Author: mcayland Date: Sat Feb 20 14:22:17 2016 New Revision: 1383 URL: http://tracker.coreboot.org/trac/openbios/changeset/1383
Log: ciface.fs: implement optional (exit) hook when returning control back to the interpreter
This allows us to optionally intercept and execute code before returning back to the Forth interactive console.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/forth/system/ciface.fs
Modified: trunk/openbios-devel/forth/system/ciface.fs ============================================================================== --- trunk/openbios-devel/forth/system/ciface.fs Sat Feb 20 14:22:14 2016 (r1382) +++ trunk/openbios-devel/forth/system/ciface.fs Sat Feb 20 14:22:17 2016 (r1383) @@ -326,6 +326,14 @@
: exit ( -- ) ." EXIT" + + \ Execute (exit) hook if one exists + s" (exit)" $find if + execute + else + 2drop + then + outer-interpreter ;