riscv: use 16-byte alignment everywhere
Source: https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf
Этот коммит содержится в:
родитель
35f427c8cc
коммит
187d9c6aca
3 изменённых файлов: 6 добавлений и 10 удалений
|
@ -6,6 +6,12 @@ import "device/riscv"
|
||||||
|
|
||||||
const deferExtraRegs = 0
|
const deferExtraRegs = 0
|
||||||
|
|
||||||
|
// RISC-V has a maximum alignment of 16 bytes (both for RV32 and for RV64).
|
||||||
|
// Source: https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf
|
||||||
|
func align(ptr uintptr) uintptr {
|
||||||
|
return (ptr + 15) &^ 15
|
||||||
|
}
|
||||||
|
|
||||||
func getCurrentStackPointer() uintptr {
|
func getCurrentStackPointer() uintptr {
|
||||||
return uintptr(stacksave())
|
return uintptr(stacksave())
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,3 @@ const GOARCH = "arm" // riscv pretends to be arm
|
||||||
|
|
||||||
// The bitness of the CPU (e.g. 8, 32, 64).
|
// The bitness of the CPU (e.g. 8, 32, 64).
|
||||||
const TargetBits = 32
|
const TargetBits = 32
|
||||||
|
|
||||||
// Align on word boundary.
|
|
||||||
func align(ptr uintptr) uintptr {
|
|
||||||
return (ptr + 3) &^ 3
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,8 +6,3 @@ const GOARCH = "arm64" // riscv pretends to be arm
|
||||||
|
|
||||||
// The bitness of the CPU (e.g. 8, 32, 64).
|
// The bitness of the CPU (e.g. 8, 32, 64).
|
||||||
const TargetBits = 64
|
const TargetBits = 64
|
||||||
|
|
||||||
// Align on word boundary.
|
|
||||||
func align(ptr uintptr) uintptr {
|
|
||||||
return (ptr + 7) &^ 7
|
|
||||||
}
|
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче