Lines Matching refs:thread
124 int z_impl_k_thread_priority_get(k_tid_t thread) in z_impl_k_thread_priority_get() argument
126 return thread->base.prio; in z_impl_k_thread_priority_get()
130 static inline int z_vrfy_k_thread_priority_get(k_tid_t thread) in z_vrfy_k_thread_priority_get() argument
132 K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); in z_vrfy_k_thread_priority_get()
133 return z_impl_k_thread_priority_get(thread); in z_vrfy_k_thread_priority_get()
138 int z_impl_k_thread_name_set(k_tid_t thread, const char *str) in z_impl_k_thread_name_set() argument
141 if (thread == NULL) { in z_impl_k_thread_name_set()
142 thread = _current; in z_impl_k_thread_name_set()
145 strncpy(thread->name, str, CONFIG_THREAD_MAX_NAME_LEN - 1); in z_impl_k_thread_name_set()
146 thread->name[CONFIG_THREAD_MAX_NAME_LEN - 1] = '\0'; in z_impl_k_thread_name_set()
149 arch_thread_name_set(thread, str); in z_impl_k_thread_name_set()
152 SYS_PORT_TRACING_OBJ_FUNC(k_thread, name_set, thread, 0); in z_impl_k_thread_name_set()
156 ARG_UNUSED(thread); in z_impl_k_thread_name_set()
159 SYS_PORT_TRACING_OBJ_FUNC(k_thread, name_set, thread, -ENOSYS); in z_impl_k_thread_name_set()
166 static inline int z_vrfy_k_thread_name_set(k_tid_t thread, const char *str) in z_vrfy_k_thread_name_set() argument
171 if (thread != NULL) { in z_vrfy_k_thread_name_set()
172 if (K_SYSCALL_OBJ(thread, K_OBJ_THREAD) != 0) { in z_vrfy_k_thread_name_set()
185 return z_impl_k_thread_name_set(thread, name); in z_vrfy_k_thread_name_set()
193 const char *k_thread_name_get(k_tid_t thread) in k_thread_name_get() argument
196 return (const char *)thread->name; in k_thread_name_get()
198 ARG_UNUSED(thread); in k_thread_name_get()
203 int z_impl_k_thread_name_copy(k_tid_t thread, char *buf, size_t size) in z_impl_k_thread_name_copy() argument
206 strncpy(buf, thread->name, size); in z_impl_k_thread_name_copy()
209 ARG_UNUSED(thread); in z_impl_k_thread_name_copy()
284 static inline int z_vrfy_k_thread_name_copy(k_tid_t thread, in z_vrfy_k_thread_name_copy() argument
289 struct k_object *ko = k_object_find(thread); in z_vrfy_k_thread_name_copy()
294 if ((thread == NULL) || (ko->type != K_OBJ_THREAD) || in z_vrfy_k_thread_name_copy()
301 len = strlen(thread->name); in z_vrfy_k_thread_name_copy()
306 return k_usermode_to_copy((void *)buf, thread->name, len + 1); in z_vrfy_k_thread_name_copy()
308 ARG_UNUSED(thread); in z_vrfy_k_thread_name_copy()
857 int z_impl_k_thread_stack_space_get(const struct k_thread *thread, in z_impl_k_thread_stack_space_get() argument
861 if (thread->stack_info.mapped.addr == NULL) { in z_impl_k_thread_stack_space_get()
866 return z_stack_space_get((const uint8_t *)thread->stack_info.start, in z_impl_k_thread_stack_space_get()
867 thread->stack_info.size, unused_ptr); in z_impl_k_thread_stack_space_get()
871 int z_vrfy_k_thread_stack_space_get(const struct k_thread *thread, in z_vrfy_k_thread_stack_space_get() argument
877 ret = K_SYSCALL_OBJ(thread, K_OBJ_THREAD); in z_vrfy_k_thread_stack_space_get()
882 ret = z_impl_k_thread_stack_space_get(thread, &unused); in z_vrfy_k_thread_stack_space_get()
900 const struct k_thread *thread) in z_vrfy_k_thread_timeout_remaining_ticks() argument
902 K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); in z_vrfy_k_thread_timeout_remaining_ticks()
903 return z_impl_k_thread_timeout_remaining_ticks(thread); in z_vrfy_k_thread_timeout_remaining_ticks()
908 const struct k_thread *thread) in z_vrfy_k_thread_timeout_expires_ticks() argument
910 K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); in z_vrfy_k_thread_timeout_expires_ticks()
911 return z_impl_k_thread_timeout_expires_ticks(thread); in z_vrfy_k_thread_timeout_expires_ticks()
947 int k_thread_runtime_stats_get(k_tid_t thread, in k_thread_runtime_stats_get() argument
950 if ((thread == NULL) || (stats == NULL)) { in k_thread_runtime_stats_get()
955 z_sched_thread_usage(thread, stats); in k_thread_runtime_stats_get()
1030 void defer_thread_cleanup(struct k_thread *thread) in defer_thread_cleanup() argument
1038 thread_to_cleanup = thread; in defer_thread_cleanup()
1050 thread_cleanup_stack_addr = thread->stack_info.mapped.addr; in defer_thread_cleanup()
1051 thread_cleanup_stack_sz = thread->stack_info.mapped.sz; in defer_thread_cleanup()
1057 thread->stack_info.mapped.addr = NULL; in defer_thread_cleanup()
1058 thread->stack_info.mapped.sz = 0; in defer_thread_cleanup()
1062 void do_thread_cleanup(struct k_thread *thread) in do_thread_cleanup() argument
1068 ARG_UNUSED(thread); in do_thread_cleanup()
1080 void k_thread_abort_cleanup(struct k_thread *thread) in k_thread_abort_cleanup() argument
1089 if (thread == _current) { in k_thread_abort_cleanup()
1102 defer_thread_cleanup(thread); in k_thread_abort_cleanup()
1107 do_thread_cleanup(thread); in k_thread_abort_cleanup()
1112 void k_thread_abort_cleanup_check_reuse(struct k_thread *thread) in k_thread_abort_cleanup_check_reuse() argument
1119 if (thread_to_cleanup == thread) { in k_thread_abort_cleanup_check_reuse()