Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d98292

Browse files
author
Octavian Purdila
authored
Merge pull request torvalds#181 from liuyuan10/wb
lkl: Remove sem_get and lkl_syscall_wouldblock
2 parents 5c93aa5 + 9c6798b commit 0d98292

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

arch/lkl/include/uapi/asm/host_ops.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ typedef unsigned long lkl_thread_t;
2424
* @sem_free - free a host semaphore
2525
* @sem_up - perform an up operation on the semaphore
2626
* @sem_down - perform a down operation on the semaphore
27-
* @sem_get - return the current value of semahpore. To be used only for sanity
28-
* checking
2927
*
3028
* @mutex_alloc - allocate and initialize a host mutex
3129
* @mutex_free - free a host mutex
@@ -76,7 +74,6 @@ struct lkl_host_operations {
7674
void (*sem_free)(struct lkl_sem *sem);
7775
void (*sem_up)(struct lkl_sem *sem);
7876
void (*sem_down)(struct lkl_sem *sem);
79-
int (*sem_get)(struct lkl_sem *sem);
8077

8178
struct lkl_mutex *(*mutex_alloc)(void);
8279
void (*mutex_free)(struct lkl_mutex *mutex);

arch/lkl/kernel/syscalls.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,6 @@ static int syscall_thread_data_init(struct syscall_thread_data *data,
180180
return 0;
181181
}
182182

183-
static int lkl_syscall_wouldblock(struct syscall_thread_data *data)
184-
{
185-
if (!lkl_ops->sem_get)
186-
return 0;
187-
188-
return !lkl_ops->sem_get(data->mutex);
189-
}
190-
191183
static long __lkl_syscall(struct syscall_thread_data *data, long no,
192184
long *params)
193185
{
@@ -196,9 +188,6 @@ static long __lkl_syscall(struct syscall_thread_data *data, long no,
196188
s.no = no;
197189
s.params = params;
198190

199-
if (lkl_syscall_wouldblock(data))
200-
lkl_puts("syscall would block");
201-
202191
lkl_ops->sem_down(data->mutex);
203192
data->s = &s;
204193
lkl_trigger_irq(data->irq);

tools/lkl/lib/posix-host.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,6 @@ static void sem_down(struct lkl_sem *sem)
132132
#endif /* _POSIX_SEMAPHORES */
133133
}
134134

135-
static int sem_get(struct lkl_sem *sem) {
136-
int v = 0;
137-
#ifdef _POSIX_SEMAPHORES
138-
WARN_UNLESS(sem_getvalue(&sem->sem, &v));
139-
#else
140-
WARN_PTHREAD(pthread_mutex_lock(&sem->lock));
141-
v = sem->count;
142-
WARN_PTHREAD(pthread_mutex_unlock(&sem->lock));
143-
#endif /* _POSIX_SEMAPHORES */
144-
return v;
145-
}
146-
147135
static struct lkl_mutex *mutex_alloc(void)
148136
{
149137
struct lkl_mutex *_mutex = malloc(sizeof(struct lkl_mutex));
@@ -301,7 +289,6 @@ struct lkl_host_operations lkl_host_ops = {
301289
.sem_free = sem_free,
302290
.sem_up = sem_up,
303291
.sem_down = sem_down,
304-
.sem_get = sem_get,
305292
.mutex_alloc = mutex_alloc,
306293
.mutex_free = mutex_free,
307294
.mutex_lock = mutex_lock,

0 commit comments

Comments
 (0)