Skip to content

Commit 4c30482

Browse files
committed
add runtime.DataRegion for GOOS=tamago
1 parent 4c873bc commit 4c30482

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/runtime/os_tamago_amd64.go

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ func TextRegion() (start uint64, end uint64) {
3131
return uint64(firstmoduledata.text), uint64(firstmoduledata.etext)
3232
}
3333

34+
// DataRegion returns the start and end addresses of the physical RAM
35+
// containing the Go runtime global symbols.
36+
func DataRegion() (start uint64, end uint64) {
37+
return uint64(firstmoduledata.data), uint64(firstmoduledata.enoptrbss)
38+
}
39+
3440
// CPU returns the CPU name given by the vendor.
3541
// If the CPU name can not be determined an
3642
// empty string is returned.

src/runtime/os_tamago_arm.go

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ func TextRegion() (start uint32, end uint32) {
3333
return uint32(firstmoduledata.text), uint32(firstmoduledata.etext)
3434
}
3535

36+
// DataRegion returns the start and end addresses of the physical RAM
37+
// containing the Go runtime global symbols.
38+
func DataRegion() (start uint32, end uint32) {
39+
return uint32(firstmoduledata.data), uint32(firstmoduledata.enoptrbss)
40+
}
41+
3642
func checkgoarm() {
3743
if goarm < 5 || goarm > 7 {
3844
print("runtime: tamago requires ARMv5 through ARMv7. Recompile using GOARM=5, GOARM=6 or GOARM=7.\n")

src/runtime/os_tamago_riscv64.go

+6
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@ func MemRegion() (start uint64, end uint64) {
2828
func TextRegion() (start uint64, end uint64) {
2929
return uint64(firstmoduledata.text), uint64(firstmoduledata.etext)
3030
}
31+
32+
// DataRegion returns the start and end addresses of the physical RAM
33+
// containing the Go runtime global symbols.
34+
func DataRegion() (start uint64, end uint64) {
35+
return uint64(firstmoduledata.data), uint64(firstmoduledata.enoptrbss)
36+
}

0 commit comments

Comments
 (0)