/* Big case statement for dispatching syscalls */ /* ** Copyright 2001, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static inline int _user_null() { return 0; } // map to the arch specific call static inline int64 _user_restore_signal_frame() { return arch_restore_signal_frame(); } // XXX: _kern_exit() was formerly mapped to _user_exit_thread(). That's // probably not correct. static inline void _user_exit(int returnCode) { _user_exit_thread(returnCode); } // TODO: Replace when networking code is added to the build. static inline int _user_socket(int family, int type, int proto) { return 0; } int syscall_dispatcher(unsigned long call_num, void *args, uint64 *call_ret) { // dprintf("syscall_dispatcher: thread 0x%x call 0x%x, arg0 0x%x, arg1 0x%x arg2 0x%x arg3 0x%x arg4 0x%x\n", // thread_get_current_thread_id(), call_num, arg0, arg1, arg2, arg3, arg4); switch (call_num) { // the cases are auto-generated #include "syscall_dispatcher.h" default: *call_ret = -1; } // dprintf("syscall_dispatcher: done with syscall 0x%x\n", call_num); return B_INVOKE_SCHEDULER; }