Skip to content

Commit

Permalink
ARM: 7981/1: add support for AT_HWCAP2 ELF auxv entry
Browse files Browse the repository at this point in the history
This enables AT_HWCAP2 for ARM. The generic support for this
new ELF auxv entry was added in commit 2171364 (powerpc:
Add HWCAP2 aux entry)

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Ard Biesheuvel authored and Russell King committed Feb 25, 2014
1 parent 27e8efd commit b342ea4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/include/asm/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* instruction set this cpu supports.
*/
#define ELF_HWCAP (elf_hwcap)
extern unsigned int elf_hwcap;
#define ELF_HWCAP2 (elf_hwcap2)
extern unsigned int elf_hwcap, elf_hwcap2;
#endif
#endif
4 changes: 4 additions & 0 deletions arch/arm/include/uapi/asm/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@
#define HWCAP_LPAE (1 << 20)
#define HWCAP_EVTSTRM (1 << 21)

/*
* HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2
*/

#endif /* _UAPI__ASMARM_HWCAP_H */
11 changes: 11 additions & 0 deletions arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ EXPORT_SYMBOL(system_serial_high);
unsigned int elf_hwcap __read_mostly;
EXPORT_SYMBOL(elf_hwcap);

unsigned int elf_hwcap2 __read_mostly;
EXPORT_SYMBOL(elf_hwcap2);


#ifdef MULTI_CPU
struct processor processor __read_mostly;
Expand Down Expand Up @@ -1005,6 +1008,10 @@ static const char *hwcap_str[] = {
NULL
};

static const char *hwcap2_str[] = {
NULL
};

static int c_show(struct seq_file *m, void *v)
{
int i, j;
Expand All @@ -1028,6 +1035,10 @@ static int c_show(struct seq_file *m, void *v)
if (elf_hwcap & (1 << j))
seq_printf(m, "%s ", hwcap_str[j]);

for (j = 0; hwcap2_str[j]; j++)
if (elf_hwcap2 & (1 << j))
seq_printf(m, "%s ", hwcap2_str[j]);

seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24);
seq_printf(m, "CPU architecture: %s\n",
proc_arch[cpu_architecture()]);
Expand Down

0 comments on commit b342ea4

Please sign in to comment.