diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-12-23 20:06:26 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-12-23 20:06:26 +0000 |
commit | 0750743bb48903d20cdcc368727c9111c072e058 (patch) | |
tree | e4248bff22e4b53b0decda939a5563557e0742ce | |
parent | 103a27ca8ae28041ae9da27d21be11103beaf7bd (diff) | |
download | ChibiOS-0750743bb48903d20cdcc368727c9111c072e058.tar.gz ChibiOS-0750743bb48903d20cdcc368727c9111c072e058.tar.bz2 ChibiOS-0750743bb48903d20cdcc368727c9111c072e058.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1459 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/ports/GCC/SIMIA32/chcore.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/os/ports/GCC/SIMIA32/chcore.c b/os/ports/GCC/SIMIA32/chcore.c index c6c5d69e1..6fe0725dd 100644 --- a/os/ports/GCC/SIMIA32/chcore.c +++ b/os/ports/GCC/SIMIA32/chcore.c @@ -22,6 +22,8 @@ * @{
*/
+#include <stdlib.h>
+
#include "ch.h"
#include "hal.h"
@@ -33,9 +35,14 @@ __attribute__((used))
static void __dummy(Thread *otp, Thread *ntp) {
(void)otp; (void)ntp;
+#if defined(WIN32)
asm volatile (".globl @port_switch@8 \n\t" \
- "@port_switch@8: \n\t" \
- "push %ebp \n\t" \
+ "@port_switch@8:");
+#else
+ asm volatile (".globl port_switch \n\t" \
+ "port_switch:");
+#endif
+ asm volatile ("push %ebp \n\t" \
"push %esi \n\t" \
"push %edi \n\t" \
"push %ebx \n\t" \
@@ -62,8 +69,13 @@ void port_halt(void) { */
void threadexit(void) {
+#if defined(WIN32)
asm volatile ("push %eax \n\t" \
"call _chThdExit");
+#else
+ asm volatile ("push %eax \n\t" \
+ "call chThdExit");
+#endif
}
/** @} */
|