Add comments to critical region regarding nesting requirement.

This commit is contained in:
Kelvin Lawson
2011-05-27 17:35:56 +01:00
committed by Himanshu Chauhan
parent c0e238ffb2
commit d06cbdc16a
3 changed files with 18 additions and 3 deletions

View File

@@ -60,7 +60,12 @@
#define POINTER void *
/* Critical region protection */
/**
* Critical region protection: this should disable interrupts
* to protect OS data structures during modification. It must
* allow nested calls, which means that interrupts should only
* be re-enabled when the outer CRITICAL_END() is reached.
*/
#define CRITICAL_STORE uint8_t sreg
#define CRITICAL_START() sreg = SREG; cli();
#define CRITICAL_END() SREG = sreg

View File

@@ -54,7 +54,12 @@
#define POINTER void *
/* Critical region protection */
/**
* Critical region protection: this should disable interrupts
* to protect OS data structures during modification. It must
* allow nested calls, which means that interrupts should only
* be re-enabled when the outer CRITICAL_END() is reached.
*/
#define CRITICAL_STORE uint8_t sreg
#define CRITICAL_START() sreg = SREG; cli();
#define CRITICAL_END() SREG = sreg

View File

@@ -60,7 +60,12 @@
#define POINTER void *
/* Critical region protection */
/**
* Critical region protection: this should disable interrupts
* to protect OS data structures during modification. It must
* allow nested calls, which means that interrupts should only
* be re-enabled when the outer CRITICAL_END() is reached.
*/
/* COSMIC: Use inline assembler */
#if defined(__CSMC__)