~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/loongarch/include/asm/cpu-features.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  4  *
  5  * Derived from MIPS:
  6  * Copyright (C) 2003, 2004 Ralf Baechle
  7  * Copyright (C) 2004  Maciej W. Rozycki
  8  */
  9 #ifndef __ASM_CPU_FEATURES_H
 10 #define __ASM_CPU_FEATURES_H
 11 
 12 #include <asm/cpu.h>
 13 #include <asm/cpu-info.h>
 14 
 15 #define cpu_opt(opt)                    (cpu_data[0].options & (opt))
 16 #define cpu_has(feat)                   (cpu_data[0].options & BIT_ULL(feat))
 17 
 18 #define cpu_has_loongarch               (cpu_has_loongarch32 | cpu_has_loongarch64)
 19 #define cpu_has_loongarch32             (cpu_data[0].isa_level & LOONGARCH_CPU_ISA_32BIT)
 20 #define cpu_has_loongarch64             (cpu_data[0].isa_level & LOONGARCH_CPU_ISA_64BIT)
 21 
 22 #ifdef CONFIG_32BIT
 23 # define cpu_has_64bits                 (cpu_data[0].isa_level & LOONGARCH_CPU_ISA_64BIT)
 24 # define cpu_vabits                     31
 25 # define cpu_pabits                     31
 26 #endif
 27 
 28 #ifdef CONFIG_64BIT
 29 # define cpu_has_64bits                 1
 30 # define cpu_vabits                     cpu_data[0].vabits
 31 # define cpu_pabits                     cpu_data[0].pabits
 32 # define __NEED_ADDRBITS_PROBE
 33 #endif
 34 
 35 /*
 36  * SMP assumption: Options of CPU 0 are a superset of all processors.
 37  * This is true for all known LoongArch systems.
 38  */
 39 #define cpu_has_cpucfg          cpu_opt(LOONGARCH_CPU_CPUCFG)
 40 #define cpu_has_lam             cpu_opt(LOONGARCH_CPU_LAM)
 41 #define cpu_has_ual             cpu_opt(LOONGARCH_CPU_UAL)
 42 #define cpu_has_fpu             cpu_opt(LOONGARCH_CPU_FPU)
 43 #define cpu_has_lsx             cpu_opt(LOONGARCH_CPU_LSX)
 44 #define cpu_has_lasx            cpu_opt(LOONGARCH_CPU_LASX)
 45 #define cpu_has_crc32           cpu_opt(LOONGARCH_CPU_CRC32)
 46 #define cpu_has_complex         cpu_opt(LOONGARCH_CPU_COMPLEX)
 47 #define cpu_has_crypto          cpu_opt(LOONGARCH_CPU_CRYPTO)
 48 #define cpu_has_lvz             cpu_opt(LOONGARCH_CPU_LVZ)
 49 #define cpu_has_lbt_x86         cpu_opt(LOONGARCH_CPU_LBT_X86)
 50 #define cpu_has_lbt_arm         cpu_opt(LOONGARCH_CPU_LBT_ARM)
 51 #define cpu_has_lbt_mips        cpu_opt(LOONGARCH_CPU_LBT_MIPS)
 52 #define cpu_has_lbt             (cpu_has_lbt_x86|cpu_has_lbt_arm|cpu_has_lbt_mips)
 53 #define cpu_has_csr             cpu_opt(LOONGARCH_CPU_CSR)
 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 
 69 #endif /* __ASM_CPU_FEATURES_H */
 70 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php