mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-17 10:19:48 +00:00
parent
d0e7cc35fa
commit
57ec61fb4b
@ -9,4 +9,4 @@ include $(REP_DIR)/lib/mk/base.inc
|
|||||||
LIBS += startup
|
LIBS += startup
|
||||||
SRC_CC += thread.cc thread_myself.cc thread_linux.cc
|
SRC_CC += thread.cc thread_myself.cc thread_linux.cc
|
||||||
SRC_CC += capability_space.cc capability_raw.cc
|
SRC_CC += capability_space.cc capability_raw.cc
|
||||||
|
SRC_CC += attach_stack_area.cc
|
||||||
|
@ -118,6 +118,11 @@ class Genode::Platform_env : public Platform_env_base,
|
|||||||
constexpr static size_t _emergency_ram_size() { return 8*1024; }
|
constexpr static size_t _emergency_ram_size() { return 8*1024; }
|
||||||
Ram_dataspace_capability _emergency_ram_ds;
|
Ram_dataspace_capability _emergency_ram_ds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach stack area to local address space (for non-hybrid components)
|
||||||
|
*/
|
||||||
|
void _attach_stack_area();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
29
repos/base-linux/src/lib/base/attach_stack_area.cc
Normal file
29
repos/base-linux/src/lib/base/attach_stack_area.cc
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* \brief Attach stack area to local address space
|
||||||
|
* \author Norman Feske
|
||||||
|
* \date 2016-07-06
|
||||||
|
*
|
||||||
|
* This function resides in a distinct compilation unit because it is not
|
||||||
|
* used for hybrid components where the Genode::Thread API is implemented
|
||||||
|
* via POSIX threads.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2016 Genode Labs GmbH
|
||||||
|
*
|
||||||
|
* This file is part of the Genode OS framework, which is distributed
|
||||||
|
* under the terms of the GNU General Public License version 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* base-internal includes */
|
||||||
|
#include <base/internal/platform_env.h>
|
||||||
|
|
||||||
|
using namespace Genode;
|
||||||
|
|
||||||
|
|
||||||
|
void Platform_env::_attach_stack_area()
|
||||||
|
{
|
||||||
|
_local_pd_session._address_space.attach_at(_local_pd_session._stack_area.dataspace(),
|
||||||
|
stack_area_virtual_base(),
|
||||||
|
stack_area_virtual_size());
|
||||||
|
}
|
@ -154,10 +154,7 @@ Platform_env::Platform_env()
|
|||||||
_heap(Platform_env_base::ram_session(), Platform_env_base::rm_session()),
|
_heap(Platform_env_base::ram_session(), Platform_env_base::rm_session()),
|
||||||
_emergency_ram_ds(ram_session()->alloc(_emergency_ram_size()))
|
_emergency_ram_ds(ram_session()->alloc(_emergency_ram_size()))
|
||||||
{
|
{
|
||||||
/* attach stack area to local address space */
|
_attach_stack_area();
|
||||||
_local_pd_session._address_space.attach_at(_local_pd_session._stack_area.dataspace(),
|
|
||||||
stack_area_virtual_base(),
|
|
||||||
stack_area_virtual_size());
|
|
||||||
|
|
||||||
env_stack_area_region_map = &_local_pd_session._stack_area;
|
env_stack_area_region_map = &_local_pd_session._stack_area;
|
||||||
env_stack_area_ram_session = ram_session();
|
env_stack_area_ram_session = ram_session();
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
/* base-internal includes */
|
/* base-internal includes */
|
||||||
#include <base/internal/native_thread.h>
|
#include <base/internal/native_thread.h>
|
||||||
#include <base/internal/globals.h>
|
#include <base/internal/globals.h>
|
||||||
|
#include <base/internal/platform_env.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -525,3 +526,17 @@ Thread::~Thread()
|
|||||||
/* inform core about the killed thread */
|
/* inform core about the killed thread */
|
||||||
_cpu_session->kill_thread(_thread_cap);
|
_cpu_session->kill_thread(_thread_cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/******************
|
||||||
|
** Platform_env **
|
||||||
|
******************/
|
||||||
|
|
||||||
|
void Platform_env::_attach_stack_area()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Omit attaching the stack area to the local address space for hybrid
|
||||||
|
* components. Otherwise, it may collide with the (randomized) loading
|
||||||
|
* locations of shared objects or the binary.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user