]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - bootrom/fromflash.c
Clean up line endings, switch everything to LF instead of CRLF
[proxmark3-svn] / bootrom / fromflash.c
index f6d5237cb7002843b4f69d5e4907e8ebfcfab8f0..80403e5f7cdf8ab130a099a9aca5df080604115d 100644 (file)
@@ -1,11 +1,13 @@
-#include <proxmark3.h>\r
-\r
-void __attribute__((section("bootphase1"))) CopyBootToRAM(void)\r
-{\r
-       int i;\r
-\r
-       volatile DWORD *s = (volatile DWORD *)0x200;\r
-       volatile DWORD *d = (volatile DWORD *)0x200000;\r
-\r
-       for(i = 0; i < 1024; i++) *d++ = *s++;\r
-}\r
+#include <proxmark3.h>
+
+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++;
+}
Impressum, Datenschutz