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

master
gdisirio 2010-04-17 12:37:00 +00:00
parent 9abcfe6c2d
commit cfdf3905db
2 changed files with 30 additions and 11 deletions

View File

@ -27,6 +27,22 @@
#include "ch.h" #include "ch.h"
/**
* @brief Internal context stacking.
*/
#define PUSH_CONTEXT(sp) { \
asm volatile ("push {r4, r5, r6, r7, r8, r9, r10, r11, lr}"); \
}
/**
* @brief Internal context unstacking.
*/
#define POP_CONTEXT(sp) { \
asm volatile ("pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}" \
: : "r" (sp)); \
}
#if !CH_OPTIMIZE_SPEED #if !CH_OPTIMIZE_SPEED
void _port_lock(void) { void _port_lock(void) {
register uint32_t tmp asm ("r3") = CORTEX_BASEPRI_KERNEL; register uint32_t tmp asm ("r3") = CORTEX_BASEPRI_KERNEL;
@ -87,8 +103,11 @@ void _port_irq_epilogue(void) {
asm volatile ("msr PSP, %0" : : "r" (ctxp)); asm volatile ("msr PSP, %0" : : "r" (ctxp));
ctxp->pc = _port_switch_from_isr; ctxp->pc = _port_switch_from_isr;
ctxp->xpsr = (regarm_t)0x01000000; ctxp->xpsr = (regarm_t)0x01000000;
/* Note, returning without unlocking is intentional, this is done in
order to keep the rest of the context switching atomic.*/
return; return;
} }
/* ISR exit without context switching.*/
port_unlock_from_isr(); port_unlock_from_isr();
} }
@ -105,15 +124,6 @@ void _port_switch_from_isr(void) {
asm volatile ("svc #0"); asm volatile ("svc #0");
} }
#define PUSH_CONTEXT(sp) { \
asm volatile ("push {r4, r5, r6, r7, r8, r9, r10, r11, lr}"); \
}
#define POP_CONTEXT(sp) { \
asm volatile ("pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}" \
: : "r" (sp)); \
}
/** /**
* @brief Performs a context switch between two threads. * @brief Performs a context switch between two threads.
* @details This is the most critical code in any port, this function * @details This is the most critical code in any port, this function

View File

@ -57,11 +57,20 @@
***************************************************************************** *****************************************************************************
*** 1.5.5 *** *** 1.5.5 ***
- FIX: Removed some "dead" code in the ARMv7-M files. - FIX: Removed some "dead" code in the old ARMv7-M files (there are new
- NEW: LPC13xx support, drivers (Serial, PAL, HAL) and demo. ones, see below).
- NEW: LPC13xx support, drivers (Serial, PAL, HAL), demo and reports.
- NEW: Added statistic info to the lwIP demo.
- CHANGE: Renamed LPC111x port and platform in LPC11xx, minor fixes to the - CHANGE: Renamed LPC111x port and platform in LPC11xx, minor fixes to the
platform header files. platform header files.
- CHANGE: Small documentation fixes and improvements. - CHANGE: Small documentation fixes and improvements.
- OPT: New Cortex-M3 port code, *huge* performance improvements in all the
context switching related benchmarks (5-15% depending on the benchmark).
The new code does no more require the use of the PendSV vector that is
thus available to the user, it also saves four RAM bytes for each thread
in the system. The old code is still available as a fall back option while
the new one is being hardened by peers review and time, the two ports are
perfectly interchangeable.
*** 1.5.4 *** *** 1.5.4 ***
- FIX: Fixed broken CH_CURRP_REGISTER_CACHE option in the ARM7 port (bug - FIX: Fixed broken CH_CURRP_REGISTER_CACHE option in the ARM7 port (bug