当前位置: 技术问答>linux和unix
宏操作_ _copy_user_zeroing()的代码怎么理解?
来源: 互联网 发布时间:2016-04-17
本文导语: 宏操作_ _copy_user_zeroing()的定义在include/asm-i386/uacces.h中: #define _ _copy_user_zeroing(to,from,size) do{ int _ _d0, _ _...
宏操作_ _copy_user_zeroing()的定义在include/asm-i386/uacces.h中:
#define _ _copy_user_zeroing(to,from,size)
do{
int _ _d0, _ _d1;
_ _asm_ _ _ _volatile_ _(
"0:rep:movln"
" movl %3, %0n"
"1: rep:movsbn"
"2:n"
".section .fixup,"ax"n"
"3: lea 0(%3,%0,4),%0n"
"4: pushl %0n"
" pushl %%eaxn"
" xorl %%eax,%%eaxn"
" rep; stosbn"
" popl %%eax n"
" popl %0n"
" jmp 2bn"
".previousn"
".section _ _ex_table, "a"n"
" .align 4n"
" .long 0b,3bn"
" .long 1b,4bn"
".previous"
: "=&c"(size), "=&D" (_ _d0), "=&S" (_ _d1 )
: "r"(size&3), "0"(size/4), "1"(to), "2"(from)
: "memory");
}while(0)
这段代码如何理解呢?同时高手给我提供一份GCC的手册,谢谢!
#define _ _copy_user_zeroing(to,from,size)
do{
int _ _d0, _ _d1;
_ _asm_ _ _ _volatile_ _(
"0:rep:movln"
" movl %3, %0n"
"1: rep:movsbn"
"2:n"
".section .fixup,"ax"n"
"3: lea 0(%3,%0,4),%0n"
"4: pushl %0n"
" pushl %%eaxn"
" xorl %%eax,%%eaxn"
" rep; stosbn"
" popl %%eax n"
" popl %0n"
" jmp 2bn"
".previousn"
".section _ _ex_table, "a"n"
" .align 4n"
" .long 0b,3bn"
" .long 1b,4bn"
".previous"
: "=&c"(size), "=&D" (_ _d0), "=&S" (_ _d1 )
: "r"(size&3), "0"(size/4), "1"(to), "2"(from)
: "memory");
}while(0)
这段代码如何理解呢?同时高手给我提供一份GCC的手册,谢谢!
|
可以GOOGLE。
情景分析第三章系统调用一节做了非常详细的分析。
情景分析第三章系统调用一节做了非常详细的分析。