Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/arm/generic_timer.c
Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
setup_user_access(void *arg __unused) | setup_user_access(void *arg __unused) | ||||
{ | { | ||||
uint32_t cntkctl; | uint32_t cntkctl; | ||||
cntkctl = get_el1(cntkctl); | cntkctl = get_el1(cntkctl); | ||||
cntkctl &= ~(GT_CNTKCTL_PL0PTEN | GT_CNTKCTL_PL0VTEN | | cntkctl &= ~(GT_CNTKCTL_PL0PTEN | GT_CNTKCTL_PL0VTEN | | ||||
GT_CNTKCTL_EVNTEN); | GT_CNTKCTL_EVNTEN | GT_CNTKCTL_PL0PCTEN); | ||||
/* Always enable the virtual timer */ | |||||
cntkctl |= GT_CNTKCTL_PL0VCTEN; | |||||
/* Enable the physical timer if supported */ | |||||
if (arm_tmr_sc->physical) { | if (arm_tmr_sc->physical) { | ||||
cntkctl |= GT_CNTKCTL_PL0PCTEN; | cntkctl |= GT_CNTKCTL_PL0PCTEN; | ||||
cntkctl &= ~GT_CNTKCTL_PL0VCTEN; | |||||
} else { | |||||
cntkctl |= GT_CNTKCTL_PL0VCTEN; | |||||
cntkctl &= ~GT_CNTKCTL_PL0PCTEN; | |||||
} | } | ||||
set_el1(cntkctl, cntkctl); | set_el1(cntkctl, cntkctl); | ||||
isb(); | isb(); | ||||
} | } | ||||
#ifdef __aarch64__ | #ifdef __aarch64__ | ||||
static int | static int | ||||
cntpct_handler(vm_offset_t va, uint32_t insn, struct trapframe *frame, | cntpct_handler(vm_offset_t va, uint32_t insn, struct trapframe *frame, | ||||
▲ Show 20 Lines • Show All 395 Lines • Show Last 20 Lines |