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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [sys/] [sparc64/] [sigsetjmp.S] - Blame information for rev 855

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

Line No. Rev Author Line
1 148 jeremybenn
! This file is called sigsetjmp.s because that is what V8 uses.
2
! We do not define sigsetjmp() or setlongjmp() yet.
3
! Solaris has setjmp/longjmp in setjmp.o.  Move this stuff there.
4
 
5
#include 
6
 
7
        TEXT_SECTION
8
        ALIGN (4)
9
 
10
#ifdef __svr4__
11
 
12
        GLOBAL (ASM_SYMBOL (setjmp))
13
        .proc   04
14
ASM_SYMBOL (setjmp):
15
 
16
        clr     [%o0]
17
        stx     %sp,[%o0+8]
18
        add     %o7,8,%g1
19
        stx     %g1,[%o0+16]
20
        retl
21
        mov     %g0,%o0
22
 
23
        GLOBAL (ASM_SYMBOL (longjmp))
24
        .proc   04
25
ASM_SYMBOL (longjmp):
26
 
27
        flushw                          ! flush register windows
28
        sub     %sp,136,%sp
29
        ldx     [%o0+8],%fp
30
        ldx     [%o0+16],%g1
31
        tst     %o1
32
        bne     L0
33
        sub     %g1,8,%o7
34
        mov     1,%o1
35
L0:
36
        retl
37
        restore %o1,0,%o0
38
 
39
#else
40
 
41
        GLOBAL (ASM_SYMBOL (setjmp))
42
        .proc   04
43
ASM_SYMBOL (setjmp):
44
        save    %sp,-136,%sp
45
        or      %g0,%g0,%o0             ! %o0 = 0
46
        or      %g0,0x6d,%g1            ! %g1 = 0x6d (syscall number)
47
        ta      SYSCALL_TRAP
48
        stw     %o0,[%i0+4]             ! save result at [%i0+4] (sigmask?)
49
        add     %fp,-8,%o1              ! %o1 -> tmp 8 byte buffer
50
        or      %g0,%g0,%o0             ! %o0 = 0
51
        or      %g0,0x70,%g1            ! %g1 = 0x70 (syscall number)
52
        ta      SYSCALL_TRAP
53
        lduw    [%fp-4],%g1             ! %g1 = onsstack?
54
        stw     %fp,[%i0+8]             ! save %fp at [%i0+8]
55
        stw     %g1,[%i0+0]             ! save ? at [%i0+8]
56
        add     %i7,8,%g1               ! %g1 = return address
57
        stw     %g1,[%i0+12]            ! save return address at [%i0+12]
58
        add     %g1,4,%g1               ! %g1 = nPC
59
        stw     %g1,[%i0+16]            ! save nPC at [%i0+16]
60
        stw     %g0,[%i0+20]
61
        stw     %g0,[%i0+24]
62
        stw     %g0,[%i0+32]
63
        jmpl    %i7+8,%g0
64
        restore %g0,0,%o0
65
 
66
        GLOBAL (ASM_SYMBOL (longjmp))
67
        .proc   04
68
ASM_SYMBOL (longjmp):
69
        orcc    %g0,%o1,%g0             ! return val == 0 ?
70
        be,a    L1                      ! branch if 0
71
        or      %g0,1,%o1               ! make it 1 (executed if branch taken)
72
L1:
73
        or      %g0,0x8b,%g1            ! set syscall 0x8b
74
        stw     %o1,[%o0+28]            ! save return val for restoration
75
        ta      SYSCALL_TRAP
76
 
77
#endif /* ! __svr4__ */

powered by: WebSVN 2.1.0

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