Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=836624619b98535079053920a29a7e474ac17cbc
Commit:     836624619b98535079053920a29a7e474ac17cbc
Parent:     995bb781d42441ed48517bc7ea6414c3df3386ef
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 28 16:04:49 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Fri Sep 28 16:04:49 2007 +0900

    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 <[EMAIL PROTECTED]>
---
 arch/sh/Kconfig               |   14 ++++++++++++++
 arch/sh/kernel/entry-common.S |    2 +-
 arch/sh/kernel/process.c      |    2 +-
 arch/sh/kernel/signal.c       |    2 ++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index a8693ed..44982c1 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 <http://lc.linux.or.jp/lc2002/papers/niibe0919p.pdf>.
+
+         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 b467280..e0317ed 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 cd8dae1..b446999 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 0f657d3..2f42442 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 */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to