From 8cbe91569112a7ee5b741fcdee72f8195fdbb59b Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Wed, 2 May 2018 15:08:02 +1000 Subject: external/mambo: Add support for readline if it exists Add support for tclreadline package if it is present. This patch loads the package and uses it when the simulation stops for any reason. Signed-off-by: Balbir Singh Signed-off-by: Stewart Smith --- external/mambo/skiboot.tcl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'external') diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl index f3684a7..7068c80 100644 --- a/external/mambo/skiboot.tcl +++ b/external/mambo/skiboot.tcl @@ -1,6 +1,17 @@ # need to get images path defined early source $env(LIB_DIR)/ppc/util.tcl +# +# Call tclreadline's Loop to move to friendlier +# commandline if one exists +# +proc readline { } { + set readline [catch { package require tclreadline }] + if { $readline == 0 } { + ::tclreadline::Loop + } +} + proc mconfig { name env_name def } { global mconf global env @@ -531,5 +542,7 @@ epapr::of2dtb mysim $mconf(epapr_dt_addr) mysim mode fastest if { [info exists env(SKIBOOT_AUTORUN)] } { - mysim go + if [catch { mysim go }] { + readline + } } -- cgit v1.1