BarryServer : Git

All the code for all my projects
// BarryServer : Git / Orion / commit / d41a53cbc7d055b1c00cf0a339dbed6925f4f02c / spinlock.h

// Related

Orion

Barry Importing existing Orion kernel d41a53c (2 years, 4 months ago)
diff --git a/spinlock.h b/spinlock.h
new file mode 100644
index 0000000..75d7154
--- /dev/null
+++ b/spinlock.h
@@ -0,0 +1,19 @@
+#ifndef KERNEL_SPINLOCK_H
+#define KERNEL_SPINLOCK_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+/* Structure for a spinlock */
+typedef struct Spinlock {
+	uint32_t locked;
+	pid_t task;
+	uint8_t cpu;
+	uint8_t ref;
+} Spinlock;
+
+void init_lock(Spinlock *lock);
+void acquire(Spinlock *lock);
+void release(Spinlock *lock);
+
+#endif