blob: 9bf710ba0e799d3213eb865e1a0f0106e59ceb12 [file] [log] [blame]
Richard Musiol35ea6242018-03-31 23:14:17 +02001// Copyright 2018 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package runtime
6
7import (
8 "runtime/internal/sys"
9 "unsafe"
10)
11
12type m0Stack struct {
13 _ [8192 * sys.StackGuardMultiplier]byte
14}
15
16var wasmStack m0Stack
17
18func wasmMove()
19
20func wasmZero()
21
22func wasmDiv()
23
24func wasmTruncS()
25func wasmTruncU()
26
27func wasmExit(code int32)
28
29// adjust Gobuf as it if executed a call to fn with context ctxt
30// and then did an immediate gosave.
31func gostartcall(buf *gobuf, fn, ctxt unsafe.Pointer) {
32 sp := buf.sp
33 if sys.RegSize > sys.PtrSize {
34 sp -= sys.PtrSize
35 *(*uintptr)(unsafe.Pointer(sp)) = 0
36 }
37 sp -= sys.PtrSize
38 *(*uintptr)(unsafe.Pointer(sp)) = buf.pc
39 buf.sp = sp
40 buf.pc = uintptr(fn)
41 buf.ctxt = ctxt
42}