Author: wmb Date: Tue Oct 11 20:17:44 2011 New Revision: 2588 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2588
Log: Added a FirmWorks-specific extension FCode "us" for microsecond-granularity delays.
Modified: cpu/arm/getms.fth cpu/arm/mmp2/timer.fth cpu/mips/getms.fth cpu/x86/acpitimer.fth cpu/x86/build/builder.dic cpu/x86/pc/getms.fth cpu/x86/tsc.fth ofw/core/ofwcore.fth ofw/fcode/extcodes.fth
Modified: cpu/arm/getms.fth ============================================================================== --- cpu/arm/getms.fth Tue Oct 11 20:09:09 2011 (r2587) +++ cpu/arm/getms.fth Tue Oct 11 20:17:44 2011 (r2588) @@ -22,7 +22,8 @@ c; : 1ms ( -- ) ms-factor spins ;
-: us ( #microseconds -- ) us-factor * spins ; +: (us) ( #microseconds -- ) us-factor * spins ; +' (us) to us
: (ms) ( #ms -- ) dup ms/tick 3 * u> interrupts-enabled? and if ( #ms )
Modified: cpu/arm/mmp2/timer.fth ============================================================================== --- cpu/arm/mmp2/timer.fth Tue Oct 11 20:09:09 2011 (r2587) +++ cpu/arm/mmp2/timer.fth Tue Oct 11 20:17:44 2011 (r2588) @@ -92,13 +92,14 @@ ; ' (ms) to ms
-: us ( delay-us -- ) +: (us) ( delay-us -- ) d# 13 2 */ timer0@ + ( limit ) begin ( limit ) dup timer0@ - ( limit delta ) 0< until ( limit ) drop ; +' (us) to us
\ Timing tools variable timestamp
Modified: cpu/mips/getms.fth ============================================================================== --- cpu/mips/getms.fth Tue Oct 11 20:09:09 2011 (r2587) +++ cpu/mips/getms.fth Tue Oct 11 20:17:44 2011 (r2588) @@ -24,7 +24,8 @@ begin dup count@ - 0<= until \ Loop until target time reached drop ( ) ; -: us ( #microseconds -- ) us-factor * ticks ; +: (us) ( #microseconds -- ) us-factor * ticks ; +' (us) to us
: (ms) ( #ms -- ) dup ms/tick 3 * u> ticks-enabled? and if ( #ms )
Modified: cpu/x86/acpitimer.fth ============================================================================== --- cpu/x86/acpitimer.fth Tue Oct 11 20:09:09 2011 (r2587) +++ cpu/x86/acpitimer.fth Tue Oct 11 20:17:44 2011 (r2588) @@ -24,7 +24,7 @@ ;
[ifdef] use-acpi-delays -: us ( us -- ) acpi-us ; +' acpi-us to us ' acpi-ms to ms [then]
Modified: cpu/x86/build/builder.dic ============================================================================== Binary file (source and/or target). No diff available.
Modified: cpu/x86/pc/getms.fth ============================================================================== --- cpu/x86/pc/getms.fth Tue Oct 11 20:09:09 2011 (r2587) +++ cpu/x86/pc/getms.fth Tue Oct 11 20:17:44 2011 (r2588) @@ -40,7 +40,8 @@ c;
: 1ms ( -- ) ms-factor spins ; -: us ( #microseconds -- ) us-factor * spins ; +: (us) ( #microseconds -- ) us-factor * spins ; +' (us) to us
: (ms) ( #ms -- ) dup ms/tick 3 * u> interrupts-enabled? and if ( #ms )
Modified: cpu/x86/tsc.fth ============================================================================== --- cpu/x86/tsc.fth Tue Oct 11 20:09:09 2011 (r2587) +++ cpu/x86/tsc.fth Tue Oct 11 20:17:44 2011 (r2588) @@ -33,7 +33,8 @@ ' (get-msecs) to get-msecs
: 1ms ( -- ) ms-factor spins ; -: us ( #microseconds -- ) us-factor * spins ; +: (us) ( #microseconds -- ) us-factor * spins ; +' (us) to us
[ifdef] use-timestamp-counter : (ms) ( #ms -- ) 0 ?do 1ms loop ;
Modified: ofw/core/ofwcore.fth ============================================================================== --- ofw/core/ofwcore.fth Tue Oct 11 20:09:09 2011 (r2587) +++ ofw/core/ofwcore.fth Tue Oct 11 20:17:44 2011 (r2588) @@ -100,6 +100,7 @@ d# 10 value ms/tick defer get-msecs ( -- n ) ' 0 is get-msecs defer ms ( n -- ) ' drop is ms +defer us ( n -- ) ' drop is us
\ Enabling/disabling interrupts
Modified: ofw/fcode/extcodes.fth ============================================================================== --- ofw/fcode/extcodes.fth Tue Oct 11 20:09:09 2011 (r2587) +++ ofw/fcode/extcodes.fth Tue Oct 11 20:17:44 2011 (r2588) @@ -12,3 +12,5 @@ vfw 076 2 byte-code: $instructions ( name$ -- ) vfw 077 2 byte-code: instructions-done ( -- ) vfw 078 2 byte-code: instructions-idle ( -- ) + +vfw 079 2 byte-code: us ( -- )
openfirmware@openfirmware.info