Add more examples to the Windows installer.
[fio.git] / os / syslet.h
CommitLineData
12cbb469
JA
1#ifndef _SYSLET_H_
2#define _SYSLET_H_
a4f4fdd7 3
12cbb469 4#include "kcompat.h"
ad18c1ec 5
12cbb469
JA
6struct syslet_frame {
7 u64 ip;
8 u64 sp;
a4f4fdd7
JA
9};
10
12cbb469
JA
11struct syslet_args {
12 u64 ring_ptr;
13 u64 caller_data;
14 struct syslet_frame frame;
15};
a4f4fdd7 16
12cbb469
JA
17struct syslet_completion {
18 u64 status;
19 u64 caller_data;
20};
a4f4fdd7 21
12cbb469
JA
22struct syslet_ring {
23 u32 kernel_head;
24 u32 user_tail;
25 u32 elements;
26 u32 wait_group;
27 struct syslet_completion comp[0];
28};
bf0dc8fa 29
12cbb469
JA
30#ifdef __x86_64__
31#define __NR_syslet_ring_wait 287
32#elif defined __i386__
33#define __NR_syslet_ring_wait 326
34#endif
bf0dc8fa 35
12cbb469 36#define ESYSLETPENDING 132
a4f4fdd7 37
12cbb469 38typedef void (*syslet_return_func_t)(void);
bf0dc8fa 39
f3de88a7
JA
40static inline void fill_syslet_args(struct syslet_args *args,
41 struct syslet_ring *ring, uint64_t caller_data,
42 syslet_return_func_t func, void *stack)
12cbb469
JA
43{
44 args->ring_ptr = (u64)(unsigned long)ring;
45 args->caller_data = caller_data;
46 args->frame.ip = (u64)(unsigned long)func;
47 args->frame.sp = (u64)(unsigned long)stack;
48}
a4f4fdd7
JA
49
50#endif