Skip to content

Commit 6ab3b0b

Browse files
committed
Move other ports to gchelper
1 parent f7c66cc commit 6ab3b0b

File tree

13 files changed

+56
-2
lines changed

13 files changed

+56
-2
lines changed

ports/analog/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ endif
156156

157157
SRC_S_UPPER = supervisor/shared/cpu_regs.S
158158
SRC_S += $(STARTUPFILE)
159+
SRC_S += shared/runtime/gchelper_thumb2.s
160+
161+
SRC_C += shared/runtime/gchelper_native.c
159162

160163
# Needed to compile some MAX32 headers
161164
CFLAGS += -D$(MCU_VARIANT_UPPER) \

ports/atmel-samd/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ SRC_C += \
284284
lib/tinyusb/src/portable/microchip/samd/dcd_samd.c \
285285
mphalport.c \
286286
reset.c \
287+
shared/runtime/gchelper_native.c \
287288
timer_handler.c \
288289
$(SRC_PERIPHERALS) \
289290

@@ -308,6 +309,12 @@ ifeq ($(CIRCUITPY_AUDIOBUSIO),1)
308309
SRC_C += peripherals/samd/i2s.c peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/i2s.c
309310
endif
310311

312+
ifeq ($(CHIP_FAMILY), samd21)
313+
SRC_S += shared/runtime/gchelper_thumb1.s
314+
else
315+
SRC_S += shared/runtime/gchelper_thumb2.s
316+
endif
317+
311318
SRC_S_UPPER = supervisor/shared/cpu_regs.S
312319

313320
OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
@@ -317,6 +324,7 @@ ifeq ($(INTERNAL_LIBM),1)
317324
OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
318325
endif
319326
OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o))
327+
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
320328
OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o))
321329
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
322330

ports/broadcom/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ SRC_C += bindings/videocore/__init__.c \
5959

6060
SRC_S = peripherals/broadcom/boot$(SUFFIX).s
6161

62+
SRC_C += shared/runtime/gchelper_generic.c
63+
6264
OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
6365
OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o))
6466
ifeq ($(INTERNAL_LIBM),1)

ports/cxd56/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ LDFLAGS = \
111111
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_CXD56 -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=512 $(CFLAGS_MOD)
112112

113113
SRC_S_UPPER = supervisor/shared/cpu_regs.S
114+
SRC_S = shared/runtime/gchelper_thumb2.s
115+
116+
SRC_C += shared/runtime/gchelper_native.c
114117

115118
SRC_C += \
116119
background.c \
@@ -120,6 +123,7 @@ SRC_C += \
120123
lib/tinyusb/src/portable/sony/cxd56/dcd_cxd56.c \
121124

122125
OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
126+
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
123127
OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o))
124128
OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o))
125129
ifeq ($(INTERNAL_LIBM),1)

ports/espressif/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,12 @@ ifeq ($(IDF_TARGET_ARCH),xtensa)
216216
# `#include "xtensa/xtensa_api.h"`.
217217

218218
CFLAGS += -mlongcalls -isystem esp-idf/components/xtensa/deprecated_include/ -Wno-error=cpp
219+
CFLAGS += -DMICROPY_GCREGS_SETJMP=1
219220

220221
# Wrap longjmp with a patched version that protects register window update with a critical section
221222
LDFLAGS += -Wl,--wrap=longjmp
223+
224+
SRC_C += shared/runtime/gchelper_generic.c
222225
else ifeq ($(IDF_TARGET_ARCH),riscv)
223226

224227
ifeq ($(IDF_TARGET),esp32p4)
@@ -230,6 +233,9 @@ else ifeq ($(IDF_TARGET_ARCH),riscv)
230233
LDFLAGS += \
231234
-Lesp-idf/components/riscv/ld \
232235
-Trom.api.ld
236+
237+
SRC_C += shared/runtime/gchelper_native.c
238+
SRC_S = shared/runtime/gchelper_rv32i.s
233239
endif
234240

235241

@@ -594,6 +600,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
594600
endif
595601
OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o))
596602
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
603+
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
597604
OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o))
598605

599606
$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os

ports/litex/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ SRC_S_UPPER = \
8181
crt0-vexriscv.S \
8282
supervisor/shared/cpu_regs.S
8383

84+
SRC_S = shared/runtime/gchelper_rv32i.s
85+
86+
SRC_C += shared/runtime/gchelper_native.c
87+
8488
$(BUILD)/lib/tlsf/tlsf.o: CFLAGS += -Wno-cast-align
8589

8690
ifneq ($(FROZEN_MPY_DIR),)
@@ -94,6 +98,7 @@ ifeq ($(INTERNAL_LIBM),1)
9498
OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
9599
endif
96100
OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o))
101+
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
97102
OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o))
98103
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
99104

ports/mimxrt10xx/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,18 @@ SRC_S_UPPER = \
165165
sdk/devices/$(CHIP_FAMILY)/gcc/startup_$(CHIP_CORE).S \
166166
supervisor/shared/cpu_regs.S
167167

168+
SRC_S = shared/runtime/gchelper_thumb2.s
169+
170+
SRC_C += shared/runtime/gchelper_native.c
171+
168172
OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
169173
OBJ += $(addprefix $(BUILD)/, $(SRC_SDK:.c=.o))
170174
OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o))
171175
ifeq ($(INTERNAL_LIBM),1)
172176
OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
173177
endif
174178
OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o))
175-
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.S=.o))
179+
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
176180
OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o))
177181
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
178182

ports/nordic/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ $(patsubst %.c,$(BUILD)/%.o,$(SRC_DCD)): CFLAGS += -Wno-missing-prototypes
147147
endif # CIRCUITPY_USB_DEVICE
148148

149149
SRC_S_UPPER = supervisor/shared/cpu_regs.S
150+
SRC_S = shared/runtime/gchelper_thumb2.s
151+
152+
SRC_C += shared/runtime/gchelper_native.c
150153

151154
OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
152155
OBJ += $(addprefix $(BUILD)/, $(SRC_NRFX:.c=.o))
@@ -155,6 +158,7 @@ ifeq ($(INTERNAL_LIBM),1)
155158
OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
156159
endif
157160
OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o))
161+
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
158162
OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o))
159163
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
160164

ports/raspberrypi/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ SRC_S_UPPER_CHIP_VARIANT := \
422422
sdk/src/rp2_common/pico_float/float_aeabi_rp2040.S \
423423
sdk/src/rp2_common/pico_mem_ops/mem_ops_aeabi.S \
424424

425+
SRC_S = shared/runtime/gchelper_thumb1.s
426+
425427
PICO_LDFLAGS += \
426428
$(PICO_WRAP_FLOAT_AEABI_FLAGS) \
427429
$(PICO_WRAP_FLOAT_SCI_FLAGS) \
@@ -461,6 +463,8 @@ SRC_S_UPPER_CHIP_VARIANT := \
461463
sdk/src/rp2_common/pico_float/float_sci_m33_vfp.S \
462464
sdk/src/rp2_common/pico_float/float_common_m33.S \
463465

466+
SRC_S = shared/runtime/gchelper_thumb2.s
467+
464468
PICO_LDFLAGS += $(PICO_WRAP_FLOAT_SCI_FLAGS) $(PICO_WRAP_DOUBLE_FLAGS)
465469

466470
ifeq ($(CHIP_PACKAGE),A)
@@ -473,6 +477,7 @@ endif
473477

474478
endif
475479

480+
SRC_C += shared/runtime/gchelper_native.c
476481

477482
SRC_SDK := \
478483
src/common/hardware_claim/claim.c \

ports/renode/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ SRC_C += \
4646
mphalport.c \
4747

4848
SRC_S_UPPER = supervisor/shared/cpu_regs.S
49+
SRC_S = shared/runtime/gchelper_thumb1.s
50+
51+
SRC_C += shared/runtime/gchelper_native.c
4952

5053
OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
5154
OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o))

0 commit comments

Comments
 (0)