From e7a6ae9cc5b84abe63c7439005656ecc4beda8c1 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Wed, 9 Jun 2010 14:12:01 -0500 Subject: Kernel spinlock support. --- src/include/kernel/spinlock.H | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/include/kernel/spinlock.H (limited to 'src/include/kernel/spinlock.H') diff --git a/src/include/kernel/spinlock.H b/src/include/kernel/spinlock.H new file mode 100644 index 000000000..92d1f6e05 --- /dev/null +++ b/src/include/kernel/spinlock.H @@ -0,0 +1,20 @@ +#ifndef __KERNEL_SPINLOCK_H +#define __KERNEL_SPINLOCK_H + +#include +#include + +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 -- cgit v1.2.3