mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
hw: fix capability accounting of kernel/core
The recently implemented capability resource trading scheme unfortunately broke the automated capability memory upgrade mechanism needed by base-hw kernel/core. This commit splits the capability memory upgrade mechanism from the PD session ram_quota upgrade, and moves that functionality into a separate Pd_session::Native_pd interface. Ref #2398
This commit is contained in:
committed by
Christian Helmuth
parent
6f8dc9054a
commit
a004462096
32
repos/base-hw/include/hw_native_pd/client.h
Normal file
32
repos/base-hw/include/hw_native_pd/client.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* \brief Client-side HW specific PD session interface
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2017-06-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__HW_NATIVE_PD__CLIENT_H_
|
||||
#define _INCLUDE__HW_NATIVE_PD__CLIENT_H_
|
||||
|
||||
#include <hw_native_pd/hw_native_pd.h>
|
||||
#include <base/rpc_client.h>
|
||||
|
||||
namespace Genode { struct Hw_native_pd_client; }
|
||||
|
||||
|
||||
struct Genode::Hw_native_pd_client : Rpc_client<Hw_native_pd>
|
||||
{
|
||||
explicit Hw_native_pd_client(Capability<Native_pd> cap)
|
||||
: Rpc_client<Hw_native_pd>(static_cap_cast<Hw_native_pd>(cap)) { }
|
||||
|
||||
void upgrade_cap_slab() override {
|
||||
call<Rpc_upgrade_cap_slab>(); }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__HW_NATIVE_PD__CLIENT_H_ */
|
||||
37
repos/base-hw/include/hw_native_pd/hw_native_pd.h
Normal file
37
repos/base-hw/include/hw_native_pd/hw_native_pd.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* \brief HW-specific part of the PD session interface
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2017-06-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__HW_NATIVE_PD__HW_NATIVE_PD_H_
|
||||
#define _INCLUDE__HW_NATIVE_PD__HW_NATIVE_PD_H_
|
||||
|
||||
#include <base/rpc.h>
|
||||
#include <pd_session/pd_session.h>
|
||||
|
||||
namespace Genode { struct Hw_native_pd; }
|
||||
|
||||
|
||||
struct Genode::Hw_native_pd : Pd_session::Native_pd
|
||||
{
|
||||
virtual void upgrade_cap_slab() = 0;
|
||||
|
||||
|
||||
/*********************
|
||||
** RPC declaration **
|
||||
*********************/
|
||||
|
||||
GENODE_RPC_THROW(Rpc_upgrade_cap_slab, void, upgrade_cap_slab,
|
||||
GENODE_TYPE_LIST(Out_of_ram));
|
||||
GENODE_RPC_INTERFACE(Rpc_upgrade_cap_slab);
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__HW_NATIVE_PD__HW_NATIVE_PD_H_ */
|
||||
Reference in New Issue
Block a user