tinygo/src/runtime
Ayke van Laethem 03481789b0 runtime: fix time base for time.Now()
This function previously returned the atomic time, that isn't affected
by system time changes but also has a time base at some arbitrary time
in the past. This makes sense for baremetal platforms (which typically
don't know the wall time) but it gives surprising results on Linux and
macOS: time.Now() usually returns a time somewhere near the start of
1970.

This commit fixes this by obtaining both time values: the monotonic time
and the wall clock time. This is also how the Go runtime implements the
time.now function.
2021-07-20 22:19:13 +02:00
..
cgo runtime/cgo: go fmt 2018-09-14 20:58:00 +02:00
debug runtime: add dummy debug package 2021-03-09 16:09:51 +01: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 wasi: remove wasm build tag 2021-06-22 09:03:23 +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_tinygowasm.go wasm: override dlmalloc heap implementation from wasi-libc 2021-07-15 00:13:17 +02:00
arch_xtensa.go esp32: implement task based scheduler 2020-12-05 09:02:11 +01:00
baremetal.go runtime: fix time base for time.Now() 2021-07-20 22:19:13 +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
extern.go Add runtime stubs required for net/http 2021-06-01 15:15:12 +02:00
float.go compiler: implement complex division 2019-05-11 15:33:37 +02:00
func.go compiler: decouple func lowering from interface type codes 2021-04-12 12:07:42 +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: expose memory stats 2021-06-10 22:03:00 +02:00
gc_extalloc.go runtime: make channels work in interrupts 2020-07-04 08:34:39 +02:00
gc_globals_conservative.go wasi: remove wasm build tag 2021-06-22 09:03:23 +02:00
gc_globals_precise.go wasi: remove wasm build tag 2021-06-22 09:03:23 +02:00
gc_leaking.go wasm: implement a growable heap 2021-01-10 21:08:52 +01:00
gc_none.go wasm: implement a growable heap 2021-01-10 21:08:52 +01:00
gc_riscv.S runtime: move/refactor some GC-related code 2020-10-02 08:54:43 +02:00
gc_stack_portable.go wasi: remove wasm build tag 2021-06-22 09:03:23 +02:00
gc_stack_raw.go wasi: remove wasm build tag 2021-06-22 09:03:23 +02:00
hashmap.go reflect: check for access in the Interface method call 2021-03-24 12:19:16 +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 reflect: implement New function 2021-04-12 14:49:26 +02:00
math.go all: change //go:export to //export 2020-04-05 16:16:57 +02:00
mstats.go runtime: expose memory stats 2021-06-10 22:03:00 +02:00
os_darwin.go runtime: fix time base for time.Now() 2021-07-20 22:19:13 +02: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 runtime: fix time base for time.Now() 2021-07-20 22:19:13 +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: fix time base for time.Now() 2021-07-20 22:19:13 +02:00
runtime_arm7tdmi.go runtime: remove the asyncScheduler constant 2021-05-08 23:08:12 +02:00
runtime_atmega.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
runtime_atsamd21.go machine: define Serial as the default output 2021-05-13 16:43:37 +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: define Serial as the default output 2021-05-13 16:43:37 +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_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 runtime: remove the asyncScheduler constant 2021-05-08 23:08:12 +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 Do not disable interrupts on abort 2021-05-27 09:28:08 +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 runtime: remove the asyncScheduler constant 2021-05-08 23:08:12 +02:00
runtime_esp32.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
runtime_esp8266.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
runtime_fe310.go machine: define Serial as the default output 2021-05-13 16:43:37 +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 machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
runtime_k210_baremetal.go maixbit: support both GPIO and GPIOHS controllers 2020-07-08 00:21:59 +02:00
runtime_mimxrt1062.go runtime: remove the asyncScheduler constant 2021-05-08 23:08:12 +02: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 runtime: remove the asyncScheduler constant 2021-05-08 23:08:12 +02:00
runtime_nintendoswitch.s nintendoswitch: Add env parser and removed unused stuff 2020-11-03 23:28:55 +01:00
runtime_nrf.go machine: define Serial as the default output 2021-05-13 16:43:37 +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: avoid heap allocation in waitForEvent 2021-05-30 20:56:01 +02:00
runtime_nxpmk66f18.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
runtime_rp2040.go machine/rp2040: implement UART0/UART1, can be used on all rp2040 boards 2021-06-16 19:13:01 +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_stm32_timers.go stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +02:00
runtime_stm32f7x2.go stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +02:00
runtime_stm32f103.go stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +02:00
runtime_stm32f405.go stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +02:00
runtime_stm32f407.go stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +02:00
runtime_stm32l0.go machine: define Serial as the default output 2021-05-13 16:43:37 +02: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 stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +02:00
runtime_stm32l5x2.go stm32: Use TIM for runtime clock 2021-05-28 00:02:46 +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: remove the asyncScheduler constant 2021-05-08 23:08:12 +02:00
runtime_tinygowasm.go runtime: fix time base for time.Now() 2021-07-20 22:19:13 +02:00
runtime_unix.go runtime: fix time base for time.Now() 2021-07-20 22:19:13 +02:00
runtime_unix_heap.go unix: use conservative GC by default 2021-05-05 17:20:15 +02:00
runtime_unix_noheap.go support WASI target (#1373) 2020-09-29 21:58:03 +02:00
runtime_wasm_js.go runtime: remove the asyncScheduler constant 2021-05-08 23:08:12 +02:00
runtime_wasm_wasi.go wasi: remove wasm build tag 2021-06-22 09:03:23 +02:00
scheduler.go scheduler: task.Data made 64bit to avoid overflow 2021-06-01 15:00:07 +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
symtab.go Add runtime stubs required for net/http 2021-06-01 15:15:12 +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