diff --git a/arch/arc/core/thread.c b/arch/arc/core/thread.c index 71f9184d77c..aa88b3e42bb 100644 --- a/arch/arc/core/thread.c +++ b/arch/arc/core/thread.c @@ -82,7 +82,7 @@ static ALWAYS_INLINE void thread_monitor_init(struct tcs *tcs) * @param parameter2 second param to entry point * @param parameter3 third param to entry point * @param priority thread priority - * @param options thread options: ESSENTIAL + * @param options thread options: K_ESSENTIAL * * @return N/A */ diff --git a/arch/arc/include/nano_private.h b/arch/arc/include/nano_private.h index c88f7b11b4b..d244f3c623b 100644 --- a/arch/arc/include/nano_private.h +++ b/arch/arc/include/nano_private.h @@ -161,7 +161,7 @@ typedef struct callee_saved tCalleeSaved; #endif #define USE_FP 0x010 /* 1 = thread uses floating point unit */ -#define ESSENTIAL 0x200 /* 1 = system thread that must not abort */ +#define K_ESSENTIAL 0x200 /* 1 = system thread that must not abort */ #define NO_METRICS 0x400 /* 1 = _Swap() not to update task metrics */ /* stacks */ diff --git a/arch/arm/core/thread.c b/arch/arm/core/thread.c index 0d72b967113..0ac1a55fbd4 100644 --- a/arch/arm/core/thread.c +++ b/arch/arm/core/thread.c @@ -77,7 +77,7 @@ static ALWAYS_INLINE void thread_monitor_init(struct tcs *tcs) * @param parameter2 entry point to the second param * @param parameter3 entry point to the third param * @param priority thread priority - * @param options thread options: ESSENTIAL, USE_FP + * @param options thread options: K_ESSENTIAL, USE_FP * * @return N/A */ diff --git a/arch/arm/include/nano_private.h b/arch/arm/include/nano_private.h index a92dbad22c0..fe2ac68757e 100644 --- a/arch/arm/include/nano_private.h +++ b/arch/arm/include/nano_private.h @@ -125,7 +125,7 @@ typedef struct preempt tPreempt; #endif #define USE_FP 0x010 /* 1 = thread uses floating point unit */ -#define ESSENTIAL 0x200 /* 1 = system thread that must not abort */ +#define K_ESSENTIAL 0x200 /* 1 = system thread that must not abort */ #define NO_METRICS 0x400 /* 1 = _Swap() not to update task metrics */ /* stacks */ diff --git a/arch/nios2/include/nano_private.h b/arch/nios2/include/nano_private.h index beee5564526..9c5a5231dde 100644 --- a/arch/nios2/include/nano_private.h +++ b/arch/nios2/include/nano_private.h @@ -73,7 +73,7 @@ extern "C" { #define INT_ACTIVE 0x002 /* 1 = executing context is interrupt handler */ #define EXC_ACTIVE 0x004 /* 1 = executing context is exception handler */ #define USE_FP 0x010 /* 1 = thread uses floating point unit */ -#define ESSENTIAL 0x200 /* 1 = system thread that must not abort */ +#define K_ESSENTIAL 0x200 /* 1 = system thread that must not abort */ #define NO_METRICS 0x400 /* 1 = _Swap() not to update task metrics */ /* stacks */ diff --git a/arch/x86/core/thread.c b/arch/x86/core/thread.c index 7967a9fa5a5..a773b429333 100644 --- a/arch/x86/core/thread.c +++ b/arch/x86/core/thread.c @@ -81,7 +81,7 @@ static ALWAYS_INLINE void thread_monitor_init(struct tcs *tcs) * @param pStackMem pointer to thread stack memory * @param stackSize size of a stack in bytes * @param priority thread priority - * @param options thread options: ESSENTIAL, USE_FP, USE_SSE + * @param options thread options: K_ESSENTIAL, USE_FP, USE_SSE * * @return N/A */ @@ -325,7 +325,7 @@ __asm__("\t.globl _thread_entry\n" * @param parameter2 second param to entry point * @param parameter3 third param to entry point * @param priority thread priority - * @param options thread options: ESSENTIAL, USE_FP, USE_SSE + * @param options thread options: K_ESSENTIAL, USE_FP, USE_SSE * * * @return opaque pointer to initialized TCS structure diff --git a/arch/x86/include/nano_private.h b/arch/x86/include/nano_private.h index 68a3b5d0868..d9efde20d63 100644 --- a/arch/x86/include/nano_private.h +++ b/arch/x86/include/nano_private.h @@ -89,7 +89,7 @@ #define EXC_ACTIVE 0x4 /* 1 = executing context is exception handler */ #define USE_FP 0x10 /* 1 = thread uses floating point unit */ #define USE_SSE 0x20 /* 1 = thread uses SSEx instructions */ -#define ESSENTIAL 0x200 /* 1 = system thread that must not abort */ +#define K_ESSENTIAL 0x200 /* 1 = system thread that must not abort */ #define NO_METRICS 0x400 /* 1 = _Swap() not to update task metrics */ #define NO_METRICS_BIT_OFFSET 0xa /* Bit position of NO_METRICS */ diff --git a/doc/kernel_v2/threads/lifecycle.rst b/doc/kernel_v2/threads/lifecycle.rst index e0a2775df4e..4f4904f2cae 100644 --- a/doc/kernel_v2/threads/lifecycle.rst +++ b/doc/kernel_v2/threads/lifecycle.rst @@ -121,7 +121,7 @@ A thread that requires a thread option specifies it by name, using the The following thread options are supported. -:c:macro:`ESSENTIAL` +:c:macro:`K_ESSENTIAL` This option tags the thread as an :dfn:`essential thread`. This instructs the kernel to treat the termination or aborting of the thread as a fatal system error. diff --git a/kernel/nanokernel/nano_context.c b/kernel/nanokernel/nano_context.c index d22a2b23162..fec5599b824 100644 --- a/kernel/nanokernel/nano_context.c +++ b/kernel/nanokernel/nano_context.c @@ -59,7 +59,7 @@ nano_context_type_t sys_execution_context_type_get(void) */ void _thread_essential_set(void) { - _nanokernel.current->flags |= ESSENTIAL; + _nanokernel.current->flags |= K_ESSENTIAL; } /** @@ -74,7 +74,7 @@ void _thread_essential_set(void) */ void _thread_essential_clear(void) { - _nanokernel.current->flags &= ~ESSENTIAL; + _nanokernel.current->flags &= ~K_ESSENTIAL; } /** @@ -88,7 +88,7 @@ void _thread_essential_clear(void) */ int _is_thread_essential(void) { - return _nanokernel.current->flags & ESSENTIAL; + return _nanokernel.current->flags & K_ESSENTIAL; } void sys_thread_busy_wait(uint32_t usec_to_wait) diff --git a/kernel/nanokernel/nano_init.c b/kernel/nanokernel/nano_init.c index 082bd3c4f1f..f3739a59aa9 100644 --- a/kernel/nanokernel/nano_init.c +++ b/kernel/nanokernel/nano_init.c @@ -210,7 +210,7 @@ static void nano_init(struct tcs *dummyOutContext) */ dummyOutContext->link = (struct tcs *)NULL; - dummyOutContext->flags = FIBER | ESSENTIAL; + dummyOutContext->flags = FIBER | K_ESSENTIAL; dummyOutContext->prio = 0; @@ -249,7 +249,7 @@ static void nano_init(struct tcs *dummyOutContext) * operates on _nanokernel.current, not _nanokernel.task ... */ - _nanokernel.task->flags |= ESSENTIAL; + _nanokernel.task->flags |= K_ESSENTIAL; initialize_nano_timeouts(); diff --git a/kernel/unified/init.c b/kernel/unified/init.c index af94d134a4b..24c63703c93 100644 --- a/kernel/unified/init.c +++ b/kernel/unified/init.c @@ -195,7 +195,7 @@ static void _main(void *unused1, void *unused2, void *unused3) _init_static_threads(); - _main_thread->flags &= ~ESSENTIAL; + _main_thread->flags &= ~K_ESSENTIAL; #ifdef CONFIG_BOOT_TIME_MEASUREMENT /* record timestamp for kernel's _main() function */ @@ -249,7 +249,7 @@ static void prepare_multithreading(struct k_thread *dummy_thread) * Do not insert dummy execution context in the list of fibers, so * that it does not get scheduled back in once context-switched out. */ - dummy_thread->flags = ESSENTIAL; + dummy_thread->flags = K_ESSENTIAL; dummy_thread->prio = K_PRIO_COOP(0); /* _nanokernel.ready_q is all zeroes */ @@ -273,13 +273,13 @@ static void prepare_multithreading(struct k_thread *dummy_thread) _new_thread(main_stack, MAIN_STACK_SIZE, NULL, _main, NULL, NULL, NULL, - CONFIG_MAIN_THREAD_PRIORITY, ESSENTIAL); + CONFIG_MAIN_THREAD_PRIORITY, K_ESSENTIAL); _mark_thread_as_started(_main_thread); _add_thread_to_ready_q(_main_thread); _new_thread(idle_stack, IDLE_STACK_SIZE, NULL, idle, NULL, NULL, NULL, - K_LOWEST_THREAD_PRIO, ESSENTIAL); + K_LOWEST_THREAD_PRIO, K_ESSENTIAL); _mark_thread_as_started(_idle_thread); _add_thread_to_ready_q(_idle_thread); diff --git a/kernel/unified/thread.c b/kernel/unified/thread.c index 47fc2ff2ecc..02848603c07 100644 --- a/kernel/unified/thread.c +++ b/kernel/unified/thread.c @@ -67,7 +67,7 @@ int k_am_in_isr(void) */ void _thread_essential_set(void) { - _current->flags |= ESSENTIAL; + _current->flags |= K_ESSENTIAL; } /* @@ -77,7 +77,7 @@ void _thread_essential_set(void) */ void _thread_essential_clear(void) { - _current->flags &= ~ESSENTIAL; + _current->flags &= ~K_ESSENTIAL; } /* @@ -87,7 +87,7 @@ void _thread_essential_clear(void) */ int _is_thread_essential(void) { - return _current->flags & ESSENTIAL; + return _current->flags & K_ESSENTIAL; } void k_busy_wait(uint32_t usec_to_wait)