cpufeature.h (6e5ce7f2eae3c7c36dd1709efaac34820a34d538) cpufeature.h (f413aae96cda059635910c462ede0a8f0385897c)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright 2022-2024 Rivos, Inc
4 */
5
6#ifndef _ASM_CPUFEATURE_H
7#define _ASM_CPUFEATURE_H
8

--- 14 unchanged lines hidden (view full) ---

23};
24
25struct riscv_isainfo {
26 DECLARE_BITMAP(isa, RISCV_ISA_EXT_MAX);
27};
28
29DECLARE_PER_CPU(struct riscv_cpuinfo, riscv_cpuinfo);
30
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright 2022-2024 Rivos, Inc
4 */
5
6#ifndef _ASM_CPUFEATURE_H
7#define _ASM_CPUFEATURE_H
8

--- 14 unchanged lines hidden (view full) ---

23};
24
25struct riscv_isainfo {
26 DECLARE_BITMAP(isa, RISCV_ISA_EXT_MAX);
27};
28
29DECLARE_PER_CPU(struct riscv_cpuinfo, riscv_cpuinfo);
30
31DECLARE_PER_CPU(long, misaligned_access_speed);
32
33/* Per-cpu ISA extensions. */
34extern struct riscv_isainfo hart_isa[NR_CPUS];
35
36void riscv_user_isa_enable(void);
37
31/* Per-cpu ISA extensions. */
32extern struct riscv_isainfo hart_isa[NR_CPUS];
33
34void riscv_user_isa_enable(void);
35
38#ifdef CONFIG_RISCV_MISALIGNED
39bool unaligned_ctl_available(void);
36#if defined(CONFIG_RISCV_MISALIGNED)
40bool check_unaligned_access_emulated_all_cpus(void);
41void unaligned_emulation_finish(void);
37bool check_unaligned_access_emulated_all_cpus(void);
38void unaligned_emulation_finish(void);
39bool unaligned_ctl_available(void);
40DECLARE_PER_CPU(long, misaligned_access_speed);
42#else
43static inline bool unaligned_ctl_available(void)
44{
45 return false;
46}
41#else
42static inline bool unaligned_ctl_available(void)
43{
44 return false;
45}
47
48static inline bool check_unaligned_access_emulated(int cpu)
49{
50 return false;
51}
52
53static inline void unaligned_emulation_finish(void) {}
54#endif
55
46#endif
47
48#if defined(CONFIG_RISCV_PROBE_UNALIGNED_ACCESS)
56DECLARE_STATIC_KEY_FALSE(fast_unaligned_access_speed_key);
57
58static __always_inline bool has_fast_unaligned_accesses(void)
59{
60 return static_branch_likely(&fast_unaligned_access_speed_key);
61}
49DECLARE_STATIC_KEY_FALSE(fast_unaligned_access_speed_key);
50
51static __always_inline bool has_fast_unaligned_accesses(void)
52{
53 return static_branch_likely(&fast_unaligned_access_speed_key);
54}
55#else
56static __always_inline bool has_fast_unaligned_accesses(void)
57{
58 if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS))
59 return true;
60 else
61 return false;
62}
63#endif
62
63unsigned long riscv_get_elf_hwcap(void);
64
65struct riscv_isa_ext_data {
66 const unsigned int id;
67 const char *name;
68 const char *property;
69 const unsigned int *subset_ext_ids;

--- 76 unchanged lines hidden ---
64
65unsigned long riscv_get_elf_hwcap(void);
66
67struct riscv_isa_ext_data {
68 const unsigned int id;
69 const char *name;
70 const char *property;
71 const unsigned int *subset_ext_ids;

--- 76 unchanged lines hidden ---