mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
parent
a52541de18
commit
16b395dce3
@ -33,7 +33,7 @@ ARCH_INCLUDES += objecttype.h types.h constants.h functions.h deprecated.h \
|
||||
syscalls.h invocation.h simple_types.h
|
||||
|
||||
INCLUDES := objecttype.h types.h bootinfo.h bootinfo_types.h errors.h \
|
||||
constants.h messages.h sel4.h macros.h simple_types.h types_gen.h \
|
||||
constants.h messages.h sel4.h macros.h simple_types.h \
|
||||
syscall.h invocation.h shared_types_gen.h debug_assert.h \
|
||||
shared_types.h sel4.h deprecated.h autoconf.h syscalls.h faults.h \
|
||||
benchmark_utilisation_types.h
|
||||
@ -44,6 +44,7 @@ INCLUDE_SYMLINKS += $(addprefix include/sel4/, $(INCLUDES))
|
||||
INCLUDE_SYMLINKS += $(addprefix include/sel4/arch/, $(ARCH_INCLUDES))
|
||||
INCLUDE_SYMLINKS += $(addprefix include/sel4/sel4_arch/,$(SEL4_ARCH_INCLUDES))
|
||||
INCLUDE_SYMLINKS += $(addprefix include/sel4/plat/api/, $(PLAT_API_INCLUDES))
|
||||
INCLUDE_SYMLINKS += include/sel4/mode/types.h
|
||||
INCLUDE_SYMLINKS += include/interfaces/sel4_client.h
|
||||
|
||||
all: $(INCLUDE_SYMLINKS)
|
||||
@ -71,6 +72,10 @@ include/sel4/plat/api/%.h: $(LIBSEL4_DIR)/sel4_plat_include/$(PLAT)/sel4/plat/ap
|
||||
$(VERBOSE)mkdir -p $(dir $@)
|
||||
$(VERBOSE)ln -sf $< $@
|
||||
|
||||
include/sel4/mode/types.h: $(LIBSEL4_DIR)/mode_include/$(SEL4_WORDBITS)/sel4/mode/types.h
|
||||
$(VERBOSE)mkdir -p $(dir $@)
|
||||
$(VERBOSE)ln -sf $< $@
|
||||
|
||||
#
|
||||
# Generated headers
|
||||
#
|
||||
@ -84,12 +89,6 @@ include/sel4/sel4_arch/types.pbf: $(LIBSEL4_DIR)/sel4_arch_include/$(SEL4_ARCH)/
|
||||
$(VERBOSE)mkdir -p $(dir $@)
|
||||
$(VERBOSE)$(CPP) -Iinclude/sel4 -I$(LIBSEL4_DIR)/arch_include/$(ARCH) -P $< >$@
|
||||
|
||||
include/sel4/types_gen.h: include/sel4/types_$(SEL4_WORDBITS).pbf
|
||||
$(MSG_CONVERT)$(notdir $@)
|
||||
$(VERBOSE)mkdir -p $(dir $@)
|
||||
$(VERBOSE)python -B $(LIBSEL4_DIR)/tools/bitfield_gen.py \
|
||||
--environment libsel4 "$<" $@
|
||||
|
||||
include/sel4/shared_types_gen.h: include/sel4/shared_types_$(SEL4_WORDBITS).pbf
|
||||
$(MSG_CONVERT)$(notdir $@)
|
||||
$(VERBOSE)mkdir -p $(dir $@)
|
||||
|
@ -1,84 +0,0 @@
|
||||
--- src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h
|
||||
+++ src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h
|
||||
@@ -15,6 +15,11 @@
|
||||
#include <config.h>
|
||||
#include <types.h>
|
||||
|
||||
+enum acpi_size {
|
||||
+ ACPI_V1_SIZE = 20,
|
||||
+ ACPI_V2_SIZE = 36
|
||||
+};
|
||||
+
|
||||
/* Generic System Descriptor Table Header */
|
||||
typedef struct acpi_header {
|
||||
char signature[4];
|
||||
@@ -40,7 +45,7 @@ typedef struct acpi_rsdp {
|
||||
uint8_t extended_checksum;
|
||||
char reserved[3];
|
||||
} PACKED acpi_rsdp_t;
|
||||
-compile_assert(acpi_rsdp_packed, sizeof(acpi_rsdp_t) == 36)
|
||||
+compile_assert(acpi_rsdp_packed, sizeof(acpi_rsdp_t) == ACPI_V2_SIZE)
|
||||
|
||||
/* Root System Descriptor Table */
|
||||
typedef struct acpi_rsdt {
|
||||
--- src/kernel/sel4/src/arch/x86/kernel/boot_sys.c
|
||||
+++ src/kernel/sel4/src/arch/x86/kernel/boot_sys.c
|
||||
@@ -651,12 +651,14 @@ try_boot_sys_mbi2(
|
||||
if (tag->type == MULTIBOOT2_TAG_CMDLINE) {
|
||||
char const * const cmdline = (char const * const)(behind_tag);
|
||||
cmdline_parse(cmdline, &cmdline_opt);
|
||||
- } else if (tag->type == MULTIBOOT2_TAG_ACPI) {
|
||||
- if (sizeof(boot_state.acpi_rsdp) != tag->size - sizeof(*tag)) {
|
||||
- printf("sizeof ACPI RSDP unexpected %ld!=%lu\n", (long)sizeof(boot_state.acpi_rsdp), (long)tag->size - sizeof(*tag));
|
||||
- return false;
|
||||
+ } else if (tag->type == MULTIBOOT2_TAG_ACPI_1) {
|
||||
+ if (ACPI_V1_SIZE == tag->size - sizeof(*tag)) {
|
||||
+ memcpy(&boot_state.acpi_rsdp, (void *)behind_tag, tag->size - sizeof(*tag));
|
||||
+ }
|
||||
+ } else if (tag->type == MULTIBOOT2_TAG_ACPI_2) {
|
||||
+ if (sizeof(boot_state.acpi_rsdp) == tag->size - sizeof(*tag)) {
|
||||
+ memcpy(&boot_state.acpi_rsdp, (void *)behind_tag, sizeof(boot_state.acpi_rsdp));
|
||||
}
|
||||
- memcpy(&boot_state.acpi_rsdp, (void *)behind_tag, sizeof(boot_state.acpi_rsdp));
|
||||
} else if (tag->type == MULTIBOOT2_TAG_MODULE) {
|
||||
multiboot2_module_t const * module = (multiboot2_module_t const *)behind_tag;
|
||||
printf(
|
||||
--- src/kernel/sel4/src/plat/pc99/machine/acpi.c
|
||||
+++ src/kernel/sel4/src/plat/pc99/machine/acpi.c
|
||||
@@ -182,7 +182,7 @@ acpi_get_rsdp(void)
|
||||
|
||||
for (addr = (char*)BIOS_PADDR_START; addr < (char*)BIOS_PADDR_END; addr += 16) {
|
||||
if (strncmp(addr, acpi_str_rsd, 8) == 0) {
|
||||
- if (acpi_calc_checksum(addr, 20) == 0) {
|
||||
+ if (acpi_calc_checksum(addr, ACPI_V1_SIZE) == 0) {
|
||||
return (acpi_rsdp_t*)addr;
|
||||
}
|
||||
}
|
||||
@@ -255,8 +255,13 @@ acpi_validate_rsdp(acpi_rsdp_t *acpi_rsdp)
|
||||
acpi_rsdt_t* acpi_rsdt;
|
||||
acpi_rsdt_t* acpi_rsdt_mapped;
|
||||
|
||||
- if (acpi_calc_checksum((char*)acpi_rsdp, 20) != 0) {
|
||||
- printf("BIOS: ACPI information corrupt\n");
|
||||
+ if (acpi_calc_checksum((char*)acpi_rsdp, ACPI_V1_SIZE) != 0) {
|
||||
+ printf("BIOS: ACPIv1 information corrupt\n");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (acpi_rsdp->revision > 0 && acpi_calc_checksum((char*)acpi_rsdp, sizeof(*acpi_rsdp)) != 0) {
|
||||
+ printf("BIOS: ACPIv2 information corrupt\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
--- src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h
|
||||
+++ src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h
|
||||
@@ -43,7 +43,8 @@ enum multiboot2_tags {
|
||||
MULTIBOOT2_TAG_CMDLINE = 1,
|
||||
MULTIBOOT2_TAG_MODULE = 3,
|
||||
MULTIBOOT2_TAG_MEMORY = 6,
|
||||
- MULTIBOOT2_TAG_ACPI = 15,
|
||||
+ MULTIBOOT2_TAG_ACPI_1 = 14,
|
||||
+ MULTIBOOT2_TAG_ACPI_2 = 15,
|
||||
};
|
||||
|
||||
#endif
|
@ -1,146 +0,0 @@
|
||||
--- src/kernel/sel4/include/arch/x86/arch/kernel/boot.h
|
||||
+++ src/kernel/sel4/include/arch/x86/arch/kernel/boot.h
|
||||
@@ -42,7 +42,8 @@ bool_t init_sys_state(
|
||||
acpi_rmrr_list_t *rmrr_list,
|
||||
acpi_rsdp_t *acpi_rsdp,
|
||||
seL4_X86_BootInfo_VBE *vbe,
|
||||
- seL4_X86_BootInfo_mmap_t *mb_mmap
|
||||
+ seL4_X86_BootInfo_mmap_t *mb_mmap,
|
||||
+ seL4_X86_BootInfo_fb_t *fb_info
|
||||
);
|
||||
|
||||
bool_t init_cpu(
|
||||
--- src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h
|
||||
+++ src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h
|
||||
@@ -38,11 +38,21 @@
|
||||
char string [1];
|
||||
} PACKED multiboot2_module_t;
|
||||
|
||||
+typedef struct multiboot2_fb {
|
||||
+ uint64_t addr;
|
||||
+ uint32_t pitch;
|
||||
+ uint32_t width;
|
||||
+ uint32_t height;
|
||||
+ uint8_t bpp;
|
||||
+ uint8_t type;
|
||||
+} PACKED multiboot2_fb_t;
|
||||
+
|
||||
enum multiboot2_tags {
|
||||
MULTIBOOT2_TAG_END = 0,
|
||||
MULTIBOOT2_TAG_CMDLINE = 1,
|
||||
MULTIBOOT2_TAG_MODULE = 3,
|
||||
MULTIBOOT2_TAG_MEMORY = 6,
|
||||
+ MULTIBOOT2_TAG_FB = 8,
|
||||
MULTIBOOT2_TAG_ACPI_1 = 14,
|
||||
MULTIBOOT2_TAG_ACPI_2 = 15,
|
||||
};
|
||||
--- src/kernel/sel4/libsel4/arch_include/x86/sel4/arch/bootinfo_types.h
|
||||
+++ src/kernel/sel4/libsel4/arch_include/x86/sel4/arch/bootinfo_types.h
|
||||
@@ -135,4 +135,6 @@ typedef struct seL4_X86_BootInfo_mmap {
|
||||
seL4_X86_mb_mmap_t mmap[SEL4_MULTIBOOT_MAX_MMAP_ENTRIES];
|
||||
} SEL4_PACKED seL4_X86_BootInfo_mmap_t;
|
||||
|
||||
+typedef struct multiboot2_fb seL4_X86_BootInfo_fb_t;
|
||||
+
|
||||
#endif // __LIBSEL4_ARCH_BOOTINFO_TYPES_H
|
||||
--- src/kernel/sel4/libsel4/include/sel4/bootinfo_types.h
|
||||
+++ src/kernel/sel4/libsel4/include/sel4/bootinfo_types.h
|
||||
@@ -88,5 +88,6 @@ typedef struct {
|
||||
#define SEL4_BOOTINFO_HEADER_X86_VBE 1
|
||||
#define SEL4_BOOTINFO_HEADER_X86_MBMMAP 2
|
||||
#define SEL4_BOOTINFO_HEADER_X86_ACPI_RSDP 3
|
||||
+#define SEL4_BOOTINFO_HEADER_X86_FRAMEBUFFER 4
|
||||
|
||||
#endif // __LIBSEL4_BOOTINFO_TYPES_H
|
||||
--- src/kernel/sel4/src/arch/x86/kernel/boot.c
|
||||
+++ src/kernel/sel4/src/arch/x86/kernel/boot.c
|
||||
@@ -253,7 +253,8 @@ init_sys_state(
|
||||
acpi_rmrr_list_t *rmrr_list,
|
||||
acpi_rsdp_t *acpi_rsdp,
|
||||
seL4_X86_BootInfo_VBE *vbe,
|
||||
- seL4_X86_BootInfo_mmap_t *mb_mmap
|
||||
+ seL4_X86_BootInfo_mmap_t *mb_mmap,
|
||||
+ seL4_X86_BootInfo_fb_t *fb_info
|
||||
)
|
||||
{
|
||||
cap_t root_cnode_cap;
|
||||
@@ -287,6 +288,12 @@ init_sys_state(
|
||||
if (vbe->vbeMode != -1) {
|
||||
extra_bi_size += sizeof(seL4_X86_BootInfo_VBE);
|
||||
}
|
||||
+ if (acpi_rsdp) {
|
||||
+ extra_bi_size += sizeof(seL4_BootInfoHeader) + sizeof(*acpi_rsdp);
|
||||
+ }
|
||||
+ if (fb_info && fb_info->addr) {
|
||||
+ extra_bi_size += sizeof(seL4_BootInfoHeader) + sizeof(*fb_info);
|
||||
+ }
|
||||
|
||||
word_t mb_mmap_size = sizeof(seL4_X86_BootInfo_mmap_t);
|
||||
extra_bi_size += mb_mmap_size;
|
||||
@@ -353,6 +360,17 @@ init_sys_state(
|
||||
extra_bi_offset += sizeof(*acpi_rsdp);
|
||||
}
|
||||
|
||||
+ /* populate framebuffer information block */
|
||||
+ if (fb_info && fb_info->addr) {
|
||||
+ seL4_BootInfoHeader header;
|
||||
+ header.id = SEL4_BOOTINFO_HEADER_X86_FRAMEBUFFER;
|
||||
+ header.len = sizeof(header) + sizeof(*fb_info);
|
||||
+ *(seL4_BootInfoHeader*)(extra_bi_region.start + extra_bi_offset) = header;
|
||||
+ extra_bi_offset += sizeof(header);
|
||||
+ memcpy((void*)(extra_bi_region.start + extra_bi_offset), fb_info, sizeof(*fb_info));
|
||||
+ extra_bi_offset += sizeof(*fb_info);
|
||||
+ }
|
||||
+
|
||||
/* populate multiboot mmap block */
|
||||
mb_mmap->header.id = SEL4_BOOTINFO_HEADER_X86_MBMMAP;
|
||||
mb_mmap->header.len = mb_mmap_size;
|
||||
--- src/kernel/sel4/src/arch/x86/kernel/boot_sys.c
|
||||
+++ src/kernel/sel4/src/arch/x86/kernel/boot_sys.c
|
||||
@@ -71,6 +71,7 @@ typedef struct boot_state {
|
||||
mem_p_regs_t mem_p_regs; /* physical memory regions */
|
||||
seL4_X86_BootInfo_VBE vbe_info; /* Potential VBE information from multiboot */
|
||||
seL4_X86_BootInfo_mmap_t mb_mmap_info; /* memory map information from multiboot */
|
||||
+ seL4_X86_BootInfo_fb_t fb_info; /* framebuffer information as set by bootloader */
|
||||
} boot_state_t;
|
||||
|
||||
BOOT_BSS
|
||||
@@ -229,7 +230,8 @@ try_boot_sys_node(cpu_id_t cpu_id)
|
||||
&boot_state.rmrr_list,
|
||||
&boot_state.acpi_rsdp,
|
||||
&boot_state.vbe_info,
|
||||
- &boot_state.mb_mmap_info
|
||||
+ &boot_state.mb_mmap_info,
|
||||
+ &boot_state.fb_info
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
@@ -644,6 +646,7 @@ try_boot_sys_mbi2(
|
||||
boot_state.mem_p_regs.count = 0;
|
||||
init_allocated_p_regions();
|
||||
boot_state.mb_mmap_info.mmap_length = 0;
|
||||
+ boot_state.vbe_info.vbeMode = -1;
|
||||
|
||||
while (tag < tag_e && tag->type != MULTIBOOT2_TAG_END) {
|
||||
word_t const behind_tag = (word_t)tag + sizeof(*tag);
|
||||
@@ -701,6 +706,11 @@ try_boot_sys_mbi2(
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+ } else if (tag->type == MULTIBOOT2_TAG_FB) {
|
||||
+ multiboot2_fb_t const * fb = (multiboot2_fb_t const *)behind_tag;
|
||||
+ printf("Got framebuffer info in multiboot2. Current video mode is at physical address=%llx pitch=%u resolution=%ux%u@%u type=%u\n",
|
||||
+ fb->addr, fb->pitch, fb->width, fb->height, fb->bpp, fb->type);
|
||||
+ boot_state.fb_info = *fb;
|
||||
}
|
||||
|
||||
tag = (multiboot2_tag_t const *)((word_t)tag + ROUND_UP(tag->size, 3));
|
||||
@@ -713,8 +723,6 @@ try_boot_sys_mbi2(
|
||||
return false;
|
||||
}
|
||||
|
||||
- boot_state.vbe_info.vbeMode = -1;
|
||||
-
|
||||
return true;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
097171f475bff21223783e130445b9be6b3d1bb4
|
||||
f3cba0b8aeccaf78be076894186da3503a7e9fd1
|
||||
|
@ -4,7 +4,7 @@ DOWNLOADS := sel4.git
|
||||
|
||||
URL(sel4) := https://github.com/seL4/seL4.git
|
||||
# master branch, version 7.0 + already merged multiboot2 and uefi support
|
||||
REV(sel4) := a66feddb8c5044ecafe472c4ce249ae3adebd01b
|
||||
REV(sel4) := a2d974f47f876bb71950ef3a7cb8f695fa4f7d80
|
||||
DIR(sel4) := src/kernel/sel4
|
||||
|
||||
$(call check_tool,python)
|
||||
|
@ -100,7 +100,7 @@ Capability_space::create_rpc_obj_cap(Native_capability ep_cap,
|
||||
seL4_Word const src_index = ep_sel.value();
|
||||
uint8_t const src_depth = 32;
|
||||
seL4_CapRights_t const rights = seL4_AllRights;
|
||||
seL4_CapData_t const badge = seL4_CapData_Badge_new(rpc_obj_key.value());
|
||||
seL4_Word const badge = rpc_obj_key.value();
|
||||
|
||||
int const ret = seL4_CNode_Mint(service,
|
||||
dest_index,
|
||||
|
@ -78,7 +78,7 @@ class Genode::Cnode_base
|
||||
seL4_Word const src_index = from_idx.value();
|
||||
uint8_t const src_depth = from.size_log2();
|
||||
seL4_CapRights_t const rights = seL4_AllRights;
|
||||
seL4_CapData_t const badge = seL4_CapData_Badge_new(to_idx.value());
|
||||
seL4_Word const badge = to_idx.value();
|
||||
|
||||
int const ret = seL4_CNode_Mint(service, dest_index, dest_depth,
|
||||
src_root, src_index, src_depth,
|
||||
|
@ -251,14 +251,15 @@ void Platform::_switch_to_core_cspace()
|
||||
|
||||
/* activate core's CSpace */
|
||||
{
|
||||
seL4_CapData_t null_data = { { 0 } };
|
||||
seL4_CapData_t const guard = seL4_CapData_Guard_new(0, CONFIG_WORD_SIZE - 32);
|
||||
seL4_CNode_CapData const null_data = { { 0 } };
|
||||
seL4_CNode_CapData const guard = seL4_CNode_CapData_new(0, CONFIG_WORD_SIZE - 32);
|
||||
|
||||
int const ret = seL4_TCB_SetSpace(seL4_CapInitThreadTCB,
|
||||
seL4_CapNull, /* fault_ep */
|
||||
Core_cspace::top_cnode_sel(),
|
||||
guard,
|
||||
seL4_CapInitThreadPD, null_data);
|
||||
guard.words[0],
|
||||
seL4_CapInitThreadPD,
|
||||
null_data.words[0]);
|
||||
|
||||
if (ret != seL4_NoError)
|
||||
error(__FUNCTION__, ": seL4_TCB_SetSpace returned ", ret);
|
||||
|
@ -164,14 +164,17 @@ int Platform_thread::start(void *ip, void *sp, unsigned int cpu_no)
|
||||
prepopulate_ipc_buffer(_info.ipc_buffer_phys, _ep_sel, _lock_sel);
|
||||
|
||||
/* bind thread to PD and CSpace */
|
||||
seL4_CapData_t const guard_cap_data =
|
||||
seL4_CapData_Guard_new(0, CONFIG_WORD_SIZE - _pd->cspace_size_log2());
|
||||
seL4_CNode_CapData const guard_cap_data =
|
||||
seL4_CNode_CapData_new(0, CONFIG_WORD_SIZE - _pd->cspace_size_log2());
|
||||
|
||||
seL4_CapData_t const no_cap_data = { { 0 } };
|
||||
seL4_CNode_CapData const no_cap_data = { { 0 } };
|
||||
|
||||
int const ret = seL4_TCB_SetSpace(_info.tcb_sel.value(), _fault_handler_sel.value(),
|
||||
_pd->cspace_cnode_1st().sel().value(), guard_cap_data,
|
||||
_pd->page_directory_sel().value(), no_cap_data);
|
||||
int const ret = seL4_TCB_SetSpace(_info.tcb_sel.value(),
|
||||
_fault_handler_sel.value(),
|
||||
_pd->cspace_cnode_1st().sel().value(),
|
||||
guard_cap_data.words[0],
|
||||
_pd->page_directory_sel().value(),
|
||||
no_cap_data.words[0]);
|
||||
ASSERT(ret == 0);
|
||||
|
||||
start_sel4_thread(_info.tcb_sel, (addr_t)ip, (addr_t)(sp), _location.xpos());
|
||||
|
@ -52,12 +52,12 @@ void Thread::_init_platform_thread(size_t, Type type)
|
||||
|
||||
Platform &platform = *platform_specific();
|
||||
|
||||
seL4_CapData_t guard = seL4_CapData_Guard_new(0, CONFIG_WORD_SIZE - 32);
|
||||
seL4_CapData_t no_cap_data = { { 0 } };
|
||||
seL4_CNode_CapData guard = seL4_CNode_CapData_new(0, CONFIG_WORD_SIZE - 32);
|
||||
seL4_CNode_CapData no_cap_data = { { 0 } };
|
||||
int const ret = seL4_TCB_SetSpace(native_thread().tcb_sel, 0,
|
||||
platform.top_cnode().sel().value(),
|
||||
guard,
|
||||
seL4_CapInitThreadPD, no_cap_data);
|
||||
guard.words[0],
|
||||
seL4_CapInitThreadPD, no_cap_data.words[0]);
|
||||
ASSERT(ret == seL4_NoError);
|
||||
|
||||
/* mint notification object with badge - used by Genode::Lock */
|
||||
|
@ -157,7 +157,7 @@ static void decode_seL4_message(seL4_MessageInfo_t const &msg_info,
|
||||
*/
|
||||
arg_badges[i] = Rpc_obj_key::INVALID;
|
||||
else
|
||||
arg_badges[i] = seL4_CapData_Badge_get_Badge(seL4_GetBadge(i));
|
||||
arg_badges[i] = seL4_GetBadge(i);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user