From b73b3e5a2d7168411b3db36c9a08570feefc83a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 16 Oct 2003 17:55:21 +0000 Subject: [PATCH] Changes for the ELF loader in the boot loader. Removed the arch_mmu_alloc() function, added (empty) arch_mmu_free() function. Added platform prototypes for allocating and freeing a region. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5044 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/boot/elf.h | 21 +++++++++++++++++++ headers/private/kernel/boot/kernel_args.h | 4 ++++ headers/private/kernel/boot/platform.h | 4 ++++ .../platform/openfirmware/platform_arch.h | 4 ++-- 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 headers/private/kernel/boot/elf.h diff --git a/headers/private/kernel/boot/elf.h b/headers/private/kernel/boot/elf.h new file mode 100644 index 0000000000..d790e646bc --- /dev/null +++ b/headers/private/kernel/boot/elf.h @@ -0,0 +1,21 @@ +/* +** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the OpenBeOS License. +*/ +#ifndef KERNEL_BOOT_ELF_H +#define KERNEL_BOOT_ELF_H + + +#include + + +struct preloaded_image { + struct preloaded_image *next; + char *name; + elf_region text_region; + elf_region data_region; + addr dynamic_section; // pointer to the dynamic section + Elf32_Ehdr elf_header; +}; + +#endif /* KERNEL_BOOT_ELF_H */ diff --git a/headers/private/kernel/boot/kernel_args.h b/headers/private/kernel/boot/kernel_args.h index d5f41ceda6..cebadd3f3e 100644 --- a/headers/private/kernel/boot/kernel_args.h +++ b/headers/private/kernel/boot/kernel_args.h @@ -17,6 +17,8 @@ typedef struct address_range { #include #include +struct preloaded_image; + typedef struct kernel_args { uint32 cons_line; char *str; @@ -25,6 +27,8 @@ typedef struct kernel_args { addr_range kernel_seg1_addr; addr_range kernel_dynamic_section_addr; + struct preloaded_image *preloaded_images; + uint32 num_physical_memory_ranges; addr_range physical_memory_range[MAX_PHYSICAL_MEMORY_RANGE]; uint32 num_physical_allocated_ranges; diff --git a/headers/private/kernel/boot/platform.h b/headers/private/kernel/boot/platform.h index bdeac5405f..dab812d601 100644 --- a/headers/private/kernel/boot/platform.h +++ b/headers/private/kernel/boot/platform.h @@ -24,6 +24,10 @@ extern void dprintf(const char *format, ...); extern void platform_release_heap(struct stage2_args *args, void *base); extern status_t platform_init_heap(struct stage2_args *args, void **_base, void **_top); +/* MMU/memory functions */ +extern status_t platform_allocate_region(void **_virtualAddress, size_t size, uint8 protection); +extern status_t platform_free_region(void *address, size_t size); + /* misc functions */ extern bool platform_user_menu_requested(void); diff --git a/headers/private/kernel/boot/platform/openfirmware/platform_arch.h b/headers/private/kernel/boot/platform/openfirmware/platform_arch.h index eccb46d37a..886137e330 100644 --- a/headers/private/kernel/boot/platform/openfirmware/platform_arch.h +++ b/headers/private/kernel/boot/platform/openfirmware/platform_arch.h @@ -13,8 +13,8 @@ extern "C" { #endif -extern void *arch_mmu_alloc_at(void *address, size_t size, uint8 protection); -extern void *arch_mmu_alloc(size_t size, uint8 protection); +extern void *arch_mmu_allocate(void *address, size_t size, uint8 protection); +extern status_t arch_mmu_free(void *address, size_t size); extern status_t arch_mmu_init(void); #ifdef __cplusplus