diff options
author | Tao Guo <glorioustao@gmail.com> | 2012-09-26 04:28:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-09-26 07:35:32 -0400 |
commit | 1b2b23d8573076a587ed2081e0d2b69691079e0e (patch) | |
tree | 664d3b567fe4b8f75529c4ab64755961d3d68343 /arch/x86 | |
parent | e26a44a2d618a491d5c6a2a8aaf66ee03a94739f (diff) |
x86_64: Work around old GAS bug
GAS in binutils(2.16.91) could not parse parentheses within
macro parameters unless fully parenthesized, and this is a
workaround to make old gas work without generating below errors:
arch/x86/kernel/entry_64.S: Assembler messages:
arch/x86/kernel/entry_64.S:387: Error: too many positional arguments
arch/x86/kernel/entry_64.S:389: Error: too many positional arguments
[...]
Signed-off-by: Tao Guo <glorioustao@gmail.com>
Reluctantly-Acked-by: Jan Beulich <jbeulich@novell.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1348648102-12653-1-git-send-email-glorioustao@gmail.com
[ Jan argues that these old GAS versions are fragile - which is so, but lets give them a chance. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/calling.h | 48 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 20 |
2 files changed, 33 insertions, 35 deletions
diff --git a/arch/x86/include/asm/calling.h b/arch/x86/include/asm/calling.h index a9e3a740f697..7f8422a28a46 100644 --- a/arch/x86/include/asm/calling.h +++ b/arch/x86/include/asm/calling.h | |||
@@ -49,38 +49,36 @@ For 32-bit we have the following conventions - kernel is built with | |||
49 | #include "dwarf2.h" | 49 | #include "dwarf2.h" |
50 | 50 | ||
51 | /* | 51 | /* |
52 | * 64-bit system call stack frame layout defines and helpers, for | 52 | * 64-bit system call stack frame layout defines and helpers, |
53 | * assembly code (note that the seemingly unnecessary parentheses | 53 | * for assembly code: |
54 | * are to prevent cpp from inserting spaces in expressions that get | ||
55 | * passed to macros): | ||
56 | */ | 54 | */ |
57 | 55 | ||
58 | #define R15 (0) | 56 | #define R15 0 |
59 | #define R14 (8) | 57 | #define R14 8 |
60 | #define R13 (16) | 58 | #define R13 16 |
61 | #define R12 (24) | 59 | #define R12 24 |
62 | #define RBP (32) | 60 | #define RBP 32 |
63 | #define RBX (40) | 61 | #define RBX 40 |
64 | 62 | ||
65 | /* arguments: interrupts/non tracing syscalls only save up to here: */ | 63 | /* arguments: interrupts/non tracing syscalls only save up to here: */ |
66 | #define R11 (48) | 64 | #define R11 48 |
67 | #define R10 (56) | 65 | #define R10 56 |
68 | #define R9 (64) | 66 | #define R9 64 |
69 | #define R8 (72) | 67 | #define R8 72 |
70 | #define RAX (80) | 68 | #define RAX 80 |
71 | #define RCX (88) | 69 | #define RCX 88 |
72 | #define RDX (96) | 70 | #define RDX 96 |
73 | #define RSI (104) | 71 | #define RSI 104 |
74 | #define RDI (112) | 72 | #define RDI 112 |
75 | #define ORIG_RAX (120) /* + error_code */ | 73 | #define ORIG_RAX 120 /* + error_code */ |
76 | /* end of arguments */ | 74 | /* end of arguments */ |
77 | 75 | ||
78 | /* cpu exception frame or undefined in case of fast syscall: */ | 76 | /* cpu exception frame or undefined in case of fast syscall: */ |
79 | #define RIP (128) | 77 | #define RIP 128 |
80 | #define CS (136) | 78 | #define CS 136 |
81 | #define EFLAGS (144) | 79 | #define EFLAGS 144 |
82 | #define RSP (152) | 80 | #define RSP 152 |
83 | #define SS (160) | 81 | #define SS 160 |
84 | 82 | ||
85 | #define ARGOFFSET R11 | 83 | #define ARGOFFSET R11 |
86 | #define SWFRAME ORIG_RAX | 84 | #define SWFRAME ORIG_RAX |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index b1dac12dc5e6..2c6706167c8d 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -342,15 +342,15 @@ ENDPROC(native_usergs_sysret64) | |||
342 | .macro SAVE_ARGS_IRQ | 342 | .macro SAVE_ARGS_IRQ |
343 | cld | 343 | cld |
344 | /* start from rbp in pt_regs and jump over */ | 344 | /* start from rbp in pt_regs and jump over */ |
345 | movq_cfi rdi, RDI-RBP | 345 | movq_cfi rdi, (RDI-RBP) |
346 | movq_cfi rsi, RSI-RBP | 346 | movq_cfi rsi, (RSI-RBP) |
347 | movq_cfi rdx, RDX-RBP | 347 | movq_cfi rdx, (RDX-RBP) |
348 | movq_cfi rcx, RCX-RBP | 348 | movq_cfi rcx, (RCX-RBP) |
349 | movq_cfi rax, RAX-RBP | 349 | movq_cfi rax, (RAX-RBP) |
350 | movq_cfi r8, R8-RBP | 350 | movq_cfi r8, (R8-RBP) |
351 | movq_cfi r9, R9-RBP | 351 | movq_cfi r9, (R9-RBP) |
352 | movq_cfi r10, R10-RBP | 352 | movq_cfi r10, (R10-RBP) |
353 | movq_cfi r11, R11-RBP | 353 | movq_cfi r11, (R11-RBP) |
354 | 354 | ||
355 | /* Save rbp so that we can unwind from get_irq_regs() */ | 355 | /* Save rbp so that we can unwind from get_irq_regs() */ |
356 | movq_cfi rbp, 0 | 356 | movq_cfi rbp, 0 |
@@ -384,7 +384,7 @@ ENDPROC(native_usergs_sysret64) | |||
384 | .endm | 384 | .endm |
385 | 385 | ||
386 | ENTRY(save_rest) | 386 | ENTRY(save_rest) |
387 | PARTIAL_FRAME 1 REST_SKIP+8 | 387 | PARTIAL_FRAME 1 (REST_SKIP+8) |
388 | movq 5*8+16(%rsp), %r11 /* save return address */ | 388 | movq 5*8+16(%rsp), %r11 /* save return address */ |
389 | movq_cfi rbx, RBX+16 | 389 | movq_cfi rbx, RBX+16 |
390 | movq_cfi rbp, RBP+16 | 390 | movq_cfi rbp, RBP+16 |