Skip to contentSkip to conversation

hexagon: add hwcap

PATCH Superseded Brian Cain 1 participant 1 message Sep 7

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Brian Cain

author maintainer
#0 lore raw

PATCH 1/1 hexagon: add hwcap

Provide hwcap interface for userspace programs to discover the Hexagon CPU capabilities.

---
 arch/hexagon/include/asm/elf.h        |   3 +-
 arch/hexagon/include/asm/hexagon_vm.h |  58 +++++++++++++++
 arch/hexagon/include/asm/hwcap.h      |  25 +++++++
 arch/hexagon/include/uapi/asm/hwcap.h |  58 +++++++++++++++
 arch/hexagon/kernel/setup.c           | 100 ++++++++++++++++++++++++++
 arch/hexagon/kernel/vm_ops.S          |   4 ++
 6 files changed, 247 insertions(+), 1 deletion(-)
 create mode 100644 arch/hexagon/include/asm/hwcap.h
 create mode 100644 arch/hexagon/include/uapi/asm/hwcap.h
arch/hexagon/include/asm/elf.h +2 -1
index 5bfdd9b147fd..127e750613bd 100644
@@ -11,6 +11,7 @@
 #include <asm/ptrace.h>
 #include <asm/user.h>
 #include <linux/elf-em.h>
+#include <asm/hwcap.h>
 
 struct elf32_hdr;
 
@@ -198,7 +199,7 @@ do {					\
  * This yields a mask that user programs can use to figure out what
  * instruction set this cpu supports.
  */
-#define ELF_HWCAP	(0)
+#define ELF_HWCAP	(elf_hwcap)
 
 /*
  * This yields a string that ld.so will use to load implementation
arch/hexagon/include/asm/hexagon_vm.h +58 -0

76 lines not on this page · raw message

arch/hexagon/include/asm/hwcap.h new file +25 -0
new file mode 100644
index 000000000000..6bfbcec66d31
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Hexagon hardware capability definitions
+ *
+ * Copyright Qualcomm Technologies, Inc. and its subsidiaries
+ */
+
+#ifndef __ASM_HEXAGON_HWCAP_H
+#define __ASM_HEXAGON_HWCAP_H
+
+#include <uapi/asm/hwcap.h>
+
+/* Kernel-internal definitions: ISA versions are used directly from UAPI */
+
+#ifndef __ASSEMBLER__
+/*
+ * This yields a mask that user programs can use to figure out what
+ * instruction set this cpu supports.
+ */
+#define ELF_HWCAP		(elf_hwcap)
+
+extern unsigned long elf_hwcap;
+#endif
+
+#endif /* __ASM_HEXAGON_HWCAP_H */
arch/hexagon/include/uapi/asm/hwcap.h new file +58 -0

58 lines not on this page · raw message

arch/hexagon/kernel/setup.c +100 -0

118 lines not on this page · raw message

arch/hexagon/kernel/vm_ops.S +4 -0
index f61c04d485f6..7bf32c55e050 100644
@@ -25,6 +25,10 @@ ENTRY(__vmsetvec)
 	trap1(#HVM_TRAP1_VMSETVEC);
 	jumpr	R31;
 
+ENTRY(__vmgetinfo)
+	trap1(#HVM_TRAP1_VMGETINFO);
+	jumpr	R31;
+
 ENTRY(__vmsetie)
 	trap1(#HVM_TRAP1_VMSETIE);
 	jumpr	R31;
Signature · 1 line
2.34.1