differnce between struct reg and struct user_regs_struc?

元气小坏坏 提交于 2019-12-13 00:07:56

问题


What is the difference between struct reg and struct user_regs_struc on Linux 64 bit machine?


回答1:


struct user_regs_struct
{
  unsigned long r15;
  unsigned long r14;
  unsigned long r13;
  unsigned long r12;
  unsigned long rbp;
  unsigned long rbx;
  unsigned long r11;
  unsigned long r10;
  unsigned long r9;
  unsigned long r8;
  unsigned long rax;
  unsigned long rcx;
  unsigned long rdx;
  unsigned long rsi;
  unsigned long rdi;
  unsigned long orig_rax;
  unsigned long rip;
  unsigned long cs;
  unsigned long eflags;
  unsigned long rsp;
  unsigned long ss;
  unsigned long fs_base;
  unsigned long gs_base;
  unsigned long ds;
  unsigned long es;
  unsigned long fs;
  unsigned long gs;
};

This struct can be found in /usr/include/x86_64-linux-gnu/sys

According to this link struct reg is

 struct reg {
            register_t fixreg[32];
            register_t lr;
            register_t cr;
            register_t xer;
            register_t ctr;
            register_t pc;
    };

in freeBsd file: sys/powerpc/include/reg.h

And yes I did not found this struct in my debian 64bit system.



来源:https://stackoverflow.com/questions/3201194/differnce-between-struct-reg-and-struct-user-regs-struc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!