diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-12-13 14:55:27 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-09-21 03:46:19 +0000 |
commit | 91d4fec4606e2145d522274c786d46d12721cf9a (patch) | |
tree | f9ebc2a7adcf50f7d50209b183319be4a5d599a6 /include/version.h | |
parent | 0c1c11be2d9a590110d8d339a774b3ad8aedf96f (diff) | |
download | chrome-ec-91d4fec4606e2145d522274c786d46d12721cf9a.tar.gz |
version: Make ver_get_num_commits work for on-flash images
EFS needs to check whether a RW version on flash is equal to or newer
for rollback protection before jumping to a RW copy.
Currently, ver_get_numcommits works only for the running image. This
makes it work for images on flash as well.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=chromium:998135
BRANCH=none
TEST=Boot Nami. Verify version numbers are read from RAM and flash.
Change-Id: I94475e40f89dc4c3173d83cb1d9d4ad38d6fab79
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1450816
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/version.h')
-rw-r--r-- | include/version.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/version.h b/include/version.h index d11ac7d9d9..71e215c8e2 100644 --- a/include/version.h +++ b/include/version.h @@ -9,6 +9,7 @@ #define __CROS_EC_VERSION_H #include "common.h" +#include "system.h" #define CROS_EC_IMAGE_DATA_COOKIE1 0xce778899 #define CROS_EC_IMAGE_DATA_COOKIE2 0xceaabbdd @@ -27,7 +28,9 @@ extern const char __image_data_offset[]; extern const void *__image_size; /** - * Get the number of commits field from version string. + * Get the number of commits of an image + * + * @return Number of commits in integer or 0 on error */ -uint32_t ver_get_numcommits(void); +int ver_get_num_commits(enum system_image_copy_t copy); #endif /* __CROS_EC_VERSION_H */ |