common.S和call.S的部分理解1(6)

#ifndef syscalls_counted
.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
#define syscalls_counted
#endif
.rept syscalls_padding
        CALL(sys_ni_syscall)
.endr


由于是第一次包含,故syscalls_counted没有定义,
.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls

为了保证NR_syscalls是4的整数倍,上面的语句相当于:syscalls_padding = ((NR_syscalls + 3) & ~3) - NR_syscalls;

即:假如NR_syscalls 是1,那么syscalls_padding 就是3
 

.rept syscalls_padding
        CALL(sys_ni_syscall)
      .endr

这里涉及到汇编指令.rept的用法:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/55ed6c6fe9c780ca1b111aa019ccd733.html