summaryrefslogtreecommitdiff
path: root/arch/sparc64/kernel/setup.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-05 21:29:28 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 01:11:48 -0800
commit936f482af1743141d637483ec10eb881537c26dc (patch)
tree913da89a4d9f4038c510c9ecf2f5957b0f6d167f /arch/sparc64/kernel/setup.c
parent6e02493a7f33ac89e698b980a657d77ab2749eaf (diff)
[SPARC64]: Add initial code to twiddle %gl on trap entry/exit.
Instead of setting/clearing PSTATE_AG we have to change the %gl register value on sun4v. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/setup.c')
-rw-r--r--arch/sparc64/kernel/setup.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 2918ed3eb1ba..aaab319ad885 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -545,6 +545,24 @@ static void __init per_cpu_patch(void)
#endif
}
+static void __init gl_patch(void)
+{
+ struct gl_1insn_patch_entry *p;
+
+ if (tlb_type != hypervisor)
+ return;
+
+ p = &__gl_1insn_patch;
+ while (p < &__gl_1insn_patch_end) {
+ unsigned long addr = p->addr;
+
+ *(unsigned int *) (addr + 0) = p->insn;
+ __asm__ __volatile__("flush %0" : : "r" (addr + 0));
+
+ p++;
+ }
+}
+
void __init setup_arch(char **cmdline_p)
{
/* Initialize PROM console and command line. */
@@ -567,6 +585,8 @@ void __init setup_arch(char **cmdline_p)
*/
per_cpu_patch();
+ gl_patch();
+
boot_flags_init(*cmdline_p);
idprom_init();