#include <common.h>
#include <command.h>
#include <environment.h>
-#include <cmd_nvedit.h>
#include <linux/stddef.h>
#include <malloc.h>
#ifdef CONFIG_ETH2ADDR
"eth2addr=" MK_STR(CONFIG_ETH2ADDR) "\0"
#endif
+#ifdef CONFIG_ETH3ADDR
+ "eth3addr=" MK_STR(CONFIG_ETH3ADDR) "\0"
+#endif
#ifdef CONFIG_IPADDR
"ipaddr=" MK_STR(CONFIG_IPADDR) "\0"
#endif
#ifdef CONFIG_CLOCKS_IN_MHZ
"clocks_in_mhz=1\0"
#endif
+#if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0)
+ "pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY) "\0"
+#endif
#ifdef CONFIG_EXTRA_ENV_SETTINGS
CONFIG_EXTRA_ENV_SETTINGS
#endif
return (c);
}
+#ifdef CONFIG_AMIGAONEG3SE
+uchar env_get_char_memory (int index)
+{
+ DECLARE_GLOBAL_DATA_PTR;
+ uchar retval;
+ enable_nvram();
+ if (gd->env_valid) {
+ retval = ( *((uchar *)(gd->env_addr + index)) );
+ } else {
+ retval = ( default_environment[index] );
+ }
+ disable_nvram();
+ return retval;
+}
+#else
uchar env_get_char_memory (int index)
{
DECLARE_GLOBAL_DATA_PTR;
return ( default_environment[index] );
}
}
+#endif
uchar *env_get_addr (int index)
{
disable_nvram();
#endif
}
+
+#ifdef CONFIG_AUTO_COMPLETE
+int env_complete(char *var, int maxv, char *cmdv[], int bufsz, char *buf)
+{
+ int i, nxt, len, vallen, found;
+ const char *lval, *rval;
+
+ found = 0;
+ cmdv[0] = NULL;
+
+ len = strlen(var);
+ /* now iterate over the variables and select those that match */
+ for (i=0; env_get_char(i) != '\0'; i=nxt+1) {
+
+ for (nxt=i; env_get_char(nxt) != '\0'; ++nxt)
+ ;
+
+ lval = env_get_addr(i);
+ rval = strchr(lval, '=');
+ if (rval != NULL) {
+ vallen = rval - lval;
+ rval++;
+ } else
+ vallen = strlen(lval);
+
+ if (len > 0 && (vallen < len || memcmp(lval, var, len) != 0))
+ continue;
+
+ if (found >= maxv - 2 || bufsz < vallen + 1) {
+ cmdv[found++] = "...";
+ break;
+ }
+ cmdv[found++] = buf;
+ memcpy(buf, lval, vallen); buf += vallen; bufsz -= vallen;
+ *buf++ = '\0'; bufsz--;
+ }
+
+ cmdv[found] = NULL;
+ return found;
+}
+#endif