PERFORCE change 100311 for review
Warner Losh
imp at FreeBSD.org
Thu Jun 29 20:44:51 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100311
Change 100311 by imp at imp_lighthouse on 2006/06/29 20:44:15
We can't write or set commands for boot, so don't bother
including them. This saves 800 bytes!
Affected files ...
.. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/env_vars.c#4 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#12 edit
Differences ...
==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/env_vars.c#4 (text+ko) ====
@@ -73,68 +73,6 @@
/*
* .KB_C_FN_DEFINITION_START
- * void WriteCommandTable(void)
- * This global function write the current command table to the non-volatile
- * memory.
- * .KB_C_FN_DEFINITION_END
- */
-void
-WriteCommandTable(void)
-{
- int i, size = MAX_ENV_SIZE_BYTES, copySize;
- char *cPtr = env_table;
-
- p_memset(env_table, 0, sizeof(env_table));
-
- for (i = 0; i < MAX_BOOT_COMMANDS; ++i) {
-
- copySize = p_strlen(boot_commands[i]);
- size -= copySize + 1;
-
- if (size < 0) {
- continue;
- }
- p_memcpy(cPtr, boot_commands[i], copySize);
- cPtr += copySize;
- *cPtr++ = 0;
- }
-
- WriteEEPROM((unsigned)&BootCommandSection, env_table,
- sizeof(env_table));
-}
-
-
-/*
- * .KB_C_FN_DEFINITION_START
- * void SetBootCommand(int index, char *command)
- * This global function replaces the specified index with the string residing
- * at command. Execute this function with a NULL string to clear the
- * associated command index.
- * .KB_C_FN_DEFINITION_END
- */
-void
-SetBootCommand(int index, char *command)
-{
- int i;
-
- if ((unsigned)index < MAX_BOOT_COMMANDS) {
-
- p_memset(boot_commands[index], 0, MAX_INPUT_SIZE);
-
- if (!command)
- return ;
-
- for (i = 0; i < MAX_INPUT_SIZE; ++i) {
- boot_commands[index][i] = command[i];
- if (!(boot_commands[index][i]))
- return;
- }
- }
-}
-
-
-/*
- * .KB_C_FN_DEFINITION_START
* void DumpBootCommands(void)
* This global function displays the current boot commands.
* .KB_C_FN_DEFINITION_END
==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#12 (text+ko) ====
@@ -56,9 +56,7 @@
{COMMAND_LOCAL_IP, "ip"},
{COMMAND_MAC, "m"},
{COMMAND_SERVER_IP, "server_ip"},
- {COMMAND_SET, "s"},
{COMMAND_TFTP, "tftp"},
- {COMMAND_WRITE, "w"},
{COMMAND_XMODEM, "x"},
{COMMAND_RESET, "R"},
{COMMAND_LOAD_SPI_KERNEL, "k"},
@@ -135,26 +133,6 @@
/*
* .KB_C_FN_DEFINITION_START
- * void RestoreSpace(int)
- * This private function restores NULL characters to spaces in order to
- * process the remaining args as a string. The number passed is the argc
- * of the first entry to begin restoring space in the inputBuffer.
- * .KB_C_FN_DEFINITION_END
- */
-static void
-RestoreSpace(int startArgc)
-{
- char *cPtr;
-
- for (startArgc++; startArgc < MAX_COMMAND_PARAMS; startArgc++) {
- if ((cPtr = argv[startArgc]))
- *(cPtr - 1) = ' ';
- }
-}
-
-
-/*
- * .KB_C_FN_DEFINITION_START
* int BreakCommand(char *)
* This private function splits the buffer into separate strings as pointed
* by argv and returns the number of parameters (< 0 on failure).
@@ -301,25 +279,6 @@
break;
}
- case COMMAND_SET:
- {
- // s <index> <new boot command>
- // set the boot command at index (0-based)
- unsigned index;
-
- if (argc > 1) {
- RestoreSpace(2);
- index = p_ASCIIToHex(argv[1]);
- SetBootCommand(index, argv[2]);
- }
- break;
- }
-
- case COMMAND_WRITE:
- // write the command table to non-volatile
- WriteCommandTable();
- break;
-
case COMMAND_LOAD_SPI_KERNEL:
// "k <address>"
if (argc > 1)
More information about the p4-projects
mailing list