Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/arm/generic_timer.c
| Show First 20 Lines • Show All 886 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| uint64_t id_aa64isar2; | uint64_t id_aa64isar2; | ||||
| if (!get_kernel_reg(ID_AA64ISAR2_EL1, &id_aa64isar2)) | if (!get_kernel_reg(ID_AA64ISAR2_EL1, &id_aa64isar2)) | ||||
| return (false); | return (false); | ||||
| return (ID_AA64ISAR2_WFxT_VAL(id_aa64isar2) != ID_AA64ISAR2_WFxT_NONE); | return (ID_AA64ISAR2_WFxT_VAL(id_aa64isar2) != ID_AA64ISAR2_WFxT_NONE); | ||||
| } | } | ||||
| static void | static bool | ||||
| wfxt_enable(const struct cpu_feat *feat __unused, | wfxt_enable(const struct cpu_feat *feat __unused, | ||||
| cpu_feat_errata errata_status __unused, u_int *errata_list __unused, | cpu_feat_errata errata_status __unused, u_int *errata_list __unused, | ||||
| u_int errata_count __unused) | u_int errata_count __unused) | ||||
| { | { | ||||
| /* will be called if wfxt_check returns true */ | /* will be called if wfxt_check returns true */ | ||||
| enable_wfxt = true; | enable_wfxt = true; | ||||
| return (true); | |||||
| } | } | ||||
| CPU_FEAT(feat_wfxt, | CPU_FEAT(feat_wfxt, "WFE and WFI instructions with timeout", | ||||
| wfxt_check, NULL, wfxt_enable, | wfxt_check, NULL, wfxt_enable, | ||||
| CPU_FEAT_AFTER_DEV | CPU_FEAT_SYSTEM); | CPU_FEAT_AFTER_DEV | CPU_FEAT_SYSTEM); | ||||
| #endif | #endif | ||||
| static uint32_t | static uint32_t | ||||
| arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, | arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, | ||||
| struct timecounter *tc) | struct timecounter *tc) | ||||
| { | { | ||||
| vdso_th->th_algo = VDSO_TH_ALGO_ARM_GENTIM; | vdso_th->th_algo = VDSO_TH_ALGO_ARM_GENTIM; | ||||
| vdso_th->th_physical = arm_tmr_sc->physical_user; | vdso_th->th_physical = arm_tmr_sc->physical_user; | ||||
| bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); | bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); | ||||
| return (1); | return (1); | ||||
| } | } | ||||