diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-05-29 18:24:28 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-05-29 18:24:28 -0700 |
commit | cffdcee338ea682c74fa778244241e2f060199bf (patch) | |
tree | 17cbc43440db766cc5aba5a03afdc07e83e03e93 /pk/bbl.c | |
parent | 835d03d2160be9ee50ba5fd892554ef62fcb13b8 (diff) | |
download | pk-cffdcee338ea682c74fa778244241e2f060199bf.zip pk-cffdcee338ea682c74fa778244241e2f060199bf.tar.gz pk-cffdcee338ea682c74fa778244241e2f060199bf.tar.bz2 |
Make boot loader/SBI changes to support SMP Linux
Diffstat (limited to 'pk/bbl.c')
-rw-r--r-- | pk/bbl.c | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -1,6 +1,15 @@ #include "pk.h" #include "vm.h" +volatile int elf_loaded; + +static void enter_entry_point() +{ + write_csr(mepc, current.entry); + asm volatile("eret"); + __builtin_unreachable(); +} + void run_loaded_program(struct mainvars* args) { if (!current.is_supervisor) @@ -10,7 +19,15 @@ void run_loaded_program(struct mainvars* args) #ifdef PK_ENABLE_LOGO print_logo(); #endif - write_csr(mepc, current.entry); - asm volatile("eret"); - __builtin_unreachable(); + mb(); + elf_loaded = 1; + enter_entry_point(); +} + +void boot_other_hart() +{ + while (!elf_loaded) + ; + mb(); + enter_entry_point(); } |