summaryrefslogtreecommitdiff
path: root/kernel/include/atomic.h
blob: 4b2ddb34986249913e842a081197f9fba6e15cec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#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