-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathguest_mmio.S
More file actions
36 lines (28 loc) · 749 Bytes
/
guest_mmio.S
File metadata and controls
36 lines (28 loc) · 749 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
33
34
35
36
// Guest code for MMIO test
// This will be assembled to generate correct ARM64 instructions
.section .text
.global guest_mmio_start
.global guest_mmio_end
guest_mmio_start:
// UART base address: 0x09000000
mov x19, #0x9000000
// Write 'M' (0x4D) to UART
mov w1, #0x4D
str w1, [x19]
// Write 'M' (0x4D) again
mov w1, #0x4D
str w1, [x19]
// Write 'I' (0x49)
mov w1, #0x49
str w1, [x19]
// Write 'O' (0x4F)
mov w1, #0x4F
str w1, [x19]
// Write newline (0x0A)
mov w1, #0x0A
str w1, [x19]
// Exit via hypercall
mov x0, #1 // exit reason
hvc #0
guest_mmio_end:
nop