[OpenBIOS] [PATCH 2/5] SPARC64: increment ms counter at obp_tick_pointer on every timer interrupt

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun May 4 19:29:40 CEST 2014


This is in preparation for a get-ms implementation for SPARC64.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/arch/sparc64/vectors.S |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/openbios-devel/arch/sparc64/vectors.S b/openbios-devel/arch/sparc64/vectors.S
index 600043a..927c1cd 100644
--- a/openbios-devel/arch/sparc64/vectors.S
+++ b/openbios-devel/arch/sparc64/vectors.S
@@ -276,7 +276,7 @@ tl1_resv1f0:	BTRAPS(0x1f0) BTRAPS(0x1f8)
 
 	.section ".data"
 	.align 8
-	.globl tlb_handler_stack_top, tlb_handler_stack_pointer
+	.globl tlb_handler_stack_top, tlb_handler_stack_pointer, obp_ticks_pointer
 
 	! Stack for the tlb MMU trap handlers
 tlb_handler_stack_bottom:
@@ -288,6 +288,10 @@ tlb_handler_stack_top:
 tlb_handler_stack_pointer:
 	.xword tlb_handler_stack_top
 
+	! Pointer to current tick value
+obp_ticks_pointer:
+	.xword 0
+
         .section ".text", "ax"
 
 spill_32bit:
@@ -618,6 +622,18 @@ softint_irq:
         and     %g1, %g2, %g1
         brnz,pn %g1, tick_compare_disabled
          nop
+
+        /* update tick value if pointer set */
+        setx    obp_ticks_pointer, %g3, %g1
+        ldx     [%g1], %g3
+        brz     %g3, tick_rearm
+         nop
+
+        ldx     [%g3], %g1
+        add     %g1, 10, %g1    ! 100Hz = 10ms
+        stx     %g1, [%g3]
+         
+tick_rearm:         
         set     TICK_INTERVAL, %g1
         add     %g1, %g2, %g1
         wr      %g1, 0, %tick_cmpr
-- 
1.7.10.4




More information about the OpenBIOS mailing list