added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / .unmaintained / arm-all / clib / longjmp.s
blob5f7999e8d52b64823308c211855e6146007d985f
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: longjmp
6 Lang: english
7 */
9 /******************************************************************************
11 NAME
12 #include <setjmp.h>
14 void longjmp (jmp_buf env, int val);
16 FUNCTION
17 Save the current context so that you can return to it later.
19 INPUTS
20 env - The context/environment to restore
21 val - This value is returned by setjmp() when you return to the
22 saved context. You cannot return 0. If val is 0, then
23 setjmp() returns with 1.
25 RESULT
26 This function doesn't return.
28 NOTES
30 EXAMPLE
31 jmp_buf env;
33 ... some code ...
35 if (!setjmp (env))
37 ... this code is executed after setjmp() returns ...
39 // This is no good example on how to use this function
40 // You should not do that
41 if (error)
42 longjmp (env, 5);
44 ... some code ...
46 else
48 ... this code is executed if you call longjmp(env) ...
51 BUGS
53 SEE ALSO
54 setjmp()
56 INTERNALS
58 HISTORY
60 ******************************************************************************/
62 #include "../include/aros/machine.i"
64 .text
65 .balign 4
66 .globl longjmp
68 .set FirstArg, 4 /* Skip Return-Adress */
69 .set env, FirstArg
70 .set val, env+4
71 .set retaddr, 0
72 longjmp: