reg.h revision 280711
1280711Sandrew/*- 2280711Sandrew * Copyright (c) 2014 Andrew Turner 3280711Sandrew * Copyright (c) 2014-2015 The FreeBSD Foundation 4280711Sandrew * All rights reserved. 5280711Sandrew * 6280711Sandrew * This software was developed by Andrew Turner under 7280711Sandrew * sponsorship from the FreeBSD Foundation. 8280711Sandrew * 9280711Sandrew * Redistribution and use in source and binary forms, with or without 10280711Sandrew * modification, are permitted provided that the following conditions 11280711Sandrew * are met: 12280711Sandrew * 1. Redistributions of source code must retain the above copyright 13280711Sandrew * notice, this list of conditions and the following disclaimer. 14280711Sandrew * 2. Redistributions in binary form must reproduce the above copyright 15280711Sandrew * notice, this list of conditions and the following disclaimer in the 16280711Sandrew * documentation and/or other materials provided with the distribution. 17280711Sandrew * 18280711Sandrew * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19280711Sandrew * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20280711Sandrew * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21280711Sandrew * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22280711Sandrew * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23280711Sandrew * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24280711Sandrew * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25280711Sandrew * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26280711Sandrew * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27280711Sandrew * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28280711Sandrew * SUCH DAMAGE. 29280711Sandrew * 30280711Sandrew * $FreeBSD: head/sys/arm64/include/reg.h 280711 2015-03-26 21:10:42Z andrew $ 31280711Sandrew */ 32280711Sandrew 33280711Sandrew#ifndef _MACHINE_REG_H_ 34280711Sandrew#define _MACHINE_REG_H_ 35280711Sandrew 36280711Sandrewstruct reg { 37280711Sandrew uint64_t x[30]; 38280711Sandrew uint64_t lr; 39280711Sandrew uint64_t sp; 40280711Sandrew uint64_t elr; 41280711Sandrew uint32_t spsr; 42280711Sandrew}; 43280711Sandrew 44280711Sandrewstruct fpreg { 45280711Sandrew __uint128_t fp_q[32]; 46280711Sandrew uint32_t fp_sr; 47280711Sandrew uint32_t fp_cr; 48280711Sandrew}; 49280711Sandrew 50280711Sandrewstruct dbreg { 51280711Sandrew int dummy; 52280711Sandrew}; 53280711Sandrew 54280711Sandrew#ifdef _KERNEL 55280711Sandrew/* 56280711Sandrew * XXX these interfaces are MI, so they should be declared in a MI place. 57280711Sandrew */ 58280711Sandrewint fill_regs(struct thread *, struct reg *); 59280711Sandrewint set_regs(struct thread *, struct reg *); 60280711Sandrewint fill_fpregs(struct thread *, struct fpreg *); 61280711Sandrewint set_fpregs(struct thread *, struct fpreg *); 62280711Sandrewint fill_dbregs(struct thread *, struct dbreg *); 63280711Sandrewint set_dbregs(struct thread *, struct dbreg *); 64280711Sandrew#endif 65280711Sandrew 66280711Sandrew#endif /* !_MACHINE_REG_H_ */ 67