git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@271 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
792c528dbc
commit
f563ad9387
|
@ -89,9 +89,9 @@ ULIBS =
|
||||||
# chconf.h.
|
# chconf.h.
|
||||||
# NOTE: -falign-functions=16 may improve the performance, not always, but
|
# NOTE: -falign-functions=16 may improve the performance, not always, but
|
||||||
# increases the code size.
|
# increases the code size.
|
||||||
OPT = -O2 -ggdb -fomit-frame-pointer
|
OPT = -O2 -ggdb -fomit-frame-pointer -mabi=apcs-gnu
|
||||||
#OPT += -ffixed-r7
|
#OPT += -ffixed-r7
|
||||||
#OPT += -falign-functions=16
|
OPT += -falign-functions=16
|
||||||
|
|
||||||
# Define warning options here
|
# Define warning options here
|
||||||
WARN = -Wall -Wstrict-prototypes
|
WARN = -Wall -Wstrict-prototypes
|
||||||
|
|
|
@ -38,14 +38,6 @@ __attribute__((weak))
|
||||||
void chSysPuts(char *msg) {
|
void chSysPuts(char *msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Context switch.
|
|
||||||
*/
|
|
||||||
void chSysSwitchI(Thread *otp, Thread *ntp) {
|
|
||||||
|
|
||||||
asm volatile ("svc #0");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* System halt.
|
* System halt.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -78,16 +78,19 @@ typedef struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define chSysLock() { \
|
#define chSysLock() { \
|
||||||
asm volatile ("push {r3}"); \
|
register uint32_t tmp asm ("r3"); \
|
||||||
asm volatile ("movs r3, #0x10"); \
|
asm volatile ("movs %0, #0x10" : "=r" (tmp): ); \
|
||||||
asm volatile ("msr BASEPRI, r3"); \
|
asm volatile ("msr BASEPRI, %0" : : "r" (tmp)); \
|
||||||
asm volatile ("pop {r3}"); \
|
|
||||||
}
|
}
|
||||||
#define chSysUnlock() { \
|
#define chSysUnlock() { \
|
||||||
asm volatile ("push {r3}"); \
|
register uint32_t tmp asm ("r3"); \
|
||||||
asm volatile ("movs r3, #0"); \
|
asm volatile ("movs %0, #0" : "=r" (tmp): ); \
|
||||||
asm volatile ("msr BASEPRI, r3"); \
|
asm volatile ("msr BASEPRI, %0" : : "r" (tmp)); \
|
||||||
asm volatile ("pop {r3}"); \
|
}
|
||||||
|
#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
|
#define INT_REQUIRED_STACK 0
|
||||||
|
@ -109,7 +112,6 @@ typedef struct {
|
||||||
void _IdleThread(void *p) __attribute__((noreturn));
|
void _IdleThread(void *p) __attribute__((noreturn));
|
||||||
|
|
||||||
void chSysHalt(void);
|
void chSysHalt(void);
|
||||||
void chSysSwitchI(Thread *otp, Thread *ntp);
|
|
||||||
void chSysPuts(char *msg);
|
void chSysPuts(char *msg);
|
||||||
void threadstart(void);
|
void threadstart(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue