#define pr_fmt(fmt) "ACPI configfs: " fmt
#include <linux/module.h>
#include <linux/configfs.h>
#include "acpica/accommon.h"
#include "acpica/actables.h"
static struct config_group *acpi_table_group;
struct acpi_table_header *header;
static ssize_t acpi_table_aml_write(struct config_item *cfg,
const void *data, size_t size)
const struct acpi_table_header *header = data;
struct acpi_table *table;
table = container_of(cfg, struct acpi_table, cfg);
pr_err("table already loaded\n");
if (header->length != size) {
pr_err("invalid table length\n");
if (memcmp(header->signature, ACPI_SIG_SSDT, 4)) {
pr_err("invalid table signature\n");
table = container_of(cfg, struct acpi_table, cfg);
table->header = kmemdup(header, header->length, GFP_KERNEL);
ACPI_INFO(("Host-directed Dynamic ACPI Table Load:"));
ret = acpi_tb_install_and_load_table(
ACPI_PTR_TO_PHYSADDR(table->header),
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE,