Module Name:    src
Committed By:   rin
Date:           Tue Nov  7 13:31:26 UTC 2023

Modified Files:
        src/sys/arch/arm/arm: smccc.c

Log Message:
smccc: Adjust SMCCC_ARCH_ATTRIBUTE for clang/arm

Conditionally use

(1) __attribute__ ((target("arch=armv7ve")))
(2) __attribute__ ((target("armv7ve")))

for gcc and clang, respectively.

While gcc does not accept (2), clang accepts (1) but silently ignores it :(


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/smccc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm/smccc.c
diff -u src/sys/arch/arm/arm/smccc.c:1.3 src/sys/arch/arm/arm/smccc.c:1.4
--- src/sys/arch/arm/arm/smccc.c:1.3	Sun Aug  8 13:43:09 2021
+++ src/sys/arch/arm/arm/smccc.c	Tue Nov  7 13:31:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: smccc.c,v 1.3 2021/08/08 13:43:09 jmcneill Exp $ */
+/* $NetBSD: smccc.c,v 1.4 2023/11/07 13:31:26 rin Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1.3 2021/08/08 13:43:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1.4 2023/11/07 13:31:26 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -36,7 +36,11 @@ __KERNEL_RCSID(0, "$NetBSD: smccc.c,v 1.
 #include <arm/arm/smccc.h>
 
 #if defined(__arm__)
+#  if defined(__clang__)
+#define	SMCCC_ARCH_ATTRIBUTE  __attribute__ ((target("armv7ve")))
+#  else /* gcc */
 #define	SMCCC_ARCH_ATTRIBUTE  __attribute__ ((target("arch=armv7ve")))
+#  endif
 #else
 #define	SMCCC_ARCH_ATTRIBUTE
 #endif

Reply via email to