Home | History | Annotate | Line # | Download | only in include
sysarch.h revision 1.16.6.1
      1 /*	$NetBSD: sysarch.h,v 1.16.6.1 2006/04/22 11:37:33 simonb Exp $	*/
      2 
      3 #ifndef _I386_SYSARCH_H_
      4 #define _I386_SYSARCH_H_
      5 
      6 /*
      7  * Architecture specific syscalls (i386)
      8  */
      9 #define I386_GET_LDT	0
     10 #define I386_SET_LDT	1
     11 #define	I386_IOPL	2
     12 #define	I386_GET_IOPERM	3
     13 #define	I386_SET_IOPERM	4
     14 #define	I386_OLD_VM86	5
     15 #define	I386_PMC_INFO	8
     16 #define	I386_PMC_STARTSTOP 9
     17 #define	I386_PMC_READ	10
     18 #define I386_GET_MTRR	11
     19 #define I386_SET_MTRR	12
     20 #define	I386_VM86	13
     21 
     22 struct i386_get_ldt_args {
     23 	int start;
     24 	union descriptor *desc;
     25 	int num;
     26 };
     27 
     28 struct i386_set_ldt_args {
     29 	int start;
     30 	union descriptor *desc;
     31 	int num;
     32 };
     33 
     34 struct i386_get_mtrr_args {
     35 	struct mtrr *mtrrp;
     36 	int *n;
     37 };
     38 
     39 struct i386_set_mtrr_args {
     40 	struct mtrr *mtrrp;
     41 	int *n;
     42 };
     43 
     44 struct i386_iopl_args {
     45 	int iopl;
     46 };
     47 
     48 struct i386_get_ioperm_args {
     49 	u_long *iomap;
     50 };
     51 
     52 struct i386_set_ioperm_args {
     53 	u_long *iomap;
     54 };
     55 
     56 struct i386_pmc_info_args {
     57 	int	type;
     58 	int	flags;
     59 };
     60 
     61 #define	PMC_TYPE_NONE		0
     62 #define	PMC_TYPE_I586		1
     63 #define	PMC_TYPE_I686		2
     64 #define	PMC_TYPE_K7		3
     65 
     66 #define	PMC_INFO_HASTSC		0x01
     67 
     68 #define	PMC_NCOUNTERS		4
     69 
     70 struct i386_pmc_startstop_args {
     71 	int counter;
     72 	uint64_t val;
     73 	uint8_t event;
     74 	uint8_t unit;
     75 	uint8_t compare;
     76 	uint8_t flags;
     77 };
     78 
     79 #define	PMC_SETUP_KERNEL	0x01
     80 #define	PMC_SETUP_USER		0x02
     81 #define	PMC_SETUP_EDGE		0x04
     82 #define	PMC_SETUP_INV		0x08
     83 
     84 struct i386_pmc_read_args {
     85 	int counter;
     86 	uint64_t val;
     87 	uint64_t time;
     88 };
     89 
     90 struct mtrr;
     91 
     92 #ifndef _KERNEL
     93 #include <sys/cdefs.h>
     94 
     95 __BEGIN_DECLS
     96 int i386_get_ldt(int, union descriptor *, int);
     97 int i386_set_ldt(int, union descriptor *, int);
     98 int i386_iopl(int);
     99 int i386_pmc_info(struct i386_pmc_info_args *);
    100 int i386_pmc_startstop(struct i386_pmc_startstop_args *);
    101 int i386_pmc_read(struct i386_pmc_read_args *);
    102 int i386_set_mtrr(struct mtrr *, int *);
    103 int i386_get_mtrr(struct mtrr *, int *);
    104 int sysarch(int, void *);
    105 __END_DECLS
    106 #endif
    107 
    108 #endif /* !_I386_SYSARCH_H_ */
    109