]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/kvm/x86: Fix register names for clang
authorStefan Jumarea <stefanjumarea02@gmail.com>
Sun, 7 May 2023 10:53:19 +0000 (13:53 +0300)
committerUnikraft <monkey@unikraft.io>
Wed, 10 May 2023 13:43:48 +0000 (13:43 +0000)
`clang` does not understand the `rflags` register name, so the build
will fail. On the other hand, `gcc` does not understand `flags`, so the
register naming needs to be placed inside `#ifdef` guards.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #877

plat/kvm/x86/cpu_vectors_x86_64.S

index a78db9a4f3bc53c572a0177b79d23d260cb3187c..de7887c7bf07e9f1e202c0d2fafdc2bef95a9a22 100644 (file)
@@ -80,7 +80,15 @@ ENTRY(ASM_TRAP_SYM(\trapname))
        .cfi_offset rip, -8
        /* Description of the stack with active IST */
        .cfi_offset cs, 0
+
+#ifdef __clang__
+       .cfi_offset flags, 8
+#elif __GNUC__
        .cfi_offset rflags, 8
+#else
+#error "Unsupported Compiler"
+#endif
+
        .cfi_offset rsp, 16
        .cfi_offset ss, 24
        cld
@@ -115,7 +123,15 @@ ENTRY(cpu_irq_\irqno)
 
        /* Description of the stack with active IST */
        .cfi_offset cs, 0
+
+#ifdef __clang__
+       .cfi_offset flags, 8
+#elif __GNUC__
        .cfi_offset rflags, 8
+#else
+#error "Unsupported Compiler"
+#endif
+
        .cfi_offset rsp, 16
        .cfi_offset ss, 24
        cld