Changes in boot/arch/riscv64/src/asm.S [0a78e4f:8b6aa39] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/riscv64/src/asm.S
r0a78e4f r8b6aa39 29 29 #include <abi/asmtool.h> 30 30 #include <arch/arch.h> 31 #include <arch/mm.h>32 33 #define MCOUNTEREN_CY_MASK 0x0000000134 #define MCOUNTEREN_TM_MASK 0x0000000235 #define MCOUNTEREN_IR_MASK 0x0000000436 37 #define MSTATUS_MPP_MASK 0x0000180038 #define MSTATUS_MPP_USER 0x0000000039 #define MSTATUS_MPP_SUPERVISOR 0x0000080040 #define MSTATUS_MPP_MACHINE 0x0000180041 42 #define MSTATUS_SUM_MASK 0x0004000043 44 #define SATP_PFN_MASK 0x00000fffffffffff45 46 #define SATP_MODE_MASK 0xf00000000000000047 #define SATP_MODE_BARE 0x000000000000000048 #define SATP_MODE_SV39 0x800000000000000049 #define SATP_MODE_SV48 0x900000000000000050 31 51 32 .section BOOTSTRAP … … 95 76 96 77 FUNCTION_BEGIN(jump_to_kernel) 97 /* Enable performance counters access in supervisor mode */ 98 csrsi mcounteren, MCOUNTEREN_CY_MASK | MCOUNTEREN_TM_MASK | MCOUNTEREN_IR_MASK 99 100 /* Setup SV48 paging for supervisor mode */ 101 la t0, ptl_0 102 srli t0, t0, 12 103 104 li t1, SATP_PFN_MASK 105 and t0, t0, t1 106 107 li t1, SATP_MODE_SV48 108 or t0, t0, t1 109 110 csrw sptbr, t0 111 112 /* Jump to supervisor mode */ 113 csrr t0, mstatus 114 115 li t1, ~MSTATUS_MPP_MASK 116 and t0, t0, t1 117 118 /* 119 * TODO: Enable running with Supervisor User Mode 120 * access disabled. 121 */ 122 li t1, MSTATUS_MPP_SUPERVISOR | MSTATUS_SUM_MASK 123 or t0, t0, t1 124 125 csrw mstatus, t0 126 127 li ra, PA2KA(BOOT_OFFSET) 128 csrw mepc, ra 129 130 mret 78 j halt 131 79 FUNCTION_END(jump_to_kernel) 132 80 … … 140 88 SYMBOL(boot_stack) 141 89 .space BOOT_STACK_SIZE 142 143 .section .pt, "aw", @progbits144 145 .align PAGE_WIDTH146 SYMBOL(ptl_0)147 .fill 256, 8, 0148 /* Identity mapping for [0; 512G) */149 .quad 0 + (PTL_DIRTY | PTL_ACCESSED | PTL_EXECUTABLE | PTL_WRITABLE | PTL_READABLE | PTL_VALID)150 .fill 255, 8, 0
Note:
See TracChangeset
for help on using the changeset viewer.