Skip to content

Commit e46372e

Browse files
committed
export text region range
1 parent 8b55eeb commit e46372e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/runtime/os_tamago_arm.go

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ func MemRegion() (start uint32, end uint32) {
6262
return ramStart, ramStart + ramSize
6363
}
6464

65+
// TextRegion returns the start and end addresses of the physical RAM
66+
// containing the Go runtime executable instructions.
67+
func TextRegion() (start uint32, end uint32) {
68+
return uint32(firstmoduledata.text), uint32(firstmoduledata.etext)
69+
}
70+
6571
// stubs for unused/unimplemented functionality
6672
type mOS struct{}
6773
type sigset struct{}

src/runtime/os_tamago_riscv64.go

+6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ func MemRegion() (start uint64, end uint64) {
5353
return ramStart, ramStart + ramSize
5454
}
5555

56+
// TextRegion returns the start and end addresses of the physical RAM
57+
// containing the Go runtime executable instructions.
58+
func TextRegion() (start uint64, end uint64) {
59+
return uint64(firstmoduledata.text), uint64(firstmoduledata.etext)
60+
}
61+
5662
// stubs for unused/unimplemented functionality
5763
type mOS struct{}
5864
type sigset struct{}

0 commit comments

Comments
 (0)