diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2010-10-14 16:23:03 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-10-15 15:38:09 -0400 |
commit | a78c942df64ef4cf495fd4d8715e48501bd7f8a4 (patch) | |
tree | fe44212d36e6ca23dbe9f2c633824389216a3d1d /arch/tile/kernel/entry.S | |
parent | bf65e440e8248f22b2eacf8d47961bb9d52260f7 (diff) |
arch/tile: parameterize system PLs to support KVM port
While not a port to KVM (yet), this change modifies the kernel
to be able to build either at PL1 or at PL2 with a suitable
config switch. Pushing up this change avoids handling branch
merge issues going forward with the KVM work.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/kernel/entry.S')
-rw-r--r-- | arch/tile/kernel/entry.S | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/tile/kernel/entry.S b/arch/tile/kernel/entry.S index 80d13f013bb2..fd8dc42abdcb 100644 --- a/arch/tile/kernel/entry.S +++ b/arch/tile/kernel/entry.S | |||
@@ -15,7 +15,9 @@ | |||
15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
16 | #include <linux/unistd.h> | 16 | #include <linux/unistd.h> |
17 | #include <asm/irqflags.h> | 17 | #include <asm/irqflags.h> |
18 | #include <asm/processor.h> | ||
18 | #include <arch/abi.h> | 19 | #include <arch/abi.h> |
20 | #include <arch/spr_def.h> | ||
19 | 21 | ||
20 | #ifdef __tilegx__ | 22 | #ifdef __tilegx__ |
21 | #define bnzt bnezt | 23 | #define bnzt bnezt |
@@ -80,7 +82,7 @@ STD_ENTRY(KBacktraceIterator_init_current) | |||
80 | STD_ENTRY(cpu_idle_on_new_stack) | 82 | STD_ENTRY(cpu_idle_on_new_stack) |
81 | { | 83 | { |
82 | move sp, r1 | 84 | move sp, r1 |
83 | mtspr SYSTEM_SAVE_1_0, r2 | 85 | mtspr SPR_SYSTEM_SAVE_K_0, r2 |
84 | } | 86 | } |
85 | jal free_thread_info | 87 | jal free_thread_info |
86 | j cpu_idle | 88 | j cpu_idle |
@@ -102,15 +104,15 @@ STD_ENTRY(smp_nap) | |||
102 | STD_ENTRY(_cpu_idle) | 104 | STD_ENTRY(_cpu_idle) |
103 | { | 105 | { |
104 | lnk r0 | 106 | lnk r0 |
105 | movei r1, 1 | 107 | movei r1, KERNEL_PL |
106 | } | 108 | } |
107 | { | 109 | { |
108 | addli r0, r0, _cpu_idle_nap - . | 110 | addli r0, r0, _cpu_idle_nap - . |
109 | mtspr INTERRUPT_CRITICAL_SECTION, r1 | 111 | mtspr INTERRUPT_CRITICAL_SECTION, r1 |
110 | } | 112 | } |
111 | IRQ_ENABLE(r2, r3) /* unmask, but still with ICS set */ | 113 | IRQ_ENABLE(r2, r3) /* unmask, but still with ICS set */ |
112 | mtspr EX_CONTEXT_1_1, r1 /* PL1, ICS clear */ | 114 | mtspr SPR_EX_CONTEXT_K_1, r1 /* Kernel PL, ICS clear */ |
113 | mtspr EX_CONTEXT_1_0, r0 | 115 | mtspr SPR_EX_CONTEXT_K_0, r0 |
114 | iret | 116 | iret |
115 | .global _cpu_idle_nap | 117 | .global _cpu_idle_nap |
116 | _cpu_idle_nap: | 118 | _cpu_idle_nap: |