1f4160aedSAxel Dörfler/*
234e92cadSAxel Dörfler * Copyright 2002-2005, Axel D��rfler, axeld@pinc-software.de. All rights reserved.
3f4160aedSAxel Dörfler * Distributed under the terms of the MIT License.
4f4160aedSAxel Dörfler */
5712ec3d7SAxel Dörfler
6712ec3d7SAxel Dörfler
7712ec3d7SAxel Dörfler#include <OS.h>
8f4160aedSAxel Dörfler#include <syscalls.h>
9712ec3d7SAxel Dörfler
10712ec3d7SAxel Dörfler
11712ec3d7SAxel Dörflersem_id
12712ec3d7SAxel Dörflercreate_sem(int32 count, const char *name)
13712ec3d7SAxel Dörfler{
14f4160aedSAxel Dörfler	return _kern_create_sem(count, name);
15712ec3d7SAxel Dörfler}
16712ec3d7SAxel Dörfler
17712ec3d7SAxel Dörfler
18712ec3d7SAxel Dörflerstatus_t
19712ec3d7SAxel Dörflerdelete_sem(sem_id id)
20712ec3d7SAxel Dörfler{
21f4160aedSAxel Dörfler	return _kern_delete_sem(id);
22712ec3d7SAxel Dörfler}
23712ec3d7SAxel Dörfler
24712ec3d7SAxel Dörfler
25712ec3d7SAxel Dörflerstatus_t
26712ec3d7SAxel Dörfleracquire_sem(sem_id id)
27712ec3d7SAxel Dörfler{
28f4160aedSAxel Dörfler	return _kern_acquire_sem(id);
29712ec3d7SAxel Dörfler}
30712ec3d7SAxel Dörfler
31712ec3d7SAxel Dörfler
32712ec3d7SAxel Dörflerstatus_t
33712ec3d7SAxel Dörfleracquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout)
34712ec3d7SAxel Dörfler{
35f4160aedSAxel Dörfler	return _kern_acquire_sem_etc(id, count, flags, timeout);
36712ec3d7SAxel Dörfler}
37712ec3d7SAxel Dörfler
38712ec3d7SAxel Dörfler
3934e92cadSAxel Dörfler// ToDo: the next two calls (switch_sem()) are not yet public API; no decision
4034e92cadSAxel Dörfler//	has been made yet, so they may get changed or removed until R1
4134e92cadSAxel Dörfler
4234e92cadSAxel Dörflerstatus_t
4334e92cadSAxel Dörflerswitch_sem(sem_id releaseSem, sem_id id)
4434e92cadSAxel Dörfler{
4534e92cadSAxel Dörfler	return _kern_switch_sem(releaseSem, id);
4634e92cadSAxel Dörfler}
4734e92cadSAxel Dörfler
4834e92cadSAxel Dörfler
4934e92cadSAxel Dörflerstatus_t
5034e92cadSAxel Dörflerswitch_sem_etc(sem_id releaseSem, sem_id id, int32 count, uint32 flags, bigtime_t timeout)
5134e92cadSAxel Dörfler{
5234e92cadSAxel Dörfler	return _kern_switch_sem_etc(releaseSem, id, count, flags, timeout);
5334e92cadSAxel Dörfler}
5434e92cadSAxel Dörfler
5534e92cadSAxel Dörfler
56712ec3d7SAxel Dörflerstatus_t
57712ec3d7SAxel Dörflerrelease_sem(sem_id id)
58712ec3d7SAxel Dörfler{
59f4160aedSAxel Dörfler	return _kern_release_sem(id);
60712ec3d7SAxel Dörfler}
61712ec3d7SAxel Dörfler
62712ec3d7SAxel Dörfler
63712ec3d7SAxel Dörflerstatus_t
64712ec3d7SAxel Dörflerrelease_sem_etc(sem_id id, int32 count, uint32 flags)
65712ec3d7SAxel Dörfler{
66f4160aedSAxel Dörfler	return _kern_release_sem_etc(id, count, flags);
67712ec3d7SAxel Dörfler}
68712ec3d7SAxel Dörfler
69712ec3d7SAxel Dörfler
70712ec3d7SAxel Dörflerstatus_t
71712ec3d7SAxel Dörflerget_sem_count(sem_id sem, int32 *count)
72712ec3d7SAxel Dörfler{
73f4160aedSAxel Dörfler	return _kern_get_sem_count(sem, count);
74712ec3d7SAxel Dörfler}
75712ec3d7SAxel Dörfler
76712ec3d7SAxel Dörfler
77712ec3d7SAxel Dörflerstatus_t
78712ec3d7SAxel Dörflerset_sem_owner(sem_id sem, team_id team)
79712ec3d7SAxel Dörfler{
80f4160aedSAxel Dörfler	return _kern_set_sem_owner(sem, team);
81712ec3d7SAxel Dörfler}
82712ec3d7SAxel Dörfler
83712ec3d7SAxel Dörfler
84712ec3d7SAxel Dörflerstatus_t
85712ec3d7SAxel Dörfler_get_sem_info(sem_id sem, sem_info *info, size_t size)
86712ec3d7SAxel Dörfler{
87f4160aedSAxel Dörfler	return _kern_get_sem_info(sem, info, size);
88712ec3d7SAxel Dörfler}
89712ec3d7SAxel Dörfler
90712ec3d7SAxel Dörfler
91712ec3d7SAxel Dörflerstatus_t
92712ec3d7SAxel Dörfler_get_next_sem_info(team_id team, int32 *cookie, sem_info *info, size_t size)
93712ec3d7SAxel Dörfler{
94f4160aedSAxel Dörfler	return _kern_get_next_sem_info(team, cookie, info, size);
95712ec3d7SAxel Dörfler}
96712ec3d7SAxel Dörfler
97