hexagon: add hwcap
Subsystems (2)
Brian Cain
maintainerPATCH 1/1 hexagon: add hwcap
Provide hwcap interface for userspace programs to discover the Hexagon CPU capabilities.
Signed-off-by Brian Cain <[email protected]>
--- 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
@@ -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
@@ -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
@@ -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