Assembly instruction ARM "retne"

Currently, I understand what it takes to boot the Linux kernel. I looked at the source tree of the Linux kernel, in particular for the ARM architecture, until I came across this assembly instruction for retne lr in arch / arm / kernel / hyp-stub.S

It is clear that it is easy to understand that the instruction should return to the address stored in the link register if the Z-flag is 0. I am looking for where this ARM assembly instruction is actually documented.

I searched the ARMv7-A and ARMv7-R edition Reference Manual in the A8.8 section in ARM Architecture and could not find a description of the manual.

Comparing the sources and seeing whether this was an ARM extension, a specific GNU AS extension , did not display anything.

A Google search for โ€œassembly instructions,โ€ โ€œreturn hand commands,โ€ and everything that looked like lines didnโ€™t turn out to be useful either. Of course, I have to look for the wrong place, or I'm missing something.

Any clarifications would be greatly appreciated.

+8
assembly linux arm linux-kernel
source share
1 answer

The language of architectural arrangement is one thing, and the real world is another. Once assembler pseudo-operators and macros come into play, getting to know the toolchain and the code base in question helps a lot. Linux is especially unpleasant because most of the assembly source contains several levels of both assembler macros and CPP macros. If you know what to look for and follow the heading in arch/arm/include/asm/assembler.h , you will eventually find this complex beast:

 .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo .macro ret\c, reg #if __LINUX_ARM_ARCH__ < 6 mov\c pc, \reg #else .ifeqs "\reg", "lr" bx\c \reg .else mov\c pc, \reg .endif #endif .endm .endr 

The goal is to emit a recommended architecture return command in the interest of microarchitecture with a return stack , while allowing the same codes to compile for older architectures.

+11
source share

All Articles