tinygo/src/runtime
Ayke van Laethem fcd88356db avr: fix time.Sleep() in init code
In the early days of TinyGo, the idea of `postinit` was to enable
interrupts only after initializers have run. Which kind of makes
sense... except that `time.Sleep` is allowed in init code and
`time.Sleep` requires interrupts to be enabled. Therefore, interrupts
must be enabled while initializers are being run.

This commit simply moves the enabling of interrupts to a point right
before running package initializers. It also removes `runtime.postinit`,
which is not necessary anymore (and was only used on AVR).
2022-01-02 19:41:44 +01:00
..
cgo
debug src/runtime/debug: stub debug.Stack() 2021-11-17 19:25:52 +01:00
internal/sys
interrupt transform: refactor interrupt lowering 2021-11-06 09:40:15 +01: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 runtime: use LLVM intrinsic to read the stack pointer 2021-11-30 10:01:44 +01:00
arch_amd64.go runtime: use LLVM intrinsic to read the stack pointer 2021-11-30 10:01:44 +01:00
arch_arm.go runtime: use LLVM intrinsic to read the stack pointer 2021-11-30 10:01:44 +01:00
arch_arm64.go runtime: use LLVM intrinsic to read the stack pointer 2021-11-30 10:01:44 +01:00
arch_avr.go runtime: use LLVM intrinsic to read the stack pointer 2021-11-30 10:01:44 +01:00
arch_cortexm.go rumtime: implement __sync libcalls as critical sections 2021-12-28 22:12:03 +01:00
arch_tinygoriscv.go rumtime: implement __sync libcalls as critical sections 2021-12-28 22:12:03 +01: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_tinygowasm.go Added realloc implementation to GCs 2021-12-10 17:51:08 +01:00
arch_xtensa.go runtime: use LLVM intrinsic to read the stack pointer 2021-11-30 10:01:44 +01:00
atomics_critical.go rumtime: implement __sync libcalls as critical sections 2021-12-28 22:12:03 +01:00
baremetal.go compiler, runtime: add layout parameter to runtime.alloc 2021-11-02 22:16:15 +01:00
chan.go compiler, runtime: add layout parameter to runtime.alloc 2021-11-02 22:16:15 +01:00
complex.go
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
dynamic_arm64.go nintendoswitch: Add env parser and removed unused stuff 2020-11-03 23:28:55 +01:00
env_linux.go os: implement and smoketest os.Unsetenv 2021-12-13 23:05:17 +01:00
error.go extend stdlib to allow import of more packages (#1099) 2020-06-23 11:56:28 +02:00
extern.go Add runtime stubs required for net/http 2021-06-01 15:15:12 +02:00
float.go
func.go compiler: decouple func lowering from interface type codes 2021-04-12 12:07:42 +02:00
gc_386.S 386: bump minimum requirement to the Pentium 4 2021-08-10 20:08:27 +02:00
gc_amd64.S internal/task, runtime: add subsections_via_symbols to assembly files on darwin 2021-09-07 08:00:11 +02:00
gc_amd64_windows.S all: add support for windows/amd64 2021-11-16 11:08:30 +01: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): correct scan bounds 2021-12-17 09:26:44 +01:00
gc_globals_conservative.go runtime: remove extalloc 2021-12-17 18:15:18 +01:00
gc_globals_precise.go runtime: remove extalloc 2021-12-17 18:15:18 +01:00
gc_leaking.go Added realloc implementation to GCs 2021-12-10 17:51:08 +01:00
gc_none.go Added realloc implementation to GCs 2021-12-10 17:51:08 +01:00
gc_riscv.S runtime: move/refactor some GC-related code 2020-10-02 08:54:43 +02:00
gc_stack_portable.go runtime: remove extalloc 2021-12-17 18:15:18 +01:00
gc_stack_raw.go runtime: remove extalloc 2021-12-17 18:15:18 +01:00
hashmap.go src/runtime: fix nil map dereference 2021-12-09 18:23:49 +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: allow comparing interfaces in reflectValueEqual() 2021-11-24 14:17:47 +01:00
mstats.go runtime: expose memory stats 2021-06-10 22:03:00 +02:00
nonhosted.go runtime: only initialize os.runtime_args when needed 2021-11-05 08:50:36 +01:00
os_darwin.go runtime: fix time base for time.Now() 2021-07-20 22:19:13 +02:00
os_js.go
os_linux.go runtime: fix time base for time.Now() 2021-07-20 22:19:13 +02:00
os_windows.go all: add support for windows/amd64 2021-11-16 11:08:30 +01:00
panic.go compiler: properly implement div and rem operations 2021-10-28 15:55:02 +02:00
poll.go
print.go runtime: only use CRLF on baremetal systems 2021-11-16 11:08:30 +01:00
runtime.go rumtime: implement __sync libcalls as critical sections 2021-12-28 22:12:03 +01:00
runtime_arm7tdmi.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_atmega.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
runtime_atsamd21.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_atsamd21e18.go
runtime_atsamd21g18.go
runtime_atsamd51.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01: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_atsamd51p20.go Add board support for Adafruit Grand Central M4 (SAMD51) (#1714) 2021-03-15 14:06:09 +01:00
runtime_atsame5x_can.go atsame5x: add support for CAN 2021-05-10 12:27:10 +02:00
runtime_atsame51j19.go atsame51: add initial support for feather-m4-can 2021-04-16 17:49:46 +02:00
runtime_atsame54p20.go atsame54: add initial support for atsame54-xpro 2021-04-15 15:43:37 +02:00
runtime_attiny.go attiny: remove dummy UART 2021-03-10 22:28:58 +01:00
runtime_avr.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_cortexm.go Implement custom abort and fault handler for debugging 2020-07-08 21:58:15 +02:00
runtime_cortexm_abort.go qemu: signal correct exit code to QEMU 2021-10-06 09:04:06 +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 avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_esp32.go qemu: signal correct exit code to QEMU 2021-10-06 09:04:06 +02:00
runtime_esp32c3.go add support for CPU interrupts for ESP32-C3 2021-10-23 03:31:37 +02:00
runtime_esp32xx.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_esp8266.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_fe310.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_fe310_baremetal.go qemu: signal correct exit code to QEMU 2021-10-06 09:04:06 +02:00
runtime_fe310_qemu.go qemu: signal correct exit code to QEMU 2021-10-06 09:04:06 +02:00
runtime_k210.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_k210_baremetal.go qemu: signal correct exit code to QEMU 2021-10-06 09:04:06 +02:00
runtime_mimxrt1062.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +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 avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_nintendoswitch.s nintendoswitch: Add env parser and removed unused stuff 2020-11-03 23:28:55 +01:00
runtime_nrf.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01: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: avoid heap allocation in waitForEvent 2021-05-30 20:56:01 +02:00
runtime_nxpmk66f18.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_rp2040.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_stm32.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_stm32_timers.go runtime: remove unused arrtype type aliases 2021-12-23 22:07:49 +01:00
runtime_stm32f4.go runtime: separate runtime initialization for STM32F4 boards 2021-12-31 10:30:48 +00:00
runtime_stm32f7x2.go runtime: remove unused arrtype type aliases 2021-12-23 22:07:49 +01:00
runtime_stm32f103.go runtime: remove unused arrtype type aliases 2021-12-23 22:07:49 +01:00
runtime_stm32f405.go runtime: remove unused arrtype type aliases 2021-12-23 22:07:49 +01:00
runtime_stm32f407.go runtime: separate runtime initialization for STM32F4 boards 2021-12-31 10:30:48 +00:00
runtime_stm32f469.go targets,runtime,machine: add support for the stm32f469-disco board 2021-12-31 10:30:48 +00:00
runtime_stm32l0.go runtime: remove unused arrtype type aliases 2021-12-23 22:07:49 +01:00
runtime_stm32l0x1.go stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +02:00
runtime_stm32l0x2.go stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +02:00
runtime_stm32l4x2.go runtime: remove unused arrtype type aliases 2021-12-23 22:07:49 +01:00
runtime_stm32l5x2.go runtime: remove unused arrtype type aliases 2021-12-23 22:07:49 +01:00
runtime_stm32wlx.go runtime: remove unused arrtype type aliases 2021-12-23 22:07:49 +01: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 avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_tinygowasm.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_unix.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
runtime_wasm_js.go wasm: support -scheduler=none 2021-11-17 19:03:20 +01:00
runtime_wasm_js_scheduler.go wasm: support -scheduler=none 2021-11-17 19:03:20 +01:00
runtime_wasm_wasi.go runtime: only initialize os.runtime_args when needed 2021-11-05 08:50:36 +01:00
runtime_windows.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
scheduler.go internal/task: use asyncify on webassembly 2021-11-14 10:49:28 +01:00
scheduler_any.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
scheduler_coroutines.go refactor coroutine lowering and tasks 2020-03-17 12:16:10 +01:00
scheduler_none.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
scheduler_tasks.go runtime, internal/task: refactor to simplify stack switching 2020-12-05 09:02:11 +01:00
slice.go compiler, runtime: add layout parameter to runtime.alloc 2021-11-02 22:16:15 +01:00
stack.go extend stdlib to allow import of more packages (#1099) 2020-06-23 11:56:28 +02:00
string.go cgo: add support for C.CString and related functions 2021-11-24 21:09:29 +01:00
symtab.go Add runtime stubs required for net/http 2021-06-01 15:15:12 +02:00
sync.go
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