nintendoswitch: Add dynamic loader for runtime loading PIE sections

This commit is contained in:
Lucas Teske
2020-09-13 21:10:27 -03:00
committed by Ron Evans
parent 490e377bba
commit fb1fc267ab
6 changed files with 148 additions and 35 deletions
+12
View File
@@ -2,6 +2,8 @@
package runtime
import "unsafe"
type timeUnit int64
const asyncScheduler = false
@@ -60,6 +62,16 @@ func abort() {
}
}
//export write
func write(fd int32, buf *byte, count int) int {
// TODO: Proper handling write
for i := 0; i < count; i++ {
putchar(*buf)
buf = (*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(buf)) + 1))
}
return count
}
//export sleepThread
func sleepThread(nanos uint64)