esp_rom: splict libgcc and libc outof rom.ld bundle file

This commit is contained in:
morris 2020-01-20 13:31:28 +08:00 committed by suda-morris
parent e30cd361a8
commit 405b0e7f06
10 changed files with 107 additions and 275 deletions

View File

@ -1,8 +1,10 @@
/*
ESP32S2 ROM address table
Generated for ROM with MD5sum:
0a2c7ec5109c17884606d23b47045796 /home/jack/esp-rom/rom//.output/eagle/release/image/eagle.pro.rom.out
*/
/**
* ESP32-S2 ROM address table (except symbols from libgcc and libc)
* Generated for ROM with MD5sum: 0a2c7ec5109c17884606d23b47045796
*
* These are all weak symbols that could be overwritten in ESP-IDF.
*/
PROVIDE ( abort = 0x40019fb4 );
PROVIDE ( acm_config_descr = 0x3ffaef0f );
PROVIDE ( acm_usb_descriptors = 0x3ffaee68 );
@ -103,7 +105,6 @@ PROVIDE ( chip_usb_dw_init = 0x400133bc );
PROVIDE ( chip_usb_dw_prepare_persist = 0x40013588 );
PROVIDE ( chip_usb_get_persist_flags = 0x400135d8 );
PROVIDE ( chip_usb_set_persist_flags = 0x400135e8 );
PROVIDE ( __clear_cache = 0x40005abc );
PROVIDE ( context = 0x3fffeb34 );
PROVIDE ( cpio_destroy = 0x4001599c );
PROVIDE ( cpio_done = 0x40015968 );
@ -112,6 +113,7 @@ PROVIDE ( cpio_start = 0x4001561c );
PROVIDE ( crc16_le = 0x40011a10 );
PROVIDE ( crc32_le = 0x400119dc );
PROVIDE ( crc8_le = 0x40011a4c );
PROVIDE ( _cvt = 0x4000f9b8 );
PROVIDE ( _data_end_all_pro = 0x3fffff98 );
PROVIDE ( _data_end_c = 0x3ffffd80 );
PROVIDE ( _data_end_ets = 0x3fffe710 );
@ -144,6 +146,7 @@ PROVIDE ( dbus_baseaddrs = 0x3ffaf030 );
PROVIDE ( _DebugExceptionVector = 0x40000280 );
PROVIDE ( _DebugExceptionVector_text_end = 0x4000028b );
PROVIDE ( _DebugExceptionVector_text_start = 0x40000280 );
PROVIDE ( __default_global_locale = 0x3ffac600 );
PROVIDE ( dfu_class_handle_req = 0x400152f0 );
PROVIDE ( dfu_config_descr = 0x3ffaeeb2 );
PROVIDE ( dfu_cpio_callback = 0x4001360c );
@ -333,6 +336,7 @@ PROVIDE ( _GeneralException = 0x400073cf );
PROVIDE ( get_id = 0x4001610c );
PROVIDE ( GetSecurityInfoProc = 0x40012098 );
PROVIDE ( GetUartDevice = 0x40012f60 );
PROVIDE ( __global_locale_ptr = 0x3ffffd7c );
PROVIDE ( g_phyFuns = 0x3ffffd90 );
PROVIDE ( g_phyFuns_instance = 0x3ffffd94 );
PROVIDE ( gpio_input_get = 0x400193a0 );
@ -426,9 +430,11 @@ PROVIDE ( mz_free = 0x40002fa4 );
PROVIDE ( _NMIExceptionVector = 0x400002c0 );
PROVIDE ( _NMIExceptionVector_text_end = 0x400002c3 );
PROVIDE ( _NMIExceptionVector_text_start = 0x400002c0 );
PROVIDE ( __packed = 0x3ffffcec );
PROVIDE ( phy_get_romfuncs = 0x4000a88c );
PROVIDE ( _Pri_4_HandlerAddress = 0x3fffed78 );
PROVIDE ( _Pri_5_HandlerAddress = 0x3fffed7c );
PROVIDE ( pthread_setcancelstate = 0x40019fa8 );
PROVIDE ( _putc1 = 0x3ffffd6c );
PROVIDE ( _putc2 = 0x3ffffd68 );
PROVIDE ( RcvMsg = 0x40012f10 );
@ -582,8 +588,6 @@ PROVIDE ( SelectSpiFunction = 0x40015d08 );
PROVIDE ( SelectSpiQIO = 0x40015b88 );
PROVIDE ( SendMsg = 0x40012d0c );
PROVIDE ( send_packet = 0x40012cc8 );
PROVIDE ( setlocale = 0x40001c44 );
PROVIDE ( _setlocale_r = 0x40001bdc );
PROVIDE ( set_rtc_memory_crc = 0x40010010 );
PROVIDE ( SetSpiDrvs = 0x40015c18 );
PROVIDE ( sig_matrix = 0x3ffffd57 );
@ -644,7 +648,6 @@ PROVIDE ( str_prod_descr = 0x3ffaee88 );
PROVIDE ( str_serial_descr = 0x3ffaee84 );
PROVIDE ( s_usb_osglue = 0x3ffffcdc );
PROVIDE ( _SyscallException = 0x4000732a );
PROVIDE ( syscall_table_ptr_app = 0x3ffffd74 );
PROVIDE ( syscall_table_ptr_pro = 0x3ffffd78 );
PROVIDE ( tdefl_compress = 0x400041dc );
PROVIDE ( tdefl_compress_buffer = 0x40004938 );

View File

@ -1,3 +1,9 @@
/**
* Unlike other ROM functions which are exported using PROVIDE, which declares weak symbols,
* these libgcc functions are exported using assignment, which declare strong symbols.
* This is done so that ROM functions are always used instead of the ones provided by libgcc.a.
*/
__absvdi2 = 0x40005ad8;
__absvsi2 = 0x40005ac4;
__adddf3 = 0x40008660;
@ -8,6 +14,7 @@ __ashldi3 = 0x4001b000;
__ashrdi3 = 0x4001b018;
__bswapdi2 = 0x40006d34;
__bswapsi2 = 0x40006d0c;
__clear_cache = 0x40005abc;
__clrsbdi2 = 0x40006da8;
__clrsbsi2 = 0x40006d90;
__clzdi2 = 0x4001b238;

View File

@ -1,9 +1,15 @@
/**
* These are the .bss/.data symbols used by newlib functions present in ESP32-S2 ROM.
* See also esp32s2.rom.newlib-funcs.ld for the list of general newlib functions.
*
* Unlike other ROM functions and data which are exported using PROVIDE, which declare weak symbols,
* newlib related functions are exported using assignment, which declare strong symbols.
* This is done so that ROM functions are always used instead of the ones provided by libc.a.
*/
_ctype_ = 0x3ffac76c;
__default_global_locale = 0x3ffac600;
_global_impure_ptr = 0x3ffffd8c;
__global_locale_ptr = 0x3ffffd7c;
__locale_ctype_ptr = 0x40001c2c;
__locale_ctype_ptr_l = 0x40001c24;
__locale_mb_cur_max = 0x40001c0c;
__packed = 0x3ffffcec;
_PathLocale = 0x3ffffd80;
__sf_fake_stderr = 0x3ffaf08c;
__sf_fake_stdin = 0x3ffaf0cc;
__sf_fake_stdout = 0x3ffaf0ac;

View File

@ -1,20 +1,40 @@
/**
* These are the newlib functions present in ESP32-S2 ROM.
* See also esp32s2.rom.newlib-data.ld for the list of .data/.bss symbols used by these functions.
* Unlike other ROM functions which are exported using PROVIDE, which declare weak symbols,
* newlib related functions are exported using assignment, which declares strong symbols.
* This is done so that ROM functions are always used instead of the ones provided by libc.a.
*/
abs = 0x40000618;
__ascii_mbtowc = 0x40007a04;
__ascii_wctomb = 0x400018d0;
__assert = 0x4001a430;
__assert_func = 0x4001a408;
/*
atoi = ;
_atoi_r = ;
atol = ;
_atol_r = ;
*/
bzero = 0x400078c8;
_cvt = 0x4000f9b8;
_cleanup_r = 0x4001a480;
creat = 0x4000788c;
div = 0x40000620;
fclose = 0x4001a804;
_fclose_r = 0x4001a714;
fflush = 0x40001bb8;
_fflush_r = 0x40001b30;
fiprintf = 0x40000a3c;
_fiprintf_r = 0x40000a18;
__fp_lock_all = 0x4001a638;
fprintf = 0x40000a3c;
_fprintf_r = 0x40000a18;
__fp_unlock_all = 0x4001a64c;
__fputwc = 0x40001770;
fputwc = 0x40001864;
_fputwc_r = 0x400017f8;
_fwalk = 0x4001bcec;
_fwalk_reent = 0x4001bd24;
isalnum = 0x400078d8;
isalpha = 0x400078e8;
isascii = 0x4001aaec;
_isatty_r = 0x400078a0;
isblank = 0x400078f8;
iscntrl = 0x40007918;
isdigit = 0x40007930;
@ -24,12 +44,11 @@ isprint = 0x40007980;
ispunct = 0x40007994;
isspace = 0x400079ac;
isupper = 0x400079c4;
/*
itoa = ;
__itoa = ;
*/
labs = 0x40000648;
ldiv = 0x40000650;
__locale_ctype_ptr = 0x40001c2c;
__locale_ctype_ptr_l = 0x40001c24;
__locale_mb_cur_max = 0x40001c0c;
longjmp = 0x400005a4;
_mbtowc_r = 0x400079e0;
memccpy = 0x4001ab00;
@ -39,12 +58,28 @@ memcpy = 0x4001aba8;
memmove = 0x4001acb0;
memrchr = 0x4001acec;
memset = 0x4001ad3c;
pthread_setcancelstate = 0x40019fa8;
open = 0x400080c4;
qsort = 0x400006f4;
rand = 0x40007a78;
rand_r = 0x40007af4;
__sclose = 0x4001a700;
__seofread = 0x4001a690;
setjmp = 0x40000540;
setlocale = 0x40001c44;
_setlocale_r = 0x40001bdc;
__sflush_r = 0x400019dc;
__sfmoreglue = 0x4001a4c8;
__sfp = 0x4001a590;
__sfp_lock_acquire = 0x4001a508;
__sfp_lock_release = 0x4001a514;
__sfvwrite_r = 0x40001310;
__sinit = 0x4001a538;
__sinit_lock_acquire = 0x4001a520;
__sinit_lock_release = 0x4001a52c;
__smakebuf_r = 0x40001954;
__sprint_r = 0x40000aec;
srand = 0x40007a24;
__sread = 0x4001a660;
__sseek = 0x4001a6cc;
strcasecmp = 0x40007b38;
strcasestr = 0x40007b7c;
strcat = 0x4001ad90;
@ -72,22 +107,19 @@ strspn = 0x4001aebc;
strstr = 0x4001aee8;
__strtok_r = 0x4001af18;
strtok_r = 0x4001af7c;
/*
strtol = ;
strtol_l = ;
_strtol_r = ;
strtoul = ;
strtoul_l = ;
_strtoul_r = ;
*/
strupr = 0x40008084;
__swbuf = 0x4000167c;
__swbuf_r = 0x400015bc;
__swhatbuf_r = 0x400018f8;
__swrite = 0x4001a698;
__swsetup_r = 0x40001690;
toascii = 0x4001af90;
tolower = 0x40008158;
toupper = 0x40008174;
/*
utoa = ;
__utoa = ;
*/
vfiprintf = 0x40000e40;
_vfiprintf_r = 0x40000b58;
vfprintf = 0x40000e40;
_vfprintf_r = 0x40000b58;
wcrtomb = 0x400012f4;
_wcrtomb_r = 0x400012a0;
_wctomb_r = 0x400018ac;

View File

@ -1,54 +0,0 @@
/* These are the stdio related newlib functions present in ESP32-S2 ROM.
They are not used when compiling with newlib 3.
*/
PROVIDE ( fclose = 0x40015a30 );
PROVIDE ( _fclose_r = 0x40015940 );
PROVIDE ( fflush = 0x40001f94 );
PROVIDE ( _fflush_r = 0x40001f0c );
PROVIDE ( __fp_lock_all = 0x40015864 );
PROVIDE ( _fwalk = 0x40016efc );
PROVIDE ( _fwalk_reent = 0x40016f34 );
PROVIDE ( fiprintf = 0x40000e18 );
PROVIDE ( _fiprintf_r = 0x40000df4 );
PROVIDE ( fprintf = 0x40000e18 );
PROVIDE ( _fprintf_r = 0x40000df4 );
PROVIDE ( __fp_unlock_all = 0x40015878 );
PROVIDE ( fputwc = 0x40001c40 );
PROVIDE ( __fputwc = 0x40001b4c );
PROVIDE ( _fputwc_r = 0x40001bd4 );
PROVIDE ( _printf_common = 0x4000123c );
PROVIDE ( _printf_float = 0x40015538 );
PROVIDE ( _printf_i = 0x40001308 );
PROVIDE ( vfiprintf = 0x4000121c );
PROVIDE ( _vfiprintf_r = 0x40000f34 );
PROVIDE ( vfprintf = 0x4000121c );
PROVIDE ( _vfprintf_r = 0x40000f34 );
PROVIDE ( _scanf_float = 0x40015554 );
PROVIDE ( __sclose = 0x4001592c );
PROVIDE ( __seofread = 0x400158bc );
PROVIDE ( __sf_fake_stderr = 0x3ffae938 );
PROVIDE ( __sf_fake_stdin = 0x3ffae978 );
PROVIDE ( __sf_fake_stdout = 0x3ffae958 );
PROVIDE ( __sflush_r = 0x40001db8 );
PROVIDE ( __sfmoreglue = 0x400156f4 );
PROVIDE ( __sfp = 0x400157bc );
PROVIDE ( __sfp_lock_acquire = 0x40015734 );
PROVIDE ( __sfp_lock_release = 0x40015740 );
PROVIDE ( __sfputs_r = 0x40000e7c );
PROVIDE ( __sfvwrite_r = 0x400016ec );
PROVIDE ( __sinit = 0x40015764 );
PROVIDE ( __sinit_lock_acquire = 0x4001574c );
PROVIDE ( __sinit_lock_release = 0x40015758 );
PROVIDE ( __smakebuf_r = 0x40001d30 );
PROVIDE ( __sprint_r = 0x40000ec8 );
PROVIDE ( __sread = 0x4001588c );
PROVIDE ( __sseek = 0x400158f8 );
PROVIDE ( __swbuf = 0x40001a58 );
PROVIDE ( __swbuf_r = 0x40001998 );
PROVIDE ( __swhatbuf_r = 0x40001cd4 );
PROVIDE ( __swrite = 0x400158c4 );
PROVIDE ( __swsetup_r = 0x40001a6c );
PROVIDE ( _cleanup = 0x40015724 );
PROVIDE ( _cleanup_r = 0x400156ac );
PROVIDE ( creat = 0x40007c68 );

View File

@ -1,103 +0,0 @@
/*
ROM Functions defined in this file are not used in ESP-IDF as is,
and different definitions for functions with the same names are provided.
This file is not used when linking ESP-IDF and is intended for reference only
*/
PROVIDE ( abort = 0x400151e0 );
PROVIDE ( ets_timer_arm = 0x4000d76c );
PROVIDE ( ets_timer_arm_us = 0x4000d7b0 );
PROVIDE ( ets_timer_disarm = 0x4000d7f0 );
PROVIDE ( ets_timer_done = 0x4000d82c );
PROVIDE ( ets_timer_handler_isr = 0x4000d858 );
PROVIDE ( ets_timer_init = 0x4000d8ec );
PROVIDE ( ets_timer_setfn = 0x4000d754 );
PROVIDE ( _KernelExceptionVector = 0x40000300 );
PROVIDE ( _KernelExceptionVector_text_end = 0x40000306 );
PROVIDE ( _KernelExceptionVector_text_start = 0x40000300 );
PROVIDE ( _NMIExceptionVector = 0x400002c0 );
PROVIDE ( _NMIExceptionVector_text_end = 0x400002c3 );
PROVIDE ( _NMIExceptionVector_text_start = 0x400002c0 );
PROVIDE ( _UserExceptionVector = 0x40000340 );
PROVIDE ( _UserExceptionVector_text_end = 0x40000357 );
PROVIDE ( _UserExceptionVector_text_start = 0x40000340 );
PROVIDE ( _DebugExceptionVector = 0x40000280 );
PROVIDE ( _DebugExceptionVector_text_end = 0x4000028b );
PROVIDE ( _DebugExceptionVector_text_start = 0x40000280 );
PROVIDE ( _DoubleExceptionVector = 0x400003c0 );
PROVIDE ( _DoubleExceptionVector_text_end = 0x400003c6 );
PROVIDE ( _DoubleExceptionVector_text_start = 0x400003c0 );
PROVIDE ( _Level2FromVector = 0x400078d4 );
PROVIDE ( _Level2HandlerLabel = 0x00000000 );
PROVIDE ( _Level2InterruptVector_text_end = 0x40000186 );
PROVIDE ( _Level2InterruptVector_text_start = 0x40000180 );
PROVIDE ( _Level2Vector = 0x40000180 );
PROVIDE ( _Level3FromVector = 0x40007970 );
PROVIDE ( _Level3HandlerLabel = 0x00000000 );
PROVIDE ( _Level3InterruptVector_text_end = 0x400001c6 );
PROVIDE ( _Level3InterruptVector_text_start = 0x400001c0 );
PROVIDE ( _Level3Vector = 0x400001c0 );
PROVIDE ( _Level4FromVector = 0x40007a08 );
PROVIDE ( _Level4HandlerLabel = 0x00000000 );
PROVIDE ( _Level4InterruptVector_text_end = 0x40000206 );
PROVIDE ( _Level4InterruptVector_text_start = 0x40000200 );
PROVIDE ( _Level4Vector = 0x40000200 );
PROVIDE ( _Level5FromVector = 0x40007b38 );
PROVIDE ( _Level5HandlerLabel = 0x00000000 );
PROVIDE ( _Level5InterruptVector_text_end = 0x40000246 );
PROVIDE ( _Level5InterruptVector_text_start = 0x40000240 );
PROVIDE ( _Level5Vector = 0x40000240 );
PROVIDE ( _LevelOneInterrupt = 0x400077e6 );
PROVIDE ( _ResetHandler = 0x4000044c );
PROVIDE ( _ResetVector = 0x40000400 );
PROVIDE ( _ResetVector_literal_end = 0x40000540 );
PROVIDE ( _ResetVector_literal_start = 0x40000540 );
PROVIDE ( _ResetVector_text_end = 0x4000053d );
PROVIDE ( _ResetVector_text_start = 0x40000400 );
PROVIDE ( _SyscallException = 0x40007706 );
PROVIDE ( _WindowOverflow12 = 0x40000100 );
PROVIDE ( _WindowOverflow4 = 0x40000000 );
PROVIDE ( _WindowOverflow8 = 0x40000080 );
PROVIDE ( _WindowUnderflow12 = 0x40000140 );
PROVIDE ( _WindowUnderflow4 = 0x40000040 );
PROVIDE ( _WindowUnderflow8 = 0x400000c0 );
PROVIDE ( _WindowVectors_text_end = 0x40000170 );
PROVIDE ( _WindowVectors_text_start = 0x40000000 );
PROVIDE ( hmac_md5 = 0x4000586c );
PROVIDE ( hmac_md5_vector = 0x4000577c );
PROVIDE ( MD5Final = 0x400056e8 );
PROVIDE ( MD5Init = 0x40005648 );
PROVIDE ( MD5Update = 0x40005668 );
PROVIDE ( md5_vector = 0x40005750 );
PROVIDE ( _xtos_alloca_handler = 0x40000010 );
PROVIDE ( xtos_cause3_handler = 0x4000774c );
PROVIDE ( xtos_c_handler_table = 0x3fffcea8 );
PROVIDE ( xtos_c_wrapper_handler = 0x4000775c );
PROVIDE ( _xtos_enabled = 0x3fffcfb0 );
PROVIDE ( xtos_exc_handler_table = 0x3fffcda8 );
PROVIDE ( xtos_interrupt_mask_table = 0x3fffd0b8 );
PROVIDE ( xtos_interrupt_table = 0x3fffcfb8 );
PROVIDE ( _xtos_ints_off = 0x4001560c );
PROVIDE ( _xtos_ints_on = 0x400155e8 );
PROVIDE ( _xtos_intstruct = 0x3fffcfb0 );
PROVIDE ( _xtos_l1int_handler = 0x400077c8 );
PROVIDE ( xtos_p_none = 0x40015acc );
PROVIDE ( _xtos_restore_intlevel = 0x400078a8 );
PROVIDE ( _xtos_return_from_exc = 0x40015ad4 );
PROVIDE ( _xtos_set_exception_handler = 0x40007690 );
PROVIDE ( _xtos_set_interrupt_handler = 0x400155ac );
PROVIDE ( _xtos_set_interrupt_handler_arg = 0x40015570 );
PROVIDE ( _xtos_set_intlevel = 0x40015aec );
PROVIDE ( _xtos_set_min_intlevel = 0x40015b08 );
PROVIDE ( _xtos_set_vpri = 0x400078b4 );
PROVIDE ( _xtos_syscall_handler = 0x400076d8 );
PROVIDE ( xtos_unhandled_exception = 0x40015b2c );
PROVIDE ( xtos_unhandled_interrupt = 0x40015b3c );
PROVIDE ( _xtos_vectors_ref_ = 0x00000000 );
PROVIDE ( _xtos_vpri_enabled = 0x3fffcfb4 );
PROVIDE ( setlocale = 0x40002020 );
PROVIDE ( _setlocale_r = 0x40001fb8 );

View File

@ -1,12 +1,7 @@
/*
SPI flash driver function, compatibility names.
*/
/**
* SPI flash driver function, compatibility names.
*/
PROVIDE ( cache_ibus_mmu_set_rom = cache_ibus_mmu_set );
PROVIDE ( Cache_Read_Disable_rom = Cache_Read_Disable );
PROVIDE ( Cache_Read_Enable_rom = Cache_Read_Enable );
PROVIDE ( cache_dbus_mmu_set_rom = cache_dbus_mmu_set );
PROVIDE ( g_rom_spiflash_dummy_len_plus = dummy_len_plus);
PROVIDE ( g_ticks_per_us_pro = g_ticks_per_us );
PROVIDE ( g_rom_flashchip = SPI_flashchip_data );
@ -25,4 +20,4 @@ PROVIDE ( esp_rom_spiflash_erase_block = SPIEraseBlock );
PROVIDE ( esp_rom_spiflash_wait_idle = SPI_Wait_Idle );
PROVIDE ( esp_rom_spiflash_config_readmode = SPIReadModeCnfig );
PROVIDE ( esp_rom_spiflash_erase_block = SPIEraseBlock );
PROVIDE ( esp_rom_spiflash_write_encrypted = SPI_Encrypt_Write );
PROVIDE ( esp_rom_spiflash_write_encrypted = SPI_Encrypt_Write );

View File

@ -1,60 +0,0 @@
/* These ROM functions call respective entries in the syscall table.
They are called by other ROM functions (mostly from newlib).
We don't link to them directly, since in IDF there are actual
implementations of these functions, with same names.
I.e.:
times (in ROM) -> _times_r (in ROM) -> syscall table entry _times_r -> _times_r (in IDF)
Hence the following entries are provided only for reference
and commented out.
*/
/*
PROVIDE ( calloc = 0x40015520 );
PROVIDE ( _calloc_r = 0x40015234 );
PROVIDE ( close = 0x4000848c );
PROVIDE ( _close_r = 0x40015378 );
PROVIDE ( free = 0x400154f4 );
PROVIDE ( _free_r = 0x40015208 );
PROVIDE ( _fstat_r = 0x40015308 );
PROVIDE ( _getpid_r = 0x40015338 );
PROVIDE ( __getreent = 0x400154c8 );
PROVIDE ( _gettimeofday_r = 0x40015294 );
PROVIDE ( _kill_r = 0x4001534c );
PROVIDE ( _link_r = 0x400152d8 );
PROVIDE ( _lock_acquire = 0x40015450 );
PROVIDE ( _lock_acquire_recursive = 0x40015464 );
PROVIDE ( _lock_close = 0x40015428 );
PROVIDE ( _lock_close_recursive = 0x4001543c );
PROVIDE ( _lock_init = 0x40015400 );
PROVIDE ( _lock_init_recursive = 0x40015414 );
PROVIDE ( _lock_release = 0x400154a0 );
PROVIDE ( _lock_release_recursive = 0x400154b4 );
PROVIDE ( _lock_try_acquire = 0x40015478 );
PROVIDE ( _lock_try_acquire_recursive = 0x4001548c );
PROVIDE ( _lseek_r = 0x400153c8 );
PROVIDE ( malloc = 0x400154dc );
PROVIDE ( _malloc_r = 0x400151f0 );
PROVIDE ( open = 0x400084a0 );
PROVIDE ( _open_r = 0x40015390 );
PROVIDE ( _raise_r = 0x400152ac );
PROVIDE ( read = 0x400084f0 );
PROVIDE ( _read_r = 0x400153e4 );
PROVIDE ( realloc = 0x40015508 );
PROVIDE ( _realloc_r = 0x4001521c );
PROVIDE ( _rename_r = 0x40015264 );
PROVIDE ( sbrk = 0x40008508 );
PROVIDE ( _sbrk_r = 0x40015320 );
PROVIDE ( _stat_r = 0x400152f0 );
PROVIDE ( _system_r = 0x4001524c );
PROVIDE ( _times_r = 0x4001527c );
PROVIDE ( _unlink_r = 0x400152c0 );
PROVIDE ( write = 0x4000851c );
PROVIDE ( _write_r = 0x400153ac );
PROVIDE ( _isatty_r = 0x40007c7c );
PROVIDE ( _exit_r = 0x40015364 );
*/

View File

@ -1,9 +1,9 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
@ -26,13 +26,13 @@ extern "C" {
#endif
/*
ESP32 ROM code contains implementations of some of C library functions.
ESP32-S2 ROM code contains implementations of some of C library functions.
Whenever a function in ROM needs to use a syscall, it calls a pointer to the corresponding syscall
implementation defined in the following struct.
The table itself, by default, is not allocated in RAM. There are two pointers, `syscall_table_ptr_pro` and
`syscall_table_ptr_app`, which can be set to point to the locations of syscall tables of CPU 0 (aka PRO CPU)
and CPU 1 (aka APP CPU). Location of these pointers in .bss segment of ROM code is defined in linker script.
The table itself, by default, is not allocated in RAM. There is a pointer, `syscall_table_ptr_pro`,
which can be set to point to the locations of syscall tables of CPU 0 (aka PRO CPU).
Location of this pointer in .bss segment of ROM code is defined in linker script.
So, before using any of the C library functions (except for pure functions and memcpy/memset functions),
application must allocate syscall table structure for each CPU being used, and populate it with pointers
@ -80,7 +80,6 @@ struct syscall_stub_table
};
extern struct syscall_stub_table* syscall_table_ptr_pro;
extern struct syscall_stub_table* syscall_table_ptr_app;
#ifdef __cplusplus
} // extern "C"

View File

@ -1,4 +1,4 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -22,11 +22,16 @@
#include <sys/signal.h>
#include <sys/unistd.h>
#include <sys/reent.h>
#include "esp32/rom/libc_stubs.h"
#include "esp_vfs.h"
#include "esp_newlib.h"
#include "sdkconfig.h"
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/libc_stubs.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/libc_stubs.h"
#endif
static struct _reent s_reent;
extern int _printf_float(struct _reent *rptr,
@ -93,7 +98,9 @@ static struct syscall_stub_table s_stub_table = {
void esp_setup_syscall_table(void)
{
syscall_table_ptr_pro = &s_stub_table;
#if !CONFIG_FREERTOS_UNICORE
syscall_table_ptr_app = &s_stub_table;
#endif
_GLOBAL_REENT = &s_reent;
environ = malloc(sizeof(char*));
environ[0] = NULL;