Skip to content

Commit

Permalink
arch: arc: Remove priv_stack_size field form _thread_arch
Browse files Browse the repository at this point in the history
This commit removes the priv_stack_size field from the _thread_arch
on arc architecture as there is no code using value stored in this
variable.

Signed-off-by: Piotr Zięcik <[email protected]>
  • Loading branch information
pizi-nordic authored and andrewboie committed Dec 12, 2018
1 parent 5ea8454 commit 23d2aa1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions arch/arc/core/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ void _new_thread(struct k_thread *thread, k_thread_stack_t *stack,
if (options & K_USER) {
thread->arch.priv_stack_start =
(u32_t)(stackEnd + STACK_GUARD_SIZE);
thread->arch.priv_stack_size =
(u32_t)(CONFIG_PRIVILEGED_STACK_SIZE);

stackAdjEnd = (char *)STACK_ROUND_DOWN(stackEnd + STACK_GUARD_SIZE +
CONFIG_PRIVILEGED_STACK_SIZE);
Expand Down Expand Up @@ -121,7 +119,6 @@ void _new_thread(struct k_thread *thread, k_thread_stack_t *stack,
stackEnd += CONFIG_PRIVILEGED_STACK_SIZE + STACK_GUARD_SIZE;

thread->arch.priv_stack_start = 0;
thread->arch.priv_stack_size = 0;

#ifdef CONFIG_THREAD_USERSPACE_LOCAL_DATA
/* reserve stack space for the userspace local data struct */
Expand Down Expand Up @@ -249,13 +246,11 @@ FUNC_NORETURN void _arch_user_mode_enter(k_thread_entry_t user_entry,
_current->arch.priv_stack_start =
(u32_t)(_current->stack_info.start +
_current->stack_info.size + STACK_GUARD_SIZE);
_current->arch.priv_stack_size =
(u32_t)CONFIG_PRIVILEGED_STACK_SIZE;

#ifdef CONFIG_ARC_STACK_CHECKING
_current->arch.k_stack_top = _current->arch.priv_stack_start;
_current->arch.k_stack_base = _current->arch.priv_stack_start +
_current->arch.priv_stack_size;
CONFIG_PRIVILEGED_STACK_SIZE;
_current->arch.u_stack_top = _current->stack_info.start;
_current->arch.u_stack_base = _current->stack_info.start +
_current->stack_info.size;
Expand Down
1 change: 0 additions & 1 deletion arch/arc/include/kernel_arch_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ struct _thread_arch {

#ifdef CONFIG_USERSPACE
u32_t priv_stack_start;
u32_t priv_stack_size;
#endif
};

Expand Down

0 comments on commit 23d2aa1

Please sign in to comment.