Changeset View
Changeset View
Standalone View
Standalone View
head/sys/riscv/riscv/machdep.c
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | |||||
u_int physmap_idx; | u_int physmap_idx; | ||||
struct kva_md_info kmi; | struct kva_md_info kmi; | ||||
int64_t dcache_line_size; /* The minimum D cache line size */ | int64_t dcache_line_size; /* The minimum D cache line size */ | ||||
int64_t icache_line_size; /* The minimum I cache line size */ | int64_t icache_line_size; /* The minimum I cache line size */ | ||||
int64_t idcache_line_size; /* The minimum cache line size */ | int64_t idcache_line_size; /* The minimum cache line size */ | ||||
uint32_t boot_hart; /* The hart we booted on. */ | |||||
cpuset_t all_harts; | |||||
extern int *end; | extern int *end; | ||||
extern int *initstack_end; | extern int *initstack_end; | ||||
uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs); | uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs); | ||||
uintptr_t | uintptr_t | ||||
mcall_trap(uintptr_t mcause, uintptr_t* regs) | mcall_trap(uintptr_t mcause, uintptr_t* regs) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 682 Lines • ▼ Show 20 Lines | initriscv(struct riscv_bootparams *rvbp) | ||||
vm_offset_t lastaddr; | vm_offset_t lastaddr; | ||||
vm_size_t kernlen; | vm_size_t kernlen; | ||||
caddr_t kmdp; | caddr_t kmdp; | ||||
int i; | int i; | ||||
/* Set the pcpu data, this is needed by pmap_bootstrap */ | /* Set the pcpu data, this is needed by pmap_bootstrap */ | ||||
pcpup = &__pcpu[0]; | pcpup = &__pcpu[0]; | ||||
pcpu_init(pcpup, 0, sizeof(struct pcpu)); | pcpu_init(pcpup, 0, sizeof(struct pcpu)); | ||||
pcpup->pc_hart = boot_hart; | |||||
/* Set the pcpu pointer */ | /* Set the pcpu pointer */ | ||||
__asm __volatile("mv gp, %0" :: "r"(pcpup)); | __asm __volatile("mv gp, %0" :: "r"(pcpup)); | ||||
PCPU_SET(curthread, &thread0); | PCPU_SET(curthread, &thread0); | ||||
/* Set the module data location */ | /* Set the module data location */ | ||||
lastaddr = fake_preload_metadata(rvbp); | lastaddr = fake_preload_metadata(rvbp); | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |