blob: dc94720ea55f31a8266937298bd583b983fa2fd9 [file] [log] [blame]
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2014 The ChromiumOS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070014 */
15
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070016#ifndef __VBOOT_MISC_H__
17#define __VBOOT_MISC_H__
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070018
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070019#include <vboot/vboot_common.h>
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070020
Aaron Durbinb5a20b22015-10-06 17:29:03 -050021struct vb2_context;
22struct vb2_shared_data;
23
Aaron Durbin17200ad2015-05-01 16:48:54 -050024void vboot_fill_handoff(void);
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070025
Aaron Durbinb5a20b22015-10-06 17:29:03 -050026void vb2_init_work_context(struct vb2_context *ctx);
27struct vb2_shared_data *vb2_get_shared_data(void);
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070028
Aaron Durbin4e50cdd2015-05-15 23:25:46 -050029/* Returns 0 on success. < 0 on failure. */
Aaron Durbin6d720f32015-12-08 17:00:23 -060030int vb2_get_selected_region(struct region *region);
31void vb2_set_selected_region(const struct region *region);
Furquan Shaikha6c5ddd2016-07-22 06:59:40 -070032int vb2_is_slot_selected(void);
33int vb2_logic_executed(void);
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070034
Aaron Durbinb5933662015-10-07 16:03:41 -050035/* Store the selected region in cbmem for later use. */
36void vb2_store_selected_region(void);
37
Furquan Shaikh85aa1352016-07-22 08:56:43 -070038void vb2_save_recovery_reason_vbnv(void);
39
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070040#endif /* __VBOOT_MISC_H__ */