xref: /haiku/headers/private/kernel/ksyscalls.h (revision b4f58d8758380bc4ef224a1d2a05348fc1535e33)
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 
1219101ba0SIngo Weinhold #define MAX_SYSCALL_PARAMETERS	16
1319101ba0SIngo Weinhold 
1419101ba0SIngo 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 
2019101ba0SIngo Weinhold typedef struct syscall_parameter_info {
2119101ba0SIngo Weinhold 	int			offset;
2219101ba0SIngo Weinhold 	int			size;
2319101ba0SIngo Weinhold 	int			used_size;
2419101ba0SIngo Weinhold 	type_code	type;
2519101ba0SIngo Weinhold } syscall_parameter_info;
2619101ba0SIngo Weinhold 
27*b4f58d87SIngo Weinhold typedef struct extended_syscall_info {
28*b4f58d87SIngo Weinhold 	const char*				name;
2919101ba0SIngo Weinhold 	int						parameter_count;
3019101ba0SIngo Weinhold 	syscall_parameter_info	parameters[MAX_SYSCALL_PARAMETERS];
31*b4f58d87SIngo Weinhold } extended_syscall_info;
3219101ba0SIngo Weinhold 
3319101ba0SIngo Weinhold 
347d4d6d35SIngo Weinhold extern const int kSyscallCount;
357d4d6d35SIngo Weinhold extern const syscall_info kSyscallInfos[];
36*b4f58d87SIngo Weinhold extern const extended_syscall_info kExtendedSyscallInfos[];
377d4d6d35SIngo Weinhold 
387d4d6d35SIngo Weinhold 
39c3c3d22fSAxel Dörfler #ifdef __cplusplus
40c3c3d22fSAxel Dörfler extern "C" {
41c3c3d22fSAxel Dörfler #endif
42c3c3d22fSAxel Dörfler 
43c3c3d22fSAxel Dörfler int32 syscall_dispatcher(uint32 function, void *argBuffer, uint64 *_returnValue);
44c3c3d22fSAxel Dörfler status_t generic_syscall_init(void);
45c3c3d22fSAxel Dörfler 
46c3c3d22fSAxel Dörfler #ifdef __cplusplus
47c3c3d22fSAxel Dörfler }
48c3c3d22fSAxel Dörfler #endif
4952a38012Sejakowatz 
502fe71062SAxel Dörfler #endif	/* _KERNEL_KSYSCALLS_H */
51