コード例 #1
0
ファイル: cmd_cptf.c プロジェクト: tkgunji/RCU2_soft
	envm_write_and_reset(ulong dst, ulong src, ulong size, int do_reset)
{
	int ret = 0;

	/*
	 * Copy the buffer to the destination.
	 */
	if (envm_write((uint) dst, (void *) src, (uint) size) != size) {
		ret = -1;
		goto Done;
	}

	/*
	 * If the user needs a reset, do the reset
	 */
	if (do_reset) {
		/*
		 * Cortex-M3 core reset.
		 */
		reset_cpu(0);

		/*
		 * Should never be here.
		 */
	}

	Done:
	return ret;
}
コード例 #2
0
ファイル: env_envm.c プロジェクト: EmcraftSystems/u-boot
int saveenv(void)
{
	/* env must be copied to do not alter env structure in memory*/
	unsigned char temp[CONFIG_ENV_SIZE];
	memcpy(temp, env_ptr, CONFIG_ENV_SIZE);
	return envm_write(CONFIG_ENV_ADDR, temp, CONFIG_ENV_SIZE);
}