2 * fmap_sections.h, track which sections of the image will contain CBFSes
4 * Copyright (C) 2015 Google, Inc.
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.
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.
16 #ifndef CBFS_SECTIONS_H_
17 #define CBFS_SECTIONS_H_
23 #define SECTION_NAME_FMAP "FMAP"
24 #define SECTION_NAME_PRIMARY_CBFS "COREBOOT"
26 #define SECTION_ANNOTATION_CBFS "CBFS"
28 typedef const struct descriptor_node
*cbfs_section_iterator_t
;
30 /** @return Iterator pointing to first CBFS section, or NULL if none exist */
31 cbfs_section_iterator_t
cbfs_sections_iterator(void);
34 * Advance iterator to point to the next CBFS section.
35 * If it was already pointing to the last such section, it will be set to NULL.
37 * @param it (Non-NULL) pointer to (possibly NULL) iterator to be updated
38 * @return Whether it was successfully advanced (wasn't already NULL)
40 bool cbfs_sections_iterator_advance(cbfs_section_iterator_t
*it
);
43 * @param it Iterator, which must currently be non-NULL
44 * @return Section to which it points
46 const struct flashmap_descriptor
*cbfs_sections_iterator_deref(
47 cbfs_section_iterator_t it
);
49 /** @return Whether a section named SECTION_NAME_PRIMARY_CBFS is in the list. */
50 bool cbfs_sections_primary_cbfs_accounted_for(void);
52 /** Reclaim the space used to store knowledge of which sections are CBFSes. */
53 void cbfs_sections_cleanup(void);