mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 20:43:40 +00:00
UEFI: Add support for UEFI time and UEFI events; fix STOP \n -> \r\n conversion (#5549)
* add support for UEFI time and UEFI events; fix STOP \n -> \r\n conversion * apply EFI timezone offset
This commit is contained in:
@@ -56,9 +56,8 @@ func sleepTicks(d timeUnit) {
|
||||
|
||||
func putchar(c byte) {
|
||||
if c == '\n' {
|
||||
buf := [4]uefi.CHAR16{'\r', 0, '\n', 0}
|
||||
buf := [2]uefi.CHAR16{uefi.CHAR16('\r'), 0}
|
||||
uefi.ST().ConOut.OutputString(&buf[0])
|
||||
return
|
||||
}
|
||||
buf := [2]uefi.CHAR16{uefi.CHAR16(c), 0}
|
||||
uefi.ST().ConOut.OutputString(&buf[0])
|
||||
@@ -103,6 +102,15 @@ func growHeap() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func init() {
|
||||
mono := nanotime()
|
||||
efiTime, status := uefi.GetTime()
|
||||
if status == uefi.EFI_SUCCESS {
|
||||
sec, nsec := efiTime.GetEpoch()
|
||||
timeOffset.Store(sec*1000000000 + int64(nsec) - mono)
|
||||
}
|
||||
}
|
||||
|
||||
func SetWaitForEvents(f func()) {
|
||||
waitForEventsFunction = f
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user