2017-11-01 22:08:43 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
2015-07-28 03:58:23 +08:00
|
|
|
#ifndef _UAPI_ASM_HWCAP_H
|
|
|
|
#define _UAPI_ASM_HWCAP_H
|
|
|
|
|
|
|
|
/* HWCAP flags */
|
|
|
|
#define HWCAP_MIPS_R6 (1 << 0)
|
|
|
|
#define HWCAP_MIPS_MSA (1 << 1)
|
2018-02-10 06:11:05 +08:00
|
|
|
#define HWCAP_MIPS_CRC32 (1 << 2)
|
2019-10-10 23:01:57 +08:00
|
|
|
#define HWCAP_MIPS_MIPS16 (1 << 3)
|
|
|
|
#define HWCAP_MIPS_MDMX (1 << 4)
|
|
|
|
#define HWCAP_MIPS_MIPS3D (1 << 5)
|
|
|
|
#define HWCAP_MIPS_SMARTMIPS (1 << 6)
|
|
|
|
#define HWCAP_MIPS_DSP (1 << 7)
|
|
|
|
#define HWCAP_MIPS_DSP2 (1 << 8)
|
|
|
|
#define HWCAP_MIPS_DSP3 (1 << 9)
|
|
|
|
#define HWCAP_MIPS_MIPS16E2 (1 << 10)
|
|
|
|
#define HWCAP_LOONGSON_MMI (1 << 11)
|
|
|
|
#define HWCAP_LOONGSON_EXT (1 << 12)
|
|
|
|
#define HWCAP_LOONGSON_EXT2 (1 << 13)
|
MIPS: Expose Loongson CPUCFG availability via HWCAP
The point is to allow userspace to probe for CPUCFG without possibly
triggering invalid instructions. In addition to that, future Loongson
feature bits could all be stuffed into CPUCFG bit fields (or "leaves"
in x86-speak) if Loongson does not make mistakes, so ELF HWCAP bits are
conserved.
Userspace can determine native CPUCFG availability by checking the LCSRP
(Loongson CSR Present) bit in CPUCFG output after seeing CPUCFG bit in
HWCAP. Native CPUCFG always sets the LCSRP bit, as CPUCFG is part of the
Loongson CSR ASE, while the emulation intentionally leaves this bit
clear.
The other existing Loongson-specific HWCAP bits are, to my best
knowledge, unused, as
(1) they are fairly recent additions,
(2) Loongson never back-ported the patch into their kernel fork, and
(3) Loongson's existing installed base rarely upgrade, if ever;
However, they are still considered userspace ABI, hence unfortunately
unremovable. But hopefully at least we could stop adding new Loongson
HWCAP bits in the future.
Cc: Paul Burton <paulburton@kernel.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Huacai Chen <chenhc@lemote.com>
Signed-off-by: WANG Xuerui <git@xen0n.name>
Reviewed-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2020-05-30 15:32:42 +08:00
|
|
|
#define HWCAP_LOONGSON_CPUCFG (1 << 14)
|
2015-07-28 03:58:23 +08:00
|
|
|
|
|
|
|
#endif /* _UAPI_ASM_HWCAP_H */
|