Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f577adf0 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Ian Maund
Browse files

arm64: drop redundant macros from read_cpuid()



asm/cputype.h contains a bunch of #defines for CPU id registers
that essentially map to themselves. Remove the #defines and pass
the tokens directly to the inline asm() that reads the registers.

Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Git-commit: 148eb0a1db8e37a5966afe98223cefe0c1837c26
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarIan Maund <imaund@codeaurora.org>
parent ab451030
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -16,16 +16,6 @@
#ifndef __ASM_CPUTYPE_H
#define __ASM_CPUTYPE_H

#define ID_MIDR_EL1		"midr_el1"
#define ID_MPIDR_EL1		"mpidr_el1"
#define ID_CTR_EL0		"ctr_el0"

#define ID_AA64PFR0_EL1		"id_aa64pfr0_el1"
#define ID_AA64DFR0_EL1		"id_aa64dfr0_el1"
#define ID_AA64AFR0_EL1		"id_aa64afr0_el1"
#define ID_AA64ISAR0_EL1	"id_aa64isar0_el1"
#define ID_AA64MMFR0_EL1	"id_aa64mmfr0_el1"

#define INVALID_HWID		ULONG_MAX

#define MPIDR_HWID_BITMASK	0xff00ffffff
@@ -42,7 +32,7 @@

#define read_cpuid(reg) ({						\
	u64 __val;							\
	asm("mrs	%0, " reg : "=r" (__val));			\
	asm("mrs	%0, " #reg : "=r" (__val));			\
	__val;								\
})

@@ -64,12 +54,12 @@
 */
static inline u32 __attribute_const__ read_cpuid_id(void)
{
	return read_cpuid(ID_MIDR_EL1);
	return read_cpuid(MIDR_EL1);
}

static inline u64 __attribute_const__ read_cpuid_mpidr(void)
{
	return read_cpuid(ID_MPIDR_EL1);
	return read_cpuid(MPIDR_EL1);
}

static inline unsigned int __attribute_const__ read_cpuid_implementor(void)
@@ -84,7 +74,7 @@ static inline unsigned int __attribute_const__ read_cpuid_part_number(void)

static inline u32 __attribute_const__ read_cpuid_cachetype(void)
{
	return read_cpuid(ID_CTR_EL0);
	return read_cpuid(CTR_EL0);
}

#endif /* __ASSEMBLY__ */