1 /* 2 * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _KERNEL_GENERIC_SYSCALLS_H 6 #define _KERNEL_GENERIC_SYSCALLS_H 7 8 9 #include <SupportDefs.h> 10 11 12 /* If we decide to make this API public, the contents of this file 13 * should be moved to KernelExport.h 14 */ 15 16 typedef status_t (*syscall_hook)(const char *subsystem, uint32 function, void *buffer, size_t bufferSize); 17 18 /* predefined functions */ 19 #define B_RESERVED_SYSCALL_BASE 0x80000000 20 #define B_SYSCALL_INFO (B_RESERVED_SYSCALL_BASE) 21 // gets a minimum version uint32, and fills it with the current version on return 22 23 /* syscall flags */ 24 #define B_SYSCALL_NOT_REPLACEABLE 1 25 #define B_DO_NOT_REPLACE_SYSCALL 2 26 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 status_t register_generic_syscall(const char *subsystem, syscall_hook hook, 33 uint32 version, uint32 flags); 34 status_t unregister_generic_syscall(const char *subsystem, uint32 version); 35 36 #ifdef __cplusplus 37 } 38 #endif 39 40 #endif /* _KERNEL_GENERIC_SYSCALLS_H */ 41