12void __attribute((noreturn)) panic(
char *);
13uint8_t rp2040_rom_version(
void);
17uint32_t sd_table[SF_TABLE_V2_SIZE / 2];
19#if !(PICO_DOUBLE_SUPPORT_ROM_V1 && PICO_RP2040_B0_SUPPORTED)
20static __attribute__((noreturn))
void missing_double_func_shim(
void) {
21 panic(
"missing double function");
24extern void double_table_shim_on_use_helper(
void);
28void __aeabi_double_init(
void) {
29 int rom_version = rp2040_rom_version();
30#if PICO_DOUBLE_SUPPORT_ROM_V1 && PICO_RP2040_B0_SUPPORTED
31 if (rom_version == 1) {
40 for(uint32_t i=0; i<SF_TABLE_V2_SIZE/4; i++) {
41 sd_table[i] = (uintptr_t)double_table_shim_on_use_helper;
45 if (rom_version == 1) {
47 for(uint32_t i=0;i<SF_TABLE_V2_SIZE/4;i++) {
48 sd_table[i] = (uintptr_t)missing_double_func_shim;
52 if (rom_version >= 2) {
54 assert(*((uint8_t *)(((
void *)
rom_data_lookup(rom_table_code(
'S',
'F')))-2)) * 4 >= SF_TABLE_V2_SIZE);
55 memcpy(&sd_table, rom_table, SF_TABLE_V2_SIZE);
56 if (rom_version == 2) {
58 if (*(uint16_t *)0x3854 != 0xb500 ||
60 *(uint16_t *)0x38d8 != 0x4649 ||
61 *(uint16_t *)0x389c != 0x4659
68 if (rom_version < 3) {
70 sd_table[SF_TABLE_V3_FSINCOS / 4] = (uintptr_t) double_table_shim_on_use_helper;
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.