diff --git a/base-fiasco/include/base/cancelable_lock.h b/base-fiasco/include/base/cancelable_lock.h
index d2bfcf74f..c684501da 100644
--- a/base-fiasco/include/base/cancelable_lock.h
+++ b/base-fiasco/include/base/cancelable_lock.h
@@ -15,7 +15,6 @@
#define _INCLUDE__BASE__CANCELABLE_LOCK_H_
#include
-#include
#include
namespace Genode {
@@ -33,7 +32,7 @@ namespace Genode {
/**
* Constructor
*/
- Cancelable_lock(State initial = UNLOCKED);
+ explicit Cancelable_lock(State initial = UNLOCKED);
/**
* Try to aquire lock an block while lock is not free
diff --git a/base-fiasco/include/base/sleep.h b/base-fiasco/include/base/sleep.h
new file mode 100644
index 000000000..9a05e8e51
--- /dev/null
+++ b/base-fiasco/include/base/sleep.h
@@ -0,0 +1,31 @@
+/*
+ * \brief Lay back and relax
+ * \author Norman Feske
+ * \author Christian Helmuth
+ * \date 2006-07-19
+ */
+
+/*
+ * Copyright (C) 2006-2014 Genode Labs GmbH
+ *
+ * This file is part of the Genode OS framework, which is distributed
+ * under the terms of the GNU General Public License version 2.
+ */
+
+#ifndef _INCLUDE__BASE__SLEEP_H_
+#define _INCLUDE__BASE__SLEEP_H_
+
+/* L4/Fiasco includes */
+namespace Fiasco {
+#include
+}
+
+namespace Genode {
+
+ __attribute__((noreturn)) inline void sleep_forever()
+ {
+ while (true) Fiasco::l4_ipc_sleep((Fiasco::l4_timeout_t){0});
+ }
+}
+
+#endif /* _INCLUDE__BASE__SLEEP_H_ */
diff --git a/base-foc/src/base/thread/thread_bootstrap.cc b/base-foc/src/base/thread/thread_bootstrap.cc
index 25a521e0e..b556f1c52 100644
--- a/base-foc/src/base/thread/thread_bootstrap.cc
+++ b/base-foc/src/base/thread/thread_bootstrap.cc
@@ -15,6 +15,7 @@
/* Genode includes */
#include
#include
+#include
/*****************************
@@ -54,6 +55,5 @@ void Genode::Thread_base::_thread_start()
Thread_base::myself()->_thread_bootstrap();
Thread_base::myself()->entry();
Thread_base::myself()->_join_lock.unlock();
- Lock sleep_forever_lock(Lock::LOCKED);
- sleep_forever_lock.lock();
+ sleep_forever();
}
diff --git a/base/include/base/sleep.h b/base/include/base/sleep.h
index bd158a682..98f7403dc 100644
--- a/base/include/base/sleep.h
+++ b/base/include/base/sleep.h
@@ -1,11 +1,12 @@
/*
* \brief Lay back and relax
* \author Norman Feske
+ * \author Christian Helmuth
* \date 2006-07-19
*/
/*
- * Copyright (C) 2006-2013 Genode Labs GmbH
+ * Copyright (C) 2006-2014 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@@ -14,15 +15,14 @@
#ifndef _INCLUDE__BASE__SLEEP_H_
#define _INCLUDE__BASE__SLEEP_H_
-#include
+#include
namespace Genode {
__attribute__((noreturn)) inline void sleep_forever()
{
- Msgbuf<16> buf;
- Ipc_server s(&buf, &buf);
- while (1) s >> IPC_WAIT;
+ Lock sleep;
+ while (true) sleep.lock();
}
}
diff --git a/os/include/platform/pbxa9/pl011_defs.h b/os/include/platform/pbxa9/pl011_defs.h
index 226839808..c6cd3f637 100644
--- a/os/include/platform/pbxa9/pl011_defs.h
+++ b/os/include/platform/pbxa9/pl011_defs.h
@@ -14,6 +14,7 @@
#ifndef _INCLUDE__PLATFORM__PBXA9__PL011_DEFS_H_
#define _INCLUDE__PLATFORM__PBXA9__PL011_DEFS_H_
+#include
#include
enum {
diff --git a/os/include/platform/vpb926/pl011_defs.h b/os/include/platform/vpb926/pl011_defs.h
index d43535ddd..ed702a240 100644
--- a/os/include/platform/vpb926/pl011_defs.h
+++ b/os/include/platform/vpb926/pl011_defs.h
@@ -14,6 +14,8 @@
#ifndef _INCLUDE__PLATFORM__VPB926__PL011_DEFS_H_
#define _INCLUDE__PLATFORM__VPB926__PL011_DEFS_H_
+#include
+
#warning pl011 untested on vpb926
enum {