OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [m68k/] [ptrace.c] - Rev 1775

Go to most recent revision | Compare with Previous | Blame | View Log

#include <errno.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
 
int
ptrace(int request, int pid, int addr, int data)
{
	long ret;
	long res;
	if (request > 0 && request < 4) (long *)data = &ret;
 
	__asm__ volatile ("movel %1,%/d0\n\t"
			  "movel %2,%/d1\n\t"
			  "movel %3,%/d2\n\t"
			  "movel %4,%/d3\n\t"
			  "movel %5,%/d4\n\t"
			  "trap  #0\n\t"
			  "movel %/d0,%0"
		:"=g" (res)
		:"i" (SYS_ptrace), "g" (request), "g" (pid),
		 "g" (addr), "g" (data) : "%d0", "%d1", "%d2", "%d3", "%d4");
 
	if (res >= 0) {
		if (request > 0 && request < 4) {
			errno = 0;
			return (ret);
		}
		return (int) res;
	}
	errno = -res;
	return -1;
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.