summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdiskfs/diskfs.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index f26d8663..384f27c1 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -18,12 +18,6 @@
#ifndef _HURD_DISKFS
#define _HURD_DISKFS
-#ifdef MAKING_DISKFS
-#include "../machine/diskfs_machdep.h"
-#else
-#include <hurd/machine/diskfs_machdep.h>
-#endif
-
/* Each user port referring to a file points to one of these
(with the aid of the ports library. */
struct protid
@@ -861,4 +855,31 @@ int ports_demuxer (mach_msg_header_t *, mach_msg_header_t *);
routines have the prefix `diskfs_S_'; `in' arguments of type
file_t or io_t appear as `struct protid *' to the stub. */
+
+/* Exception handling */
+
+#include <cthreads.h>
+#include <setjmp.h>
+struct thread_stuff
+{
+ jmp_buf buf;
+ struct thread_stuff *link;
+};
+
+#define diskfs_catch_exception() \
+ ({ \
+ struct thread_stuff *tmp; \
+ tmp = __builtin_alloca (sizeof (struct thread_stuff)); \
+ tmp->link = (struct thread_stuff *)cthread_data (cthread_self ()); \
+ cthread_set_data (cthread_self (), (any_t)tmp); \
+ setjmp (tmp->buf); \
+ })
+
+#define diskfs_end_catch_exception() \
+ (void) ({ \
+ struct thread_stuff *tmp; \
+ tmp = (struct thread_stuff *)cthread_data (cthread_self ()); \
+ (void) cthread_set_data (cthread_self (), (any_t)tmp->link); \
+ })
+
#endif