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 extended_syscall_info { 28 const char* name; 29 int parameter_count; 30 syscall_parameter_info parameters[MAX_SYSCALL_PARAMETERS]; 31 } extended_syscall_info; 32 33 34 extern const int kSyscallCount; 35 extern const syscall_info kSyscallInfos[]; 36 extern const extended_syscall_info kExtendedSyscallInfos[]; 37 38 39 #ifdef __cplusplus 40 extern "C" { 41 #endif 42 43 int32 syscall_dispatcher(uint32 function, void *argBuffer, uint64 *_returnValue); 44 status_t generic_syscall_init(void); 45 46 #ifdef __cplusplus 47 } 48 #endif 49 50 #endif /* _KERNEL_KSYSCALLS_H */ 51