Skip to content

Commit bd65251

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 34fdc56 commit bd65251

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

include/sys/task.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -108,39 +108,6 @@ extern kcb_t *kcb;
108108
/* Task lookup cache size for frequently accessed tasks */
109109
#define TASK_CACHE_SIZE 4
110110

111-
/* Disables/enables ALL maskable interrupts globally.
112-
* This provides the strongest protection against concurrency from both other
113-
* tasks and all ISRs. Use this when modifying data shared with any ISR.
114-
* WARNING: This increases interrupt latency. Use NOSCHED macros if protection
115-
* is only needed against task preemption.
116-
*/
117-
#define CRITICAL_ENTER() \
118-
do { \
119-
if (kcb->preemptive) \
120-
_di(); \
121-
} while (0)
122-
#define CRITICAL_LEAVE() \
123-
do { \
124-
if (kcb->preemptive) \
125-
_ei(); \
126-
} while (0)
127-
128-
/* Disables/enables ONLY the scheduler timer interrupt.
129-
* This is a lighter-weight critical section that prevents task preemption but
130-
* allows other hardware interrupts (e.g., UART) to be serviced, minimizing
131-
* latency. Use this when protecting data shared between tasks.
132-
*/
133-
#define NOSCHED_ENTER() \
134-
do { \
135-
if (kcb->preemptive) \
136-
hal_timer_disable(); \
137-
} while (0)
138-
#define NOSCHED_LEAVE() \
139-
do { \
140-
if (kcb->preemptive) \
141-
hal_timer_enable(); \
142-
} while (0)
143-
144111
/* Core Kernel and Task Management API */
145112

146113
/* Prints a fatal error message and halts the system. */

0 commit comments

Comments
 (0)