use virt instructions with clang instead of equivalent raw bytes
authorjsg <jsg@openbsd.org>
Sat, 20 Jan 2018 23:57:44 +0000 (23:57 +0000)
committerjsg <jsg@openbsd.org>
Sat, 20 Jan 2018 23:57:44 +0000 (23:57 +0000)
sys/arch/armv7/armv7/locore0.S

index b683e00..62bbcb1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: locore0.S,v 1.3 2017/07/25 19:37:27 kettenis Exp $    */
+/*     $OpenBSD: locore0.S,v 1.4 2018/01/20 23:57:44 jsg Exp $ */
 /*     $NetBSD: lubbock_start.S,v 1.1 2003/06/18 10:51:15 bsh Exp $ */
 
 /*
 #undef DOMAIN_CLIENT   /* XXX */
 #include "assym.h"
 
+#ifdef __clang__
+.arch_extension virt
+#define ELR    msr     ELR_hyp, lr
+#define ERET   eret
+#else
 #define ELR    .long   0xe12ef30e              @ msr   ELR_hyp, lr
 #define ERET   .long   0xe160006e              @ eret
+#endif
 
 /*
  * Kernel start routine for OMAP