Replace FRAME_SIZE_OFFSET with MAX_REG_OFFSET because different arches have different ideas of what it means.
Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/