From patchwork Wed May 2 05:08:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 907305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40bRBX6GWKz9s2B for ; Wed, 2 May 2018 15:08:36 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pShvwJMa"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40bRBX3NMpzF2RN for ; Wed, 2 May 2018 15:08:36 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pShvwJMa"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::241; helo=mail-pf0-x241.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pShvwJMa"; dkim-atps=neutral Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40bRB62vsTzF2RL for ; Wed, 2 May 2018 15:08:12 +1000 (AEST) Received: by mail-pf0-x241.google.com with SMTP id f20so1965438pfn.0 for ; Tue, 01 May 2018 22:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=XlkKwo9YVKoGQA4ecUi2VR91tsHG85iWXfpGJA9BJF8=; b=pShvwJMaujJ954dO+cprQwKZZveriM75fG1Xn50kPyIy6J549rJdlCKc7pU7BpSDo3 KiYei3yGrhl9/Ot8jbdqcxJYmITDGnieBsPp1eKNb2zfSU6WXTa+hGawYuTa8T6EV/ZQ cg6GfjWNtXs9W4OuvzNIvGEvid4P6BVY3VZQtfiRt/Oy+RF/ugyi2MbgC46TL4D63fIG vybrU1//2AyGqGAIX6b7huYB6V5ghOnLYqk/HrZTPYswx8DBW0Fq+7FS0b/4+4Pd1mTK 36Dh7u3N764M/9OBXywSkgIw7de12+NbJL3U787Ry57nz26cHpbByQKBbJPDrnl8cAO1 2zwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XlkKwo9YVKoGQA4ecUi2VR91tsHG85iWXfpGJA9BJF8=; b=pa3bJBXKfiT7/K8yTj+Jy++3IcFqp9DJbu/1yvqkP4bGURbPv9jgtlffw6cHsWbIDW 4dfL8hUoNMyXJmmiBFZijkLmRmzm8qlIH7U3ehvx0zN+OgJNrt/jJAm8d0+nq60wOCfH ukGe0bZuKK7beNyrFAQvvJ/6WW10BUShVchX4ab3hIKljEvN6xpYeuBZO0fwdhCF4u05 /jvGtFBQq7YnW5SJYUbwh2kYk+arVjA9K5AG78ZNwuTOGaVMdxn3POTSVFrxPDWwbheh c1A4TRNSreNogt6bYnn76xmpEwxHSNCSiRdFMYz2+X02liOkK9ye4Mm/lEAy1jn2YLgX Mbdg== X-Gm-Message-State: ALQs6tAr6HSm8AF0CuSObZkvM9PJQhm4DEOFjOUfZNMA5XJm2bsB0QEG vblcV7GzI/Cy4Tk0qxg3iA0= X-Google-Smtp-Source: AB8JxZqN/gXa3jhS3yC/4S5EcbXVYo/Ey+nHgUjhHtJSidXHi0ZvCCx+JQbFRRc1WsROTIDoAqryZw== X-Received: by 2002:a17:902:6505:: with SMTP id b5-v6mr18593474plk.147.1525237690511; Tue, 01 May 2018 22:08:10 -0700 (PDT) Received: from balbir.ozlabs.ibm.com ([122.99.82.10]) by smtp.googlemail.com with ESMTPSA id o10-v6sm15804246pgp.30.2018.05.01.22.08.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 May 2018 22:08:09 -0700 (PDT) From: Balbir Singh To: stewart@linux.vnet.ibm.com Date: Wed, 2 May 2018 15:08:02 +1000 Message-Id: <20180502050802.15191-1-bsingharora@gmail.com> X-Mailer: git-send-email 2.13.6 Subject: [Skiboot] [PATCH] external/mambo: Add support for readline if it exists X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: skiboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- external/mambo/skiboot.tcl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl index 38298bff..078f4b65 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 @@ -481,5 +492,7 @@ epapr::of2dtb mysim $mconf(epapr_dt_addr) mysim mode fastest if { [info exists env(SKIBOOT_AUTORUN)] } { - mysim go + if [catch { mysim go }] { + readline + } }