-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsyscall.go
51 lines (42 loc) · 1.82 KB
/
syscall.go
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) WithSecure Corporation
// https://foundry.withsecure.com
//
// Use of this source code is governed by the license
// that can be found in the LICENSE file.
// Package syscall provides support for system call for TamaGo unikernels
// launched in supervised mode through monitor.Exec (see monitor package).
//
// This package is only meant to be used with `GOOS=tamago` as supported by the
// TamaGo framework for bare metal Go, see https://github.com/usbarmory/tamago.
package syscall
// defined in syscall_*.s
// Supervisors triggers a supervisor call (SWI/SVC).
func Supervisor()
// Exit terminates the execution context scheduling through a system call to
// the supervisor.
func Exit()
// Print prints a single character on standard output through a system call to
// the supervisor.
func Print(c byte)
// Nanotime returns the system time in nanoseconds through a system call to the
// supervisor.
func Nanotime() int64
// GetRandom fills a byte array with random values through a system call to the
// supervisor.
func GetRandom(b []byte, n uint) {
Write(SYS_GETRANDOM, b, n)
}
// Read requests a transfer of n bytes into p from the supervisor through the
// syscall specified as first argument. It can be used to implement syscalls
// that require request/responses data streams, along with Write().
//
// The underlying connection used by the RPC client (see NewClient()) is an
// example of such implementation.
func Read(trap uint, p []byte, n uint) int
// Write requests a transfer of n bytes from p to the supervisor through the
// syscall specified as first argument. It can be used to implement syscalls
// that require request/responses data streams, along with Read().
//
// The underlying connection used by the RPC client (see NewClient()) is an
// example of such implementation.
func Write(trap uint, p []byte, n uint)