xref: /haiku/headers/private/kernel/ksyscalls.h (revision 19101ba0f4061b3ca064ad0713dfd29e93104a39)
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
7 
8 
9 #include <SupportDefs.h>
10 
11 
12 #define MAX_SYSCALL_PARAMETERS	16
13 
14 
15 typedef struct syscall_info {
16 	void	*function;		// pointer to the syscall function
17 	int		parameter_size;	// summed up parameter size
18 } syscall_info;
19 
20 typedef struct syscall_parameter_info {
21 	int			offset;
22 	int			size;
23 	int			used_size;
24 	type_code	type;
25 } syscall_parameter_info;
26 
27 typedef struct syscall_parameters_info {
28 	int						parameter_count;
29 	syscall_parameter_info	parameters[MAX_SYSCALL_PARAMETERS];
30 } syscall_parameters_info;
31 
32 
33 extern const int kSyscallCount;
34 extern const syscall_info kSyscallInfos[];
35 extern const syscall_parameters_info kSyscallParametersInfos[];
36 
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 int32 syscall_dispatcher(uint32 function, void *argBuffer, uint64 *_returnValue);
43 status_t generic_syscall_init(void);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif	/* _KERNEL_KSYSCALLS_H */
50