카테고리 없음

struct pt_regs

НooпeУ 2012. 11. 6. 00:31

Take a look at the definition of struct pt_regs in arch/x86/include/asm/ptrace.h.

Notice #ifndef __KERNEL__ stuff there, it means that the definition of that structure is different for kernel-mode and user-mode code.

For the kernel code, pt_regs::ax is probably the value you need. It should contain the value of%eax on a 32-bit system and %rax on a 64-bit one.


이글을 보면

kernel 모드와 user모드에서 사용하는 레지스터가 다르네