Path: blob/master/arch/loongarch/include/asm/cpu-features.h
26488 views
/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copyright (C) 2020-2022 Loongson Technology Corporation Limited3*4* Derived from MIPS:5* Copyright (C) 2003, 2004 Ralf Baechle6* Copyright (C) 2004 Maciej W. Rozycki7*/8#ifndef __ASM_CPU_FEATURES_H9#define __ASM_CPU_FEATURES_H1011#include <asm/cpu.h>12#include <asm/cpu-info.h>1314#define cpu_opt(opt) (cpu_data[0].options & (opt))15#define cpu_has(feat) (cpu_data[0].options & BIT_ULL(feat))1617#define cpu_has_loongarch (cpu_has_loongarch32 | cpu_has_loongarch64)18#define cpu_has_loongarch32 (cpu_data[0].isa_level & LOONGARCH_CPU_ISA_32BIT)19#define cpu_has_loongarch64 (cpu_data[0].isa_level & LOONGARCH_CPU_ISA_64BIT)2021#ifdef CONFIG_32BIT22# define cpu_has_64bits (cpu_data[0].isa_level & LOONGARCH_CPU_ISA_64BIT)23# define cpu_vabits 3124# define cpu_pabits 3125#endif2627#ifdef CONFIG_64BIT28# define cpu_has_64bits 129# define cpu_vabits cpu_data[0].vabits30# define cpu_pabits cpu_data[0].pabits31# define __NEED_ADDRBITS_PROBE32#endif3334/*35* SMP assumption: Options of CPU 0 are a superset of all processors.36* This is true for all known LoongArch systems.37*/38#define cpu_has_cpucfg cpu_opt(LOONGARCH_CPU_CPUCFG)39#define cpu_has_lam cpu_opt(LOONGARCH_CPU_LAM)40#define cpu_has_ual cpu_opt(LOONGARCH_CPU_UAL)41#define cpu_has_fpu cpu_opt(LOONGARCH_CPU_FPU)42#define cpu_has_lsx cpu_opt(LOONGARCH_CPU_LSX)43#define cpu_has_lasx cpu_opt(LOONGARCH_CPU_LASX)44#define cpu_has_crc32 cpu_opt(LOONGARCH_CPU_CRC32)45#define cpu_has_complex cpu_opt(LOONGARCH_CPU_COMPLEX)46#define cpu_has_crypto cpu_opt(LOONGARCH_CPU_CRYPTO)47#define cpu_has_lvz cpu_opt(LOONGARCH_CPU_LVZ)48#define cpu_has_lbt_x86 cpu_opt(LOONGARCH_CPU_LBT_X86)49#define cpu_has_lbt_arm cpu_opt(LOONGARCH_CPU_LBT_ARM)50#define cpu_has_lbt_mips cpu_opt(LOONGARCH_CPU_LBT_MIPS)51#define cpu_has_lbt (cpu_has_lbt_x86|cpu_has_lbt_arm|cpu_has_lbt_mips)52#define cpu_has_csr cpu_opt(LOONGARCH_CPU_CSR)53#define cpu_has_iocsr cpu_opt(LOONGARCH_CPU_IOCSR)54#define cpu_has_tlb cpu_opt(LOONGARCH_CPU_TLB)55#define cpu_has_watch cpu_opt(LOONGARCH_CPU_WATCH)56#define cpu_has_vint cpu_opt(LOONGARCH_CPU_VINT)57#define cpu_has_csripi cpu_opt(LOONGARCH_CPU_CSRIPI)58#define cpu_has_extioi cpu_opt(LOONGARCH_CPU_EXTIOI)59#define cpu_has_prefetch cpu_opt(LOONGARCH_CPU_PREFETCH)60#define cpu_has_pmp cpu_opt(LOONGARCH_CPU_PMP)61#define cpu_has_perf cpu_opt(LOONGARCH_CPU_PMP)62#define cpu_has_scalefreq cpu_opt(LOONGARCH_CPU_SCALEFREQ)63#define cpu_has_flatmode cpu_opt(LOONGARCH_CPU_FLATMODE)64#define cpu_has_eiodecode cpu_opt(LOONGARCH_CPU_EIODECODE)65#define cpu_has_guestid cpu_opt(LOONGARCH_CPU_GUESTID)66#define cpu_has_hypervisor cpu_opt(LOONGARCH_CPU_HYPERVISOR)67#define cpu_has_ptw cpu_opt(LOONGARCH_CPU_PTW)68#define cpu_has_lspw cpu_opt(LOONGARCH_CPU_LSPW)69#define cpu_has_avecint cpu_opt(LOONGARCH_CPU_AVECINT)7071#endif /* __ASM_CPU_FEATURES_H */727374