mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-01-11 18:33:16 +01:00
Add comments to critical region regarding nesting requirement.
This commit is contained in:
committed by
Himanshu Chauhan
parent
c0e238ffb2
commit
d06cbdc16a
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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__)
|
||||
|
||||
Reference in New Issue
Block a user