netbsd32_machdep.h revision 1.3
1/*	$NetBSD: netbsd32_machdep.h,v 1.3 2019/11/24 04:08:36 rin Exp $	*/
2
3#ifndef _MACHINE_NETBSD32_H_
4#define _MACHINE_NETBSD32_H_
5
6#include <sys/ucontext.h>
7#include <compat/sys/ucontext.h>
8#include <compat/sys/siginfo.h>
9
10#define NETBSD32_POINTER_TYPE uint32_t
11typedef	struct { NETBSD32_POINTER_TYPE i32; } netbsd32_pointer_t;
12
13/* earm has 64bit aligned 64bit integers */
14#define NETBSD32_INT64_ALIGN __attribute__((__aligned__(8)))
15
16typedef netbsd32_pointer_t netbsd32_sigcontextp_t;
17
18struct netbsd32_sigcontext13 {
19	int32_t		sc_onstack;		/* sigstack state to restore */
20	int32_t		__sc_mask13;		/* signal mask to restore (old style) */
21
22	uint32_t	sc_spsr;
23	uint32_t	sc_r0;
24	uint32_t	sc_r1;
25	uint32_t	sc_r2;
26	uint32_t	sc_r3;
27	uint32_t	sc_r4;
28	uint32_t	sc_r5;
29	uint32_t	sc_r6;
30	uint32_t	sc_r7;
31	uint32_t	sc_r8;
32	uint32_t	sc_r9;
33	uint32_t	sc_r10;
34	uint32_t	sc_r11;
35	uint32_t	sc_r12;
36	uint32_t	sc_usr_sp;
37	uint32_t	sc_usr_lr;
38	uint32_t	sc_svc_lr;
39	uint32_t	sc_pc;
40};
41
42struct netbsd32_sigcontext {
43	int32_t		sc_onstack;		/* sigstack state to restore */
44	int32_t		__sc_mask13;		/* signal mask to restore (old style) */
45
46	uint32_t	sc_spsr;
47	uint32_t	sc_r0;
48	uint32_t	sc_r1;
49	uint32_t	sc_r2;
50	uint32_t	sc_r3;
51	uint32_t	sc_r4;
52	uint32_t	sc_r5;
53	uint32_t	sc_r6;
54	uint32_t	sc_r7;
55	uint32_t	sc_r8;
56	uint32_t	sc_r9;
57	uint32_t	sc_r10;
58	uint32_t	sc_r11;
59	uint32_t	sc_r12;
60	uint32_t	sc_usr_sp;
61	uint32_t	sc_usr_lr;
62	uint32_t	sc_svc_lr;
63	uint32_t	sc_pc;
64
65	sigset_t	sc_mask;		/* signal mask to restore (new style) */
66};
67
68struct netbsd32_sigframe_siginfo {
69	siginfo32_t sf_si;
70	ucontext32_t sf_uc;
71};
72
73struct reg32 {
74	uint32_t r[13];
75	uint32_t r_sp;
76	uint32_t r_lr;
77	uint32_t r_pc;
78	uint32_t r_cpsr;
79};
80
81struct vfpreg32 {
82	uint32_t vfp_fpexc;
83	uint32_t vfp_fpscr;
84	uint32_t vfp_fpinst;
85	uint32_t vfp_fpinst2;
86	uint64_t vfp_regs[33];	/* In case we need fstmx format. */
87};
88
89struct fpreg32 {
90	struct vfpreg32 fpr_vfp;
91};
92
93/* same as cpustate in arm/arm/core_machdep.c  */
94struct netbsd32_cpustate {
95	struct reg32 regs;
96	struct fpreg32 fpregs;
97};
98
99/* compat netbsd/arm sysarch(2) */
100#define ARM_SYNC_ICACHE		0
101#define ARM_DRAIN_WRITEBUF	1
102#define ARM_VFP_FPSCR		2
103#define ARM_FPU_USED		3
104
105struct netbsd32_arm_sync_icache_args {
106	netbsd32_uintptr_t addr;	/* Virtual start address */
107	netbsd32_size_t len;		/* Region size */
108};
109
110/* Support varying ABI names for netbsd32 */
111#define PROC_MACHINE_ARCH32(P)	((P)->p_md.md_march32)
112
113#endif /* _MACHINE_NETBSD32_H_ */
114