Skip to content

Commit

Permalink
added some functions to wrapper.c, made all extracted flashpatches we…
Browse files Browse the repository at this point in the history
…ak, so that they can be overwritten.
  • Loading branch information
matthiasseemoo committed Dec 10, 2018
1 parent c3689fd commit 9f79ac4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions buildtools/flash_patch_extractor/fpext.c
Expand Up @@ -166,6 +166,7 @@ analyse_ram()
get_words(fpc[i].data_ptr, &low, &high);
darm_disasm(dd, low, high, 1);

printf("__attribute__((weak))\n");
printf("__attribute__((at(0x%08x, \"flashpatch\")))\n", fpc[i].target_addr);
printf("BPatch(flash_patch_%d, 0x%08x);\n\n", i, fpc[i].target_addr + dd->imm + 4);

Expand Down Expand Up @@ -195,6 +196,7 @@ analyse_ram_bcm43596()
get_words(fpc[i].data_ptr, &low, &high);
darm_disasm(dd, low, high, 1);

printf("__attribute__((weak))\n");
printf("__attribute__((at(0x%08x, \"flashpatch\")))\n", fpc[i].target_addr);
printf("unsigned int flash_patch_%d[2] = {0x%08x, 0x%08x};\n\n", i,
*((unsigned int *) (ram_array + fpc[i].data_ptr - ram_start)),
Expand All @@ -221,6 +223,7 @@ analyse_ram_bcm4366()
get_words(fpc[i].data_ptr, &low, &high);
darm_disasm(dd, low, high, 1);

printf("__attribute__((weak))\n");
printf("__attribute__((at(0x%08x, \"flashpatch\")))\n", fpc[i].target_addr);
printf("unsigned int flash_patch_%d[4] = {0x%08x, 0x%08x, 0x%08x, 0x%08x};\n\n", i,
*((unsigned int *) (ram_array + fpc[i].data_ptr - ram_start)),
Expand Down
4 changes: 3 additions & 1 deletion patches/common/wrapper.c
Expand Up @@ -159,7 +159,7 @@ AT(CHIP_VER_BCM4330, FW_VER_5_90_100_41, 0x80D800)
AT(CHIP_VER_BCM4358, FW_VER_ALL, 0x8290)
AT(CHIP_VER_BCM4356, FW_VER_ALL, 0x80A4)
AT(CHIP_VER_BCM4335b0, FW_VER_ALL, 0x17EA8)
AT(CHIP_VER_BCM43455c0, FW_VER_ALL, 0x7FFC)
AT(CHIP_VER_BCM43455c0, FW_VER_7_45_154, 0x19A4B4)
void *
hndrte_add_timer(void *t, int ms, int periodic)
RETURN_DUMMY
Expand Down Expand Up @@ -206,6 +206,7 @@ RETURN_DUMMY
AT(CHIP_VER_BCM4339, FW_VER_ALL, 0x168F4)
AT(CHIP_VER_BCM43438, FW_VER_ALL, 0x807F24)
AT(CHIP_VER_BCM43430a1, FW_VER_ALL, 0x807F24)
AT(CHIP_VER_BCM43455c0, FW_VER_ALL, 0x8448)
unsigned int
hndrte_time_ms()
RETURN_DUMMY
Expand Down Expand Up @@ -398,6 +399,7 @@ AT(CHIP_VER_BCM43438, FW_VER_ALL, 0x803BF8)
AT(CHIP_VER_BCM43430a1, FW_VER_ALL, 0x803BF8)
AT(CHIP_VER_BCM43596a0, FW_VER_ALL, 0x1ed0)
AT(CHIP_VER_BCM43451b1, FW_VER_ALL, 0x259c)
AT(CHIP_VER_BCM43455c0, FW_VER_ALL, 0x38cc)
int
sprintf(char *buf, const char *format, ...)
RETURN_DUMMY
Expand Down

0 comments on commit 9f79ac4

Please sign in to comment.