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

This commit is contained in:
gdisirio 2008-04-18 13:27:05 +00:00
parent 792c528dbc
commit f563ad9387
3 changed files with 13 additions and 19 deletions

View File

@ -89,9 +89,9 @@ ULIBS =
# chconf.h.
# NOTE: -falign-functions=16 may improve the performance, not always, but
# increases the code size.
OPT = -O2 -ggdb -fomit-frame-pointer
OPT = -O2 -ggdb -fomit-frame-pointer -mabi=apcs-gnu
#OPT += -ffixed-r7
#OPT += -falign-functions=16
OPT += -falign-functions=16
# Define warning options here
WARN = -Wall -Wstrict-prototypes

View File

@ -38,14 +38,6 @@ __attribute__((weak))
void chSysPuts(char *msg) {
}
/*
* Context switch.
*/
void chSysSwitchI(Thread *otp, Thread *ntp) {
asm volatile ("svc #0");
}
/*
* System halt.
*/

View File

@ -78,16 +78,19 @@ typedef struct {
}
#define chSysLock() { \
asm volatile ("push {r3}"); \
asm volatile ("movs r3, #0x10"); \
asm volatile ("msr BASEPRI, r3"); \
asm volatile ("pop {r3}"); \
register uint32_t tmp asm ("r3"); \
asm volatile ("movs %0, #0x10" : "=r" (tmp): ); \
asm volatile ("msr BASEPRI, %0" : : "r" (tmp)); \
}
#define chSysUnlock() { \
asm volatile ("push {r3}"); \
asm volatile ("movs r3, #0"); \
asm volatile ("msr BASEPRI, r3"); \
asm volatile ("pop {r3}"); \
register uint32_t tmp asm ("r3"); \
asm volatile ("movs %0, #0" : "=r" (tmp): ); \
asm volatile ("msr BASEPRI, %0" : : "r" (tmp)); \
}
#define chSysSwitchI(otp, ntp) { \
register Thread *_otp asm ("r0") = (otp); \
register Thread *_ntp asm ("r1") = (ntp); \
asm volatile ("svc #0" : : "r" (_otp), "r" (_ntp)); \
}
#define INT_REQUIRED_STACK 0
@ -109,7 +112,6 @@ typedef struct {
void _IdleThread(void *p) __attribute__((noreturn));
void chSysHalt(void);
void chSysSwitchI(Thread *otp, Thread *ntp);
void chSysPuts(char *msg);
void threadstart(void);