coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cstates.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <acpi/acpigen.h>
5 
6 #define MWAIT_RES(state, sub_state) \
7  { \
8  .space_id = ACPI_ADDRESS_SPACE_FIXED, \
9  .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL, \
10  .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT, \
11  .access_size = ACPI_ACCESS_SIZE_UNDEFINED, \
12  .addrl = (((state) << 4) | (sub_state)), \
13  .addrh = 0, \
14  }
15 
16 static const acpi_cstate_t cst_entries[] = {
17  {
18  .ctype = 1,
19  .latency = 1,
20  .power = 1000,
21  .resource = MWAIT_RES(0, 0),
22  },
23  {
24  .ctype = 2,
25  .latency = 1,
26  .power = 500,
27  .resource = MWAIT_RES(1, 0),
28  },
29  {
30  .ctype = 3,
31  .latency = 17,
32  .power = 250,
33  .resource = MWAIT_RES(2, 0),
34  },
35 };
36 
37 int get_cst_entries(const acpi_cstate_t **entries)
38 {
39  *entries = cst_entries;
40  return ARRAY_SIZE(cst_entries);
41 }
int get_cst_entries(const acpi_cstate_t **entries)
Definition: cstates.c:5
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define MWAIT_RES(state, sub_state)
Definition: cstates.c:6
static const acpi_cstate_t cst_entries[]
Definition: cstates.c:16
u8 ctype
Definition: acpi.h:984