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.
This commit is contained in:
parent
b700a427d2
commit
09bc0a577d
4 changed files with 22 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -27,6 +27,12 @@
|
|||
/* 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
|
||||
|
|
Loading…
Reference in a new issue