[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86_emulate: Shuffle use of __attribute__((packed))



commit 4ef5d4c3aa77d8ebb843dcffad4a6ea2a8f01495
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Mar 14 09:46:34 2014 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Mar 14 09:46:34 2014 +0100

    x86_emulate: Shuffle use of __attribute__((packed))
    
    Also include #defines for the test code to allow compilation.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 tools/tests/x86_emulator/test_x86_emulator.c |    2 ++
 tools/tests/x86_emulator/x86_emulate.c       |    2 ++
 xen/arch/x86/x86_emulate/x86_emulate.h       |    8 ++++----
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/tests/x86_emulator/test_x86_emulator.c 
b/tools/tests/x86_emulator/test_x86_emulator.c
index 7404ee3..17b674b 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -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"
 
diff --git a/tools/tests/x86_emulator/x86_emulate.c 
b/tools/tests/x86_emulator/x86_emulate.c
index b157ade..ef9bfe9 100644
--- a/tools/tests/x86_emulator/x86_emulate.c
+++ b/tools/tests/x86_emulator/x86_emulate.c
@@ -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"
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h 
b/xen/arch/x86/x86_emulate/x86_emulate.h
index 85bc4bc..107addf 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -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().
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.