Author: kib
Date: Tue Jan 17 17:07:13 2012
New Revision: 230270
URL: http://svn.freebsd.org/changeset/base/230270

Log:
  Add definitions for the FPU extended state header, legacy extended
  state and AVX state.
  
  MFC after:    1 week

Modified:
  head/sys/amd64/include/fpu.h
  head/sys/i386/include/npx.h

Modified: head/sys/amd64/include/fpu.h
==============================================================================
--- head/sys/amd64/include/fpu.h        Tue Jan 17 16:53:41 2012        
(r230269)
+++ head/sys/amd64/include/fpu.h        Tue Jan 17 17:07:13 2012        
(r230270)
@@ -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;

Modified: head/sys/i386/include/npx.h
==============================================================================
--- head/sys/i386/include/npx.h Tue Jan 17 16:53:41 2012        (r230269)
+++ head/sys/i386/include/npx.h Tue Jan 17 17:07:13 2012        (r230270)
@@ -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:
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to