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_X86_L4API_L4V2_SETJMP_H_
00014 #define __UTIL_INCLUDE_ARCH_X86_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 ebx;            /* 0 */
00023     l4_umword_t esi;            /* 4 */
00024     l4_umword_t edi;            /* 8 */
00025     l4_umword_t ebp;            /* 12 */
00026     l4_umword_t esp;            /* 16 */
00027     l4_umword_t eip;            /* 20 */
00028     l4_umword_t eip_caller;     /* 24 */
00029     l4_umword_t eflags;         /* 28 */
00030     l4_umword_t stack[40];
00031 } l4_thread_jmp_buf_s;
00032 typedef int l4_thread_jmp_buf[sizeof(l4_thread_jmp_buf_s)/sizeof(l4_umword_t)];
00033 
00034 typedef union{
00035     l4_thread_jmp_buf_s s;
00036     l4_thread_jmp_buf raw;
00037 } l4_thread_jmp_buf_u;
00038 
00039 /*\brief inter-thread setjmp
00040  *
00041  * \param       env     jump buffer
00042  * \retval      0       returned directly
00043  * \retval      !0      returned from longjmp
00044  *
00045  * Use this function to prepare a longjmp from another thread for this thread.
00046  *
00047  * \see setjmp(3)
00048  */
00049 extern int l4_thread_setjmp(l4_thread_jmp_buf env);
00050 
00064 void l4_thread_longjmp(l4_threadid_t thread, l4_thread_jmp_buf env, int val);
00065 
00066 EXTERN_C_END
00067 
00068 #endif

L4 Utilities, part of DROPS  © 2000-2003