arch: arm: Fix checks of CONFIG_USERSPACE
The compiler generates errors of the form error: "CONFIG_USERSPACE" is not defined, evaluates to 0 [-Werror=undef] when -Wundef is used and the config option was turned off. Change check to if defined(). Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
This commit is contained in:
parent
c5665f2e8e
commit
63013d93ab
2 changed files with 5 additions and 5 deletions
|
@ -349,7 +349,7 @@ SECTION_FUNC(TEXT, __svc)
|
||||||
* expand this case.
|
* expand this case.
|
||||||
*/
|
*/
|
||||||
ands r1, #0xff
|
ands r1, #0xff
|
||||||
#if CONFIG_USERSPACE
|
#if defined(CONFIG_USERSPACE)
|
||||||
mrs r2, CONTROL
|
mrs r2, CONTROL
|
||||||
|
|
||||||
cmp r1, #3
|
cmp r1, #3
|
||||||
|
@ -381,7 +381,7 @@ _oops:
|
||||||
bl z_do_kernel_oops
|
bl z_do_kernel_oops
|
||||||
pop {r0, pc}
|
pop {r0, pc}
|
||||||
|
|
||||||
#if CONFIG_USERSPACE
|
#if defined(CONFIG_USERSPACE)
|
||||||
/*
|
/*
|
||||||
* System call will setup a jump to the _do_arm_syscall function
|
* System call will setup a jump to the _do_arm_syscall function
|
||||||
* when the SVC returns via the bx lr.
|
* when the SVC returns via the bx lr.
|
||||||
|
|
|
@ -85,7 +85,7 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
||||||
#endif /* CONFIG_THREAD_USERSPACE_LOCAL_DATA */
|
#endif /* CONFIG_THREAD_USERSPACE_LOCAL_DATA */
|
||||||
#endif /* CONFIG_USERSPACE */
|
#endif /* CONFIG_USERSPACE */
|
||||||
|
|
||||||
#if CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT && CONFIG_USERSPACE
|
#if CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT && defined(CONFIG_USERSPACE)
|
||||||
/* This is required to work-around the case where the thread
|
/* This is required to work-around the case where the thread
|
||||||
* is created without using K_THREAD_STACK_SIZEOF() macro in
|
* is created without using K_THREAD_STACK_SIZEOF() macro in
|
||||||
* k_thread_create(). If K_THREAD_STACK_SIZEOF() is used, the
|
* k_thread_create(). If K_THREAD_STACK_SIZEOF() is used, the
|
||||||
|
@ -104,7 +104,7 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
||||||
pInitCtx = (struct __esf *)(STACK_ROUND_DOWN(stackEnd -
|
pInitCtx = (struct __esf *)(STACK_ROUND_DOWN(stackEnd -
|
||||||
(char *)top_of_stack_offset - sizeof(struct __esf)));
|
(char *)top_of_stack_offset - sizeof(struct __esf)));
|
||||||
|
|
||||||
#if CONFIG_USERSPACE
|
#if defined(CONFIG_USERSPACE)
|
||||||
if ((options & K_USER) != 0) {
|
if ((options & K_USER) != 0) {
|
||||||
pInitCtx->basic.pc = (u32_t)z_arch_user_mode_enter;
|
pInitCtx->basic.pc = (u32_t)z_arch_user_mode_enter;
|
||||||
} else {
|
} else {
|
||||||
|
@ -130,7 +130,7 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
||||||
thread->callee_saved.psp = (u32_t)pInitCtx;
|
thread->callee_saved.psp = (u32_t)pInitCtx;
|
||||||
thread->arch.basepri = 0;
|
thread->arch.basepri = 0;
|
||||||
|
|
||||||
#if CONFIG_USERSPACE
|
#if defined(CONFIG_USERSPACE)
|
||||||
thread->arch.mode = 0;
|
thread->arch.mode = 0;
|
||||||
thread->arch.priv_stack_start = 0;
|
thread->arch.priv_stack_start = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue