X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/e3ae0257834f7d134c7f80db6fa23668b5a5fa6d..c1bd1140c4502c59a28c28f4ca9fadfa43e3ff3d:/bootrom/fromflash.c diff --git a/bootrom/fromflash.c b/bootrom/fromflash.c index 6b41c408..81501fd0 100644 --- a/bootrom/fromflash.c +++ b/bootrom/fromflash.c @@ -1,13 +1,21 @@ -#include - -extern char __bootphase2_src_start__, __bootphase2_start__, __bootphase2_end__; -void __attribute__((section(".bootphase1"))) CopyBootToRAM(void) -{ - int i; - - volatile DWORD *s = (volatile DWORD *)&__bootphase2_src_start__; - volatile DWORD *d = (volatile DWORD *)&__bootphase2_start__; - unsigned int l = (int)&__bootphase2_end__ - (int)&__bootphase2_start__; - - for(i = 0; i < l/sizeof(DWORD); i++) *d++ = *s++; -} +//----------------------------------------------------------------------------- +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Helper function for launching the bootloader from FLASH +//----------------------------------------------------------------------------- + +#include + +extern char __bootphase2_src_start__, __bootphase2_start__, __bootphase2_end__; +void __attribute__((section(".bootphase1"))) CopyBootToRAM(void) +{ + int i; + + volatile uint32_t *s = (volatile uint32_t *)&__bootphase2_src_start__; + volatile uint32_t *d = (volatile uint32_t *)&__bootphase2_start__; + unsigned int l = (int)&__bootphase2_end__ - (int)&__bootphase2_start__; + + for(i = 0; i < l/sizeof(uint32_t); i++) *d++ = *s++; +}