mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-21 19:45:52 +00:00
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:
parent
5765398741
commit
544148bc24
repos/base-hw
lib/mk/arm
src/core
@ -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
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -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();
|
||||
|
19
repos/base-hw/src/core/spec/arm/platform_support.cc
Normal file
19
repos/base-hw/src/core/spec/arm/platform_support.cc
Normal 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() { };
|
@ -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() { }
|
||||
|
Loading…
x
Reference in New Issue
Block a user