mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 23:20:26 +09:00
move cmd_get_data_size to command.c
add CMD_DATA_SIZE macro to enable it Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
507641d249
commit
8a40fb148e
@ -33,8 +33,6 @@ extern void print_evb440spe_info(void);
|
|||||||
static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag,
|
static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag,
|
||||||
int flag, int argc, char *argv[]);
|
int flag, int argc, char *argv[]);
|
||||||
|
|
||||||
extern int cmd_get_data_size(char* arg, int default_size);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
int do_evb440spe(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
int do_evb440spe(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -127,7 +127,6 @@ static uchar i2c_no_probes[] = CFG_I2C_NOPROBES;
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]);
|
mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]);
|
||||||
extern int cmd_get_data_size(char* arg, int default_size);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Syntax:
|
* Syntax:
|
||||||
|
@ -64,8 +64,6 @@ op_tbl_t op_table [] = {
|
|||||||
|
|
||||||
#define op_tbl_size (sizeof(op_table)/sizeof(op_table[0]))
|
#define op_tbl_size (sizeof(op_table)/sizeof(op_table[0]))
|
||||||
|
|
||||||
extern int cmd_get_data_size(char* arg, int default_size);
|
|
||||||
|
|
||||||
static long evalexp(char *s, int w)
|
static long evalexp(char *s, int w)
|
||||||
{
|
{
|
||||||
long l, *p;
|
long l, *p;
|
||||||
|
@ -37,35 +37,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <watchdog.h>
|
#include <watchdog.h>
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_MEMORY) \
|
|
||||||
|| defined(CONFIG_CMD_I2C) \
|
|
||||||
|| defined(CONFIG_CMD_ITEST) \
|
|
||||||
|| defined(CONFIG_CMD_PCI) \
|
|
||||||
|| defined(CONFIG_CMD_PORTIO)
|
|
||||||
|
|
||||||
int cmd_get_data_size(char* arg, int default_size)
|
|
||||||
{
|
|
||||||
/* Check for a size specification .b, .w or .l.
|
|
||||||
*/
|
|
||||||
int len = strlen(arg);
|
|
||||||
if (len > 2 && arg[len-2] == '.') {
|
|
||||||
switch(arg[len-1]) {
|
|
||||||
case 'b':
|
|
||||||
return 1;
|
|
||||||
case 'w':
|
|
||||||
return 2;
|
|
||||||
case 'l':
|
|
||||||
return 4;
|
|
||||||
case 's':
|
|
||||||
return -2;
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return default_size;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_MEMORY)
|
#if defined(CONFIG_CMD_MEMORY)
|
||||||
|
|
||||||
#ifdef CMD_MEM_DEBUG
|
#ifdef CMD_MEM_DEBUG
|
||||||
|
@ -35,8 +35,6 @@
|
|||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <pci.h>
|
#include <pci.h>
|
||||||
|
|
||||||
extern int cmd_get_data_size(char* arg, int default_size);
|
|
||||||
|
|
||||||
unsigned char ShortPCIListing = 1;
|
unsigned char ShortPCIListing = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <command.h>
|
#include <command.h>
|
||||||
|
|
||||||
extern int cmd_get_data_size (char *arg, int default_size);
|
|
||||||
|
|
||||||
/* Display values from last command.
|
/* Display values from last command.
|
||||||
* Memory modify remembered values are different from display memory.
|
* Memory modify remembered values are different from display memory.
|
||||||
*/
|
*/
|
||||||
|
@ -654,3 +654,27 @@ int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CMD_DATA_SIZE
|
||||||
|
int cmd_get_data_size(char* arg, int default_size)
|
||||||
|
{
|
||||||
|
/* Check for a size specification .b, .w or .l.
|
||||||
|
*/
|
||||||
|
int len = strlen(arg);
|
||||||
|
if (len > 2 && arg[len-2] == '.') {
|
||||||
|
switch(arg[len-1]) {
|
||||||
|
case 'b':
|
||||||
|
return 1;
|
||||||
|
case 'w':
|
||||||
|
return 2;
|
||||||
|
case 'l':
|
||||||
|
return 4;
|
||||||
|
case 's':
|
||||||
|
return -2;
|
||||||
|
default:
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return default_size;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -78,6 +78,15 @@ extern int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *
|
|||||||
|
|
||||||
typedef void command_t (cmd_tbl_t *, int, int, char *[]);
|
typedef void command_t (cmd_tbl_t *, int, int, char *[]);
|
||||||
|
|
||||||
|
#if defined(CONFIG_CMD_MEMORY) \
|
||||||
|
|| defined(CONFIG_CMD_I2C) \
|
||||||
|
|| defined(CONFIG_CMD_ITEST) \
|
||||||
|
|| defined(CONFIG_CMD_PCI) \
|
||||||
|
|| defined(CONFIG_CMD_PORTIO)
|
||||||
|
#define CMD_DATA_SIZE
|
||||||
|
extern int cmd_get_data_size(char* arg, int default_size);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user