X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Femul%2Fswitch_i386.S;h=0b2f0937e07c2fed3251a32fc4d5c723aa7a249e;hb=0b1a1fb4f820c70802478793b34240e0435fbb4e;hp=6931d45c9986636b931ebb4be1411338dda471e7;hpb=313117db717ca63c3fb036c0aed11b35785e2797;p=bertos.git diff --git a/bertos/emul/switch_i386.S b/bertos/emul/switch_i386.S index 6931d45c..0b2f0937 100644 --- a/bertos/emul/switch_i386.S +++ b/bertos/emul/switch_i386.S @@ -1,21 +1,56 @@ -/*! +/** * \file * * - * \brief i386 context switch - * * \version $Id$ + * \author Bernie Innocenti * - * \author Bernardo Innocenti + * \brief i386 context switch */ + + +#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 +72,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