summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/h8300/ptrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/h8300/ptrace.c')
-rw-r--r--libc/sysdeps/linux/h8300/ptrace.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/libc/sysdeps/linux/h8300/ptrace.c b/libc/sysdeps/linux/h8300/ptrace.c
index 64fb7bc96..7ce1b277e 100644
--- a/libc/sysdeps/linux/h8300/ptrace.c
+++ b/libc/sysdeps/linux/h8300/ptrace.c
@@ -1,24 +1,15 @@
#include <errno.h>
#include <asm/ptrace.h>
-#include <sys/syscall.h>
-#include <stdarg.h>
+#include <asm/unistd.h>
int
-ptrace(int request, ... /* int pid, int addr, int data */)
+ptrace(int request, int pid, int addr, int data)
{
- long ret;
- long res;
- int pid,addr,data;
- va_list ap;
+ int ret;
+ int res;
- va_start(ap,request);
- pid = va_arg(ap,int);
- addr = va_arg(ap,int);
- data = va_arg(ap,int);
- va_end(ap);
-
- if (request > 0 && request < 4) (long *)data = &ret;
+ if (request > 0 && request < 4) data = (int)&ret;
__asm__ volatile ("sub.l er0,er0\n\t"
"mov.b %1,r0l\n\t"
@@ -30,7 +21,8 @@ ptrace(int request, ... /* int pid, int addr, int data */)
"mov.l er0,%0"
:"=g" (res)
:"i" (__NR_ptrace), "g" (request), "g" (pid),
- "g" (addr), "g" (data) : "er0", "er1", "er2", "er3", "er4");
+ "g" (addr), "g" (data)
+ : "er0", "er1", "er2", "er3", "er4");
if (res >= 0) {
if (request > 0 && request < 4) {