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*ed854de7SIngo Weinhold typedef struct syscall_return_type_info { 28*ed854de7SIngo Weinhold int size; 29*ed854de7SIngo Weinhold int used_size; 30*ed854de7SIngo Weinhold type_code type; 31*ed854de7SIngo Weinhold } syscall_return_type_info; 32*ed854de7SIngo Weinhold 33b4f58d87SIngo Weinhold typedef struct extended_syscall_info { 34b4f58d87SIngo Weinhold const char* name; 3519101ba0SIngo Weinhold int parameter_count; 36*ed854de7SIngo Weinhold syscall_return_type_info return_type; 3719101ba0SIngo Weinhold syscall_parameter_info parameters[MAX_SYSCALL_PARAMETERS]; 38b4f58d87SIngo Weinhold } extended_syscall_info; 3919101ba0SIngo Weinhold 4019101ba0SIngo Weinhold 417d4d6d35SIngo Weinhold extern const int kSyscallCount; 427d4d6d35SIngo Weinhold extern const syscall_info kSyscallInfos[]; 43b4f58d87SIngo Weinhold extern const extended_syscall_info kExtendedSyscallInfos[]; 447d4d6d35SIngo Weinhold 457d4d6d35SIngo Weinhold 46c3c3d22fSAxel Dörfler #ifdef __cplusplus 47c3c3d22fSAxel Dörfler extern "C" { 48c3c3d22fSAxel Dörfler #endif 49c3c3d22fSAxel Dörfler 50c3c3d22fSAxel Dörfler int32 syscall_dispatcher(uint32 function, void *argBuffer, uint64 *_returnValue); 51c3c3d22fSAxel Dörfler status_t generic_syscall_init(void); 52c3c3d22fSAxel Dörfler 53c3c3d22fSAxel Dörfler #ifdef __cplusplus 54c3c3d22fSAxel Dörfler } 55c3c3d22fSAxel Dörfler #endif 5652a38012Sejakowatz 572fe71062SAxel Dörfler #endif /* _KERNEL_KSYSCALLS_H */ 58