tinygo/src/runtime
Ayke van Laethem abb09e869e runtime, internal/task: refactor to simplify stack switching
The Cortex-M target isn't much changed, but much of the logic for the
AVR stack switcher that was previously in assembly has now been moved to
Go to make it more maintainable and in fact smaller in code size. Three
functions (tinygo_getCurrentStackPointer, tinygo_switchToTask,
tinygo_switchToScheduler) have been changed to one: tinygo_swapTask.

This reduction in assembly code should make the code more maintainable
and should make it easier to port stack switching to other
architectures.

I've also moved the assembly files to src/internal/task, which seems
like a more appropriate location to me.
2020-12-05 09:02:11 +01:00
..
cgo runtime/cgo: go fmt 2018-09-14 20:58:00 +02:00
internal/sys all: check formatting on CI 2019-04-13 19:58:58 +02:00
interrupt esp: add support for the Espressif ESP32 chip 2020-08-31 09:02:23 +02:00
pprof loader: rewrite/refactor much of the code to use go list directly 2020-09-03 22:10:14 +02:00
volatile Viable NXP/Teensy support 2020-07-08 21:58:15 +02:00
arch_386.go gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
arch_amd64.go gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
arch_arm.go support WASI target (#1373) 2020-09-29 21:58:03 +02:00
arch_arm64.go gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
arch_avr.go runtime: add dummy getCurrentStackPointer functions 2019-08-25 13:12:27 +02:00
arch_cortexm.go nrf: call sd_app_evt_wait when the SoftDevice is enabled 2020-08-24 22:46:21 +02:00
arch_tinygoriscv.go runtime: reuse common code between 32 and 64-bit RISC-V 2020-07-08 00:21:59 +02:00
arch_tinygoriscv32.go runtime: reuse common code between 32 and 64-bit RISC-V 2020-07-08 00:21:59 +02:00
arch_tinygoriscv64.go runtime: reuse common code between 32 and 64-bit RISC-V 2020-07-08 00:21:59 +02:00
arch_wasm.go all: change //go:export to //export 2020-04-05 16:16:57 +02:00
arch_xtensa.go esp: add support for the Espressif ESP32 chip 2020-08-31 09:02:23 +02:00
baremetal.go test: support non-host tests 2020-09-24 21:17:26 +02:00
chan.go runtime: make channels work in interrupts 2020-07-04 08:34:39 +02:00
complex.go compiler: implement complex division 2019-05-11 15:33:37 +02:00
cond.go runtime: add cheap atomic condition variable 2020-10-14 13:35:00 +02:00
cond_nosched.go runtime: add cheap atomic condition variable 2020-10-14 13:35:00 +02:00
defer.go compiler: avoid function pointers in defer calls 2018-12-09 16:44:37 +01:00
dynamic_arm64.go nintendoswitch: Add env parser and removed unused stuff 2020-11-03 23:28:55 +01:00
error.go extend stdlib to allow import of more packages (#1099) 2020-06-23 11:56:28 +02:00
float.go compiler: implement complex division 2019-05-11 15:33:37 +02:00
func.go compiler: fix crash with linked lists in interfaces 2019-08-05 14:44:30 +02:00
gc_386.S gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
gc_amd64.S gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
gc_arm.S runtime: move/refactor some GC-related code 2020-10-02 08:54:43 +02:00
gc_arm64.S gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
gc_avr.S runtime: move/refactor some GC-related code 2020-10-02 08:54:43 +02:00
gc_conservative.go runtime (gc): do not scan the runqueue when the platform is not baremetal with a scheduler 2020-07-04 08:34:39 +02:00
gc_extalloc.go runtime: make channels work in interrupts 2020-07-04 08:34:39 +02:00
gc_globals_conservative.go runtime (gc): add garbage collector that uses an external allocator 2020-03-30 14:35:29 +02:00
gc_globals_precise.go runtime (gc): add garbage collector that uses an external allocator 2020-03-30 14:35:29 +02:00
gc_leaking.go run init in a goroutine 2020-03-17 19:25:30 +01:00
gc_none.go run init in a goroutine 2020-03-17 19:25:30 +01:00
gc_riscv.S runtime: move/refactor some GC-related code 2020-10-02 08:54:43 +02:00
gc_stack_portable.go gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
gc_stack_raw.go gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
hashmap.go runtime: allow ranging over a nil map 2020-10-29 21:53:41 +01:00
hosted.go runtime (gc): do not scan the runqueue when the platform is not baremetal with a scheduler 2020-07-04 08:34:39 +02:00
interface.go runtime: implement comparing uintptr values in interfaces 2019-11-09 13:41:27 -05:00
math.go all: change //go:export to //export 2020-04-05 16:16:57 +02:00
os_darwin.go all: add macOS support 2019-02-19 15:54:36 +01:00
os_freebsd.go Add initial FreeBSD support 2019-12-29 10:48:28 +01:00
os_js.go Add runtime.GOOS 2018-08-30 05:48:16 +02:00
os_linux.go Add runtime.GOOS 2018-08-30 05:48:16 +02:00
panic.go all: change //go:export to //export 2020-04-05 16:16:57 +02:00
poll.go runtime: remove ctx param from stub code 2019-01-14 20:56:42 +01:00
print.go runtime: use dedicated printfloat32 2020-10-02 11:26:22 +02:00
runtime.go runtime: refactor time handling 2020-05-25 22:08:28 +02:00
runtime_arm7tdmi.go runtime: refactor time handling 2020-05-25 22:08:28 +02:00
runtime_atmega.go avr: use register wrappers that use runtime/volatile.*Uint8 calls 2019-05-14 12:24:01 +02:00
runtime_atsamd21.go nrf: call sd_app_evt_wait when the SoftDevice is enabled 2020-08-24 22:46:21 +02:00
runtime_atsamd21e18.go machine/sam: Refactor all machine/runtime code to use new volatile package/API 2019-05-19 19:53:11 +02:00
runtime_atsamd21g18.go machine/sam: Refactor all machine/runtime code to use new volatile package/API 2019-05-19 19:53:11 +02:00
runtime_atsamd51.go machine/atsamd51x,runtime/atsamd51x: fixes needed for full support for all PWM pins. Also adds some useful constants to clarify peripheral clock usage 2020-08-30 09:27:17 +02:00
runtime_atsamd51g19.go runtime/atsamd51x: use PCHCTRL_GCLK_SERCOMX_SLOW for setting clocks on all SERCOM ports 2020-08-30 09:27:17 +02:00
runtime_atsamd51j19.go runtime/atsamd51x: use PCHCTRL_GCLK_SERCOMX_SLOW for setting clocks on all SERCOM ports 2020-08-30 09:27:17 +02:00
runtime_atsamd51j20.go runtime/atsamd51x: use PCHCTRL_GCLK_SERCOMX_SLOW for setting clocks on all SERCOM ports 2020-08-30 09:27:17 +02:00
runtime_atsamd51p19.go runtime/atsamd51x: use PCHCTRL_GCLK_SERCOMX_SLOW for setting clocks on all SERCOM ports 2020-08-30 09:27:17 +02:00
runtime_attiny.go avr: add support for the digispark 2018-11-20 18:50:24 +01:00
runtime_avr.go runtime: refactor time handling 2020-05-25 22:08:28 +02:00
runtime_cortexm.go Implement custom abort and fault handler for debugging 2020-07-08 21:58:15 +02:00
runtime_cortexm_abort.go test: support non-host tests 2020-09-24 21:17:26 +02:00
runtime_cortexm_hardfault.go add better fault identification for Cortex-M3/M33/M4/M7 hardfault handlers, add fault description registers to SCB_Type 2020-11-11 18:34:47 +01:00
runtime_cortexm_hardfault_debug.go add better fault identification for Cortex-M3/M33/M4/M7 hardfault handlers, add fault description registers to SCB_Type 2020-11-11 18:34:47 +01:00
runtime_cortexm_qemu.go test: support non-host tests 2020-09-24 21:17:26 +02:00
runtime_esp32.go esp: add support for the Espressif ESP32 chip 2020-08-31 09:02:23 +02:00
runtime_esp8266.go esp8266: add support for this chip 2020-09-09 19:17:11 +02:00
runtime_fe310.go Zero PLIC threshold value at startup 2020-06-07 11:45:26 +02:00
runtime_fe310_baremetal.go runtime: refactor time handling 2020-05-25 22:08:28 +02:00
runtime_fe310_qemu.go runtime: refactor time handling 2020-05-25 22:08:28 +02:00
runtime_k210.go maixbit: support both GPIO and GPIOHS controllers 2020-07-08 00:21:59 +02:00
runtime_k210_baremetal.go maixbit: support both GPIO and GPIOHS controllers 2020-07-08 00:21:59 +02:00
runtime_mimxrt1062.go teensy40: add UART support 2020-11-15 12:34:15 +01:00
runtime_mimxrt1062_clock.go teensy40: refactor to remove unnecessary code and constants 2020-11-11 18:34:47 +01:00
runtime_mimxrt1062_mpu.go teensy40: refactor to remove unnecessary code and constants 2020-11-11 18:34:47 +01:00
runtime_mimxrt1062_time.go teensy40: refactor to remove unnecessary code and constants 2020-11-11 18:34:47 +01:00
runtime_nintendoswitch.go nintendoswitch: Add env parser and removed unused stuff 2020-11-03 23:28:55 +01:00
runtime_nintendoswitch.s nintendoswitch: Add env parser and removed unused stuff 2020-11-03 23:28:55 +01:00
runtime_nrf.go runtime: use waitForEvents when appropriate 2020-08-24 22:46:21 +02:00
runtime_nrf_bare.go nrf: call sd_app_evt_wait when the SoftDevice is enabled 2020-08-24 22:46:21 +02:00
runtime_nrf_softdevice.go nrf: call sd_app_evt_wait when the SoftDevice is enabled 2020-08-24 22:46:21 +02:00
runtime_nxpmk66f18.go nrf: call sd_app_evt_wait when the SoftDevice is enabled 2020-08-24 22:46:21 +02:00
runtime_stm32.go nrf: call sd_app_evt_wait when the SoftDevice is enabled 2020-08-24 22:46:21 +02:00
runtime_stm32f103xx.go Allow interrupts in stm32f103xx (#1466) 2020-11-07 12:21:38 +01:00
runtime_stm32f405.go add basic UART handler 2020-09-14 08:48:01 +02:00
runtime_stm32f407.go runtime: refactor time handling 2020-05-25 22:08:28 +02:00
runtime_tinygoriscv.go maixbit (uart): serial is working with echo example 2020-07-08 00:21:59 +02:00
runtime_tinygoriscv64.go maixbit (uart): serial is working with echo example 2020-07-08 00:21:59 +02:00
runtime_tinygoriscv_qemu.go runtime: refactor time handling 2020-05-25 22:08:28 +02:00
runtime_unix.go gc: use raw stack access whenever possible 2020-10-02 08:54:43 +02:00
runtime_unix_heap.go support WASI target (#1373) 2020-09-29 21:58:03 +02:00
runtime_unix_noheap.go support WASI target (#1373) 2020-09-29 21:58:03 +02:00
runtime_wasm.go wasm: use the fixed length buffer for putchar 2020-10-23 22:04:32 +02:00
runtime_wasm_js.go support WASI target (#1373) 2020-09-29 21:58:03 +02:00
runtime_wasm_wasi.go support WASI target (#1373) 2020-09-29 21:58:03 +02:00
scheduler.go runtime: make channels work in interrupts 2020-07-04 08:34:39 +02:00
scheduler_any.go runtime: make channels work in interrupts 2020-07-04 08:34:39 +02:00
scheduler_coroutines.go refactor coroutine lowering and tasks 2020-03-17 12:16:10 +01:00
scheduler_none.go runtime: make channels work in interrupts 2020-07-04 08:34:39 +02:00
scheduler_tasks.go runtime, internal/task: refactor to simplify stack switching 2020-12-05 09:02:11 +01:00
slice.go runtime: return the correct type from the copy builtin 2020-03-11 15:44:31 -07:00
stack.go extend stdlib to allow import of more packages (#1099) 2020-06-23 11:56:28 +02:00
string.go runtime: fix UTF-8 decoding 2020-09-21 08:49:13 +02:00
strings_go111.go runtime: fix UTF-8 decoding 2020-09-21 08:49:13 +02:00
sync.go all: basic support for the os package 2018-09-16 13:01:03 +02:00
time_nxpmk66f18.go Viable NXP/Teensy support 2020-07-08 21:58:15 +02:00
wait_other.go runtime: make channels work in interrupts 2020-07-04 08:34:39 +02:00