summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/pcb.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-06-05 15:59:59 +0000
committerkib <kib@FreeBSD.org>2010-06-05 15:59:59 +0000
commit2d77212fe48ecc0a97a3c56ca4cb8dc37493a066 (patch)
treebcc333531405cbc8269cbb94116e1781440b2ed4 /sys/amd64/include/pcb.h
parentfbdcfea8cb5a809b733223e1c53a383040e1dc4b (diff)
downloadFreeBSD-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/amd64/include/pcb.h')
-rw-r--r--sys/amd64/include/pcb.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h
index b26188a..aead8b7 100644
--- a/sys/amd64/include/pcb.h
+++ b/sys/amd64/include/pcb.h
@@ -57,7 +57,9 @@ struct pcb {
register_t pcb_gsbase;
u_long pcb_flags;
#define PCB_DBREGS 0x02 /* process using debug registers */
+#define PCB_KERNFPU 0x04 /* kernel uses fpu */
#define PCB_FPUINITDONE 0x08 /* fpu state is initialized */
+#define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */
#define PCB_GS32BIT 0x20 /* linux gs switch */
#define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */
#define PCB_FULLCTX 0x80 /* full context restore on sysret */
@@ -69,7 +71,7 @@ struct pcb {
u_int64_t pcb_dr6;
u_int64_t pcb_dr7;
- struct savefpu pcb_save;
+ struct savefpu pcb_user_save;
uint16_t pcb_initial_fpucw;
caddr_t pcb_onfault; /* copyin/out fault recovery */
@@ -78,6 +80,7 @@ struct pcb {
struct user_segment_descriptor pcb_gs32sd;
/* local tss, with i/o bitmap; NULL for common */
struct amd64tss *pcb_tssp;
+ struct savefpu *pcb_save;
char pcb_full_iret;
};
OpenPOWER on IntegriCloud