Move syslet/indirect bits into the OS specific directory
authorJens Axboe <jens.axboe@oracle.com>
Sun, 24 Feb 2008 20:36:00 +0000 (21:36 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Sun, 24 Feb 2008 20:36:00 +0000 (21:36 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/syslet-rw.c
indirect.h [deleted file]
kcompat.h [deleted file]
os/indirect.h [new file with mode: 0644]
os/kcompat.h [new file with mode: 0644]
os/os-linux.h
os/syslet.h [new file with mode: 0644]
syslet.h [deleted file]

index 7bb1be8..0fdf752 100644 (file)
@@ -14,8 +14,6 @@
 #include <asm/unistd.h>
 
 #include "../fio.h"
-#include "../indirect.h"
-#include "../syslet.h"
 #include "../fls.h"
 
 #ifdef FIO_HAVE_SYSLET
diff --git a/indirect.h b/indirect.h
deleted file mode 100644 (file)
index fba6b6b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _INDIRECT_H_
-#define _INDIRECT_H_
-
-#include "syslet.h"
-
-union indirect_params {
-       struct {
-               u32 flags;
-       } file_flags;
-       struct syslet_args syslet;
-};
-
-#ifdef __x86_64__
-# define __NR_indirect 286
-struct indirect_registers {
-       u64 rax;
-       u64 rdi;
-       u64 rsi;
-       u64 rdx;
-       u64 r10;
-       u64 r8;
-       u64 r9;
-};
-#elif defined __i386__
-# define __NR_indirect 325
-struct indirect_registers {
-       u32 eax;
-       u32 ebx;
-       u32 ecx;
-       u32 edx;
-       u32 esi;
-       u32 edi;
-       u32 ebp;
-};
-#endif
-
-#define FILL_IN(var, values...) \
-         (var) = (struct indirect_registers) { values, }
-
-#endif
diff --git a/kcompat.h b/kcompat.h
deleted file mode 100644 (file)
index 9ef1f33..0000000
--- a/kcompat.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _KCOMPAT_H_
-#define _KCOMPAT_H_
-
-#include <stdint.h>
-
-#define u64 uint64_t
-#define u32 uint32_t
-
-#endif
diff --git a/os/indirect.h b/os/indirect.h
new file mode 100644 (file)
index 0000000..fba6b6b
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef _INDIRECT_H_
+#define _INDIRECT_H_
+
+#include "syslet.h"
+
+union indirect_params {
+       struct {
+               u32 flags;
+       } file_flags;
+       struct syslet_args syslet;
+};
+
+#ifdef __x86_64__
+# define __NR_indirect 286
+struct indirect_registers {
+       u64 rax;
+       u64 rdi;
+       u64 rsi;
+       u64 rdx;
+       u64 r10;
+       u64 r8;
+       u64 r9;
+};
+#elif defined __i386__
+# define __NR_indirect 325
+struct indirect_registers {
+       u32 eax;
+       u32 ebx;
+       u32 ecx;
+       u32 edx;
+       u32 esi;
+       u32 edi;
+       u32 ebp;
+};
+#endif
+
+#define FILL_IN(var, values...) \
+         (var) = (struct indirect_registers) { values, }
+
+#endif
diff --git a/os/kcompat.h b/os/kcompat.h
new file mode 100644 (file)
index 0000000..9ef1f33
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _KCOMPAT_H_
+#define _KCOMPAT_H_
+
+#include <stdint.h>
+
+#define u64 uint64_t
+#define u32 uint32_t
+
+#endif
index ed19553..e7c0e47 100644 (file)
@@ -10,6 +10,8 @@
 #include <linux/raw.h>
 #include <linux/major.h>
 
+#include "indirect.h"
+
 #define FIO_HAVE_LIBAIO
 #define FIO_HAVE_POSIXAIO
 #define FIO_HAVE_FADVISE
diff --git a/os/syslet.h b/os/syslet.h
new file mode 100644 (file)
index 0000000..095cc13
--- /dev/null
@@ -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
diff --git a/syslet.h b/syslet.h
deleted file mode 100644 (file)
index 16f81d2..0000000
--- a/syslet.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#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);
-
-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