summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-01-17 17:07:13 +0000
committerkib <kib@FreeBSD.org>2012-01-17 17:07:13 +0000
commit69f3e63a09d0bf9cf5040a94480ab69a27962f72 (patch)
tree44dda2232a798ac1a0f380e2d7f719b24fb94aa7
parent8999bd2861cb515c00c0dd3f8273f7e761e0bce4 (diff)
downloadFreeBSD-src-69f3e63a09d0bf9cf5040a94480ab69a27962f72.zip
FreeBSD-src-69f3e63a09d0bf9cf5040a94480ab69a27962f72.tar.gz
Add definitions for the FPU extended state header, legacy extended
state and AVX state. MFC after: 1 week
-rw-r--r--sys/amd64/include/fpu.h22
-rw-r--r--sys/i386/include/npx.h27
2 files changed, 49 insertions, 0 deletions
diff --git a/sys/amd64/include/fpu.h b/sys/amd64/include/fpu.h
index cef2108..1e7103e 100644
--- a/sys/amd64/include/fpu.h
+++ b/sys/amd64/include/fpu.h
@@ -78,6 +78,28 @@ struct savefpu {
uint8_t sv_pad[96];
} __aligned(16);
+struct xstate_hdr {
+ uint64_t xstate_bv;
+ uint8_t xstate_rsrv0[16];
+ uint8_t xstate_rsrv[40];
+};
+
+struct savefpu_xstate {
+ struct xstate_hdr sx_hd;
+ struct ymmacc sx_ymm[16];
+};
+
+struct savefpu_ymm {
+ struct envxmm sv_env;
+ struct {
+ struct fpacc87 fp_acc;
+ int8_t fp_pad[6]; /* padding */
+ } sv_fp[8];
+ struct xmmacc sv_xmm[16];
+ uint8_t sv_pad[96];
+ struct savefpu_xstate sv_xstate;
+} __aligned(64);
+
#ifdef _KERNEL
struct fpu_kern_ctx {
struct savefpu hwstate;
diff --git a/sys/i386/include/npx.h b/sys/i386/include/npx.h
index 6b56bb4..d7ead54 100644
--- a/sys/i386/include/npx.h
+++ b/sys/i386/include/npx.h
@@ -101,6 +101,11 @@ struct xmmacc {
u_char xmm_bytes[16];
};
+/* Contents of the upper 16 bytes of each AVX extended accumulator */
+struct ymmacc {
+ uint8_t ymm_bytes[16];
+};
+
struct savexmm {
struct envxmm sv_env;
struct {
@@ -116,6 +121,28 @@ union savefpu {
struct savexmm sv_xmm;
};
+struct xstate_hdr {
+ uint64_t xstate_bv;
+ uint8_t xstate_rsrv0[16];
+ uint8_t xstate_rsrv[40];
+};
+
+struct savexmm_xstate {
+ struct xstate_hdr sx_hd;
+ struct ymmacc sx_ymm[16];
+};
+
+struct savexmm_ymm {
+ struct envxmm sv_env;
+ struct {
+ struct fpacc87 fp_acc;
+ int8_t fp_pad[6]; /* padding */
+ } sv_fp[8];
+ struct xmmacc sv_xmm[16];
+ uint8_t sv_pad[96];
+ struct savexmm_xstate sv_xstate;
+} __aligned(64);
+
/*
* The hardware default control word for i387's and later coprocessors is
* 0x37F, giving:
OpenPOWER on IntegriCloud