Write registers SVC ARMv8 AArch64 SVC

Let's say I have a simple aarch64 function that makes a system call via SVC looks something like this (iOS target):

make_syscall:
    stp fp, lr, [sp, #-16]!
    add fp, sp, #0             
    mov x16, SYSCALL_NUM       
    svc #128                   
    ldp fp, lr, [sp], #16      
    ret                        

      

The question is: since the function only modifies x16, which is retained, is it still necessary to save / restore any other registers besides the frame pointer and reference register? In other words, is it safe to assume that SVC handlers respect the ABI procedure calling conventions?

thank

+3


source to share


1 answer


I think I will find an answer to the question: https://events.linuxfoundation.org/images/stories/pdf/lcna_co2012_marinas.pdf On pages 14-15 it is about what kind of leverage 64 bit does when user mode is passed to more high mode. It's easy to say that the kernel automatically pushes the GPR onto the kernel stack, but not explicitly, as user codes do.



0


source







All Articles