This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

svc_handler

what does this piece of code means in SVC handler and how are the svc number is passed from application to handler ?

SVC_Handler PROC
                       EXPORT SVC_Handler [WEAK]
                       IMPORT SVC_Handler_Main
                       TST lr, #4
                       ITE EQ
                       MRSEQ r0, MSP
                       MRSNE r0, PSP
                       B SVC_Handler_Main
                       ENDP

/*below code is placed in main*/

void SVC_Handler_Main( unsigned int *svc_args )
{
unsigned int svc_number;

svc_number = ( ( char * )svc_args[ 6 ] )[ -2 ] ;
switch( svc_number )
{
case 0: 
break;
case 1:
break;
default: /* unknown SVC */
break;