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,58 +0,0 @@
/*
* \brief Implementation of the IO_PORT session interface
* \author Norman Feske
* \date 2009-10-02
*/
/*
* Copyright (C) 2009-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 "io_port_session_component.h"
using namespace Genode;
/**************
** Port API **
**************/
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)
{ }
/******************************
** Constructor / destructor **
******************************/
Io_port_session_component::Io_port_session_component(Range_allocator *io_port_alloc,
const char *args)
: _io_port_alloc(io_port_alloc)
{ }
Io_port_session_component::~Io_port_session_component()
{ }

View File

@ -19,11 +19,11 @@ SRC_CC = \
thread_bootstrap.cc \
platform_thread.cc \
platform_pd.cc \
platform_services.cc \
platform.cc \
dataspace_component.cc \
rm_session_component.cc \
rm_session_support.cc \
io_port_session_component.cc \
irq_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \
@ -45,6 +45,7 @@ vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.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 dataspace_component.cc $(GEN_CORE_DIR)
@ -55,4 +56,3 @@ vpath %.cc $(REP_DIR)/src/core
vpath thread_bootstrap.cc $(BASE_DIR)/src/base/thread
vpath thread.cc $(BASE_DIR)/src/base/thread
vpath utcb.cc $(REP_DIR)/src/base/env

View File

@ -4,4 +4,5 @@ REQUIRES += arm
SRC_CC += platform_arm.cc
vpath io_port_session_component.cc $(GEN_CORE_DIR)/arm
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@ -19,6 +19,7 @@ SRC_CC = main.cc \
thread_bootstrap.cc \
platform_thread.cc \
platform_pd.cc \
platform_services.cc \
platform.cc \
dataspace_component.cc \
rm_session_component.cc \

View File

@ -4,4 +4,5 @@ REQUIRES += x86
SRC_CC += platform_x86.cc
vpath io_port_session_component.cc $(GEN_CORE_DIR)/x86
vpath platform_services.cc $(GEN_CORE_DIR)/x86

View File

@ -6,6 +6,4 @@ REQUIRES += arm foc_panda
SRC_CC += arm/platform_arm.cc
INC_DIR += $(REP_DIR)/src/core/include/arm
vpath io_port_session_component.cc $(GEN_CORE_DIR)/arm
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@ -6,5 +6,5 @@ INC_DIR += $(REP_DIR)/src/core/include/arm
LD_TEXT_ADDR = 0x70490000
vpath io_port_session_component.cc $(GEN_CORE_DIR)/arm
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@ -6,56 +6,56 @@ LD_TEXT_ADDR = 0x500000
GEN_CORE_DIR = $(BASE_DIR)/src/core
SRC_CC = main.cc \
multiboot_info.cc \
ram_session_component.cc \
ram_session_support.cc \
rom_session_component.cc \
SRC_CC = cap_map.cc \
cap_session_component.cc \
context_area.cc \
cpu_session_component.cc \
pd_session_component.cc \
cpu_session_extension.cc \
dataspace_component.cc \
dump_alloc.cc \
io_mem_session_component.cc \
io_mem_session_support.cc \
thread.cc \
thread_bootstrap.cc \
thread_start.cc \
platform_thread.cc \
platform_pd.cc \
irq_session_component.cc \
main.cc \
multiboot_info.cc \
pd_session_component.cc \
pd_session_extension.cc \
platform.cc \
dataspace_component.cc \
platform_pd.cc \
platform_services.cc \
platform_thread.cc \
ram_session_component.cc \
ram_session_support.cc \
rm_session_component.cc \
rm_session_support.cc \
io_port_session_component.cc \
irq_session_component.cc \
rom_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \
dump_alloc.cc \
context_area.cc \
cap_map.cc \
cap_session_component.cc \
cpu_session_extension.cc \
pd_session_extension.cc \
spin_lock.cc
spin_lock.cc \
thread.cc \
thread_bootstrap.cc \
thread_start.cc
INC_DIR += $(REP_DIR)/src/core/include \
$(GEN_CORE_DIR)/include \
$(REP_DIR)/src/base/lock \
$(BASE_DIR)/src/base/lock
vpath main.cc $(GEN_CORE_DIR)
vpath multiboot_info.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath context_area.cc $(GEN_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath dump_alloc.cc $(GEN_CORE_DIR)
vpath context_area.cc $(GEN_CORE_DIR)
vpath thread.cc $(REP_DIR)/src/base/thread
vpath thread_bootstrap.cc $(REP_DIR)/src/base/thread
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath main.cc $(GEN_CORE_DIR)
vpath multiboot_info.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath cap_map.cc $(REP_DIR)/src/base/env
vpath spin_lock.cc $(REP_DIR)/src/base/env
vpath thread.cc $(REP_DIR)/src/base/thread
vpath thread_bootstrap.cc $(REP_DIR)/src/base/thread
vpath %.cc $(REP_DIR)/src/core

View File

@ -6,5 +6,5 @@ INC_DIR += $(REP_DIR)/src/core/include/arm
LD_TEXT_ADDR = 0x60490000
vpath io_port_session_component.cc $(GEN_CORE_DIR)/arm
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@ -1,8 +1,10 @@
include $(PRG_DIR)/../target.inc
REQUIRES += x86
SRC_CC += x86/platform_x86.cc
SRC_CC += io_port_session_component.cc \
x86/platform_x86.cc
INC_DIR += $(REP_DIR)/src/core/include/x86
vpath io_port_session_component.cc $(GEN_CORE_DIR)/x86
vpath platform_services.cc $(GEN_CORE_DIR)/x86

View File

@ -1,58 +0,0 @@
/*
* \brief Implementation of the IO_PORT session interface
* \author Norman Feske
* \date 2009-10-02
*/
/*
* Copyright (C) 2009-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 "io_port_session_component.h"
using namespace Genode;
/**************
** Port API **
**************/
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)
{ }
/******************************
** Constructor / destructor **
******************************/
Io_port_session_component::Io_port_session_component(Range_allocator *io_port_alloc,
const char *args)
: _io_port_alloc(io_port_alloc)
{ }
Io_port_session_component::~Io_port_session_component()
{ }

View File

@ -20,6 +20,7 @@ SRC_CC = \
platform_thread.cc \
platform_pd.cc \
platform.cc \
platform_services.cc \
dataspace_component.cc \
rm_session_component.cc \
rm_session_support.cc \
@ -44,6 +45,7 @@ vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath signal_source_component.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath platform_serices.cc $(GEN_CORE_DIR)
vpath %.cc $(REP_DIR)/src/core
vpath thread_bootstrap.cc $(BASE_DIR)/src/base/thread
vpath thread.cc $(BASE_DIR)/src/base/thread

View File

@ -1,85 +0,0 @@
/*
* \brief Implementation of the IO_PORT session interface
* \author Martin Stein
* \date 2012-02-12
*/
/*
* Copyright (C) 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.
*/
/* Genode includes */
#include <kernel/log.h>
/* core includes */
#include <io_port_session_component.h>
using namespace Genode;
unsigned char Io_port_session_component::inb(unsigned short address)
{
kernel_log() << __PRETTY_FUNCTION__ << ": Not implemented\n";
while (1) ;
return 0;
}
unsigned short Io_port_session_component::inw(unsigned short address)
{
kernel_log() << __PRETTY_FUNCTION__ << ": Not implemented\n";
while (1) ;
return 0;
}
unsigned Io_port_session_component::inl(unsigned short address)
{
kernel_log() << __PRETTY_FUNCTION__ << ": Not implemented\n";
while (1) ;
return 0;
}
void Io_port_session_component::outb(unsigned short address,
unsigned char value)
{
kernel_log() << __PRETTY_FUNCTION__ << ": Not implemented\n";
while (1) ;
}
void Io_port_session_component::outw(unsigned short address,
unsigned short value)
{
kernel_log() << __PRETTY_FUNCTION__ << ": Not implemented\n";
while (1) ;
}
void Io_port_session_component::outl(unsigned short address, unsigned value)
{
kernel_log() << __PRETTY_FUNCTION__ << ": Not implemented\n";
while (1) ;
}
Io_port_session_component::
Io_port_session_component(Range_allocator * io_port_alloc,
const char * args)
: _io_port_alloc(io_port_alloc)
{
kernel_log() << __PRETTY_FUNCTION__ << ": Not implemented\n";
while (1) ;
}
Io_port_session_component::~Io_port_session_component()
{
kernel_log() << __PRETTY_FUNCTION__ << ": Not implemented\n";
while (1) ;
}

View File

@ -22,27 +22,40 @@ INC_DIR += $(REP_DIR)/src/core/include $(REP_DIR)/include \
$(BASE_DIR)/include
# add C++ sources
SRC_CC += main.cc _main.cc ram_session_component.cc \
ram_session_support.cc rom_session_component.cc \
pd_session_component.cc io_mem_session_component.cc \
io_mem_session_support.cc thread.cc platform_pd.cc platform.cc \
platform_thread.cc dataspace_component.cc rm_session_component.cc \
io_port_session_component.cc \
irq_session_component.cc signal_session_component.cc \
dump_alloc.cc cpu_session_component.cc \
cpu_session_support.cc console.cc
SRC_CC += _main.cc \
console.cc \
cpu_session_component.cc \
cpu_session_support.cc \
dataspace_component.cc \
dump_alloc.cc \
io_mem_session_component.cc \
io_mem_session_support.cc \
irq_session_component.cc \
main.cc \
pd_session_component.cc \
platform.cc \
platform_pd.cc \
platform_thread.cc \
platform_services.cc \
ram_session_component.cc \
ram_session_support.cc \
rm_session_component.cc \
rom_session_component.cc \
signal_session_component.cc \
thread.cc
# declare file locations
vpath _main.cc $(BASE_DIR)/src/platform
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath main.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath platform_services.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath dump_alloc.cc $(GEN_CORE_DIR)
vpath console.cc $(REP_DIR)/src/base
vpath % $(REP_DIR)/src/core

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

View File

@ -1,41 +0,0 @@
/*
* \brief Implementation of the IO_PORT session interface
* \author Martin Stein
* \date 2010-09-09
*/
/*
* Copyright (C) 2010-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 "io_port_session_component.h"
using namespace Genode;
/**************
** Port API **
**************/
unsigned char Io_port_session_component::inb(unsigned short) { return 0; }
unsigned short Io_port_session_component::inw(unsigned short) { return 0; }
unsigned Io_port_session_component::inl(unsigned short) { return 0; }
void Io_port_session_component::outb(unsigned short, unsigned char) { }
void Io_port_session_component::outw(unsigned short, unsigned short) { }
void Io_port_session_component::outl(unsigned short, unsigned) { }
/******************************
** Constructor / destructor **
******************************/
Io_port_session_component::Io_port_session_component(Range_allocator *io_port_alloc,
const char *args)
: _io_port_alloc(io_port_alloc) { }
Io_port_session_component::~Io_port_session_component() { }

View File

@ -4,49 +4,50 @@ SPEC_BASE_DIR = $(REP_DIR)/src/base
SRC_CC = \
main.cc \
ram_session_component.cc \
ram_session_support.cc \
rom_session_component.cc \
context_area.cc
core_rm_session.cc \
cpu_session_component.cc \
pd_session_component.cc \
dataspace_component.cc \
dump_alloc.cc \
io_mem_session_component.cc \
io_mem_session_support.cc \
thread.cc \
thread_roottask.cc \
thread_bootstrap.cc \
platform_thread.cc \
irq_session_component.cc \
main.cc \
pd_session_component.cc \
platform.cc \
dataspace_component.cc \
platform_services.cc \
platform_thread.cc \
ram_session_component.cc \
ram_session_support.cc \
rm_session_component.cc \
rm_session_support.cc \
io_port_session_component.cc \
irq_session_component.cc \
rom_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \
core_rm_session.cc \
dump_alloc.cc \
context_area.cc
thread.cc \
thread_bootstrap.cc \
thread_roottask.cc \
INC_DIR = $(SPEC_CORE_DIR)/include \
$(GEN_CORE_DIR)/include
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath context_area.cc $(SPEC_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(SPEC_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath signal_source_component.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath dump_alloc.cc $(GEN_CORE_DIR)
vpath context_area.cc $(SPEC_CORE_DIR)
vpath platform.cc $(GEN_CORE_DIR)
vpath platform_thread.cc $(GEN_CORE_DIR)
vpath thread_roottask.cc $(GEN_CORE_DIR)
vpath thread_bootstrap.cc $(SPEC_BASE_DIR)/thread
vpath thread.cc $(SPEC_BASE_DIR)/thread
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(SPEC_CORE_DIR)
vpath irq_session_component.cc $(SPEC_CORE_DIR)
vpath main.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath platform.cc $(GEN_CORE_DIR)
vpath platform_services.cc $(GEN_CORE_DIR)
vpath platform_thread.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath signal_source_component.cc $(GEN_CORE_DIR)
vpath thread.cc $(SPEC_BASE_DIR)/thread
vpath thread_bootstrap.cc $(SPEC_BASE_DIR)/thread
vpath thread_roottask.cc $(GEN_CORE_DIR)

View File

@ -19,6 +19,7 @@ SRC_CC = \
platform_thread.cc \
platform_pd.cc \
platform.cc \
platform_services.cc \
core_mem_alloc.cc \
dataspace_component.cc \
rm_session_component.cc \
@ -51,6 +52,7 @@ vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath core_mem_alloc.cc $(GEN_CORE_DIR)
vpath dump_alloc.cc $(GEN_CORE_DIR)
vpath platform_services.cc $(GEN_CORE_DIR)/x86
vpath context_area.cc $(GEN_CORE_DIR)
vpath %.cc $(REP_DIR)/src/core
vpath thread.cc $(BASE_DIR)/src/base/thread

View File

@ -21,10 +21,10 @@ SRC_CC = main.cc \
platform_thread.cc \
platform_pd.cc \
platform.cc \
platform_services.cc \
dataspace_component.cc \
rm_session_component.cc \
rm_session_support.cc \
io_port_session_component.cc \
irq_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \

View File

@ -0,0 +1,31 @@
/*
* \brief x86-specific platform definitions
* \author Stefan Kalkowski
* \date 2012-10-02
*/
/*
* Copyright (C) 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.
*/
/* Genode includes */
#include <base/service.h>
/* core includes */
#include <platform.h>
#include <core_env.h>
#include <io_port_root.h>
using namespace Genode;
void Platform::add_local_services(Rpc_entrypoint *e, Sliced_heap *sliced_heap,
Core_env *env, Service_registry *local_services)
{
/* add x86 specific ioport service */
static Io_port_root io_port_root(env->cap_session(), io_port_alloc(), sliced_heap);
static Local_service io_port_ls(Io_port_session::service_name(), &io_port_root);
local_services->insert(&io_port_ls);
}

View File

@ -2,7 +2,9 @@ include $(PRG_DIR)/../target.inc
REQUIRES += x86
SRC_CC += platform_thread_x86.cc
SRC_CC += io_port_session_component.cc \
platform_thread_x86.cc
vpath io_port_session_component.cc $(GEN_CORE_DIR)/x86
vpath platform_thread_x86.cc $(GEN_CORE_DIR)/x86
vpath platform_services.cc $(GEN_CORE_DIR)/x86
vpath platform_thread_x86.cc $(GEN_CORE_DIR)/x86

View File

@ -21,10 +21,10 @@ SRC_CC = main.cc \
platform_thread.cc \
platform_pd.cc \
platform.cc \
platform_services.cc \
dataspace_component.cc \
rm_session_component.cc \
rm_session_support.cc \
io_port_session_component.cc \
irq_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \

View File

@ -1,7 +1,9 @@
include $(PRG_DIR)/../target.inc
REQUIRES += x86
SRC_CC += platform_x86.cc
SRC_CC += io_port_session_component.cc \
platform_x86.cc
vpath io_port_session_component.cc $(GEN_CORE_DIR)/x86
vpath platform_services.cc $(GEN_CORE_DIR)/x86

View File

@ -1,63 +0,0 @@
/*
* \brief Dummy implementation of the IO_PORT session interface
* \author Norman Feske
* \date 2007-09-27
*
* On ARM, port I/O does not exist.
*/
/*
* 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 <util/string.h>
//#include <util/arg_string.h>
#include "io_port_session_component.h"
using namespace Genode;
/**************
** Port API **
**************/
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)
{ }
/******************************
** Constructor / destructor **
******************************/
Io_port_session_component::Io_port_session_component(Range_allocator *io_port_alloc,
const char *args)
: _io_port_alloc(io_port_alloc)
{ }
Io_port_session_component::~Io_port_session_component()
{ }

View File

@ -0,0 +1,37 @@
/*
* \brief Platform-specific services
* \author Stefan Kalkowski
* \date 2012-10-26
*/
/*
* Copyright (C) 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.
*/
#ifndef _CORE__INCLUDE__PLATFORM_SERVICES_H_
#define _CORE__INCLUDE__PLATFORM_SERVICES_H_
namespace Genode {
class Rpc_entrypoint;
class Sliced_heap;
class Service_registry;
/**
* Register platform-specific services at entrypoint, and service
* registry
*
* \param ep entrypoint used for session components of platform-services
* \param md metadata allocator for session components
* \param reg registry where to add platform-specific services
*/
void platform_add_local_services(Rpc_entrypoint *ep,
Sliced_heap *md,
Service_registry *reg);
}
#endif /* _CORE__INCLUDE__PLATFORM_SERVICES_H_ */

View File

@ -30,9 +30,9 @@
#include <pd_root.h>
#include <log_root.h>
#include <io_mem_root.h>
#include <io_port_root.h>
#include <irq_root.h>
#include <signal_root.h>
#include <platform_services.h>
using namespace Genode;
@ -173,7 +173,6 @@ int main()
static Log_root log_root (e, &sliced_heap);
static Io_mem_root io_mem_root (e, e, platform()->io_mem_alloc(),
platform()->ram_alloc(), &sliced_heap);
static Io_port_root io_port_root (core_env()->cap_session(), platform()->io_port_alloc(), &sliced_heap);
static Irq_root irq_root (core_env()->cap_session(),
platform()->irq_alloc(), &sliced_heap);
static Signal_root signal_root (&sliced_heap, core_env()->cap_session());
@ -191,7 +190,6 @@ int main()
Local_service(Pd_session::service_name(), &pd_root),
Local_service(Log_session::service_name(), &log_root),
Local_service(Io_mem_session::service_name(), &io_mem_root),
Local_service(Io_port_session::service_name(), &io_port_root),
Local_service(Irq_session::service_name(), &irq_root),
Local_service(Signal_session::service_name(), &signal_root)
};
@ -200,6 +198,9 @@ int main()
for (unsigned i = 0; i < sizeof(ls) / sizeof(Local_service); i++)
local_services.insert(&ls[i]);
/* make platform-specific services known to service pool */
platform_add_local_services(e, &sliced_heap, &local_services);
PDBG("--- start init ---");
/* obtain ROM session with init binary */

View File

@ -0,0 +1,19 @@
/*
* \brief Dummy implemntation of platform-specific services
* \author Stefan Kalkowski
* \date 2012-10-26
*/
/*
* Copyright (C) 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.
*/
/* core includes */
#include <platform_services.h>
void Genode::platform_add_local_services(Rpc_entrypoint*, Sliced_heap*,
Service_registry*) { }

View File

@ -0,0 +1,36 @@
/*
* \brief Platform specific services for x86
* \author Stefan Kalkowski
* \date 2012-10-26
*/
/*
* Copyright (C) 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.
*/
/* Genode includes */
#include <base/service.h>
/* core includes */
#include <core_env.h>
#include <platform.h>
#include <platform_services.h>
#include <io_port_root.h>
/*
* Add x86 specific ioport service
*/
void Genode::platform_add_local_services(Rpc_entrypoint*,
Sliced_heap *sliced_heap,
Service_registry *local_services)
{
static Io_port_root io_port_root(core_env()->cap_session(),
platform()->io_port_alloc(), sliced_heap);
static Local_service io_port_ls(Io_port_session::service_name(),
&io_port_root);
local_services->insert(&io_port_ls);
}