diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-09-28 03:04:49 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-09-28 03:04:49 -0400 |
commit | 836624619b98535079053920a29a7e474ac17cbc (patch) | |
tree | beb3b4fc1b893b6a422be3645c3611b1c7adb456 /arch | |
parent | 995bb781d42441ed48517bc7ea6414c3df3386ef (diff) |
sh: Conditionalize gUSA support.
This conditionalizes gUSA support. gUSA is not supported on
SMP configurations, and it's not necessary there anyways due
to having other atomicity options (ie, movli.l/movco.l).
Anything implementing the LL/SC semantics (all SH-4A CPUs)
can switch to userspace atomicity implementations without
requiring gUSA. This is left default-enabled on all UP so
that glibc doesn't break.
Those that know what they are doing can disable this explicitly.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/Kconfig | 14 | ||||
-rw-r--r-- | arch/sh/kernel/entry-common.S | 2 | ||||
-rw-r--r-- | arch/sh/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/signal.c | 2 |
4 files changed, 18 insertions, 2 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index a8693edd4f43..44982c1dfa23 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -570,6 +570,20 @@ config NR_CPUS | |||
570 | 570 | ||
571 | source "kernel/Kconfig.preempt" | 571 | source "kernel/Kconfig.preempt" |
572 | 572 | ||
573 | config GUSA | ||
574 | def_bool y | ||
575 | depends on !SMP | ||
576 | help | ||
577 | This enables support for gUSA (general UserSpace Atomicity). | ||
578 | This is the default implementation for both UP and non-ll/sc | ||
579 | CPUs, and is used by the libc, amongst others. | ||
580 | |||
581 | For additional information, design information can be found | ||
582 | in <http://lc.linux.or.jp/lc2002/papers/niibe0919p.pdf>. | ||
583 | |||
584 | This should only be disabled for special cases where alternate | ||
585 | atomicity implementations exist. | ||
586 | |||
573 | endmenu | 587 | endmenu |
574 | 588 | ||
575 | menu "Boot options" | 589 | menu "Boot options" |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index b46728027195..e0317ed080c3 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -176,7 +176,7 @@ work_notifysig: | |||
176 | jmp @r1 | 176 | jmp @r1 |
177 | lds r0, pr | 177 | lds r0, pr |
178 | work_resched: | 178 | work_resched: |
179 | #ifndef CONFIG_PREEMPT | 179 | #if defined(CONFIG_GUSA) && !defined(CONFIG_PREEMPT) |
180 | ! gUSA handling | 180 | ! gUSA handling |
181 | mov.l @(OFF_SP,r15), r0 ! get user space stack pointer | 181 | mov.l @(OFF_SP,r15), r0 ! get user space stack pointer |
182 | mov r0, r1 | 182 | mov r0, r1 |
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index cd8dae16e940..b4469992d6b2 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, | |||
350 | unlazy_fpu(prev, task_pt_regs(prev)); | 350 | unlazy_fpu(prev, task_pt_regs(prev)); |
351 | #endif | 351 | #endif |
352 | 352 | ||
353 | #ifdef CONFIG_PREEMPT | 353 | #if defined(CONFIG_GUSA) && defined(CONFIG_PREEMPT) |
354 | { | 354 | { |
355 | struct pt_regs *regs; | 355 | struct pt_regs *regs; |
356 | 356 | ||
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index 0f657d32ceb9..2f42442cf164 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, | |||
507 | ctrl_inw(regs->pc - 4)); | 507 | ctrl_inw(regs->pc - 4)); |
508 | break; | 508 | break; |
509 | } | 509 | } |
510 | #ifdef CONFIG_GUSA | ||
510 | } else { | 511 | } else { |
511 | /* gUSA handling */ | 512 | /* gUSA handling */ |
512 | preempt_disable(); | 513 | preempt_disable(); |
@@ -523,6 +524,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
523 | } | 524 | } |
524 | 525 | ||
525 | preempt_enable_no_resched(); | 526 | preempt_enable_no_resched(); |
527 | #endif | ||
526 | } | 528 | } |
527 | 529 | ||
528 | /* Set up the stack frame */ | 530 | /* Set up the stack frame */ |