[commit] r1289 - in trunk/openbios-devel: arch/sparc64 forth/device

Author: mcayland Date: Mon May 12 17:43:35 2014 New Revision: 1289 URL: http://tracker.coreboot.org/trac/openbios/changeset/1289 Log: SPARC64: add basic get-msecs implementation This is currently based upon the %tick register, although at some point it should be moved to a per-CPU timer. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Modified: trunk/openbios-devel/arch/sparc64/openbios.c trunk/openbios-devel/forth/device/other.fs Modified: trunk/openbios-devel/arch/sparc64/openbios.c ============================================================================== --- trunk/openbios-devel/arch/sparc64/openbios.c Mon May 12 17:43:22 2014 (r1288) +++ trunk/openbios-devel/arch/sparc64/openbios.c Mon May 12 17:43:35 2014 (r1289) @@ -561,6 +561,8 @@ PUSH(virt + MEMORY_SIZE); } +extern volatile uint64_t *obp_ticks_pointer; + static void arch_init( void ) { @@ -572,6 +574,10 @@ nvconf_init(); device_end(); + /* Point to the Forth obp-ticks variable */ + fword("obp-ticks"); + obp_ticks_pointer = cell2pointer(POP()); + bind_func("platform-boot", boot ); bind_func("(go)", go); } Modified: trunk/openbios-devel/forth/device/other.fs ============================================================================== --- trunk/openbios-devel/forth/device/other.fs Mon May 12 17:43:22 2014 (r1288) +++ trunk/openbios-devel/forth/device/other.fs Mon May 12 17:43:35 2014 (r1289) @@ -93,21 +93,21 @@ \ 5.3.7.3 Time -[IFDEF] CONFIG_SPARC32 +[IFDEF] CONFIG_PPC -\ OBP tick value updated by timer interrupt -variable obp-ticks +0 value dummy-msecs : get-msecs ( -- n ) - obp-ticks @ + dummy-msecs dup 1+ to dummy-msecs ; [ELSE] -0 value dummy-msecs +\ OBP tick value updated by timer interrupt +variable obp-ticks : get-msecs ( -- n ) - dummy-msecs dup 1+ to dummy-msecs + obp-ticks @ ; [THEN]
participants (1)
-
repository service