]> git.baikalelectronics.ru Git - uboot.git/commit
bootstage: Use rec_count as the array index
authorSimon Glass <sjg@chromium.org>
Mon, 22 May 2017 11:05:27 +0000 (05:05 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 5 Jun 2017 18:13:05 +0000 (14:13 -0400)
commit6bd57a9a42511c9ec2e8b3a051e35ed3917312c0
tree4affe3e2698cce4a4248b0867980b202be752049
parente32221b8abfc6672b1c1815a553a72965a0dd6d1
bootstage: Use rec_count as the array index

At present bootstage has a large array with all possible bootstage IDs
recorded. It adds times to the array element indexed by the ID. This is
inefficient because many IDs are not used during boot. We can save space
by only recording those IDs which actually have timestamps.

Update the array to use a record count, which increments with each
addition of a new timestamp. This takes longer to record a time, since it
may involve an array search. Such a search may be particularly expensive
before relocation when the CPU is running slowly or the cache is off. But
at that stage there should be very few records.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/Kconfig
common/bootstage.c