summaryrefslogtreecommitdiff
path: root/kernel/include/atomic.h
blob: 6f5993707907eab8b4aae162b6efcf00f465d8c2 (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