/Zephyr-Core-3.5.0/samples/kernel/condition_variables/simple/ |
D | README.rst | 11 to signal changing states (conditions) from worker thread to the main 12 thread. Main thread uses a condition variable to wait for a condition to 13 become true. Main thread and the worker thread alternate between their 14 execution based on when the worker thread signals the main thread that is 38 [thread 0] working (0/5) 39 [thread 1] working (0/5) 40 [thread 2] working (0/5) 41 [thread 3] working (0/5) 42 [thread 4] working (0/5) 43 [thread 5] working (0/5) [all …]
|
/Zephyr-Core-3.5.0/kernel/ |
D | sched.c | 42 struct k_thread *thread); 44 struct k_thread *thread); 60 static void end_thread(struct k_thread *thread); 63 static inline int is_preempt(struct k_thread *thread) in is_preempt() argument 66 return thread->base.preempt <= _PREEMPT_THRESHOLD; in is_preempt() 74 static inline int is_metairq(struct k_thread *thread) in is_metairq() argument 77 return (thread->base.prio - K_HIGHEST_THREAD_PRIO) in is_metairq() 80 ARG_UNUSED(thread); in is_metairq() 86 static inline bool is_thread_dummy(struct k_thread *thread) in is_thread_dummy() argument 88 return (thread->base.thread_state & _THREAD_DUMMY) != 0U; in is_thread_dummy() [all …]
|
/Zephyr-Core-3.5.0/subsys/tracing/user/ |
D | tracing_user.c | 11 void __weak sys_trace_thread_create_user(struct k_thread *thread) {} in sys_trace_thread_create_user() argument 12 void __weak sys_trace_thread_abort_user(struct k_thread *thread) {} in sys_trace_thread_abort_user() argument 13 void __weak sys_trace_thread_suspend_user(struct k_thread *thread) {} in sys_trace_thread_suspend_user() argument 14 void __weak sys_trace_thread_resume_user(struct k_thread *thread) {} in sys_trace_thread_resume_user() argument 15 void __weak sys_trace_thread_name_set_user(struct k_thread *thread) {} in sys_trace_thread_name_set_user() argument 18 void __weak sys_trace_thread_info_user(struct k_thread *thread) {} in sys_trace_thread_info_user() argument 19 void __weak sys_trace_thread_sched_ready_user(struct k_thread *thread) {} in sys_trace_thread_sched_ready_user() argument 20 void __weak sys_trace_thread_pend_user(struct k_thread *thread) {} in sys_trace_thread_pend_user() argument 21 void __weak sys_trace_thread_priority_set_user(struct k_thread *thread, int prio) {} in sys_trace_thread_priority_set_user() argument 26 void sys_trace_thread_create(struct k_thread *thread) in sys_trace_thread_create() argument [all …]
|
/Zephyr-Core-3.5.0/doc/kernel/services/threads/ |
D | index.rst | 16 A :dfn:`thread` is a kernel object that is used for application processing 20 available RAM). Each thread is referenced by a :dfn:`thread id` that is assigned 21 when the thread is spawned. 23 A thread has the following key properties: 25 * A **stack area**, which is a region of memory used for the thread's stack. 27 of the thread's processing. Special macros exist to create and work with 30 * A **thread control block** for private kernel bookkeeping of the thread's 33 * An **entry point function**, which is invoked when the thread is started. 37 allocate CPU time to the thread. (See :ref:`scheduling_v2`.) 39 * A set of **thread options**, which allow the thread to receive special [all …]
|
D | system_threads.rst | 10 A :dfn:`system thread` is a thread that the kernel spawns automatically 15 **Main thread** 16 This thread performs kernel initialization, then calls the application's 19 By default, the main thread uses the highest configured preemptible thread 21 threads, the main thread uses the lowest configured cooperative thread 24 The main thread is an essential thread while it is performing kernel 26 this means a fatal system error is raised if the thread aborts. If 28 return, the main thread terminates normally and no error is raised. 30 **Idle thread** 31 This thread executes when there is no other work for the system to do. [all …]
|
/Zephyr-Core-3.5.0/samples/kernel/condition_variables/condvar/ |
D | README.rst | 12 to signal changing states (conditions) from one thread to another 13 thread. A thread uses a condition variable to wait for a condition to 15 function execution based on when they signal the other thread that is 39 Starting watch_count: thread 1 40 watch_count: thread 1 Count= 0. Going into wait... 41 inc_count: thread 2, count = 1, unlocking mutex 42 inc_count: thread 3, count = 2, unlocking mutex 43 inc_count: thread 2, count = 3, unlocking mutex 44 inc_count: thread 3, count = 4, unlocking mutex 45 inc_count: thread 2, count = 5, unlocking mutex [all …]
|
/Zephyr-Core-3.5.0/arch/arc/core/ |
D | thread.c | 9 * @brief New thread creation for ARCv2 11 * Core thread related primitives for the ARCv2 processor architecture. 45 static bool is_user(struct k_thread *thread) in is_user() argument 47 return (thread->base.user_options & K_USER) != 0; in is_user() 51 /* Set all stack-related architecture variables for the provided thread */ 52 static void setup_stack_vars(struct k_thread *thread) in setup_stack_vars() argument 55 if (is_user(thread)) { in setup_stack_vars() 57 thread->arch.priv_stack_start = in setup_stack_vars() 58 (uint32_t)z_priv_stack_find(thread->stack_obj); in setup_stack_vars() 60 thread->arch.priv_stack_start = (uint32_t)(thread->stack_obj); in setup_stack_vars() [all …]
|
/Zephyr-Core-3.5.0/subsys/tracing/ctf/ |
D | ctf_top.c | 13 static void _get_thread_name(struct k_thread *thread, in _get_thread_name() argument 16 const char *tname = k_thread_name_get(thread); in _get_thread_name() 28 struct k_thread *thread; in sys_trace_k_thread_switched_out() local 30 thread = k_sched_current_thread_query(); in sys_trace_k_thread_switched_out() 31 _get_thread_name(thread, &name); in sys_trace_k_thread_switched_out() 33 ctf_top_thread_switched_out((uint32_t)(uintptr_t)thread, name); in sys_trace_k_thread_switched_out() 38 struct k_thread *thread; in sys_trace_k_thread_switched_in() local 41 thread = k_sched_current_thread_query(); in sys_trace_k_thread_switched_in() 42 _get_thread_name(thread, &name); in sys_trace_k_thread_switched_in() 44 ctf_top_thread_switched_in((uint32_t)(uintptr_t)thread, name); in sys_trace_k_thread_switched_in() [all …]
|
/Zephyr-Core-3.5.0/kernel/include/ |
D | ksched.h | 42 void z_move_thread_to_end_of_prio_q(struct k_thread *thread); 43 int z_is_thread_time_slicing(struct k_thread *thread); 44 void z_unpend_thread_no_timeout(struct k_thread *thread); 49 void z_pend_thread(struct k_thread *thread, _wait_q_t *wait_q, 54 void z_unpend_thread(struct k_thread *thread); 56 void z_thread_priority_set(struct k_thread *thread, int prio); 57 bool z_set_prio(struct k_thread *thread, int prio); 62 void z_sched_abort(struct k_thread *thread); 64 void z_sched_start(struct k_thread *thread); 65 void z_ready_thread(struct k_thread *thread); [all …]
|
/Zephyr-Core-3.5.0/doc/kernel/services/data_passing/ |
D | mailboxes.rst | 31 A thread that sends a message is known as the **sending thread**, 32 while a thread that receives the message is known as the **receiving thread**. 33 Each message may be received by only one thread (i.e. point-to-multipoint and 38 (and even specify) the identity of the other thread. 45 Both the sending thread and the receiving thread supply a message descriptor 55 A **message buffer** is an area of memory provided by the thread that sends or 69 it is given to a mailbox by the sending thread. The message is then owned 70 by the mailbox until it is given to a receiving thread. The receiving thread 75 Thread Compatibility 78 A sending thread can specify the address of the thread to which the message [all …]
|
/Zephyr-Core-3.5.0/subsys/tracing/sysview/ |
D | sysview_config.c | 20 static void set_thread_name(char *name, struct k_thread *thread) in set_thread_name() argument 22 const char *tname = k_thread_name_get(thread); in set_thread_name() 29 thread, &thread->entry); in set_thread_name() 33 void sys_trace_thread_info(struct k_thread *thread) in sys_trace_thread_info() argument 37 set_thread_name(name, thread); in sys_trace_thread_info() 41 Info.TaskID = (uint32_t)(uintptr_t)thread; in sys_trace_thread_info() 43 Info.Prio = thread->base.prio; in sys_trace_thread_info() 44 Info.StackBase = thread->stack_info.size; in sys_trace_thread_info() 45 Info.StackSize = thread->stack_info.start; in sys_trace_thread_info() 60 struct k_thread *thread; in send_task_list_cb() local [all …]
|
/Zephyr-Core-3.5.0/tests/kernel/context/ |
D | README.txt | 12 - start a helper thread to help with k_yield() tests 13 - start a thread to test thread related functionality 16 - Called by a higher priority thread when there is another thread 17 - Called by an equal priority thread when there is another thread 18 - Called by a lower priority thread when there is another thread 22 - Called from an ISR (interrupted a thread) 24 - Called from a thread 28 - Called from an ISR that interrupted a thread 30 - Called from a thread 81 tc_start() - Test kernel CPU and thread routines [all …]
|
/Zephyr-Core-3.5.0/arch/sparc/core/ |
D | thread.c | 10 void z_thread_entry_wrapper(k_thread_entry_t thread, 19 * required if we need to taken a trap (interrupt) in the thread entry wrapper. 31 void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, in arch_new_thread() argument 40 thread->callee_saved.i0 = (uint32_t) entry; in arch_new_thread() 41 thread->callee_saved.i1 = (uint32_t) p1; in arch_new_thread() 42 thread->callee_saved.i2 = (uint32_t) p2; in arch_new_thread() 43 thread->callee_saved.i3 = (uint32_t) p3; in arch_new_thread() 44 thread->callee_saved.i6 = 0; /* frame pointer */ in arch_new_thread() 45 thread->callee_saved.o6 = (uint32_t) iframe; /* stack pointer */ in arch_new_thread() 46 thread->callee_saved.o7 = (uint32_t) z_thread_entry_wrapper - 8; in arch_new_thread() [all …]
|
/Zephyr-Core-3.5.0/doc/kernel/services/scheduling/ |
D | index.rst | 12 The scheduler determines which thread is allowed to execute 13 at any point in time; this thread is known as the **current thread**. 16 opportunity to change the identity of the current thread. These points 19 - transition of a thread from running state to a suspended or waiting 21 - transition of a thread to the :ref:`ready state <thread_states>`, for 23 - return to thread context after processing an interrupt 24 - when a running thread invokes :c:func:`k_yield` 26 A thread **sleeps** when it voluntarily initiates an operation that 29 Whenever the scheduler changes the identity of the current thread, 30 or when execution of the current thread is replaced by an ISR, [all …]
|
/Zephyr-Core-3.5.0/arch/x86/core/intel64/ |
D | thread.c | 13 extern void x86_sse_init(struct k_thread *thread); /* in locore.S */ 28 void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, in arch_new_thread() argument 39 switch_entry = z_x86_userspace_prepare_thread(thread); in arch_new_thread() 40 thread->arch.cs = X86_KERNEL_CS; in arch_new_thread() 41 thread->arch.ss = X86_KERNEL_DS; in arch_new_thread() 47 thread->callee_saved.rsp = (long) iframe; in arch_new_thread() 48 thread->callee_saved.rip = (long) switch_entry; in arch_new_thread() 49 thread->callee_saved.rflags = EFLAGS_INITIAL; in arch_new_thread() 52 * thread->callee_saved.rip in arch_new_thread() 54 thread->arch.rdi = (long) entry; in arch_new_thread() [all …]
|
/Zephyr-Core-3.5.0/tests/kernel/threads/thread_apis/src/ |
D | test_threads_cancel_abort.c | 25 /**TESTPOINT: abort current thread*/ in thread_entry_abort() 34 * @brief Validate k_thread_abort() when called by current thread 36 * @details Create a user thread and let the thread execute. 37 * Then call k_thread_abort() and check if the thread is terminated. 38 * Here the main thread is also a user thread. 48 /**TESTPOINT: spawned thread executed but abort itself*/ in ZTEST_USER() 54 * @brief Validate k_thread_abort() when called by other thread 56 * @details Create a user thread and abort the thread before its 57 * execution. Create a another user thread and abort the thread 71 /**TESTPOINT: check not-started thread is aborted*/ in ZTEST_USER() [all …]
|
D | test_threads_spawn.c | 40 * @brief Check the parameters passed to thread entry function 42 * @details Create an user thread and pass 2 variables and a 43 * semaphore to a thread entry function. Check for the correctness 58 * @brief Spawn thread with higher priority 60 * @details Create an user thread with priority greater than 61 * current thread and check its behavior. 67 /* spawn thread with higher priority */ in ZTEST() 76 * @brief Spawn thread with a delay 78 * @details Create a user thread with delay and check if the 79 * thread entry function is executed only after the timeout occurs. [all …]
|
/Zephyr-Core-3.5.0/arch/arm/core/cortex_m/ |
D | thread.c | 10 * @brief New thread creation for ARM Cortex-M 12 * Core thread related primitives for the ARM Cortex-M 59 void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, in arch_new_thread() argument 71 thread->stack_info.start += MPU_GUARD_ALIGN_AND_SIZE; in arch_new_thread() 72 thread->stack_info.size -= MPU_GUARD_ALIGN_AND_SIZE; in arch_new_thread() 76 if ((thread->base.user_options & K_FP_REGS) != 0) { in arch_new_thread() 82 thread->stack_info.start += FP_GUARD_EXTRA_SIZE; in arch_new_thread() 83 thread->stack_info.size -= FP_GUARD_EXTRA_SIZE; in arch_new_thread() 90 if ((thread->base.user_options & K_USER) != 0) { in arch_new_thread() 109 thread->callee_saved.psp = (uint32_t)iframe; in arch_new_thread() [all …]
|
/Zephyr-Core-3.5.0/arch/arm/core/cortex_a_r/ |
D | thread.c | 10 * @brief New thread creation for ARM Cortex-A and Cortex-R 12 * Core thread related primitives for the ARM Cortex-A and 51 void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, in arch_new_thread() argument 63 thread->stack_info.start += MPU_GUARD_ALIGN_AND_SIZE; in arch_new_thread() 64 thread->stack_info.size -= MPU_GUARD_ALIGN_AND_SIZE; in arch_new_thread() 68 if ((thread->base.user_options & K_FP_REGS) != 0) { in arch_new_thread() 74 thread->stack_info.start += FP_GUARD_EXTRA_SIZE; in arch_new_thread() 75 thread->stack_info.size -= FP_GUARD_EXTRA_SIZE; in arch_new_thread() 82 if ((thread->base.user_options & K_USER) != 0) { in arch_new_thread() 107 thread->callee_saved.psp = (uint32_t)iframe; in arch_new_thread() [all …]
|
/Zephyr-Core-3.5.0/tests/kernel/fifo/fifo_usage/src/ |
D | main.c | 14 * Test Thread enters items into a fifo, starts the Child Thread 15 * and waits for a semaphore. Child thread extracts all items from 16 * the fifo and enters some items back into the fifo. Child Thread 17 * gives the semaphore for Test Thread to continue. Once the control 18 * is returned back to Test Thread, it extracts all items from the fifo. 21 * Test Thread enters an item into fifo2, starts a Child Thread and 22 * extract an item from fifo1 once the item is there. The Child Thread 24 * an item to fifo1. The flow of control goes from Test Thread to 25 * Child Thread and so forth. 28 * Tests the ISR interfaces. Test thread puts items into fifo2 and gives [all …]
|
/Zephyr-Core-3.5.0/drivers/sensor/adt7310/ |
D | Kconfig | 25 Sets thread type for the interrupt handler. 31 bool "Use global thread" 34 Use a global thread for the interrupt handler. 37 bool "Use own thread" 40 Use a separate thread for the interrupt handler. 47 int "Thread priority of the interrupt handler" 50 Thread priority of the interrupt handler. A higher number implies a 51 higher priority. The thread is cooperative and will not be interrupted by 52 another thread until execution is released. 55 int "Stack size of the interrupt handler thread" [all …]
|
/Zephyr-Core-3.5.0/samples/userspace/syscall_perf/ |
D | README.rst | 7 user thread has to go through a system call compared to a supervisor thread that 14 This application creates a supervisor and a user thread. 16 current thread. The user thread has to go through a system call. 27 User thread: 18012 cycles 748 instructions 28 Supervisor thread: 7 cycles 4 instructions 29 User thread: 20136 cycles 748 instructions 30 Supervisor thread: 7 cycles 4 instructions 31 User thread: 18014 cycles 748 instructions 32 Supervisor thread: 7 cycles 4 instructions
|
/Zephyr-Core-3.5.0/doc/kernel/services/other/ |
D | float.rst | 36 If a thread uses any floating point register, 37 the kernel generates a fatal error condition and aborts the thread. 42 This mode is used when the application has only a single thread 46 be used by any thread (initialization in skipped on ARM Cortex-M platforms and 60 the kernel supports one or more of the following thread sub-classes: 62 * non-user: A thread that cannot use any floating point registers 64 * FPU user: A thread that can use the standard floating point registers 66 * SSE user: A thread that can use both the standard floating point registers 71 by any thread, then saves and restores these registers during 84 This means that any thread is allowed to access the floating point registers. [all …]
|
/Zephyr-Core-3.5.0/subsys/logging/ |
D | Kconfig.processing | 25 bool "Block in thread context on full" 28 When enabled logger will block (if in the thread context) when 32 int "Maximum time (in milliseconds) thread can be blocked" 40 logging (e.g. logger or shell thread). 47 When number of buffered messages reaches the threshold thread is waken 48 up. Log processing thread ID is provided during log initialization. 50 this threshold is used by the internal thread. 53 bool "Use internal thread for log processing" 57 When enabled thread is created by the logger subsystem. Thread is 65 int "Set log processing thread startup delay" [all …]
|
/Zephyr-Core-3.5.0/drivers/sensor/bmi08x/ |
D | Kconfig | 30 bool "Use global thread" 34 bool "Use own thread" 42 int "Accelerometer own thread priority" 46 The priority of the thread used for handling interrupts. 49 int "Accelerometer own thread stack size" 53 The thread stack size. 66 bool "Use global thread" 70 bool "Use own thread" 78 int "Own thread priority" 82 The priority of the thread used for handling interrupts. [all …]
|