summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/h8300
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-16 20:03:25 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-16 20:03:25 +0000
commita0a890144405a9059544604fe40240b1bcfce97a (patch)
treebf1b8e8e8f5c3b8237fe6c2dc64ab785f3ecd756 /libc/sysdeps/linux/h8300
parent29f7a71028a9f9fb5b92338929c7c0f3ba98bd92 (diff)
Patch from Yoshinori Sato <qzb04471@nifty.ne.jp> to fix up
ptrace for the Hitachi h8300
Diffstat (limited to 'libc/sysdeps/linux/h8300')
-rw-r--r--libc/sysdeps/linux/h8300/ptrace.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/h8300/ptrace.c b/libc/sysdeps/linux/h8300/ptrace.c
index acd6db0b4..64fb7bc96 100644
--- a/libc/sysdeps/linux/h8300/ptrace.c
+++ b/libc/sysdeps/linux/h8300/ptrace.c
@@ -2,15 +2,26 @@
#include <errno.h>
#include <asm/ptrace.h>
#include <sys/syscall.h>
+#include <stdarg.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;
+
+ 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;
- __asm__ volatile ("mov.l %1,er0\n\t"
+ __asm__ volatile ("sub.l er0,er0\n\t"
+ "mov.b %1,r0l\n\t"
"mov.l %2,er1\n\t"
"mov.l %3,er2\n\t"
"mov.l %4,er3\n\t"