xref: /qemu/host/include/riscv/host/cpuinfo.h (revision 32a97c5d05c5deb54a42315d48cecf86cbeadaf4)
1 /*
2  * SPDX-License-Identifier: GPL-2.0-or-later
3  * Host specific cpu identification for RISC-V.
4  */
5 
6 #ifndef HOST_CPUINFO_H
7 #define HOST_CPUINFO_H
8 
9 #define CPUINFO_ALWAYS          (1u << 0)  /* so cpuinfo is nonzero */
10 #define CPUINFO_ZBA             (1u << 1)
11 #define CPUINFO_ZBB             (1u << 2)
12 #define CPUINFO_ZBS             (1u << 3)
13 #define CPUINFO_ZICOND          (1u << 4)
14 #define CPUINFO_ZVE64X          (1u << 5)
15 
16 /* Initialized with a constructor. */
17 extern unsigned cpuinfo;
18 extern unsigned riscv_lg2_vlenb;
19 
20 /*
21  * We cannot rely on constructor ordering, so other constructors must
22  * use the function interface rather than the variable above.
23  */
24 unsigned cpuinfo_init(void);
25 
26 #endif /* HOST_CPUINFO_H */
27