blob: 095cc1347ec1551ab9f14c3f19adbbe3614e7e0d [file] [log] [blame]
Jens Axboe12cbb462007-12-10 20:24:44 +01001#ifndef _SYSLET_H_
2#define _SYSLET_H_
Jens Axboea4f4fdd2007-02-14 01:16:39 +01003
Jens Axboe12cbb462007-12-10 20:24:44 +01004#include "kcompat.h"
5
6struct syslet_frame {
7 u64 ip;
8 u64 sp;
9};
10
11struct syslet_args {
12 u64 ring_ptr;
13 u64 caller_data;
14 struct syslet_frame frame;
15};
16
17struct syslet_completion {
18 u64 status;
19 u64 caller_data;
20};
21
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};
29
30#ifdef __x86_64__
31#define __NR_syslet_ring_wait 287
32#elif defined __i386__
33#define __NR_syslet_ring_wait 326
Ingo Molnarad18c1e2007-02-20 10:19:41 +010034#endif
35
Jens Axboe12cbb462007-12-10 20:24:44 +010036#define ESYSLETPENDING 132
Jens Axboea4f4fdd2007-02-14 01:16:39 +010037
Jens Axboe12cbb462007-12-10 20:24:44 +010038typedef void (*syslet_return_func_t)(void);
Jens Axboea4f4fdd2007-02-14 01:16:39 +010039
Jens Axboef3de88a2008-02-24 21:36:00 +010040static 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)
Jens Axboe12cbb462007-12-10 20:24:44 +010043{
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}
Jens Axboea4f4fdd2007-02-14 01:16:39 +010049
50#endif