Home | History | Annotate | Line # | Download | only in include
netbsd32_machdep.h revision 1.9
      1  1.9      cube /*	$NetBSD: netbsd32_machdep.h,v 1.9 2006/03/12 20:25:25 cube Exp $	*/
      2  1.1      fvdl 
      3  1.1      fvdl #ifndef _MACHINE_NETBSD32_H_
      4  1.1      fvdl #define _MACHINE_NETBSD32_H_
      5  1.1      fvdl 
      6  1.4      fvdl #include <sys/ucontext.h>
      7  1.6       chs #include <compat/sys/ucontext.h>
      8  1.7       chs #include <compat/sys/siginfo.h>
      9  1.4      fvdl 
     10  1.1      fvdl typedef	u_int32_t netbsd32_pointer_t;
     11  1.1      fvdl #define	NETBSD32PTR64(p32)	((void *)(u_long)(u_int)(p32))
     12  1.1      fvdl 
     13  1.1      fvdl typedef netbsd32_pointer_t netbsd32_sigcontextp_t;
     14  1.1      fvdl 
     15  1.1      fvdl struct netbsd32_sigcontext13 {
     16  1.4      fvdl 	uint32_t	sc_gs;
     17  1.4      fvdl 	uint32_t	sc_fs;
     18  1.4      fvdl 	uint32_t	sc_es;
     19  1.4      fvdl 	uint32_t	sc_ds;
     20  1.4      fvdl 	uint32_t	sc_edi;
     21  1.4      fvdl 	uint32_t	sc_esi;
     22  1.4      fvdl 	uint32_t	sc_ebp;
     23  1.4      fvdl 	uint32_t	sc_ebx;
     24  1.4      fvdl 	uint32_t	sc_edx;
     25  1.4      fvdl 	uint32_t	sc_ecx;
     26  1.4      fvdl 	uint32_t	sc_eax;
     27  1.1      fvdl 	/* XXX */
     28  1.4      fvdl 	uint32_t	sc_eip;
     29  1.4      fvdl 	uint32_t	sc_cs;
     30  1.4      fvdl 	uint32_t	sc_eflags;
     31  1.4      fvdl 	uint32_t	sc_esp;
     32  1.4      fvdl 	uint32_t	sc_ss;
     33  1.1      fvdl 
     34  1.4      fvdl 	uint32_t	sc_onstack;	/* sigstack state to restore */
     35  1.4      fvdl 	uint32_t	sc_mask;	/* signal mask to restore (old style) */
     36  1.1      fvdl 
     37  1.4      fvdl 	uint32_t	sc_trapno;	/* XXX should be above */
     38  1.4      fvdl 	uint32_t	sc_err;
     39  1.1      fvdl };
     40  1.1      fvdl 
     41  1.1      fvdl struct netbsd32_sigcontext {
     42  1.4      fvdl 	uint32_t	sc_gs;
     43  1.4      fvdl 	uint32_t	sc_fs;
     44  1.4      fvdl 	uint32_t	sc_es;
     45  1.4      fvdl 	uint32_t	sc_ds;
     46  1.4      fvdl 	uint32_t	sc_edi;
     47  1.4      fvdl 	uint32_t	sc_esi;
     48  1.4      fvdl 	uint32_t	sc_ebp;
     49  1.4      fvdl 	uint32_t	sc_ebx;
     50  1.4      fvdl 	uint32_t	sc_edx;
     51  1.4      fvdl 	uint32_t	sc_ecx;
     52  1.4      fvdl 	uint32_t	sc_eax;
     53  1.1      fvdl 	/* XXX */
     54  1.4      fvdl 	uint32_t	sc_eip;
     55  1.4      fvdl 	uint32_t	sc_cs;
     56  1.4      fvdl 	uint32_t	sc_eflags;
     57  1.4      fvdl 	uint32_t	sc_esp;
     58  1.4      fvdl 	uint32_t	sc_ss;
     59  1.1      fvdl 
     60  1.4      fvdl 	uint32_t	sc_onstack;	/* sigstack state to restore */
     61  1.4      fvdl 	uint32_t	__sc_mask13;	/* signal mask to restore (old style) */
     62  1.1      fvdl 
     63  1.4      fvdl 	uint32_t	sc_trapno;	/* XXX should be above */
     64  1.4      fvdl 	uint32_t	sc_err;
     65  1.1      fvdl 
     66  1.1      fvdl 	sigset_t sc_mask;		/* signal mask to restore (new style) */
     67  1.1      fvdl };
     68  1.1      fvdl 
     69  1.1      fvdl #define sc_sp sc_esp
     70  1.1      fvdl #define sc_fp sc_ebp
     71  1.1      fvdl #define sc_pc sc_eip
     72  1.1      fvdl #define sc_ps sc_eflags
     73  1.1      fvdl 
     74  1.4      fvdl struct netbsd32_sigframe_sigcontext {
     75  1.4      fvdl 	uint32_t	sf_ra;
     76  1.4      fvdl 	int32_t		sf_signum;
     77  1.4      fvdl 	int32_t		sf_code;
     78  1.4      fvdl 	uint32_t	sf_scp;
     79  1.4      fvdl 	struct netbsd32_sigcontext sf_sc;
     80  1.4      fvdl };
     81  1.4      fvdl 
     82  1.4      fvdl struct netbsd32_sigframe_siginfo {
     83  1.4      fvdl 	uint32_t	sf_ra;
     84  1.4      fvdl 	int32_t		sf_signum;
     85  1.4      fvdl 	uint32_t	sf_sip;
     86  1.4      fvdl 	uint32_t	sf_ucp;
     87  1.4      fvdl 	siginfo32_t	sf_si;
     88  1.4      fvdl 	ucontext32_t	sf_uc;
     89  1.1      fvdl };
     90  1.1      fvdl 
     91  1.1      fvdl struct reg32 {
     92  1.1      fvdl 	int	r_eax;
     93  1.1      fvdl 	int	r_ecx;
     94  1.1      fvdl 	int	r_edx;
     95  1.1      fvdl 	int	r_ebx;
     96  1.1      fvdl 	int	r_esp;
     97  1.1      fvdl 	int	r_ebp;
     98  1.1      fvdl 	int	r_esi;
     99  1.1      fvdl 	int	r_edi;
    100  1.1      fvdl 	int	r_eip;
    101  1.1      fvdl 	int	r_eflags;
    102  1.1      fvdl 	int	r_cs;
    103  1.1      fvdl 	int	r_ss;
    104  1.1      fvdl 	int	r_ds;
    105  1.1      fvdl 	int	r_es;
    106  1.1      fvdl 	int	r_fs;
    107  1.1      fvdl 	int	r_gs;
    108  1.1      fvdl };
    109  1.1      fvdl 
    110  1.1      fvdl struct fpreg32 {
    111  1.1      fvdl 	char	__data[108];
    112  1.1      fvdl };
    113  1.1      fvdl 
    114  1.1      fvdl struct mtrr32 {
    115  1.1      fvdl 	uint64_t base;
    116  1.1      fvdl 	uint64_t len;
    117  1.1      fvdl 	uint8_t type;
    118  1.1      fvdl 	uint8_t __pad0[3];
    119  1.1      fvdl 	int flags;
    120  1.1      fvdl 	uint32_t owner;
    121  1.1      fvdl } __attribute__((packed));
    122  1.1      fvdl 
    123  1.1      fvdl struct x86_64_get_mtrr_args32 {
    124  1.1      fvdl 	uint32_t mtrrp;
    125  1.1      fvdl 	uint32_t n;
    126  1.1      fvdl };
    127  1.1      fvdl 
    128  1.1      fvdl struct x86_64_set_mtrr_args32 {
    129  1.1      fvdl 	uint32_t mtrrp;
    130  1.1      fvdl 	uint32_t n;
    131  1.1      fvdl };
    132  1.1      fvdl 
    133  1.9      cube struct env87 {
    134  1.9      cube 	int32_t		en_cw;
    135  1.9      cube 	int32_t		en_sw;
    136  1.9      cube 	int32_t		en_tw;
    137  1.9      cube 	int32_t		en_fip;
    138  1.9      cube 	uint16_t	en_fcs;
    139  1.9      cube 	uint16_t	en_opcode;
    140  1.9      cube 	int32_t		en_foo;
    141  1.9      cube 	int32_t		en_fos;
    142  1.9      cube } __attribute__((packed));
    143  1.9      cube 
    144  1.9      cube struct fpacc87 {
    145  1.9      cube 	uint8_t 	fp_bytes[10];
    146  1.9      cube } __attribute__((packed));
    147  1.9      cube 
    148  1.9      cube struct save87 {
    149  1.9      cube 	struct env87	sv_env;
    150  1.9      cube 	struct fpacc87	sv_ac[8];
    151  1.9      cube 	int32_t		sv_ex_sw;
    152  1.9      cube 	int32_t		sv_ex_tw;
    153  1.9      cube 	uint8_t		sv_pad[8 * 2 - 2 * 4];
    154  1.9      cube } __attribute__((packed));
    155  1.9      cube 
    156  1.5  drochner #define NETBSD32_MID_MACHINE MID_I386
    157  1.5  drochner 
    158  1.9      cube int netbsd32_process_read_regs(struct lwp *, struct reg32 *);
    159  1.9      cube int netbsd32_process_read_fpregs(struct lwp *, struct fpreg32 *);
    160  1.9      cube 
    161  1.1      fvdl #endif /* _MACHINE_NETBSD32_H_ */
    162