aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_32.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/head_32.S')
-rw-r--r--arch/powerpc/kernel/head_32.S12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 0c326823c6d4..be9f9e5470e8 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -31,6 +31,7 @@
31#include <asm/ppc_asm.h> 31#include <asm/ppc_asm.h>
32#include <asm/asm-offsets.h> 32#include <asm/asm-offsets.h>
33#include <asm/ptrace.h> 33#include <asm/ptrace.h>
34#include <asm/bug.h>
34 35
35/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ 36/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
36#define LOAD_BAT(n, reg, RA, RB) \ 37#define LOAD_BAT(n, reg, RA, RB) \
@@ -1070,9 +1071,14 @@ start_here:
1070 RFI 1071 RFI
1071 1072
1072/* 1073/*
1074 * void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next);
1075 *
1073 * Set up the segment registers for a new context. 1076 * Set up the segment registers for a new context.
1074 */ 1077 */
1075_ENTRY(set_context) 1078_ENTRY(switch_mmu_context)
1079 lwz r3,MMCONTEXTID(r4)
1080 cmpwi cr0,r3,0
1081 blt- 4f
1076 mulli r3,r3,897 /* multiply context by skew factor */ 1082 mulli r3,r3,897 /* multiply context by skew factor */
1077 rlwinm r3,r3,4,8,27 /* VSID = (context & 0xfffff) << 4 */ 1083 rlwinm r3,r3,4,8,27 /* VSID = (context & 0xfffff) << 4 */
1078 addis r3,r3,0x6000 /* Set Ks, Ku bits */ 1084 addis r3,r3,0x6000 /* Set Ks, Ku bits */
@@ -1083,6 +1089,7 @@ _ENTRY(set_context)
1083 /* Context switch the PTE pointer for the Abatron BDI2000. 1089 /* Context switch the PTE pointer for the Abatron BDI2000.
1084 * The PGDIR is passed as second argument. 1090 * The PGDIR is passed as second argument.
1085 */ 1091 */
1092 lwz r4,MM_PGD(r4)
1086 lis r5, KERNELBASE@h 1093 lis r5, KERNELBASE@h
1087 lwz r5, 0xf0(r5) 1094 lwz r5, 0xf0(r5)
1088 stw r4, 0x4(r5) 1095 stw r4, 0x4(r5)
@@ -1098,6 +1105,9 @@ _ENTRY(set_context)
1098 sync 1105 sync
1099 isync 1106 isync
1100 blr 1107 blr
11084: trap
1109 EMIT_BUG_ENTRY 4b,__FILE__,__LINE__,0
1110 blr
1101 1111
1102/* 1112/*
1103 * An undocumented "feature" of 604e requires that the v bit 1113 * An undocumented "feature" of 604e requires that the v bit