tinygo/src/runtime/arch_amd64.go
Ayke van Laethem 9af535bf98 avr: add support for recover()
You can see that it works with the following command:

    tinygo run -target=simavr ./testdata/recover.go

This also gets the following tests to pass again:

    go test -run=Build -target=simavr -v

Adding support for AVR was a bit more compliated because it's also
necessary to save and restore the Y register.
2022-06-19 11:51:12 +02:00

19 строки
413 Б
Go

package runtime
const GOARCH = "amd64"
// The bitness of the CPU (e.g. 8, 32, 64).
const TargetBits = 64
const deferExtraRegs = 0
// Align a pointer.
// Note that some amd64 instructions (like movaps) expect 16-byte aligned
// memory, thus the result must be 16-byte aligned.
func align(ptr uintptr) uintptr {
return (ptr + 15) &^ 15
}
func getCurrentStackPointer() uintptr {
return uintptr(stacksave())
}