Home | History | Annotate | Line # | Download | only in include
netbsd32_machdep.h revision 1.6
      1 /*	$NetBSD: netbsd32_machdep.h,v 1.6 2005/09/14 16:19:27 chs 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 
      9 typedef	u_int32_t netbsd32_pointer_t;
     10 #define	NETBSD32PTR64(p32)	((void *)(u_long)(u_int)(p32))
     11 
     12 typedef netbsd32_pointer_t netbsd32_sigcontextp_t;
     13 
     14 struct netbsd32_sigcontext13 {
     15 	uint32_t	sc_gs;
     16 	uint32_t	sc_fs;
     17 	uint32_t	sc_es;
     18 	uint32_t	sc_ds;
     19 	uint32_t	sc_edi;
     20 	uint32_t	sc_esi;
     21 	uint32_t	sc_ebp;
     22 	uint32_t	sc_ebx;
     23 	uint32_t	sc_edx;
     24 	uint32_t	sc_ecx;
     25 	uint32_t	sc_eax;
     26 	/* XXX */
     27 	uint32_t	sc_eip;
     28 	uint32_t	sc_cs;
     29 	uint32_t	sc_eflags;
     30 	uint32_t	sc_esp;
     31 	uint32_t	sc_ss;
     32 
     33 	uint32_t	sc_onstack;	/* sigstack state to restore */
     34 	uint32_t	sc_mask;	/* signal mask to restore (old style) */
     35 
     36 	uint32_t	sc_trapno;	/* XXX should be above */
     37 	uint32_t	sc_err;
     38 };
     39 
     40 struct netbsd32_sigcontext {
     41 	uint32_t	sc_gs;
     42 	uint32_t	sc_fs;
     43 	uint32_t	sc_es;
     44 	uint32_t	sc_ds;
     45 	uint32_t	sc_edi;
     46 	uint32_t	sc_esi;
     47 	uint32_t	sc_ebp;
     48 	uint32_t	sc_ebx;
     49 	uint32_t	sc_edx;
     50 	uint32_t	sc_ecx;
     51 	uint32_t	sc_eax;
     52 	/* XXX */
     53 	uint32_t	sc_eip;
     54 	uint32_t	sc_cs;
     55 	uint32_t	sc_eflags;
     56 	uint32_t	sc_esp;
     57 	uint32_t	sc_ss;
     58 
     59 	uint32_t	sc_onstack;	/* sigstack state to restore */
     60 	uint32_t	__sc_mask13;	/* signal mask to restore (old style) */
     61 
     62 	uint32_t	sc_trapno;	/* XXX should be above */
     63 	uint32_t	sc_err;
     64 
     65 	sigset_t sc_mask;		/* signal mask to restore (new style) */
     66 };
     67 
     68 #define sc_sp sc_esp
     69 #define sc_fp sc_ebp
     70 #define sc_pc sc_eip
     71 #define sc_ps sc_eflags
     72 
     73 struct netbsd32_sigframe_sigcontext {
     74 	uint32_t	sf_ra;
     75 	int32_t		sf_signum;
     76 	int32_t		sf_code;
     77 	uint32_t	sf_scp;
     78 	struct netbsd32_sigcontext sf_sc;
     79 };
     80 
     81 struct netbsd32_sigframe_siginfo {
     82 	uint32_t	sf_ra;
     83 	int32_t		sf_signum;
     84 	uint32_t	sf_sip;
     85 	uint32_t	sf_ucp;
     86 	siginfo32_t	sf_si;
     87 	ucontext32_t	sf_uc;
     88 };
     89 
     90 struct reg32 {
     91 	int	r_eax;
     92 	int	r_ecx;
     93 	int	r_edx;
     94 	int	r_ebx;
     95 	int	r_esp;
     96 	int	r_ebp;
     97 	int	r_esi;
     98 	int	r_edi;
     99 	int	r_eip;
    100 	int	r_eflags;
    101 	int	r_cs;
    102 	int	r_ss;
    103 	int	r_ds;
    104 	int	r_es;
    105 	int	r_fs;
    106 	int	r_gs;
    107 };
    108 
    109 struct fpreg32 {
    110 	char	__data[108];
    111 };
    112 
    113 struct mtrr32 {
    114 	uint64_t base;
    115 	uint64_t len;
    116 	uint8_t type;
    117 	uint8_t __pad0[3];
    118 	int flags;
    119 	uint32_t owner;
    120 } __attribute__((packed));
    121 
    122 struct x86_64_get_mtrr_args32 {
    123 	uint32_t mtrrp;
    124 	uint32_t n;
    125 };
    126 
    127 struct x86_64_set_mtrr_args32 {
    128 	uint32_t mtrrp;
    129 	uint32_t n;
    130 };
    131 
    132 #define NETBSD32_MID_MACHINE MID_I386
    133 
    134 #endif /* _MACHINE_NETBSD32_H_ */
    135