diff options
author | Prafulla Wadaskar <prafulla@marvell.com> | 2009-09-07 14:59:08 +0530 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-09-10 22:58:48 +0200 |
commit | b029dddc9ae958b1ccf875649f52c6db396a742d (patch) | |
tree | 687a66a179ca405ce13dedc52162310a45376c94 /include | |
parent | f666dea8ab215c76c3c2a077ad299f90dd1ace7c (diff) | |
download | u-boot-imx-b029dddc9ae958b1ccf875649f52c6db396a742d.zip u-boot-imx-b029dddc9ae958b1ccf875649f52c6db396a742d.tar.gz u-boot-imx-b029dddc9ae958b1ccf875649f52c6db396a742d.tar.bz2 |
mkimage: Make table_entry code global
- make get_table_entry_id() global
- make get_table_entry_name() global
- move struct table_entry to image.h
Currently this code is used by image.c only.
This patch makes this API global so it can be used by other parts of
code, too.
Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Ron Lee <ron.debian.org>
Edit comments and commit message.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/image.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/image.h b/include/image.h index 4a7bf78..d4cbf8c 100644 --- a/include/image.h +++ b/include/image.h @@ -284,6 +284,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); |