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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [libgloss/] [xstormy16/] [syscalls.m4] - Rev 258

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

# xstormy16 system calls for the simulator
 
#include <syscall.h>
 
	.text
 
define(`syscall',`.globl _`'$1
_`'$1`':
	mov r1,#SYS_$1
	.hword 0x0001
	bnz r1,#0,syscall_error
	ret
0:	.size $1,0b-_$1
')dnl
	syscall(exit)
	syscall(open)
	syscall(close)
	syscall(read)
	syscall(write)
	syscall(lseek)
	syscall(unlink)
	syscall(getpid)
	syscall(kill)
	syscall(fstat)
	syscall(chdir)
	syscall(stat)
	syscall(chmod)
	syscall(utime)
	syscall(time)
	syscall(gettimeofday)
	syscall(times)
	syscall(link)
dnl
syscall_error:
	push r0
	callf __errno
	pop r0
	mov.w (r2),r0
	ret
0:	.size syscall_error,0b-syscall_error
 

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.