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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [sysdep.h] - Blame information for rev 1771

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

Line No. Rev Author Line
1 199 simons
/* Copyright (C) 1992 Free Software Foundation, Inc.
2
This file is part of the GNU C Library.
3
 
4
The GNU C Library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public License as
6
published by the Free Software Foundation; either version 2 of the
7
License, or (at your option) any later version.
8
 
9
The GNU C Library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
Library General Public License for more details.
13
 
14
You should have received a copy of the GNU Library General Public
15
License along with the GNU C Library; see the file COPYING.LIB.  If
16
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17
Cambridge, MA 02139, USA.  */
18
 
19
#include <sys/syscall.h>
20
 
21
#define SYMBOL_NAME(X) _##X
22
#define SYMBOL_NAME_LABEL(X) _##X##:
23
#define ALIGN 4
24
 
25
#define ENTRY(name)                                                           \
26
  .global SYMBOL_NAME(name);                                                  \
27
  .align ALIGN;                                                               \
28
  SYMBOL_NAME_LABEL(name)
29
 
30
#define _HASH  #
31
 
32
/* In case of returning a memory address, negative values may not mean
33
   error.  Moreover, we have to copy the return value to register %a0,
34
   as those syscalls are normally declared to return a pointer.  */
35
 
36
#ifdef __CHECK_RETURN_ADDR
37
#define check_error(LAB)        cmp.l _HASH -4096, %d0; jls LAB
38
#define copy_ret                move.l %d0, %a0
39
#else
40
#define check_error(LAB)        tst.l %d0; jpl LAB
41
#define copy_ret                /* empty */
42
#endif
43
 
44
#define ERRNO_LOCATION SYMBOL_NAME(__errno_location)
45
 
46
#define PSEUDO(name, syscall_name, args)                        \
47
        .text;                                                  \
48
        ENTRY (name)                                            \
49
        l.addi r11,r0,SYS_##syscall_name;                       \
50
        l.sys 1;                                                \
51
        l.nop;                                                  \
52 523 simons
        l.jr r9;                                                \
53 199 simons
        l.nop
54
 
55
#define ret                                                     \
56 523 simons
        l.jr r9;                                                \
57 199 simons
        l.nop
58
 
59
#define SYSCALL__(name,args)    PSEUDO (name, name, args)
60
#define SYSCALL(name,args)      PSEUDO (name, name, args)

powered by: WebSVN 2.1.0

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