git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@239 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2008-03-17 15:43:03 +00:00
parent 8ce99ed1fb
commit 24359085b9
6 changed files with 33 additions and 5 deletions

View File

@ -71,7 +71,7 @@ SRC = ../../ports/ARMCM3/chcore.c \
board.c main.c board.c main.c
# List ASM source files here # List ASM source files here
ASMSRC = ../../ports/ARMCM3/crt0.s ASMSRC = ../../ports/ARMCM3/crt0.s ../../ports/ARMCM3-STM32F103/vectors.s
# List all user directories here # List all user directories here
UINCDIR = ../../src/include ../../src/lib ../../ports/ARMCM3 UINCDIR = ../../src/include ../../src/lib ../../ports/ARMCM3

View File

@ -41,6 +41,7 @@ SECTIONS
.text : .text :
{ {
_text = .; _text = .;
*(INTVEC);
*(.text); *(.text);
*(.rodata); *(.rodata);
*(.rodata*); *(.rodata*);

View File

@ -32,7 +32,8 @@ struct extctx {
regarm r1; regarm r1;
regarm r2; regarm r2;
regarm r3; regarm r3;
regarm r12; regarm r12
regarm lr_usr;
}; };
/* /*

View File

@ -66,5 +66,25 @@ void threadstart(void) {
asm volatile ("mov r0, r5 \n\t" \ asm volatile ("mov r0, r5 \n\t" \
"blx r4 \n\t" \ "blx r4 \n\t" \
"bl chThdExit "); "bl chThdExit ");
}
void *retaddr;
__attribute__((naked, weak))
void threadswitch(void) {
asm volatile ("sub sp, sp, #4 \n\t" \
"push {r0-r3, r12, lr} \n\t" \
"mrs r0, XPSR \n\t" \
"push {r0} \n\t" \
"ldr r0, =retaddr \n\t" \
"str r0, [sp, #28] ");
chSchDoRescheduleI();
asm volatile ("pop {r0} \n\t" \
"msr XPSR, r0 \n\t" \
"pop {r0-r3, r12, lr} \n\t" \
"cpsie i \n\t" \
"pop {pc} ");
} }

View File

@ -26,13 +26,14 @@ typedef void *regarm;
* Interrupt saved context. * Interrupt saved context.
*/ */
struct extctx { struct extctx {
regarm spsr_irq; regarm pc;
regarm lr_irq; regarm xpsr;
regarm r0; regarm r0;
regarm r1; regarm r1;
regarm r2; regarm r2;
regarm r3; regarm r3;
regarm r12; regarm r12;
regarm lr;
}; };
/* /*

View File

@ -60,6 +60,11 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
*** Releases *** *** Releases ***
***************************************************************************** *****************************************************************************
*** 0.6.2 ***
- Fixed a minor problem in the ARM7 port, the structure extctx definition was
missing one field, the effect was to allocate stacks 4 bytes shorter. This
was not a problem in most scenarios.
*** 0.6.1 *** *** 0.6.1 ***
- Removed some redundant checks from the scheduler code: improved threads - Removed some redundant checks from the scheduler code: improved threads
flyback time, reduced interrupts service time. flyback time, reduced interrupts service time.