Skip to content

Commit

Permalink
all: Update to point to files in new shared/ directory.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Jul 12, 2021
1 parent 4d54671 commit 136369d
Show file tree
Hide file tree
Showing 141 changed files with 324 additions and 306 deletions.
12 changes: 6 additions & 6 deletions docs/develop/porting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ The basic MicroPython firmware is implemented in the main port file, e.g ``main.
#include "py/gc.h"
#include "py/mperrno.h"
#include "py/stackctrl.h"
#include "lib/utils/gchelper.h"
#include "lib/utils/pyexec.h"
#include "shared/runtime/gchelper.h"
#include "shared/runtime/pyexec.h"
// Allocate memory for the MicroPython GC heap.
static char heap[4096];
Expand Down Expand Up @@ -106,10 +106,10 @@ We also need a Makefile at this point for the port:
SRC_C = \
main.c \
mphalport.c \
lib/mp-readline/readline.c \
lib/utils/gchelper_generic.c \
lib/utils/pyexec.c \
lib/utils/stdout_helpers.c \
shared/readline/readline.c \
shared/runtime/gchelper_generic.c \
shared/runtime/pyexec.c \
shared/runtime/stdout_helpers.c \
# Define the required object files.
OBJ = $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
Expand Down
2 changes: 1 addition & 1 deletion drivers/cyw43/cyw43.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "lwip/netif.h"
#include "lwip/dhcp.h"
#include "lib/netutils/dhcpserver.h"
#include "shared/netutils/dhcpserver.h"
#include "drivers/cyw43/cyw43_ll.h"

// For trace_flags
Expand Down
2 changes: 1 addition & 1 deletion drivers/cyw43/cyw43_lwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <string.h>

#include "py/mphal.h"
#include "lib/netutils/netutils.h"
#include "shared/netutils/netutils.h"
#include "lwip/etharp.h"
#include "lwip/dns.h"
#include "lwip/apps/mdns.h"
Expand Down
16 changes: 8 additions & 8 deletions examples/embedding/Makefile.upylib
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ endif
endif

ifeq ($(MICROPY_USE_READLINE),1)
INC += -I$(MPTOP)/lib/mp-readline
INC += -I$(MPTOP)/shared/readline
CFLAGS_MOD += -DMICROPY_USE_READLINE=1
LIB_SRC_C_EXTRA += mp-readline/readline.c
SHARED_SRC_C_EXTRA += readline/readline.c
endif
ifeq ($(MICROPY_USE_READLINE),2)
CFLAGS_MOD += -DMICROPY_USE_READLINE=2
Expand Down Expand Up @@ -145,19 +145,19 @@ SRC_C = $(addprefix ports/unix/,\
$(SRC_MOD) \
)

LIB_SRC_C = $(addprefix lib/,\
$(LIB_SRC_C_EXTRA) \
utils/printf.c \
utils/gchelper_generic.c \
SHARED_SRC_C = $(addprefix shared/,\
libc/printf.c \
runtime/gchelper_generic.c \
timeutils/timeutils.c \
$(SHARED_SRC_C_EXTRA) \
)

OBJ = $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SHARED_SRC_C:.c=.o))

# List of sources for qstr extraction
SRC_QSTR += $(SRC_C) $(LIB_SRC_C)
SRC_QSTR += $(SRC_C) $(SHARED_SRC_C)
# Append any auto-generated sources that are needed by sources listed in
# SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
Expand Down
4 changes: 2 additions & 2 deletions extmod/extmod.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set(MICROPY_EXTMOD_DIR "${MICROPY_DIR}/extmod")
set(MICROPY_OOFATFS_DIR "${MICROPY_DIR}/lib/oofatfs")

set(MICROPY_SOURCE_EXTMOD
${MICROPY_DIR}/lib/embed/abort_.c
${MICROPY_DIR}/lib/utils/printf.c
${MICROPY_DIR}/shared/libc/abort_.c
${MICROPY_DIR}/shared/libc/printf.c
${MICROPY_EXTMOD_DIR}/machine_i2c.c
${MICROPY_EXTMOD_DIR}/machine_mem.c
${MICROPY_EXTMOD_DIR}/machine_pulse.c
Expand Down
2 changes: 1 addition & 1 deletion extmod/extmod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ LWIP_DIR = lib/lwip/src
INC += -I$(TOP)/$(LWIP_DIR)/include
CFLAGS_MOD += -DMICROPY_PY_LWIP=1
$(BUILD)/$(LWIP_DIR)/core/ipv4/dhcp.o: CFLAGS_MOD += -Wno-address
SRC_MOD += extmod/modlwip.c lib/netutils/netutils.c
SRC_MOD += extmod/modlwip.c shared/netutils/netutils.c
SRC_MOD += $(addprefix $(LWIP_DIR)/,\
apps/mdns/mdns.c \
core/def.c \
Expand Down
2 changes: 1 addition & 1 deletion extmod/modlwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "py/mperrno.h"
#include "py/mphal.h"

#include "lib/netutils/netutils.h"
#include "shared/netutils/netutils.h"

#include "lwip/init.h"
#include "lwip/tcp.h"
Expand Down
2 changes: 1 addition & 1 deletion extmod/uos_dupterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "py/objarray.h"
#include "py/stream.h"
#include "extmod/misc.h"
#include "lib/utils/interrupt_char.h"
#include "shared/runtime/interrupt_char.h"

#if MICROPY_PY_OS_DUPTERM

Expand Down
2 changes: 1 addition & 1 deletion extmod/vfs_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "py/mperrno.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs_fat.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"

#if FF_MAX_SS == FF_MIN_SS
#define SECSIZE(fs) (FF_MIN_SS)
Expand Down
2 changes: 1 addition & 1 deletion extmod/vfs_lfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "py/runtime.h"
#include "py/mphal.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"
#include "extmod/vfs.h"
#include "extmod/vfs_lfs.h"

Expand Down
2 changes: 1 addition & 1 deletion extmod/vfs_lfsx.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "py/objstr.h"
#include "py/mperrno.h"
#include "extmod/vfs.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"

STATIC int MP_VFS_LFSx(dev_ioctl)(const struct LFSx_API (config) * c, int cmd, int arg, bool must_return_int) {
mp_obj_t ret = mp_vfs_blockdev_ioctl(c->context, cmd, arg);
Expand Down
2 changes: 1 addition & 1 deletion mpy-cross/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ LDFLAGS = $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA)
SRC_C = \
main.c \
gccollect.c \
lib/utils/gchelper_generic.c \
shared/runtime/gchelper_generic.c \

# Add fmode when compiling with mingw gcc
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
Expand Down
2 changes: 1 addition & 1 deletion mpy-cross/gccollect.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "py/mpstate.h"
#include "py/gc.h"

#include "lib/utils/gchelper.h"
#include "shared/runtime/gchelper.h"

#if MICROPY_ENABLE_GC

Expand Down
4 changes: 2 additions & 2 deletions mpy-cross/mpy-cross.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<Import Project="$(PyMsvcDir)sources.props" />
<ItemGroup>
<ClCompile Include="@(PyCoreSource)" />
<ClCompile Include="$(PyBaseDir)lib/utils/gchelper_generic.c" >
<ClCompile Include="$(PyBaseDir)shared/runtime/gchelper_generic.c" >
<PreprocessorDefinitions>MICROPY_GCREGS_SETJMP</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="$(PyBaseDir)mpy-cross\gccollect.c"/>
Expand All @@ -103,4 +103,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion ports/bare-arm/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void free(void *p) {
}

// These standard string functions are needed by the runtime, and can be
// provided either by the system or lib/libc/string0.c. The implementations
// provided either by the system or shared/libc/string0.c. The implementations
// here are very simple.

int memcmp(const void *s1, const void *s2, size_t n) {
Expand Down
21 changes: 12 additions & 9 deletions ports/cc3200/application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,18 @@ APP_MAIN_SRC_C = \
APP_LIB_SRC_C = $(addprefix lib/,\
oofatfs/ff.c \
oofatfs/ffunicode.c \
)

APP_SHARED_SRC_C = $(addprefix shared/,\
libc/string0.c \
mp-readline/readline.c \
readline/readline.c \
netutils/netutils.c \
timeutils/timeutils.c \
utils/gchelper_native.c \
utils/pyexec.c \
utils/interrupt_char.c \
utils/stdout_helpers.c \
utils/sys_stdio_mphal.c \
runtime/gchelper_native.c \
runtime/pyexec.c \
runtime/interrupt_char.c \
runtime/stdout_helpers.c \
runtime/sys_stdio_mphal.c \
)

APP_STM_SRC_C = $(addprefix ports/stm32/,\
Expand All @@ -158,12 +161,12 @@ APP_STM_SRC_C = $(addprefix ports/stm32/,\

OBJ = $(PY_O) $(addprefix $(BUILD)/, $(APP_FATFS_SRC_C:.c=.o) $(APP_RTOS_SRC_C:.c=.o) $(APP_FTP_SRC_C:.c=.o) $(APP_HAL_SRC_C:.c=.o) $(APP_MISC_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(APP_MODS_SRC_C:.c=.o) $(APP_CC3100_SRC_C:.c=.o) $(APP_SL_SRC_C:.c=.o) $(APP_TELNET_SRC_C:.c=.o) $(APP_UTIL_SRC_C:.c=.o) $(APP_UTIL_SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/, $(APP_MAIN_SRC_C:.c=.o) $(APP_LIB_SRC_C:.c=.o) $(APP_STM_SRC_C:.c=.o))
OBJ += $(BUILD)/lib/utils/gchelper_m3.o
OBJ += $(addprefix $(BUILD)/, $(APP_MAIN_SRC_C:.c=.o) $(APP_SHARED_SRC_C:.c=.o) $(APP_LIB_SRC_C:.c=.o) $(APP_STM_SRC_C:.c=.o))
OBJ += $(BUILD)/shared/runtime/gchelper_m3.o
OBJ += $(BUILD)/pins.o

# List of sources for qstr extraction
SRC_QSTR += $(APP_MODS_SRC_C) $(APP_MISC_SRC_C) $(APP_STM_SRC_C)
SRC_QSTR += $(APP_MODS_SRC_C) $(APP_MISC_SRC_C) $(APP_STM_SRC_C) $(APP_SHARED_SRC_C)
# Append any auto-generated sources that are needed by sources listed in
# SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
Expand Down
6 changes: 3 additions & 3 deletions ports/cc3200/bootmgr/bootloader.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ BOOT_PY_SRC_C = $(addprefix py/,\
mpprint.c \
)

BOOT_LIB_SRC_C = $(addprefix lib/,\
BOOT_SHARED_SRC_C = $(addprefix shared/,\
libc/printf.c \
libc/string0.c \
utils/printf.c \
)

OBJ = $(addprefix $(BUILD)/, $(BOOT_HAL_SRC_C:.c=.o) $(BOOT_SL_SRC_C:.c=.o) $(BOOT_CC3100_SRC_C:.c=.o) $(BOOT_UTIL_SRC_C:.c=.o) $(BOOT_MISC_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(BOOT_MAIN_SRC_C:.c=.o) $(BOOT_MAIN_SRC_S:.s=.o) $(BOOT_PY_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(BOOT_LIB_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(BOOT_SHARED_SRC_C:.c=.o))

# Add the linker script
LINKER_SCRIPT = bootmgr/bootmgr.lds
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/fatfs_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "py/runtime.h"
#include "lib/oofatfs/ff.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"
#include "mods/pybrtc.h"

#if FF_FS_REENTRANT
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/ftp/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <stdio.h>

#include "py/runtime.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs.h"
#include "extmod/vfs_fat.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/mods/moduos.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "py/objtuple.h"
#include "py/objstr.h"
#include "py/runtime.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"
#include "lib/oofatfs/ff.h"
#include "lib/oofatfs/diskio.h"
#include "genhdr/mpversion.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/mods/modusocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "py/runtime.h"
#include "py/stream.h"
#include "py/mphal.h"
#include "lib/netutils/netutils.h"
#include "shared/netutils/netutils.h"
#include "modnetwork.h"
#include "modusocket.h"

Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/mods/modutime.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "py/obj.h"
#include "py/smallint.h"
#include "py/mphal.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"
#include "extmod/utime_mphal.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
Expand Down
4 changes: 2 additions & 2 deletions ports/cc3200/mods/modwlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include "py/runtime.h"
#include "py/stream.h"
#include "py/mphal.h"
#include "lib/timeutils/timeutils.h"
#include "lib/netutils/netutils.h"
#include "shared/timeutils/timeutils.h"
#include "shared/netutils/netutils.h"
#include "modnetwork.h"
#include "modusocket.h"
#include "modwlan.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/mods/pybrtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "py/obj.h"
#include "py/runtime.h"
#include "py/mperrno.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/mods/pybuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "py/objlist.h"
#include "py/stream.h"
#include "py/mphal.h"
#include "lib/utils/interrupt_char.h"
#include "shared/runtime/interrupt_char.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
Expand Down
6 changes: 3 additions & 3 deletions ports/cc3200/mptask.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "py/runtime.h"
#include "py/gc.h"
#include "py/mphal.h"
#include "lib/mp-readline/readline.h"
#include "shared/readline/readline.h"
#include "lib/oofatfs/ff.h"
#include "lib/oofatfs/diskio.h"
#include "extmod/vfs.h"
Expand All @@ -49,8 +49,8 @@
#include "pybuart.h"
#include "pybpin.h"
#include "pybrtc.h"
#include "lib/utils/pyexec.h"
#include "lib/utils/gchelper.h"
#include "shared/runtime/pyexec.h"
#include "shared/runtime/gchelper.h"
#include "gccollect.h"
#include "mperror.h"
#include "simplelink.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/telnet/telnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "py/runtime.h"
#include "py/mphal.h"
#include "lib/utils/interrupt_char.h"
#include "shared/runtime/interrupt_char.h"
#include "telnet.h"
#include "simplelink.h"
#include "modnetwork.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/cc3200/util/gccollect.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "py/gc.h"
#include "py/mpthread.h"
#include "lib/utils/gchelper.h"
#include "shared/runtime/gchelper.h"
#include "gccollect.h"

/******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32/fatfs_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <sys/time.h>
#include "lib/oofatfs/ff.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"

DWORD get_fattime(void) {
struct timeval tv;
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32/machine_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "py/obj.h"
#include "py/runtime.h"
#include "py/mphal.h"
#include "lib/timeutils/timeutils.h"
#include "shared/timeutils/timeutils.h"
#include "modmachine.h"
#include "machine_rtc.h"

Expand Down
4 changes: 2 additions & 2 deletions ports/esp32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
#include "py/repl.h"
#include "py/gc.h"
#include "py/mphal.h"
#include "lib/mp-readline/readline.h"
#include "lib/utils/pyexec.h"
#include "shared/readline/readline.h"
#include "shared/runtime/pyexec.h"
#include "uart.h"
#include "usb.h"
#include "modmachine.h"
Expand Down
Loading

0 comments on commit 136369d

Please sign in to comment.