Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[cascardo/linux.git] / arch / um / sys-i386 / ptrace_user.c
index 40aa885..40ff0c8 100644 (file)
@@ -1,12 +1,12 @@
-/* 
+/*
  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
 
 #include <stdio.h>
+#include <stddef.h>
 #include <errno.h>
 #include <unistd.h>
-#include <linux/stddef.h>
 #include "ptrace_user.h"
 /* Grr, asm/user.h includes asm/ptrace.h, so has to follow ptrace_user.h */
 #include <asm/user.h>
@@ -44,14 +44,15 @@ int ptrace_setfpregs(long pid, unsigned long *regs)
        return 0;
 }
 
-/* All the below stuff is of interest for TT mode only */
+#ifdef UML_CONFIG_MODE_TT
+
 static void write_debugregs(int pid, unsigned long *regs)
 {
        struct user *dummy;
        int nregs, i;
 
        dummy = NULL;
-       nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]);
+       nregs = ARRAY_SIZE(dummy->u_debugreg);
        for(i = 0; i < nregs; i++){
                if((i == 4) || (i == 5)) continue;
                if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i],
@@ -68,7 +69,7 @@ static void read_debugregs(int pid, unsigned long *regs)
        int nregs, i;
 
        dummy = NULL;
-       nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]);
+       nregs = ARRAY_SIZE(dummy->u_debugreg);
        for(i = 0; i < nregs; i++){
                regs[i] = ptrace(PTRACE_PEEKUSR, pid,
                                 &dummy->u_debugreg[i], 0);
@@ -127,13 +128,4 @@ void update_debugregs(int seq)
 }
 #endif
 
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
+#endif