From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] bootstage: Export bootstage_add_record() function
Date: Fri, 28 Sep 2012 11:56:35 -0700 [thread overview]
Message-ID: <1348858600-7095-2-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1348858600-7095-1-git-send-email-sjg@chromium.org>
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 <sjg@chromium.org>
---
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.
*/
--
1.7.7.3
next prev parent reply other threads:[~2012-09-28 18:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 18:56 [U-Boot] [PATCH 0/6] bootstage: Add a number of new features Simon Glass
2012-09-28 18:56 ` Simon Glass [this message]
2012-09-28 18:56 ` [U-Boot] [PATCH 2/6] bootstage: Add time accumulation feature Simon Glass
2012-09-28 18:56 ` [U-Boot] [PATCH 3/6] bootstage: Store boot timings in device tree Simon Glass
2012-09-28 18:56 ` [U-Boot] [PATCH 4/6] bootstage: Add feature to stash/unstash bootstage info Simon Glass
2012-09-28 18:56 ` [U-Boot] [PATCH 5/6] bootstage: Add bootstage command Simon Glass
2012-09-28 18:56 ` [U-Boot] [PATCH 6/6] bootstage: Add new bootstage IDs for board, LCD Simon Glass
2012-10-02 23:02 ` [U-Boot] [PATCH 0/6] bootstage: Add a number of new features Anatolij Gustschin
2012-10-03 0:07 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348858600-7095-2-git-send-email-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox