
This page has been a big help in adding support for this new chip: https://wiki.osdev.org/HiFive-1_Bare_Bones
21 строка
311 Б
Go
21 строка
311 Б
Go
// +build cortexm
|
|
|
|
package runtime
|
|
|
|
import (
|
|
"device/arm"
|
|
)
|
|
|
|
const GOARCH = "arm"
|
|
|
|
// The bitness of the CPU (e.g. 8, 32, 64).
|
|
const TargetBits = 32
|
|
|
|
// Align on word boundary.
|
|
func align(ptr uintptr) uintptr {
|
|
return (ptr + 3) &^ 3
|
|
}
|
|
|
|
func getCurrentStackPointer() uintptr {
|
|
return arm.ReadRegister("sp")
|
|
}
|