[openfirmware] r1679 - cpu/x86/pc/olpc/via
svn at openfirmware.info
svn at openfirmware.info
Thu Jan 21 07:17:13 CET 2010
Author: pgf
Date: 2010-01-21 07:17:12 +0100 (Thu, 21 Jan 2010)
New Revision: 1679
Modified:
cpu/x86/pc/olpc/via/runin.fth
Log:
changes from chia-hsiu: fix handling of KA tag, for comparision
purposes, adjust rtc +/- limit, and add support for the "repass"
file. i think we need to understand a little better what this is
for.
Modified: cpu/x86/pc/olpc/via/runin.fth
===================================================================
--- cpu/x86/pc/olpc/via/runin.fth 2010-01-19 01:17:16 UTC (rev 1678)
+++ cpu/x86/pc/olpc/via/runin.fth 2010-01-21 06:17:12 UTC (rev 1679)
@@ -18,14 +18,14 @@
d# 128 buffer: mb-buf : mb$ mb-buf count ;
-: get-mb-tags ( --)
+: get-mb-tags ( -- )
" B#" find-tag if
?-null
then
mb-buf place
;
-: set-tag-assy ( --)
+: set-tag-assy ( -- )
get-mb-tags
clear-mfg-buf
@@ -178,7 +178,7 @@
2>r 2over 2r@ $= if ( value$ key$ r: old-value$' )
2drop 2drop 2r> 2drop ( )
else ( value$ key$ r: old-value$' )
- type ." tag changed!" cr ( value$ r: old-value$' )
+ type ." tag changed!" cr ( value$ r: old-value$' )
." Old: " 2r> show-tag cr ( value$ )
." New: " show-tag cr ( )
do-tag-error
@@ -188,12 +188,28 @@
then
;
+: replace-ka-value ( rem$ value$ key$ -- rem$ file-data$ key$ )
+ 2swap 2dup 8 min ka-dir$ " %s%s" sprintf ( rem$ key$ value$ filename$ )
+ $read-file if ( rem$ key$ value$ )
+ ." ERROR: No KA tag file for " type cr ( rem$ key$ )
+ true abort" KA file not found" ( rem$ key$ )
+ 2drop ( rem$ )
+ else ( rem$ key$ value$ file-data$ )
+ 2swap 2drop ( rem$ key$ file-data$ )
+ 2swap ( rem$ file-data$ key$ )
+ then
+;
+
: parse-tags ( adr len -- )
begin dup while ( adr len )
linefeed left-parse-string ( rem$ line$ )
?remove-cr ( rem$ line$ )
[char] : left-parse-string ( rem$ value$ key$ )
dup 2 = if ( rem$ value$ key$ )
+ \ catch value from http, if KA tag
+ 2dup " KA" $= if ( rem$ value$ key$ )
+ replace-ka-value ( rem$ value$' key$ )
+ then
handle-tag ( rem$ )
else ( rem$ value$ key$ )
4drop ( rem$ )
@@ -201,6 +217,7 @@
repeat ( adr len )
2drop ( )
;
+
: format-date ( s m h d m y -- adr len )
push-decimal
>r >r >r >r >r >r
@@ -243,7 +260,7 @@
kbc-on
;
-d# 4 constant rtc-threshold
+d# 180 constant rtc-threshold \ yes, really. 3 minutes
0 value ntp-seconds
0 value rtc-seconds
: .clocks ( -- )
@@ -350,9 +367,12 @@
: finish-final-test ( -- )
- " del int:\runin\olpc.fth" ['] eval catch
- " copy int:\runin\repass.fth int:\runin\olpc.fth" ['] eval catch
- " del int:\runin\repass.fth" ['] eval catch
+ " int:\runin\final.fth" $safe-delete
+ " int:\runin\repass.fth" 2dup $file-exists? if
+ " int:\runin\final.fth" $copy
+ else
+ 2drop
+ then
wait-connections
@@ -369,6 +389,8 @@
." Submitting results .. "
final-result cifs-disconnect
." Done" cr
+
+ " int:\runin\repass.fth" $safe-delete
\ need to delete target, due to #9957
" int:\runin\final.fth.sav" $safe-delete
More information about the openfirmware
mailing list