We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
ePendSV_handler: mrs r0,PSP stmdb r0!,{r4-r11,lr}; ... load ... load new PSP valu here to R0 ldmia r0!,{r4-r11,lr} msr PSP,r0 bx lr void eSVCall(void){ unsigned int a0,a1,a2,a3,svc,*psp; psp=(U32*)__get_PSP(); a0=psp[0];a1=psp[1];a2=psp[2];a3=psp[3]; //get registers from user stack svc=psp[4]; // service call ID a0=service(svc,a0,a1,a2,a3); psp[0]=a0; //overwrite R0(return value) in user stack} SVC usage in thread level code: mov R12, #1 ; service call ID mov R0, #123 ; arg svc #0 ; now R0 holds return value