xref: /haiku/headers/private/kernel/ksyscalls.h (revision 19101ba0f4061b3ca064ad0713dfd29e93104a39)
152a38012Sejakowatz /*
252a38012Sejakowatz ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
352a38012Sejakowatz ** Distributed under the terms of the NewOS License.
452a38012Sejakowatz */
52fe71062SAxel Dörfler #ifndef _KERNEL_KSYSCALLS_H
62fe71062SAxel Dörfler #define _KERNEL_KSYSCALLS_H
752a38012Sejakowatz 
8b67f1117SAxel Dörfler 
9c3c3d22fSAxel Dörfler #include <SupportDefs.h>
10c3c3d22fSAxel Dörfler 
11c3c3d22fSAxel Dörfler 
12*19101ba0SIngo Weinhold #define MAX_SYSCALL_PARAMETERS	16
13*19101ba0SIngo Weinhold 
14*19101ba0SIngo Weinhold 
1534b3b26bSIngo Weinhold typedef struct syscall_info {
167d4d6d35SIngo Weinhold 	void	*function;		// pointer to the syscall function
177d4d6d35SIngo Weinhold 	int		parameter_size;	// summed up parameter size
187d4d6d35SIngo Weinhold } syscall_info;
197d4d6d35SIngo Weinhold 
20*19101ba0SIngo Weinhold typedef struct syscall_parameter_info {
21*19101ba0SIngo Weinhold 	int			offset;
22*19101ba0SIngo Weinhold 	int			size;
23*19101ba0SIngo Weinhold 	int			used_size;
24*19101ba0SIngo Weinhold 	type_code	type;
25*19101ba0SIngo Weinhold } syscall_parameter_info;
26*19101ba0SIngo Weinhold 
27*19101ba0SIngo Weinhold typedef struct syscall_parameters_info {
28*19101ba0SIngo Weinhold 	int						parameter_count;
29*19101ba0SIngo Weinhold 	syscall_parameter_info	parameters[MAX_SYSCALL_PARAMETERS];
30*19101ba0SIngo Weinhold } syscall_parameters_info;
31*19101ba0SIngo Weinhold 
32*19101ba0SIngo Weinhold 
337d4d6d35SIngo Weinhold extern const int kSyscallCount;
347d4d6d35SIngo Weinhold extern const syscall_info kSyscallInfos[];
35*19101ba0SIngo Weinhold extern const syscall_parameters_info kSyscallParametersInfos[];
367d4d6d35SIngo Weinhold 
377d4d6d35SIngo Weinhold 
38c3c3d22fSAxel Dörfler #ifdef __cplusplus
39c3c3d22fSAxel Dörfler extern "C" {
40c3c3d22fSAxel Dörfler #endif
41c3c3d22fSAxel Dörfler 
42c3c3d22fSAxel Dörfler int32 syscall_dispatcher(uint32 function, void *argBuffer, uint64 *_returnValue);
43c3c3d22fSAxel Dörfler status_t generic_syscall_init(void);
44c3c3d22fSAxel Dörfler 
45c3c3d22fSAxel Dörfler #ifdef __cplusplus
46c3c3d22fSAxel Dörfler }
47c3c3d22fSAxel Dörfler #endif
4852a38012Sejakowatz 
492fe71062SAxel Dörfler #endif	/* _KERNEL_KSYSCALLS_H */
50