diff options
Diffstat (limited to 'tests/common/boot_mode.h')
-rw-r--r-- | tests/common/boot_mode.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/common/boot_mode.h b/tests/common/boot_mode.h new file mode 100644 index 00000000..bd6a3fd5 --- /dev/null +++ b/tests/common/boot_mode.h @@ -0,0 +1,20 @@ +/* Copyright 2022 The ChromiumOS Authors. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "2api.h" + +void _set_boot_mode(struct vb2_context *ctx, enum vb2_boot_mode boot_mode, + uint32_t recovery_reason, ...); + +/* + * Set the boot mode to the expected boot mode with the recovery reason if + * given. Also, set the corresponding ctx flag. + * + * @param ctx Vboot context. + * @param boot_mode Boot mode to be set. + * @param recovery_reason Recovery reason set to sd->recovery_reason. + */ +#define SET_BOOT_MODE(ctx, boot_mode, ...) \ + _set_boot_mode(ctx, boot_mode, ##__VA_ARGS__, 0) |