[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbios
Subject:    [OpenBIOS] [commit] r1252 - trunk/openbios-devel/forth/device
From:       repository service <svn () openbios ! org>
Date:       2014-01-13 9:46:51
Message-ID: E1W2e6d-000403-MF () ra ! coresystems ! de
[Download RAW message or body]

Author: mcayland
Date: Mon Jan 13 10:46:51 2014
New Revision: 1252
URL: http://tracker.coreboot.org/trac/openbios/changeset/1252

Log:
feval.fs: enable OpenBIOS to recover correctly from invalid FCode

If invalid FCode has been executed, the FCode interpreter may have exited
whilst still in compile mode, causing OpenBIOS internals to become corrupted.

Detect this condition and switch back to immediate mode to prevent subsequent
random internal errors within OpenBIOS.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Modified:
   trunk/openbios-devel/forth/device/feval.fs

Modified: trunk/openbios-devel/forth/device/feval.fs
==============================================================================
--- trunk/openbios-devel/forth/device/feval.fs	Mon Jan 13 10:46:46 2014	(r1251)
+++ trunk/openbios-devel/forth/device/feval.fs	Mon Jan 13 10:46:51 2014	(r1252)
@@ -49,6 +49,15 @@
       ,
     then
   fcode-end @ until
+
+  \ If we've executed incorrect FCode we may have reached the end of the FCode
+  \ program but still be in compile mode. Make sure that if this has happened
+  \ then we switch back to immediate mode to prevent internal OpenBIOS errors.
+  tmp-comp-depth @ -1 <> if
+    -1 tmp-comp-depth !
+    tmp-comp-buf @ @ here!
+    0 state !
+  then
 ;
 
 : byte-load ( addr xt -- )

-- 
OpenBIOS                 http://openbios.org/
Mailinglist:  http://lists.openbios.org/mailman/listinfo
Free your System - May the Forth be with you
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic