kernel: move z_is_thread_essential out of public kernel header

This is a private API to the kernel, so move out of kernel.h

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2023-09-18 10:28:13 -04:00 committed by Carles Cufí
commit e19f21cb27
4 changed files with 6 additions and 3 deletions

View file

@ -5950,8 +5950,6 @@ extern void z_init_static_threads(void);
/** /**
* @internal * @internal
*/ */
extern bool z_is_thread_essential(void);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
void z_smp_thread_init(void *arg, struct k_thread *thread); void z_smp_thread_init(void *arg, struct k_thread *thread);
void z_smp_thread_swap(void); void z_smp_thread_swap(void);

View file

@ -13,6 +13,8 @@
#include <zephyr/tracing/tracing.h> #include <zephyr/tracing/tracing.h>
#include <stdbool.h> #include <stdbool.h>
bool z_is_thread_essential(void);
BUILD_ASSERT(K_LOWEST_APPLICATION_THREAD_PRIO BUILD_ASSERT(K_LOWEST_APPLICATION_THREAD_PRIO
>= K_HIGHEST_APPLICATION_THREAD_PRIO); >= K_HIGHEST_APPLICATION_THREAD_PRIO);

View file

@ -327,7 +327,7 @@ ZTEST_USER(userspace, test_write_kerntext)
/* Try to write to kernel text. */ /* Try to write to kernel text. */
set_fault(K_ERR_CPU_EXCEPTION); set_fault(K_ERR_CPU_EXCEPTION);
memset(&z_is_thread_essential, 0, 4); memset(&k_current_get, 0, 4);
zassert_unreachable("Write to kernel text did not fault"); zassert_unreachable("Write to kernel text did not fault");
} }

View file

@ -6,7 +6,10 @@
#include <zephyr/ztest.h> #include <zephyr/ztest.h>
#include <zephyr/kernel.h> #include <zephyr/kernel.h>
#include <zephyr/kernel_structs.h> #include <zephyr/kernel_structs.h>
/* Internal APIs */
#include <kernel_internal.h> #include <kernel_internal.h>
#include <ksched.h>
struct k_thread kthread_thread; struct k_thread kthread_thread;
struct k_thread kthread_thread1; struct k_thread kthread_thread1;