Introduce platform-specific services for core

By now all services in core where created, and registered in the generic
main routine. Although there exists already a x86-specific service (I/O ports)
there was no possibility to announce core-services for certain platforms only.
This commit introduces a hook function in the 'Platform' class, that enables
registration of platform-specific services. Moreover, the io-port service
is offered on x86 platforms only now.
This commit is contained in:
Stefan Kalkowski
2012-10-02 13:11:58 +02:00
parent 96d45c1159
commit dc3d784e6d
29 changed files with 246 additions and 460 deletions

View File

@ -1,59 +0,0 @@
/*
* \brief Linux-specific IO_PORT service
* \author Christian Helmuth
* \date 2007-04-18
*/
/*
* Copyright (C) 2007-2012 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.
*/
#include <base/printf.h>
#include <root/root.h>
#include "io_port_session_component.h"
using namespace Genode;
unsigned char Io_port_session_component::inb(unsigned short address) {
return 0; }
unsigned short Io_port_session_component::inw(unsigned short address) {
return 0; }
unsigned Io_port_session_component::inl(unsigned short address) {
return 0; }
void Io_port_session_component::outb(unsigned short address, unsigned char value) {
}
void Io_port_session_component::outw(unsigned short address, unsigned short value) {
}
void Io_port_session_component::outl(unsigned short address, unsigned value) {
}
Io_port_session_component::Io_port_session_component(Range_allocator *io_port_alloc,
const char *args)
: _io_port_alloc(io_port_alloc)
{
PWRN("no IO_PORT support under Linux (args=\"%s\")", args);
_size = 0;
throw Root::Invalid_args();
}
Io_port_session_component::~Io_port_session_component()
{
PERR("Implement me, immediately!");
}

View File

@ -7,6 +7,7 @@ GEN_CORE_DIR = $(BASE_DIR)/src/core
SRC_CC = main.cc \
platform.cc \
platform_thread.cc \
platform_services.cc \
ram_session_component.cc \
ram_session_support.cc \
rom_session_component.cc \
@ -14,7 +15,6 @@ SRC_CC = main.cc \
cpu_session_support.cc \
pd_session_component.cc \
io_mem_session_component.cc \
io_port_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \
thread.cc \
@ -32,6 +32,7 @@ vpath main.cc $(GEN_CORE_DIR)
vpath thread.cc $(BASE_DIR)/src/base/thread
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)
vpath platform_services.cc $(GEN_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath signal_source_component.cc $(GEN_CORE_DIR)
vpath debug.cc $(REP_DIR)/src/base/env