typedef struct BIOS32ci BIOS32ci;
typedef struct Conf Conf;
typedef struct Confmem Confmem;
-typedef union FPsave FPsave;
-typedef struct Fxsave Fxsave;
-typedef struct FPstate FPstate;
+typedef struct FPsave FPsave;
+typedef struct PFPU PFPU;
typedef struct ISAConf ISAConf;
typedef struct Label Label;
typedef struct Lock Lock;
typedef struct MMU MMU;
typedef struct Mach Mach;
-typedef struct Notsave Notsave;
typedef struct PCArch PCArch;
typedef struct Pcidev Pcidev;
typedef struct PCMmap PCMmap;
uintptr pc;
};
-/*
- * FPsave.status
- */
-enum
+struct FPsave
{
- /* this is a state */
- FPinit= 0,
- FPactive= 1,
- FPinactive= 2,
-
- /* the following is a bit that can be or'd into the state */
- FPillegal= 0x100,
-};
-
-/*
- * the FP regs must be stored here, not somewhere pointed to from here.
- * port code assumes this.
- */
-struct Fxsave {
u16int fcw; /* x87 control word */
u16int fsw; /* x87 status word */
u8int ftw; /* x87 tag word */
uchar ign[96]; /* reserved, ignored */
};
-union FPsave {
- uchar align[512+15];
- Fxsave;
+enum
+{
+ /* this is a state */
+ FPinit= 0,
+ FPactive= 1,
+ FPinactive= 2,
+
+ /*
+ * the following are bits that can be or'd into the state.
+ *
+ * this is biased so that FPinit, FPactive and FPinactive
+ * without any flags refer to user fp state in fpslot[0].
+ */
+ FPillegal= 1<<8, /* fp forbidden in note handler */
+ FPpush= 2<<8, /* trap on use and initialize new fpslot */
+ FPnouser= 4<<8, /* fpslot[0] is kernel regs */
+ FPkernel= 8<<8, /* fp use in kernel (user in fpslot[0] when !FPnouser) */
+
+ FPindexs= 16,
+ FPindex1= 1<<FPindexs,
+ FPindexm= 3<<FPindexs,
+};
+
+struct PFPU
+{
+ int fpstate;
+ FPsave *fpsave; /* fpslot[fpstate>>FPindexs] */
+ FPsave *fpslot[(FPindexm+1)>>FPindexs];
};
struct Confmem
ulong mmucount;
u64int dr[8];
-};
-
-/*
- * things saved in the Proc structure during a notify
- */
-struct Notsave
-{
- ulong svflags;
- ulong svcs;
- ulong svss;
+ void *vmx;
};
#include "../port/portdat.h"
int cpuiddx;
char cpuidid[16];
char* cpuidtype;
+ uchar cpuidfamily;
+ uchar cpuidmodel;
+ uchar cpuidstepping;
int havetsc;
int havepge;
int havewatchpt8;
+ int havenx;
uvlong tscticks;
u64int dr7; /* shadow copy of dr7 */
+
+ void* vmx;
uintptr stack[1];
};
struct ISAConf {
char *type;
- ulong port;
+ uvlong port;
int irq;
ulong dma;
ulong mem;