summaryrefslogtreecommitdiffstats
path: root/src/include/kernel/spinlock.H
blob: 92d1f6e053ce0628e75185989028daa366bff892 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef __KERNEL_SPINLOCK_H
#define __KERNEL_SPINLOCK_H

#include <util/locked/lock.H>
#include <stdint.h>

class Spinlock : public Util::Locked::Lock
{
    public:
	Spinlock() : iv_reserve(0), iv_ready(0) {};

	void lock();
	void unlock();

    private:
	volatile uint64_t iv_reserve;
	volatile uint64_t iv_ready;
};

#endif
OpenPOWER on IntegriCloud