Changeset 3fa509b in mainline
- Timestamp:
- 2013-01-19T23:59:25Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9eec7bc
- Parents:
- 4b28c70
- Location:
- kernel/arch/arm32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/asm.h
r4b28c70 r3fa509b 43 43 #include <trace.h> 44 44 45 /** No such instruction on old ARM to sleep CPU.45 /** CPU specific way to sleep cpu. 46 46 * 47 47 * ARMv7 introduced wait for event and wait for interrupt (wfe/wfi). -
kernel/arch/arm32/include/cp15.h
r4b28c70 r3fa509b 416 416 CONTROL_REG_GEN_WRITE(TLBIALLNSNHS, c8, 4, c7, 4); 417 417 418 /* c9 are reserved */ 418 /* c9 are performance monitoring resgisters */ 419 enum { 420 PMCR_IMP_MASK = 0xff, 421 PMCR_IMP_SHIFT = 24, 422 PMCR_IDCODE_MASK = 0xff, 423 PMCR_IDCODE_SHIFT = 16, 424 PMCR_EVENT_NUM_MASK = 0x1f, 425 PMCR_EVENT_NUM_SHIFT = 11, 426 PMCR_DP_FLAG = 1 << 5, 427 PMCR_X_FLAG = 1 << 4, 428 PMCR_D_FLAG = 1 << 3, 429 PMCR_C_FLAG = 1 << 2, 430 PMCR_P_FLAG = 1 << 1, 431 PMCR_E_FLAG = 1 << 0, 432 }; 433 CONTROL_REG_GEN_READ(PMCR, c9, 0, c12, 0); 434 CONTROL_REG_GEN_WRITE(PMCR, c9, 0, c12, 0); 435 enum { 436 PMCNTENSET_CYCLE_COUNTER_EN_FLAG = 1 << 31, 437 #define PMCNTENSET_COUNTER_EN_FLAG(c) (1 << c) 438 }; 439 CONTROL_REG_GEN_READ(PMCNTENSET, c9, 0, c12, 1); 440 CONTROL_REG_GEN_WRITE(PMCNTENSET, c9, 0, c12, 1); 441 CONTROL_REG_GEN_READ(PMCCNTR, c9, 0, c13, 0); 442 CONTROL_REG_GEN_WRITE(PMCCNTR, c9, 0, c13, 0); 443 419 444 420 445 /*c10 has tons of reserved too */ -
kernel/arch/arm32/include/cycle.h
r4b28c70 r3fa509b 38 38 39 39 #include <trace.h> 40 #include <arch/cp15.h> 40 41 41 42 /** Return count of CPU cycles. … … 48 49 NO_TRACE static inline uint64_t get_cycle(void) 49 50 { 51 #ifdef PROCESSOR_ARCH_armv7_a 52 if ((ID_PFR1_read() & ID_PFR1_GEN_TIMER_EXT_MASK) == 53 ID_PFR1_GEN_TIMER_EXT) { 54 uint32_t low = 0, high = 0; 55 asm volatile( "MRRC p15, 0, %[low], %[high], c14": [low]"=r"(low), [high]"=r"(high)); 56 return ((uint64_t)high << 32) | low; 57 } else { 58 return PMCCNTR_read(); 59 } 60 #endif 50 61 return 0; 51 62 } -
kernel/arch/arm32/src/cpu/cpu.c
r4b28c70 r3fa509b 168 168 fpu_setup(); 169 169 #endif 170 171 #ifdef PROCESSOR_ARCH_armv7_a 172 PMCR_write(PMCR_read() | PMCR_E_FLAG); 173 PMCNTENSET_write(PMCNTENSET_CYCLE_COUNTER_EN_FLAG); 174 #endif 170 175 } 171 176
Note:
See TracChangeset
for help on using the changeset viewer.