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


  1: CALL(sys_preadv)
    2: CALL(sys_pwritev)
    3: #ifndef syscalls_counted
    4: .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
    5: #define syscalls_counted
    6: #endif
    7: .rept syscalls_padding
    8: CALL(sys_ni_syscall)
    9: .endr

分析:

.equ NR_syscalls,0    中涉及到汇编指令.equ:


.equ/.set: 赋值语句, 格式如下:

.equ(.set) 变量名,表达式
  例如:
  .equ abc 3 @让abc=3


这里只是定义了一个变量NR_syscalls,并将其初始化为0。可以理解为: NR_syscalls = 0

#define CALL(x) .equ NR_syscalls,NR_syscalls+1 

即 将CALL(x) 定义为: NR_syscalls = NR_syscalls  + 1

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

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