mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 17:17:38 +00:00
nova: use 'Native_cpu' component for thread initialization
Pass the thread type and exception base to core with a 'Native_cpu' component instead of enhancing the 'Thread_state' class. Fixes #2298
This commit is contained in:
committed by
Christian Helmuth
parent
fbdfbc2476
commit
ca2871e2e4
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* \brief Thread state
|
||||
* \author Alexander Boettcher
|
||||
* \date 2012-08-09
|
||||
*
|
||||
* This file contains the NOVA specific thread state.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012-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__BASE__THREAD_STATE_H_
|
||||
#define _INCLUDE__BASE__THREAD_STATE_H_
|
||||
|
||||
#include <base/thread_state_base.h>
|
||||
|
||||
namespace Genode { struct Thread_state; }
|
||||
|
||||
|
||||
struct Genode::Thread_state : Thread_state_base
|
||||
{
|
||||
bool vcpu;
|
||||
addr_t sel_exc_base;
|
||||
bool global_thread;
|
||||
|
||||
Thread_state() : vcpu(false), sel_exc_base(~0UL), global_thread(true) { }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__BASE__THREAD_STATE_H_ */
|
33
repos/base-nova/include/nova_native_cpu/client.h
Normal file
33
repos/base-nova/include/nova_native_cpu/client.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* \brief Client-side NOVA-specific CPU session interface
|
||||
* \author Norman Feske
|
||||
* \date 2016-04-21
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016-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__NOVA_NATIVE_CPU__CLIENT_H_
|
||||
#define _INCLUDE__NOVA_NATIVE_CPU__CLIENT_H_
|
||||
|
||||
#include <nova_native_cpu/nova_native_cpu.h>
|
||||
#include <base/rpc_client.h>
|
||||
|
||||
namespace Genode { struct Nova_native_cpu_client; }
|
||||
|
||||
|
||||
struct Genode::Nova_native_cpu_client : Rpc_client<Nova_native_cpu>
|
||||
{
|
||||
explicit Nova_native_cpu_client(Capability<Native_cpu> cap)
|
||||
: Rpc_client<Nova_native_cpu>(static_cap_cast<Nova_native_cpu>(cap)) { }
|
||||
|
||||
void thread_type(Thread_capability thread_cap, Thread_type thread_type,
|
||||
Exception_base exception_base) {
|
||||
call<Rpc_thread_type>(thread_cap, thread_type, exception_base); }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__NOVA_NATIVE_CPU__CLIENT_H_ */
|
45
repos/base-nova/include/nova_native_cpu/nova_native_cpu.h
Normal file
45
repos/base-nova/include/nova_native_cpu/nova_native_cpu.h
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* \brief NOVA-specific part of the CPU session interface
|
||||
* \author Norman Feske
|
||||
* \date 2016-04-21
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016-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__NOVA_NATIVE_CPU__FOC_NATIVE_CPU_H_
|
||||
#define _INCLUDE__NOVA_NATIVE_CPU__FOC_NATIVE_CPU_H_
|
||||
|
||||
#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
|
||||
{
|
||||
enum Thread_type { GLOBAL, LOCAL, VCPU };
|
||||
|
||||
/*
|
||||
* Exception base of thread in caller protection domain - not in core!
|
||||
*/
|
||||
struct Exception_base { addr_t exception_base; };
|
||||
|
||||
|
||||
virtual void thread_type(Thread_capability, Thread_type, Exception_base) = 0;
|
||||
|
||||
|
||||
/*********************
|
||||
** RPC declaration **
|
||||
*********************/
|
||||
|
||||
GENODE_RPC(Rpc_thread_type, void, thread_type, Thread_capability,
|
||||
Thread_type, Exception_base );
|
||||
GENODE_RPC_INTERFACE(Rpc_thread_type);
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__NOVA_NATIVE_CPU__FOC_NATIVE_CPU_H_ */
|
Reference in New Issue
Block a user