sel4: import parent cap into non-core components

This commit is contained in:
Norman Feske 2015-05-13 11:30:32 +02:00 committed by Christian Helmuth
parent 1ea22f82fa
commit 3259185bfc
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#
# Make the includes of src/base/internal/ available to the startup lib. This is
# needed because the seL4-specific src/platform/_main_parent_cap.h as included
# by the startup lib depends on the internal/capability_space_sel4.h.
#
INC_DIR += $(REP_DIR)/src/base
include $(BASE_DIR)/lib/mk/startup.inc
vpath crt0.s $(BASE_DIR)/src/platform/x86_32

View File

@ -0,0 +1,39 @@
/*
* \brief Obtain parent capability
* \author Norman Feske
* \date 2015-05-12
*/
/*
* Copyright (C) 2015 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.
*/
#ifndef _PLATFORM__MAIN_PARENT_CAP_H_
#define _PLATFORM__MAIN_PARENT_CAP_H_
/* Genode includes */
#include <util/string.h>
/* base-internal includes */
#include <internal/capability_space_sel4.h>
namespace Genode {
/**
* Return constructed parent capability
*/
Parent_capability parent_cap()
{
Capability_space::Ipc_cap_data const
ipc_cap_data(Rpc_obj_key(), INITIAL_SEL_PARENT);
Native_capability cap = Capability_space::import(ipc_cap_data);
return reinterpret_cap_cast<Parent>(cap);
}
}
#endif /* _PLATFORM__MAIN_PARENT_CAP_H_ */