patch-1.3.24 linux/arch/alpha/kernel/ptrace.c

Next file: linux/arch/i386/config.in
Previous file: linux/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.23/linux/arch/alpha/kernel/ptrace.c linux/arch/alpha/kernel/ptrace.c
@@ -160,7 +160,8 @@
  * and that it is in the task area before calling this: this routine does
  * no checking.
  */
-static unsigned long get_long(struct vm_area_struct * vma, unsigned long addr)
+static unsigned long get_long(struct task_struct * tsk,
+	struct vm_area_struct * vma, unsigned long addr)
 {
 	pgd_t * pgdir;
 	pmd_t * pgmiddle;
@@ -169,9 +170,9 @@
 
 	DBG(DBG_MEM_ALL, ("getting long at 0x%lx\n", addr));
 repeat:
-	pgdir = pgd_offset(vma->vm_task, addr);
+	pgdir = pgd_offset(vma->vm_mm, addr);
 	if (pgd_none(*pgdir)) {
-		do_no_page(vma, addr, 0);
+		do_no_page(tsk, vma, addr, 0);
 		goto repeat;
 	}
 	if (pgd_bad(*pgdir)) {
@@ -181,7 +182,7 @@
 	}
 	pgmiddle = pmd_offset(pgdir, addr);
 	if (pmd_none(*pgmiddle)) {
-		do_no_page(vma, addr, 0);
+		do_no_page(tsk, vma, addr, 0);
 		goto repeat;
 	}
 	if (pmd_bad(*pgmiddle)) {
@@ -191,7 +192,7 @@
 	}
 	pgtable = pte_offset(pgmiddle, addr);
 	if (!pte_present(*pgtable)) {
-		do_no_page(vma, addr, 0);
+		do_no_page(tsk, vma, addr, 0);
 		goto repeat;
 	}
 	page = pte_page(*pgtable);
@@ -211,8 +212,8 @@
  * Now keeps R/W state of page so that a text page stays readonly
  * even if a debugger scribbles breakpoints into it.  -M.U-
  */
-static void put_long(struct vm_area_struct * vma, unsigned long addr,
-		     unsigned long data)
+static void put_long(struct task_struct * tsk, struct vm_area_struct * vma,
+	unsigned long addr, unsigned long data)
 {
 	pgd_t *pgdir;
 	pmd_t *pgmiddle;
@@ -220,9 +221,9 @@
 	unsigned long page;
 
 repeat:
-	pgdir = pgd_offset(vma->vm_task, addr);
+	pgdir = pgd_offset(vma->vm_mm, addr);
 	if (!pgd_present(*pgdir)) {
-		do_no_page(vma, addr, 1);
+		do_no_page(tsk, vma, addr, 1);
 		goto repeat;
 	}
 	if (pgd_bad(*pgdir)) {
@@ -232,7 +233,7 @@
 	}
 	pgmiddle = pmd_offset(pgdir, addr);
 	if (pmd_none(*pgmiddle)) {
-		do_no_page(vma, addr, 1);
+		do_no_page(tsk, vma, addr, 1);
 		goto repeat;
 	}
 	if (pmd_bad(*pgmiddle)) {
@@ -242,12 +243,12 @@
 	}
 	pgtable = pte_offset(pgmiddle, addr);
 	if (!pte_present(*pgtable)) {
-		do_no_page(vma, addr, 1);
+		do_no_page(tsk, vma, addr, 1);
 		goto repeat;
 	}
 	page = pte_page(*pgtable);
 	if (!pte_write(*pgtable)) {
-		do_wp_page(vma, addr, 1);
+		do_wp_page(tsk, vma, addr, 1);
 		goto repeat;
 	}
 /* this is a hack for non-kernel-mapped video buffers and similar */
@@ -304,17 +305,17 @@
 		}
 		align = addr & (sizeof(long) - 1);
 		addr -= align;
-		low = get_long(vma, addr);
+		low = get_long(tsk, vma, addr);
 		if (align) {
 		    unsigned long high;
 
-		    high = get_long(vma_high, addr + sizeof(long));
+		    high = get_long(tsk, vma_high, addr + sizeof(long));
 		    low >>= align * 8;
 		    low  |= high << (64 - align * 8);
 		}
 		*result = low;
 	} else {
-	        long l = get_long(vma, addr);
+	        long l = get_long(tsk, vma, addr);
 
 		DBG(DBG_MEM_ALL, ("value is 0x%lx\n", l));
 		*result = l;
@@ -344,16 +345,16 @@
 		}
 		align = addr & (sizeof(long) - 1);
 		addr -= align;
-		low  = get_long(vma, addr);
-		high = get_long(vma_high, addr + sizeof(long));
+		low  = get_long(tsk, vma, addr);
+		high = get_long(tsk, vma_high, addr + sizeof(long));
 		low  &= ~0UL >> (64 - align * 8);
 		high &= ~0UL << (align * 8);
 		low  |= data << (align * 8);
 		high |= data >> (64 - align * 8);
-		put_long(vma, addr, low);
-		put_long(vma_high, addr + sizeof(long), high);
+		put_long(tsk, vma, addr, low);
+		put_long(tsk, vma_high, addr + sizeof(long), high);
 	} else
-		put_long(vma, addr, data);
+		put_long(tsk, vma, addr, data);
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this