hw_x86_64: use 'muen' SPEC to implement aspect
This commit is contained in:
parent
750c4ad81d
commit
9f1beaa036
|
@ -0,0 +1,10 @@
|
|||
#
|
||||
# \brief Build config for parts of core that depend on Muen status
|
||||
# \author Stefan Kalkowski
|
||||
# \date 2015-06-02
|
||||
#
|
||||
|
||||
REQUIRES = x86_64
|
||||
|
||||
# add library dependencies
|
||||
LIBS += core-muen_off
|
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# \brief Build config for parts of core that depend on Muen status
|
||||
# \author Stefan Kalkowski
|
||||
# \date 2015-06-02
|
||||
#
|
||||
|
||||
# add library dependencies
|
||||
LIBS += core-muen_on
|
|
@ -10,8 +10,6 @@ INC_DIR += $(REP_DIR)/src/core/include/spec/x86
|
|||
|
||||
# add C++ sources
|
||||
SRC_CC += spec/x86/platform_support.cc
|
||||
SRC_CC += spec/x86/kernel/thread.cc
|
||||
SRC_CC += spec/x86/kernel/cpu.cc
|
||||
SRC_CC += spec/x86/kernel/pd.cc
|
||||
SRC_CC += spec/x86/cpu.cc
|
||||
SRC_CC += spec/x86/bios_data_area.cc
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#
|
||||
# \brief Build config for Genodes core process
|
||||
# \author Stefan Kalkowski
|
||||
# \date 2015-06-02
|
||||
#
|
||||
|
||||
# add assembly sources
|
||||
SRC_S += spec/x86_64/kernel/crt0_translation_table.s
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += spec/x86/kernel/thread.cc
|
||||
SRC_CC += spec/x86/kernel/cpu.cc
|
||||
SRC_CC += spec/x86/pic.cc
|
||||
SRC_CC += spec/x86_64/platform_support.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/x86_64/core.inc
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# \brief Build config for Genodes core process
|
||||
# \author Stefan Kalkowski
|
||||
# \date 2015-06-02
|
||||
#
|
||||
|
||||
# add include paths
|
||||
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64/muen
|
||||
|
||||
# add assembly sources
|
||||
SRC_S += spec/x86_64/muen/kernel/crt0_translation_table.s
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += spec/x86_64/muen/kernel/thread.cc
|
||||
SRC_CC += spec/x86_64/muen/kernel/cpu.cc
|
||||
SRC_CC += spec/x86_64/muen/platform_support.cc
|
||||
SRC_CC += spec/x86_64/muen/sinfo.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/x86_64/core.inc
|
|
@ -0,0 +1,22 @@
|
|||
#
|
||||
# \brief Build config for Genodes core process
|
||||
# \author Stefan Kalkowski
|
||||
# \author Martin Stein
|
||||
# \date 2012-10-04
|
||||
#
|
||||
|
||||
# add include paths
|
||||
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64
|
||||
|
||||
# add assembly sources
|
||||
SRC_S += spec/x86_64/mode_transition.s
|
||||
SRC_S += spec/x86_64/kernel/crt0.s
|
||||
SRC_S += spec/x86_64/crt0.s
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += spec/x86_64/kernel/thread_base.cc
|
||||
SRC_CC += spec/x86_64/idt.cc
|
||||
SRC_CC += spec/x86_64/tss.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/x86/core.inc
|
|
@ -1,25 +1,7 @@
|
|||
#
|
||||
# \brief Build config for Genodes core process
|
||||
# \author Stefan Kalkowski
|
||||
# \author Martin Stein
|
||||
# \date 2012-10-04
|
||||
# \date 2015-06-02
|
||||
#
|
||||
|
||||
# add include paths
|
||||
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64
|
||||
|
||||
# add assembly sources
|
||||
SRC_S += spec/x86_64/mode_transition.s
|
||||
SRC_S += spec/x86_64/kernel/crt0.s
|
||||
SRC_S += spec/x86_64/kernel/crt0_translation_table.s
|
||||
SRC_S += spec/x86_64/crt0.s
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += spec/x86/pic.cc
|
||||
SRC_CC += spec/x86_64/kernel/thread_base.cc
|
||||
SRC_CC += spec/x86_64/platform_support.cc
|
||||
SRC_CC += spec/x86_64/idt.cc
|
||||
SRC_CC += spec/x86_64/tss.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/x86/core.inc
|
||||
LIBS += core-muen
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
include $(REP_DIR)/lib/mk/base-common.inc
|
||||
|
||||
vpath kernel/interface.cc $(REP_DIR)/src/base/x86_64
|
|
@ -1,35 +0,0 @@
|
|||
#
|
||||
# \brief Build config for Genodes core process
|
||||
# \author Stefan Kalkowski
|
||||
# \author Martin Stein
|
||||
# \date 2012-10-04
|
||||
#
|
||||
|
||||
# add include paths
|
||||
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64_muen
|
||||
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64
|
||||
INC_DIR += $(REP_DIR)/src/core/include/spec/x86
|
||||
|
||||
# add assembly sources
|
||||
SRC_S += spec/x86_64/mode_transition.s
|
||||
SRC_S += spec/x86_64/kernel/crt0.s
|
||||
SRC_S += spec/x86_64_muen/kernel/crt0_translation_table.s
|
||||
SRC_S += spec/x86_64/crt0.s
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += spec/x86_64_muen/platform_support.cc
|
||||
SRC_CC += spec/x86_64_muen/sinfo.cc
|
||||
SRC_CC += spec/x86_64_muen/kernel/thread.cc
|
||||
SRC_CC += spec/x86_64_muen/kernel/cpu.cc
|
||||
SRC_CC += spec/x86_64/kernel/thread_base.cc
|
||||
SRC_CC += spec/x86_64/idt.cc
|
||||
SRC_CC += spec/x86_64/tss.cc
|
||||
SRC_CC += spec/x86/platform_support.cc
|
||||
SRC_CC += spec/x86/kernel/pd.cc
|
||||
SRC_CC += spec/x86/cpu.cc
|
||||
SRC_CC += x86/io_port_session_component.cc
|
||||
SRC_CC += x86/platform_services.cc
|
||||
SRC_CC += kernel/vm_thread.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/core.inc
|
|
@ -1,19 +1,11 @@
|
|||
#
|
||||
# \brief Build configs that are specific to base-hw/x86_64 on the Muen SK
|
||||
# \author Martin Stein
|
||||
# \date 2011-12-20
|
||||
# \author Reto Buerki
|
||||
# \date 2015-04-14
|
||||
#
|
||||
|
||||
# denote wich specs are also fullfilled by this spec
|
||||
SPECS += hw x86_64_muen
|
||||
SPECS += pci ps2 vesa framebuffer
|
||||
|
||||
# configure multiprocessor mode
|
||||
NR_OF_CPUS = 1
|
||||
|
||||
# set address where to link text segment at
|
||||
LD_TEXT_ADDR ?= 0x200000
|
||||
SPECS += hw_x86_64 muen
|
||||
|
||||
# include implied specs
|
||||
include $(call select_from_repositories,mk/spec-hw.mk)
|
||||
include $(call select_from_repositories,mk/spec-x86_64.mk)
|
||||
include $(call select_from_repositories,mk/spec-hw_x86_64.mk)
|
||||
|
|
|
@ -30,13 +30,14 @@ Cpu_idle::Cpu_idle(Cpu * const cpu) : Cpu_job(Cpu_priority::MIN, 0)
|
|||
|
||||
void Cpu_idle::exception(unsigned const cpu)
|
||||
{
|
||||
if (trapno == RESET) {
|
||||
return;
|
||||
} else if (trapno >= INTERRUPTS_START && trapno <= INTERRUPTS_END) {
|
||||
if (trapno == RESET) return;
|
||||
|
||||
if (trapno >= INTERRUPTS_START && trapno <= INTERRUPTS_END) {
|
||||
pic()->irq_occurred(trapno);
|
||||
_interrupt(cpu);
|
||||
return;
|
||||
}
|
||||
|
||||
PWRN("Unknown exception %lu with error code %lu at ip=%p", trapno,
|
||||
errcode, (void *)ip);
|
||||
assert(0);
|
|
@ -24,6 +24,7 @@ enum {
|
|||
static const subject_info_type *
|
||||
const sinfo = ((subject_info_type *)SINFO_BASE_ADDR);
|
||||
|
||||
|
||||
/* Log channel information */
|
||||
static bool log_channel(
|
||||
const struct Genode::Sinfo::Channel_info * const channel,
|
||||
|
@ -45,6 +46,7 @@ static bool log_channel(
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Log memory region information */
|
||||
static bool log_memregion(
|
||||
const struct Genode::Sinfo::Memregion_info * const region,
|
||||
|
@ -57,9 +59,9 @@ static bool log_memregion(
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Fill channel struct with channel information from resource given by index */
|
||||
static void fill_channel_data(
|
||||
uint8_t idx,
|
||||
static void fill_channel_data(uint8_t idx,
|
||||
struct Genode::Sinfo::Channel_info *channel)
|
||||
{
|
||||
const struct resource_type resource = sinfo->resources[idx];
|
||||
|
@ -81,9 +83,9 @@ static void fill_channel_data(
|
|||
channel->vector = channel_info.vector;
|
||||
}
|
||||
|
||||
|
||||
/* Fill memregion struct with memory region info from resource given by index */
|
||||
static void fill_memregion_data(
|
||||
uint8_t idx,
|
||||
static void fill_memregion_data(uint8_t idx,
|
||||
struct Genode::Sinfo::Memregion_info *region)
|
||||
{
|
||||
const struct resource_type resource = sinfo->resources[idx];
|
||||
|
@ -99,18 +101,21 @@ static void fill_memregion_data(
|
|||
region->executable = memregion.flags & MEM_EXECUTABLE_FLAG;
|
||||
}
|
||||
|
||||
|
||||
/* Returns true if the given resource is a memory region */
|
||||
static bool is_memregion(const struct resource_type * const resource)
|
||||
{
|
||||
return resource->memregion_idx != NO_RESOURCE;
|
||||
}
|
||||
|
||||
|
||||
/* Returns true if the given resource is a channel */
|
||||
static bool is_channel(const struct resource_type * const resource)
|
||||
{
|
||||
return is_memregion(resource) && resource->channel_info_idx != NO_RESOURCE;
|
||||
}
|
||||
|
||||
|
||||
Sinfo::Sinfo()
|
||||
{
|
||||
if (!check_magic()) {
|
||||
|
@ -126,11 +131,13 @@ Sinfo::Sinfo()
|
|||
for_each_channel(log_channel, 0);
|
||||
}
|
||||
|
||||
|
||||
bool Sinfo::check_magic(void)
|
||||
{
|
||||
return sinfo != 0 && sinfo->magic == MUEN_SUBJECT_INFO_MAGIC;
|
||||
}
|
||||
|
||||
|
||||
bool Sinfo::get_channel_info(const char * const name,
|
||||
struct Channel_info *channel)
|
||||
{
|
||||
|
@ -149,6 +156,7 @@ bool Sinfo::get_channel_info(const char * const name,
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Sinfo::get_memregion_info(const char * const name,
|
||||
struct Memregion_info *memregion)
|
||||
{
|
||||
|
@ -167,6 +175,7 @@ bool Sinfo::get_memregion_info(const char * const name,
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Sinfo::for_each_channel(Channel_cb func, void *data)
|
||||
{
|
||||
int i;
|
||||
|
@ -185,6 +194,7 @@ bool Sinfo::for_each_channel(Channel_cb func, void *data)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Sinfo::for_each_memregion(Memregion_cb func, void *data)
|
||||
{
|
||||
int i;
|
||||
|
@ -203,6 +213,7 @@ bool Sinfo::for_each_memregion(Memregion_cb func, void *data)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
uint64_t Sinfo::get_tsc_khz(void)
|
||||
{
|
||||
if (!check_magic())
|
||||
|
@ -211,6 +222,7 @@ uint64_t Sinfo::get_tsc_khz(void)
|
|||
return sinfo->tsc_khz;
|
||||
}
|
||||
|
||||
|
||||
uint64_t Sinfo::get_sched_start(void)
|
||||
{
|
||||
if (!check_magic())
|
||||
|
@ -219,6 +231,7 @@ uint64_t Sinfo::get_sched_start(void)
|
|||
return sinfo->tsc_schedule_start;
|
||||
}
|
||||
|
||||
|
||||
uint64_t Sinfo::get_sched_end(void)
|
||||
{
|
||||
if (!check_magic())
|
|
@ -146,13 +146,13 @@ proc run_boot_dir {binaries} {
|
|||
set elf_img "[run_dir]/image.elf"
|
||||
|
||||
# Use raw binary object for base-hw on Muen
|
||||
if {[have_spec "hw_x86_64_muen"]} {
|
||||
if {[have_spec "muen"]} {
|
||||
set raw_img "[run_dir]/image.raw"
|
||||
exec [cross_dev_prefix]objcopy -O binary bin/$core_bin $raw_img
|
||||
exit 0
|
||||
}
|
||||
|
||||
if {[have_spec "x86_64"]} {
|
||||
if {[have_spec "x86_64"] && ![have_spec "muen"]} {
|
||||
# as startup is done in 32 bit mode, GRUB expects a 32 bit image
|
||||
exec [cross_dev_prefix]objcopy -O elf32-i386 bin/$core_bin $elf_img
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue