x86_emulate: Shuffle use of __attribute__((packed))

Also include #defines for the test code to allow compilation.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper authored and Jan Beulich committed 2014-03-14 09:46:34 +01:00
1 parent b2f0271ef7
commit 4ef5d4c3aa
3 files changed
+8 -4

No files matched your search

@@ -7,6 +7,8 @@
#include <xen/xen.h>
#include <sys/mman.h>
#define __packed __attribute__((packed))
#include "x86_emulate/x86_emulate.h"
#include "blowfish.h"
+2
View File
@@ -14,5 +14,7 @@ typedef bool bool_t;
#define cpu_has_amd_erratum(nr) 0
#define mark_regs_dirty(r) ((void)(r))
#define __packed __attribute__((packed))
#include "x86_emulate/x86_emulate.h"
#include "x86_emulate/x86_emulate.c"
+4 -4
View File
@@ -55,7 +55,7 @@ enum x86_segment {
* Attribute for segment selector. This is a copy of bit 40:47 & 52:55 of the
* segment descriptor. It happens to match the format of an AMD SVM VMCB.
*/
typedef union segment_attributes {
typedef union __packed segment_attributes {
uint16_t bytes;
struct
{
@@ -69,18 +69,18 @@ typedef union segment_attributes {
uint16_t g: 1; /* 11; Bit 55 */
uint16_t pad: 4;
} fields;
} __attribute__ ((packed)) segment_attributes_t;
} segment_attributes_t;
/*
* Full state of a segment register (visible and hidden portions).
* Again, this happens to match the format of an AMD SVM VMCB.
*/
struct segment_register {
struct __packed segment_register {
uint16_t sel;
segment_attributes_t attr;
uint32_t limit;
uint64_t base;
} __attribute__ ((packed));
};
/*
* Return codes from state-accessor functions and from x86_emulate().
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.