Changeset 0a78e4f in mainline
- Timestamp:
- 2017-08-22T16:08:00Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b93ea46a
- Parents:
- d639eaa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/riscv64/src/asm.S
rd639eaa r0a78e4f 30 30 #include <arch/arch.h> 31 31 #include <arch/mm.h> 32 33 #define MCOUNTEREN_CY_MASK 0x00000001 34 #define MCOUNTEREN_TM_MASK 0x00000002 35 #define MCOUNTEREN_IR_MASK 0x00000004 32 36 33 37 #define MSTATUS_MPP_MASK 0x00001800 … … 91 95 92 96 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 93 100 /* Setup SV48 paging for supervisor mode */ 94 101 la t0, ptl_0 … … 108 115 li t1, ~MSTATUS_MPP_MASK 109 116 and t0, t0, t1 110 111 117 112 118 /* -
kernel/arch/riscv64/include/arch/cycle.h
rd639eaa r0a78e4f 40 40 NO_TRACE static inline uint64_t get_cycle(void) 41 41 { 42 return 0; 42 uint64_t cycle; 43 44 asm volatile ( 45 "rdcycle %[cycle]\n" 46 : [cycle] "=r" (cycle) 47 ); 48 49 return cycle; 43 50 } 44 51
Note:
See TracChangeset
for help on using the changeset viewer.