aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/ports/AVR/nilcore.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-01-28 10:03:16 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-01-28 10:03:16 +0000
commit6d6546dac1f6d8848df3037b7c32176c34745b1c (patch)
tree90e354558fd523fa004757c56fdc0d65bad890a5 /os/nil/ports/AVR/nilcore.h
parentcae2586a0a9f7ebe67bdf29974510066d046af3d (diff)
downloadChibiOS-6d6546dac1f6d8848df3037b7c32176c34745b1c.tar.gz
ChibiOS-6d6546dac1f6d8848df3037b7c32176c34745b1c.tar.bz2
ChibiOS-6d6546dac1f6d8848df3037b7c32176c34745b1c.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6650 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/nil/ports/AVR/nilcore.h')
-rw-r--r--os/nil/ports/AVR/nilcore.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/os/nil/ports/AVR/nilcore.h b/os/nil/ports/AVR/nilcore.h
index 32d2ea835..6394eeb0b 100644
--- a/os/nil/ports/AVR/nilcore.h
+++ b/os/nil/ports/AVR/nilcore.h
@@ -238,10 +238,7 @@ struct port_intctx {
* @details This macro must be inserted at the end of all IRQ handlers
* enabled to invoke system APIs.
*/
-#define PORT_IRQ_EPILOGUE() { \
- if (chSchIsRescRequiredI()) \
- chSchRescheduleS(); \
-}
+#define PORT_IRQ_EPILOGUE() chSchRescheduleS()
/**
* @brief IRQ handler function declaration.
@@ -255,7 +252,7 @@ struct port_intctx {
* @note @p id can be a function name or a vector number depending on the
* port implementation.
*/
-#define PORT_FAST_IRQ_HANDLER(id) void id(void)
+#define PORT_FAST_IRQ_HANDLER(id) ISR(id)
/**
* @brief Performs a context switch between two threads.
@@ -345,6 +342,7 @@ static inline bool port_is_isr_context(void) {
*/
static inline void port_lock(void) {
+ asm volatile ("cli" : : : "memory");
}
/**
@@ -352,10 +350,12 @@ static inline void port_lock(void) {
*/
static inline void port_unlock(void) {
+ asm volatile ("sei" : : : "memory");
}
/**
* @brief Kernel-lock action from an interrupt handler.
+ * @note This function is empty in this port.
*/
static inline void port_lock_from_isr(void) {
@@ -363,6 +363,7 @@ static inline void port_lock_from_isr(void) {
/**
* @brief Kernel-unlock action from an interrupt handler.
+ * @note This function is empty in this port.
*/
static inline void port_unlock_from_isr(void) {
@@ -373,6 +374,7 @@ static inline void port_unlock_from_isr(void) {
*/
static inline void port_disable(void) {
+ asm volatile ("cli" : : : "memory");
}
/**
@@ -380,6 +382,7 @@ static inline void port_disable(void) {
*/
static inline void port_suspend(void) {
+ asm volatile ("cli" : : : "memory");
}
/**
@@ -387,6 +390,7 @@ static inline void port_suspend(void) {
*/
static inline void port_enable(void) {
+ asm volatile ("sei" : : : "memory");
}
/**
@@ -398,6 +402,7 @@ static inline void port_enable(void) {
*/
static inline void port_wait_for_interrupt(void) {
+ asm volatile ("sleep" : : : "memory");
}
/**