From 80447e5711461fa58cf61d17a6a1b79f7dcd5294 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sat, 5 Mar 2016 14:34:18 -0800 Subject: Disentangle PK and BBL a bit --- pk/boot.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pk/boot.h (limited to 'pk/boot.h') diff --git a/pk/boot.h b/pk/boot.h new file mode 100644 index 0000000..d0d97d6 --- /dev/null +++ b/pk/boot.h @@ -0,0 +1,47 @@ +// See LICENSE for license details. + +#ifndef _BOOT_H +#define _BOOT_H + +#ifndef __ASSEMBLER__ + +#include +#include + +struct mainvars { + uint64_t argc; + uint64_t argv[127]; // this space is shared with the arg strings themselves +}; + +typedef struct { + int phent; + int phnum; + int is_supervisor; + size_t phdr; + size_t phdr_size; + size_t first_free_paddr; + size_t first_user_vaddr; + size_t first_vaddr_after_user; + size_t bias; + size_t entry; + size_t brk_min; + size_t brk; + size_t brk_max; + size_t mmap_max; + size_t stack_bottom; + size_t stack_top; + size_t t0; +} elf_info; + +extern elf_info current; + +void prepare_supervisor_mode(); +void run_loaded_program(struct mainvars*); +void boot_loader(); +void boot_other_hart(); +void load_elf(const char* fn, elf_info* info); +void print_logo(); + +#endif // !__ASSEMBLER__ + +#endif -- cgit v1.1