]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
fix amd64 fattrap to correctly account for error codes
authorAntti Kantee <pooka@iki.fi>
Thu, 3 Dec 2015 20:10:44 +0000 (20:10 +0000)
committerAntti Kantee <pooka@iki.fi>
Thu, 3 Dec 2015 20:11:19 +0000 (20:11 +0000)
platform/hw/arch/amd64/intr.S

index 0e38ec074972e1374a2bf7e7cc693f8a5ef0e134..0a9d7966330d8c1f8f3d1ab1ab0f49b0f013e85f 100644 (file)
@@ -66,11 +66,14 @@ fattrapstr##num:                                                    ;\
 ENTRY(x86_trap_##num)                                                   \
        movq $fattrapstr##num, %rdi                                     ;\
        movq %cr2, %rdx                                                 ;\
-       mov $##num, %rcx                                                ;\
-       test $14, %rcx                                                  ;\
+       movq $##num, %rcx                                               ;\
+       cmpq $13, %rcx                                                  ;\
        je 1f                                                           ;\
-       addq $8, %rsp                                                   ;\
+       cmpq $14, %rcx                                                  ;\
+       jne 2f                                                          ;\
 1:                                                                     ;\
+       addq $8, %rsp                                                   ;\
+2:                                                                     ;\
        movq 0(%rsp), %rsi                                              ;\
        call cpu_fattrap                                                ;\
        hlt                                                             ;\