aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/entry_64.S
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-21 09:11:32 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-21 09:12:28 -0500
commite8a0e27662186f8856a0a6242e7a8386c9a64a53 (patch)
tree96d84f4b24035294088f5a0045eee8927871edfc /arch/x86/kernel/entry_64.S
parentdcd072e26055de600cecdc3f7a1e083ecd55c2e4 (diff)
x86: clean up after: move entry_64.S register saving out of the macros, fix
Impact: build fix The break builds with older binutils (2.16.1): arch/x86/kernel/entry_64.S: Assembler messages: arch/x86/kernel/entry_64.S:282: Error: too many positional arguments arch/x86/kernel/entry_64.S:283: Error: too many positional arguments arch/x86/kernel/entry_64.S:284: Error: too many positional arguments arch/x86/kernel/entry_64.S:285: Error: too many positional arguments arch/x86/kernel/entry_64.S:286: Error: too many positional arguments arch/x86/kernel/entry_64.S:287: Error: too many positional arguments arch/x86/kernel/entry_64.S:288: Error: too many positional arguments arch/x86/kernel/entry_64.S:289: Error: too many positional arguments arch/x86/kernel/entry_64.S:290: Error: too many positional arguments Took some time to figure out the detail that GAS chokes on: it's negative offsets. Rearrange the calculations to make sure we never go negative. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/entry_64.S')
-rw-r--r--arch/x86/kernel/entry_64.S54
1 files changed, 27 insertions, 27 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 7a04f696121d..4e3d83678f85 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -247,12 +247,12 @@ ENTRY(native_usergs_sysret64)
247 * initial frame state for interrupts (and exceptions without error code) 247 * initial frame state for interrupts (and exceptions without error code)
248 */ 248 */
249 .macro INTR_FRAME start=1 offset=0 249 .macro INTR_FRAME start=1 offset=0
250 EMPTY_FRAME \start, (SS+8-RIP)+\offset 250 EMPTY_FRAME \start, SS+8+\offset-RIP
251 /*CFI_REL_OFFSET ss, SS-RIP+\offset*/ 251 /*CFI_REL_OFFSET ss, SS+\offset-RIP*/
252 CFI_REL_OFFSET rsp, RSP-RIP+\offset 252 CFI_REL_OFFSET rsp, RSP+\offset-RIP
253 /*CFI_REL_OFFSET rflags, EFLAGS-RIP+\offset*/ 253 /*CFI_REL_OFFSET rflags, EFLAGS+\offset-RIP*/
254 /*CFI_REL_OFFSET cs, CS-RIP+\offset*/ 254 /*CFI_REL_OFFSET cs, CS+\offset-RIP*/
255 CFI_REL_OFFSET rip, RIP-RIP+\offset 255 CFI_REL_OFFSET rip, RIP+\offset-RIP
256 .endm 256 .endm
257 257
258/* 258/*
@@ -260,7 +260,7 @@ ENTRY(native_usergs_sysret64)
260 * with vector already pushed) 260 * with vector already pushed)
261 */ 261 */
262 .macro XCPT_FRAME start=1 offset=0 262 .macro XCPT_FRAME start=1 offset=0
263 INTR_FRAME \start, (RIP-ORIG_RAX)+\offset 263 INTR_FRAME \start, RIP+\offset-ORIG_RAX
264 /*CFI_REL_OFFSET orig_rax, ORIG_RAX-ORIG_RAX*/ 264 /*CFI_REL_OFFSET orig_rax, ORIG_RAX-ORIG_RAX*/
265 .endm 265 .endm
266 266
@@ -268,23 +268,23 @@ ENTRY(native_usergs_sysret64)
268 * frame that enables calling into C. 268 * frame that enables calling into C.
269 */ 269 */
270 .macro PARTIAL_FRAME start=1 offset=0 270 .macro PARTIAL_FRAME start=1 offset=0
271 XCPT_FRAME \start, (ORIG_RAX-ARGOFFSET)+\offset 271 XCPT_FRAME \start, ORIG_RAX+\offset-ARGOFFSET
272 CFI_REL_OFFSET rdi, (RDI-ARGOFFSET)+\offset 272 CFI_REL_OFFSET rdi, RDI+\offset-ARGOFFSET
273 CFI_REL_OFFSET rsi, (RSI-ARGOFFSET)+\offset 273 CFI_REL_OFFSET rsi, RSI+\offset-ARGOFFSET
274 CFI_REL_OFFSET rdx, (RDX-ARGOFFSET)+\offset 274 CFI_REL_OFFSET rdx, RDX+\offset-ARGOFFSET
275 CFI_REL_OFFSET rcx, (RCX-ARGOFFSET)+\offset 275 CFI_REL_OFFSET rcx, RCX+\offset-ARGOFFSET
276 CFI_REL_OFFSET rax, (RAX-ARGOFFSET)+\offset 276 CFI_REL_OFFSET rax, RAX+\offset-ARGOFFSET
277 CFI_REL_OFFSET r8, (R8-ARGOFFSET)+\offset 277 CFI_REL_OFFSET r8, R8+\offset-ARGOFFSET
278 CFI_REL_OFFSET r9, (R9-ARGOFFSET)+\offset 278 CFI_REL_OFFSET r9, R9+\offset-ARGOFFSET
279 CFI_REL_OFFSET r10, (R10-ARGOFFSET)+\offset 279 CFI_REL_OFFSET r10, R10+\offset-ARGOFFSET
280 CFI_REL_OFFSET r11, (R11-ARGOFFSET)+\offset 280 CFI_REL_OFFSET r11, R11+\offset-ARGOFFSET
281 .endm 281 .endm
282 282
283/* 283/*
284 * frame that enables passing a complete pt_regs to a C function. 284 * frame that enables passing a complete pt_regs to a C function.
285 */ 285 */
286 .macro DEFAULT_FRAME start=1 offset=0 286 .macro DEFAULT_FRAME start=1 offset=0
287 PARTIAL_FRAME \start, (R11-R15)+\offset 287 PARTIAL_FRAME \start, R11+\offset-R15
288 CFI_REL_OFFSET rbx, RBX+\offset 288 CFI_REL_OFFSET rbx, RBX+\offset
289 CFI_REL_OFFSET rbp, RBP+\offset 289 CFI_REL_OFFSET rbp, RBP+\offset
290 CFI_REL_OFFSET r12, R12+\offset 290 CFI_REL_OFFSET r12, R12+\offset
@@ -297,15 +297,15 @@ ENTRY(native_usergs_sysret64)
297ENTRY(save_args) 297ENTRY(save_args)
298 XCPT_FRAME 298 XCPT_FRAME
299 cld 299 cld
300 CFI_MOVQ rdi, (RDI-ARGOFFSET)+16 300 CFI_MOVQ rdi, RDI+16-ARGOFFSET
301 CFI_MOVQ rsi, (RSI-ARGOFFSET)+16 301 CFI_MOVQ rsi, RSI+16-ARGOFFSET
302 CFI_MOVQ rdx, (RDX-ARGOFFSET)+16 302 CFI_MOVQ rdx, RDX+16-ARGOFFSET
303 CFI_MOVQ rcx, (RCX-ARGOFFSET)+16 303 CFI_MOVQ rcx, RCX+16-ARGOFFSET
304 CFI_MOVQ rax, (RAX-ARGOFFSET)+16 304 CFI_MOVQ rax, RAX+16-ARGOFFSET
305 CFI_MOVQ r8, (R8-ARGOFFSET)+16 305 CFI_MOVQ r8, R8+16-ARGOFFSET
306 CFI_MOVQ r9, (R9-ARGOFFSET)+16 306 CFI_MOVQ r9, R9+16-ARGOFFSET
307 CFI_MOVQ r10, (R10-ARGOFFSET)+16 307 CFI_MOVQ r10, R10+16-ARGOFFSET
308 CFI_MOVQ r11, (R11-ARGOFFSET)+16 308 CFI_MOVQ r11, R11+16-ARGOFFSET
309 leaq -ARGOFFSET+16(%rsp),%rdi /* arg1 for handler */ 309 leaq -ARGOFFSET+16(%rsp),%rdi /* arg1 for handler */
310 CFI_MOVQ rbp, 8 /* push %rbp */ 310 CFI_MOVQ rbp, 8 /* push %rbp */
311 leaq 8(%rsp), %rbp /* mov %rsp, %ebp */ 311 leaq 8(%rsp), %rbp /* mov %rsp, %ebp */