Skip to content

Commit

Permalink
x86: Clean up the loadsegment() macro
Browse files Browse the repository at this point in the history
Make it readable in the source too, not just in the assembly output.
No change in functionality.

Cc: Brian Gerst <brgerst@gmail.com>
LKML-Reference: <1259176706-5908-1-git-send-email-brgerst@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Nov 26, 2009
1 parent 79b0379 commit 64b028b
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions arch/x86/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,21 @@ extern void native_load_gs_index(unsigned);
* Load a segment. Fall back on loading the zero
* segment if something goes wrong..
*/
#define loadsegment(seg, value) \
do { \
unsigned short __val = value; \
asm volatile("\n" \
"1:\t" \
"movl %k0,%%" #seg "\n" \
".section .fixup,\"ax\"\n" \
"2:\t" \
"xorl %k0,%k0\n\t" \
"jmp 1b\n" \
".previous\n" \
_ASM_EXTABLE(1b, 2b) \
: "+r" (__val) : : "memory"); \
#define loadsegment(seg, value) \
do { \
unsigned short __val = (value); \
\
asm volatile(" \n" \
"1: movl %k0,%%" #seg " \n" \
\
".section .fixup,\"ax\" \n" \
"2: xorl %k0,%k0 \n" \
" jmp 1b \n" \
".previous \n" \
\
_ASM_EXTABLE(1b, 2b) \
\
: "+r" (__val) : : "memory"); \
} while (0)

/*
Expand Down

0 comments on commit 64b028b

Please sign in to comment.