1 1.11.12.1 gehenna /* $NetBSD: sysarch.h,v 1.11.12.1 2002/07/14 17:48:01 gehenna Exp $ */ 2 1.3 cgd 3 1.2 mycroft #ifndef _I386_SYSARCH_H_ 4 1.2 mycroft #define _I386_SYSARCH_H_ 5 1.2 mycroft 6 1.1 brezak /* 7 1.1 brezak * Architecture specific syscalls (i386) 8 1.1 brezak */ 9 1.1 brezak #define I386_GET_LDT 0 10 1.1 brezak #define I386_SET_LDT 1 11 1.7 mycroft #define I386_IOPL 2 12 1.7 mycroft #define I386_GET_IOPERM 3 13 1.7 mycroft #define I386_SET_IOPERM 4 14 1.8 mycroft #define I386_VM86 5 15 1.10 thorpej #define I386_PMC_INFO 8 16 1.10 thorpej #define I386_PMC_STARTSTOP 9 17 1.10 thorpej #define I386_PMC_READ 10 18 1.11 fvdl #define I386_GET_MTRR 11 19 1.11 fvdl #define I386_SET_MTRR 12 20 1.5 mycroft 21 1.5 mycroft struct i386_get_ldt_args { 22 1.5 mycroft int start; 23 1.5 mycroft union descriptor *desc; 24 1.5 mycroft int num; 25 1.5 mycroft }; 26 1.5 mycroft 27 1.5 mycroft struct i386_set_ldt_args { 28 1.5 mycroft int start; 29 1.5 mycroft union descriptor *desc; 30 1.5 mycroft int num; 31 1.5 mycroft }; 32 1.1 brezak 33 1.11 fvdl struct i386_get_mtrr_args { 34 1.11 fvdl struct mtrr *mtrrp; 35 1.11 fvdl int *n; 36 1.11 fvdl }; 37 1.11 fvdl 38 1.11 fvdl struct i386_set_mtrr_args { 39 1.11 fvdl struct mtrr *mtrrp; 40 1.11 fvdl int *n; 41 1.11 fvdl }; 42 1.11 fvdl 43 1.7 mycroft struct i386_iopl_args { 44 1.7 mycroft int iopl; 45 1.7 mycroft }; 46 1.7 mycroft 47 1.7 mycroft struct i386_get_ioperm_args { 48 1.7 mycroft u_long *iomap; 49 1.7 mycroft }; 50 1.7 mycroft 51 1.7 mycroft struct i386_set_ioperm_args { 52 1.7 mycroft u_long *iomap; 53 1.7 mycroft }; 54 1.7 mycroft 55 1.10 thorpej struct i386_pmc_info_args { 56 1.10 thorpej int type; 57 1.10 thorpej int flags; 58 1.10 thorpej }; 59 1.10 thorpej 60 1.10 thorpej #define PMC_TYPE_NONE 0 61 1.10 thorpej #define PMC_TYPE_I586 1 62 1.10 thorpej #define PMC_TYPE_I686 2 63 1.11.12.1 gehenna #define PMC_TYPE_K7 3 64 1.10 thorpej 65 1.10 thorpej #define PMC_INFO_HASTSC 0x01 66 1.10 thorpej 67 1.11.12.1 gehenna #define PMC_NCOUNTERS 4 68 1.10 thorpej 69 1.10 thorpej struct i386_pmc_startstop_args { 70 1.10 thorpej int counter; 71 1.10 thorpej u_int64_t val; 72 1.10 thorpej u_int8_t event; 73 1.10 thorpej u_int8_t unit; 74 1.10 thorpej u_int8_t compare; 75 1.10 thorpej u_int8_t flags; 76 1.10 thorpej }; 77 1.10 thorpej 78 1.10 thorpej #define PMC_SETUP_KERNEL 0x01 79 1.10 thorpej #define PMC_SETUP_USER 0x02 80 1.10 thorpej #define PMC_SETUP_EDGE 0x04 81 1.10 thorpej #define PMC_SETUP_INV 0x08 82 1.10 thorpej 83 1.10 thorpej struct i386_pmc_read_args { 84 1.10 thorpej int counter; 85 1.10 thorpej u_int64_t val; 86 1.10 thorpej u_int64_t time; 87 1.10 thorpej }; 88 1.10 thorpej 89 1.11 fvdl struct mtrr; 90 1.11 fvdl 91 1.4 jtc #ifndef _KERNEL 92 1.1 brezak int i386_get_ldt __P((int, union descriptor *, int)); 93 1.1 brezak int i386_set_ldt __P((int, union descriptor *, int)); 94 1.7 mycroft int i386_iopl __P((int)); 95 1.7 mycroft int i386_get_ioperm __P((u_long *)); 96 1.7 mycroft int i386_set_ioperm __P((u_long *)); 97 1.10 thorpej int i386_pmc_info __P((struct i386_pmc_info_args *)); 98 1.10 thorpej int i386_pmc_startstop __P((struct i386_pmc_startstop_args *)); 99 1.10 thorpej int i386_pmc_read __P((struct i386_pmc_read_args *)); 100 1.11 fvdl int i386_set_mtrr __P((struct mtrr *, int *)); 101 1.11 fvdl int i386_get_mtrr __P((struct mtrr *, int *)); 102 1.9 perry int sysarch __P((int, void *)); 103 1.1 brezak #endif 104 1.2 mycroft 105 1.2 mycroft #endif /* !_I386_SYSARCH_H_ */ 106