diff options
Diffstat (limited to 'rbutil/mkamsboot/mkamsboot.c')
-rw-r--r-- | rbutil/mkamsboot/mkamsboot.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c index 2897e48657..05b862376a 100644 --- a/rbutil/mkamsboot/mkamsboot.c +++ b/rbutil/mkamsboot/mkamsboot.c | |||
@@ -474,15 +474,15 @@ void patch_firmware( | |||
474 | memcpy(buf + 0x600, ams_identity[model].bootloader, ams_identity[model].bootloader_size); | 474 | memcpy(buf + 0x600, ams_identity[model].bootloader, ams_identity[model].bootloader_size); |
475 | 475 | ||
476 | /* Insert vectors, they won't overwrite the OF version string */ | 476 | /* Insert vectors, they won't overwrite the OF version string */ |
477 | 477 | static const uint32_t goto_start = 0xe3a0fc02; // mov pc, #0x200 | |
478 | /* Reset vector: branch 0x200 bytes away, to our dualboot code */ | 478 | static const uint32_t infinite_loop = 0xeafffffe; // 1: b 1b |
479 | static const uint8_t b_0x200[4] = { 0x7e, 0x00, 0x00, 0xea }; // b 0x200 | 479 | /* ALL vectors: infinite loop */ |
480 | memcpy(buf + 0x400, b_0x200, sizeof(b_0x200)); | 480 | for (i=0; i < 8; i++) |
481 | 481 | put_uint32le(buf + 0x400 + 4*i, infinite_loop); | |
482 | /* Other vectors: infinite loops */ | 482 | /* Now change only the interesting vectors */ |
483 | static const uint8_t b_1b[4] = { 0xfe, 0xff, 0xff, 0xea }; // 1: b 1b | 483 | /* Reset/SWI vectors: branch to our dualboot code at 0x200 */ |
484 | for (i=1; i < 8; i++) | 484 | put_uint32le(buf + 0x400 + 4*0, goto_start); // Reset |
485 | memcpy(buf + 0x400 + 4*i, b_1b, sizeof(b_1b)); | 485 | put_uint32le(buf + 0x400 + 4*2, goto_start); // SWI |
486 | 486 | ||
487 | /* We are filling the firmware buffer backwards from the end */ | 487 | /* We are filling the firmware buffer backwards from the end */ |
488 | p = buf + 0x400 + firmware_size; | 488 | p = buf + 0x400 + firmware_size; |