diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index a8693edd4f43ad4c818860bf9bb9b23ae0758f32..44982c1dfa23c7adc28b422d8b2d35fa6b6c92b4 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -570,6 +570,20 @@ config NR_CPUS source "kernel/Kconfig.preempt" +config GUSA + def_bool y + depends on !SMP + help + This enables support for gUSA (general UserSpace Atomicity). + This is the default implementation for both UP and non-ll/sc + CPUs, and is used by the libc, amongst others. + + For additional information, design information can be found + in . + + This should only be disabled for special cases where alternate + atomicity implementations exist. + endmenu menu "Boot options" diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index b46728027195b15747b7b43f18a7e35e0a687623..e0317ed080c3402d870ab51c75dd34853f73b797 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S @@ -176,7 +176,7 @@ work_notifysig: jmp @r1 lds r0, pr work_resched: -#ifndef CONFIG_PREEMPT +#if defined(CONFIG_GUSA) && !defined(CONFIG_PREEMPT) ! gUSA handling mov.l @(OFF_SP,r15), r0 ! get user space stack pointer mov r0, r1 diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index cd8dae16e9403ca00568a7f6986d6665095f6853..b4469992d6b25aafab1e8fcc1f2cd089bee5f9e0 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev, unlazy_fpu(prev, task_pt_regs(prev)); #endif -#ifdef CONFIG_PREEMPT +#if defined(CONFIG_GUSA) && defined(CONFIG_PREEMPT) { struct pt_regs *regs; diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index 0f657d32ceb9fda86bc5e1cd8fa88462b2408fe0..2f42442cf164e9d6921b22bec246596304d3d640 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c @@ -507,6 +507,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, ctrl_inw(regs->pc - 4)); break; } +#ifdef CONFIG_GUSA } else { /* gUSA handling */ preempt_disable(); @@ -523,6 +524,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, } preempt_enable_no_resched(); +#endif } /* Set up the stack frame */