summaryrefslogtreecommitdiff
path: root/kernel/include/atomic.h
blob: 99f83fbbf15e99b4acbe425bc46cde3577b8d087 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef ATOMIC
#define ATOMIC

#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);

extern mutex_t cnt_lock;
extern uint64_t cnt;

#endif