X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Femul%2Fswitch_i386.S;fp=bertos%2Femul%2Fswitch_i386.S;h=6570f8e83904e03903ec80a79963eff37b34086e;hb=a2fc2366ad564f11e705703ed1f42b7dc499a47c;hp=6931d45c9986636b931ebb4be1411338dda471e7;hpb=72e3c950726d50c18883d4b47acf4d9817ee58e5;p=bertos.git diff --git a/bertos/emul/switch_i386.S b/bertos/emul/switch_i386.S index 6931d45c..6570f8e8 100644 --- a/bertos/emul/switch_i386.S +++ b/bertos/emul/switch_i386.S @@ -13,9 +13,20 @@ * \author Bernardo Innocenti */ + + +#ifdef __APPLE__ + //This workaround is necessary to compile under OS X assembler. + #define SWITCH_CONTEXT _asm_switch_context + #define SWITCH_VERSION _asm_switch_version +#else + #define SWITCH_CONTEXT asm_switch_context + #define SWITCH_VERSION asm_switch_version +#endif + /* void asm_switch_context(void ** new_sp, void ** save_sp) */ -.globl asm_switch_context -asm_switch_context: +.globl SWITCH_CONTEXT +SWITCH_CONTEXT: pushl %eax pushl %ebx pushl %ecx @@ -37,8 +48,8 @@ asm_switch_context: ret /* int asm_switch_version(void) */ -.globl asm_switch_version -asm_switch_version: +.globl SWITCH_VERSION +SWITCH_VERSION: mov $1,%eax ret