hw_x86_64: Factor out _core_only_mmio_regions function

Move the _core_only_mmio_regions function to the
x86_64/platform_support.cc file. This is required to make it overridable
for other platforms deriving from x86.
This commit is contained in:
Reto Buerki 2015-05-04 14:08:58 +02:00 committed by Christian Helmuth
parent afb827a96f
commit 2a0b6fb541
3 changed files with 29 additions and 11 deletions

View File

@ -17,6 +17,7 @@ SRC_S += spec/x86_64/crt0.s
# add C++ sources
SRC_CC += spec/x86/pic.cc
SRC_CC += spec/x86_64/kernel/thread_base.cc
SRC_CC += spec/x86_64/platform_support.cc
SRC_CC += spec/x86_64/idt.cc
SRC_CC += spec/x86_64/tss.cc

View File

@ -33,17 +33,6 @@ Native_region * Platform::_ram_regions(unsigned const i)
}
Native_region * Platform::_core_only_mmio_regions(unsigned const i)
{
static Native_region _regions[] =
{
{ Board::MMIO_LAPIC_BASE, Board::MMIO_LAPIC_SIZE },
{ Board::MMIO_IOAPIC_BASE, Board::MMIO_IOAPIC_SIZE },
};
return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0;
}
void Platform::_init_io_port_alloc()
{
_io_port_alloc.add_range(0, 0x10000);

View File

@ -0,0 +1,28 @@
/*
* \brief Platform implementations specific for x86_64
* \author Reto Buerki
* \date 2015-05-04
*/
/*
* 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.
*/
/* core includes */
#include <platform.h>
#include <board.h>
using namespace Genode;
Native_region * Platform::_core_only_mmio_regions(unsigned const i)
{
static Native_region _regions[] =
{
{ Board::MMIO_LAPIC_BASE, Board::MMIO_LAPIC_SIZE },
{ Board::MMIO_IOAPIC_BASE, Board::MMIO_IOAPIC_SIZE },
};
return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0;
}