linux/drivers/acpi/sysfs.c

// SPDX-License-Identifier: GPL-2.0
/*
 * sysfs.c - ACPI sysfs interface to userspace.
 */

#define pr_fmt(fmt)

#include <linux/acpi.h>
#include <linux/bitmap.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/kstrtox.h>
#include <linux/moduleparam.h>

#include "internal.h"

#ifdef CONFIG_ACPI_DEBUG
/*
 * ACPI debug sysfs I/F, including:
 * /sys/modules/acpi/parameters/debug_layer
 * /sys/modules/acpi/parameters/debug_level
 * /sys/modules/acpi/parameters/trace_method_name
 * /sys/modules/acpi/parameters/trace_state
 * /sys/modules/acpi/parameters/trace_debug_layer
 * /sys/modules/acpi/parameters/trace_debug_level
 */

struct acpi_dlayer {};
struct acpi_dlevel {};
#define ACPI_DEBUG_INIT(v)

static const struct acpi_dlayer acpi_debug_layers[] =;

static const struct acpi_dlevel acpi_debug_levels[] =;

static int param_get_debug_layer(char *buffer, const struct kernel_param *kp)
{}

static int param_get_debug_level(char *buffer, const struct kernel_param *kp)
{}

static const struct kernel_param_ops param_ops_debug_layer =;

static const struct kernel_param_ops param_ops_debug_level =;

module_param_cb();
module_param_cb();

static char trace_method_name[1024];

static int param_set_trace_method_name(const char *val,
				       const struct kernel_param *kp)
{}

static int param_get_trace_method_name(char *buffer, const struct kernel_param *kp)
{}

static const struct kernel_param_ops param_ops_trace_method =;

static const struct kernel_param_ops param_ops_trace_attrib =;

module_param_cb();
module_param_cb();
module_param_cb();

static int param_set_trace_state(const char *val,
				 const struct kernel_param *kp)
{}

static int param_get_trace_state(char *buffer, const struct kernel_param *kp)
{}

module_param_call();
#endif /* CONFIG_ACPI_DEBUG */


/* /sys/modules/acpi/parameters/aml_debug_output */

module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object,
		   byte, 0644);
MODULE_PARM_DESC();

/* /sys/module/acpi/parameters/acpica_version */
static int param_get_acpica_version(char *buffer,
				    const struct kernel_param *kp)
{}

module_param_call();

/*
 * ACPI table sysfs I/F:
 * /sys/firmware/acpi/tables/
 * /sys/firmware/acpi/tables/data/
 * /sys/firmware/acpi/tables/dynamic/
 */

static LIST_HEAD(acpi_table_attr_list);
static struct kobject *tables_kobj;
static struct kobject *tables_data_kobj;
static struct kobject *dynamic_tables_kobj;
static struct kobject *hotplug_kobj;

#define ACPI_MAX_TABLE_INSTANCES
#define ACPI_INST_SIZE

struct acpi_table_attr {};

struct acpi_data_attr {};

static ssize_t acpi_table_show(struct file *filp, struct kobject *kobj,
			       struct bin_attribute *bin_attr, char *buf,
			       loff_t offset, size_t count)
{}

static int acpi_table_attr_init(struct kobject *tables_obj,
				struct acpi_table_attr *table_attr,
				struct acpi_table_header *table_header)
{}

acpi_status acpi_sysfs_table_handler(u32 event, void *table, void *context)
{}

static ssize_t acpi_data_show(struct file *filp, struct kobject *kobj,
			      struct bin_attribute *bin_attr, char *buf,
			      loff_t offset, size_t count)
{}

static int acpi_bert_data_init(void *th, struct acpi_data_attr *data_attr)
{}

static int acpi_ccel_data_init(void *th, struct acpi_data_attr *data_attr)
{}

static struct acpi_data_obj {} acpi_data_objs[] =;

#define NUM_ACPI_DATA_OBJS

static int acpi_table_data_init(struct acpi_table_header *th)
{}

static int acpi_tables_sysfs_init(void)
{}

/*
 * Detailed ACPI IRQ counters:
 * /sys/firmware/acpi/interrupts/
 */

u32 acpi_irq_handled;
u32 acpi_irq_not_handled;

#define COUNT_GPE
#define COUNT_SCI
#define COUNT_SCI_NOT
#define COUNT_ERROR
#define NUM_COUNTERS_EXTRA

struct event_counter {};

static struct event_counter *all_counters;
static u32 num_gpes;
static u32 num_counters;
static struct attribute **all_attrs;
static u32 acpi_gpe_count;

static struct attribute_group interrupt_stats_attr_group =;

static struct kobj_attribute *counter_attrs;

static void delete_gpe_attr_array(void)
{}

static void gpe_count(u32 gpe_number)
{}

static void fixed_event_count(u32 event_number)
{}

static void acpi_global_event_handler(u32 event_type, acpi_handle device,
	u32 event_number, void *context)
{}

static int get_status(u32 index, acpi_event_status *ret,
		      acpi_handle *handle)
{}

static ssize_t counter_show(struct kobject *kobj,
			    struct kobj_attribute *attr, char *buf)
{}

/*
 * counter_set() sets the specified counter.
 * setting the total "sci" file to any value clears all counters.
 * enable/disable/clear a gpe/fixed event in user space.
 */
static ssize_t counter_set(struct kobject *kobj,
			   struct kobj_attribute *attr, const char *buf,
			   size_t size)
{}

/*
 * A Quirk Mechanism for GPE Flooding Prevention:
 *
 * Quirks may be needed to prevent GPE flooding on a specific GPE. The
 * flooding typically cannot be detected and automatically prevented by
 * ACPI_GPE_DISPATCH_NONE check because there is a _Lxx/_Exx prepared in
 * the AML tables. This normally indicates a feature gap in Linux, thus
 * instead of providing endless quirk tables, we provide a boot parameter
 * for those who want this quirk. For example, if the users want to prevent
 * the GPE flooding for GPE 00, they need to specify the following boot
 * parameter:
 *   acpi_mask_gpe=0x00
 * Note, the parameter can be a list (see bitmap_parselist() for the details).
 * The masking status can be modified by the following runtime controlling
 * interface:
 *   echo unmask > /sys/firmware/acpi/interrupts/gpe00
 */
#define ACPI_MASKABLE_GPE_MAX
static DECLARE_BITMAP(acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) __initdata;

static int __init acpi_gpe_set_masked_gpes(char *val)
{}
__setup();

void __init acpi_gpe_apply_masked_gpes(void)
{}

void acpi_irq_stats_init(void)
{}

static void __exit interrupt_stats_exit(void)
{}

static ssize_t pm_profile_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{}

static const struct kobj_attribute pm_profile_attr =;

static ssize_t enabled_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{}

static ssize_t enabled_store(struct kobject *kobj, struct kobj_attribute *attr,
			     const char *buf, size_t size)
{}

static struct kobj_attribute hotplug_enabled_attr =;

static struct attribute *hotplug_profile_attrs[] =;
ATTRIBUTE_GROUPS();

static const struct kobj_type acpi_hotplug_profile_ktype =;

void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
				    const char *name)
{}

static ssize_t force_remove_show(struct kobject *kobj,
				 struct kobj_attribute *attr, char *buf)
{}

static ssize_t force_remove_store(struct kobject *kobj,
				  struct kobj_attribute *attr,
				  const char *buf, size_t size)
{}

static const struct kobj_attribute force_remove_attr =;

int __init acpi_sysfs_init(void)
{}