From a84835a7eadadb715a61d993da6766bdf1b37c5e Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Thu, 7 Jan 2010 03:24:05 +0000 Subject: Move the CLI related functions main() and cli_usage() to cli_classic.c And rename them accordingly. For now, main() just calls cli_classic(), but alternative frontends can be switched in main(). Annotate remaining help texts with CLI dependency inside flashrom.c with a FIXME comment. Now people can go and create different frontends and be happy. Please note that any other frontend will have to sort of duplicate the probing code in cli_classic.c. Refactoring that part of the code is possible, but not easy because we still want to print instructive help messages for users. Corresponding to flashrom svn r833. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Sean Nelson --- flash.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'flash.h') diff --git a/flash.h b/flash.h index b7b9aed1..648dc833 100644 --- a/flash.h +++ b/flash.h @@ -482,21 +482,31 @@ extern char *programmer_param; extern unsigned long flashbase; extern int verbose; extern const char *flashrom_version; +extern char *chip_to_probe; #define printf_debug(x...) { if (verbose) printf(x); } void map_flash_registers(struct flashchip *flash); int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len); int erase_flash(struct flashchip *flash); +struct flashchip *probe_flash(struct flashchip *first_flash, int force); +int read_flash(struct flashchip *flash, char *filename); +void check_chip_supported(struct flashchip *flash); +int check_max_decode(enum chipbustype buses, uint32_t size); int min(int a, int b); int max(int a, int b); char *extract_param(char **haystack, char *needle, char *delim); int check_erased_range(struct flashchip *flash, int start, int len); int verify_range(struct flashchip *flash, uint8_t *cmpbuf, int start, int len, char *message); char *strcat_realloc(char *dest, const char *src); +void print_version(void); +int selfcheck(void); int doit(struct flashchip *flash, int force, char *filename, int read_it, int write_it, int erase_it, int verify_it); #define OK 0 #define NT 1 /* Not tested */ +/* cli_classic.c */ +int cli_classic(int argc, char *argv[]); + /* layout.c */ int show_id(uint8_t *bios, int size, int force); int read_romlayout(char *name); -- cgit v1.2.3