runtime, targets: some WIP on wasm unknown in part from PR #3072

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2024-02-12 13:43:54 +01:00
committed by Ron Evans
parent 828b9614c2
commit 186018abeb
8 changed files with 129 additions and 5 deletions
+50
View File
@@ -0,0 +1,50 @@
//go:build wasm_unknown
package runtime
const (
stdout = 1
)
func putchar(c byte) {
}
func getchar() byte {
// dummy, TODO
return 0
}
func buffered() int {
// dummy, TODO
return 0
}
//go:linkname now time.now
func now() (sec int64, nsec int32, mono int64) {
return 0, 0, 0
}
// Abort executes the wasm 'unreachable' instruction.
func abort() {
trap()
}
//go:linkname syscall_Exit syscall.Exit
func syscall_Exit(code int) {
//proc_exit(uint32(code))
}
// TinyGo does not yet support any form of parallelism on WebAssembly, so these
// can be left empty.
//go:linkname procPin sync/atomic.runtime_procPin
func procPin() {
}
//go:linkname procUnpin sync/atomic.runtime_procUnpin
func procUnpin() {
}
func hardwareRand() (n uint64, ok bool) {
return 0, false
}