From patchwork Fri Sep 28 18:56:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 187879 X-Patchwork-Delegate: agust@denx.de 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 3063B2C0094 for ; Sat, 29 Sep 2012 04:57:57 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B8B20280F7; Fri, 28 Sep 2012 20:57:53 +0200 (CEST) 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 pyovDyGJq+PD; Fri, 28 Sep 2012 20:57:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B8DD0280FC; Fri, 28 Sep 2012 20:57:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 083F8280C3 for ; Fri, 28 Sep 2012 20:57:13 +0200 (CEST) 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 T0f+1y5eGpsR for ; Fri, 28 Sep 2012 20:57:12 +0200 (CEST) X-Greylist: delayed 65540 seconds by postgrey-1.27 at theia; Fri, 28 Sep 2012 20:57:09 CEST 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-bk0-f74.google.com (mail-bk0-f74.google.com [209.85.214.74]) by theia.denx.de (Postfix) with ESMTPS id 6C7A1280CD for ; Fri, 28 Sep 2012 20:57:09 +0200 (CEST) Received: by bkwq16 with SMTP id q16so233692bkw.3 for ; Fri, 28 Sep 2012 11:57:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=mge6MBKUH7Hy8c8Al+H0qAwXGezDEhFpipz2FbEenXM=; b=iTUnxOpQXdmM5EUzeBcccRqq93Ab5WyzZDnlm7uBEYItEfI+eoW5YgzfMPayKF5yT/ IxK3IW1XOJgPkgC0FPBl2vyRM9DCuULzinoM+HAnqYqiC52KxXjbuJyrVoU7moGGzmij ++NqTXgKsn7GJFgMJBxcQw92wVdrr0FB5/0t8/p6+ImKcYj1rvGHJqrdyy33/CLyFIPy dJgsgT2Q9egybfeOmbjqYkfaEaLitEkvFqnpVSwEQXr1onSu9yvIwCxr4eQrNMs7gOIY 45DsomfJtz1S7GPXYo7h1hQHjptidosAa3jG1zQEHT21JnbNaynLHqLMjPxavxbo97j9 ewFw== Received: by 10.180.73.134 with SMTP id l6mr758356wiv.1.1348858627892; Fri, 28 Sep 2012 11:57:07 -0700 (PDT) Received: by 10.180.73.134 with SMTP id l6mr758350wiv.1.1348858627811; Fri, 28 Sep 2012 11:57:07 -0700 (PDT) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id cq5si53645wib.1.2012.09.28.11.57.07 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 28 Sep 2012 11:57:07 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id 6A6825C0050; Fri, 28 Sep 2012 11:57:07 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id BD9AE160731; Fri, 28 Sep 2012 11:57:06 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 28 Sep 2012 11:56:35 -0700 Message-Id: <1348858600-7095-2-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1348858600-7095-1-git-send-email-sjg@chromium.org> References: <1348858600-7095-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQky/jlOru7TalXsjQiyZXLhnbcF01/2e1H2x3+ZUjY0h0LgmGtSqnaYJkrOd2M+P0BuW7JB3JWvMha2A8mJFz3Eg6trLadD+js5SQIjW8cK6GQ6mK/GvwJMo6eN4uKSRwzmzg0ql6pC7fVAtBcIX/WYrjEx35dMkgJodnoxB2WisWMOi6axM//AcGXzQUaAWJOhzlwW Subject: [U-Boot] [PATCH 1/6] bootstage: Export bootstage_add_record() function 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This function is not static, but not exported either. Add a prototype in the header file and move the required enum to the header also. Signed-off-by: Simon Glass --- common/bootstage.c | 16 ++++++---------- include/bootstage.h | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/common/bootstage.c b/common/bootstage.c index 4e01d92..3275499 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -33,13 +33,9 @@ DECLARE_GLOBAL_DATA_PTR; -enum bootstage_flags { - BOOTSTAGEF_ERROR = 1 << 0, /* Error record */ - BOOTSTAGEF_ALLOC = 1 << 1, /* Allocate an id */ -}; - struct bootstage_record { ulong time_us; + uint32_t start_us; const char *name; int flags; /* see enum bootstage_flags */ enum bootstage_id id; @@ -49,10 +45,9 @@ static struct bootstage_record record[BOOTSTAGE_ID_COUNT] = { {1} }; static int next_id = BOOTSTAGE_ID_USER; ulong bootstage_add_record(enum bootstage_id id, const char *name, - int flags) + int flags, ulong mark) { struct bootstage_record *rec; - ulong mark = timer_get_boot_us(); if (flags & BOOTSTAGEF_ALLOC) id = next_id++; @@ -77,12 +72,13 @@ ulong bootstage_add_record(enum bootstage_id id, const char *name, ulong bootstage_mark(enum bootstage_id id) { - return bootstage_add_record(id, NULL, 0); + return bootstage_add_record(id, NULL, 0, timer_get_boot_us()); } ulong bootstage_error(enum bootstage_id id) { - return bootstage_add_record(id, NULL, BOOTSTAGEF_ERROR); + return bootstage_add_record(id, NULL, BOOTSTAGEF_ERROR, + timer_get_boot_us()); } ulong bootstage_mark_name(enum bootstage_id id, const char *name) @@ -91,7 +87,7 @@ ulong bootstage_mark_name(enum bootstage_id id, const char *name) if (id == BOOTSTAGE_ID_ALLOC) flags = BOOTSTAGEF_ALLOC; - return bootstage_add_record(id, name, flags); + return bootstage_add_record(id, name, flags, timer_get_boot_us()); } static void print_time(unsigned long us_time) diff --git a/include/bootstage.h b/include/bootstage.h index a000538..64b2ec6 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -31,6 +31,12 @@ #define CONFIG_BOOTSTAGE_USER_COUNT 20 #endif +/* Flags for each bootstage record */ +enum bootstage_flags { + BOOTSTAGEF_ERROR = 1 << 0, /* Error record */ + BOOTSTAGEF_ALLOC = 1 << 1, /* Allocate an id */ +}; + /* * A list of boot stages that we know about. Each of these indicates the * state that we are at, and the action that we are about to perform. For @@ -221,6 +227,17 @@ void show_boot_progress(int val); #ifdef CONFIG_BOOTSTAGE /* This is the full bootstage implementation */ +/** + * Add a new bootstage record + * + * @param id Bootstage ID to use (ignored if flags & BOOTSTAGEF_ALLOC) + * @param name Name of record, or NULL for none + * @param flags Flags (BOOTSTAGEF_...) + * @param mark Time to record in this record, in microseconds + */ +ulong bootstage_add_record(enum bootstage_id id, const char *name, + int flags, ulong mark); + /* * Mark a time stamp for the current boot stage. */