OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [libgloss/] [mep/] [syscalls.S] - Blame information for rev 606

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

Line No. Rev Author Line
1 207 jeremybenn
/*
2
 * Copyright (c) 2003  Red Hat, Inc. All rights reserved.
3
 *
4
 * This copyrighted material is made available to anyone wishing to use, modify,
5
 * copy, or redistribute it subject to the terms and conditions of the BSD
6
 * License.  This program is distributed in the hope that it will be useful,
7
 * but WITHOUT ANY WARRANTY expressed or implied, including the implied
8
 * warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  A copy
9
 * of this license is available at http://www.opensource.org/licenses. Any
10
 * Red Hat trademarks that are incorporated in the source code or documentation
11
 * are not subject to the BSD License and may only be used or replicated with
12
 * the express permission of Red Hat, Inc.
13
 */
14
#include "syscall.h"
15
 
16
/* Return ABI: $1 is errno, $0 is return value. */
17
 
18
#define S(n) \
19
        .global n ; .weak n ; n: ; \
20
        .2byte 0x7800 | ((SYS_##n & 0xe) << 7) | ((SYS_##n & 1) << 4) ; bra sysret
21
 
22
        .text
23
 
24
#define SYS___mep_write SYS_write
25
#define SYS___mep_read SYS_read
26
#define SYS__Sid_config SYS_reconfig
27
 
28
S(open)
29
S(close)
30
S(__mep_read)
31
S(__mep_write)
32
S(lseek)
33
S(unlink)
34
S(getpid)
35
S(kill)
36
S(fstat)
37
 
38
/* ARGV support.  */
39
S(argvlen)
40
S(argv)
41
 
42
/* These are extras added for one reason or another.  */
43
S(chdir)
44
S(stat)
45
S(chmod)
46
S(utime)
47
S(time)
48
S(gettimeofday)
49
S(times)
50
S(link)
51
S(_Sid_config)
52
 
53
sysret:
54
        add3    $sp, $sp, -16
55
        sw      $0, 0($sp)
56
        sw      $1, 4($sp)
57
        ldc     $2, $lp
58
        sw      $2, 8($sp)
59
        bsr     __errno
60
        lw      $1, 4($sp)
61
        sw      $1, ($0)
62
        lw      $0, 0($sp)
63
        lw      $2, 8($sp)
64
        stc     $2, $lp
65
        add3    $sp, $sp, 16
66
        ret

powered by: WebSVN 2.1.0

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