As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>. This patch proposes to then include <zephyr/kernel.h> instead of <zephyr/zephyr.h> since it is more clear that you are including the Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a catch-all header that may be confusing. Most applications need to include a bunch of other things to compile, e.g. driver headers or subsystem headers like BT, logging, etc. The idea of a catch-all header in Zephyr is probably not feasible anyway. Reason is that Zephyr is not a library, like it could be for example `libpython`. Zephyr provides many utilities nowadays: a kernel, drivers, subsystems, etc and things will likely grow. A catch-all header would be massive, difficult to keep up-to-date. It is also likely that an application will only build a small subset. Note that subsystem-level headers may use a catch-all approach to make things easier, though. NOTE: This patch is **NOT** removing the header, just removing its usage in-tree. I'd advocate for its deprecation (add a #warning on it), but I understand many people will have concerns. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
60 lines
1.7 KiB
C
60 lines
1.7 KiB
C
/*
|
|
* Copyright (c) 2016 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef __TEST_SCHED_H__
|
|
#define __TEST_SCHED_H__
|
|
|
|
#include <zephyr/kernel.h>
|
|
#include <zephyr/ztest.h>
|
|
|
|
#define MAX_NUM_THREAD 10
|
|
#define STACK_SIZE (640 + CONFIG_TEST_EXTRA_STACK_SIZE)
|
|
|
|
K_THREAD_STACK_DECLARE(tstack, STACK_SIZE);
|
|
K_THREAD_STACK_ARRAY_DECLARE(tstacks, MAX_NUM_THREAD, STACK_SIZE);
|
|
extern struct k_thread user_thread;
|
|
extern struct k_sem user_sem;
|
|
|
|
struct thread_data {
|
|
k_tid_t tid;
|
|
int priority;
|
|
int executed;
|
|
};
|
|
|
|
void spin_for_ms(int ticks);
|
|
|
|
void test_priority_cooperative(void);
|
|
void test_priority_preemptible(void);
|
|
void test_priority_preemptible_wait_prio(void);
|
|
void test_bad_priorities(void);
|
|
void test_yield_cooperative(void);
|
|
void test_sleep_cooperative(void);
|
|
void test_busy_wait_cooperative(void);
|
|
void test_sleep_wakeup_preemptible(void);
|
|
void test_pending_thread_wakeup(void);
|
|
void test_time_slicing_preemptible(void);
|
|
void test_time_slicing_disable_preemptible(void);
|
|
void test_lock_preemptible(void);
|
|
void test_unlock_preemptible(void);
|
|
void test_unlock_nested_sched_lock(void);
|
|
void test_sched_is_preempt_thread(void);
|
|
void test_slice_reset(void);
|
|
void test_slice_scheduling(void);
|
|
void test_priority_scheduling(void);
|
|
void test_wakeup_expired_timer_thread(void);
|
|
void test_user_k_wakeup(void);
|
|
void test_user_k_is_preempt(void);
|
|
void test_k_thread_suspend_init_null(void);
|
|
void test_k_thread_resume_init_null(void);
|
|
void test_k_thread_priority_get_init_null(void);
|
|
void test_k_thread_priority_set_init_null(void);
|
|
void test_k_thread_priority_set_overmax(void);
|
|
void test_k_thread_priority_set_upgrade(void);
|
|
void test_k_wakeup_init_null(void);
|
|
void test_slice_perthread(void);
|
|
|
|
#endif /* __TEST_SCHED_H__ */
|