diff --git a/headers/private/kernel/ksyscalls.h b/headers/private/kernel/ksyscalls.h index 2fbffc9cde..f666d0b900 100755 --- a/headers/private/kernel/ksyscalls.h +++ b/headers/private/kernel/ksyscalls.h @@ -19,7 +19,7 @@ enum { SYSCALL_READ, SYSCALL_WRITE, SYSCALL_SEEK, - SYSCALL_IOCTL, /* 10 */ + SYSCALL_IOCTL, /* 10 */ SYSCALL_CREATE, SYSCALL_UNLINK, SYSCALL_RENAME, @@ -29,17 +29,17 @@ enum { SYSCALL_SNOOZE_ETC, SYSCALL_SEM_CREATE, SYSCALL_SEM_DELETE, - SYSCALL_SEM_ACQUIRE, /* 20 */ + SYSCALL_SEM_ACQUIRE, /* 20 */ SYSCALL_SEM_ACQUIRE_ETC, SYSCALL_SEM_RELEASE, SYSCALL_SEM_RELEASE_ETC, - SYSCALL_GET_CURRENT_THREAD_ID, + SYSCALL_FIND_THREAD, SYSCALL_EXIT_THREAD, SYSCALL_CREATE_TEAM, - SYSCALL_WAIT_ON_THREAD, - SYSCALL_WAIT_ON_TEAM, + SYSCALL_WAIT_FOR_THREAD, + SYSCALL_WAIT_FOR_TEAM, SYSCALL_CREATE_AREA, - SYSCALL_CLONE_AREA, /* 30 */ + SYSCALL_CLONE_AREA, /* 30 */ SYSCALL_VM_MAP_FILE, SYSCALL_DELETE_AREA, SYSCALL_GET_AREA_INFO, @@ -50,7 +50,7 @@ enum { SYSCALL_RESUME_THREAD, SYSCALL_KILL_TEAM, SYSCALL_GET_CURRENT_TEAM_ID, - SYSCALL_GETCWD, /* 40 */ + SYSCALL_GETCWD, /* 40 */ SYSCALL_SETCWD, SYSCALL_PORT_CREATE, SYSCALL_PORT_CLOSE, @@ -60,7 +60,7 @@ enum { SYSCALL_PORT_GET_NEXT_PORT_INFO, SYSCALL_PORT_BUFFER_SIZE, SYSCALL_PORT_BUFFER_SIZE_ETC, - SYSCALL_PORT_COUNT, /* 50 */ + SYSCALL_PORT_COUNT, /* 50 */ SYSCALL_PORT_READ, SYSCALL_PORT_READ_ETC, SYSCALL_PORT_SET_OWNER, diff --git a/headers/private/kernel/syscalls.h b/headers/private/kernel/syscalls.h index 65e9c745cf..713750a4d5 100644 --- a/headers/private/kernel/syscalls.h +++ b/headers/private/kernel/syscalls.h @@ -21,11 +21,11 @@ extern "C" { int sys_null(); -int sys_getrlimit(int resource, struct rlimit * rlp); -int sys_setrlimit(int resource, const struct rlimit * rlp); +extern int _kern_getrlimit(int resource, struct rlimit * rlp); +extern int _kern_setrlimit(int resource, const struct rlimit * rlp); -bigtime_t sys_system_time(); -status_t sys_snooze_etc(bigtime_t time, int timebase, int32 flags); +extern bigtime_t _kern_system_time(); +extern status_t _kern_snooze_etc(bigtime_t time, int timebase, int32 flags); /* sem functions */ sem_id sys_create_sem(int count, const char *name); @@ -39,26 +39,30 @@ int sys_get_sem_info(sem_id, struct sem_info *, size_t); int sys_get_next_sem_info(team_id, uint32 *, struct sem_info *, size_t); int sys_set_sem_owner(sem_id id, team_id proc); -void sys_exit(int retcode); -team_id sys_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority); +/* thread syscalls */ -thread_id sys_spawn_thread(int32 (*func)(thread_func, void *), const char *, int32, void *, void *); -thread_id sys_get_current_thread_id(void); -int sys_suspend_thread(thread_id tid); -int sys_resume_thread(thread_id tid); -int sys_kill_thread(thread_id tid); -void sys_exit_thread(status_t return_value); +extern void _kern_exit(int returnCode); +extern team_id _kern_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority); +extern status_t _kern_kill_team(team_id team); +extern team_id _kern_get_current_team(); +extern status_t _kern_wait_for_team(team_id thread, int *_returnCode); -status_t sys_wait_on_thread(thread_id tid, status_t *retcode); -int sys_kill_team(team_id tid); +extern thread_id _kern_spawn_thread(int32 (*func)(thread_func, void *), const char *, int32, void *, void *); +extern thread_id _kern_find_thread(const char *name); +extern status_t _kern_suspend_thread(thread_id thread); +extern status_t _kern_resume_thread(thread_id thread); +extern status_t _kern_set_thread_priority(thread_id thread, int32 newPriority); +extern status_t _kern_kill_thread(thread_id thread); +extern void _kern_exit_thread(status_t returnValue); +extern status_t _kern_wait_for_thread(thread_id thread, status_t *_returnCode); +extern bool _kern_has_data(thread_id thread); +extern status_t _kern_send_data(thread_id thread, int32 code, const void *buffer, size_t buffer_size); +extern status_t _kern_receive_data(thread_id *_sender, void *buffer, size_t buffer_size); -team_id sys_get_current_team_id(); -int sys_wait_on_team(team_id tid, int *retcode); - -status_t sys_get_thread_info(thread_id id, thread_info *info); -status_t sys_get_next_thread_info(team_id team, int32 *cookie, thread_info *info); -status_t sys_get_team_info(team_id id, team_info *info); -status_t sys_get_next_team_info(int32 *cookie, team_info *info); +extern status_t _kern_get_thread_info(thread_id id, thread_info *info); +extern status_t _kern_get_next_thread_info(team_id team, int32 *cookie, thread_info *info); +extern status_t _kern_get_team_info(team_id id, team_info *info); +extern status_t _kern_get_next_team_info(int32 *cookie, team_info *info); int sys_send_signal(pid_t tid, uint sig); int sys_sigaction(int sig, const struct sigaction *act, struct sigaction *oact); diff --git a/headers/private/kernel/thread.h b/headers/private/kernel/thread.h index 298c7e7851..b39fc75348 100755 --- a/headers/private/kernel/thread.h +++ b/headers/private/kernel/thread.h @@ -56,7 +56,6 @@ thread_id spawn_kernel_thread_etc(thread_func, const char *name, int32 priority, int team_init(kernel_args *ka); struct team *team_get_kernel_team(void); team_id team_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority); -int team_kill_team(team_id); status_t wait_for_team(team_id id, status_t *returnCode); void team_remove_team_from_hash(struct team *team); team_id team_get_kernel_team_id(void); @@ -67,30 +66,31 @@ bool team_is_valid(team_id id); struct team *team_get_team_struct_locked(team_id id); // used in syscalls.c -int user_thread_wait_for_thread(thread_id id, int *uretcode); -team_id user_team_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority); -int user_team_wait_for_team(team_id id, int *uretcode); +team_id _user_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority); +status_t _user_wait_for_team(team_id id, status_t *_returnCode); +status_t _user_kill_team(thread_id thread); +team_id _user_get_current_team(void); -status_t user_set_thread_priority(thread_id thread, int32 newPriority); -status_t user_suspend_thread(thread_id thread); -status_t user_resume_thread(thread_id thread); -thread_id user_spawn_thread(thread_func func, const char *name, int32 priority, void *arg1, void *arg2); -status_t user_wait_for_thread(thread_id id, status_t *returnCode); -status_t user_wait_for_team(team_id id, status_t *returnCode); -status_t user_snooze_etc(bigtime_t timeout, int timebase, uint32 flags); -void user_exit_thread(status_t return_value); +status_t _user_set_thread_priority(thread_id thread, int32 newPriority); +status_t _user_suspend_thread(thread_id thread); +status_t _user_resume_thread(thread_id thread); +thread_id _user_spawn_thread(thread_func func, const char *name, int32 priority, void *arg1, void *arg2); +status_t _user_wait_for_thread(thread_id id, status_t *_returnCode); +status_t _user_snooze_etc(bigtime_t timeout, int timebase, uint32 flags); +status_t _user_kill_thread(thread_id thread); +void _user_exit_thread(status_t return_value); +bool _user_has_data(thread_id thread); +status_t _user_send_data(thread_id thread, int32 code, const void *buffer, size_t buffer_size); +status_t _user_receive_data(thread_id *_sender, void *buffer, size_t buffer_size); +thread_id _user_find_thread(const char *name); +status_t _user_get_thread_info(thread_id id, thread_info *info); +status_t _user_get_next_thread_info(team_id team, int32 *cookie, thread_info *info); +status_t _user_get_team_info(team_id id, team_info *info); +status_t _user_get_next_team_info(int32 *cookie, team_info *info); -bool user_has_data(thread_id thread); -status_t user_send_data(thread_id thread, int32 code, const void *buffer, size_t buffer_size); -status_t user_receive_data(thread_id *sender, void *buffer, size_t buffer_size); - -status_t user_get_thread_info(thread_id id, thread_info *info); -status_t user_get_next_thread_info(team_id team, int32 *cookie, thread_info *info); -status_t user_get_team_info(team_id id, team_info *info); -status_t user_get_next_team_info(int32 *cookie, team_info *info); - -int user_getrlimit(int resource, struct rlimit * rlp); -int user_setrlimit(int resource, const struct rlimit * rlp); +// ToDo: these don't belong here +int _user_getrlimit(int resource, struct rlimit * rlp); +int _user_setrlimit(int resource, const struct rlimit * rlp); // ToDo: please move the "env" setter/getter out of the kernel! int user_setenv(const char *name, const char *value, int overwrite);