linux/drivers/acpi/processor_perflib.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * processor_perflib.c - ACPI Processor P-States Library ($Revision: 71 $)
 *
 *  Copyright (C) 2001, 2002 Andy Grover <[email protected]>
 *  Copyright (C) 2001, 2002 Paul Diefenbaugh <[email protected]>
 *  Copyright (C) 2004       Dominik Brodowski <[email protected]>
 *  Copyright (C) 2004  Anil S Keshavamurthy <[email protected]>
 *  			- Added processor hotplug support
 */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/cpufreq.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <acpi/processor.h>
#ifdef CONFIG_X86
#include <asm/cpufeature.h>
#endif

#define ACPI_PROCESSOR_FILE_PERFORMANCE

static DEFINE_MUTEX(performance_mutex);

/*
 * _PPC support is implemented as a CPUfreq policy notifier:
 * This means each time a CPUfreq driver registered also with
 * the ACPI core is asked to change the speed policy, the maximum
 * value is adjusted so that it is within the platform limit.
 *
 * Also, when a new platform limit value is detected, the CPUfreq
 * policy is adjusted accordingly.
 */

/* ignore_ppc:
 * -1 -> cpufreq low level drivers not initialized -> _PSS, etc. not called yet
 *       ignore _PPC
 *  0 -> cpufreq low level drivers initialized -> consider _PPC values
 *  1 -> ignore _PPC totally -> forced by user through boot param
 */
static int ignore_ppc =;
module_param(ignore_ppc, int, 0644);
MODULE_PARM_DESC();

static bool acpi_processor_ppc_in_use;

static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
{}

#define ACPI_PROCESSOR_NOTIFY_PERFORMANCE
/*
 * acpi_processor_ppc_ost: Notify firmware the _PPC evaluation status
 * @handle: ACPI processor handle
 * @status: the status code of _PPC evaluation
 *	0: success. OSPM is now using the performance state specified.
 *	1: failure. OSPM has not changed the number of P-states in use
 */
static void acpi_processor_ppc_ost(acpi_handle handle, int status)
{}

void acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag)
{}

int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
{}
EXPORT_SYMBOL();

void acpi_processor_ignore_ppc_init(void)
{}

void acpi_processor_ppc_init(struct cpufreq_policy *policy)
{}

void acpi_processor_ppc_exit(struct cpufreq_policy *policy)
{}

static int acpi_processor_get_performance_control(struct acpi_processor *pr)
{}

#ifdef CONFIG_X86
/*
 * Some AMDs have 50MHz frequency multiples, but only provide 100MHz rounding
 * in their ACPI data. Calculate the real values and fix up the _PSS data.
 */
static void amd_fixup_frequency(struct acpi_processor_px *px, int i)
{}
#else
static void amd_fixup_frequency(struct acpi_processor_px *px, int i) {};
#endif

static int acpi_processor_get_performance_states(struct acpi_processor *pr)
{}

int acpi_processor_get_performance_info(struct acpi_processor *pr)
{}
EXPORT_SYMBOL_GPL();

int acpi_processor_pstate_control(void)
{}

int acpi_processor_notify_smm(struct module *calling_module)
{}
EXPORT_SYMBOL();

int acpi_processor_get_psd(acpi_handle handle, struct acpi_psd_package *pdomain)
{}
EXPORT_SYMBOL();

int acpi_processor_preregister_performance(
		struct acpi_processor_performance __percpu *performance)
{}
EXPORT_SYMBOL();

int acpi_processor_register_performance(struct acpi_processor_performance
					*performance, unsigned int cpu)
{}
EXPORT_SYMBOL();

void acpi_processor_unregister_performance(unsigned int cpu)
{}
EXPORT_SYMBOL();