From 9f4147af32eb34c844bdfc93363949e0b63e0ee3 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Sun, 9 Feb 2020 00:03:25 +0900 Subject: [PATCH] klibc/mutex: Move mutex definition to mutex.h and remove unused includes --- kernel/include/mutex.h | 10 +++++++++- kernel/klibc/mutex.c | 8 -------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/include/mutex.h b/kernel/include/mutex.h index 40485ff..b158334 100644 --- a/kernel/include/mutex.h +++ b/kernel/include/mutex.h @@ -1,7 +1,15 @@ #ifndef __MUTEX_H #define __MUTEX_H -typedef struct _mutex mutex_t; +#include +#include +#include + +typedef struct { + spinlock_t mx_lock; + task_t *mx_owner; + task_t *mx_waitq[CONFIG_MUTEX_WAITQLEN]; +} mutex_t; /* * mutex_lock() - Lock a mutex diff --git a/kernel/klibc/mutex.c b/kernel/klibc/mutex.c index f76693c..7e69b07 100644 --- a/kernel/klibc/mutex.c +++ b/kernel/klibc/mutex.c @@ -1,19 +1,11 @@ #include #include #include -#include #include #include #include -#include #include -struct _mutex { - spinlock_t mx_lock; - task_t *mx_owner; - task_t *mx_waitq[CONFIG_MUTEX_WAITQLEN]; -}; - inline static int _nq(mutex_t *mutex, task_t *t) { int i; -- 2.47.3