struct reg 和 struct user_regs_struc 之间的区别?

发布于 2024-09-08 22:58:45 字数 98 浏览 6 评论 0原文

Linux 64 位机器上的 struct regstruct user_regs_struc 有什么区别?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒路情人 2024-09-15 22:58:45
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;
};

该结构可以在 /usr/include/x86_64-linux-gnu/sys 中找到,

根据 此链接 struct reg 位于

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

freeBsd 文件中:sys/powerpc/include/reg.h

是的,我在我的 debian 64 位系统中没有找到此结构。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文