projects
/
seabios.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35ae726
)
Allow GET/SET_SEG asm to access memory or a register.
author
Kevin O'Connor
<kevin@koconnor.net>
Mon, 19 Jan 2009 22:58:54 +0000
(17:58 -0500)
committer
Kevin O'Connor
<kevin@koconnor.net>
Mon, 19 Jan 2009 22:58:54 +0000
(17:58 -0500)
This is a minor optimization that can improve gcc code generation.
src/farptr.h
patch
|
blob
|
history
diff --git
a/src/farptr.h
b/src/farptr.h
index 3256848b65fe4fe8a25552f86da95611ea2ea9af..a26cf08724e7c751d56ef62424567b39f5803268 100644
(file)
--- 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))
+ : "r
m
"(value))
#define __GET_SEG(SEG) ({ \
u16 __seg; \
- __asm__("movw %%" #SEG ", %w0" : "=r
"(__seg)
\
+ __asm__("movw %%" #SEG ", %w0" : "=r
m"(__seg)
\
: "m"(__segment_ ## SEG)); \
__seg;})