genode/repos/base-hw/src/core/spec/pbxa9/platform_support.cc
Stefan Kalkowski d549921bc8 hw: introduce memory regions and array
* replace Native_regions and inline code for iteration

Ref #2092
2017-02-07 19:20:30 +01:00

51 lines
1.2 KiB
C++

/*
* \brief Parts of platform that are specific to PBXA9
* \author Martin Stein
* \date 2012-04-27
*/
/*
* 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.
*/
/* core includes */
#include <platform.h>
#include <board.h>
#include <cpu.h>
#include <pic.h>
/* base-internal includes */
#include <base/internal/unmanaged_singleton.h>
using namespace Genode;
Memory_region_array & Platform::ram_regions()
{
return *unmanaged_singleton<Memory_region_array>(
Memory_region { Board::RAM_0_BASE, Board::RAM_0_SIZE },
Memory_region { Board::RAM_1_BASE, Board::RAM_1_SIZE });
}
Memory_region_array & Platform::core_mmio_regions()
{
return *unmanaged_singleton<Memory_region_array>(
/* core timer and PIC */
Memory_region { Board::CORTEX_A9_PRIVATE_MEM_BASE,
Board::CORTEX_A9_PRIVATE_MEM_SIZE },
/* core UART */
Memory_region { Board::PL011_0_MMIO_BASE, Board::PL011_0_MMIO_SIZE },
/* L2 Cache Controller */
Memory_region { Board::PL310_MMIO_BASE, Board::PL310_MMIO_SIZE }
);
}
Genode::Arm::User_context::User_context() { cpsr = Psr::init_user(); }