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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [machine/] [z8k/] [setjmp.S] - Blame information for rev 862

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

Line No. Rev Author Line
1 148 jeremybenn
        .global _setjmp
2
        .global _longjmp
3
 
4
#ifdef __Z8001__
5
        segm
6
 
7
#ifdef __STD_CALL__
8
 
9
_setjmp:
10
        ldl     rr6,rr14(#4)    ! get argument
11
        ldl     rr2,@rr14       ! fetch pc
12
        ldl     @rr6,rr2        ! save it
13
        ldl     rr6(#16),rr8
14
        ldl     rr6(#4),rr10
15
        ldl     rr6(#8),rr12    ! remember frame pointer
16
        ldl     rr6(#12),rr14   ! remember stack pointer
17
        ldk     r7,#0
18
        ret     t
19
 
20
_longjmp:
21
        ldl     rr4,rr14(#4)    ! get first argument
22
        ld      r7,rr14(#8)     ! get return value
23
        ldl     rr8,rr4(#16)
24
        ldl     rr10,rr4(#4)
25
        ldl     rr12,rr4(#8)    ! restore old frame pointer
26
        ldl     rr14,rr4(#12)   ! restore old stack pointer
27
        ldl     rr4,@rr4        ! return address
28
        inc     r15,#4
29
        jp      @rr4
30
 
31
#else /* above __STD_CALL_, below not */
32
 
33
_setjmp:
34
        ldl     rr2,@rr14       ! fetch pc
35
        ldl     @rr6,rr2        ! save it
36
        ldl     rr6(16),rr8
37
        ldl     rr6(4),rr10
38
        ldl     rr6(8),rr12     ! and the other special regs
39
        ldl     rr6(12),rr14
40
        ldk     r2,#0
41
        ret     t
42
 
43
_longjmp:
44
        ld      r2,r5           ! get return value
45
        ldl     rr4,rr6(0)
46
        ldl     rr8,rr6(16)
47
        ldl     rr10,rr6(4)
48
        ldl     rr12,rr6(8)
49
        ldl     rr14,rr6(12)
50
        inc     r15,#4
51
        jp      @rr4
52
 
53
#endif  /* not __STD_CALL__ */
54
#else /* above Z8001, below Z8002 */
55
        unseg
56
 
57
#ifdef __STD_CALL__
58
 
59
_setjmp:
60
        ld      r7,r15(#2)      ! get argument
61
        ld      r2,@r15         ! fetch pc
62
        ld      @r7,r2          ! save it
63
        ldl     r7(#14),rr8
64
        ldl     r7(#2),rr10
65
        ldl     r7(#6),rr12     ! remember frame pointer
66
        ldl     r7(#10),rr14    ! remember stack pointer
67
        ldk     r7,#0
68
        ret     t
69
 
70
_longjmp:
71
        ld      r4,r15(#2)      ! get first argument (jmp_buf)
72
        ld      r7,r15(#4)      ! get return value
73
        ldl     rr8,r4(#14)
74
        ldl     rr10,r4(#2)
75
        ldl     rr12,r4(#6)     ! restore old frame pointer
76
        ldl     rr14,r4(#10)    ! restore old stack pointer
77
        ld      r4,@r4          ! return address
78
        inc     r15,#2
79
        jp      @r4
80
 
81
#else /* above __STD_CALL_, below not */
82
 
83
_setjmp:
84
        ld      r2,@r15 ! fetch pc
85
        ld      @r7,r2  ! save it
86
        ldl     r7(4),rr10
87
        ldl     r7(8),rr12      ! and the other special regs
88
        ldl     r7(12),rr14
89
        ldk     r2,#0
90
        ret     t
91
 
92
_longjmp:
93
        ld      r2,r6           ! get return value
94
        ld      r4,@r7
95
        ldl     rr10,r7(4)
96
        ldl     rr12,r7(8)
97
        ldl     rr14,r7(12)
98
        inc     r15,#2
99
        jp      @r4
100
 
101
#endif  /* not __STD_CALL__ */
102
#endif  /* Z8002 version */

powered by: WebSVN 2.1.0

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