mirror of
https://xff.cz/git/u-boot/
synced 2025-09-18 00:52:07 +02:00
image: Create a table of information for each category
Add a table that contains the category name, the number of items in each category and a pointer to the table of items. This will allow us to use generic code to deal with the categories. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
@@ -176,6 +176,19 @@ static const table_entry_t uimage_comp[] = {
|
|||||||
{ -1, "", "", },
|
{ -1, "", "", },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct table_info {
|
||||||
|
const char *desc;
|
||||||
|
int count;
|
||||||
|
const table_entry_t *table;
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct table_info table_info[IH_COUNT] = {
|
||||||
|
{ "architecture", IH_ARCH_COUNT, uimage_arch },
|
||||||
|
{ "compression", IH_COMP_COUNT, uimage_comp },
|
||||||
|
{ "operating system", IH_OS_COUNT, uimage_os },
|
||||||
|
{ "image type", IH_TYPE_COUNT, uimage_type },
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Legacy format routines */
|
/* Legacy format routines */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@@ -123,6 +123,15 @@ struct lmb;
|
|||||||
# define IMAGE_OF_SYSTEM_SETUP 0
|
# define IMAGE_OF_SYSTEM_SETUP 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
enum ih_category {
|
||||||
|
IH_ARCH,
|
||||||
|
IH_COMP,
|
||||||
|
IH_OS,
|
||||||
|
IH_TYPE,
|
||||||
|
|
||||||
|
IH_COUNT,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Operating System Codes
|
* Operating System Codes
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user