From patchwork Sat Dec 17 17:03:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 132014 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 506A41007DB for ; Sun, 18 Dec 2011 04:19:28 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9441A28447; Sat, 17 Dec 2011 18:18:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OSi+edDNCzFq; Sat, 17 Dec 2011 18:18:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7515728353; Sat, 17 Dec 2011 18:17:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4BAA328083 for ; Sat, 17 Dec 2011 18:04:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3WjM98JdbifO for ; Sat, 17 Dec 2011 18:04:55 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by theia.denx.de (Postfix) with ESMTPS id 07B1928088 for ; Sat, 17 Dec 2011 18:04:54 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id c14so2998501eek.3 for ; Sat, 17 Dec 2011 09:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=QZSQ5uCOyUIxnCeJDxsDkrjiGa8+RJLR7u6gWY52Oz8=; b=lYOgNUo+ueHrZj9cANXSfTycs5y+qlnIDay6llGyKCNoLzK4k8URWwSdeI4JRgKeoq WI9ZmnPEFIuiCAJR/T+aF1f9ErAhnryrahvC+3WO3kY19PfMemlNvk960OGrcHn/1Zk8 6Vi28toA/oNcYWIUdlXn3r3k/3iUiSoUXhOag= Received: by 10.14.52.200 with SMTP id e48mr1422070eec.72.1324141494756; Sat, 17 Dec 2011 09:04:54 -0800 (PST) Received: from Pali-EliteBook.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPS id a60sm17652568eeb.4.2011.12.17.09.04.53 (version=SSLv3 cipher=OTHER); Sat, 17 Dec 2011 09:04:54 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Date: Sat, 17 Dec 2011 18:03:15 +0100 Message-Id: <1324141398-14859-13-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1324141398-14859-1-git-send-email-pali.rohar@gmail.com> References: <2772527.Czs1Sl5aoH@pali-elitebook> <1324141398-14859-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 17 Dec 2011 18:17:05 +0100 Cc: Sebastian Reichel , Marcel Mol , Martin Jansa , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [U-Boot] [PATCH 13/16] New config variable CONFIG_PREMONITOR X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de * if defined run env "premonitor" before Main Loop for Monitor Command Processing Signed-off-by: Pali Rohár --- common/env_common.c | 3 +++ common/main.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/common/env_common.c b/common/env_common.c index 8a71096..1ef8ecc 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -92,6 +92,9 @@ const uchar default_environment[] = { #ifdef CONFIG_PREBOOT "preboot=" CONFIG_PREBOOT "\0" #endif +#ifdef CONFIG_PREMONITOR + "premonitor=" CONFIG_PREMONITOR "\0" +#endif #ifdef CONFIG_ROOTPATH "rootpath=" CONFIG_ROOTPATH "\0" #endif diff --git a/common/main.c b/common/main.c index fc80317..3dd9fc7 100644 --- a/common/main.c +++ b/common/main.c @@ -425,6 +425,16 @@ void main_loop (void) } #endif +#ifdef CONFIG_PREMONITOR + if ((s = getenv ("premonitor")) != NULL) { +# ifndef CONFIG_SYS_HUSH_PARSER + run_command (s, 0); +# else + parse_string_outer(s, FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP); +# endif + } +#endif /* CONFIG_PREMONITOR */ + /* * Main Loop for Monitor Command Processing */