]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Rearange user_desc structure union to reduce namespacing
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 5 Jun 2017 17:43:28 +0000 (18:43 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 7 Jun 2017 12:41:45 +0000 (13:41 +0100)
This avoids having identically named fields in different named unions.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/include/arch/desc.h

index bea79114c4219cf6d8d53c6ff7c8e26658dfc41f..0babdce514a2e6847b18482dcfbc19e2a6e31e0b 100644 (file)
@@ -21,39 +21,38 @@ struct __packed seg_desc32 {
         struct {
             uint32_t lo, hi;
         };
-        /** Common named fields. */
         struct {
             uint16_t limit0;
             uint16_t base0;
             uint8_t  base1;
-            unsigned type: 4;
-            unsigned s: 1, dpl: 2, p: 1;
-            unsigned limit: 4;
-            unsigned avl: 1, l: 1, d: 1, g: 1;
+            union {
+                /** Common named fields. */
+                struct __packed {
+                    unsigned int type:4;
+
+                    bool s:1;
+                    unsigned int dpl:2;
+                    bool p:1;
+
+                    unsigned int limit1:4;
+
+                    bool avl:1, :1, :1, g:1;
+                };
+                /** Code segment specific field names. */
+                struct __packed {
+                    bool a:1, r:1, c:1, x:1;
+                    unsigned int :4, :4;
+                    bool :1, l:1, d:1, :1;
+                };
+                /** Data segment specific field names. */
+                struct __packed {
+                    bool :1, w:1, e:1, :1;
+                    unsigned int :4, :4;
+                    bool :1, :1, b:1, :1;
+                };
+            };
             uint8_t base2;
         };
-        /** Code segment specific field names. */
-        struct {
-            uint16_t limit0;
-            uint16_t base0;
-            uint8_t  base1;
-            unsigned a: 1, r: 1, c: 1, x: 1;
-            unsigned s: 1, dpl: 2, p: 1;
-            unsigned limit: 4;
-            unsigned avl: 1, l: 1, d: 1, g: 1;
-            uint8_t base2;
-        } code;
-        /** Data segment specific field names. */
-        struct {
-            uint16_t limit0;
-            uint16_t base0;
-            uint8_t  base1;
-            unsigned a: 1, w: 1, e: 1, x: 1;
-            unsigned s: 1, dpl: 2, p: 1;
-            unsigned limit: 4;
-            unsigned avl: 1, _r0: 1, b: 1, g: 1;
-            uint8_t base2;
-        } data;
     };
 };