aboutsummaryrefslogtreecommitdiff
path: root/bbl/bbl.c
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2017-02-17 01:54:52 -0800
committerAndrew Waterman <andrew@sifive.com>2017-02-17 01:55:00 -0800
commitb14d4187fe1a328b9e87f61a984fd70e17211954 (patch)
treef8e8e8ec17b3092edbaf4c79e404bcac1e86be3e /bbl/bbl.c
parent926b360655fd7a22413c7732faceeea21a224aa1 (diff)
downloadriscv-pk-b14d4187fe1a328b9e87f61a984fd70e17211954.zip
riscv-pk-b14d4187fe1a328b9e87f61a984fd70e17211954.tar.gz
riscv-pk-b14d4187fe1a328b9e87f61a984fd70e17211954.tar.bz2
Clean up boot loader for physical address loading
Diffstat (limited to 'bbl/bbl.c')
-rw-r--r--bbl/bbl.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bbl/bbl.c b/bbl/bbl.c
index 96605fd..bdd56ad 100644
--- a/bbl/bbl.c
+++ b/bbl/bbl.c
@@ -6,25 +6,24 @@
#include "config.h"
#include <string.h>
-static kernel_elf_info info;
-static volatile int elf_loaded;
+static volatile uintptr_t entry_point;
void boot_other_hart()
{
- while (!elf_loaded)
+ while (!entry_point)
;
mb();
- enter_supervisor_mode((void *)info.entry + info.load_offset, read_csr(mhartid), 0);
+ enter_supervisor_mode((void *)entry_point, read_csr(mhartid), 0);
}
void boot_loader()
{
extern char _payload_start, _payload_end;
- load_kernel_elf(&_payload_start, &_payload_end - &_payload_start, &info);
+ uintptr_t entry = load_kernel_elf(&_payload_start, &_payload_end - &_payload_start);
#ifdef PK_ENABLE_LOGO
print_logo();
#endif
mb();
- elf_loaded = 1;
+ entry_point = entry;
boot_other_hart();
}