aboutsummaryrefslogtreecommitdiff
path: root/bbl/bbl.c
blob: 9553ddb60eb780554e7c4b109bcfe4fb4e7a4dd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "bbl.h"
#include "mtrap.h"
#include "atomic.h"
#include "vm.h"
#include "bits.h"
#include "config.h"
#include <string.h>

static const void* entry_point;

void boot_other_hart()
{
  const void* entry;
  do {
    entry = entry_point;
    mb();
  } while (!entry);
  enter_supervisor_mode(entry, read_csr(mhartid), 0);
}

void boot_loader()
{
  extern char _payload_start;
#ifdef PK_ENABLE_LOGO
  print_logo();
#endif
  mb();
  entry_point = &_payload_start;
  boot_other_hart();
}