linux/lib/fw_table.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  fw_tables.c - Parsing support for ACPI and ACPI-like tables provided by
 *                platform or device firmware
 *
 *  Copyright (C) 2001 Paul Diefenbaugh <[email protected]>
 *  Copyright (C) 2023 Intel Corp.
 */
#include <linux/errno.h>
#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/fw_table.h>

enum acpi_subtable_type {};

struct acpi_subtable_entry {};

static unsigned long __init_or_fwtbl_lib
acpi_get_entry_type(struct acpi_subtable_entry *entry)
{}

static unsigned long __init_or_fwtbl_lib
acpi_get_entry_length(struct acpi_subtable_entry *entry)
{}

static unsigned long __init_or_fwtbl_lib
acpi_get_subtable_header_length(struct acpi_subtable_entry *entry)
{}

static enum acpi_subtable_type __init_or_fwtbl_lib
acpi_get_subtable_type(char *id)
{}

static unsigned long __init_or_fwtbl_lib
acpi_table_get_length(enum acpi_subtable_type type,
		      union fw_table_header *header)
{}

static __init_or_fwtbl_lib int call_handler(struct acpi_subtable_proc *proc,
					    union acpi_subtable_headers *hdr,
					    unsigned long end)
{}

/**
 * acpi_parse_entries_array - for each proc_num find a suitable subtable
 *
 * @id: table id (for debugging purposes)
 * @table_size: size of the root table
 * @max_length: maximum size of the table (ignore if 0)
 * @table_header: where does the table start?
 * @proc: array of acpi_subtable_proc struct containing entry id
 *        and associated handler with it
 * @proc_num: how big proc is?
 * @max_entries: how many entries can we process?
 *
 * For each proc_num find a subtable with proc->id and run proc->handler
 * on it. Assumption is that there's only single handler for particular
 * entry id.
 *
 * The table_size is not the size of the complete ACPI table (the length
 * field in the header struct), but only the size of the root table; i.e.,
 * the offset from the very first byte of the complete ACPI table, to the
 * first byte of the very first subtable.
 *
 * On success returns sum of all matching entries for all proc handlers.
 * Otherwise, -ENODEV or -EINVAL is returned.
 */
int __init_or_fwtbl_lib
acpi_parse_entries_array(char *id, unsigned long table_size,
			 union fw_table_header *table_header,
			 unsigned long max_length,
			 struct acpi_subtable_proc *proc,
			 int proc_num, unsigned int max_entries)
{}

int __init_or_fwtbl_lib
cdat_table_parse(enum acpi_cdat_type type,
		 acpi_tbl_entry_handler_arg handler_arg,
		 void *arg,
		 struct acpi_table_cdat *table_header,
		 unsigned long length)
{}
EXPORT_SYMBOL_FWTBL_LIB();