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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [libgloss/] [sparc/] [libsys/] [sbrk.S] - Blame information for rev 158

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
! sbrk() system call
2
 
3
#include "syscallasm.h"
4
 
5
        TEXT_SECTION
6
        ALIGN (4)
7
#ifdef REENT
8
        GLOBAL (ASM_SYMBOL (_sbrk_r))
9
ASM_SYMBOL (_sbrk_r):
10
        mov     %o0,%o5
11
        mov     %o1,%o0
12
#else
13
        GLOBAL (ASM_SYMBOL (sbrk))
14
ASM_SYMBOL (sbrk):
15
#endif
16
        add     %o0,7,%o0
17
        andn    %o0,7,%o0
18
        sethi   %hi (ASM_PRIVATE_SYMBOL (curbrk)),%o2
19
#ifdef __sparc_v9__
20
        lduw    [%o2+%lo (ASM_PRIVATE_SYMBOL (curbrk))],%o3
21
#else
22
        ld      [%o2+%lo (ASM_PRIVATE_SYMBOL (curbrk))],%o3
23
#endif
24
        add     %o3,7,%o3
25
        andn    %o3,7,%o3
26
        add     %o3,%o0,%o0
27
        mov     %o0,%o4
28
        mov     SYS_brk,%g1
29
        ta      SYSCALL_TRAP
30
        bcs     err
31
        nop
32
        st      %o4,[%o2+%lo (ASM_PRIVATE_SYMBOL (curbrk))]
33
        jmpl    %o7+8,%g0
34
        mov     %o3,%o0
35
 
36
#ifdef REENT
37
        GLOBAL (ASM_SYMBOL (_brk_r))
38
ASM_SYMBOL (_brk_r):
39
        mov     %o0,%o5
40
        mov     %o1,%o0
41
#else
42
        GLOBAL (ASM_SYMBOL (brk))
43
ASM_SYMBOL (brk):
44
#endif
45
        add     %o0,7,%o0
46
        andn    %o0,7,%o0
47
        mov     %o0,%o2
48
        mov     SYS_brk,%g1
49
        ta      SYSCALL_TRAP
50
        bcs     err
51
        nop
52
        sethi   %hi (ASM_PRIVATE_SYMBOL (curbrk)),%o3
53
        st      %o2,[%o3+%lo (ASM_PRIVATE_SYMBOL (curbrk))]
54
        retl
55
        mov     %g0,%o0
56
 
57
err:
58
#ifdef REENT
59
        sethi   %hi (ASM_PRIVATE_SYMBOL (cerror_r)),%g1
60
        or      %g1,%lo (ASM_PRIVATE_SYMBOL (cerror_r)),%g1
61
#else
62
        sethi   %hi (ASM_PRIVATE_SYMBOL (cerror)),%g1
63
        or      %g1,%lo (ASM_PRIVATE_SYMBOL (cerror)),%g1
64
#endif
65
        jmpl    %g1,%g0
66
        mov     %o5,%o1

powered by: WebSVN 2.1.0

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