From: Pierre-Marc Fournier Date: Mon, 2 Nov 2009 21:16:53 +0000 (-0500) Subject: processor.h: save rflags X-Git-Tag: v0.1~61 X-Git-Url: http://git.liburcu.org/?p=ust.git;a=commitdiff_plain;h=b10c692b2ad4fccc4763f965ca48e41f702dd718 processor.h: save rflags --- diff --git a/include/ust/processor.h b/include/ust/processor.h index 1eb5843..b9a2f64 100644 --- a/include/ust/processor.h +++ b/include/ust/processor.h @@ -53,6 +53,7 @@ struct registers { unsigned long r15; int cs; int ss; + unsigned long rflags; }; #define save_registers(regsptr) \ @@ -74,6 +75,9 @@ struct registers { "movq %%r15,%c[r15_off](%[regs])\n\t" \ "movw %%cs,%c[cs_off](%[regs])\n\t" \ "movw %%ss,%c[ss_off](%[regs])\n\t" \ + /* deal with rflags */ \ + "pushfq\n\t" /* push rflags on stack */ \ + "popq %c[rflags_off](%[regs])\n\t" \ : \ : [regs] "r" (regsptr), \ [rax_off] "i" (offsetof(struct registers, rax)), \ @@ -93,7 +97,8 @@ struct registers { [r14_off] "i" (offsetof(struct registers, r14)), \ [r15_off] "i" (offsetof(struct registers, r15)), \ [cs_off] "i" (offsetof(struct registers, cs)), \ - [ss_off] "i" (offsetof(struct registers, ss)) \ + [ss_off] "i" (offsetof(struct registers, ss)), \ + [rflags_off] "i" (offsetof(struct registers, rflags)) \ ); /* Macro to insert the address of a relative jump in an assembly stub,