aboutsummaryrefslogtreecommitdiff
path: root/src/farptr.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-01-19 17:58:54 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-01-19 17:58:54 -0500
commit79f4118e50ce256994b75b99811ceb0e6a812a13 (patch)
tree6f6f84b3c37babec6404cbb2505b7e286d75b86a /src/farptr.h
parent35ae726530432c478a0955532e7e6c8b32c4bfef (diff)
downloadseabios-hppa-79f4118e50ce256994b75b99811ceb0e6a812a13.zip
seabios-hppa-79f4118e50ce256994b75b99811ceb0e6a812a13.tar.gz
seabios-hppa-79f4118e50ce256994b75b99811ceb0e6a812a13.tar.bz2
Allow GET/SET_SEG asm to access memory or a register.
This is a minor optimization that can improve gcc code generation.
Diffstat (limited to 'src/farptr.h')
-rw-r--r--src/farptr.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/farptr.h b/src/farptr.h
index 3256848..a26cf08 100644
--- a/src/farptr.h
+++ b/src/farptr.h
@@ -49,10 +49,10 @@ extern u16 __segment_FS, __segment_GS;
// Low level macros for getting/setting a segment register.
#define __SET_SEG(SEG, value) \
__asm__("movw %w1, %%" #SEG : "=m"(__segment_ ## SEG) \
- : "r"(value))
+ : "rm"(value))
#define __GET_SEG(SEG) ({ \
u16 __seg; \
- __asm__("movw %%" #SEG ", %w0" : "=r"(__seg) \
+ __asm__("movw %%" #SEG ", %w0" : "=rm"(__seg) \
: "m"(__segment_ ## SEG)); \
__seg;})