Changeset 305 for asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h
- Timestamp:
- Jun 26, 2017, 6:45:41 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_wo_tecs/trunk/arch/arm_gcc/common/core_test.h
r302 r305 4 4 * Advanced Standard Profile Kernel 5 5 * 6 * Copyright (C) 2006-201 5by Embedded and Real-Time Systems Laboratory6 * Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory 7 7 * Graduate School of Information Science, Nagoya Univ., JAPAN 8 8 * … … 51 51 * ã®è²¬ä»»ãè² ããªãï¼ 52 52 * 53 * $Id: core_test.h 460 2015-08-29 13:04:06Z ertl-hiro $53 * $Id: core_test.h 524 2016-01-14 11:01:56Z ertl-hiro $ 54 54 */ 55 55 … … 146 146 147 147 #endif 148 149 /*150 * ããã©ã¼ãã³ã¹ã¢ãã¿ã«ããæ§è½è©ä¾¡151 */152 #if defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7153 154 /*155 * ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®ãã¼ã¿å156 */157 typedef uint32_t PMCNT;158 159 /*160 * ããã©ã¼ãã³ã¹ã¢ãã¿ã®åæå161 */162 Inline void163 arm_init_pmcnt(void)164 {165 uint32_t reg;166 167 /*168 * ããã©ã¼ãã³ã¹ã¢ãã¿ã®æå¹å169 *170 * TOPPERS_ARM_PMCNT_DIV64ãå®ç¾©ããã¦ããå ´åã¯ï¼64ã¯ããã¯æ¯ã«ã«171 * ã¦ã³ãã¢ããããï¼172 */173 CP15_READ_PMCR(reg);174 reg |= CP15_PMCR_ALLCNTR_ENABLE;175 176 #ifdef TOPPERS_ARM_PMCNT_DIV64177 reg |= CP15_PMCR_PMCCNTR_DIVIDER;178 #else /* !TOPPERS_ARM_PMCNT_DIV64 */179 reg &= ~CP15_PMCR_PMCCNTR_DIVIDER;180 #endif /* TOPPERS_ARM_PMCNT_DIV64 */181 182 CP15_WRITE_PMCR(reg);183 184 /*185 * ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®æå¹å186 */187 CP15_READ_PMCNTENSET(reg);188 reg |= CP15_PMCNTENSET_CCNTR_ENABLE;189 CP15_WRITE_PMCNTENSET(reg);190 }191 192 /*193 * ããã©ã¼ãã³ã¹ã¢ãã¿ã®ã«ã¦ã³ã¿ã®èªã¿è¾¼ã¿194 */195 Inline void196 arm_get_pmcnt(PMCNT *p_count)197 {198 CP15_READ_PMCCNTR(*p_count);199 }200 201 /*202 * ã«ã¦ã³ã¿å¤ã®æéè¨æ¸¬åä½ã¸ã®å¤æ203 *204 * æéè¨æ¸¬ã®åä½ã¯ï¼ç¾ç¶ã¯ããç§ã«ãªã£ã¦ããï¼ãã¤ã¯ãç§åä½ã«ããè¨205 * å®ã欲ããã¨æãããï¼ï¼206 */207 Inline uint_t208 arm_conv_time(PMCNT count) {209 #ifdef TOPPERS_ARM_PMCNT_DIV64210 return(((uint_t) count) * (1000 * 64) / CORE_CLK_MHZ);211 #else /* !TOPPERS_ARM_PMCNT_DIV64 */212 return(((uint_t) count) * 1000 / CORE_CLK_MHZ);213 #endif /* TOPPERS_ARM_PMCNT_DIV64 */214 }215 216 #define HISTTIM PMCNT217 #define HIST_GET_TIM(p_time) (arm_get_pmcnt(p_time))218 #define HIST_CONV_TIM(time) (arm_conv_tim(time))219 #define HIST_BM_HOOK() ((void) 0)220 221 #endif /* defined(USE_ARM_PM_HIST) && __TARGET_ARCH_ARM == 7 */222 148 #endif /* TOPPERS_CORE_TEST_H */
Note:
See TracChangeset
for help on using the changeset viewer.