-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathconsole.go
More file actions
32 lines (28 loc) · 717 Bytes
/
console.go
File metadata and controls
32 lines (28 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//go:build uefi
package uefi
import "unsafe"
// SimpleTextOutputProtocol provides text output services.
type SimpleTextOutputProtocol struct {
Reset uintptr
OutputString uintptr
TestString uintptr
QueryMode uintptr
SetMode uintptr
SetAttribute uintptr
ClearScreen uintptr
SetCursorPosition uintptr
EnableCursor uintptr
Mode uintptr
}
// OutputString prints a UCS-2 string to the console.
func OutputString(str *uint16) {
st := GetSystemTable()
if st == nil || st.ConOut == nil || st.ConOut.OutputString == 0 {
return
}
Call(
st.ConOut.OutputString,
uintptr(unsafe.Pointer(st.ConOut)),
uintptr(unsafe.Pointer(str)),
)
}