2 * FreeBSD arm register structures
4 * Copyright (c) 2015 Stacey Son
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef TARGET_ARCH_REG_H
21 #define TARGET_ARCH_REG_H
23 /* See sys/arm/include/reg.h */
24 typedef struct target_reg
{
32 typedef struct target_fp_reg
{
34 uint32_t fp_mantissa_hi
;
35 u_int32_t fp_mantissa_lo
;
38 typedef struct target_fpreg
{
40 target_fp_reg_t fpr
[8];
43 #define tswapreg(ptr) tswapal(ptr)
45 static inline void target_copy_regs(target_reg_t
*regs
, const CPUARMState
*env
)
49 for (i
= 0; i
< 13; i
++) {
50 regs
->r
[i
] = tswapreg(env
->regs
[i
+ 1]);
52 regs
->r_sp
= tswapreg(env
->regs
[13]);
53 regs
->r_lr
= tswapreg(env
->regs
[14]);
54 regs
->r_pc
= tswapreg(env
->regs
[15]);
55 regs
->r_cpsr
= tswapreg(cpsr_read((CPUARMState
*)env
));
60 #endif /* TARGET_ARCH_REG_H */