mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
base: New RPCs to allow to associate a PD with a Cell and growing and shrinking a cell's core allocation.
This commit is contained in:
@@ -106,6 +106,29 @@ void Pd_session_component::map(addr_t virt, addr_t size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pd_session_component::create_cell(long prioritiy, const Affinity::Location &loc)
|
||||||
|
{
|
||||||
|
Nova::uint8_t err = Nova::NOVA_OK;
|
||||||
|
if ((err = Nova::create_cell(_pd->pd_sel(), prioritiy, loc.xpos(), loc.xpos()+loc.width())) != Nova::NOVA_OK) {
|
||||||
|
error("Could not create new cell: ", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Pd_session_component::grow_cell(const Affinity::Location &loc)
|
||||||
|
{
|
||||||
|
Nova::uint8_t err = Nova::NOVA_OK;
|
||||||
|
if ((err = Nova::grow_cell(_pd->pd_sel(), loc.xpos(), loc.xpos()+loc.width())) != Nova::NOVA_OK) {
|
||||||
|
error("Could not enlarge cell: ", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Pd_session_component::shrink_cell(const Affinity::Location &loc)
|
||||||
|
{
|
||||||
|
Nova::uint8_t err = Nova::NOVA_OK;
|
||||||
|
if ((err = Nova::shrink_cell(_pd->pd_sel(), loc.xpos(), loc.xpos()+loc.width())) != Nova::NOVA_OK) {
|
||||||
|
error("Could not shrink down cell: ", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
using State = Genode::Pd_session::Managing_system_state;
|
using State = Genode::Pd_session::Managing_system_state;
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,21 @@ struct Genode::Pd_session_client : Rpc_client<Pd_session>
|
|||||||
|
|
||||||
Attach_dma_result attach_dma(Dataspace_capability ds, addr_t at) override {
|
Attach_dma_result attach_dma(Dataspace_capability ds, addr_t at) override {
|
||||||
return call<Rpc_attach_dma>(ds, at); }
|
return call<Rpc_attach_dma>(ds, at); }
|
||||||
|
|
||||||
|
void create_cell(long prioritiy, const Affinity::Location &loc) override
|
||||||
|
{
|
||||||
|
call<Rpc_create_cell>(prioritiy, loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void grow_cell(const Affinity::Location &loc) override
|
||||||
|
{
|
||||||
|
call<Rpc_grow_cell>(loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void shrink_cell(const Affinity::Location &loc) override
|
||||||
|
{
|
||||||
|
call<Rpc_shrink_cell>(loc);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _INCLUDE__PD_SESSION__CLIENT_H_ */
|
#endif /* _INCLUDE__PD_SESSION__CLIENT_H_ */
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include <session/session.h>
|
#include <session/session.h>
|
||||||
#include <region_map/region_map.h>
|
#include <region_map/region_map.h>
|
||||||
#include <base/ram_allocator.h>
|
#include <base/ram_allocator.h>
|
||||||
|
#include <base/affinity.h>
|
||||||
namespace Genode {
|
namespace Genode {
|
||||||
struct Pd_session;
|
struct Pd_session;
|
||||||
struct Pd_session_client;
|
struct Pd_session_client;
|
||||||
@@ -29,7 +29,6 @@ namespace Genode {
|
|||||||
struct Signal_context;
|
struct Signal_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct Genode::Pd_session : Session, Ram_allocator
|
struct Genode::Pd_session : Session, Ram_allocator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -347,6 +346,14 @@ struct Genode::Pd_session : Session, Ram_allocator
|
|||||||
*/
|
*/
|
||||||
virtual Attach_dma_result attach_dma(Dataspace_capability, addr_t at) = 0;
|
virtual Attach_dma_result attach_dma(Dataspace_capability, addr_t at) = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create a new cell at the kernel for this protection domain
|
||||||
|
*/
|
||||||
|
virtual void create_cell(long prioritiy, const Affinity::Location &loc) = 0;
|
||||||
|
|
||||||
|
virtual void shrink_cell(const Affinity::Location &loc) = 0;
|
||||||
|
|
||||||
|
virtual void grow_cell(const Affinity::Location &loc) = 0;
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
** RPC declaration **
|
** RPC declaration **
|
||||||
@@ -402,6 +409,11 @@ struct Genode::Pd_session : Session, Ram_allocator
|
|||||||
GENODE_RPC(Rpc_attach_dma, Attach_dma_result, attach_dma,
|
GENODE_RPC(Rpc_attach_dma, Attach_dma_result, attach_dma,
|
||||||
Dataspace_capability, addr_t);
|
Dataspace_capability, addr_t);
|
||||||
|
|
||||||
|
GENODE_RPC(Rpc_create_cell, void, create_cell, long, Affinity::Location const &);
|
||||||
|
|
||||||
|
GENODE_RPC(Rpc_shrink_cell, void, shrink_cell, Affinity::Location const &);
|
||||||
|
GENODE_RPC(Rpc_grow_cell, void, grow_cell, Affinity::Location const &);
|
||||||
|
|
||||||
GENODE_RPC_INTERFACE(Rpc_assign_parent, Rpc_assign_pci, Rpc_map,
|
GENODE_RPC_INTERFACE(Rpc_assign_parent, Rpc_assign_pci, Rpc_map,
|
||||||
Rpc_alloc_signal_source, Rpc_free_signal_source,
|
Rpc_alloc_signal_source, Rpc_free_signal_source,
|
||||||
Rpc_alloc_context, Rpc_free_context, Rpc_submit,
|
Rpc_alloc_context, Rpc_free_context, Rpc_submit,
|
||||||
@@ -411,7 +423,8 @@ struct Genode::Pd_session : Session, Ram_allocator
|
|||||||
Rpc_try_alloc, Rpc_try_alloc_numa, Rpc_free,
|
Rpc_try_alloc, Rpc_try_alloc_numa, Rpc_free,
|
||||||
Rpc_transfer_ram_quota, Rpc_ram_quota, Rpc_used_ram,
|
Rpc_transfer_ram_quota, Rpc_ram_quota, Rpc_used_ram,
|
||||||
Rpc_native_pd, Rpc_managing_system,
|
Rpc_native_pd, Rpc_managing_system,
|
||||||
Rpc_dma_addr, Rpc_attach_dma);
|
Rpc_dma_addr, Rpc_attach_dma,
|
||||||
|
Rpc_create_cell, Rpc_grow_cell, Rpc_shrink_cell);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _INCLUDE__PD_SESSION__PD_SESSION_H_ */
|
#endif /* _INCLUDE__PD_SESSION__PD_SESSION_H_ */
|
||||||
|
|||||||
@@ -346,6 +346,14 @@ class Genode::Pd_session_component : public Session_object<Pd_session>
|
|||||||
addr_t dma_addr(Ram_dataspace_capability) override;
|
addr_t dma_addr(Ram_dataspace_capability) override;
|
||||||
|
|
||||||
Attach_dma_result attach_dma(Dataspace_capability, addr_t) override;
|
Attach_dma_result attach_dma(Dataspace_capability, addr_t) override;
|
||||||
|
|
||||||
|
/******************************************
|
||||||
|
** Support for EalánOS cells **
|
||||||
|
******************************************/
|
||||||
|
void create_cell(long prioritiy, const Affinity::Location &loc) override;
|
||||||
|
|
||||||
|
void grow_cell(const Affinity::Location &loc) override;
|
||||||
|
void shrink_cell(const Affinity::Location &loc) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _CORE__INCLUDE__PD_SESSION_COMPONENT_H_ */
|
#endif /* _CORE__INCLUDE__PD_SESSION_COMPONENT_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user