FreeBSD/sys/boot/arm/at91/bootiic/env_vars.c
/*
 * .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
 */
.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_START void WriteCommandTable ( void ) This global function write the current command table to the non - volatile memory .
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;
		}
		memcpy(cPtr, boot_commands[i], copySize);
		cPtr += copySize;
		*cPtr++ = 0;
	}
	WriteEEPROM((unsigned)&BootCommandSection, env_table,
	    sizeof(env_table));
}
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 ; } memcpy ( cPtr , boot_commands [ i ] , copySize ) ; cPtr += copySize ; * cPtr ++ = 0 ; } WriteEEPROM ( ( unsigned ) & BootCommandSection , env_table , sizeof ( env_table ) ) ; }
.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_START void WriteCommandTable ( void ) This global function write the current command table to the non - volatile memory .
/* We're executing in low RAM so addr in ram == offset in eeprom */