xref: /minix3/lib/libc/arch/or1k/sys/__syscall.S (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc/*	$NetBSD: __syscall.S,v 1.1 2014/09/03 19:34:26 matt Exp $	*/
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambuc#include <machine/asm.h>
4*0a6a1f1dSLionel Sambuc
5*0a6a1f1dSLionel SambucENTRY(__syscall)
6*0a6a1f1dSLionel Sambuc	l.or	r13,r3,r0		/* syscall number */
7*0a6a1f1dSLionel Sambuc	l.or	r3,r4,r0
8*0a6a1f1dSLionel Sambuc	l.or	r4,r5,r0
9*0a6a1f1dSLionel Sambuc	l.or	r5,r6,r0
10*0a6a1f1dSLionel Sambuc	l.or	r6,r7,r0
11*0a6a1f1dSLionel Sambuc	l.or	r7,r8,r0
12*0a6a1f1dSLionel Sambuc	// at most 5 arguments can be passed via registers so the others
13*0a6a1f1dSLionel Sambuc	// must be on the stack.
14*0a6a1f1dSLionel Sambuc	l.lwz	r8,0(r1)
15*0a6a1f1dSLionel Sambuc	l.lwz	r11,4(r1)		/* use return value regs for last 2 */
16*0a6a1f1dSLionel Sambuc	l.lwz	r12,8(r1)		/* use return value regs for last 2 */
17*0a6a1f1dSLionel Sambuc	l.sys	0
18*0a6a1f1dSLionel Sambuc	l.bf	_C_LABEL(__cerror)
19*0a6a1f1dSLionel Sambuc	l.nop
20*0a6a1f1dSLionel Sambuc	l.jr	lr
21*0a6a1f1dSLionel Sambuc	l.nop
22*0a6a1f1dSLionel SambucEND(__syscall)
23*0a6a1f1dSLionel Sambuc
24*0a6a1f1dSLionel SambucSTRONG_ALIAS(syscall, __syscall)
25