patch-2.1.51 linux/arch/ppc/kernel/ptrace.c
Next file: linux/arch/ppc/kernel/setup.c
Previous file: linux/arch/ppc/kernel/prom.c
Back to the patch index
Back to the overall index
- Lines: 56
- Date:
Sat Aug 16 09:51:08 1997
- Orig file:
v2.1.50/linux/arch/ppc/kernel/ptrace.c
- Orig date:
Mon Aug 4 16:25:36 1997
diff -u --recursive --new-file v2.1.50/linux/arch/ppc/kernel/ptrace.c linux/arch/ppc/kernel/ptrace.c
@@ -171,8 +171,11 @@
goto repeat;
}
/* this is a hack for non-kernel-mapped video buffers and similar */
- if (MAP_NR(page) < max_mapnr)
- *(unsigned long *) (page + (addr & ~PAGE_MASK)) = data;
+ if (MAP_NR(page) < max_mapnr) {
+ unsigned long phys_addr = page + (addr & ~PAGE_MASK);
+ *(unsigned long *) phys_addr = data;
+ flush_icache_range(phys_addr, phys_addr+4);
+ }
/* we're bypassing pagetables, so we have to set the dirty bit ourselves */
/* this should also re-instate whatever read-only mode there was before */
set_pte(pgtable, pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
@@ -364,7 +367,7 @@
case PTRACE_PEEKUSR: {
unsigned long tmp;
- if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) {
+ if ((addr & 3) || addr < 0 || addr > (PT_FPSCR << 2)) {
ret = -EIO;
goto out;
}
@@ -378,13 +381,11 @@
if (addr < PT_FPR0) {
tmp = get_reg(child, addr);
}
-#if 1
- else if (addr >= PT_FPR0 && addr < PT_FPR0 + 64) {
+ else if (addr >= PT_FPR0 && addr <= PT_FPSCR) {
if (last_task_used_math == child)
giveup_fpu();
tmp = ((long *)child->tss.fpr)[addr - PT_FPR0];
}
-#endif
else
ret = -EIO;
if (!ret)
@@ -400,7 +401,7 @@
case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
ret = -EIO;
- if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
+ if ((addr & 3) || addr < 0 || addr >= ((PT_FPR0 + 64) << 2))
goto out;
addr = addr >> 2; /* temporary hack. */
@@ -508,7 +509,7 @@
goto out;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
- notify_parent(current);
+ notify_parent(current, SIGCHLD);
schedule();
/*
* this isn't the same as continuing with a signal, but it will do
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov