Main Page   File List  

setjmp.h

Go to the documentation of this file.
00001 
00009 /* (c) 2004 Technische Universitaet Dresden
00010  * This file is part of DROPS, which is distributed under the terms of the
00011  * GNU General Public License 2. Please see the COPYING file for details.
00012  */
00013 #ifndef __UTIL_INCLUDE_ARCH_AMD64_L4API_L4V2_SETJMP_H_
00014 #define __UTIL_INCLUDE_ARCH_AMd64_L4API_L4V2_SETJMP_H_
00015 #include <l4/sys/types.h>
00016 #include <l4/sys/syscalls.h>
00017 #include <l4/sys/compiler.h>
00018 
00019 EXTERN_C_BEGIN
00020 
00021 typedef struct{
00022     l4_umword_t r8;             /* 0x00 */
00023     l4_umword_t r9;             /* 0x08 */
00024     l4_umword_t r10;            /* 0x10 */
00025     l4_umword_t r11;            /* 0x18 */
00026     l4_umword_t r12;            /* 0x20 */
00027     l4_umword_t r13;            /* 0x28 */
00028     l4_umword_t r14;            /* 0x30 */
00029     l4_umword_t r15;            /* 0x38 */
00030     l4_umword_t rbx;            /* 0x40 */
00031     l4_umword_t rsi;            /* 0x48 */
00032     l4_umword_t rbp;            /* 0x50 */
00033     l4_umword_t rsp;            /* 0x58 */
00034     l4_umword_t rip;            /* 0x60 */
00035     l4_umword_t rip_caller;     /* 0x68 */
00036     l4_umword_t rflags;         /* 0x70 */
00037     l4_umword_t stack[40];
00038 } l4_thread_jmp_buf_s;
00039 typedef int l4_thread_jmp_buf[sizeof(l4_thread_jmp_buf_s)/sizeof(l4_umword_t)];
00040 
00041 typedef union{
00042     l4_thread_jmp_buf_s s;
00043     l4_thread_jmp_buf raw;
00044 } l4_thread_jmp_buf_u;
00045 
00046 /*\brief inter-thread setjmp
00047  *
00048  * \param       env     jump buffer
00049  * \retval      0       returned directly
00050  * \retval      !0      returned from longjmp
00051  *
00052  * Use this function to prepare a longjmp from another thread for this thread.
00053  *
00054  * \see setjmp(3)
00055  */
00056 L4_CV int l4_thread_setjmp(l4_thread_jmp_buf env);
00057 
00071 L4_CV void l4_thread_longjmp(l4_threadid_t thread, l4_thread_jmp_buf env, int val);
00072 
00073 EXTERN_C_END
00074 
00075 #endif

L4 Utilities, part of DROPS  © 2000-2003