Skip to content

Commit

Permalink
Merge pull request torvalds#181 from liuyuan10/wb
Browse files Browse the repository at this point in the history
lkl: Remove sem_get and lkl_syscall_wouldblock
  • Loading branch information
Octavian Purdila authored Jul 22, 2016
2 parents 5c93aa5 + 9c6798b commit 0d98292
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
3 changes: 0 additions & 3 deletions arch/lkl/include/uapi/asm/host_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ typedef unsigned long lkl_thread_t;
* @sem_free - free a host semaphore
* @sem_up - perform an up operation on the semaphore
* @sem_down - perform a down operation on the semaphore
* @sem_get - return the current value of semahpore. To be used only for sanity
* checking
*
* @mutex_alloc - allocate and initialize a host mutex
* @mutex_free - free a host mutex
Expand Down Expand Up @@ -76,7 +74,6 @@ struct lkl_host_operations {
void (*sem_free)(struct lkl_sem *sem);
void (*sem_up)(struct lkl_sem *sem);
void (*sem_down)(struct lkl_sem *sem);
int (*sem_get)(struct lkl_sem *sem);

struct lkl_mutex *(*mutex_alloc)(void);
void (*mutex_free)(struct lkl_mutex *mutex);
Expand Down
11 changes: 0 additions & 11 deletions arch/lkl/kernel/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,6 @@ static int syscall_thread_data_init(struct syscall_thread_data *data,
return 0;
}

static int lkl_syscall_wouldblock(struct syscall_thread_data *data)
{
if (!lkl_ops->sem_get)
return 0;

return !lkl_ops->sem_get(data->mutex);
}

static long __lkl_syscall(struct syscall_thread_data *data, long no,
long *params)
{
Expand All @@ -196,9 +188,6 @@ static long __lkl_syscall(struct syscall_thread_data *data, long no,
s.no = no;
s.params = params;

if (lkl_syscall_wouldblock(data))
lkl_puts("syscall would block");

lkl_ops->sem_down(data->mutex);
data->s = &s;
lkl_trigger_irq(data->irq);
Expand Down
13 changes: 0 additions & 13 deletions tools/lkl/lib/posix-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,6 @@ static void sem_down(struct lkl_sem *sem)
#endif /* _POSIX_SEMAPHORES */
}

static int sem_get(struct lkl_sem *sem) {
int v = 0;
#ifdef _POSIX_SEMAPHORES
WARN_UNLESS(sem_getvalue(&sem->sem, &v));
#else
WARN_PTHREAD(pthread_mutex_lock(&sem->lock));
v = sem->count;
WARN_PTHREAD(pthread_mutex_unlock(&sem->lock));
#endif /* _POSIX_SEMAPHORES */
return v;
}

static struct lkl_mutex *mutex_alloc(void)
{
struct lkl_mutex *_mutex = malloc(sizeof(struct lkl_mutex));
Expand Down Expand Up @@ -301,7 +289,6 @@ struct lkl_host_operations lkl_host_ops = {
.sem_free = sem_free,
.sem_up = sem_up,
.sem_down = sem_down,
.sem_get = sem_get,
.mutex_alloc = mutex_alloc,
.mutex_free = mutex_free,
.mutex_lock = mutex_lock,
Expand Down

0 comments on commit 0d98292

Please sign in to comment.