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 15typedef struct syscall_info { 16 void *function; // pointer to the syscall function 17 int parameter_size; // summed up parameter size 18} syscall_info; 19 20typedef struct syscall_parameter_info { 21 int offset; 22 int size; 23 int used_size; 24 type_code type; 25} syscall_parameter_info; 26 27typedef struct syscall_return_type_info { 28 int size; 29 int used_size; 30 type_code type; 31} syscall_return_type_info; 32 33typedef struct extended_syscall_info { 34 const char* name; 35 int parameter_count; 36 syscall_return_type_info return_type; 37 syscall_parameter_info parameters[MAX_SYSCALL_PARAMETERS]; 38} extended_syscall_info; 39 40 41extern const int kSyscallCount; 42extern const syscall_info kSyscallInfos[]; 43extern const extended_syscall_info kExtendedSyscallInfos[]; 44 45 46#ifdef __cplusplus 47extern "C" { 48#endif 49 50int32 syscall_dispatcher(uint32 function, void *argBuffer, uint64 *_returnValue); 51status_t generic_syscall_init(void); 52 53#ifdef __cplusplus 54} 55#endif 56 57#endif /* _KERNEL_KSYSCALLS_H */ 58