xref: /aosp_15_r20/external/vboot_reference/tests/common/boot_mode.h (revision 8617a60d3594060b7ecbd21bc622a7c14f3cf2bc)
1*8617a60dSAndroid Build Coastguard Worker /* Copyright 2022 The ChromiumOS Authors
2*8617a60dSAndroid Build Coastguard Worker  * Use of this source code is governed by a BSD-style license that can be
3*8617a60dSAndroid Build Coastguard Worker  * found in the LICENSE file.
4*8617a60dSAndroid Build Coastguard Worker  */
5*8617a60dSAndroid Build Coastguard Worker 
6*8617a60dSAndroid Build Coastguard Worker #include "2api.h"
7*8617a60dSAndroid Build Coastguard Worker 
8*8617a60dSAndroid Build Coastguard Worker void _set_boot_mode(struct vb2_context *ctx, enum vb2_boot_mode boot_mode,
9*8617a60dSAndroid Build Coastguard Worker 		    uint32_t recovery_reason, ...);
10*8617a60dSAndroid Build Coastguard Worker 
11*8617a60dSAndroid Build Coastguard Worker /*
12*8617a60dSAndroid Build Coastguard Worker  * Set the boot mode to the expected boot mode with the recovery reason if
13*8617a60dSAndroid Build Coastguard Worker  * given. Also, set the corresponding ctx flag.
14*8617a60dSAndroid Build Coastguard Worker  *
15*8617a60dSAndroid Build Coastguard Worker  * @param ctx			Vboot context.
16*8617a60dSAndroid Build Coastguard Worker  * @param boot_mode		Boot mode to be set.
17*8617a60dSAndroid Build Coastguard Worker  * @param recovery_reason	Recovery reason set to sd->recovery_reason.
18*8617a60dSAndroid Build Coastguard Worker  */
19*8617a60dSAndroid Build Coastguard Worker #define SET_BOOT_MODE(ctx, boot_mode, ...) \
20*8617a60dSAndroid Build Coastguard Worker 	_set_boot_mode(ctx, boot_mode, ##__VA_ARGS__, 0)
21