aboutsummaryrefslogtreecommitdiff
path: root/pk/boot.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-03-05 14:34:18 -0800
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-03-05 14:34:18 -0800
commit80447e5711461fa58cf61d17a6a1b79f7dcd5294 (patch)
tree56a5ace30a808a606346c63b9d533cbcb787619e /pk/boot.h
parentbbc9a65fed7c85ee058d7188a62f0b904c38b77b (diff)
downloadpk-80447e5711461fa58cf61d17a6a1b79f7dcd5294.zip
pk-80447e5711461fa58cf61d17a6a1b79f7dcd5294.tar.gz
pk-80447e5711461fa58cf61d17a6a1b79f7dcd5294.tar.bz2
Disentangle PK and BBL a bit
Diffstat (limited to 'pk/boot.h')
-rw-r--r--pk/boot.h47
1 files changed, 47 insertions, 0 deletions
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 <stdint.h>
+#include <stddef.h>
+
+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