Factor out register saves · Coderah/circuitpython@2bec056 · GitHub
Skip to content

Commit 2bec056

Browse files
committed
Factor out register saves
This fixes RISC-V ESP32 because it ignored registers on that architecture.
1 parent 66093e8 commit 2bec056

27 files changed

Lines changed: 166 additions & 359 deletions

File tree

main.c

Lines changed: 7 additions & 4 deletions

ports/analog/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ LINKERFILE = linking/$(MCU_VARIANT_LOWER)_cktpy.ld
138138
LDFLAGS += -nostartfiles -specs=nano.specs
139139
endif
140140

141-
SRC_S += supervisor/cpu.s \
142-
$(STARTUPFILE)
141+
SRC_S_UPPER = supervisor/shared/cpu_regs.S
142+
SRC_S += $(STARTUPFILE)
143143

144144
# Needed to compile some MAX32 headers
145145
CFLAGS += -D$(MCU_VARIANT_UPPER) \
@@ -236,6 +236,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
236236
endif
237237
OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o))
238238
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
239+
OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o))
239240
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
240241

241242
# List of sources for qstr extraction

ports/analog/supervisor/cpu.s

Lines changed: 0 additions & 34 deletions
This file was deleted.

ports/atmel-samd/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ ifeq ($(CIRCUITPY_AUDIOBUSIO),1)
308308
SRC_C += peripherals/samd/i2s.c peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/i2s.c
309309
endif
310310

311-
SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s
311+
SRC_S_UPPER = supervisor/shared/cpu_regs.S
312312

313313
OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
314314
OBJ += $(addprefix $(BUILD)/, $(SRC_ASF:.c=.o))
@@ -317,7 +317,7 @@ ifeq ($(INTERNAL_LIBM),1)
317317
OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
318318
endif
319319
OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o))
320-
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
320+
OBJ += $(addprefix $(BUILD)/, $(SRC_S_UPPER:.S=.o))
321321
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
322322

323323
QSTR_GLOBAL_REQUIREMENTS += $(HEADER_BUILD)/sdiodata.h

ports/atmel-samd/supervisor/samd21_cpu.s

Lines changed: 0 additions & 35 deletions
This file was deleted.

ports/atmel-samd/supervisor/samd51_cpu.s

Lines changed: 0 additions & 27 deletions
This file was deleted.

ports/atmel-samd/supervisor/same51_cpu.s

Lines changed: 0 additions & 27 deletions
This file was deleted.

ports/atmel-samd/supervisor/same54_cpu.s

Lines changed: 0 additions & 27 deletions
This file was deleted.

ports/cxd56/Makefile

Lines changed: 2 additions & 2 deletions

ports/cxd56/supervisor/cpu.s

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)