X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=bertos%2Femul%2Fswitch_i386.S;h=39eb31d5f734e243ff44d28425b0991cbec28987;hb=4cc44c9888a0336b9d01121ec0b7ad95f4a76195;hp=6931d45c9986636b931ebb4be1411338dda471e7;hpb=313117db717ca63c3fb036c0aed11b35785e2797;p=bertos.git diff --git a/bertos/emul/switch_i386.S b/bertos/emul/switch_i386.S index 6931d45c..39eb31d5 100644 --- a/bertos/emul/switch_i386.S +++ b/bertos/emul/switch_i386.S @@ -2,7 +2,7 @@ * \file * * @@ -10,12 +10,23 @@ * * \version $Id$ * - * \author Bernardo Innocenti + * \author Bernie 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