diff options
author | Bill Richardson <wfrichar@chromium.org> | 2015-03-26 16:58:49 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-03-31 06:28:25 +0000 |
commit | 091c7b17f09f287da115ca247d39e7128158a581 (patch) | |
tree | 32d0dc4ee097290c72946a25762a068825f25487 /futility/file_type_bios.h | |
parent | 08d52b9bf52fb140b7c77c54bee500c3a59ff69b (diff) | |
download | vboot-091c7b17f09f287da115ca247d39e7128158a581.tar.gz |
futility: put all the BIOS stuff into a separate file
This moves the functions that handle BIOS file types into a
separate set of source files. BIOSes are constructed from other
components arranged in particular ways, so they shouldn't be
mixed in with the code specifically for those components.
BUG=chromium:231574
BRANCH=none
TEST=make runtests
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I15c3fec61498925f9b8c672092fd97e7ea2d90e9
Reviewed-on: https://chromium-review.googlesource.com/262898
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'futility/file_type_bios.h')
-rw-r--r-- | futility/file_type_bios.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/futility/file_type_bios.h b/futility/file_type_bios.h new file mode 100644 index 00000000..3cd2e797 --- /dev/null +++ b/futility/file_type_bios.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2013 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ +#ifndef VBOOT_REFERENCE_FUTILITY_FILE_TYPE_BIOS_H_ +#define VBOOT_REFERENCE_FUTILITY_FILE_TYPE_BIOS_H_ +#include <stdint.h> + +/* + * The Chrome OS BIOS must contain specific FMAP areas, which we want to look + * at in a certain order. + */ +enum bios_component { + BIOS_FMAP_GBB, + BIOS_FMAP_FW_MAIN_A, + BIOS_FMAP_FW_MAIN_B, + BIOS_FMAP_VBLOCK_A, + BIOS_FMAP_VBLOCK_B, + + NUM_BIOS_COMPONENTS +}; + +/* Location information for each component */ +struct bios_area_s { + uint32_t offset; /* to avoid pointer math */ + uint8_t *buf; + uint32_t len; + uint32_t is_valid; +}; + +/* State to track as we visit all components */ +struct bios_state_s { + /* Current component */ + enum bios_component c; + /* Other activites, possibly before or after the current one */ + struct bios_area_s area[NUM_BIOS_COMPONENTS]; + struct bios_area_s recovery_key; + struct bios_area_s rootkey; +}; + +#endif /* VBOOT_REFERENCE_FUTILITY_FILE_TYPE_BIOS_H_ */ |