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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [machine/] [fr30/] [setjmp.S] - Diff between revs 1007 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 1007 Rev 1765
# setjmp/longjmp for FR30.  The jmpbuf looks like this:
# setjmp/longjmp for FR30.  The jmpbuf looks like this:
#
#
# Register      jmpbuf offset
# Register      jmpbuf offset
# R8            0x00
# R8            0x00
# R9            0x04
# R9            0x04
# R10           0x08
# R10           0x08
# R11           0x0c
# R11           0x0c
# R12           0x10
# R12           0x10
# R13           0x14
# R13           0x14
# R14 (FP)      0x18
# R14 (FP)      0x18
# R15 (SP)      0x1c
# R15 (SP)      0x1c
# RP            0x20
# RP            0x20
.macro save reg
.macro save reg
        st      \reg,@r4
        st      \reg,@r4
        add     #4,r4
        add     #4,r4
.endm
.endm
.macro restore reg
.macro restore reg
        ld      @r4,\reg
        ld      @r4,\reg
        add     #4,r4
        add     #4,r4
.endm
.endm
        .text
        .text
        .global setjmp
        .global setjmp
setjmp:
setjmp:
        save    r8
        save    r8
        save    r9
        save    r9
        save    r10
        save    r10
        save    r11
        save    r11
        save    r12
        save    r12
        save    r13
        save    r13
        save    r14
        save    r14
        save    r15
        save    r15
        mov     RP,r5
        mov     RP,r5
        st      r5,@r4
        st      r5,@r4
# Return 0 to caller.
# Return 0 to caller.
        ldi:8   #0,r4
        ldi:8   #0,r4
        ret
        ret
        .global longjmp
        .global longjmp
longjmp:
longjmp:
        restore r8
        restore r8
        restore r9
        restore r9
        restore r10
        restore r10
        restore r11
        restore r11
        restore r12
        restore r12
        restore r13
        restore r13
        restore r14
        restore r14
        restore r15
        restore r15
        ld      @r4,r4
        ld      @r4,r4
        mov     r4,RP
        mov     r4,RP
# If caller attempted to return 0, return 1 instead.
# If caller attempted to return 0, return 1 instead.
        mov     r5,r4
        mov     r5,r4
        or      r4,r4
        or      r4,r4
        bne     1f
        bne     1f
        ldi:8   #1,r4
        ldi:8   #1,r4
    1:
    1:
        ret
        ret
 
 

powered by: WebSVN 2.1.0

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