X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fimage.h;h=5a424e6a9422c74933494710e1ead02a745a19f1;hb=01471d538fb163f472a769f21267d7676c91267c;hp=a62669fc63cc68d12e0743cc4042cd25c853240f;hpb=3a2003f61ee79ac53d20c24cc896c2637a2dfc24;p=oweals%2Fu-boot.git diff --git a/include/image.h b/include/image.h index a62669fc63..5a424e6a94 100644 --- a/include/image.h +++ b/include/image.h @@ -155,6 +155,7 @@ #define IH_TYPE_SCRIPT 6 /* Script file */ #define IH_TYPE_FILESYSTEM 7 /* Filesystem Image (any type) */ #define IH_TYPE_FLATDT 8 /* Binary Flat Device Tree Blob */ +#define IH_TYPE_KWBIMAGE 9 /* Kirkwood Boot Image */ /* * Compression Types @@ -284,6 +285,30 @@ typedef struct bootm_headers { #define uimage_to_cpu(x) be32_to_cpu(x) #define cpu_to_uimage(x) cpu_to_be32(x) +/* + * Translation table for entries of a specific type; used by + * get_table_entry_id() and get_table_entry_name(). + */ +typedef struct table_entry { + int id; + char *sname; /* short (input) name to find table entry */ + char *lname; /* long (output) name to print for messages */ +} table_entry_t; + +/* + * get_table_entry_id() scans the translation table trying to find an + * entry that matches the given short name. If a matching entry is + * found, it's id is returned to the caller. + */ +int get_table_entry_id (table_entry_t *table, + const char *table_name, const char *name); +/* + * get_table_entry_name() scans the translation table trying to find + * an entry that matches the given id. If a matching entry is found, + * its long name is returned to the caller. + */ +char *get_table_entry_name (table_entry_t *table, char *msg, int id); + const char *genimg_get_os_name (uint8_t os); const char *genimg_get_arch_name (uint8_t arch); const char *genimg_get_type_name (uint8_t type); @@ -292,6 +317,7 @@ int genimg_get_os_id (const char *name); int genimg_get_arch_id (const char *name); int genimg_get_type_id (const char *name); int genimg_get_comp_id (const char *name); +void genimg_print_size (uint32_t size); #ifndef USE_HOSTCC /* Image format types, returned by _get_format() routine */