aboutsummaryrefslogtreecommitdiff
path: root/src/farptr.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-06-30 21:45:56 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-06-30 21:45:56 -0400
commit957a19859507ffcf66297e2ae06e0686888030c0 (patch)
tree185ed8d3c2998f1c892500821cf285c50cbed5e8 /src/farptr.h
parentab233da2c9cef25eb2594fcb86f908c5319d038e (diff)
downloadseabios-hppa-957a19859507ffcf66297e2ae06e0686888030c0.zip
seabios-hppa-957a19859507ffcf66297e2ae06e0686888030c0.tar.gz
seabios-hppa-957a19859507ffcf66297e2ae06e0686888030c0.tar.bz2
Rework READ64_SEG macro to prevent spurious warning on gcc 4.4.
Gcc is reporting a spurious unused variable warning - work around it.
Diffstat (limited to 'src/farptr.h')
-rw-r--r--src/farptr.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/farptr.h b/src/farptr.h
index 4fc727b..360b28e 100644
--- a/src/farptr.h
+++ b/src/farptr.h
@@ -23,11 +23,12 @@ extern u16 __segment_FS, __segment_GS;
#define READ32_SEG(SEG, value, var) \
__asm__("movl %%" #SEG ":%1, %0" : "=ri"(value) \
: "m"(var), "m"(__segment_ ## SEG))
-#define READ64_SEG(SEG, value, var) do { \
- union u64_u32_u *__w64_ptr = (union u64_u32_u *)&(value); \
- union u64_u32_u *__r64_ptr = (union u64_u32_u *)&(var); \
- READ32_SEG(SEG, __w64_ptr->hi, __r64_ptr->hi); \
- READ32_SEG(SEG, __w64_ptr->lo, __r64_ptr->lo); \
+#define READ64_SEG(SEG, value, var) do { \
+ union u64_u32_u __value; \
+ union u64_u32_u *__r64_ptr = (union u64_u32_u *)&(var); \
+ READ32_SEG(SEG, __value.hi, __r64_ptr->hi); \
+ READ32_SEG(SEG, __value.lo, __r64_ptr->lo); \
+ (value) = __value.val; \
} while (0)
#define WRITE8_SEG(SEG, var, value) \
__asm__("movb %b1, %%" #SEG ":%0" : "=m"(var) \