]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
With Apple assembly in .macro environvemnt you have to use $$ instead
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 24 Nov 2013 04:55:47 +0000 (05:55 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 24 Nov 2013 06:08:18 +0000 (07:08 +0100)
of $. So introduce new preprocessor macro MACRO_DOLLAR(x) which expands
to $$x on Apple and to $x on everything else.

ChangeLog
grub-core/boot/i386/pc/boot.S
grub-core/gdb/i386/machdep.S
include/grub/symbol.h

index c0d1572a9c740dce8eff19ad0f82f84dfa5d74c3..32d7f09583f3eb7105dd9adf05ae727d0d0ce629 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-24  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       With Apple assembly in .macro environvemnt you have to use $$ instead
+       of $. So introduce new preprocessor macro MACRO_DOLLAR(x) which expands
+       to $$x on Apple and to $x on everything else.
+
 2013-11-24  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/Makefile.am: Use correct TARGET_OBJCONV rather than
index 5b959b627184bc046420060586fc927196d2113f..ee0b9d621705efd468270b5caf5d17108dde89b3 100644 (file)
@@ -40,12 +40,12 @@ LOCAL(floppy_probe):
  *  Perform floppy probe.
  */
 
-       movw    $probe_values - 1, %si
+       movw    MACRO_DOLLAR(probe_values) - 1, %si
 
 LOCAL(probe_loop):
        /* reset floppy controller INT 13h AH=0 */
        xorw    %ax, %ax
-       int     $0x13
+       int     MACRO_DOLLAR(0x13)
 
        incw    %si
        movb    (%si), %cl
@@ -65,20 +65,20 @@ fd_probe_error_string:      .asciz "Floppy"
 
 1:
        /* perform read */
-       movw    $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
+       movw    MACRO_DOLLAR(GRUB_BOOT_MACHINE_BUFFER_SEG), %bx
        movw    %bx, %es
        xorw    %bx, %bx
-       movw    $0x201, %ax
-       movb    $0, %ch
-       movb    $0, %dh
-       int     $0x13
+       movw    MACRO_DOLLAR(0x201), %ax
+       movb    MACRO_DOLLAR(0), %ch
+       movb    MACRO_DOLLAR(0), %dh
+       int     MACRO_DOLLAR(0x13)
 
        /* if error, jump to "LOCAL(probe_loop)" */
        jc      LOCAL(probe_loop)
 
        /* %cl is already the correct value! */
-       movb    $1, %dh
-       movb    $79, %ch
+       movb    MACRO_DOLLAR(1), %dh
+       movb    MACRO_DOLLAR(79), %ch
 
        jmp     LOCAL(final_init)
        .endm
index 5825fe8caf90eda652778bada2eba21654e51fe5..f96d2b9c4b9f2a5ed4ca5742e1acee69a1b356f1 100644 (file)
@@ -186,11 +186,7 @@ VARIABLE(grub_gdb_stack)
        .text
 1:     
        .if EC
-#ifdef __APPLE__
-               add $$4, %esp
-#else
-               add $4, %esp
-#endif
+               add MACRO_DOLLAR(4), %esp
        .endif
 
        save_context
index 89883a3625de2207acf5b9d93f9bdadb71c4df05..ed19f70db9d52e36a4510c8407f4860102a31d83 100644 (file)
 /* Add an underscore to a C symbol in assembler code if needed. */
 #ifndef GRUB_UTIL
 
+#ifdef __APPLE__
+#define MACRO_DOLLAR(x) $$ ## x
+#else
+#define MACRO_DOLLAR(x) $ ## x
+#endif
+
 #if HAVE_ASM_USCORE
 #ifdef ASM_FILE
 # define EXT_C(sym)    _ ## sym