8000 add existing libc entry points to mp_port_fun_table · micropython/micropython@30eca7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 30eca7d

Browse files
committed
add existing libc entry points to mp_port_fun_table
1 parent 283ecc7 commit 30eca7d

File tree

3 files changed

+106
-3
lines changed

3 files changed

+106
-3
lines changed

ports/esp32/esp32-common.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ MICROPY_BLUETOOTH_NIMBLE = 1
135135
endif
136136

137137
# include sdkconfig to get needed configuration values
138-
$(info SDKCONFIG=$(SDKCONFIG))
139138
SDKCONFIG := $(addprefix $(PORT_DIR)/, $(SDKCONFIG))
140-
$(info SDKCONFIG=$(SDKCONFIG))
141139
include $(SDKCONFIG)
142140

143141
################################################################################

ports/esp32/port_fun.inc

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,96 @@
1+
// List of libc entry points that are already linked into MP for inclusion into mp_port_fun_table
2+
// Obtained using something like:
3+
// xtensa-esp32-elf-nm --extern-only build-GENERIC/application.elf | grep ' A ' |
4+
// sed -e 's/^.* [TA] //' | sort -u >externs-mp
5+
// <same command on find ~/.espressif/tools/xtensa-esp32-elf/ -name libc.a>
6+
// sort externs-libc1 externs-mp1 | uniq -c | egrep ' 2 ' | egrep -v ' _' | sed -e 's/.* //' >libc.inc
7+
abs,
8+
asctime,
9+
asctime_r,
10+
atoi,
11+
atol,
12+
bzero,
13+
creat,
14+
ctime,
15+
ctime_r,
16+
div,
17+
fclose,
18+
fflush,
19+
fputwc,
20+
gmtime,
21+
gmtime_r,
22+
isalnum,
23+
isalpha,
24+
isascii,
25+
isblank,
26+
iscntrl,
27+
isdigit,
28+
isgraph,
29+
islower,
30+
isprint,
31+
ispunct,
32+
isspace,
33+
isupper,
34+
itoa,
35+
labs,
36+
ldiv,
37+
localeconv,
38+
localtime,
39+
localtime_r,
40+
longjmp,
41+
memccpy,
42+
memchr,
43+
memcmp,
44+
memcpy,
45+
memmove,
46+
memrchr,
47+
memset,
48+
mktime,
49+
qsort,
50+
rand,
51+
rand_r,
52+
setjmp,
53+
setlocale,
54+
srand,
55+
strcasecmp,
56+
strcasestr,
57+
strcat,
58+
strchr,
59+
strcmp,
60+
strcoll,
61+
strcpy,
62+
strcspn,
63+
strdup,
64+
strftime,
65+
strlcat,
66+
strlcpy,
67+
strlen,
68+
strlwr,
69+
strncasecmp,
70+
strncat,
71+
strncmp,
72+
strncpy,
73+
strndup,
74+
strnlen,
75+
strrchr,
76+
strsep,
77+
strspn,
78+
strstr,
79+
strtok_r,
80+
strtol,
81+
strtoul,
82+
strupr,
83+
time,
84+
toascii,
85+
tolower,
86+
toupper,
87+
tzset,
88+
ungetc,
89+
utoa,
90+
wcrtomb,
91+
// List of ESP-IDF entry points culled from portions of the docs.
92+
// Initially generated for ESP-IDF v4.0 release using 'port_fun' target in Makefile.
93+
// Use that Makefile target to add new functions to the end of the list.
194
adc1_config_channel_atten,
295
adc1_config_width,
396
adc1_get_raw,

ports/esp32/portnativeglue.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#define INC_FREERTOS_H // avoid including ESP-IDF function definitions which spoil extern decl below
27+
// We need the MICROPY_PORT_FUN_TABLE #define from mpconfigport.h but need to exclude pulling in the
28+
// rest of the .h world because it spoils the phony "voidfun" type decl below. We #define some
29+
// XXX_H defines to prevent recursive inclusion. Alternatives would be to pass
30+
// -DMICROPY_PORT_FUN_TABLE on the gcc commandline or to build the mp_port_fun_table table in asm.
31+
#define _STDINT_H
32+
#define _NEWLIB_ALLOCA_H
33+
#define _SYS_TYPES_H
34+
#define _ROM_ETS_SYS_H_
35+
#define INC_FREERTOS_H
36+
#pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
37+
typedef int size_t;
38+
typedef int int32_t;
39+
typedef unsigned int uint32_t;
2840
#include "mpconfigport.h"
2941

3042
#if MICROPY_PORT_FUN_TABLE

0 commit comments

Comments
 (0)
0