source: trunk/libs/newlib/src/libgloss/sparc/libsys/cerror.S @ 656

Last change on this file since 656 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.0 KB
Line 
1! Set errno.
2! This function is called by all the syscall stubs.
3!
4! FIXME: We assume errno is the first member of struct _reent.
5! Not sure what to do about this.
6
7#include "syscallasm.h"
8
9        DATA_SECTION
10        ALIGN (4)
11        GLOBAL (ASM_SYMBOL (errno))     ! FIXME: ASM_PRIVATE_SYMBOL ?
12ASM_SYMBOL (errno):
13        WORD (0)
14
15        TEXT_SECTION
16        ALIGN (4)
17
18        GLOBAL (ASM_PRIVATE_SYMBOL (cerror))
19ASM_PRIVATE_SYMBOL (cerror):
20        sethi   %hi (ASM_SYMBOL (errno)),%g1
21        st      %o0,[%g1+%lo (ASM_SYMBOL (errno))]
22        jmpl    %o7+8,%g0
23        mov     -1,%o0
24
25        GLOBAL (ASM_PRIVATE_SYMBOL (cerror_r))
26ASM_PRIVATE_SYMBOL (cerror_r):
27        st      %o0,[%o1]
28        jmpl    %o7+8,%g0
29        mov     -1,%o0
30
31! Since all system calls need this file, we put various state globals
32! here as well.
33
34        DATA_SECTION
35
36! CURBRK contains the current top of allocated space.
37! END is a private symbol in svr4, but a public one in sunos4.
38! FIXME: CURBRK is 4 bytes for now.
39
40        ALIGN (4)
41        GLOBAL (ASM_PRIVATE_SYMBOL (curbrk))
42ASM_PRIVATE_SYMBOL (curbrk):
43#ifdef SVR4
44        WORD (ASM_PRIVATE_SYMBOL (end))
45#else
46        WORD (ASM_SYMBOL (end))
47#endif
Note: See TracBrowser for help on using the repository browser.