coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
acpigen_dptf.c File Reference
#include <acpi/acpigen.h>
#include <acpi/acpigen_dptf.h>
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for acpigen_dptf.c:

Go to the source code of this file.

Macros

#define DEFAULT_RAW_UNIT   "ma"
 
#define DPTF_PASSIVE_POLICY_1_0_UUID   "42A441D6-AE6A-462B-A84B-4A8CE79027D3"
 
#define DPTF_CRITICAL_POLICY_UUID   "97C68AE7-15FA-499c-B8C9-5DA81D606E0A"
 
#define DPTF_ACTIVE_POLICY_UUID   "3A95C389-E4B8-4629-A526-C52C88626BAE"
 

Enumerations

enum  {
  ART_REVISION = 0 , DEFAULT_PRIORITY = 100 , DEFAULT_TRIP_POINT = 0xFFFFFFFFull , DEFAULT_WEIGHT = 100 ,
  DPTF_MAX_ART_THRESHOLDS = 10 , FPS_REVISION = 0 , PPCC_REVISION = 2 , RAPL_PL1_INDEX = 0 ,
  RAPL_PL2_INDEX = 1
}
 

Functions

static int to_acpi_temp (int deg_c)
 
static int to_acpi_time (int ms)
 
static void write_simple_return_method (const char *name, int value)
 
static void write_zeros (int count)
 
static const char * namestring_of (enum dptf_participant participant)
 
static const char * scope_of (enum dptf_participant participant)
 
static const char * path_of (enum dptf_participant participant)
 
void dptf_write_scope (enum dptf_participant participant)
 
static void write_active_relationship_table (const struct dptf_active_policy *policies, int max_count)
 
static void write_active_cooling_methods (const struct dptf_active_policy *policies, int max_count)
 
void dptf_write_active_policies (const struct dptf_active_policy *policies, int max_count)
 
static void write_thermal_relationship_table (const struct dptf_passive_policy *policies, int max_count)
 
static void write_all_PSV (const struct dptf_passive_policy *policies, int max_count)
 
void dptf_write_passive_policies (const struct dptf_passive_policy *policies, int max_count)
 
void dptf_write_critical_policies (const struct dptf_critical_policy *policies, int max_count)
 
void dptf_write_charger_perf (const struct dptf_charger_perf *states, int max_count)
 
void dptf_write_fan_perf (const struct dptf_fan_perf *states, int max_count)
 
void dptf_write_power_limits (const struct dptf_power_limits *limits)
 
void dptf_write_STR (const char *str)
 
void dptf_write_fan_options (bool fine_grained, int step_size, bool low_speed_notify)
 
void dptf_write_tsr_hysteresis (uint8_t hysteresis)
 
void dptf_write_enabled_policies (const struct dptf_active_policy *active_policies, int active_count, const struct dptf_passive_policy *passive_policies, int passive_count, const struct dptf_critical_policy *critical_policies, int critical_count)
 

Macro Definition Documentation

◆ DEFAULT_RAW_UNIT

#define DEFAULT_RAW_UNIT   "ma"

Definition at line 9 of file acpigen_dptf.c.

◆ DPTF_ACTIVE_POLICY_UUID

#define DPTF_ACTIVE_POLICY_UUID   "3A95C389-E4B8-4629-A526-C52C88626BAE"

Definition at line 14 of file acpigen_dptf.c.

◆ DPTF_CRITICAL_POLICY_UUID

#define DPTF_CRITICAL_POLICY_UUID   "97C68AE7-15FA-499c-B8C9-5DA81D606E0A"

Definition at line 13 of file acpigen_dptf.c.

◆ DPTF_PASSIVE_POLICY_1_0_UUID

#define DPTF_PASSIVE_POLICY_1_0_UUID   "42A441D6-AE6A-462B-A84B-4A8CE79027D3"

Definition at line 12 of file acpigen_dptf.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ART_REVISION 
DEFAULT_PRIORITY 
DEFAULT_TRIP_POINT 
DEFAULT_WEIGHT 
DPTF_MAX_ART_THRESHOLDS 
FPS_REVISION 
PPCC_REVISION 
RAPL_PL1_INDEX 
RAPL_PL2_INDEX 

Definition at line 16 of file acpigen_dptf.c.

Function Documentation

◆ dptf_write_active_policies()

void dptf_write_active_policies ( const struct dptf_active_policy policies,
int  max_count 
)

Definition at line 208 of file acpigen_dptf.c.

References write_active_cooling_methods(), and write_active_relationship_table().

Referenced by write_policies().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dptf_write_charger_perf()

void dptf_write_charger_perf ( const struct dptf_charger_perf states,
int  max_count 
)

Definition at line 316 of file acpigen_dptf.c.

References acpigen_emit_byte(), acpigen_pop_len(), acpigen_write_integer(), acpigen_write_method(), acpigen_write_package(), acpigen_write_string(), DEFAULT_RAW_UNIT, DPTF_CHARGER, dptf_write_scope(), RETURN_OP, and write_zeros().

Referenced by write_controls().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dptf_write_critical_policies()

void dptf_write_critical_policies ( const struct dptf_critical_policy policies,
int  max_count 
)

Definition at line 298 of file acpigen_dptf.c.

References acpigen_pop_len(), DPTF_CRITICAL_SHUTDOWN, DPTF_NONE, dptf_write_scope(), to_acpi_temp(), type, and write_simple_return_method().

Referenced by write_policies().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dptf_write_enabled_policies()

void dptf_write_enabled_policies ( const struct dptf_active_policy active_policies,
int  active_count,
const struct dptf_passive_policy passive_policies,
int  passive_count,
const struct dptf_critical_policy critical_policies,
int  critical_count 
)

◆ dptf_write_fan_options()

void dptf_write_fan_options ( bool  fine_grained,
int  step_size,
bool  low_speed_notify 
)

Definition at line 443 of file acpigen_dptf.c.

References acpigen_pop_len(), acpigen_write_integer(), acpigen_write_name(), and acpigen_write_package().

Referenced by write_options().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dptf_write_fan_perf()

void dptf_write_fan_perf ( const struct dptf_fan_perf states,
int  max_count 
)

Definition at line 355 of file acpigen_dptf.c.

References acpigen_pop_len(), acpigen_write_integer(), acpigen_write_name(), acpigen_write_package(), DEFAULT_TRIP_POINT, DPTF_FAN, dptf_write_scope(), FPS_REVISION, and power.

Referenced by write_controls().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dptf_write_passive_policies()

void dptf_write_passive_policies ( const struct dptf_passive_policy policies,
int  max_count 
)

Definition at line 292 of file acpigen_dptf.c.

References write_all_PSV(), and write_thermal_relationship_table().

Referenced by write_policies().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dptf_write_power_limits()

void dptf_write_power_limits ( const struct dptf_power_limits limits)

Definition at line 392 of file acpigen_dptf.c.

References acpigen_pop_len(), acpigen_write_integer(), acpigen_write_method(), acpigen_write_package(), DPTF_CPU, dptf_write_scope(), limits, PPCC_REVISION, RAPL_PL1_INDEX, and RAPL_PL2_INDEX.

Referenced by write_controls().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dptf_write_scope()

void dptf_write_scope ( enum dptf_participant  participant)

◆ dptf_write_STR()

void dptf_write_STR ( const char *  str)

Definition at line 435 of file acpigen_dptf.c.

References acpigen_write_name_string().

Referenced by write_options().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dptf_write_tsr_hysteresis()

void dptf_write_tsr_hysteresis ( uint8_t  hysteresis)

Definition at line 455 of file acpigen_dptf.c.

References acpigen_write_name_integer().

Referenced by write_options().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ namestring_of()

static const char* namestring_of ( enum dptf_participant  participant)
static

Definition at line 56 of file acpigen_dptf.c.

References DPTF_BATTERY, DPTF_CHARGER, DPTF_CPU, DPTF_FAN, DPTF_POWER, DPTF_TEMP_SENSOR_0, DPTF_TEMP_SENSOR_1, DPTF_TEMP_SENSOR_2, DPTF_TEMP_SENSOR_3, DPTF_TEMP_SENSOR_4, and DPTF_TPCH.

Referenced by path_of(), and scope_of().

Here is the caller graph for this function:

◆ path_of()

static const char* path_of ( enum dptf_participant  participant)
static

Definition at line 105 of file acpigen_dptf.c.

References DPTF_CPU, namestring_of(), and scope_of().

Referenced by write_active_relationship_table(), and write_thermal_relationship_table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scope_of()

static const char* scope_of ( enum dptf_participant  participant)
static

Definition at line 87 of file acpigen_dptf.c.

References DPTF_CPU, DPTF_DEVICE_PATH, namestring_of(), snprintf(), and TCPU_SCOPE.

Referenced by dptf_write_scope(), and path_of().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_acpi_temp()

static int to_acpi_temp ( int  deg_c)
static

Definition at line 29 of file acpigen_dptf.c.

Referenced by dptf_write_critical_policies(), write_active_cooling_methods(), and write_all_PSV().

Here is the caller graph for this function:

◆ to_acpi_time()

static int to_acpi_time ( int  ms)
static

Definition at line 35 of file acpigen_dptf.c.

Referenced by write_thermal_relationship_table().

Here is the caller graph for this function:

◆ write_active_cooling_methods()

static void write_active_cooling_methods ( const struct dptf_active_policy policies,
int  max_count 
)
static

Definition at line 178 of file acpigen_dptf.c.

References acpigen_pop_len(), DPTF_MAX_ACX, DPTF_NONE, dptf_write_scope(), name, snprintf(), to_acpi_temp(), and write_simple_return_method().

Referenced by dptf_write_active_policies().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_active_relationship_table()

static void write_active_relationship_table ( const struct dptf_active_policy policies,
int  max_count 
)
static

◆ write_all_PSV()

static void write_all_PSV ( const struct dptf_passive_policy policies,
int  max_count 
)
static

Definition at line 278 of file acpigen_dptf.c.

References acpigen_pop_len(), DPTF_NONE, dptf_write_scope(), to_acpi_temp(), and write_simple_return_method().

Referenced by dptf_write_passive_policies().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_simple_return_method()

static void write_simple_return_method ( const char *  name,
int  value 
)
static

Definition at line 41 of file acpigen_dptf.c.

References acpigen_pop_len(), acpigen_write_method(), acpigen_write_return_integer(), name, and value.

Referenced by dptf_write_critical_policies(), write_active_cooling_methods(), and write_all_PSV().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_thermal_relationship_table()

static void write_thermal_relationship_table ( const struct dptf_passive_policy policies,
int  max_count 
)
static

◆ write_zeros()

static void write_zeros ( int  count)
static

Definition at line 49 of file acpigen_dptf.c.

References acpigen_write_integer(), and count.

Referenced by dptf_write_charger_perf(), and write_thermal_relationship_table().

Here is the call graph for this function:
Here is the caller graph for this function: