arm: sevl_wfe.S example

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-01-14 00:00:00 +00:00
parent cc1d34f862
commit 270421ccc3
2 changed files with 15 additions and 0 deletions

View File

@@ -18645,6 +18645,7 @@ Concrete examples of the instruction can be seen at:
* link:userland/arch/aarch64/nostartfiles/wfe.S[]
* link:userland/arch/aarch64/freestanding/linux/wfe.S[]
* link:userland/arch/aarch64/freestanding/linux/sevl_wfe.S[]
* link:userland/arch/aarch64/freestanding/linux/wfe_wfe.S[]: run WFE twice, because gem5 390a74f59934b85d91489f8a563450d8321b602d does not sleep on the first, see also: <<gem5-arm-wfe>>
* link:baremetal/arch/aarch64/no_bootloader/wfe_loop.S[], see: <<gem5-simulate-limit-reached>>
* link:userland/arch/aarch64/inline_asm/wfe_sev.cpp[]: one Linux thread runs WFE and the other runs SEV to wake it up

View File

@@ -0,0 +1,14 @@
/* https://cirosantilli.com/linux-kernel-module-cheat#arm-wfe-and-sev-instructions */
.text
.global _start
_start:
asm_main_after_prologue:
sevl
/* Shoul not sleep due to above sevl. */
wfe
/* exit */
mov x0, 0 /* exit status */
mov x8, 93 /* syscall number */
svc 0