Changeset View
Changeset View
Standalone View
Standalone View
sys/riscv/riscv/machdep.c
Show First 20 Lines • Show All 112 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. */ | uint32_t boot_hart; /* The hart we booted on. */ | ||||
cpuset_t all_harts; | cpuset_t all_harts; | ||||
u_int cpuid_hart_map[MAXCPU]; /* Mapping between cpuid and hart number */ | |||||
extern int *end; | extern int *end; | ||||
extern int *initstack_end; | extern int *initstack_end; | ||||
static void | static void | ||||
cpu_startup(void *dummy) | cpu_startup(void *dummy) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 709 Lines • ▼ Show 20 Lines | initriscv(struct riscv_bootparams *rvbp) | ||||
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; | pcpup->pc_hart = boot_hart; | ||||
/* Set the pcpu pointer */ | /* Set the pcpu pointer */ | ||||
__asm __volatile("mv tp, %0" :: "r"(pcpup)); | __asm __volatile("mv tp, %0" :: "r"(pcpup)); | ||||
PCPU_SET(curthread, &thread0); | PCPU_SET(curthread, &thread0); | ||||
/* Set the boot hart mapping */ | |||||
cpuid_hart_map[0] = boot_hart; | |||||
/* Set the module data location */ | /* Set the module data location */ | ||||
lastaddr = fake_preload_metadata(rvbp); | lastaddr = fake_preload_metadata(rvbp); | ||||
/* Find the kernel address */ | /* Find the kernel address */ | ||||
kmdp = preload_search_by_type("elf kernel"); | kmdp = preload_search_by_type("elf kernel"); | ||||
if (kmdp == NULL) | if (kmdp == NULL) | ||||
kmdp = preload_search_by_type("elf64 kernel"); | kmdp = preload_search_by_type("elf64 kernel"); | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |