genode/repos/base-pistachio/include/pistachio/kip.h
Norman Feske ca971bbfd8 Move repositories to 'repos/' subdirectory
This patch changes the top-level directory layout as a preparatory
step for improving the tools for managing 3rd-party source codes.
The rationale is described in the issue referenced below.

Issue #1082
2014-05-14 16:08:00 +02:00

57 lines
1.0 KiB
C++

/*
* \brief Access to kernel info page (KIP)
* \author Julian Stecklina
* \date 2008-02-20
*/
/*
* Copyright (C) 2008-2013 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 _INCLUDE__PISTACHIO__KIP_H_
#define _INCLUDE__PISTACHIO__KIP_H_
namespace Pistachio {
#include <l4/types.h>
#include <l4/kip.h>
/**
* Return a pointer to the kernel info page
*/
L4_KernelInterfacePage_t *get_kip();
unsigned int get_page_size_log2();
L4_Word_t get_page_mask();
inline L4_Word_t get_page_size()
{
return 1<<get_page_size_log2();
}
inline L4_ThreadId_t get_sigma0()
{
/* from l4/sigma0.h */
return L4_GlobalId (get_kip()->ThreadInfo.X.UserBase, 1);
}
inline unsigned int get_user_base()
{
return get_kip()->ThreadInfo.X.UserBase;
}
inline unsigned int get_threadno_bits()
{
#ifdef L4_32BIT
return 18;
#else
#error "Unsupported architecture."
#endif
}
}
#endif /* _INCLUDE__PISTACHIO__KIP_H_ */