-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsyscall_arm.s
62 lines (43 loc) · 882 Bytes
/
syscall_arm.s
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
52
53
54
55
56
57
58
59
60
61
62
// 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.
#include "go_asm.h"
// func Supervisor()
TEXT ·Supervisor(SB),$0
SWI $0
RET
// func Exit()
TEXT ·Exit(SB),$0
MOVW $const_SYS_EXIT, R0
SWI $0
RET
// func Print(c byte)
TEXT ·Print(SB),$0-1
MOVW $const_SYS_WRITE, R0
MOVB c+0(FP), R1
SWI $0
RET
// func Nanotime() int64
TEXT ·Nanotime(SB),$0-8
MOVW $const_SYS_NANOTIME, R0
SWI $0
MOVW R0, ret_lo+0(FP)
MOVW R1, ret_hi+4(FP)
RET
// func Write(trap uint, b []byte, n uint)
TEXT ·Write(SB),$0-20
MOVW trap+0(FP), R0
MOVW b+4(FP), R1
MOVW n+16(FP), R2
SWI $0
RET
// func Read(trap uint, b []byte, n uint) int
TEXT ·Read(SB),$0-24
MOVW trap+0(FP), R0
MOVW b+4(FP), R1
MOVW n+16(FP), R2
SWI $0
MOVW R0, ret+20(FP)
RET