1 /* syscall for frv/uClibc
3 * Copyright (C) 2004 by Alexandre Oliva <aoliva@redhat.com>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Library General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
15 * You should have received a copy of the GNU Library General Public License
16 * along with this program; see the file COPYING.LIB. If not, see
17 * <http://www.gnu.org/licenses/>.
22 #include <sys/types.h>
23 #include <sys/syscall.h>
26 long syscall(long sysnum, long arg1, long arg2, long arg3,
27 long arg4, long arg5, long arg6)
29 register unsigned long __scnum __asm__ ("gr7") = (sysnum);
30 register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) (arg1);
31 register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) (arg2);
32 register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) (arg3);
33 register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) (arg4);
34 register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) (arg5);
35 register unsigned long __sc5 __asm__ ("gr13") = (unsigned long) (arg6);
36 __asm__ __volatile__ ("tra gr0,gr0"
38 : "r" (__scnum), "r" (__sc1), "r" (__sc2),
39 "r" (__sc3), "r" (__sc4), "r" (__sc5));
40 __syscall_return(long,__sc0);