netbsd32_machdep.h revision 1.3
11.3Srin/*	$NetBSD: netbsd32_machdep.h,v 1.3 2019/11/24 04:08:36 rin Exp $	*/
21.1Sryo
31.1Sryo#ifndef _MACHINE_NETBSD32_H_
41.1Sryo#define _MACHINE_NETBSD32_H_
51.1Sryo
61.1Sryo#include <sys/ucontext.h>
71.1Sryo#include <compat/sys/ucontext.h>
81.1Sryo#include <compat/sys/siginfo.h>
91.1Sryo
101.1Sryo#define NETBSD32_POINTER_TYPE uint32_t
111.1Sryotypedef	struct { NETBSD32_POINTER_TYPE i32; } netbsd32_pointer_t;
121.1Sryo
131.1Sryo/* earm has 64bit aligned 64bit integers */
141.1Sryo#define NETBSD32_INT64_ALIGN __attribute__((__aligned__(8)))
151.1Sryo
161.1Sryotypedef netbsd32_pointer_t netbsd32_sigcontextp_t;
171.1Sryo
181.1Sryostruct netbsd32_sigcontext13 {
191.1Sryo	int32_t		sc_onstack;		/* sigstack state to restore */
201.1Sryo	int32_t		__sc_mask13;		/* signal mask to restore (old style) */
211.1Sryo
221.1Sryo	uint32_t	sc_spsr;
231.1Sryo	uint32_t	sc_r0;
241.1Sryo	uint32_t	sc_r1;
251.1Sryo	uint32_t	sc_r2;
261.1Sryo	uint32_t	sc_r3;
271.1Sryo	uint32_t	sc_r4;
281.1Sryo	uint32_t	sc_r5;
291.1Sryo	uint32_t	sc_r6;
301.1Sryo	uint32_t	sc_r7;
311.1Sryo	uint32_t	sc_r8;
321.1Sryo	uint32_t	sc_r9;
331.1Sryo	uint32_t	sc_r10;
341.1Sryo	uint32_t	sc_r11;
351.1Sryo	uint32_t	sc_r12;
361.1Sryo	uint32_t	sc_usr_sp;
371.1Sryo	uint32_t	sc_usr_lr;
381.1Sryo	uint32_t	sc_svc_lr;
391.1Sryo	uint32_t	sc_pc;
401.1Sryo};
411.1Sryo
421.1Sryostruct netbsd32_sigcontext {
431.1Sryo	int32_t		sc_onstack;		/* sigstack state to restore */
441.1Sryo	int32_t		__sc_mask13;		/* signal mask to restore (old style) */
451.1Sryo
461.1Sryo	uint32_t	sc_spsr;
471.1Sryo	uint32_t	sc_r0;
481.1Sryo	uint32_t	sc_r1;
491.1Sryo	uint32_t	sc_r2;
501.1Sryo	uint32_t	sc_r3;
511.1Sryo	uint32_t	sc_r4;
521.1Sryo	uint32_t	sc_r5;
531.1Sryo	uint32_t	sc_r6;
541.1Sryo	uint32_t	sc_r7;
551.1Sryo	uint32_t	sc_r8;
561.1Sryo	uint32_t	sc_r9;
571.1Sryo	uint32_t	sc_r10;
581.1Sryo	uint32_t	sc_r11;
591.1Sryo	uint32_t	sc_r12;
601.1Sryo	uint32_t	sc_usr_sp;
611.1Sryo	uint32_t	sc_usr_lr;
621.1Sryo	uint32_t	sc_svc_lr;
631.1Sryo	uint32_t	sc_pc;
641.1Sryo
651.1Sryo	sigset_t	sc_mask;		/* signal mask to restore (new style) */
661.1Sryo};
671.1Sryo
681.2Sryostruct netbsd32_sigframe_siginfo {
691.2Sryo	siginfo32_t sf_si;
701.2Sryo	ucontext32_t sf_uc;
711.2Sryo};
721.2Sryo
731.2Sryostruct reg32 {
741.2Sryo	uint32_t r[13];
751.2Sryo	uint32_t r_sp;
761.2Sryo	uint32_t r_lr;
771.2Sryo	uint32_t r_pc;
781.2Sryo	uint32_t r_cpsr;
791.2Sryo};
801.2Sryo
811.2Sryostruct vfpreg32 {
821.2Sryo	uint32_t vfp_fpexc;
831.2Sryo	uint32_t vfp_fpscr;
841.2Sryo	uint32_t vfp_fpinst;
851.2Sryo	uint32_t vfp_fpinst2;
861.2Sryo	uint64_t vfp_regs[33];	/* In case we need fstmx format. */
871.2Sryo};
881.2Sryo
891.2Sryostruct fpreg32 {
901.2Sryo	struct vfpreg32 fpr_vfp;
911.2Sryo};
921.2Sryo
931.2Sryo/* same as cpustate in arm/arm/core_machdep.c  */
941.2Sryostruct netbsd32_cpustate {
951.2Sryo	struct reg32 regs;
961.2Sryo	struct fpreg32 fpregs;
971.2Sryo};
981.2Sryo
991.2Sryo/* compat netbsd/arm sysarch(2) */
1001.2Sryo#define ARM_SYNC_ICACHE		0
1011.2Sryo#define ARM_DRAIN_WRITEBUF	1
1021.2Sryo#define ARM_VFP_FPSCR		2
1031.2Sryo#define ARM_FPU_USED		3
1041.2Sryo
1051.2Sryostruct netbsd32_arm_sync_icache_args {
1061.2Sryo	netbsd32_uintptr_t addr;	/* Virtual start address */
1071.2Sryo	netbsd32_size_t len;		/* Region size */
1081.2Sryo};
1091.1Sryo
1101.3Srin/* Support varying ABI names for netbsd32 */
1111.3Srin#define PROC_MACHINE_ARCH32(P)	((P)->p_md.md_march32)
1121.3Srin
1131.1Sryo#endif /* _MACHINE_NETBSD32_H_ */
114