Commit d95bd8f6 authored by Radim Krčmář's avatar Radim Krčmář Committed by Marcelo Tosatti
Browse files

x86: fix build (macro R interpreted as raw string)



GCC 5.0.0 enables raw strings by default and they have higher priority
than macros, thus R"[...]" is interpreted incorrectly:

  lib/x86/isr.c:112:30: error: invalid character ')' in raw string delimiter
  lib/x86/isr.c:112:8: error: stray ‘R’ in program
  lib/x86/isr.c:112:26: error: expected ‘:’ or ‘)’ before string constant
          "orl $0x200, (%%"R"sp)\n\t"

Fix it by putting a space between macro R and a string literal.
(We already do that somewhere.)
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent c1ec863e
......@@ -114,22 +114,22 @@ asm (".pushsection .text \n\t"
"push %r15; push %r14; push %r13; push %r12 \n\t"
"push %r11; push %r10; push %r9; push %r8 \n\t"
#endif
"push %"R"di; push %"R"si; push %"R"bp; sub $"S", %"R"sp \n\t"
"push %"R"bx; push %"R"dx; push %"R"cx; push %"R"ax \n\t"
"push %"R "di; push %"R "si; push %"R "bp; sub $"S", %"R "sp \n\t"
"push %"R "bx; push %"R "dx; push %"R "cx; push %"R "ax \n\t"
#ifdef __x86_64__
"mov %"R"sp, %"R"di \n\t"
"mov %"R "sp, %"R "di \n\t"
#else
"mov %"R"sp, %"R"ax \n\t"
"mov %"R "sp, %"R "ax \n\t"
#endif
"call do_handle_exception \n\t"
"pop %"R"ax; pop %"R"cx; pop %"R"dx; pop %"R"bx \n\t"
"add $"S", %"R"sp; pop %"R"bp; pop %"R"si; pop %"R"di \n\t"
"pop %"R "ax; pop %"R "cx; pop %"R "dx; pop %"R "bx \n\t"
"add $"S", %"R "sp; pop %"R "bp; pop %"R "si; pop %"R "di \n\t"
#ifdef __x86_64__
"pop %r8; pop %r9; pop %r10; pop %r11 \n\t"
"pop %r12; pop %r13; pop %r14; pop %r15 \n\t"
#endif
"add $"S", %"R"sp \n\t"
"add $"S", %"R"sp \n\t"
"add $"S", %"R "sp \n\t"
"add $"S", %"R "sp \n\t"
"iret"W" \n\t"
".popsection");
......
......@@ -109,7 +109,7 @@ void handle_external_interrupt(int vector)
"push %[sp]\n\t"
#endif
"pushf\n\t"
"orl $0x200, (%%"R"sp)\n\t"
"orl $0x200, (%%"R "sp)\n\t"
"push $%c[cs]\n\t"
"call *%[entry]\n\t"
:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment