From 6aa84fd30d23e109f66f9c05e87eda9d4ce7290f Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Fri, 24 Jul 2015 18:42:38 -0700 Subject: Undo last commit It breaks programs that rely on ELF program headers. --- pk/init.c | 4 +++- pk/minit.c | 3 +-- pk/pk.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'pk') diff --git a/pk/init.c b/pk/init.c index f029340..851e878 100644 --- a/pk/init.c +++ b/pk/init.c @@ -84,7 +84,7 @@ struct mainvars* parse_args(struct mainvars* args) return (struct mainvars*)&args->argv[a0-1]; } -void load_program(struct mainvars* args) +void boot_loader(struct mainvars* args) { // load program named by argv[0] long phdrs[128]; @@ -93,4 +93,6 @@ void load_program(struct mainvars* args) if (!args->argc) panic("tell me what ELF to load!"); load_elf((char*)(uintptr_t)args->argv[0], ¤t); + + run_loaded_program(args); } diff --git a/pk/minit.c b/pk/minit.c index b22565d..b8a0b48 100644 --- a/pk/minit.c +++ b/pk/minit.c @@ -67,8 +67,7 @@ static void init_first_hart() memory_init(); vm_init(); - load_program(args); - run_loaded_program(args); + boot_loader(args); } static void init_other_hart() diff --git a/pk/pk.h b/pk/pk.h index 588392c..9bcf8da 100644 --- a/pk/pk.h +++ b/pk/pk.h @@ -60,7 +60,7 @@ void handle_misaligned_load(trapframe_t*); void handle_misaligned_store(trapframe_t*); void handle_fault_load(trapframe_t*); void handle_fault_store(trapframe_t*); -void load_program(struct mainvars*); +void boot_loader(struct mainvars*); void run_loaded_program(struct mainvars*); void boot_other_hart(); -- cgit v1.1