hw_x86_64: Add I/O port allocator to platform

Add the entire I/O port range to the I/O port allocator on x86. Do nothing
on ARM platforms since there are no I/O port resources.
This commit is contained in:
Adrian-Ken Rueegsegger 2015-03-18 23:40:58 +01:00 committed by Christian Helmuth
parent 5765398741
commit 544148bc24
5 changed files with 39 additions and 1 deletions

View File

@ -11,6 +11,7 @@ INC_DIR += $(REP_DIR)/src/core/include/spec/arm
SRC_CC += spec/arm/kernel/thread_base.cc
SRC_CC += spec/arm/kernel/thread.cc
SRC_CC += spec/arm/kernel/cpu.cc
SRC_CC += spec/arm/platform_support.cc
# add assembly sources
SRC_S += spec/arm/kernel/crt0.s

View File

@ -42,6 +42,7 @@ namespace Genode {
Core_mem_allocator _core_mem_alloc; /* core-accessible memory */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Rom_fs _rom_fs; /* ROM file system */
@ -53,6 +54,10 @@ namespace Genode {
addr_t _vm_start;
size_t _vm_size;
/**
* Initialize I/O port allocator
*/
void _init_io_port_alloc();
public:
@ -112,7 +117,7 @@ namespace Genode {
inline Range_allocator * io_mem_alloc() { return &_io_mem_alloc; }
inline Range_allocator * io_port_alloc() { return 0; }
inline Range_allocator * io_port_alloc() { return &_io_port_alloc; }
inline Range_allocator * irq_alloc() { return &_irq_alloc; }

View File

@ -129,6 +129,7 @@ static Core_mem_allocator * _core_mem_allocator = 0;
Platform::Platform()
:
_io_mem_alloc(core_mem_alloc()),
_io_port_alloc(core_mem_alloc()),
_irq_alloc(core_mem_alloc()),
_vm_start(VIRT_ADDR_SPACE_START), _vm_size(VIRT_ADDR_SPACE_SIZE)
{
@ -147,6 +148,8 @@ Platform::Platform()
init_alloc(_core_mem_alloc.virt_alloc(), virt_region,
_core_only_ram_regions, get_page_size_log2());
_init_io_port_alloc();
/* make interrupts available to the interrupt allocator */
for (unsigned i = 0; i < Kernel::Pic::NR_OF_IRQ; i++)
_irq_alloc.add_range(i, 1);
@ -181,6 +184,10 @@ Platform::Platform()
printf("-------------------\n");
_io_mem_alloc.raw()->dump_addr_tree();
printf("\n");
printf("IO port allocator\n");
printf("-------------------\n");
_io_port_alloc.raw()->dump_addr_tree();
printf("\n");
printf("IRQ allocator\n");
printf("-------------------\n");
_irq_alloc.raw()->dump_addr_tree();

View File

@ -0,0 +1,19 @@
/*
* \brief ARM specific platform implementations
* \author Adrian-Ken Rueegsegger
* \date 2015-03-18
*/
/*
* 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>
using namespace Genode;
void Platform::_init_io_port_alloc() { };

View File

@ -51,4 +51,10 @@ Native_region * Platform::_core_only_mmio_regions(unsigned const i)
}
void Platform::_init_io_port_alloc()
{
_io_port_alloc.add_range(0, 0x10000);
}
Cpu::User_context::User_context() { }