From 4bf7308d26da9fef275d3950f3f5717e0f06704f Mon Sep 17 00:00:00 2001 From: Kenneth Bell Date: Sat, 25 Mar 2023 10:36:44 +0000 Subject: [PATCH] machine: make gosched available to machine package --- src/machine/machine_nxpmk66f18_uart.go | 3 --- src/machine/runtime.go | 13 +++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/machine/runtime.go diff --git a/src/machine/machine_nxpmk66f18_uart.go b/src/machine/machine_nxpmk66f18_uart.go index 01faa658..d62fc64e 100644 --- a/src/machine/machine_nxpmk66f18_uart.go +++ b/src/machine/machine_nxpmk66f18_uart.go @@ -59,9 +59,6 @@ var ( ErrNotConfigured = errors.New("device has not been configured") ) -//go:linkname gosched runtime.Gosched -func gosched() - // PutcharUART writes a byte to the UART synchronously, without using interrupts // or calling the scheduler func PutcharUART(u *UART, c byte) { diff --git a/src/machine/runtime.go b/src/machine/runtime.go new file mode 100644 index 00000000..928a39cf --- /dev/null +++ b/src/machine/runtime.go @@ -0,0 +1,13 @@ +package machine + +import ( + _ "unsafe" +) + +// +// This file provides access to runtime package that would not otherwise +// be permitted due to linker dependencies. +// + +//go:linkname gosched runtime.Gosched +func gosched()