summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoredisonhello <edisonhello@google.com>2021-09-06 18:17:32 +0800
committerCommit Bot <commit-bot@chromium.org>2021-11-07 00:01:15 +0000
commitf5deada0fcabe07115fe6797bffe7c2e3b1217b1 (patch)
tree90b072c2cbc64c65577eed6c7436f619ea8f01f3
parent63e662d66a1dc8031a57c6d8b53955e5acc5c3b1 (diff)
downloadvboot-f5deada0fcabe07115fe6797bffe7c2e3b1217b1.tar.gz
vboot: Remove VbExIsShutdownRequested
Remove function VbExIsShutdownRequested, since this function is not used in vboot anymore after UI code is centralized. Remove VB_SHUTDOWN_* macros since they are not used in vboot now. These macros will be added in depthcharge in the dependent CL. BUG=b:172339016 TEST=DEBUG=1 make -j test_setup && make -j runtests BRANCH=none Cq-Depend: chromium:3142698 Signed-off-by: edisonhello <edisonhello@google.com> Change-Id: I024b34212a5c9e42b880d51d21c7a90a6170b3c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3143814 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
-rw-r--r--firmware/2lib/include/2return_codes.h2
-rw-r--r--firmware/include/vboot_api.h27
-rw-r--r--firmware/stub/vboot_api_stub.c6
-rw-r--r--tests/vb2_ec_sync_tests.c10
4 files changed, 1 insertions, 44 deletions
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h
index 0dc7c441..176c2c6b 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -29,7 +29,7 @@ enum vb2_return_code {
*/
VB2_REQUEST = 0x1000,
- /* Calling firmware requested shutdown via VbExIsShutdownRequested() */
+ /* Calling firmware requested shutdown */
VB2_REQUEST_SHUTDOWN = 0x1001,
/* Calling firmware needs to perform a reboot */
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 1fee766d..ce3ac2d6 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -288,33 +288,6 @@ vb2_error_t VbExStreamRead(VbExStream_t stream, uint32_t bytes, void *buffer);
*/
void VbExStreamClose(VbExStream_t stream);
-/*****************************************************************************/
-/* Misc */
-
-/**
- * Check if the firmware needs to shut down the system.
- *
- * Returns a non-zero VB_SHUTDOWN_REQUEST mask indicating the reason(s) for
- * shutdown if a shutdown is being requested (see VB_SHUTDOWN_REQUEST_*), or 0
- * if a shutdown is not being requested.
- *
- * NOTE: When we're displaying a screen, pressing the power button should shut
- * down the computer. We need a way to break out of our control loop so this
- * can occur cleanly.
- */
-uint32_t VbExIsShutdownRequested(void);
-
-/*
- * Shutdown requested for a reason which is not defined among other
- * VB_SHUTDOWN_REQUEST_* values. This must be defined as 1 for backward
- * compatibility with old versions of the API.
- */
-#define VB_SHUTDOWN_REQUEST_OTHER 0x00000001
-/* Shutdown requested due to a lid switch being closed. */
-#define VB_SHUTDOWN_REQUEST_LID_CLOSED 0x00000002
-/* Shutdown requested due to a power button being pressed. */
-#define VB_SHUTDOWN_REQUEST_POWER_BUTTON 0x00000004
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/firmware/stub/vboot_api_stub.c b/firmware/stub/vboot_api_stub.c
index 5e085566..9335c8b3 100644
--- a/firmware/stub/vboot_api_stub.c
+++ b/firmware/stub/vboot_api_stub.c
@@ -19,12 +19,6 @@
#include "vboot_test.h"
__attribute__((weak))
-uint32_t VbExIsShutdownRequested(void)
-{
- return 0;
-}
-
-__attribute__((weak))
vb2_error_t vb2ex_run_altfw(uint32_t altfw_id)
{
return VB2_SUCCESS;
diff --git a/tests/vb2_ec_sync_tests.c b/tests/vb2_ec_sync_tests.c
index 16496e44..1f484ef9 100644
--- a/tests/vb2_ec_sync_tests.c
+++ b/tests/vb2_ec_sync_tests.c
@@ -111,16 +111,6 @@ struct vb2_gbb_header *vb2_get_gbb(struct vb2_context *c)
return &gbb;
}
-uint32_t VbExIsShutdownRequested(void)
-{
- if (shutdown_request_calls_left == 0)
- return 1;
- else if (shutdown_request_calls_left > 0)
- shutdown_request_calls_left--;
-
- return 0;
-}
-
int vb2ex_ec_trusted(void)
{
return !ec_run_image;