1 /* syscall for META/uClibc
3 * Copyright (C) 2013 Imagination Technologies
5 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
10 #include <sys/types.h>
11 #include <sys/syscall.h>
13 long syscall(long sysnum
,
14 long arg1
, long arg2
, long arg3
,
15 long arg4
, long arg5
, long arg6
)
18 register long __call
__asm__ ("D1Re0") = sysnum
;
19 register long __res
__asm__ ("D0Re0");
20 register long __a
__asm__ ("D1Ar1") = arg1
;
21 register long __b
__asm__ ("D0Ar2") = arg2
;
22 register long __c
__asm__ ("D1Ar3") = arg3
;
23 register long __d
__asm__ ("D0Ar4") = arg4
;
24 register long __e
__asm__ ("D1Ar5") = arg5
;
25 register long __f
__asm__ ("D0Ar6") = arg6
;
28 __asm__
__volatile__ ("SWITCH #0x440001"
30 : "d" (__call
), "d" (__a
), "d" (__b
),
31 "d" (__c
), "d" (__d
), "d" (__e
) , "d" (__f
)
34 if(__res
>= (unsigned long) -4095) {
36 (*__errno_location()) = (-err
);
37 __res
= (unsigned long) -1;