genode/base-hw/src/core/arm_v6/translation_table.h

34 lines
814 B
C++

/*
* \brief Armv6 translation table for core
* \author Martin Stein
* \author Stefan Kalkowski
* \date 2012-02-22
*/
/*
* Copyright (C) 2012-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 _ARM_V6__TRANSLATION_TABLE_H_
#define _ARM_V6__TRANSLATION_TABLE_H_
/* core includes */
#include <arm/short_translation_table.h>
template <typename T>
static typename T::access_t
Arm::memory_region_attr(Page_flags const & flags)
{
typedef typename T::Tex Tex;
typedef typename T::C C;
typedef typename T::B B;
if(flags.device) { return 0; }
if(flags.cacheable) { return Tex::bits(5) | B::bits(1); }
return Tex::bits(6) | C::bits(1);
}
#endif /* _ARM_V6__TRANSLATION_TABLE_H_ */