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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [machine/] [d10v/] [setjmp.S] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
; setjmp/longjmp for D10V.  The jmpbuf looks like this:
; setjmp/longjmp for D10V.  The jmpbuf looks like this:
;
;
; Register              jmpbuf offset
; Register              jmpbuf offset
; R6                    0x00
; R6                    0x00
; R7                    0x02
; R7                    0x02
; R8                    0x04
; R8                    0x04
; R9                    0x06
; R9                    0x06
; R10                   0x08
; R10                   0x08
; R11                   0x0a
; R11                   0x0a
; R13 (return address)  0x0c
; R13 (return address)  0x0c
; R15 (SP)              0x0E
; R15 (SP)              0x0E
        .text
        .text
        .globl  setjmp
        .globl  setjmp
        .type   setjmp,@function
        .type   setjmp,@function
        .stabs  "setjmp.S",100,0,0,setjmp
        .stabs  "setjmp.S",100,0,0,setjmp
        .stabs  "int:t(0,1)=r(0,1);-65536;65535;",128,0,0,0
        .stabs  "int:t(0,1)=r(0,1);-65536;65535;",128,0,0,0
        .stabs  "setjmp:F(0,1)",36,0,1,setjmp
        .stabs  "setjmp:F(0,1)",36,0,1,setjmp
setjmp:
setjmp:
; Address of jmpbuf is passed in R0.  Save the appropriate registers.
; Address of jmpbuf is passed in R0.  Save the appropriate registers.
        st2w    r6, @r0+
        st2w    r6, @r0+
        st2w    r8, @r0+
        st2w    r8, @r0+
        st2w    r10, @r0+
        st2w    r10, @r0+
        st      r13, @r0+
        st      r13, @r0+
        st      r15, @r0+
        st      r15, @r0+
; Return 0 to caller
; Return 0 to caller
        ldi     r0, 0
        ldi     r0, 0
        jmp     r13
        jmp     r13
.Lsetjmp:
.Lsetjmp:
        .size   setjmp,.Lsetjmp-setjmp
        .size   setjmp,.Lsetjmp-setjmp
        .stabs  "",36,0,0,.Lsetjmp-setjmp
        .stabs  "",36,0,0,.Lsetjmp-setjmp
        .globl  longjmp
        .globl  longjmp
        .type   longjmp,@function
        .type   longjmp,@function
        .stabs  "longjmp:F(0,1)",36,0,1,longjmp
        .stabs  "longjmp:F(0,1)",36,0,1,longjmp
longjmp:
longjmp:
; Address of jmpbuf is in R0.  Restore the registers.
; Address of jmpbuf is in R0.  Restore the registers.
        ld2w    r6, @r0+
        ld2w    r6, @r0+
        ld2w    r8, @r0+
        ld2w    r8, @r0+
        ld2w    r10, @r0+
        ld2w    r10, @r0+
        ld      r13, @r0+
        ld      r13, @r0+
        ld      r15, @r0+
        ld      r15, @r0+
; Value to return to caller is in R1.  If caller attemped to return 0,
; Value to return to caller is in R1.  If caller attemped to return 0,
; return 1 instead.
; return 1 instead.
        mv      r0, r1
        mv      r0, r1
        cmpeqi  r0, 0
        cmpeqi  r0, 0
        exef0t || ldi r0,1
        exef0t || ldi r0,1
        jmp     r13
        jmp     r13
.Llongjmp:
.Llongjmp:
        .size   longjmp,.Llongjmp-longjmp
        .size   longjmp,.Llongjmp-longjmp
        .stabs  "",36,0,0,.Llongjmp-longjmp
        .stabs  "",36,0,0,.Llongjmp-longjmp
 
 

powered by: WebSVN 2.1.0

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