Or more generally, what happens if an swi instruction with an opcode !=0 is executed on such a kernel? Does it produce a signal? I ask because I’d like to trap it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The code that fields
swiinstructions is here: http://lxr.linux.no/linux+*/arch/arm/kernel/entry-common.S#L335. I am not an ARM expert, but it appears that the CPU does not stash theswiargument anywhere the kernel can get at it; if the kernel wants to know, it has to fetch the instruction from the calling program’s runtime image. This makes every system call more expensive, so (if I’m reading things correctly) the kernel only bothers to find out what theswiargument is if it’s compiled withCONFIG_OABI_COMPAT.EDIT: The ARM ARM confirms that SWI does not do anything useful with its argument. (Physical page 634 / logical page A7-118.)