]> xenbits.xensource.com Git - seabios.git/commitdiff
Fix 'union u64_u32_u' member names.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 15 Sep 2012 16:17:37 +0000 (12:17 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 15 Sep 2012 16:17:37 +0000 (12:17 -0400)
Use 'lo' to mean the low bits and 'hi' to mean the high bits of a
64bit value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/byteorder.h
src/farptr.h
src/types.h

index 94e3a3bc0e02d1a5c27b250b407044a5fefe754b..5a8a64a743687005daeba4c382fc9ae15f432512 100644 (file)
@@ -17,8 +17,8 @@ static inline u32 __swab32(u32 val) {
 static inline u64 __swab64(u64 val) {
     union u64_u32_u i, o;
     i.val = val;
-    o.hi = __swab32(i.lo);
     o.lo = __swab32(i.hi);
+    o.hi = __swab32(i.lo);
     return o.val;
 }
 
index 3a85c6b8305697793bffc2c73529d13c221789fb..5b6c5c10918f424894b170bc39098443cb486f5d 100644 (file)
@@ -26,8 +26,8 @@ extern u16 __segment_FS, __segment_GS;
 #define READ64_SEG(prefix, SEG, value, var) do {                \
         union u64_u32_u __value;                                \
         union u64_u32_u *__r64_ptr = (union u64_u32_u *)&(var); \
-        READ32_SEG(prefix, SEG, __value.hi, __r64_ptr->hi);     \
         READ32_SEG(prefix, SEG, __value.lo, __r64_ptr->lo);     \
+        READ32_SEG(prefix, SEG, __value.hi, __r64_ptr->hi);     \
         *(u64*)&(value) = __value.val;                          \
     } while (0)
 #define WRITE8_SEG(prefix, SEG, var, value)                     \
@@ -44,8 +44,8 @@ extern u16 __segment_FS, __segment_GS;
         union u64_u32_u *__w64_ptr = (union u64_u32_u *)&(var); \
         typeof(var) __value_tmp = (value);                      \
         __value.val = *(u64*)&__value_tmp;                      \
-        WRITE32_SEG(prefix, SEG, __w64_ptr->hi, __value.hi);    \
         WRITE32_SEG(prefix, SEG, __w64_ptr->lo, __value.lo);    \
+        WRITE32_SEG(prefix, SEG, __w64_ptr->hi, __value.hi);    \
     } while (0)
 
 // Macros for automatically choosing the appropriate memory size
index b10f3b31283ee51d9b58a5d104c13cd8f9bea772..24b078e83bed23041559c2903f791fa5a760f19b 100644 (file)
@@ -17,7 +17,7 @@ typedef signed long long s64;
 typedef u32 size_t;
 
 union u64_u32_u {
-    struct { u32 hi, lo; };
+    struct { u32 lo, hi; };
     u64 val;
 };