Jens Axboe | 12cbb46 | 2007-12-10 20:24:44 +0100 | [diff] [blame] | 1 | #ifndef _SYSLET_H_ |
| 2 | #define _SYSLET_H_ |
Jens Axboe | a4f4fdd | 2007-02-14 01:16:39 +0100 | [diff] [blame] | 3 | |
Jens Axboe | 12cbb46 | 2007-12-10 20:24:44 +0100 | [diff] [blame] | 4 | #include "kcompat.h" |
| 5 | |
| 6 | struct syslet_frame { |
| 7 | u64 ip; |
| 8 | u64 sp; |
| 9 | }; |
| 10 | |
| 11 | struct syslet_args { |
| 12 | u64 ring_ptr; |
| 13 | u64 caller_data; |
| 14 | struct syslet_frame frame; |
| 15 | }; |
| 16 | |
| 17 | struct syslet_completion { |
| 18 | u64 status; |
| 19 | u64 caller_data; |
| 20 | }; |
| 21 | |
| 22 | struct 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 Molnar | ad18c1e | 2007-02-20 10:19:41 +0100 | [diff] [blame] | 34 | #endif |
| 35 | |
Jens Axboe | 12cbb46 | 2007-12-10 20:24:44 +0100 | [diff] [blame] | 36 | #define ESYSLETPENDING 132 |
Jens Axboe | a4f4fdd | 2007-02-14 01:16:39 +0100 | [diff] [blame] | 37 | |
Jens Axboe | 12cbb46 | 2007-12-10 20:24:44 +0100 | [diff] [blame] | 38 | typedef void (*syslet_return_func_t)(void); |
Jens Axboe | a4f4fdd | 2007-02-14 01:16:39 +0100 | [diff] [blame] | 39 | |
Jens Axboe | f3de88a | 2008-02-24 21:36:00 +0100 | [diff] [blame] | 40 | static 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 Axboe | 12cbb46 | 2007-12-10 20:24:44 +0100 | [diff] [blame] | 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 | } |
Jens Axboe | a4f4fdd | 2007-02-14 01:16:39 +0100 | [diff] [blame] | 49 | |
| 50 | #endif |