memory commands: export common functions
The memory commands all use open_and_lseek and mem_parse_options. Export them to be able to split the memory commands into separate files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
59dbb4fe2c
commit
d91b7772c4
|
@ -112,7 +112,7 @@ int memory_display(char *addr, loff_t offs, ulong nbytes, int size, int swab)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int open_and_lseek(const char *filename, int mode, loff_t pos)
|
int open_and_lseek(const char *filename, int mode, loff_t pos)
|
||||||
{
|
{
|
||||||
int fd, ret;
|
int fd, ret;
|
||||||
|
|
||||||
|
@ -135,7 +135,11 @@ static int open_and_lseek(const char *filename, int mode, loff_t pos)
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
|
/*
|
||||||
|
* Common function for parsing options for the 'md', 'mw', 'memcpy', 'memcmp'
|
||||||
|
* commands.
|
||||||
|
*/
|
||||||
|
int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
|
||||||
char **sourcefile, char **destfile, int *swab)
|
char **sourcefile, char **destfile, int *swab)
|
||||||
{
|
{
|
||||||
int opt;
|
int opt;
|
||||||
|
|
|
@ -221,6 +221,10 @@ int run_shell(void);
|
||||||
|
|
||||||
int memory_display(char *addr, loff_t offs, ulong nbytes, int size, int swab);
|
int memory_display(char *addr, loff_t offs, ulong nbytes, int size, int swab);
|
||||||
|
|
||||||
|
int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
|
||||||
|
char **sourcefile, char **destfile, int *swab);
|
||||||
|
int open_and_lseek(const char *filename, int mode, loff_t pos);
|
||||||
|
|
||||||
extern const char version_string[];
|
extern const char version_string[];
|
||||||
#ifdef CONFIG_BANNER
|
#ifdef CONFIG_BANNER
|
||||||
void barebox_banner(void);
|
void barebox_banner(void);
|
||||||
|
|
Loading…
Reference in New Issue