1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * linux/arch/unicore32/include/asm/cputype.h 4 * 5 * Code specific to PKUnity SoC and UniCore ISA 6 * 7 * Copyright (C) 2001-2010 GUAN Xue-tao 8 */ 9 #ifndef __UNICORE_CPUTYPE_H__ 10 #define __UNICORE_CPUTYPE_H__ 11 12 #include <linux/stringify.h> 13 14 #define CPUID_CPUID 0 15 #define CPUID_CACHETYPE 1 16 17 #define read_cpuid(reg) \ 18 ({ \ 19 unsigned int __val; \ 20 asm("movc %0, p0.c0, #" __stringify(reg) \ 21 : "=r" (__val) \ 22 : \ 23 : "cc"); \ 24 __val; \ 25 }) 26 27 #define uc32_cpuid read_cpuid(CPUID_CPUID) 28 #define uc32_cachetype read_cpuid(CPUID_CACHETYPE) 29 30 #endif