]> git.corax.cc Git - corax/commitdiff
klibc/mutex: Move mutex definition to mutex.h and remove unused includes
authorMatthias Kruk <m@m10k.eu>
Sat, 8 Feb 2020 15:03:25 +0000 (00:03 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 8 Feb 2020 15:14:02 +0000 (00:14 +0900)
kernel/include/mutex.h
kernel/klibc/mutex.c

index 40485ffc849ee766fa8bc0533331745456206542..b15833471b200614d4b35b5dcedc616f700ed177 100644 (file)
@@ -1,7 +1,15 @@
 #ifndef __MUTEX_H
 #define __MUTEX_H
 
-typedef struct _mutex mutex_t;
+#include <config.h>
+#include <spinlock.h>
+#include <arch.h>
+
+typedef struct {
+       spinlock_t mx_lock;
+       task_t     *mx_owner;
+       task_t     *mx_waitq[CONFIG_MUTEX_WAITQLEN];
+} mutex_t;
 
 /*
  * mutex_lock() - Lock a mutex
index f76693cbd59d8d9225e8f37012d7df623ca512e5..7e69b07464f1c7b29fa5be41fb613d7d34ffb71d 100644 (file)
@@ -1,19 +1,11 @@
 #include <config.h>
 #include <corax/types.h>
 #include <corax/errno.h>
-#include <corax/heap.h>
 #include <spinlock.h>
 #include <mutex.h>
 #include <arch.h>
-#include <process.h>
 #include <sched.h>
 
-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;