Google luky.org euqset.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/10] UML - Provide an arch-specific define for register file size


Replace FRAME_SIZE_OFFSET with MAX_REG_OFFSET because different arches have
different ideas of what it means.

Signed-off-by: Jeff Dike <jdike@xxxxxxxxxxx>

Index: 2.6.10/arch/um/include/sysdep-i386/ptrace_user.h
===================================================================
--- 2.6.10.orig/arch/um/include/sysdep-i386/ptrace_user.h	2005-01-13 18:17:25.000000000 -0500
+++ 2.6.10/arch/um/include/sysdep-i386/ptrace_user.h	2005-01-13 19:02:33.000000000 -0500
@@ -33,6 +33,9 @@
 #define FP_FRAME_SIZE (27)
 #define FPX_FRAME_SIZE (128)
 
+#define MAX_REG_OFFSET (FRAME_SIZE_OFFSET)
+#define MAX_REG_NR (FRAME_SIZE)
+
 #ifdef PTRACE_GETREGS
 #define UM_HAVE_GETREGS
 #endif
Index: 2.6.10/arch/um/kernel/ptrace.c
===================================================================
--- 2.6.10.orig/arch/um/kernel/ptrace.c	2005-01-13 18:35:19.000000000 -0500
+++ 2.6.10/arch/um/kernel/ptrace.c	2005-01-13 19:03:53.000000000 -0500
@@ -94,7 +94,7 @@
 			break;
 
 		tmp = 0;  /* Default return condition */
-		if(addr < FRAME_SIZE_OFFSET){
+		if(addr < MAX_REG_OFFSET){
 			tmp = getreg(child, addr);
 		}
 		else if((addr >= offsetof(struct user, u_debugreg[0])) &&
@@ -122,10 +122,11 @@
 		if ((addr & 3) || addr < 0)
 			break;
 
-		if (addr < FRAME_SIZE_OFFSET) {
+		if (addr < MAX_REG_OFFSET) {
 			ret = putreg(child, addr, data);
 			break;
 		}
+#if 0 /* XXX x86_64 */
 		else if((addr >= offsetof(struct user, u_debugreg[0])) &&
 			(addr <= offsetof(struct user, u_debugreg[7]))){
 			  addr -= offsetof(struct user, u_debugreg[0]);
@@ -134,6 +135,7 @@
 			  child->thread.arch.debugregs[addr] = data;
 			  ret = 0;
 		}
+#endif
 
 		break;
 
@@ -196,11 +198,11 @@
 #ifdef PTRACE_GETREGS
 	case PTRACE_GETREGS: { /* Get all gp regs from the child. */
 	  	if (!access_ok(VERIFY_WRITE, (unsigned long *)data, 
-			       FRAME_SIZE_OFFSET)) {
+			       MAX_REG_OFFSET)) {
 			ret = -EIO;
 			break;
 		}
-		for ( i = 0; i < FRAME_SIZE_OFFSET; i += sizeof(long) ) {
+		for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) {
 			__put_user(getreg(child, i),
 				   (unsigned long __user *) data);
 			data += sizeof(long);
@@ -213,11 +215,11 @@
 	case PTRACE_SETREGS: { /* Set all gp regs in the child. */
 		unsigned long tmp = 0;
 	  	if (!access_ok(VERIFY_READ, (unsigned *)data, 
-			       FRAME_SIZE_OFFSET)) {
+			       MAX_REG_OFFSET)) {
 			ret = -EIO;
 			break;
 		}
-		for ( i = 0; i < FRAME_SIZE_OFFSET; i += sizeof(long) ) {
+		for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) {
 			__get_user(tmp, (unsigned long __user *) data);
 			putreg(child, i, tmp);
 			data += sizeof(long);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


$B$3$N>pJs$,$"$J$?$NC5$7$F$$?$b$N$+$I$&$+A*Br$7$F$/$@$5$!#(B
yes/$B$^$5$K$3$l$@!*(B   no/$B0c$&$J$!(B   part/$B0lIt8+$D$+$C$?(B   try/$B$3$l$G;n$7$F$_$k(B

$B$"$J$?$,C5$7$F$$?>pJs$O$I$N$h$&$J$3$H$+!"$4<+M3$K5-F~2<$5$!#FC$K!V$^$5$K$3$l$@!*!W$H8@$&>l9g$O5-F~$r$*4j$$7$^$9!#(B
$BNc(B:$B!VJ#?t$N%^%7%s$+$i(BCATV$B7PM3$G(Bipmasquerade$B$rMxMQ$7$F(BWeb$B$r;2>H$7$?$>l9g$N@_Dj$K$D$$F!W(B