12void __attribute((noreturn)) panic(
char *);
13uint8_t rp2040_rom_version(
void);
17uint32_t sf_table[SF_TABLE_V2_SIZE / 2];
20#if !(PICO_FLOAT_SUPPORT_ROM_V1 && PICO_RP2040_B0_SUPPORTED)
21static __attribute__((noreturn))
void missing_float_func_shim(
void) {
26void __aeabi_float_init(
void) {
27 int rom_version = rp2040_rom_version();
29#if PICO_FLOAT_SUPPORT_ROM_V1 && PICO_RP2040_B0_SUPPORTED
30 if (rom_version == 1) {
31 memcpy(&sf_table, rom_table, SF_TABLE_V1_SIZE);
32 extern void float_table_shim_on_use_helper(
void);
35 if (*(uint16_t *)0x29ee != 0x0fc4 ||
36 *(uint16_t *)0x29c0 != 0x0dc2 ||
37 *(uint16_t *)0x2b96 != 0xb5c0 ||
38 *(uint16_t *)0x2b18 != 0x2500 ||
39 *(uint16_t *)0x2acc != 0xb510 ||
40 *(uint32_t *)0x2cfc != 0x6487ed51
54 for(uint32_t i=SF_TABLE_V1_SIZE/4; i<SF_TABLE_V2_SIZE/4; i++) {
55 sf_table[i] = (uintptr_t)float_table_shim_on_use_helper;
58 sf_table[SF_TABLE_FLOAT2INT/4] = sf_table[SF_TABLE_FLOAT2FIX/4] = (uintptr_t)float_table_shim_on_use_helper;
61 if (rom_version == 1) {
62 memcpy(&sf_table, rom_table, SF_TABLE_V1_SIZE);
64 for(uint32_t i=0;i<SF_TABLE_V2_SIZE/4;i++) {
65 if (!sf_table[i]) sf_table[i] = (uintptr_t)missing_float_func_shim;
69 if (rom_version >= 2) {
70 assert(*((uint8_t *)(rom_table-2)) * 4 >= SF_TABLE_V2_SIZE);
71 memcpy(&sf_table, rom_table, SF_TABLE_V2_SIZE);
void * rom_func_lookup(uint32_t code)
Lookup a bootrom function by code.
void * rom_data_lookup(uint32_t code)
Lookup a bootrom address by code.
void __attribute__((noreturn))(*rom_reset_usb_boot_fn)(uint32_t
Reboot the device into BOOTSEL mode.