btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / kernel / ksyscalls.h
blobf57c6ba00ee609e13d9193dd57980a39891e9101
1 /*
2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef _KERNEL_KSYSCALLS_H
6 #define _KERNEL_KSYSCALLS_H
9 #include <SupportDefs.h>
12 #define MAX_SYSCALL_PARAMETERS 16
15 typedef struct syscall_info {
16 void *function; // pointer to the syscall function
17 int parameter_size; // summed up parameter size
18 } syscall_info;
20 typedef struct syscall_parameter_info {
21 int offset;
22 int size;
23 int used_size;
24 type_code type;
25 } syscall_parameter_info;
27 typedef struct syscall_return_type_info {
28 int size;
29 int used_size;
30 type_code type;
31 } syscall_return_type_info;
33 typedef struct extended_syscall_info {
34 const char* name;
35 int parameter_count;
36 syscall_return_type_info return_type;
37 syscall_parameter_info parameters[MAX_SYSCALL_PARAMETERS];
38 } extended_syscall_info;
41 extern const int kSyscallCount;
42 extern const syscall_info kSyscallInfos[];
43 extern const extended_syscall_info kExtendedSyscallInfos[];
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
50 int32 syscall_dispatcher(uint32 function, void *argBuffer, uint64 *_returnValue);
51 status_t generic_syscall_init(void);
53 #ifdef __cplusplus
55 #endif
57 #endif /* _KERNEL_KSYSCALLS_H */