Fixed regression in simulator port.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13655 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2020-05-18 16:30:00 +00:00
parent 43303f22ea
commit 9ff8210349
1 changed files with 19 additions and 2 deletions

View File

@ -37,6 +37,23 @@
/* Module local definitions. */
/*===========================================================================*/
/*
* RTOS-specific context offset.
*/
#if defined(_CHIBIOS_RT_CONF_)
#if CH_CFG_USE_REGISTRY
#define CONTEXT_OFFSET "20"
#else
#define CONTEXT_OFFSET "12"
#endif
#elif defined(_CHIBIOS_NIL_CONF_)
#define CONTEXT_OFFSET "0"
#else
#error "invalid chconf.h"
#endif
/*===========================================================================*/
/* Module exported variables. */
/*===========================================================================*/
@ -84,8 +101,8 @@ static void __dummy(thread_t *ntp, thread_t *otp) {
"push %esi \n\t"
"push %edi \n\t"
"push %ebx \n\t"
"movl %esp, 12(%edx) \n\t"
"movl 12(%ecx), %esp \n\t"
"movl %esp, "CONTEXT_OFFSET"(%edx) \n\t"
"movl "CONTEXT_OFFSET"(%ecx), %esp \n\t"
"pop %ebx \n\t"
"pop %edi \n\t"
"pop %esi \n\t"