diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-28 21:50:22 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-30 04:04:06 -0400 |
commit | ee400b63f37120987bd12a2fada850c6212d7563 (patch) | |
tree | ede86a22406e2383b9cf3e84d93bc00dce873341 | |
parent | dcff1b170b43d9b8cb83e275cb3451dfd261c23e (diff) |
powerpc: more cleanup of powerpc/kernel
Update head_64.S from arch/ppc64
Remove arc/ppc/kernel/fpu.S
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 9 | ||||
-rw-r--r-- | arch/ppc/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/ppc/kernel/fpu.S | 133 |
3 files changed, 7 insertions, 136 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 22a5ee07e1ea..db0cd3587627 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -1253,7 +1253,7 @@ unrecov_slb: | |||
1253 | * | 1253 | * |
1254 | * On iSeries, the hypervisor must fill in at least one entry before | 1254 | * On iSeries, the hypervisor must fill in at least one entry before |
1255 | * we get control (with relocate on). The address is give to the hv | 1255 | * we get control (with relocate on). The address is give to the hv |
1256 | * as a page number (see xLparMap in LparData.c), so this must be at a | 1256 | * as a page number (see xLparMap in lpardata.c), so this must be at a |
1257 | * fixed address (the linker can't compute (u64)&initial_stab >> | 1257 | * fixed address (the linker can't compute (u64)&initial_stab >> |
1258 | * PAGE_SHIFT). | 1258 | * PAGE_SHIFT). |
1259 | */ | 1259 | */ |
@@ -1364,6 +1364,7 @@ _STATIC(__start_initialization_iSeries) | |||
1364 | addi r2,r2,0x4000 | 1364 | addi r2,r2,0x4000 |
1365 | 1365 | ||
1366 | bl .iSeries_early_setup | 1366 | bl .iSeries_early_setup |
1367 | bl .early_setup | ||
1367 | 1368 | ||
1368 | /* relocation is on at this point */ | 1369 | /* relocation is on at this point */ |
1369 | 1370 | ||
@@ -1970,20 +1971,22 @@ _GLOBAL(hmt_start_secondary) | |||
1970 | blr | 1971 | blr |
1971 | #endif | 1972 | #endif |
1972 | 1973 | ||
1973 | #if defined(CONFIG_KEXEC) || (defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES)) | 1974 | #if defined(CONFIG_KEXEC) || defined(CONFIG_SMP) |
1974 | _GLOBAL(smp_release_cpus) | 1975 | _GLOBAL(smp_release_cpus) |
1975 | /* All secondary cpus are spinning on a common | 1976 | /* All secondary cpus are spinning on a common |
1976 | * spinloop, release them all now so they can start | 1977 | * spinloop, release them all now so they can start |
1977 | * to spin on their individual paca spinloops. | 1978 | * to spin on their individual paca spinloops. |
1978 | * For non SMP kernels, the secondary cpus never | 1979 | * For non SMP kernels, the secondary cpus never |
1979 | * get out of the common spinloop. | 1980 | * get out of the common spinloop. |
1981 | * XXX This does nothing useful on iSeries, secondaries are | ||
1982 | * already waiting on their paca. | ||
1980 | */ | 1983 | */ |
1981 | li r3,1 | 1984 | li r3,1 |
1982 | LOADADDR(r5,__secondary_hold_spinloop) | 1985 | LOADADDR(r5,__secondary_hold_spinloop) |
1983 | std r3,0(r5) | 1986 | std r3,0(r5) |
1984 | sync | 1987 | sync |
1985 | blr | 1988 | blr |
1986 | #endif /* CONFIG_SMP && !CONFIG_PPC_ISERIES */ | 1989 | #endif /* CONFIG_SMP */ |
1987 | 1990 | ||
1988 | 1991 | ||
1989 | /* | 1992 | /* |
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile index 09067fe5772c..da2dc08c4c1b 100644 --- a/arch/ppc/kernel/Makefile +++ b/arch/ppc/kernel/Makefile | |||
@@ -39,6 +39,7 @@ endif | |||
39 | # These are here while we do the architecture merge | 39 | # These are here while we do the architecture merge |
40 | vecemu-y += ../../powerpc/kernel/vecemu.o | 40 | vecemu-y += ../../powerpc/kernel/vecemu.o |
41 | vector-y += ../../powerpc/kernel/vector.o | 41 | vector-y += ../../powerpc/kernel/vector.o |
42 | fpu-y += ../../powerpc/kernel/fpu.o | ||
42 | 43 | ||
43 | else | 44 | else |
44 | obj-y := entry.o irq.o idle.o time.o misc.o \ | 45 | obj-y := entry.o irq.o idle.o time.o misc.o \ |
diff --git a/arch/ppc/kernel/fpu.S b/arch/ppc/kernel/fpu.S deleted file mode 100644 index 665d7d34304c..000000000000 --- a/arch/ppc/kernel/fpu.S +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | /* | ||
2 | * FPU support code, moved here from head.S so that it can be used | ||
3 | * by chips which use other head-whatever.S files. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version | ||
8 | * 2 of the License, or (at your option) any later version. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <linux/config.h> | ||
13 | #include <asm/processor.h> | ||
14 | #include <asm/page.h> | ||
15 | #include <asm/mmu.h> | ||
16 | #include <asm/pgtable.h> | ||
17 | #include <asm/cputable.h> | ||
18 | #include <asm/cache.h> | ||
19 | #include <asm/thread_info.h> | ||
20 | #include <asm/ppc_asm.h> | ||
21 | #include <asm/asm-offsets.h> | ||
22 | |||
23 | /* | ||
24 | * This task wants to use the FPU now. | ||
25 | * On UP, disable FP for the task which had the FPU previously, | ||
26 | * and save its floating-point registers in its thread_struct. | ||
27 | * Load up this task's FP registers from its thread_struct, | ||
28 | * enable the FPU for the current task and return to the task. | ||
29 | */ | ||
30 | .globl load_up_fpu | ||
31 | load_up_fpu: | ||
32 | mfmsr r5 | ||
33 | ori r5,r5,MSR_FP | ||
34 | #ifdef CONFIG_PPC64BRIDGE | ||
35 | clrldi r5,r5,1 /* turn off 64-bit mode */ | ||
36 | #endif /* CONFIG_PPC64BRIDGE */ | ||
37 | SYNC | ||
38 | MTMSRD(r5) /* enable use of fpu now */ | ||
39 | isync | ||
40 | /* | ||
41 | * For SMP, we don't do lazy FPU switching because it just gets too | ||
42 | * horrendously complex, especially when a task switches from one CPU | ||
43 | * to another. Instead we call giveup_fpu in switch_to. | ||
44 | */ | ||
45 | #ifndef CONFIG_SMP | ||
46 | tophys(r6,0) /* get __pa constant */ | ||
47 | addis r3,r6,last_task_used_math@ha | ||
48 | lwz r4,last_task_used_math@l(r3) | ||
49 | cmpwi 0,r4,0 | ||
50 | beq 1f | ||
51 | add r4,r4,r6 | ||
52 | addi r4,r4,THREAD /* want last_task_used_math->thread */ | ||
53 | SAVE_32FPRS(0, r4) | ||
54 | mffs fr0 | ||
55 | stfd fr0,THREAD_FPSCR-4(r4) | ||
56 | lwz r5,PT_REGS(r4) | ||
57 | add r5,r5,r6 | ||
58 | lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) | ||
59 | li r10,MSR_FP|MSR_FE0|MSR_FE1 | ||
60 | andc r4,r4,r10 /* disable FP for previous task */ | ||
61 | stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) | ||
62 | 1: | ||
63 | #endif /* CONFIG_SMP */ | ||
64 | /* enable use of FP after return */ | ||
65 | mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */ | ||
66 | lwz r4,THREAD_FPEXC_MODE(r5) | ||
67 | ori r9,r9,MSR_FP /* enable FP for current */ | ||
68 | or r9,r9,r4 | ||
69 | lfd fr0,THREAD_FPSCR-4(r5) | ||
70 | mtfsf 0xff,fr0 | ||
71 | REST_32FPRS(0, r5) | ||
72 | #ifndef CONFIG_SMP | ||
73 | subi r4,r5,THREAD | ||
74 | sub r4,r4,r6 | ||
75 | stw r4,last_task_used_math@l(r3) | ||
76 | #endif /* CONFIG_SMP */ | ||
77 | /* restore registers and return */ | ||
78 | /* we haven't used ctr or xer or lr */ | ||
79 | b fast_exception_return | ||
80 | |||
81 | /* | ||
82 | * FP unavailable trap from kernel - print a message, but let | ||
83 | * the task use FP in the kernel until it returns to user mode. | ||
84 | */ | ||
85 | .globl KernelFP | ||
86 | KernelFP: | ||
87 | lwz r3,_MSR(r1) | ||
88 | ori r3,r3,MSR_FP | ||
89 | stw r3,_MSR(r1) /* enable use of FP after return */ | ||
90 | lis r3,86f@h | ||
91 | ori r3,r3,86f@l | ||
92 | mr r4,r2 /* current */ | ||
93 | lwz r5,_NIP(r1) | ||
94 | bl printk | ||
95 | b ret_from_except | ||
96 | 86: .string "floating point used in kernel (task=%p, pc=%x)\n" | ||
97 | .align 4,0 | ||
98 | |||
99 | /* | ||
100 | * giveup_fpu(tsk) | ||
101 | * Disable FP for the task given as the argument, | ||
102 | * and save the floating-point registers in its thread_struct. | ||
103 | * Enables the FPU for use in the kernel on return. | ||
104 | */ | ||
105 | .globl giveup_fpu | ||
106 | giveup_fpu: | ||
107 | mfmsr r5 | ||
108 | ori r5,r5,MSR_FP | ||
109 | SYNC_601 | ||
110 | ISYNC_601 | ||
111 | MTMSRD(r5) /* enable use of fpu now */ | ||
112 | SYNC_601 | ||
113 | isync | ||
114 | cmpwi 0,r3,0 | ||
115 | beqlr- /* if no previous owner, done */ | ||
116 | addi r3,r3,THREAD /* want THREAD of task */ | ||
117 | lwz r5,PT_REGS(r3) | ||
118 | cmpwi 0,r5,0 | ||
119 | SAVE_32FPRS(0, r3) | ||
120 | mffs fr0 | ||
121 | stfd fr0,THREAD_FPSCR-4(r3) | ||
122 | beq 1f | ||
123 | lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) | ||
124 | li r3,MSR_FP|MSR_FE0|MSR_FE1 | ||
125 | andc r4,r4,r3 /* disable FP for previous task */ | ||
126 | stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) | ||
127 | 1: | ||
128 | #ifndef CONFIG_SMP | ||
129 | li r5,0 | ||
130 | lis r4,last_task_used_math@ha | ||
131 | stw r5,last_task_used_math@l(r4) | ||
132 | #endif /* CONFIG_SMP */ | ||
133 | blr | ||