summaryrefslogtreecommitdiffstats
path: root/src/include/kernel/spinlock.H
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-06-09 14:12:01 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-06-09 14:12:01 -0500
commite7a6ae9cc5b84abe63c7439005656ecc4beda8c1 (patch)
treee50ad79598edeccd4b2e513f146896d2d60f0c82 /src/include/kernel/spinlock.H
parentcbbd9e5b225e743ee3b4688ac6a3b69a9876926a (diff)
downloadblackbird-hostboot-e7a6ae9cc5b84abe63c7439005656ecc4beda8c1.tar.gz
blackbird-hostboot-e7a6ae9cc5b84abe63c7439005656ecc4beda8c1.zip
Kernel spinlock support.
Diffstat (limited to 'src/include/kernel/spinlock.H')
-rw-r--r--src/include/kernel/spinlock.H20
1 files changed, 20 insertions, 0 deletions
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 <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