X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=api%2Fapi.c;h=190ee6ad6cca9b4bc562d07375122eb694e4a6c0;hb=8e0ec82eb40db6c24c2ac5b323c8cc278bef8597;hp=10f83eb691c85afe8ee817f72035ef140d78142a;hpb=694976afa5dcc5c4e7eaeaa0612eac35cd5bd8ec;p=u-boot diff --git a/api/api.c b/api/api.c index 10f83eb691..190ee6ad6c 100644 --- a/api/api.c +++ b/api/api.c @@ -24,12 +24,10 @@ */ #include - -#if defined(CONFIG_API) - #include #include #include +#include #include #include @@ -39,9 +37,7 @@ #undef DEBUG /* U-Boot routines needed */ -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); -extern uchar (*env_get_char)(int); -extern uchar *env_get_addr(int); +extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); /***************************************************************************** * @@ -231,7 +227,7 @@ static int API_dev_enum(va_list ap) /* start over - clean up enumeration */ dev_enum_reset(); /* XXX shouldn't the name contain 'stor'? */ debugf("RESTART ENUM\n"); - + /* net device enumeration first */ if (dev_enum_net(di)) return 0; @@ -365,7 +361,7 @@ static int API_dev_write(va_list ap) return API_EINVAL; if (di->type & DEV_TYP_STOR) - /* + /* * write to storage is currently not supported by U-Boot: * no storage device implements block_write() method */ @@ -523,7 +519,7 @@ static int API_env_enum(va_list ap) char *last, **next; last = (char *)va_arg(ap, u_int32_t); - + if ((next = (char **)va_arg(ap, u_int32_t)) == NULL) return API_EINVAL; @@ -535,12 +531,12 @@ static int API_env_enum(va_list ap) for (i = 0; env_get_char(i) != '\0'; i = n + 1) { for (n = i; env_get_char(n) != '\0'; ++n) { - if (n >= CFG_ENV_SIZE) { + if (n >= CONFIG_ENV_SIZE) { /* XXX shouldn't we set *next = NULL?? */ return 0; } } - + if (envmatch((uchar *)last, i) < 0) continue; @@ -567,7 +563,7 @@ static cfp_t calls_table[API_MAXCALL] = { NULL, }; * serviced until finished. * * e.g. syscall(1, int *, u_int32_t, u_int32_t, u_int32_t, u_int32_t); - * + * * call: syscall number * * retval: points to the return value placeholder, this is the place the @@ -583,7 +579,7 @@ int syscall(int call, int *retval, ...) va_list ap; int rv; - if (call < 0 || call >= calls_no || calls_table[call] == NULL) { + if (call < 0 || call >= calls_no) { debugf("invalid call #%d\n", call); return 0; } @@ -655,7 +651,7 @@ void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long siz if (!si->mr || !size || (flags == 0)) return; - + /* find free slot */ for (i = 0; i < si->mr_no; i++) if (si->mr[i].flags == 0) { @@ -666,5 +662,3 @@ void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long siz return; } } - -#endif /* CONFIG_API */