diff options
author | kib <kib@FreeBSD.org> | 2010-06-05 15:59:59 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-06-05 15:59:59 +0000 |
commit | 2d77212fe48ecc0a97a3c56ca4cb8dc37493a066 (patch) | |
tree | bcc333531405cbc8269cbb94116e1781440b2ed4 /sys/i386/include/pcb.h | |
parent | fbdcfea8cb5a809b733223e1c53a383040e1dc4b (diff) | |
download | FreeBSD-src-2d77212fe48ecc0a97a3c56ca4cb8dc37493a066.zip FreeBSD-src-2d77212fe48ecc0a97a3c56ca4cb8dc37493a066.tar.gz |
Introduce the x86 kernel interfaces to allow kernel code to use
FPU/SSE hardware. Caller should provide a save area that is chained
into the stack of the areas; pcb save_area for usermode FPU state is
on top. The pcb now contains a pointer to the current FPU saved area,
used during FPUDNA handling and context switches. There is also a
facility to allow the kernel thread to use pcb save_area.
Change the dreaded warnings "npxdna in kernel mode!" into the panics
when FPU usage is not registered.
KPI discussed with: fabient
Tested by: pho, fabient
Hardware provided by: Sentex Communications
MFC after: 1 month
Diffstat (limited to 'sys/i386/include/pcb.h')
-rw-r--r-- | sys/i386/include/pcb.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/i386/include/pcb.h b/sys/i386/include/pcb.h index 17c8486..465f497 100644 --- a/sys/i386/include/pcb.h +++ b/sys/i386/include/pcb.h @@ -60,7 +60,7 @@ struct pcb { int pcb_dr6; int pcb_dr7; - union savefpu pcb_save; + union savefpu pcb_user_save; uint16_t pcb_initial_npxcw; u_int pcb_flags; #define FP_SOFTFP 0x01 /* process using software fltng pnt emulator */ @@ -68,6 +68,8 @@ struct pcb { #define PCB_NPXTRAP 0x04 /* npx trap pending */ #define PCB_NPXINITDONE 0x08 /* fpu state is initialized */ #define PCB_VM86CALL 0x10 /* in vm86 call */ +#define PCB_NPXUSERINITDONE 0x20 /* user fpu state is initialized */ +#define PCB_KERNNPX 0x40 /* kernel uses npx */ caddr_t pcb_onfault; /* copyin/out fault recovery */ int pcb_gs; @@ -76,6 +78,7 @@ struct pcb { struct pcb_ext *pcb_ext; /* optional pcb extension */ int pcb_psl; /* process status long */ u_long pcb_vm86[2]; /* vm86bios scratch space */ + union savefpu *pcb_save; }; #ifdef _KERNEL |