feat(arch timer): helpers to configure EL1 physical timer

Hafnium exposes partitions to EL1 physical timer (though it actually
traps and emulates them behind the scenes).
Hence, the arch timer helper utilities are enhanced to take care of
EL1 physical timer peripheral.

Complete support for arch timer is added in subsequent patches.

Change-Id: I15aae69b7429b5f7ceb2431ffd49e570585e63b7
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/src/api.c b/src/api.c
index 79278ce..68558d2 100644
--- a/src/api.c
+++ b/src/api.c
@@ -1442,20 +1442,11 @@
 	 * regs_available was true (and then set it to false) before returning
 	 * true.
 	 */
-	if (arch_timer_pending(&vcpu->regs)) {
+	if (arch_timer_expired(&vcpu->regs)) {
 		/* Make virtual timer interrupt pending. */
 		api_interrupt_inject_locked(vcpu_next_locked,
 					    HF_VIRTUAL_TIMER_INTID,
 					    vcpu_next_locked, NULL);
-
-		/*
-		 * Set the mask bit so the hardware interrupt doesn't fire
-		 * again. Ideally we wouldn't do this because it affects what
-		 * the secondary vCPU sees, but if we don't then we end up with
-		 * a loop of the interrupt firing each time we try to return to
-		 * the secondary vCPU.
-		 */
-		arch_timer_mask(&vcpu->regs);
 	}
 
 	/* Switch to the vCPU. */
@@ -2962,12 +2953,10 @@
 	}
 
 	/* Inject timer interrupt if any pending */
-	if (arch_timer_pending(&receiver_vcpu->regs)) {
+	if (arch_timer_expired(&receiver_vcpu->regs)) {
 		api_interrupt_inject_locked(receiver_vcpu_locked,
 					    HF_VIRTUAL_TIMER_INTID,
 					    current_locked, NULL);
-
-		arch_timer_mask(&receiver_vcpu->regs);
 	}
 
 	/* The receiver vCPU runs upon direct message invocation */