Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Svc handler to SMC call

how to write an svc handler in C to call SMC(monitor mode) instruction to switch to monitor mode for arm cortex a9? i.e from supervisor mode to monitor mode what all needs to be done in svc handler,how to write the same in C. Detailed answers appreciated...

like image 524
Mohit Narain Chaudhary Avatar asked Oct 21 '22 16:10

Mohit Narain Chaudhary


1 Answers

Examples can be found in the Linux source tree for the OMAP2 platform.

  • omap-smc.S
  • omap-secure.h
  • omap-secure.c

See also: LWN's KS2012: ARM: Secure monitor API Kernel summit 2012 notes on ARM SMC modes.

Basically, what ever interface people dream up for an SWI or SVC interface can be used by the SMC interface. Otherwise, this question is impossible to answer specifically.


SMC calling conventions is an advisory from ARM to allow secure world software vendors to make something that is compatible/inter-operable. NOTE: No one has to follow this advice.

This was published after the original question was asked. Some software does follow this advice such as ARM Trusted Firmware.

like image 78
artless noise Avatar answered Nov 04 '22 00:11

artless noise