99ca3f7c8b317dcff508fca9aada4d91c5f8a543
1 #ifndef UST_REGISTERS_H
2 #define UST_REGISTERS_H
27 static inline save_registers(struct registers
*regs
)
55 #define save_registers(regsptr) \
56 asm ("movq %%rax,%c[rax_off](%[regs])\n\t" \
57 "movq %%rbx,%c[rbx_off](%[regs])\n\t" \
58 "movq %%rcx,%c[rcx_off](%[regs])\n\t" \
59 "movq %%rdx,%c[rdx_off](%[regs])\n\t" \
60 "movq %%rbp,%c[rbp_off](%[regs])\n\t" \
61 "movq %%rsp,%c[rsp_off](%[regs])\n\t" \
62 "movq %%rsi,%c[rsi_off](%[regs])\n\t" \
63 "movq %%rdi,%c[rdi_off](%[regs])\n\t" \
64 "movq %%r8,%c[r8_off](%[regs])\n\t" \
65 "movq %%r9,%c[r9_off](%[regs])\n\t" \
66 "movq %%r10,%c[r10_off](%[regs])\n\t" \
67 "movq %%r11,%c[r11_off](%[regs])\n\t" \
68 "movq %%r12,%c[r12_off](%[regs])\n\t" \
69 "movq %%r13,%c[r13_off](%[regs])\n\t" \
70 "movq %%r14,%c[r14_off](%[regs])\n\t" \
71 "movq %%r15,%c[r15_off](%[regs])\n\t" \
72 "movw %%cs,%c[cs_off](%[regs])\n\t" \
73 "movw %%ss,%c[ss_off](%[regs])\n\t" \
76 "popq %c[rip_off](%[regs])\n\t" \
77 : /* do output regs */ \
78 : [regs] "r" (regsptr), \
79 [rax_off] "i" (offsetof(struct registers, rax)), \
80 [rbx_off] "i" (offsetof(struct registers, rbx)), \
81 [rcx_off] "i" (offsetof(struct registers, rcx)), \
82 [rdx_off] "i" (offsetof(struct registers, rdx)), \
83 [rbp_off] "i" (offsetof(struct registers, rbp)), \
84 [rsp_off] "i" (offsetof(struct registers, rsp)), \
85 [rsi_off] "i" (offsetof(struct registers, rsi)), \
86 [rdi_off] "i" (offsetof(struct registers, rdi)), \
87 [r8_off] "i" (offsetof(struct registers, r8)), \
88 [r9_off] "i" (offsetof(struct registers, r9)), \
89 [r10_off] "i" (offsetof(struct registers, r10)), \
90 [r11_off] "i" (offsetof(struct registers, r11)), \
91 [r12_off] "i" (offsetof(struct registers, r12)), \
92 [r13_off] "i" (offsetof(struct registers, r13)), \
93 [r14_off] "i" (offsetof(struct registers, r14)), \
94 [r15_off] "i" (offsetof(struct registers, r15)), \
95 [cs_off] "i" (offsetof(struct registers, cs)), \
96 [ss_off] "i" (offsetof(struct registers, ss)), \
97 [rip_off] "i" (offsetof(struct registers, rip)) \
102 #endif /* UST_REGISTERS_H */
This page took 0.030799 seconds and 3 git commands to generate.