1 diff -urN linux-2.4.15-pre9/arch/ppc/kernel/entry.S linuxppc_2_4/arch/ppc/kernel/entry.S
2 --- linux-2.4.15-pre9/arch/ppc/kernel/entry.S Mon Sep 24 09:31:16 2001
3 +++ linuxppc_2_4/arch/ppc/kernel/entry.S Sat Feb 23 16:40:48 2002
6 - * BK Id: SCCS/s.entry.S 1.22 08/15/01 22:43:06 paulus
7 + * BK Id: SCCS/s.entry.S 1.24 11/23/01 16:38:29 paulus
14 mflr r20 /* Return to switch caller */
15 + stw r20,INT_FRAME_SIZE+4(r1)
17 li r0,MSR_FP /* Disable floating-point */
20 oris r0,r0,MSR_VEC@h /* Disable altivec */
21 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
22 #endif /* CONFIG_ALTIVEC */
23 + and. r0,r0,r22 /* FP or altivec enabled? */
37 - ori r0,r0,MSR_EE|MSR_SE|MSR_BE
38 + ori r0,r0,MSR_EE|MSR_SE|MSR_BE|MSR_FE0|MSR_FE1
40 - li r10,MSR_IR|MSR_DR|MSR_FE0|MSR_FE1|MSR_FP
41 + li r10,MSR_IR|MSR_DR|MSR_FP
43 SYNC /* disable interrupts so SRR0/1 */
44 mtmsr r0 /* don't get trashed */
45 diff -urN linux-2.4.15-pre9/arch/ppc/kernel/misc.S linuxppc_2_4/arch/ppc/kernel/misc.S
46 --- linux-2.4.15-pre9/arch/ppc/kernel/misc.S Tue Nov 6 18:21:29 2001
47 +++ linuxppc_2_4/arch/ppc/kernel/misc.S Sat Feb 23 16:40:48 2002
50 - * BK Id: SCCS/s.misc.S 1.32 10/18/01 17:29:53 trini
51 + * BK Id: SCCS/s.misc.S 1.34 11/23/01 16:38:29 paulus
54 * This file contains miscellaneous low-level functions.
57 cmpi 0,r3,0 /* parent or child? */
58 bnelr /* return if parent */
59 - li r0,0 /* clear out p->thread.regs */
60 - stw r0,THREAD+PT_REGS(r2) /* since we don't have user ctx */
61 - addi r1,r2,TASK_UNION_SIZE-STACK_FRAME_OVERHEAD
63 + li r0,0 /* make top-level stack frame */
65 mtlr r6 /* fn addr in lr */
66 mr r3,r4 /* load arg and call fn */
68 diff -urN linux-2.4.15-pre9/arch/ppc/kernel/process.c linuxppc_2_4/arch/ppc/kernel/process.c
69 --- linux-2.4.15-pre9/arch/ppc/kernel/process.c Wed Oct 10 12:38:52 2001
70 +++ linuxppc_2_4/arch/ppc/kernel/process.c Sat Feb 23 16:40:48 2002
73 - * BK Id: SCCS/s.process.c 1.31 10/02/01 09:51:41 paulus
74 + * BK Id: SCCS/s.process.c 1.34 11/23/01 16:38:29 paulus
77 * linux/arch/ppc/kernel/process.c
79 /* for kernel thread, set `current' and stackptr in new task */
80 childregs->gpr[1] = sp + sizeof(struct pt_regs);
81 childregs->gpr[2] = (unsigned long) p;
83 + p->thread.regs = NULL; /* no user register state */
85 + p->thread.regs = childregs;
86 childregs->gpr[3] = 0; /* Result from fork() */
87 - p->thread.regs = childregs;
88 sp -= STACK_FRAME_OVERHEAD;
97 +void show_trace_task(struct task_struct *tsk)
99 + unsigned long stack_top = (unsigned long) tsk + THREAD_SIZE;
100 + unsigned long sp, prev_sp;
105 + sp = (unsigned long) &tsk->thread.ksp;
108 + sp = *(unsigned long *)sp;
109 + if (sp <= prev_sp || sp >= stack_top || (sp & 3) != 0)
112 + printk("[%08lx] ", *(unsigned long *)(sp + 4));
113 + } while (++count < 16);
119 diff -urN linux-2.4.15-pre9/arch/ppc/kernel/ptrace.c linuxppc_2_4/arch/ppc/kernel/ptrace.c
120 --- linux-2.4.15-pre9/arch/ppc/kernel/ptrace.c Mon Sep 24 09:31:17 2001
121 +++ linuxppc_2_4/arch/ppc/kernel/ptrace.c Sat Feb 23 16:40:48 2002
124 - * BK Id: SCCS/s.ptrace.c 1.8 07/07/01 17:00:08 paulus
125 + * BK Id: SCCS/s.ptrace.c 1.12 11/23/01 16:38:30 paulus
128 * linux/arch/ppc/kernel/ptrace.c
130 ret = ptrace_attach(child);
134 - if (!(child->ptrace & PT_PTRACED))
136 - if (child->state != TASK_STOPPED) {
137 - if (request != PTRACE_KILL)
140 - if (child->p_pptr != current)
142 + ret = ptrace_check_attach(child, request == PTRACE_KILL);
147 diff -urN linux-2.4.15-pre9/arch/ppc/kernel/signal.c linuxppc_2_4/arch/ppc/kernel/signal.c
148 --- linux-2.4.15-pre9/arch/ppc/kernel/signal.c Sat May 26 12:39:42 2001
149 +++ linuxppc_2_4/arch/ppc/kernel/signal.c Sat Feb 23 16:40:48 2002
152 - * BK Id: SCCS/s.signal.c 1.7 05/17/01 18:14:22 cort
153 + * BK Id: SCCS/s.signal.c 1.10 11/23/01 16:38:30 paulus
156 * linux/arch/ppc/kernel/signal.c
158 siginitset(&new_ka.sa.sa_mask, mask);
161 - ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
162 + ret = do_sigaction(sig, (act? &new_ka: NULL), (oact? &old_ka: NULL));
165 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
167 current->blocked = set;
168 recalc_sigpending(current);
169 spin_unlock_irq(¤t->sigmask_lock);
170 + if (regs->msr & MSR_FP)
171 + giveup_fpu(current);
173 rt_sf++; /* Look at next rt_sigframe */
174 if (rt_sf == (struct rt_sigframe *)(sigctx.regs)) {
176 * see handle_signal()
178 sr = (struct sigregs *) sigctx.regs;
179 - if (regs->msr & MSR_FP )
180 - giveup_fpu(current);
181 if (copy_from_user(saved_regs, &sr->gp_regs,
182 sizeof(sr->gp_regs)))
185 if (get_user(prevsp, &sr->gp_regs[PT_R1])
186 || put_user(prevsp, (unsigned long *) regs->gpr[1]))
188 + current->thread.fpscr = 0;
194 flush_icache_range((unsigned long) &frame->tramp[0],
195 (unsigned long) &frame->tramp[2]);
196 + current->thread.fpscr = 0; /* turn off all fp exceptions */
198 /* Retrieve rt_sigframe from stack and
199 set up registers for signal handler
200 @@ -379,13 +381,13 @@
201 current->blocked = set;
202 recalc_sigpending(current);
203 spin_unlock_irq(¤t->sigmask_lock);
204 + if (regs->msr & MSR_FP )
205 + giveup_fpu(current);
207 sc++; /* Look at next sigcontext */
208 if (sc == (struct sigcontext_struct *)(sigctx.regs)) {
209 /* Last stacked signal - restore registers */
210 sr = (struct sigregs *) sigctx.regs;
211 - if (regs->msr & MSR_FP )
212 - giveup_fpu(current);
213 if (copy_from_user(saved_regs, &sr->gp_regs,
214 sizeof(sr->gp_regs)))
217 if (get_user(prevsp, &sr->gp_regs[PT_R1])
218 || put_user(prevsp, (unsigned long *) regs->gpr[1]))
220 + current->thread.fpscr = 0;
226 if (verify_area(VERIFY_WRITE, frame, sizeof(*frame)))
228 - if (regs->msr & MSR_FP)
229 - giveup_fpu(current);
230 + if (regs->msr & MSR_FP)
231 + giveup_fpu(current);
232 if (__copy_to_user(&frame->gp_regs, regs, GP_REGS_SIZE)
233 || __copy_to_user(&frame->fp_regs, current->thread.fpr,
234 ELF_NFPREG * sizeof(double))
237 flush_icache_range((unsigned long) &frame->tramp[0],
238 (unsigned long) &frame->tramp[2]);
239 + current->thread.fpscr = 0; /* turn off all fp exceptions */
241 newsp -= __SIGNAL_FRAMESIZE;
242 if (put_user(regs->gpr[1], (unsigned long *)newsp)
243 diff -urN linux-2.4.15-pre9/arch/ppc/kernel/smp.c linuxppc_2_4/arch/ppc/kernel/smp.c
244 --- linux-2.4.15-pre9/arch/ppc/kernel/smp.c Thu Nov 22 22:06:50 2001
245 +++ linuxppc_2_4/arch/ppc/kernel/smp.c Sat Feb 23 16:40:48 2002
248 - * BK Id: SCCS/s.smp.c 1.34 10/11/01 12:06:01 trini
249 + * BK Id: SCCS/s.smp.c 1.37 11/23/01 16:38:30 paulus
252 * Smp support for ppc.
254 #include <asm/residual.h>
255 #include <asm/time.h>
257 -#include "open_pic.h"
259 int smp_threads_ready;
260 volatile int smp_commenced;
261 int smp_num_cpus = 1;
265 /* create a process for the processor */
266 - /* we don't care about the values in regs since we'll
267 - never reschedule the forked task. */
268 - /* We DO care about one bit in the pt_regs we
269 - pass to do_fork. That is the MSR_FP bit in
270 - regs.msr. If that bit is on, then do_fork
271 - (via copy_thread) will call giveup_fpu.
272 - giveup_fpu will get a pointer to our (current's)
273 - last register savearea via current->thread.regs
274 - and using that pointer will turn off the MSR_FP,
275 - MSR_FE0 and MSR_FE1 bits. At this point, this
276 - pointer is pointing to some arbitrary point within
279 + /* only regs.msr is actually used, and 0 is OK for it */
280 memset(®s, 0, sizeof(struct pt_regs));
282 if (do_fork(CLONE_VM|CLONE_PID, 0, ®s, 0) < 0)
283 panic("failed fork for CPU %d", i);
284 p = init_task.prev_task;
286 cpu_callin_map[cpu] = 1;
288 smp_ops->setup_cpu(cpu);
293 * This cpu is now "online". Only set them online
294 diff -urN linux-2.4.15-pre9/arch/ppc/mm/ppc_mmu.c linuxppc_2_4/arch/ppc/mm/ppc_mmu.c
295 --- linux-2.4.15-pre9/arch/ppc/mm/ppc_mmu.c Mon Sep 24 09:31:17 2001
296 +++ linuxppc_2_4/arch/ppc/mm/ppc_mmu.c Sat Feb 23 16:40:48 2002
299 if (Hash == 0 || nopreload)
301 + /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
302 + if (!pte_young(pte))
304 mm = (address < TASK_SIZE)? vma->vm_mm: &init_mm;
305 pmd = pmd_offset(pgd_offset(mm, address), address);
306 if (!pmd_none(*pmd)) {