aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/setup.c')
-rw-r--r--arch/sparc64/kernel/setup.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index aaab319ad885..e22bf5fc92ce 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -547,19 +547,33 @@ static void __init per_cpu_patch(void)
547 547
548static void __init gl_patch(void) 548static void __init gl_patch(void)
549{ 549{
550 struct gl_1insn_patch_entry *p; 550 struct gl_1insn_patch_entry *p1;
551 struct gl_2insn_patch_entry *p2;
551 552
552 if (tlb_type != hypervisor) 553 if (tlb_type != hypervisor)
553 return; 554 return;
554 555
555 p = &__gl_1insn_patch; 556 p1 = &__gl_1insn_patch;
556 while (p < &__gl_1insn_patch_end) { 557 while (p1 < &__gl_1insn_patch_end) {
557 unsigned long addr = p->addr; 558 unsigned long addr = p1->addr;
558 559
559 *(unsigned int *) (addr + 0) = p->insn; 560 *(unsigned int *) (addr + 0) = p1->insn;
560 __asm__ __volatile__("flush %0" : : "r" (addr + 0)); 561 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
561 562
562 p++; 563 p1++;
564 }
565
566 p2 = &__gl_2insn_patch;
567 while (p2 < &__gl_2insn_patch_end) {
568 unsigned long addr = p2->addr;
569
570 *(unsigned int *) (addr + 0) = p2->insns[0];
571 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
572
573 *(unsigned int *) (addr + 3) = p2->insns[1];
574 __asm__ __volatile__("flush %0" : : "r" (addr + 4));
575
576 p2++;
563 } 577 }
564} 578}
565 579