diff --git a/headers/private/kernel/ktypes.h b/headers/private/kernel/ktypes.h index c0e7141df6..26313813ed 100755 --- a/headers/private/kernel/ktypes.h +++ b/headers/private/kernel/ktypes.h @@ -13,12 +13,8 @@ extern "C" { typedef uint16 mode_t; typedef int pid_t; -typedef int32 thread_id; typedef int32 region_id; typedef int32 aspace_id; -typedef int32 team_id; -typedef int32 sem_id; -typedef int32 port_id; typedef int32 image_id; typedef uint32 dev_t; typedef uint64 ino_t; diff --git a/headers/private/kernel/lock.h b/headers/private/kernel/lock.h index a4fba7067c..5eab064ff4 100755 --- a/headers/private/kernel/lock.h +++ b/headers/private/kernel/lock.h @@ -5,6 +5,7 @@ #ifndef _KERNEL_LOCK_H #define _KERNEL_LOCK_H +#include #include #include diff --git a/headers/private/kernel/sem.h b/headers/private/kernel/sem.h index 45726aa436..ac68d4476a 100755 --- a/headers/private/kernel/sem.h +++ b/headers/private/kernel/sem.h @@ -13,8 +13,7 @@ #include #include -/* #ifdef _KERNEL_ */ - +/* user calls */ sem_id user_create_sem(int32 count, const char *name); status_t user_delete_sem(sem_id id); status_t user_delete_sem_etc(sem_id id, status_t return_code); @@ -27,11 +26,10 @@ status_t user_get_sem_info(sem_id, struct sem_info *, size_t); status_t user_get_next_sem_info(team_id, int32 *, struct sem_info *, size_t); status_t user_set_sem_owner(sem_id id, team_id team); +/* kernel calls */ +extern sem_id create_sem_etc(int32 count, const char *name, team_id owner); +extern status_t sem_init(kernel_args *ka); +extern int sem_delete_owned_sems(team_id owner); +extern status_t sem_interrupt_thread(struct thread *t); -status_t sem_init(kernel_args *ka); -int sem_delete_owned_sems(team_id owner); -status_t sem_interrupt_thread(struct thread *t); -/* #endif */ - -#endif /* _KERNEL_SEM_H */ - +#endif /* _KERNEL_SEM_H */ diff --git a/headers/private/kernel/thread.h b/headers/private/kernel/thread.h index c1ecd699d2..97a7b60625 100755 --- a/headers/private/kernel/thread.h +++ b/headers/private/kernel/thread.h @@ -51,11 +51,15 @@ struct thread *thread_get_thread_struct(thread_id id); #ifdef NEW_SCHEDULER struct thread *thread_get_thread_struct_locked(thread_id id); #endif /* NEW_SCHEDULER */ -thread_id thread_get_current_thread_id(void); -extern inline thread_id thread_get_current_thread_id(void) { - struct thread *t = thread_get_current_thread(); return t ? t->id : 0; +static thread_id thread_get_current_thread_id(void); +static inline thread_id +thread_get_current_thread_id(void) +{ + struct thread *t = thread_get_current_thread(); + return t ? t->id : 0; } + int thread_wait_on_thread(thread_id id, int *retcode); thread_id thread_create_user_thread(char *name, team_id tid, addr entry, void *args);