Skip to content

Commit

Permalink
kernel: corrected parameter names
Browse files Browse the repository at this point in the history
- applied the exact parameter names of the interface to implementation

Signed-off-by: Hess Nathan <[email protected]>
  • Loading branch information
DeHess authored and nashif committed Jul 8, 2024
1 parent 8ca14a7 commit 980d3f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static void z_thread_halt(struct k_thread *thread, k_spinlock_key_t key,
}


void z_impl_k_thread_suspend(struct k_thread *thread)
void z_impl_k_thread_suspend(k_tid_t thread)
{
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_thread, suspend, thread);

Expand All @@ -524,15 +524,15 @@ void z_impl_k_thread_suspend(struct k_thread *thread)
}

#ifdef CONFIG_USERSPACE
static inline void z_vrfy_k_thread_suspend(struct k_thread *thread)
static inline void z_vrfy_k_thread_suspend(k_tid_t thread)
{
K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
z_impl_k_thread_suspend(thread);
}
#include <zephyr/syscalls/k_thread_suspend_mrsh.c>
#endif /* CONFIG_USERSPACE */

void z_impl_k_thread_resume(struct k_thread *thread)
void z_impl_k_thread_resume(k_tid_t thread)
{
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_thread, resume, thread);

Expand All @@ -553,7 +553,7 @@ void z_impl_k_thread_resume(struct k_thread *thread)
}

#ifdef CONFIG_USERSPACE
static inline void z_vrfy_k_thread_resume(struct k_thread *thread)
static inline void z_vrfy_k_thread_resume(k_tid_t thread)
{
K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
z_impl_k_thread_resume(thread);
Expand Down Expand Up @@ -1215,7 +1215,7 @@ static inline int32_t z_vrfy_k_sleep(k_timeout_t timeout)
#include <zephyr/syscalls/k_sleep_mrsh.c>
#endif /* CONFIG_USERSPACE */

int32_t z_impl_k_usleep(int us)
int32_t z_impl_k_usleep(int32_t us)
{
int32_t ticks;

Expand All @@ -1232,7 +1232,7 @@ int32_t z_impl_k_usleep(int us)
}

#ifdef CONFIG_USERSPACE
static inline int32_t z_vrfy_k_usleep(int us)
static inline int32_t z_vrfy_k_usleep(int32_t us)
{
return z_impl_k_usleep(us);
}
Expand Down Expand Up @@ -1442,7 +1442,7 @@ void z_thread_abort(struct k_thread *thread)
}

#if !defined(CONFIG_ARCH_HAS_THREAD_ABORT)
void z_impl_k_thread_abort(struct k_thread *thread)
void z_impl_k_thread_abort(k_tid_t thread)
{
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_thread, abort, thread);

Expand Down
12 changes: 6 additions & 6 deletions kernel/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,22 @@ static inline int z_vrfy_k_thread_priority_get(k_tid_t thread)
#include <zephyr/syscalls/k_thread_priority_get_mrsh.c>
#endif /* CONFIG_USERSPACE */

int z_impl_k_thread_name_set(struct k_thread *thread, const char *value)
int z_impl_k_thread_name_set(k_tid_t thread, const char *str)
{
#ifdef CONFIG_THREAD_NAME
if (thread == NULL) {
thread = _current;
}

strncpy(thread->name, value, CONFIG_THREAD_MAX_NAME_LEN - 1);
strncpy(thread->name, str, CONFIG_THREAD_MAX_NAME_LEN - 1);
thread->name[CONFIG_THREAD_MAX_NAME_LEN - 1] = '\0';

SYS_PORT_TRACING_OBJ_FUNC(k_thread, name_set, thread, 0);

return 0;
#else
ARG_UNUSED(thread);
ARG_UNUSED(value);
ARG_UNUSED(str);

SYS_PORT_TRACING_OBJ_FUNC(k_thread, name_set, thread, -ENOSYS);

Expand All @@ -159,7 +159,7 @@ int z_impl_k_thread_name_set(struct k_thread *thread, const char *value)
}

#ifdef CONFIG_USERSPACE
static inline int z_vrfy_k_thread_name_set(struct k_thread *thread, const char *str)
static inline int z_vrfy_k_thread_name_set(k_tid_t thread, const char *str)
{
#ifdef CONFIG_THREAD_NAME
char name[CONFIG_THREAD_MAX_NAME_LEN];
Expand Down Expand Up @@ -340,15 +340,15 @@ void z_check_stack_sentinel(void)
}
#endif /* CONFIG_STACK_SENTINEL */

void z_impl_k_thread_start(struct k_thread *thread)
void z_impl_k_thread_start(k_tid_t thread)
{
SYS_PORT_TRACING_OBJ_FUNC(k_thread, start, thread);

z_sched_start(thread);
}

#ifdef CONFIG_USERSPACE
static inline void z_vrfy_k_thread_start(struct k_thread *thread)
static inline void z_vrfy_k_thread_start(k_tid_t thread)
{
K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
return z_impl_k_thread_start(thread);
Expand Down

0 comments on commit 980d3f4

Please sign in to comment.