コード例 #1
0
ファイル: tables.c プロジェクト: 020gzh/linux
int __init
acpi_table_parse_entries_array(char *id,
			 unsigned long table_size,
			 struct acpi_subtable_proc *proc, int proc_num,
			 unsigned int max_entries)
{
	struct acpi_table_header *table_header = NULL;
	acpi_size tbl_size;
	int count;
	u32 instance = 0;

	if (acpi_disabled)
		return -ENODEV;

	if (!id)
		return -EINVAL;

	if (!strncmp(id, ACPI_SIG_MADT, 4))
		instance = acpi_apic_instance;

	acpi_get_table_with_size(id, instance, &table_header, &tbl_size);
	if (!table_header) {
		pr_warn("%4.4s not present\n", id);
		return -ENODEV;
	}

	count = acpi_parse_entries_array(id, table_size, table_header,
			proc, proc_num, max_entries);

	early_acpi_os_unmap_memory((char *)table_header, tbl_size);
	return count;
}
コード例 #2
0
int __init
acpi_parse_entries(char *id,
			unsigned long table_size,
			acpi_tbl_entry_handler handler,
			struct acpi_table_header *table_header,
			int entry_id, unsigned int max_entries)
{
	struct acpi_subtable_proc proc = {
		.id		= entry_id,
		.handler	= handler,
	};

	return acpi_parse_entries_array(id, table_size, table_header,
			&proc, 1, max_entries);
}