diff --git a/base-hw/src/core/include/platform_pd.h b/base-hw/src/core/include/platform_pd.h
index 6f5cc3ffa0..95c14e8893 100644
--- a/base-hw/src/core/include/platform_pd.h
+++ b/base-hw/src/core/include/platform_pd.h
@@ -16,6 +16,7 @@
/* Genode includes */
#include
+#include
/* Core includes */
#include
@@ -56,11 +57,16 @@ namespace Genode
bool kernel_pd_ok =
ram->alloc_aligned(Kernel::pd_size(), &kernel_pd,
Kernel::pd_alignm_log2()).is_ok();
- assert(kernel_pd_ok);
-
+ if (!kernel_pd_ok) {
+ PERR("failed to allocate kernel object");
+ throw Root::Quota_exceeded();
+ }
/* create kernel object */
_id = Kernel::new_pd(kernel_pd, this);
- assert(_id);
+ if (!_id) {
+ PERR("failed to create kernel object");
+ throw Root::Unavailable();
+ }
}
/**
@@ -86,19 +92,15 @@ namespace Genode
return t->join_pd(_id, 0, Address_space::weak_ptr());
}
- /**
- * Unbind thread from protection domain
- *
- * Free the thread's slot and update thread object.
- */
- void unbind_thread(Platform_thread * t);
-
/**
* Assign parent interface to protection domain
*/
int assign_parent(Native_capability parent)
{
- assert(parent.valid());
+ if (!parent.valid()) {
+ PERR("parent invalid");
+ return -1;
+ }
_parent = parent;
return 0;
}
diff --git a/base-hw/src/core/platform_pd.cc b/base-hw/src/core/platform_pd.cc
index d2446ce1f3..ca76841a46 100644
--- a/base-hw/src/core/platform_pd.cc
+++ b/base-hw/src/core/platform_pd.cc
@@ -21,8 +21,13 @@ using namespace Genode;
** Platform PD **
*****************/
-void Platform_pd::unbind_thread(Platform_thread *thread) { assert(0); }
-
-
-Platform_pd::~Platform_pd() { assert(0); }
+Platform_pd::~Platform_pd()
+{
+ /*
+ * FIXME: throwing exceptions is not declared for
+ * 'Pd_root::close' wich is why we can only
+ * print an error
+ */
+ PERR("not implemented");
+}