coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cpu.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __ARCH_CPU_H__
4 #define __ARCH_CPU_H__
5 
6 #include <arch/encoding.h>
7 #include <device/device.h>
8 
9 static inline void cpu_relax(void) { }
10 
11 #define asmlinkage
12 
13 struct cpu_driver {
14  struct device_operations *ops;
15  const struct cpu_device_id *id_table;
16 };
17 
18 struct cpuinfo_riscv {
19  uint8_t riscv; /* CPU family */
20  uint8_t riscv_vendor; /* CPU vendor */
22 };
23 
24 static inline int supports_extension(char ext)
25 {
26  return read_csr(misa) & (1 << (ext - 'A'));
27 }
28 
29 static inline int machine_xlen(void)
30 {
31  int mxl = (read_csr(misa) >> (__riscv_xlen - 2)) & 3;
32  return (1 << mxl) * 16;
33 }
34 
35 #endif /* __ARCH_CPU_H__ */
static int supports_extension(char ext)
Definition: cpu.h:24
static void cpu_relax(void)
Definition: cpu.h:9
static int machine_xlen(void)
Definition: cpu.h:29
unsigned char uint8_t
Definition: stdint.h:8
Definition: cpu.h:13
const struct cpu_device_id * id_table
Definition: cpu.h:15
struct device_operations * ops
Definition: cpu.h:14
uint8_t riscv_vendor
Definition: cpu.h:20
uint8_t riscv_model
Definition: cpu.h:21
uint8_t riscv
Definition: cpu.h:19