-/* $OpenBSD: agtimer.c,v 1.3 2015/05/29 05:48:07 jsg Exp $ */
+/* $OpenBSD: agtimer.c,v 1.4 2015/06/06 16:49:04 jsg Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2013 Patrick Wildt <patrick@blueri.se>
struct agtimer_pcpu_softc *pc = &sc->sc_pstat[CPU_INFO_UNIT(curcpu())];
uint64_t now;
uint64_t nextevent;
- uint32_t r, reg;
+ uint32_t r;
#if defined(USE_GTIMER_CMP)
int skip = 1;
#else
agtimer_set_tval(delay);
- reg = agtimer_get_ctrl();
- if (reg & GTIMER_CNTP_CTL_ISTATUS) {
- reg |= GTIMER_CNTP_CTL_IMASK;
- agtimer_set_ctrl(reg);
- }
-
return (rc);
}
/* establish interrupts */
/* XXX - irq */
+
+ /* secure physical timer */
ampintc_intr_establish(29, IPL_CLOCK, agtimer_intr,
NULL, "tick");
+ /* non-secure physical timer */
+ ampintc_intr_establish(30, IPL_CLOCK, agtimer_intr,
+ NULL, "tick");
next = agtimer_readcnt64(sc) + sc->sc_ticks_per_intr;
pc->pc_nexttickevent = pc->pc_nextstatevent = next;