summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-12-03 11:37:17 -0800
committerAndy Lutomirski <luto@amacapital.net>2014-12-03 11:37:17 -0800
commit8bf0f3233d8433a1b376175dc7753e7e146abda1 (patch)
tree435218668ef763b7fcc9aa8ab742861d9320fbf1
parenta70d4efc6b05b3db7180150e9616f1d002738b7c (diff)
downloadmisc-tests-8bf0f3233d8433a1b376175dc7753e7e146abda1.tar.gz
syscall_exit_regs: Log flags
-rw-r--r--syscall_exit_regs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/syscall_exit_regs.c b/syscall_exit_regs.c
index a794981..f0fb557 100644
--- a/syscall_exit_regs.c
+++ b/syscall_exit_regs.c
@@ -48,6 +48,7 @@ static void test_syscall(long nr)
unsigned long rcx = 1;
unsigned long orig_rcx = rcx;
unsigned short orig_ss, ss;
+ unsigned long orig_flags, flags;
long ret;
int local_nerrs = 0;
@@ -59,11 +60,16 @@ static void test_syscall(long nr)
got_sigill = 0;
asm volatile ("mov %%ss,%[orig_ss]\n\t"
+ "pushf\n\t"
+ "pop %[orig_flags]\n\t"
"syscall\n\t"
"syscall_rip:"
"mov %%ss,%[ss]\n\t"
+ "pushf\n\t"
+ "pop %[flags]"
: "+c" (rcx), [orig_ss] "=rm" (orig_ss), [ss] "=rm" (ss),
- "=a" (ret)
+ "=a" (ret), [flags] "=rm" (flags),
+ [orig_flags] "=rm" (orig_flags)
: "a" (nr) :
#ifdef __x86_64__
"r11"
@@ -92,8 +98,8 @@ static void test_syscall(long nr)
printf("%s\tsyscall %lx: AX = %lx\n",
outcome, nr, ret);
- printf("[NOTE]\tsyscall %lx: orig RCX = %lx ss = %hx orig_ss = %hx\n",
- nr, orig_rcx, ss, orig_ss);
+ printf("[NOTE]\tsyscall %lx: orig RCX = %lx ss = %hx orig_ss = %hx flags = %lx orig_flags = %lx\n",
+ nr, orig_rcx, ss, orig_ss, flags, orig_flags);
}
nerrs += local_nerrs;