mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-06 01:11:46 +00:00
Switch to Seoul VMM repository instead of NUL
In this version of the transition the Hip structure from Genode is reused, @nfeskes seoul_libc_support is used for the string functions and the nul/config.h is replaced by just using a constant value in the one place where the file was needed. Related to #666.
This commit is contained in:
parent
9d0a377efe
commit
b8eb9b534d
53
ports/ports/seoul.mk
Normal file
53
ports/ports/seoul.mk
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
SEOUL_REV = 6ee3f454c66fa9fb427ff161ced3fccf6462311a
|
||||||
|
SEOUL = seoul-git
|
||||||
|
SEOUL_URL = https://github.com/alex-ab/seoul.git
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for tools
|
||||||
|
#
|
||||||
|
$(call check_tool,git)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Interface to top-level prepare Makefile
|
||||||
|
#
|
||||||
|
PORTS += $(SEOUL)
|
||||||
|
|
||||||
|
#
|
||||||
|
# We need to execute some python scripts for preparing the i82576vf
|
||||||
|
# device model.
|
||||||
|
#
|
||||||
|
PYTHON2 := $(notdir $(lastword $(shell which python2 python2.{4,5,6,7,8})))
|
||||||
|
ifeq ($(PYTHON2),)
|
||||||
|
prepare: python_not_installed
|
||||||
|
python_not_installed:
|
||||||
|
$(ECHO) "Error: Seoul needs Python 2 to be installed"
|
||||||
|
@false;
|
||||||
|
endif
|
||||||
|
|
||||||
|
prepare:: $(CONTRIB_DIR)/$(SEOUL)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Port-specific local rules
|
||||||
|
#
|
||||||
|
$(DOWNLOAD_DIR)/$(SEOUL)/.git:
|
||||||
|
$(VERBOSE)git clone $(SEOUL_URL) $(DOWNLOAD_DIR)/$(SEOUL) && \
|
||||||
|
cd download/seoul-git && \
|
||||||
|
git reset --hard $(SEOUL_REV) && \
|
||||||
|
cd ../.. && touch $@
|
||||||
|
|
||||||
|
I82576VF_DIR = $(CONTRIB_DIR)/$(SEOUL)/model/intel82576vf
|
||||||
|
EXECUTOR_DIR = $(CONTRIB_DIR)/$(SEOUL)/executor
|
||||||
|
|
||||||
|
$(CONTRIB_DIR)/$(SEOUL)/.git: $(DOWNLOAD_DIR)/$(SEOUL)/.git
|
||||||
|
$(VERBOSE)git clone $(DOWNLOAD_DIR)/$(SEOUL) $(CONTRIB_DIR)/$(SEOUL)
|
||||||
|
@# fix python version in code generator scripts
|
||||||
|
$(VERBOSE)sed -i "s/env python2/env $(PYTHON2)/" $(I82576VF_DIR)/genreg.py
|
||||||
|
@# call code generators
|
||||||
|
$(VERBOSE)cd $(EXECUTOR_DIR); \
|
||||||
|
./build_instructions.py > instructions.inc
|
||||||
|
$(VERBOSE)cd $(I82576VF_DIR); \
|
||||||
|
./genreg.py reg_pci.py ../../include/model/intel82576vfpci.inc
|
||||||
|
$(VERBOSE)cd $(I82576VF_DIR); \
|
||||||
|
./genreg.py reg_mmio.py ../../include/model/intel82576vfmmio.inc
|
||||||
|
|
||||||
|
$(CONTRIB_DIR)/$(SEOUL): $(CONTRIB_DIR)/$(SEOUL)/.git
|
@ -43,11 +43,11 @@ Device_model_info::Device_model_info(char const *name, Create create,
|
|||||||
* Helper macro to create global 'Device_model_info' objects
|
* Helper macro to create global 'Device_model_info' objects
|
||||||
*/
|
*/
|
||||||
#define MODEL_INFO(name, ...) \
|
#define MODEL_INFO(name, ...) \
|
||||||
extern "C" void __parameter_##name##_function(Motherboard &, unsigned long *, \
|
extern "C" void __parameter_##name##_fn(Motherboard &, unsigned long *, \
|
||||||
const char *, unsigned); \
|
const char *, unsigned); \
|
||||||
static char const * name##_arg_names[] = { __VA_ARGS__ , 0 }; \
|
static char const * name##_arg_names[] = { __VA_ARGS__ , 0 }; \
|
||||||
static Device_model_info \
|
static Device_model_info \
|
||||||
name##_model_info(#name, __parameter_##name##_function, name##_arg_names);
|
name##_model_info(#name, __parameter_##name##_fn, name##_arg_names);
|
||||||
|
|
||||||
#define MODEL_INFO_NO_ARG(name) MODEL_INFO(name, 0)
|
#define MODEL_INFO_NO_ARG(name) MODEL_INFO(name, 0)
|
||||||
|
|
||||||
@ -80,8 +80,9 @@ MODEL_INFO(vga, "io_base", "fb_size")
|
|||||||
MODEL_INFO(pmtimer, "io_port")
|
MODEL_INFO(pmtimer, "io_port")
|
||||||
|
|
||||||
MODEL_INFO(pcihostbridge, "bus_num", "bus_count", "io_base", "mem_base")
|
MODEL_INFO(pcihostbridge, "bus_num", "bus_count", "io_base", "mem_base")
|
||||||
|
#ifndef __x86_64__
|
||||||
MODEL_INFO(i82576vf, "promisc", "mem_mmio", "mem_msix", "txpoll_us", "rx_map")
|
MODEL_INFO(intel82576vf, "promisc", "mem_mmio", "mem_msix", "txpoll_us", "rx_map")
|
||||||
|
#endif
|
||||||
MODEL_INFO(ahci, "mem", "irq", "bdf")
|
MODEL_INFO(ahci, "mem", "irq", "bdf")
|
||||||
MODEL_INFO(drive, "sigma0drive", "controller", "port")
|
MODEL_INFO(drive, "sigma0drive", "controller", "port")
|
||||||
|
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
/* NOVA userland includes */
|
/* NOVA userland includes */
|
||||||
#include <nul/vcpu.h>
|
#include <nul/vcpu.h>
|
||||||
#include <nul/motherboard.h>
|
#include <nul/motherboard.h>
|
||||||
#include <nul/service_timer.h>
|
|
||||||
#include <sys/hip.h>
|
#include <sys/hip.h>
|
||||||
|
|
||||||
/* local includes */
|
/* local includes */
|
||||||
@ -1094,7 +1093,7 @@ class Machine : public StaticReceiver<Machine>
|
|||||||
Vcpu_dispatcher *vcpu_dispatcher =
|
Vcpu_dispatcher *vcpu_dispatcher =
|
||||||
new Vcpu_dispatcher(msg.vcpu, _guest_memory,
|
new Vcpu_dispatcher(msg.vcpu, _guest_memory,
|
||||||
_motherboard,
|
_motherboard,
|
||||||
_hip->has_svm(), _hip->has_vmx());
|
_hip->has_feature_svm(), _hip->has_feature_vmx());
|
||||||
|
|
||||||
msg.value = vcpu_dispatcher->sel_sm_ec();
|
msg.value = vcpu_dispatcher->sel_sm_ec();
|
||||||
return true;
|
return true;
|
||||||
@ -1292,7 +1291,7 @@ class Machine : public StaticReceiver<Machine>
|
|||||||
}
|
}
|
||||||
msg.wallclocktime = _rtc->get_current_time();
|
msg.wallclocktime = _rtc->get_current_time();
|
||||||
Logging::printf("Got time %llx\n", msg.wallclocktime);
|
Logging::printf("Got time %llx\n", msg.wallclocktime);
|
||||||
msg.timestamp = _motherboard.clock()->clock(TimerProtocol::WALLCLOCK_FREQUENCY);
|
msg.timestamp = _motherboard.clock()->clock(1000000U);
|
||||||
|
|
||||||
*Genode::Thread_base::myself()->utcb() = utcb_backup;
|
*Genode::Thread_base::myself()->utcb() = utcb_backup;
|
||||||
|
|
||||||
@ -1374,7 +1373,7 @@ class Machine : public StaticReceiver<Machine>
|
|||||||
:
|
:
|
||||||
_hip_rom("hypervisor_info_page"),
|
_hip_rom("hypervisor_info_page"),
|
||||||
_hip(Genode::env()->rm_session()->attach(_hip_rom.dataspace())),
|
_hip(Genode::env()->rm_session()->attach(_hip_rom.dataspace())),
|
||||||
_clock(_hip->freq_tsc*1000),
|
_clock(_hip->tsc_freq*1000),
|
||||||
_motherboard(&_clock, _hip),
|
_motherboard(&_clock, _hip),
|
||||||
_guest_memory(guest_memory),
|
_guest_memory(guest_memory),
|
||||||
_boot_modules(boot_modules)
|
_boot_modules(boot_modules)
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
/* NOVA userland includes */
|
/* NOVA userland includes */
|
||||||
#include <service/logging.h>
|
#include <service/logging.h>
|
||||||
|
#include <service/memory.h>
|
||||||
|
|
||||||
enum { verbose_memory_leak = false };
|
enum { verbose_memory_leak = false };
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ void Logging::printf(const char *format, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Logging::vprintf(const char *format, char *&)
|
void Logging::vprintf(const char *format, va_list &ap)
|
||||||
{
|
{
|
||||||
Genode::Lock::Guard guard(*printf_lock());
|
Genode::Lock::Guard guard(*printf_lock());
|
||||||
|
|
||||||
@ -81,7 +82,7 @@ void Logging::panic(const char *format, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *heap_alloc(unsigned int size)
|
void *heap_alloc(size_t size)
|
||||||
{
|
{
|
||||||
void *res = Genode::env()->heap()->alloc(size);
|
void *res = Genode::env()->heap()->alloc(size);
|
||||||
if (res)
|
if (res)
|
||||||
@ -92,7 +93,7 @@ void *heap_alloc(unsigned int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *operator new[](unsigned int size)
|
void *operator new[](size_t size)
|
||||||
{
|
{
|
||||||
void * addr = heap_alloc(size);
|
void * addr = heap_alloc(size);
|
||||||
if (addr)
|
if (addr)
|
||||||
@ -102,8 +103,9 @@ void *operator new[](unsigned int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *operator new[](unsigned int size, unsigned int align)
|
void *operator new[](size_t size, Aligned const alignment)
|
||||||
{
|
{
|
||||||
|
unsigned int align = alignment.alignment;
|
||||||
void *res = heap_alloc(size + align);
|
void *res = heap_alloc(size + align);
|
||||||
if (res)
|
if (res)
|
||||||
Genode::memset(res, 0, size + align);
|
Genode::memset(res, 0, size + align);
|
||||||
@ -112,7 +114,7 @@ void *operator new[](unsigned int size, unsigned int align)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *operator new (unsigned int size)
|
void *operator new (size_t size)
|
||||||
{
|
{
|
||||||
void * addr = heap_alloc(size);
|
void * addr = heap_alloc(size);
|
||||||
if (addr)
|
if (addr)
|
||||||
@ -140,3 +142,13 @@ void do_exit(char const *msg)
|
|||||||
char __param_table_start;
|
char __param_table_start;
|
||||||
char __param_table_end;
|
char __param_table_end;
|
||||||
|
|
||||||
|
/* parameter support */
|
||||||
|
#include <service/params.h>
|
||||||
|
|
||||||
|
Genode::Fifo<Parameter> &Parameter::all_parameters()
|
||||||
|
{
|
||||||
|
static Genode::Fifo<Parameter> _all_parameters;
|
||||||
|
return _all_parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
// EOF
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
diff --git a/julian/model/82576vf.cc b/julian/model/82576vf.cc
|
|
||||||
index b4d29a5..db8d2f3 100644
|
|
||||||
--- a/julian/model/82576vf.cc
|
|
||||||
+++ b/julian/model/82576vf.cc
|
|
||||||
@@ -950,7 +950,7 @@ public:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
-PARAM_HANDLER(82576vf,
|
|
||||||
+PARAM_HANDLER(i82576vf,
|
|
||||||
"82576vf:[promisc][,mem_mmio][,mem_msix][,txpoll_us][,rx_map] - attach an Intel 82576VF to the PCI bus.",
|
|
||||||
"promisc - if !=0, be always promiscuous (use for Linux VMs that need it for bridging) (Default 1)",
|
|
||||||
"txpoll_us - if !=0, map TX registers to guest and poll them every txpoll_us microseconds. (Default 0)",
|
|
27
ports/src/vancouver/service/memory.h
Normal file
27
ports/src/vancouver/service/memory.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* \brief Memory header expected by Seoul
|
||||||
|
* \author Markus Partheymueller
|
||||||
|
* \date 2013-03-02
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2011-2013 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct Aligned {
|
||||||
|
size_t alignment;
|
||||||
|
Aligned(size_t alignment) : alignment(alignment) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
void *heap_alloc(size_t size);
|
||||||
|
|
||||||
|
void *operator new[](size_t size);
|
||||||
|
|
||||||
|
void *operator new[](size_t size, Aligned const alignment);
|
||||||
|
|
||||||
|
void *operator new (size_t size);
|
||||||
|
|
||||||
|
void operator delete[](void *ptr);
|
@ -1,35 +1,39 @@
|
|||||||
TARGET = vancouver
|
TARGET = vancouver
|
||||||
|
|
||||||
CONTRIB_DIR = $(REP_DIR)/contrib/vancouver-git
|
CONTRIB_DIR = $(REP_DIR)/contrib/seoul-git
|
||||||
VANCOUVER_DIR = $(CONTRIB_DIR)/vancouver
|
VANCOUVER_DIR = $(CONTRIB_DIR)
|
||||||
NOVA_INCLUDE_DIR = $(REP_DIR)/contrib/vancouver-git/base/include
|
GENODE_DIR = $(CONTRIB_DIR)/genode
|
||||||
|
NOVA_INCLUDE_DIR = $(REP_DIR)/contrib/seoul-git/include
|
||||||
|
|
||||||
REQUIRES = nova x86_32
|
REQUIRES = nova
|
||||||
|
|
||||||
ifeq ($(wildcard $(VANCOUVER_DIR)),)
|
ifeq ($(wildcard $(VANCOUVER_DIR)),)
|
||||||
REQUIRES += prepare_ports_vancouver
|
REQUIRES += prepare_ports_vancouver
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBS += base blit alarm
|
LIBS += base blit alarm seoul_libc_support
|
||||||
SRC_CC = main.cc nova_user_env.cc device_model_registry.cc
|
SRC_CC = main.cc nova_user_env.cc device_model_registry.cc
|
||||||
SRC_CC += console.cc keyboard.cc network.cc disk.cc
|
SRC_CC += console.cc keyboard.cc network.cc disk.cc
|
||||||
SRC_BIN = mono.tff
|
SRC_BIN = mono.tff
|
||||||
|
|
||||||
MODEL_SRC_CC += $(notdir $(wildcard $(VANCOUVER_DIR)/model/*.cc))
|
MODEL_SRC_CC += $(notdir $(wildcard $(VANCOUVER_DIR)/model/*.cc))
|
||||||
EXECUTOR_SRC_CC += $(notdir $(wildcard $(VANCOUVER_DIR)/executor/*.cc))
|
EXECUTOR_SRC_CC += $(notdir $(wildcard $(VANCOUVER_DIR)/executor/*.cc))
|
||||||
SERVICE_SRC_CC += hostsink.cc
|
SERVICE_SRC_CC += sink.cc
|
||||||
|
|
||||||
|
ifneq ($(filter x86_64, $(SPECS)),)
|
||||||
|
FILTER_OUT += model/intel82576vf.cc
|
||||||
|
CC_CXX_OPT += -mcmodel=large
|
||||||
|
endif
|
||||||
|
|
||||||
SRC_CC += $(filter-out $(FILTER_OUT),$(addprefix model/,$(MODEL_SRC_CC)))
|
SRC_CC += $(filter-out $(FILTER_OUT),$(addprefix model/,$(MODEL_SRC_CC)))
|
||||||
SRC_CC += $(CONTRIB_DIR)/julian/model/82576vf.cc
|
|
||||||
SRC_CC += $(filter-out $(FILTER_OUT),$(addprefix executor/,$(EXECUTOR_SRC_CC)))
|
SRC_CC += $(filter-out $(FILTER_OUT),$(addprefix executor/,$(EXECUTOR_SRC_CC)))
|
||||||
SRC_CC += base/service/hostsink.cc base/lib/runtime/string.cc
|
SRC_CC += model/sink.cc
|
||||||
|
|
||||||
INC_DIR += $(PRG_DIR)
|
INC_DIR += $(PRG_DIR)
|
||||||
INC_DIR += $(CONTRIB_DIR)/julian/model
|
INC_DIR += $(PRG_DIR)/executor
|
||||||
INC_DIR += $(CONTRIB_DIR)/julian/include
|
|
||||||
INC_DIR += $(VANCOUVER_DIR)/model
|
INC_DIR += $(VANCOUVER_DIR)/model
|
||||||
INC_DIR += $(VANCOUVER_DIR)/executor
|
INC_DIR += $(VANCOUVER_DIR)/executor
|
||||||
INC_DIR += $(VANCOUVER_DIR)/include
|
INC_DIR += $(VANCOUVER_DIR)/include $(GENODE_DIR)/include
|
||||||
INC_DIR += $(NOVA_INCLUDE_DIR)
|
INC_DIR += $(NOVA_INCLUDE_DIR)
|
||||||
|
|
||||||
CC_WARN += -Wno-parentheses
|
CC_WARN += -Wno-parentheses
|
||||||
|
Loading…
x
Reference in New Issue
Block a user