summaryrefslogtreecommitdiff
path: root/os/syslet.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-02-24 21:36:00 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-02-24 21:36:00 +0100
commitf3de88a7a8806016ebb27af3f4be1fced172122e (patch)
tree66d45af2dbcf76b2058a7cc8ad937dc3ba7bcec5 /os/syslet.h
parent6ae1f57f2cb8661b97b770372eeb3694f6d5a744 (diff)
downloadfio-f3de88a7a8806016ebb27af3f4be1fced172122e.tar.gz
fio-f3de88a7a8806016ebb27af3f4be1fced172122e.tar.bz2
Move syslet/indirect bits into the OS specific directory
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'os/syslet.h')
-rw-r--r--os/syslet.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/os/syslet.h b/os/syslet.h
new file mode 100644
index 00000000..095cc134
--- /dev/null
+++ b/os/syslet.h
@@ -0,0 +1,50 @@
+#ifndef _SYSLET_H_
+#define _SYSLET_H_
+
+#include "kcompat.h"
+
+struct syslet_frame {
+ u64 ip;
+ u64 sp;
+};
+
+struct syslet_args {
+ u64 ring_ptr;
+ u64 caller_data;
+ struct syslet_frame frame;
+};
+
+struct syslet_completion {
+ u64 status;
+ u64 caller_data;
+};
+
+struct syslet_ring {
+ u32 kernel_head;
+ u32 user_tail;
+ u32 elements;
+ u32 wait_group;
+ struct syslet_completion comp[0];
+};
+
+#ifdef __x86_64__
+#define __NR_syslet_ring_wait 287
+#elif defined __i386__
+#define __NR_syslet_ring_wait 326
+#endif
+
+#define ESYSLETPENDING 132
+
+typedef void (*syslet_return_func_t)(void);
+
+static inline void fill_syslet_args(struct syslet_args *args,
+ struct syslet_ring *ring, uint64_t caller_data,
+ syslet_return_func_t func, void *stack)
+{
+ args->ring_ptr = (u64)(unsigned long)ring;
+ args->caller_data = caller_data;
+ args->frame.ip = (u64)(unsigned long)func;
+ args->frame.sp = (u64)(unsigned long)stack;
+}
+
+#endif