Changeset View
Changeset View
Standalone View
Standalone View
head/sys/riscv/riscv/locore.S
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | 2: | ||||
mulw a5, a5, a6 | mulw a5, a5, a6 | ||||
add t0, s1, a5 | add t0, s1, a5 | ||||
sd t6, (t0) | sd t6, (t0) | ||||
/* Create an L2 page superpage for DTB */ | /* Create an L2 page superpage for DTB */ | ||||
lla s1, pagetable_l2_devmap | lla s1, pagetable_l2_devmap | ||||
mv s2, a1 | mv s2, a1 | ||||
srli s2, s2, PAGE_SHIFT | srli s2, s2, PAGE_SHIFT | ||||
/* Mask off any bits that aren't aligned */ | |||||
andi s2, s2, ~((1 << (PTE_PPN1_S - PTE_PPN0_S)) - 1) | |||||
li t0, (PTE_KERN) | li t0, (PTE_KERN) | ||||
slli t2, s2, PTE_PPN0_S /* << PTE_PPN0_S */ | slli t2, s2, PTE_PPN0_S /* << PTE_PPN0_S */ | ||||
or t0, t0, t2 | or t0, t0, t2 | ||||
/* Store PTE entry to position */ | /* Store PTE entry to position */ | ||||
li a6, PTE_SIZE | li a6, PTE_SIZE | ||||
li a5, 510 | li a5, 510 | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | #endif | ||||
la t0, pagetable_l1 | la t0, pagetable_l1 | ||||
sd t0, RISCV_BOOTPARAMS_KERN_L1PT(sp) | sd t0, RISCV_BOOTPARAMS_KERN_L1PT(sp) | ||||
sd s9, RISCV_BOOTPARAMS_KERN_PHYS(sp) | sd s9, RISCV_BOOTPARAMS_KERN_PHYS(sp) | ||||
la t0, initstack | la t0, initstack | ||||
sd t0, RISCV_BOOTPARAMS_KERN_STACK(sp) | sd t0, RISCV_BOOTPARAMS_KERN_STACK(sp) | ||||
li t0, (VM_EARLY_DTB_ADDRESS) | li t0, (VM_EARLY_DTB_ADDRESS) | ||||
/* Add offset of DTB within superpage */ | |||||
li t1, (L2_OFFSET) | |||||
and t1, a1, t1 | |||||
add t0, t0, t1 | |||||
sd t0, RISCV_BOOTPARAMS_DTBP_VIRT(sp) | sd t0, RISCV_BOOTPARAMS_DTBP_VIRT(sp) | ||||
mv a0, sp | mv a0, sp | ||||
call _C_LABEL(initriscv) /* Off we go */ | call _C_LABEL(initriscv) /* Off we go */ | ||||
call _C_LABEL(mi_startup) | call _C_LABEL(mi_startup) | ||||
/* | /* | ||||
* Get the physical address the kernel is loaded to. Returned in s9. | * Get the physical address the kernel is loaded to. Returned in s9. | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |