From e96a844909dac884bab3c194f73b158e428e7481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 5 Oct 2002 01:17:28 +0000 Subject: [PATCH] Removed some type definitions from ktypes.h that are now located in OS.h. Changed lock.h to like those changes. Moved the create_sem_etc() from the public OS.h to the private kernel only sem.h, cleaned it up a bit. gcc doesn't seem to like the "extern inlines" with -O0 -g, so I replaced an inline function in thread.h with "static inline" (which it does always like). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1376 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/ktypes.h | 4 ---- headers/private/kernel/lock.h | 1 + headers/private/kernel/sem.h | 16 +++++++--------- headers/private/kernel/thread.h | 10 +++++++--- 4 files changed, 15 insertions(+), 16 deletions(-) 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);