Fixed bug 2745153.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@882 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2009-04-09 12:27:02 +00:00
parent 3a5cb07fb9
commit a8a6649caa
2 changed files with 13 additions and 12 deletions

View File

@ -77,7 +77,7 @@ ULIBDIR =
ULIBS =
# Define optimisation level here
OPT = -ggdb -O2 -fomit-frame-pointer
OPT = -ggdb -O0 -fomit-frame-pointer
#
# End of user defines
@ -93,7 +93,7 @@ LIBS = $(DLIBS) $(ULIBS)
LDFLAGS = -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
ASFLAGS = -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
CPFLAGS = $(OPT) -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=$(<:.c=.lst) $(DEFS)
CPFLAGS = $(OPT) -Wall -Wstrict-prototypes -fverbose-asm -Wa,-alms=$(<:.c=.lst) $(DEFS)
# Generate dependency information
CPFLAGS += -MD -MP -MF .dep/$(@F).d

View File

@ -98,20 +98,21 @@ void ChkIntSources(void) {
* @param otp the thread to be switched out
* @param ntp the thread to be switched in
*/
__attribute__((fastcall))
void port_switch(Thread *otp, Thread *ntp) {
register struct intctx volatile *esp asm("esp");
asm volatile ("push %ebp \n\t" \
__attribute__((used))
static void __dummy(Thread *otp, Thread *ntp) {
asm volatile (".globl @port_switch@8 \n\t" \
"@port_switch@8: \n\t" \
"push %ebp \n\t" \
"push %esi \n\t" \
"push %edi \n\t" \
"push %ebx");
otp->p_ctx.esp = esp;
esp = ntp->p_ctx.esp;
asm volatile ("pop %ebx \n\t" \
"push %ebx \n\t" \
"movl %esp, 16(%ecx) \n\t" \
"movl 16(%edx), %esp \n\t" \
"pop %ebx \n\t" \
"pop %edi \n\t" \
"pop %esi \n\t" \
"pop %ebp");
"pop %ebp \n\t" \
"ret");
}
/**