summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-12-01 01:08:00 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-12-01 01:08:00 +0100
commit55797acc7748c15cd25891f1b84b1123aee50b3d (patch)
tree990b77b3a1b8ca5918aee3054b4d718a71902508
parent43572e94214186d6094407ec51815434ddd3e256 (diff)
x86: Move fp_reg.h static assertions to .c file
Since fp_reg.h is installed on the system, and compilers may not even support _Static_assert. * i386/include/mach/i386/fp_reg.h: Move _Static_assert to... * i386/i386/fpu.c: ... c file.
-rw-r--r--i386/i386/fpu.c3
-rw-r--r--i386/include/mach/i386/fp_reg.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index 8a971b8e..6c84725f 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -69,6 +69,9 @@
#define ASSERT_IPL(L)
#endif
+_Static_assert(sizeof(struct i386_xfp_xstate_header) == 8*8);
+_Static_assert(sizeof(struct i386_xfp_save) == 512 + 8*8);
+
int fp_kind = FP_387; /* 80387 present */
enum fp_save_kind fp_save_kind = FP_FNSAVE; /* Which instruction we use to save/restore FPU state */
uint64_t fp_xsave_support; /* Bitmap of supported XSAVE save areas */
diff --git a/i386/include/mach/i386/fp_reg.h b/i386/include/mach/i386/fp_reg.h
index 60fd8f5d..7ad0ade6 100644
--- a/i386/include/mach/i386/fp_reg.h
+++ b/i386/include/mach/i386/fp_reg.h
@@ -57,7 +57,6 @@ struct i386_xfp_xstate_header {
unsigned long long xcomp_bv;
unsigned long long reserved[6];
} __attribute__((packed, aligned(64)));
-_Static_assert(sizeof(struct i386_xfp_xstate_header) == 8*8);
struct i386_xfp_save {
unsigned short fp_control; /* control */
@@ -80,7 +79,6 @@ struct i386_xfp_save {
struct i386_xfp_xstate_header header;
unsigned char extended[0]; /* Extended region */
} __attribute__((packed, aligned(64)));
-_Static_assert(sizeof(struct i386_xfp_save) == 512 + 8*8);
/*
* Control register