Make the repo self-contained (no dependency on the parent firmware-tools/ checkout): copy in the patch/disasm/syx tools and the c2probe RP2040 C2 flash-reader/patcher firmware. - patch_usb1_to_cv.py : byte-level USB-1->CV patch (imported by roundtrip.py) - d8051.py : standalone 8051 disassembler - syx_extract.py : SysEx extractor - c2probe/ : RP2040 C2 flash reader + host scripts (c2probe.c, cdc/dump_flash/patch_c2/reflash_page/verify.py, CMake build) - RECOVERY.md : C2 flash recovery procedure - EFM8UB20_PINOUT.md : reverse-engineered QFP48 pinout + firmware pin usage - roundtrip.py : import local patch_usb1_to_cv (parent as fallback) - .gitignore : exclude c2probe/.venv, c2probe/build Verified: stock + patched round-trips still re-assemble byte-identical.
32 lines
1.6 KiB
C
32 lines
1.6 KiB
C
// lock_stubs.c -- no-op retargetable-lock stubs for newlib.
|
|
//
|
|
// The Pico SDK expects a *non-retargetable* newlib (lock calls compile to
|
|
// nothing). The toolchain we build with ships a *retargetable* newlib, whose
|
|
// stdio/malloc/exit code references __lock___* objects and __retarget_lock_*
|
|
// functions that the SDK does not provide. c2probe is strictly single
|
|
// threaded, so all of these are no-ops. The named objects are the complete set
|
|
// enumerated from newlib's libc/libg (thumb) with `nm -u`.
|
|
|
|
#include <sys/lock.h>
|
|
|
|
/* Backing mutex objects newlib declares extern via __LOCK_INIT(). */
|
|
struct __lock __lock___sfp_recursive_mutex;
|
|
struct __lock __lock___sinit_recursive_mutex;
|
|
struct __lock __lock___malloc_recursive_mutex;
|
|
struct __lock __lock___env_recursive_mutex;
|
|
struct __lock __lock___atexit_recursive_mutex;
|
|
struct __lock __lock___at_quick_exit_mutex;
|
|
struct __lock __lock___tz_mutex;
|
|
struct __lock __lock___arc4random_mutex;
|
|
struct __lock __lock___dd_hash_mutex;
|
|
|
|
void __retarget_lock_init(_LOCK_T l) { (void)l; }
|
|
void __retarget_lock_init_recursive(_LOCK_T l) { (void)l; }
|
|
void __retarget_lock_close(_LOCK_T l) { (void)l; }
|
|
void __retarget_lock_close_recursive(_LOCK_T l) { (void)l; }
|
|
void __retarget_lock_acquire(_LOCK_T l) { (void)l; }
|
|
void __retarget_lock_acquire_recursive(_LOCK_T l) { (void)l; }
|
|
int __retarget_lock_try_acquire(_LOCK_T l) { (void)l; return 1; }
|
|
int __retarget_lock_try_acquire_recursive(_LOCK_T l) { (void)l; return 1; }
|
|
void __retarget_lock_release(_LOCK_T l) { (void)l; }
|
|
void __retarget_lock_release_recursive(_LOCK_T l) { (void)l; } |