Core includes untangling

Express convoluted include walks directly in code, do not hide them
in build scripts.
This commit is contained in:
Ehmry - 2019-09-26 14:24:28 +02:00
parent a83ffd4821
commit 6e9f9ce3a8
120 changed files with 732 additions and 152 deletions

View File

@ -17,7 +17,7 @@
#include <base/internal/raw_write_string.h>
#include <core_log.h>
#include <kernel/log.h>
#include "kernel/log.h"
void Genode::Core_log::out(char const c) { Kernel::log(c); }

View File

@ -17,7 +17,7 @@
/* core includes */
#include <platform.h>
#include <core_region_map.h>
#include <map_local.h>
#include "map_local.h"
#include <util.h>
#include <base/heap.h>

View File

@ -16,7 +16,7 @@
/* core includes */
#include <cpu_session_component.h>
#include <kernel/configuration.h>
#include "kernel/configuration.h"
using namespace Genode;

View File

@ -13,10 +13,10 @@
*/
/* base-hw includes */
#include <kernel/core_interface.h>
#include "kernel/core_interface.h"
/* core includes */
#include <kernel/irq.h>
#include "kernel/irq.h"
#include <irq_root.h>
#include <irq_args.h>
#include <core_env.h>

View File

@ -13,11 +13,11 @@
*/
/* core includes */
#include <kernel/cpu.h>
#include <kernel/kernel.h>
#include <kernel/thread.h>
#include <kernel/irq.h>
#include <kernel/pd.h>
#include "cpu.h"
#include "kernel.h"
#include "thread.h"
#include "irq.h"
#include "pd.h"
#include <board.h>
#include <hw/assert.h>
#include <hw/boot_info.h>

View File

@ -19,10 +19,10 @@
/* core includes */
#include <board.h>
#include <kernel/cpu_context.h>
#include <kernel/irq.h>
#include <kernel/inter_processor_work.h>
#include <kernel/thread.h>
#include "cpu_context.h"
#include "irq.h"
#include "inter_processor_work.h"
#include "thread.h"
namespace Kernel
{

View File

@ -16,8 +16,8 @@
#define _CORE__KERNEL__CPU_CONTEXT_H_
/* core includes */
#include <kernel/cpu_scheduler.h>
#include <kernel/timer.h>
#include "cpu_scheduler.h"
#include "timer.h"
namespace Kernel
{

View File

@ -11,7 +11,7 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#include <kernel/cpu.h>
#include "cpu.h"
using namespace Kernel;

View File

@ -13,7 +13,7 @@
#include <base/log.h>
#include <hw/assert.h>
#include <kernel/cpu_scheduler.h>
#include "cpu_scheduler.h"
using namespace Kernel;

View File

@ -17,8 +17,8 @@
/* core includes */
#include <util.h>
#include <util/misc_math.h>
#include <kernel/configuration.h>
#include <kernel/double_list.h>
#include "configuration.h"
#include "double_list.h"
namespace Kernel
{

View File

@ -11,7 +11,7 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#include <kernel/cpu.h>
#include "cpu.h"
void Kernel::Cpu::Ipi::occurred() { }

View File

@ -12,7 +12,7 @@
*/
/* core includes */
#include <kernel/double_list.h>
#include "double_list.h"
using namespace Kernel;

View File

@ -13,10 +13,10 @@
*/
/* core includes */
#include <kernel/pd.h>
#include <kernel/cpu.h>
#include <kernel/kernel.h>
#include <kernel/lock.h>
#include "pd.h"
#include "cpu.h"
#include "kernel.h"
#include "lock.h"
#include <platform_pd.h>
#include <board.h>
#include <platform_thread.h>

View File

@ -20,10 +20,10 @@
/* core includes */
#include <platform_pd.h>
#include <kernel/ipc_node.h>
#include <kernel/pd.h>
#include <kernel/kernel.h>
#include <kernel/thread.h>
#include "ipc_node.h"
#include "pd.h"
#include "kernel.h"
#include "thread.h"
using namespace Kernel;

View File

@ -12,9 +12,9 @@
*/
/* core includes */
#include <kernel/kernel.h>
#include <kernel/cpu.h>
#include <kernel/irq.h>
#include "kernel.h"
#include "cpu.h"
#include "irq.h"
void Kernel::Irq::disable() const {

View File

@ -23,7 +23,7 @@
#include <base/internal/unmanaged_singleton.h>
/* core includes */
#include <kernel/signal_receiver.h>
#include "signal_receiver.h"
namespace Kernel
{

View File

@ -13,9 +13,9 @@
*/
/* core includes */
#include <kernel/cpu.h>
#include <kernel/lock.h>
#include <kernel/kernel.h>
#include "cpu.h"
#include "lock.h"
#include "kernel.h"
extern "C" void kernel()

View File

@ -15,9 +15,9 @@
#include <cpu/atomic.h>
#include <cpu/memory_barrier.h>
#include <kernel/cpu.h>
#include <kernel/lock.h>
#include <kernel/kernel.h>
#include "cpu.h"
#include "lock.h"
#include "kernel.h"
Kernel::Lock & Kernel::data_lock()
{

View File

@ -1,6 +1,6 @@
#include <kernel/object.h>
#include <kernel/pd.h>
#include <kernel/kernel.h>
#include "object.h"
#include "pd.h"
#include "kernel.h"
#include <util/construct_at.h>

View File

@ -21,7 +21,7 @@
/* core includes */
#include <kernel/interface.h>
#include <kernel/kernel.h>
#include "kernel.h"
namespace Kernel
{
@ -71,7 +71,7 @@ namespace Kernel
}
class Kernel::Object
struct Kernel::Object
{
Object_identity_list list { };

View File

@ -18,8 +18,8 @@
/* core includes */
#include <hw/assert.h>
#include <cpu.h>
#include <kernel/core_interface.h>
#include <kernel/object.h>
#include "core_interface.h"
#include "object.h"
#include <translation_table.h>
namespace Genode {

View File

@ -12,7 +12,7 @@
*/
/* core includes */
#include <kernel/signal_receiver.h>
#include "signal_receiver.h"
using namespace Kernel;

View File

@ -17,8 +17,8 @@
/* Genode includes */
#include <base/signal.h>
#include <kernel/core_interface.h>
#include <kernel/object.h>
#include "core_interface.h"
#include "object.h"
namespace Kernel
{

View File

@ -24,11 +24,11 @@
/* core includes */
#include <hw/assert.h>
#include <kernel/cpu.h>
#include <kernel/kernel.h>
#include <kernel/thread.h>
#include <kernel/irq.h>
#include <kernel/log.h>
#include "cpu.h"
#include "kernel.h"
#include "thread.h"
#include "irq.h"
#include "log.h"
#include <map_local.h>
#include <platform_pd.h>

View File

@ -19,11 +19,11 @@
/* core includes */
#include <cpu.h>
#include <kernel/cpu_context.h>
#include <kernel/inter_processor_work.h>
#include <kernel/signal_receiver.h>
#include <kernel/ipc_node.h>
#include <kernel/object.h>
#include "cpu_context.h"
#include "inter_processor_work.h"
#include "signal_receiver.h"
#include "ipc_node.h"
#include "object.h"
namespace Kernel
{

View File

@ -12,9 +12,9 @@
*/
/* Core includes */
#include <kernel/cpu.h>
#include <kernel/timer.h>
#include <kernel/configuration.h>
#include "cpu.h"
#include "timer.h"
#include "configuration.h"
#include <hw/assert.h>
using namespace Kernel;

View File

@ -16,7 +16,7 @@
/* base-hw includes */
#include <kernel/types.h>
#include <kernel/irq.h>
#include "irq.h"
/* Genode includes */
#include <util/list.h>

View File

@ -17,10 +17,10 @@
namespace Genode { class Vm_state; }
/* core includes */
#include <kernel/cpu_context.h>
#include <kernel/kernel.h>
#include <kernel/pd.h>
#include <kernel/signal_receiver.h>
#include "cpu_context.h"
#include "kernel.h"
#include "pd.h"
#include "signal_receiver.h"
namespace Kernel
{

View File

@ -12,7 +12,7 @@
*/
/* core includes */
#include <kernel/thread.h>
#include "thread.h"
void Kernel::Thread::_call_new_vm() { user_arg_0(-1); }
void Kernel::Thread::_call_delete_vm() { user_arg_0(-1); }

View File

@ -12,8 +12,8 @@
*/
/* core includes */
#include <kernel/thread.h>
#include <kernel/vm.h>
#include "thread.h"
#include "vm.h"
void Kernel::Thread::_call_new_vm()
{

View File

@ -17,7 +17,7 @@
#include <board.h>
#include <platform.h>
#include <kernel/log.h>
#include "kernel/log.h"
void Kernel::log(char const c)

View File

@ -12,7 +12,7 @@
*/
#include <pd_session_component.h>
#include <native_pd_component.h>
#include "native_pd_component.h"
using namespace Genode;

View File

@ -22,7 +22,7 @@
/* base-hw includes */
#include <kernel/interface.h>
#include <kernel/object.h>
#include "kernel/object.h"
namespace Genode {
/**

View File

@ -19,14 +19,14 @@
#include <boot_modules.h>
#include <core_log.h>
#include <hw/memory_region.h>
#include <map_local.h>
#include "map_local.h"
#include <platform.h>
#include <platform_pd.h>
#include <hw/page_flags.h>
#include <hw/util.h>
#include <kernel/kernel.h>
#include "kernel/kernel.h"
#include <translation_table.h>
#include <kernel/cpu.h>
#include "kernel/cpu.h"
/* base-internal includes */
#include <base/internal/crt0.h>

View File

@ -17,15 +17,15 @@
#include <platform_pd.h>
#include <core_env.h>
#include <rm_session_component.h>
#include <map_local.h>
#include "map_local.h"
/* base-internal includes */
#include <base/internal/native_utcb.h>
#include <base/internal/capability_space.h>
/* kernel includes */
#include <kernel/pd.h>
#include <kernel/kernel.h>
#include "kernel/pd.h"
#include "kernel/kernel.h"
using namespace Genode;

View File

@ -18,7 +18,7 @@
/* core includes */
#include <ram_dataspace_factory.h>
#include <platform.h>
#include <map_local.h>
#include "map_local.h"
using namespace Genode;

View File

@ -0,0 +1,23 @@
/*
* \brief CPU driver for core
* \author Norman Feske
* \author Martin stein
* \date 2012-08-30
*/
/*
* Copyright (C) 2012-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _CORE__SPEC__ARM_V6__CPU_H_
#define _CORE__SPEC__ARM_V6__CPU_H_
/* core includes */
#include <spec/arm/cpu_support.h>
namespace Genode { using Cpu = Arm_cpu; }
#endif /* _CORE__SPEC__ARM_V6__CPU_H_ */

View File

@ -0,0 +1,94 @@
/*
* \brief CPU driver for core
* \author Stefan Kalkowski
* \date 2019-05-10
*/
/*
* Copyright (C) 2019 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _CORE__SPEC__ARM_V8__CPU_H_
#define _CORE__SPEC__ARM_V8__CPU_H_
/* Genode includes */
#include <util/register.h>
#include <cpu/cpu_state.h>
#include <base/internal/align_at.h>
#include <hw/spec/arm_64/cpu.h>
namespace Kernel { struct Thread_fault; }
namespace Genode {
struct Cpu;
using sizet_arithm_t = __uint128_t;
using uint128_t = __uint128_t;
}
struct Genode::Cpu : Hw::Arm_64_cpu
{
enum Exception_entry {
SYNC_LEVEL_EL1 = 0x000,
IRQ_LEVEL_EL1 = 0x080,
FIQ_LEVEL_EL1 = 0x100,
SERR_LEVEL_EL1 = 0x180,
SYNC_LEVEL_EL1_EXC_MODE = 0x200,
IRQ_LEVEL_EL1_EXC_MODE = 0x280,
FIQ_LEVEL_EL1_EXC_MODE = 0x300,
SERR_LEVEL_EL1_EXC_MODE = 0x380,
SYNC_LEVEL_EL0 = 0x400,
IRQ_LEVEL_EL0 = 0x480,
FIQ_LEVEL_EL0 = 0x500,
SERR_LEVEL_EL0 = 0x580,
AARCH32_SYNC_LEVEL_EL0 = 0x600,
AARCH32_IRQ_LEVEL_EL0 = 0x680,
AARCH32_FIQ_LEVEL_EL0 = 0x700,
AARCH32_SERR_LEVEL_EL0 = 0x780,
RESET = 0x800
};
struct alignas(16) Fpu_state
{
Genode::uint128_t q[32];
Genode::uint32_t fpsr;
};
struct alignas(8) Context : Cpu_state
{
Genode::uint64_t pstate { };
Genode::uint64_t exception_type { RESET };
Fpu_state fpu_state { };
Context(bool privileged);
};
struct Mmu_context
{
Ttbr::access_t ttbr;
Mmu_context(addr_t page_table_base);
~Mmu_context();
Genode::uint16_t id() {
return Ttbr::Asid::get(ttbr); }
};
void switch_to(Context&, Mmu_context &);
static void mmu_fault(Context &, Kernel::Thread_fault &);
/**
* Return kernel name of the executing CPU
*/
static unsigned executing_id() { return 0; }
static void clean_data_cache_by_virt_region(addr_t, size_t);
static void clean_invalidate_data_cache_by_virt_region(addr_t, size_t);
static void invalidate_instr_cache_by_virt_region(addr_t, size_t);
};
#endif /* _CORE__SPEC__ARM_V8__CPU_H_ */

View File

@ -0,0 +1,124 @@
/*
* \brief CPU driver for core
* \author Martin stein
* \author Stefan Kalkowski
* \date 2011-11-03
*/
/*
* Copyright (C) 2011-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _CORE__SPEC__CORTEX_A15__CPU_H_
#define _CORE__SPEC__CORTEX_A15__CPU_H_
/* core includes */
#include <spec/arm_v7/cpu_support.h>
namespace Genode { class Cpu; }
class Genode::Cpu : public Arm_v7_cpu
{
public:
/*********************************
** Virtualization extensions **
*********************************/
/**
* Hypervisor system trap register
*/
struct Hstr : Register<32>
{
/* System coprocessor primary register access trap */
template <unsigned R>
struct T : Bitfield<R, 1> {};
static access_t init()
{
/*
* allow cache (7), TLB (8) maintenance, and performance
* monitor (9), process/thread ID register (13) and timer (14)
* access.
*/
access_t v = 0;
T<0>::set(v, 1);
T<1>::set(v, 1);
T<2>::set(v, 1);
T<3>::set(v, 1);
T<5>::set(v, 1);
T<6>::set(v, 1);
T<10>::set(v, 1);
T<11>::set(v, 1);
T<12>::set(v, 1);
T<15>::set(v, 1);
return v;
};
};
/**
* Hypervisor control register
*/
struct Hcr : Register<32>
{
struct Vm : Bitfield<0, 1> {}; /* VT MMU enabled */
struct Fmo : Bitfield<3, 1> {}; /* FIQ cannot been masked */
struct Imo : Bitfield<4, 1> {}; /* IRQ cannot been masked */
struct Amo : Bitfield<5, 1> {}; /* A bit cannot been masked */
struct Twi : Bitfield<13, 1> {}; /* trap on WFI instruction */
struct Twe : Bitfield<14, 1> {}; /* trap on WFE instruction */
struct Tidcp : Bitfield<20, 1> {}; /* trap lockdown */
struct Tac : Bitfield<21, 1> {}; /* trap ACTLR accesses */
struct Tvm : Bitfield<26, 1> {}; /* trap virtual memory ctrls */
static access_t init()
{
access_t v = 0;
Vm::set(v, 1);
Fmo::set(v, 1);
Imo::set(v, 1);
Amo::set(v, 1);
Twi::set(v, 1);
Twe::set(v, 1);
Tidcp::set(v, 1);
Tac::set(v, 1);
Tvm::set(v, 1);
return v;
};
};
/**
* An usermode execution state
*/
struct Mmu_context
{
Ttbr_64bit::access_t ttbr0;
Mmu_context(addr_t const table);
~Mmu_context();
Genode::uint8_t id() const { return Ttbr_64bit::Asid::get(ttbr0); }
};
static void mmu_fault_status(Fsr::access_t fsr,
Kernel::Thread_fault & fault);
/**
* Return kernel name of the executing CPU
*/
static unsigned executing_id() { return Mpidr::Aff_0::get(Mpidr::read()); }
void switch_to(Context &, Mmu_context & mmu_context)
{
if (mmu_context.id() && (Ttbr0_64bit::read() != mmu_context.ttbr0))
Ttbr0_64bit::write(mmu_context.ttbr0);
}
};
#endif /* _CORE__SPEC__CORTEX_A15__CPU_H_ */

View File

@ -0,0 +1,35 @@
/*
* \brief ARM Cortex A8 CPU driver for core
* \author Martin stein
* \author Stefan Kalkowski
* \date 2011-11-03
*/
/*
* Copyright (C) 2011-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _CORE__SPEC__CORTEX_A8__CPU_H_
#define _CORE__SPEC__CORTEX_A8__CPU_H_
/* core includes */
#include <spec/arm_v7/cpu_support.h>
namespace Genode { struct Cpu; }
struct Genode::Cpu : Arm_v7_cpu
{
/**
* Post processing after a translation was added to a translation table
*
* \param addr virtual address of the translation
* \param size size of the translation
*/
static void translation_added(addr_t const addr, size_t const size);
};
#endif /* _CORE__SPEC__CORTEX_A8__CPU_H_ */

View File

@ -0,0 +1,40 @@
/*
* \brief CPU driver for core
* \author Martin stein
* \author Stefan Kalkowski
* \date 2011-11-03
*/
/*
* Copyright (C) 2011-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _CORE__SPEC__CORTEX_A9__CPU_H_
#define _CORE__SPEC__CORTEX_A9__CPU_H_
/* core includes */
#include <spec/arm_v7/cpu_support.h>
#include <board.h>
namespace Genode { struct Cpu; }
struct Genode::Cpu : Arm_v7_cpu
{
/**
* Clean and invalidate data-cache for virtual region
* 'base' - 'base + size'
*/
void clean_invalidate_data_cache_by_virt_region(addr_t base,
size_t const size)
{
Arm_cpu::clean_invalidate_data_cache_by_virt_region(base, size);
Board::l2_cache().clean_invalidate();
}
static unsigned executing_id() { return Mpidr::Aff_0::get(Mpidr::read()); }
};
#endif /* _CORE__SPEC__CORTEX_A9__CPU_H_ */

View File

@ -0,0 +1,86 @@
/*
* \brief CPU driver for core
* \author Sebastian Sumpf
* \date 2015-06-02
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _CORE__SPEC__RISCV__CPU_H_
#define _CORE__SPEC__RISCV__CPU_H_
/* Genode includes */
#include <base/stdint.h>
#include <cpu/cpu_state.h>
#include <util/register.h>
#include <base/internal/align_at.h>
#include <kernel/interface.h>
#include <hw/spec/riscv/cpu.h>
namespace Kernel { struct Thread_fault; }
namespace Genode
{
/**
* CPU driver for core
*/
class Cpu;
typedef __uint128_t sizet_arithm_t;
}
namespace Kernel { class Pd; }
class Genode::Cpu : public Hw::Riscv_cpu
{
public:
struct alignas(8) Context : Cpu_state
{
Context(bool);
};
struct Mmu_context
{
Sptbr::access_t sptbr = 0;
Mmu_context(addr_t page_table_base);
~Mmu_context();
};
/**
* From the manual
*
* The behavior of SFENCE.VM depends on the current value of the sasid
* register. If sasid is nonzero, SFENCE.VM takes effect only for address
* translations in the current address space. If sasid is zero, SFENCE.VM
* affects address translations for all address spaces. In this case, it
* also affects global mappings, which are described in Section 4.5.1.
*
* Right no we will flush anything
*/
static void sfence()
{
/*
* Note: In core the address space id must be zero
*/
asm volatile ("sfence.vm\n");
}
static void invalidate_tlb_by_pid(unsigned const /* pid */) { sfence(); }
void switch_to(Mmu_context & context);
static void mmu_fault(Context & c, Kernel::Thread_fault & f);
static unsigned executing_id() { return 0; }
};
#endif /* _CORE__SPEC__RISCV__CPU_H_ */

View File

@ -15,8 +15,8 @@
#define _CORE__SPEC__X86_64__BOARD_H_
#include <hw/spec/x86_64/pc_board.h>
#include <spec/x86_64/pic.h>
#include <spec/x86_64/pit.h>
#include "pic.h"
#include "pit.h"
namespace Board {
using namespace Hw::Pc_board;

View File

@ -13,8 +13,8 @@
/* core includes */
#include <cpu.h>
#include <kernel/thread.h>
#include <kernel/pd.h>
#include "../../kernel/thread.h"
#include "../../kernel/pd.h"
extern int __idt;
extern int __idt_end;

View File

@ -0,0 +1,135 @@
/*
* \brief x86_64 CPU driver for core
* \author Adrian-Ken Rueegsegger
* \author Martin stein
* \author Reto Buerki
* \author Stefan Kalkowski
* \date 2015-02-06
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _CORE__SPEC__X86_64__CPU_H_
#define _CORE__SPEC__X86_64__CPU_H_
/* Genode includes */
#include <util/register.h>
#include <kernel/interface_support.h>
#include <cpu/cpu_state.h>
#include "../../../include/hw/spec/x86_64/cpu_registers.h"
/* base includes */
#include <base/internal/align_at.h>
#include <base/internal/unmanaged_singleton.h>
/* core includes */
#include <fpu.h>
namespace Kernel { struct Thread_fault; }
namespace Genode {
class Cpu;
using sizet_arithm_t = __uint128_t;
}
class Genode::Cpu : public Hw::X86_64_cpu
{
protected:
public:
/**
* Task State Segment (TSS)
*
* See Intel SDM Vol. 3A, section 7.7
*/
struct alignas(8) Tss
{
uint32_t reserved0;
uint64_t rsp[3]; /* pl0-3 stack pointer */
uint64_t reserved1;
uint64_t ist[7]; /* irq stack pointer */
uint64_t reserved2;
static void init();
} __attribute__((packed)) tss { };
/**
* Interrupt Descriptor Table (IDT)
*
* See Intel SDM Vol. 3A, section 6.10
*/
struct Idt { static void init(); };
/**
* Global Descriptor Table (GDT)
* See Intel SDM Vol. 3A, section 3.5.1
*/
struct alignas(8) Gdt
{
uint64_t null_desc = 0;
uint64_t sys_cs_64bit_desc = 0x20980000000000;
uint64_t sys_ds_64bit_desc = 0x20930000000000;
uint64_t usr_cs_64bit_desc = 0x20f80000000000;
uint64_t usr_ds_64bit_desc = 0x20f30000000000;
uint64_t tss_desc[2];
void init(addr_t tss_addr);
} __attribute__((packed)) gdt { };
/**
* Extend basic CPU state by members relevant for 'base-hw' only
*/
struct Kernel_stack { unsigned long kernel_stack { }; };
/* exception_vector.s depends on the position of the Kernel_stack */
struct alignas(16) Context : Cpu_state, Kernel_stack, Fpu_context
{
enum Eflags {
EFLAGS_IF_SET = 1 << 9,
EFLAGS_IOPL_3 = 3 << 12,
};
Context(bool privileged);
} __attribute__((packed));
struct Mmu_context
{
addr_t cr3;
Mmu_context(addr_t page_table_base);
};
/**
* Return kernel name of the executing CPU
*/
static unsigned executing_id();
/**
* Switch to new context
*
* \param context next CPU context
*/
void switch_to(Context & context, Mmu_context &mmu_context);
static void mmu_fault(Context & regs, Kernel::Thread_fault & fault);
/**
* Invalidate the whole TLB
*/
static void invalidate_tlb() {
Genode::Cpu::Cr3::write(Genode::Cpu::Cr3::read()); }
};
#endif /* _CORE__SPEC__X86_64__CPU_H_ */

View File

@ -13,8 +13,8 @@
*/
/* core includes */
#include <kernel/cpu.h>
#include <kernel/kernel.h>
#include "../../kernel/cpu.h"
#include "../../kernel/kernel.h"
void Kernel::Cpu::_arch_init()
{

View File

@ -11,8 +11,8 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#include <kernel/cpu.h>
#include <kernel/pd.h>
#include "../../kernel/cpu.h"
#include "../../kernel/pd.h"
bool Kernel::Pd::invalidate_tlb(Cpu & cpu, addr_t, size_t)

View File

@ -14,9 +14,9 @@
*/
/* core includes */
#include <kernel/cpu.h>
#include <kernel/thread.h>
#include <kernel/pd.h>
#include "../../kernel/cpu.h"
#include "../../kernel/thread.h"
#include "../../kernel/pd.h"
void Kernel::Thread::Tlb_invalidation::execute()
{

View File

@ -14,8 +14,8 @@
*/
/* core includes */
#include <kernel/cpu.h>
#include <kernel/thread.h>
#include "../../kernel/cpu.h"
#include "../../kernel/thread.h"
using namespace Kernel;

View File

@ -19,7 +19,7 @@
#include <drivers/timer/util.h>
/* core includes */
#include <kernel/timer.h>
#include "../../kernel/timer.h"
#include <platform.h>
using namespace Genode;

View File

@ -13,7 +13,7 @@
#include <bios_data_area.h>
#include <platform.h>
#include <kernel/cpu.h>
#include "../../kernel/cpu.h"
#include <map_local.h>
using namespace Genode;

View File

@ -22,8 +22,8 @@
#include <base/internal/native_utcb.h>
/* core includes */
#include <map_local.h>
#include <kernel/kernel.h>
#include "map_local.h"
#include "kernel/kernel.h"
#include <platform.h>
#include <platform_thread.h>

View File

@ -16,10 +16,11 @@
/* Genode includes */
#include <base/rpc_server.h>
#include <base/allocator.h>
#include <util/list.h>
#include <irq_session/capability.h>
#include <kernel/irq.h>
#include "../core/kernel/irq.h"
namespace Genode { class Irq_session_component; }

View File

@ -25,10 +25,11 @@
#include <base/internal/unmanaged_singleton.h>
/* core-local includes */
#include <kernel/signal_receiver.h>
#include <hw/mapping.h>
#include <object.h>
#include <rpc_cap_factory.h>
#include "rpc_cap_factory.h"
#include "../core/kernel/signal_receiver.h"
#include "../core/kernel/object.h"
#include "../core/kernel/thread.h"
namespace Genode
{

View File

@ -24,9 +24,9 @@
/* base-hw includes */
#include <hw/boot_info.h>
#include <hw/memory_region.h>
#include <kernel/configuration.h>
#include <kernel/core_interface.h>
#include <kernel/pd.h>
#include "../core/kernel/configuration.h"
#include "../core/kernel/core_interface.h"
#include "../core/kernel/pd.h"
/* core includes */
#include <platform_generic.h>

View File

@ -17,13 +17,13 @@
/* Core includes */
#include <translation_table.h>
#include <platform.h>
#include <address_space.h>
#include <hw/page_table_allocator.h>
#include <object.h>
#include <kernel/configuration.h>
#include <kernel/object.h>
#include <kernel/pd.h>
#include "platform.h"
#include "../core/object.h"
#include "../core/kernel/configuration.h"
#include "../core/kernel/object.h"
#include "../core/kernel/pd.h"
namespace Hw
{

View File

@ -25,11 +25,11 @@
/* core includes */
#include <address_space.h>
#include <object.h>
#include "../core/object.h"
/* kernel includes */
#include <kernel/core_interface.h>
#include <kernel/thread.h>
#include "../core/kernel/core_interface.h"
#include "../core/kernel/thread.h"
namespace Genode {

View File

@ -23,8 +23,8 @@
#include <base/log.h>
/* core-local includes */
#include <object.h>
#include <kernel/thread.h>
#include "../core/object.h"
#include "../core/kernel/thread.h"
/* base-internal includes */
#include <base/internal/capability_space.h>

View File

@ -0,0 +1,7 @@
ifndef LINUX_HEADERS
error CONFIG_LINUX_HEADERS not defined
endif
INCLUDES += -I$(TUP_CWD)/include
INCLUDES += -I$(BASE_DIR)/src/include
INCLUDES += -I@(LINUX_HEADERS)

View File

@ -1 +1 @@
INCLUDES += -I$(REP_DIR)/src/include
INCLUDES = -I$(TUP_CWD)/include -I$(BASE_DIR)/src/include $(INCLUDES)

View File

@ -2,11 +2,10 @@ include_rules
GEN_CORE_DIR = $(BASE_DIR)/src/core
INCLUDES += \
-I$(REP_DIR)/src/core/include \
-I$(REP_DIR)/src/include \
-I$(BASE_DIR)/src/include \
-I$(TUP_CWD)/include \
-I$(GEN_CORE_DIR)/include \
-I$(BASE_DIR)/include \
SRC_CC += *.cc
ifeq (@(TUP_ARCH),i386)
SRC_CC += spec/x86_32/*.cc
@ -17,7 +16,6 @@ SRC_CC += spec/x86_64/*.cc
endif
SRC_CC += \
*.cc \
$(GEN_CORE_DIR)/core_log.cc \
$(GEN_CORE_DIR)/core_mem_alloc.cc \
$(GEN_CORE_DIR)/cpu_session_component.cc \
@ -47,9 +45,31 @@ CXXFLAGS_$(GEN_CORE_DIR)/version.cc += -DGENODE_VERSION=\"`git describe`\"
: foreach $(SRC_CC) |> !cxx |> {link-items}
: {link-items} |> !ar |> core-nova.lib.a
: {link-items} |> !ar |> {archive}
: core-nova.lib.a | $(REP_DIR)/<base-common> $(BASE_DIR)/<base-libs> \
|> $(LD) $(LD_MARCH) -u _start --whole-archive -r \
%<base-common> %<base-libs> %f -o %o \
|> core-nova.o $(REP_DIR)/<core>
STATIC_LIBS += -L$(LIB_DIR) `$(PKG_CONFIG) --libs cxx startup`
ifndef LIBUNWIND_BAREMETAL
error CONFIG_LIBUNWIND_BAREMETAL not defined
@(LIBUNWIND_BAREMETAL)
endif
EH_SYMBOLS = \
_Unwind_Resume \
_Unwind_Complete \
_Unwind_DeleteException \
REDEF_SYMBOLS = `echo $(EH_SYMBOLS) | awk -v RS=' ' '{ print "--redefine-sym "$1"=_cxx_"$1 }'`
export OBJCOPY
: |> $OBJCOPY $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) @(LIBUNWIND_BAREMETAL) %o |> libunwind.a {archive}
: {archive} | \
$(DEV_DIR)/<lib> \
$(GENODE_DIR)/<pkg-config> \
$(BASE_DIR)/<libunwind-baremetal> \
$(BASE_DIR)/<base-libs> \
$(REP_DIR)/<base-common> \
|> $(LD) -u _start --whole-archive -r \
%<libunwind-baremetal> %<base-libs> %<base-common> %f $(STATIC_LIBS) -o %o \
|> core.o $(REP_DIR)/<core>

View File

@ -0,0 +1,38 @@
include_rules
GENERIC_DIR = $(BASE_DIR)/src/lib/base
GENERIC_SRC_CC += \
$(GENERIC_DIR)/allocator_avl.cc \
$(GENERIC_DIR)/avl_tree.cc \
$(GENERIC_DIR)/child.cc \
$(GENERIC_DIR)/child_process.cc \
$(GENERIC_DIR)/component.cc \
$(GENERIC_DIR)/console.cc \
$(GENERIC_DIR)/elf_binary.cc \
$(GENERIC_DIR)/entrypoint.cc \
$(GENERIC_DIR)/env_session_id_space.cc \
$(GENERIC_DIR)/heap.cc \
$(GENERIC_DIR)/lock.cc \
$(GENERIC_DIR)/log.cc \
$(GENERIC_DIR)/output.cc \
$(GENERIC_DIR)/raw_output.cc \
$(GENERIC_DIR)/region_map_client.cc \
$(GENERIC_DIR)/registry.cc \
$(GENERIC_DIR)/rm_session_client.cc \
$(GENERIC_DIR)/root_proxy.cc \
$(GENERIC_DIR)/session_state.cc \
$(GENERIC_DIR)/signal_common.cc \
$(GENERIC_DIR)/slab.cc \
$(GENERIC_DIR)/sleep.cc \
$(GENERIC_DIR)/sliced_heap.cc \
$(GENERIC_DIR)/stack_allocator.cc \
$(GENERIC_DIR)/stack_protector.cc \
$(GENERIC_DIR)/thread.cc \
$(GENERIC_DIR)/thread_myself.cc \
$(GENERIC_DIR)/trace.cc \
$(GENERIC_DIR)/vm_session.cc \
: foreach $(GENERIC_SRC_CC) |> !cxx |> %B.base.o {obj}
: foreach *.cc |> !cxx |> %B.nova.o {obj}
: {obj} |> !ar |> | $(REP_DIR)/<base-common>

View File

@ -1,30 +1,7 @@
include_rules
INCLUDES += -I$(BASE_DIR)/src/include
BASE_LIB_DIR = $(BASE_DIR)/src/lib/base
include $(BASE_DIR)/src/lib/base/common.tup
COMMON_SRC_CC += \
$(BASE_DIR)/src/lib/base/child_process.cc \
$(BASE_DIR)/src/lib/base/thread.cc \
$(BASE_DIR)/src/lib/base/thread_myself.cc \
$(BASE_DIR)/src/lib/base/trace.cc \
capability.cc \
cap_map.cc \
ipc.cc \
region_map_client.cc \
rpc_entrypoint.cc \
signal_transmitter.cc \
sleep.cc \
stack_area_addr.cc \
stack.cc \
vm_session.cc \
: foreach $(COMMON_SRC_CC) |> !cxx |> nova-%B.o {base-common-obj}
: {base-common-obj} |> !ar |> base-nova-common.lib.a $(REP_DIR)/<base-common>
SRC_CC += \
rpc_cap_alloc.cc \
thread_start.cc \

View File

@ -38,19 +38,18 @@ LDFLAGS += -gc-sections -z max-page-size=0x1000
LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld \
BASE_LIBS += \
$(REP_DIR)/src/lib/base/base-nova-common.lib.a \
$(REP_DIR)/src/lib/base/base-nova.lib.a \
BASE_PKGS += alarm cxx ldso-startup startup timeout
LDFLAGS += `pkg-config --static --libs $(BASE_PKGS)`
: $(BASE_LIBS) {obj} | symbol.map \
: $(BASE_LIBS) {obj} | symbol.map $(REP_DIR)/<base-common> \
|> \
$(LD) -o %o \
$(LD_MARCH) $(LDFLAGS) \
--whole-archive --start-group \
%f \
%<base-common> %f \
--end-group --no-whole-archive \
$(LIBGCC) \
|> ld.lib.so $(REP_DIR)/<ld> {bin}

Some files were not shown because too many files have changed in this diff Show More