Skip to content

Updates to PR #10325 #10337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions shared/runtime/pyexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ static int parse_compile_execute(const void *source, mp_parse_input_kind_t input
nlr_buf_t nlr;
nlr.ret_val = NULL;
if (nlr_push(&nlr) == 0) {
// CIRCUITPY-CHANGE: Made volatile to prevent gcc from re-ordering store of function pointer into stack frame
// after call to gc_collect. For RISC-V this was causing free of the compiled function before execution.
volatile mp_obj_t module_fun = mp_const_none;
// CIRCUITPY-CHANGE
mp_obj_t module_fun = mp_const_none;
// CIRCUITPY-CHANGE
#if CIRCUITPY_ATEXIT
if (!(exec_flags & EXEC_FLAG_SOURCE_IS_ATEXIT))
Expand Down
7 changes: 7 additions & 0 deletions supervisor/shared/cpu_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
#endif
#endif

#ifdef __riscv
#define INTEGER_REGS 12
#ifdef __riscv_vector
#define FLOATING_POINT_REGS 12
#endif
#endif

#ifndef INTEGER_REGS
#define INTEGER_REGS 0
#endif
Expand Down
Loading