diff options
Diffstat (limited to 'arch/um/sys-i386/ptrace_user.c')
-rw-r--r-- | arch/um/sys-i386/ptrace_user.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/um/sys-i386/ptrace_user.c b/arch/um/sys-i386/ptrace_user.c index 40aa88531446..5f3cc6685820 100644 --- a/arch/um/sys-i386/ptrace_user.c +++ b/arch/um/sys-i386/ptrace_user.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "user.h" | 15 | #include "user.h" |
16 | #include "os.h" | 16 | #include "os.h" |
17 | #include "uml-config.h" | 17 | #include "uml-config.h" |
18 | #include "user_util.h" | ||
18 | 19 | ||
19 | int ptrace_getregs(long pid, unsigned long *regs_out) | 20 | int ptrace_getregs(long pid, unsigned long *regs_out) |
20 | { | 21 | { |
@@ -51,7 +52,7 @@ static void write_debugregs(int pid, unsigned long *regs) | |||
51 | int nregs, i; | 52 | int nregs, i; |
52 | 53 | ||
53 | dummy = NULL; | 54 | dummy = NULL; |
54 | nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]); | 55 | nregs = ARRAY_SIZE(dummy->u_debugreg); |
55 | for(i = 0; i < nregs; i++){ | 56 | for(i = 0; i < nregs; i++){ |
56 | if((i == 4) || (i == 5)) continue; | 57 | if((i == 4) || (i == 5)) continue; |
57 | if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i], | 58 | if(ptrace(PTRACE_POKEUSR, pid, &dummy->u_debugreg[i], |
@@ -68,7 +69,7 @@ static void read_debugregs(int pid, unsigned long *regs) | |||
68 | int nregs, i; | 69 | int nregs, i; |
69 | 70 | ||
70 | dummy = NULL; | 71 | dummy = NULL; |
71 | nregs = sizeof(dummy->u_debugreg)/sizeof(dummy->u_debugreg[0]); | 72 | nregs = ARRAY_SIZE(dummy->u_debugreg); |
72 | for(i = 0; i < nregs; i++){ | 73 | for(i = 0; i < nregs; i++){ |
73 | regs[i] = ptrace(PTRACE_PEEKUSR, pid, | 74 | regs[i] = ptrace(PTRACE_PEEKUSR, pid, |
74 | &dummy->u_debugreg[i], 0); | 75 | &dummy->u_debugreg[i], 0); |