aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cpu.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2016-07-06 13:35:00 -0700
committerEduardo Habkost <ehabkost@redhat.com>2016-09-19 15:34:35 -0300
commit3f32bd21df655e62eb271182a5c63280d631c7b3 (patch)
tree6edf1fb66d7ce7fdc8551a8b8e610d8a1ef63ffb /target-i386/cpu.c
parent33e1666b4289313306371fee0740f5c85517e406 (diff)
target-i386: Use struct X86XSaveArea in fpu_helper.c
This avoids a double hand-full of magic numbers in the xsave and xrstor helper functions. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r--target-i386/cpu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 5a5299ad3c..db12728abf 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -538,7 +538,12 @@ static const X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = {
};
#undef REGISTER
-const ExtSaveArea x86_ext_save_areas[] = {
+typedef struct ExtSaveArea {
+ uint32_t feature, bits;
+ uint32_t offset, size;
+} ExtSaveArea;
+
+static const ExtSaveArea x86_ext_save_areas[] = {
[XSTATE_YMM_BIT] =
{ .feature = FEAT_1_ECX, .bits = CPUID_EXT_AVX,
.offset = offsetof(X86XSaveArea, avx_state),