mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
arm: sevl_wfe.S example
This commit is contained in:
@@ -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
|
||||
|
||||
14
userland/arch/aarch64/freestanding/linux/sevl_wfe.S
Normal file
14
userland/arch/aarch64/freestanding/linux/sevl_wfe.S
Normal 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
|
||||
Reference in New Issue
Block a user