summaryrefslogtreecommitdiff
path: root/kernel/include/atomic.h
blob: 01a24335c236f0a7fda208a3b5e3c0678a6f28e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef ATOMIC_H
#define ATOMIC_H

#include <types.h>

struct mutex_t {
	volatile uint64_t* addr;
};
typedef struct mutex_t mutex_t;


void init_mutex(mutex_t* mutex);
bool test_and_set(mutex_t mutex, bool value);
void lock(mutex_t mutex);
void unlock(mutex_t mutex);

#endif