Skip to content

Commit a23914c

Browse files
committed
Remove obsolete NOSCHED_ENTER/LEAVE and CRITICAL_ENTER/LEAVE macros
All calls to NOSCHED_ENTER(), NOSCHED_LEAVE(), CRITICAL_ENTER(), and CRITICAL_LEAVE() have been replaced with spinlock-based synchronization primitives throughout the kernel. As a result, these macros are no longer used and have been removed from include/sys/task.h to clean up the codebase and avoid confusion.
1 parent 1686929 commit a23914c

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

include/sys/task.h

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -117,48 +117,6 @@ extern kcb_t *kcb;
117117
#define TASK_CACHE_SIZE \
118118
4 /* Task lookup cache size for frequently accessed tasks */
119119

120-
/* Critical Section Macros
121-
*
122-
* Two levels of protection are provided:
123-
* 1. CRITICAL_* macros disable ALL maskable interrupts globally
124-
* 2. NOSCHED_* macros disable ONLY the scheduler timer interrupt
125-
*/
126-
127-
/* Disable/enable ALL maskable interrupts globally.
128-
* Provides strongest protection against concurrency from both other tasks
129-
* and all ISRs. Use when modifying data shared with any ISR.
130-
* WARNING: Increases interrupt latency - use NOSCHED macros if protection
131-
* is only needed against task preemption.
132-
*/
133-
#define CRITICAL_ENTER() \
134-
do { \
135-
if (kcb->preemptive) \
136-
_di(); \
137-
} while (0)
138-
139-
#define CRITICAL_LEAVE() \
140-
do { \
141-
if (kcb->preemptive) \
142-
_ei(); \
143-
} while (0)
144-
145-
/* Disable/enable ONLY the scheduler timer interrupt.
146-
* Lighter-weight critical section that prevents task preemption but allows
147-
* other hardware interrupts (e.g., UART) to be serviced, minimizing latency.
148-
* Use when protecting data shared between tasks.
149-
*/
150-
#define NOSCHED_ENTER() \
151-
do { \
152-
if (kcb->preemptive) \
153-
hal_timer_disable(); \
154-
} while (0)
155-
156-
#define NOSCHED_LEAVE() \
157-
do { \
158-
if (kcb->preemptive) \
159-
hal_timer_enable(); \
160-
} while (0)
161-
162120
/* Core Kernel and Task Management API */
163121

164122
/* System Control Functions */

0 commit comments

Comments
 (0)