file_type_bios.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
  3. * Use of this source code is governed by a BSD-style license that can be
  4. * found in the LICENSE file.
  5. */
  6. #ifndef VBOOT_REFERENCE_FUTILITY_FILE_TYPE_BIOS_H_
  7. #define VBOOT_REFERENCE_FUTILITY_FILE_TYPE_BIOS_H_
  8. #include <stdint.h>
  9. /*
  10. * The Chrome OS BIOS must contain specific FMAP areas, which we want to look
  11. * at in a certain order.
  12. */
  13. enum bios_component {
  14. BIOS_FMAP_GBB,
  15. BIOS_FMAP_FW_MAIN_A,
  16. BIOS_FMAP_FW_MAIN_B,
  17. BIOS_FMAP_VBLOCK_A,
  18. BIOS_FMAP_VBLOCK_B,
  19. NUM_BIOS_COMPONENTS
  20. };
  21. /* Location information for each component */
  22. struct bios_area_s {
  23. uint32_t offset; /* to avoid pointer math */
  24. uint8_t *buf;
  25. uint32_t len;
  26. uint32_t is_valid;
  27. };
  28. /* State to track as we visit all components */
  29. struct bios_state_s {
  30. /* Current component */
  31. enum bios_component c;
  32. /* Other activites, possibly before or after the current one */
  33. struct bios_area_s area[NUM_BIOS_COMPONENTS];
  34. struct bios_area_s recovery_key;
  35. struct bios_area_s rootkey;
  36. };
  37. #endif /* VBOOT_REFERENCE_FUTILITY_FILE_TYPE_BIOS_H_ */