From b10c692b2ad4fccc4763f965ca48e41f702dd718 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Mon, 2 Nov 2009 16:16:53 -0500 Subject: [PATCH] processor.h: save rflags --- include/ust/processor.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/ust/processor.h b/include/ust/processor.h index 1eb58436..b9a2f64e 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, -- 2.34.1