mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
Remove Cpu_session::Native_cpu definition from API
This type can be a forward declaration in the public API because its definition is required only in kernel-specific code. Related to #3979
This commit is contained in:
parent
3e73d8d7b6
commit
6cfaac182a
@ -21,10 +21,10 @@
|
||||
namespace Genode { struct Foc_native_cpu_client; }
|
||||
|
||||
|
||||
struct Genode::Foc_native_cpu_client : Rpc_client<Foc_native_cpu>
|
||||
struct Genode::Foc_native_cpu_client : Rpc_client<Cpu_session::Native_cpu>
|
||||
{
|
||||
explicit Foc_native_cpu_client(Capability<Native_cpu> cap)
|
||||
: Rpc_client<Foc_native_cpu>(static_cap_cast<Foc_native_cpu>(cap)) { }
|
||||
: Rpc_client<Cpu_session::Native_cpu>(cap) { }
|
||||
|
||||
Native_capability native_cap(Thread_capability cap) override {
|
||||
return call<Rpc_native_cap>(cap); }
|
||||
|
@ -19,10 +19,8 @@
|
||||
#include <cpu_session/cpu_session.h>
|
||||
#include <foc/thread_state.h>
|
||||
|
||||
namespace Genode { struct Foc_native_cpu; }
|
||||
|
||||
|
||||
struct Genode::Foc_native_cpu : Cpu_session::Native_cpu
|
||||
struct Genode::Cpu_session::Native_cpu : Interface
|
||||
{
|
||||
virtual Native_capability native_cap(Thread_capability) = 0;
|
||||
virtual Foc_thread_state thread_state(Thread_capability) = 0;
|
||||
|
@ -25,7 +25,7 @@ namespace Genode {
|
||||
}
|
||||
|
||||
|
||||
class Genode::Native_cpu_component : public Rpc_object<Foc_native_cpu,
|
||||
class Genode::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
|
||||
Native_cpu_component>
|
||||
{
|
||||
private:
|
||||
|
@ -25,7 +25,7 @@ namespace Genode {
|
||||
}
|
||||
|
||||
|
||||
class Genode::Native_cpu_component : public Rpc_object<Linux_native_cpu,
|
||||
class Genode::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
|
||||
Native_cpu_component>
|
||||
{
|
||||
private:
|
||||
|
@ -20,10 +20,10 @@
|
||||
namespace Genode { struct Linux_native_cpu_client; }
|
||||
|
||||
|
||||
struct Genode::Linux_native_cpu_client : Rpc_client<Linux_native_cpu>
|
||||
struct Genode::Linux_native_cpu_client : Rpc_client<Cpu_session::Native_cpu>
|
||||
{
|
||||
explicit Linux_native_cpu_client(Capability<Native_cpu> cap)
|
||||
: Rpc_client<Linux_native_cpu>(static_cap_cast<Linux_native_cpu>(cap)) { }
|
||||
explicit Linux_native_cpu_client(Capability<Cpu_session::Native_cpu> cap)
|
||||
: Rpc_client<Cpu_session::Native_cpu>(cap) { }
|
||||
|
||||
void thread_id(Thread_capability thread, int pid, int tid) override {
|
||||
call<Rpc_thread_id>(thread, pid, tid); }
|
||||
|
@ -17,10 +17,8 @@
|
||||
#include <base/rpc.h>
|
||||
#include <cpu_session/cpu_session.h>
|
||||
|
||||
namespace Genode { struct Linux_native_cpu; }
|
||||
|
||||
|
||||
struct Genode::Linux_native_cpu : Cpu_session::Native_cpu
|
||||
struct Genode::Cpu_session::Native_cpu : Interface
|
||||
{
|
||||
/**
|
||||
* Register Linux PID and TID of the specified thread
|
||||
|
@ -20,10 +20,10 @@
|
||||
namespace Genode { struct Nova_native_cpu_client; }
|
||||
|
||||
|
||||
struct Genode::Nova_native_cpu_client : Rpc_client<Nova_native_cpu>
|
||||
struct Genode::Nova_native_cpu_client : Rpc_client<Cpu_session::Native_cpu>
|
||||
{
|
||||
explicit Nova_native_cpu_client(Capability<Native_cpu> cap)
|
||||
: Rpc_client<Nova_native_cpu>(static_cap_cast<Nova_native_cpu>(cap)) { }
|
||||
explicit Nova_native_cpu_client(Capability<Cpu_session::Native_cpu> cap)
|
||||
: Rpc_client<Cpu_session::Native_cpu>(cap) { }
|
||||
|
||||
void thread_type(Thread_capability thread_cap, Thread_type thread_type,
|
||||
Exception_base exception_base) override {
|
||||
|
@ -17,10 +17,8 @@
|
||||
#include <base/rpc.h>
|
||||
#include <cpu_session/cpu_session.h>
|
||||
|
||||
namespace Genode { struct Nova_native_cpu; }
|
||||
|
||||
|
||||
struct Genode::Nova_native_cpu : Cpu_session::Native_cpu
|
||||
struct Genode::Cpu_session::Native_cpu : Interface
|
||||
{
|
||||
enum Thread_type { GLOBAL, LOCAL, VCPU };
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace Genode {
|
||||
}
|
||||
|
||||
|
||||
class Genode::Native_cpu_component : public Rpc_object<Nova_native_cpu,
|
||||
class Genode::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
|
||||
Native_cpu_component>
|
||||
{
|
||||
private:
|
||||
|
@ -40,7 +40,7 @@ class Genode::Native_pd_component : public Rpc_object<Pd_session::Native_pd>
|
||||
~Native_pd_component();
|
||||
|
||||
/**
|
||||
* Nova_native_pd interface
|
||||
* Native_pd interface
|
||||
*/
|
||||
Native_capability alloc_rpc_cap(Native_capability, addr_t, addr_t) override;
|
||||
void imprint_rpc_cap(Native_capability, unsigned long) override;
|
||||
|
@ -146,8 +146,8 @@ namespace Genode {
|
||||
/**
|
||||
* Set thread type and exception portal base
|
||||
*/
|
||||
void thread_type(Nova_native_cpu::Thread_type thread_type,
|
||||
Nova_native_cpu::Exception_base exception_base);
|
||||
void thread_type(Cpu_session::Native_cpu::Thread_type thread_type,
|
||||
Cpu_session::Native_cpu::Exception_base exception_base);
|
||||
|
||||
/**
|
||||
* Set pager
|
||||
|
@ -53,7 +53,7 @@ class Genode::Rpc_cap_factory
|
||||
*
|
||||
* \throw Allocator::Out_of_memory
|
||||
*
|
||||
* This function is invoked via Nova_native_pd::alloc_rpc_cap.
|
||||
* This function is invoked via Native_pd::alloc_rpc_cap.
|
||||
*/
|
||||
Native_capability alloc(Native_capability ep, addr_t entry, addr_t mtd);
|
||||
|
||||
|
@ -335,19 +335,19 @@ void Platform_thread::pager(Pager_object &pager)
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::thread_type(Nova_native_cpu::Thread_type thread_type,
|
||||
Nova_native_cpu::Exception_base exception_base)
|
||||
void Platform_thread::thread_type(Cpu_session::Native_cpu::Thread_type thread_type,
|
||||
Cpu_session::Native_cpu::Exception_base exception_base)
|
||||
{
|
||||
/* you can do it only once */
|
||||
if (_sel_exc_base != Native_thread::INVALID_INDEX)
|
||||
return;
|
||||
|
||||
if (!main_thread() || (thread_type == Nova_native_cpu::Thread_type::VCPU))
|
||||
if (!main_thread() || (thread_type == Cpu_session::Native_cpu::Thread_type::VCPU))
|
||||
_sel_exc_base = exception_base.exception_base;
|
||||
|
||||
if (thread_type == Nova_native_cpu::Thread_type::LOCAL)
|
||||
if (thread_type == Cpu_session::Native_cpu::Thread_type::LOCAL)
|
||||
_features |= WORKER;
|
||||
else if (thread_type == Nova_native_cpu::Thread_type::VCPU)
|
||||
else if (thread_type == Cpu_session::Native_cpu::Thread_type::VCPU)
|
||||
_features |= VCPU;
|
||||
}
|
||||
|
||||
|
@ -151,14 +151,14 @@ void Thread::start()
|
||||
/* create EC at core */
|
||||
|
||||
try {
|
||||
Nova_native_cpu::Thread_type thread_type;
|
||||
Cpu_session::Native_cpu::Thread_type thread_type;
|
||||
|
||||
if (global)
|
||||
thread_type = Nova_native_cpu::Thread_type::GLOBAL;
|
||||
thread_type = Cpu_session::Native_cpu::Thread_type::GLOBAL;
|
||||
else
|
||||
thread_type = Nova_native_cpu::Thread_type::LOCAL;
|
||||
thread_type = Cpu_session::Native_cpu::Thread_type::LOCAL;
|
||||
|
||||
Nova_native_cpu::Exception_base exception_base { native_thread().exc_pt_sel };
|
||||
Cpu_session::Native_cpu::Exception_base exception_base { native_thread().exc_pt_sel };
|
||||
|
||||
Nova_native_cpu_client native_cpu(_cpu_session->native_cpu());
|
||||
native_cpu.thread_type(_thread_cap, thread_type, exception_base);
|
||||
@ -175,7 +175,7 @@ void Thread::start()
|
||||
|
||||
/*
|
||||
* Requested ec cap that is used for recall and
|
||||
* creation of portals (Nova_native_pd::alloc_rpc_cap).
|
||||
* creation of portals (Native_pd::alloc_rpc_cap).
|
||||
*/
|
||||
request_native_ec_cap(native_thread().exc_pt_sel + Nova::PT_SEL_PAGE_FAULT,
|
||||
native_thread().ec_sel);
|
||||
|
@ -220,7 +220,7 @@ struct Genode::Cpu_session : Session
|
||||
/**
|
||||
* Common base class of kernel-specific CPU interfaces
|
||||
*/
|
||||
struct Native_cpu : Interface { };
|
||||
struct Native_cpu;
|
||||
|
||||
/**
|
||||
* Return capability to kernel-specific CPU operations
|
||||
|
@ -28,7 +28,7 @@ namespace Cpu_sampler {
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
class Cpu_sampler::Native_cpu_component : public Rpc_object<Foc_native_cpu,
|
||||
class Cpu_sampler::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
|
||||
Native_cpu_component>
|
||||
{
|
||||
private:
|
||||
|
@ -28,8 +28,8 @@ namespace Cpu_sampler {
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
class Cpu_sampler::Native_cpu_component : public Rpc_object<Nova_native_cpu,
|
||||
Native_cpu_component>
|
||||
class Cpu_sampler::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
|
||||
Native_cpu_component>
|
||||
{
|
||||
private:
|
||||
|
||||
@ -51,8 +51,8 @@ class Cpu_sampler::Native_cpu_component : public Rpc_object<Nova_native_cpu,
|
||||
}
|
||||
|
||||
void thread_type(Thread_capability thread_cap,
|
||||
Nova_native_cpu::Thread_type thread_type,
|
||||
Nova_native_cpu::Exception_base exception_base) override
|
||||
Cpu_session::Native_cpu::Thread_type thread_type,
|
||||
Cpu_session::Native_cpu::Exception_base exception_base) override
|
||||
{
|
||||
auto lambda = [&] (Cpu_sampler::Cpu_thread_component *cpu_thread) {
|
||||
_nova_native_cpu.thread_type(cpu_thread->parent_thread(),
|
||||
|
@ -85,8 +85,8 @@ class Vmm::Vcpu_other_pd : public Vmm::Vcpu_thread
|
||||
});
|
||||
|
||||
/* tell parent that this will be a vCPU */
|
||||
Nova_native_cpu::Thread_type thread_type { Nova_native_cpu::Thread_type::VCPU };
|
||||
Nova_native_cpu::Exception_base exception_base { _exc_pt_sel };
|
||||
Cpu_session::Native_cpu::Thread_type thread_type { Cpu_session::Native_cpu::Thread_type::VCPU };
|
||||
Cpu_session::Native_cpu::Exception_base exception_base { _exc_pt_sel };
|
||||
Nova_native_cpu_client native_cpu(_cpu_connection->native_cpu());
|
||||
native_cpu.thread_type(vcpu_vm, thread_type, exception_base);
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace Gdb_monitor {
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
class Gdb_monitor::Native_cpu_component : public Rpc_object<Nova_native_cpu,
|
||||
class Gdb_monitor::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
|
||||
Native_cpu_component>
|
||||
{
|
||||
private:
|
||||
@ -51,8 +51,8 @@ class Gdb_monitor::Native_cpu_component : public Rpc_object<Nova_native_cpu,
|
||||
}
|
||||
|
||||
void thread_type(Thread_capability thread_cap,
|
||||
Nova_native_cpu::Thread_type thread_type,
|
||||
Nova_native_cpu::Exception_base exception_base) override
|
||||
Cpu_session::Native_cpu::Thread_type thread_type,
|
||||
Cpu_session::Native_cpu::Exception_base exception_base) override
|
||||
{
|
||||
auto lambda = [&] (Cpu_thread_component *cpu_thread) {
|
||||
_nova_native_cpu.thread_type(cpu_thread->parent_thread_cap(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user