projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
STM32: RTC: add missing include
[bertos.git]
/
bertos
/
cpu
/
irq.h
diff --git
a/bertos/cpu/irq.h
b/bertos/cpu/irq.h
index bda8b49729a60cf2c2807dc74edadc1187705fbb..8e8abe20802dd85f1a93efe69bba000172bd765e 100644
(file)
--- a/
bertos/cpu/irq.h
+++ b/
bertos/cpu/irq.h
@@
-148,7
+148,7
@@
}
#define IRQ_RUNNING() irq_running()
}
#define IRQ_RUNNING() irq_running()
- #if
CONFIG_KERN_PREEMPT
+ #if
(CONFIG_KERN && CONFIG_KERN_PREEMPT)
#define DECLARE_ISR_CONTEXT_SWITCH(func) \
void func(void); \
#define DECLARE_ISR_CONTEXT_SWITCH(func) \
void func(void); \
@@
-288,7
+288,7
@@
#define IRQ_ENABLED() ((CPU_READ_FLAGS() & 0xc0) != 0xc0)
#define IRQ_ENABLED() ((CPU_READ_FLAGS() & 0xc0) != 0xc0)
- #if
CONFIG_KERN_PREEMPT
+ #if
(CONFIG_KERN && CONFIG_KERN_PREEMPT)
EXTERN_C void asm_irq_switch_context(void);
/**
EXTERN_C void asm_irq_switch_context(void);
/**
@@
-350,7
+350,7
@@
__isr_##func(); \
IRQ_EXIT(); \
} \
__isr_##func(); \
IRQ_EXIT(); \
} \
- static void __isr_##func(void)
+ static
NOINLINE
void __isr_##func(void)
/**
* Interrupt service routine prototype: can be used for
* forward declarations.
/**
* Interrupt service routine prototype: can be used for
* forward declarations.
@@
-377,7
+377,7
@@
#endif /* CONFIG_KERN_PREEMPT */
#ifndef ISR_FUNC
#endif /* CONFIG_KERN_PREEMPT */
#ifndef ISR_FUNC
- #define ISR_FUNC
__attribute__((interrupt
))
+ #define ISR_FUNC
__attribute__((naked
))
#endif
#ifndef DECLARE_ISR
#define DECLARE_ISR(func) \
#endif
#ifndef DECLARE_ISR
#define DECLARE_ISR(func) \
@@
-394,9
+394,14
@@
static NOINLINE void __isr_##func(void); \
void ISR_FUNC func(void) \
{ \
static NOINLINE void __isr_##func(void); \
void ISR_FUNC func(void) \
{ \
+ asm volatile ( \
+ "sub lr, lr, #4\n\t" \
+ "stmfd sp!, {r0-r3, ip, lr}\n\t"); \
__isr_##func(); \
__isr_##func(); \
+ asm volatile ( \
+ "ldmfd sp!, {r0-r3, ip, pc}^\n\t"); \
} \
} \
- static void __isr_##func(void)
+ static
NOINLINE
void __isr_##func(void)
#endif
#ifndef DECLARE_ISR_CONTEXT_SWITCH
#define DECLARE_ISR_CONTEXT_SWITCH(func) DECLARE_ISR(func)
#endif
#ifndef DECLARE_ISR_CONTEXT_SWITCH
#define DECLARE_ISR_CONTEXT_SWITCH(func) DECLARE_ISR(func)
@@
-477,7
+482,7
@@
); \
(bool)(sreg & 0x80); \
})
); \
(bool)(sreg & 0x80); \
})
- #if
CONFIG_KERN_PREEMPT
+ #if
(CONFIG_KERN && CONFIG_KERN_PREEMPT)
#define DECLARE_ISR_CONTEXT_SWITCH(vect) \
INLINE void __isr_##vect(void); \
ISR(vect) \
#define DECLARE_ISR_CONTEXT_SWITCH(vect) \
INLINE void __isr_##vect(void); \
ISR(vect) \
@@
-522,6
+527,13
@@
#define ISR_PROTO_CONTEXT_SWITCH(vect) ISR(vect)
#endif
#define ISR_PROTO_CONTEXT_SWITCH(vect) ISR(vect)
#endif
+#elif CPU_MSP430
+
+ /* Get the compiler defined macros */
+ #include <signal.h>
+ #define IRQ_DISABLE dint()
+ #define IRQ_ENABLE eint()
+
#else
#error No CPU_... defined.
#endif
#else
#error No CPU_... defined.
#endif
@@
-551,7
+563,7
@@
#ifndef IRQ_PREEMPT_HANDLER
#ifndef IRQ_PREEMPT_HANDLER
- #if
CONFIG_KERN_PREEMPT
+ #if
(CONFIG_KERN && CONFIG_KERN_PREEMPT)
/**
* Handle preemptive context switch inside timer IRQ.
*/
/**
* Handle preemptive context switch inside timer IRQ.
*/