BarryServer : Git

All the code for all my projects
// BarryServer : Git / Orion / blob / e59e4fe0bbf5a3f56db0700ee49a81131b590f9c / spinlock.h

// Related

Orion

Barry Importing existing Orion kernel d41a53c (2 years, 4 months ago)
#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