Allow to request the Tukija capability selector for a PD capability.

This commit is contained in:
Michael Mueller
2025-02-21 15:30:46 +01:00
parent 9ea62b25a0
commit 9ccf7d1264
4 changed files with 9 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ class Core::Native_pd_component : public Rpc_object<Pd_session::Native_pd>
*/ */
Native_capability alloc_rpc_cap(Native_capability, addr_t, addr_t) override; Native_capability alloc_rpc_cap(Native_capability, addr_t, addr_t) override;
void imprint_rpc_cap(Native_capability, unsigned long) override; void imprint_rpc_cap(Native_capability, unsigned long) override;
Genode::addr_t sel() override;
}; };
#endif /* _CORE__INCLUDE__NATIVE_PD_COMPONENT_H_ */ #endif /* _CORE__INCLUDE__NATIVE_PD_COMPONENT_H_ */

View File

@@ -39,8 +39,9 @@ class Core::Platform_pd : public Address_space
Platform_pd(Platform_pd const &); Platform_pd(Platform_pd const &);
Platform_pd &operator = (Platform_pd const &); Platform_pd &operator = (Platform_pd const &);
public: friend class Native_pd;
public:
bool has_any_threads = false; bool has_any_threads = false;
/** /**

View File

@@ -36,6 +36,10 @@ void Native_pd_component::imprint_rpc_cap(Native_capability cap, unsigned long b
imprint_badge(cap.local_name(), badge); imprint_badge(cap.local_name(), badge);
} }
Genode::addr_t Native_pd_component::sel()
{
return _pd_session._pd->pd_sel();
}
Native_pd_component::Native_pd_component(Pd_session_component &pd, char const *) Native_pd_component::Native_pd_component(Pd_session_component &pd, char const *)
: :

View File

@@ -37,6 +37,8 @@ Platform_pd::Platform_pd(Allocator &, char const *label, signed, bool)
return; return;
} }
log("Creating PD for <", label, "> with cap selector ", _pd_sel);
/* create task */ /* create task */
enum { KEEP_FREE_PAGES_NOT_AVAILABLE_FOR_UPGRADE = 2, UPPER_LIMIT_PAGES = 32 }; enum { KEEP_FREE_PAGES_NOT_AVAILABLE_FOR_UPGRADE = 2, UPPER_LIMIT_PAGES = 32 };
uint8_t res = Tukija::create_pd(_pd_sel, platform_specific().core_pd_sel(), uint8_t res = Tukija::create_pd(_pd_sel, platform_specific().core_pd_sel(),
@@ -48,7 +50,6 @@ Platform_pd::Platform_pd(Allocator &, char const *label, signed, bool)
error("create_pd returned ", res); error("create_pd returned ", res);
} }
Platform_pd::~Platform_pd() Platform_pd::~Platform_pd()
{ {
if (_pd_sel == Native_thread::INVALID_INDEX) if (_pd_sel == Native_thread::INVALID_INDEX)