From: Kevin O'Connor Date: Mon, 19 Jan 2009 22:58:54 +0000 (-0500) Subject: Allow GET/SET_SEG asm to access memory or a register. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=79f4118e50ce256994b75b99811ceb0e6a812a13;p=seabios.git Allow GET/SET_SEG asm to access memory or a register. This is a minor optimization that can improve gcc code generation. --- 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;})