~ubuntu-branches/ubuntu/quantal/uclibc/quantal

« back to all changes in this revision

Viewing changes to libc/sysdeps/linux/mips/syscall_error.S

  • Committer: Bazaar Package Importer
  • Author(s): Hector Oron
  • Date: 2011-06-11 03:06:20 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110611030620-ywjfvyuqvrpsm282
Tags: 0.9.32-1
* New upstream release
* Add myself as maintainer
* Bump standards version 
* Add Vcs-Git, Vcs-Browser and Homepage fields
* Add watch file 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2002, 2003
 
2
   Free Software Foundation, Inc.
 
3
   This file is part of the GNU C Library.
 
4
   Contributed by Brendan Kehoe (brendan@zen.org).
 
5
 
 
6
   The GNU C Library is free software; you can redistribute it and/or
 
7
   modify it under the terms of the GNU Lesser General Public
 
8
   License as published by the Free Software Foundation; either
 
9
   version 2.1 of the License, or (at your option) any later version.
 
10
 
 
11
   The GNU C Library is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
   Lesser General Public License for more details.
 
15
 
 
16
   You should have received a copy of the GNU Lesser General Public
 
17
   License along with the GNU C Library; if not, write to the Free
 
18
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
19
   02111-1307 USA.  */
 
20
 
 
21
#include <sys/asm.h>
 
22
#include <sysdep.h>
 
23
#include <bits/errno.h>
 
24
 
 
25
#ifdef _LIBC_REENTRANT
 
26
 
 
27
LOCALSZ= 3
 
28
FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
 
29
RAOFF= FRAMESZ-(1*SZREG)
 
30
GPOFF= FRAMESZ-(2*SZREG)
 
31
V0OFF= FRAMESZ-(3*SZREG)
 
32
 
 
33
ENTRY(__syscall_error)
 
34
#ifdef __PIC__
 
35
        .set noat
 
36
        SETUP_GPX (AT)
 
37
        .set at
 
38
#endif
 
39
        PTR_SUBU sp, FRAMESZ
 
40
        .set noat
 
41
        SETUP_GPX64(GPOFF,AT)
 
42
        .set at
 
43
#ifdef __PIC__
 
44
        SAVE_GP(GPOFF)
 
45
#endif
 
46
        REG_S   v0, V0OFF(sp)
 
47
        REG_S   ra, RAOFF(sp)
 
48
 
 
49
        /* Find our per-thread errno address  */
 
50
        jal     __errno_location
 
51
 
 
52
        /* Store the error value.  */
 
53
        REG_L   t0, V0OFF(sp)
 
54
        sw      t0, 0(v0)
 
55
 
 
56
        /* And just kick back a -1.  */
 
57
        REG_L   ra, RAOFF(sp)
 
58
        RESTORE_GP64
 
59
        PTR_ADDU sp, FRAMESZ
 
60
        li      v0, -1
 
61
        j       ra
 
62
        END(__syscall_error)
 
63
 
 
64
#else /* __LIBC_REENTRANT */
 
65
 
 
66
 
 
67
ENTRY(__syscall_error)
 
68
#ifdef __PIC__
 
69
        .set noat
 
70
        SETUP_GPX (AT)
 
71
        .set at
 
72
#endif
 
73
        SETUP_GPX64 (t9, AT)
 
74
 
 
75
        /* Store it in errno... */
 
76
        sw v0, errno
 
77
 
 
78
        /* And just kick back a -1.  */
 
79
        li v0, -1
 
80
 
 
81
        RESTORE_GP64
 
82
        j ra
 
83
        END(__syscall_error)
 
84
#endif  /* _LIBC_REENTRANT*/