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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [arm/] [syscall.c] - Blame information for rev 1779

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

Line No. Rev Author Line
1 1325 phoenix
/* vi: set sw=4 ts=4: */
2
/* syscall for arm/uClibc
3
 *
4
 * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
5
 *
6
 * This program is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU Library General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or (at your
9
 * option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
14
 * for more details.
15
 *
16
 * You should have received a copy of the GNU Library General Public License
17
 * along with this program; if not, write to the Free Software Foundation,
18
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
 */
20
 
21
#include <features.h>
22
#include <errno.h>
23
#include <sys/types.h>
24
#include <sys/syscall.h>
25
 
26
 
27
long syscall(long sysnum, long a, long b, long c, long d, long e, long f)
28
{
29
    register long _r0 asm("r0")=(long)(sysnum);
30
    register long _r6 asm("r6")=(long)(f);
31
    register long _r5 asm("r5")=(long)(e);
32
    register long _r4 asm("r4")=(long)(d);
33
    register long _r3 asm("r3")=(long)(c);
34
    register long _r2 asm("r2")=(long)(b);
35
    register long _r1 asm("r1")=(long)(a);
36
    asm volatile(
37
            "swi %1"
38
            : "=r"(_r0)
39
            : "i"(__NR_syscall), "r"(_r0), "r"(_r1),
40
              "r"(_r2), "r"(_r3), "r"(_r4), "r"(_r5),
41
              "r"(_r6)
42
            : "memory");
43
    if(_r0 >=(unsigned long) -4095) {
44
        (*__errno_location())=(-_r0);
45
        _r0=(unsigned long) -1;
46
    }
47
    return (long) _r0;
48
}
49
 

powered by: WebSVN 2.1.0

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