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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [sys/] [arm/] [setjmp.S] - Diff between revs 39 and 56

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 39 Rev 56
Line 1... Line 1...
/* This is a simple version of setjmp and longjmp.
/* This is a simple version of setjmp and longjmp.
 
 
   Nick Clifton, Cygnus Solutions, 13 June 1997.  */
   Nick Clifton, Cygnus Solutions, 13 June 1997.  */
 
 
 
/* ANSI concatenation macros.  */
 
#define CONCAT(a, b) CONCAT2(a, b)
 
#define CONCAT2(a, b) a ## b
 
 
 
#ifdef __USER_LABEL_PREFIX__
 
#define FUNCTION( name ) CONCAT (__USER_LABEL_PREFIX__, name)
 
#else
 
#error __USER_LABEL_PREFIX__ is not defined
 
#endif
 
 
 
 
        .text
        .text
        .code 32
        .code 32
        .align 2
        .align 2
 
 
/* int setjmp (jmp_buf);  */
/* int setjmp (jmp_buf);  */
        .globl  _setjmp
        .globl  FUNCTION(setjmp)
_setjmp:
FUNCTION(setjmp):
 
 
        /* Save all the callee-preserved registers into the jump buffer. */
        /* Save all the callee-preserved registers into the jump buffer. */
        stmea           a1!, { v1-v7, fp, ip, sp, lr }
        stmea           a1!, { v1-v7, fp, ip, sp, lr }
 
 
#if 0   /* Simulator does not cope with FP instructions yet.... */
#if 0   /* Simulator does not cope with FP instructions yet.... */
Line 32... Line 42...
.word   0xe12fff1e      /*  bx lr */
.word   0xe12fff1e      /*  bx lr */
#endif
#endif
 
 
 
 
/* volatile void longjmp (jmp_buf, int);  */
/* volatile void longjmp (jmp_buf, int);  */
        .globl  _longjmp
        .globl  FUNCTION(longjmp)
_longjmp:
FUNCTION(longjmp):
 
 
        /* If we have stack extension code it ought to be handled here. */
        /* If we have stack extension code it ought to be handled here. */
 
 
        /* Restore the registers, retrieving the state when setjmp() was called. */
        /* Restore the registers, retrieving the state when setjmp() was called. */
        ldmfd           a1!, { v1-v7, fp, ip, sp, lr }
        ldmfd           a1!, { v1-v7, fp, ip, sp, lr }

powered by: WebSVN 2.1.0

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