Skip to content

Commit

Permalink
ACPICA: Remove duplicate table manager
Browse files Browse the repository at this point in the history
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Alexey Starikovskiy authored and Len Brown committed Feb 3, 2007
1 parent a7a22fa commit ceb6c46
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 461 deletions.
40 changes: 20 additions & 20 deletions arch/i386/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,24 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
struct acpi_table_mcfg_config *pci_mmcfg_config;
int pci_mmcfg_config_num;

int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
int __init acpi_parse_mcfg(struct acpi_table_header *header)
{
struct acpi_table_mcfg *mcfg;
unsigned long i;
int config_size;

if (!phys_addr || !size)
if (!header)
return -EINVAL;

mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size);
mcfg = (struct acpi_table_mcfg *)header;
if (!mcfg) {
printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
return -ENODEV;
}

/* how many config structures do we have */
pci_mmcfg_config_num = 0;
i = size - sizeof(struct acpi_table_mcfg);
i = header->length - sizeof(struct acpi_table_mcfg);
while (i >= sizeof(struct acpi_table_mcfg_config)) {
++pci_mmcfg_config_num;
i -= sizeof(struct acpi_table_mcfg_config);
Expand Down Expand Up @@ -220,14 +220,14 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
#endif /* CONFIG_PCI_MMCONFIG */

#ifdef CONFIG_X86_LOCAL_APIC
static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
static int __init acpi_parse_madt(struct acpi_table_header *header)
{
struct acpi_table_madt *madt = NULL;

if (!phys_addr || !size || !cpu_has_apic)
if (!header|| !cpu_has_apic)
return -EINVAL;

madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
madt = (struct acpi_table_madt *)header;
if (!madt) {
printk(KERN_WARNING PREFIX "Unable to map MADT\n");
return -ENODEV;
Expand Down Expand Up @@ -619,14 +619,14 @@ acpi_scan_rsdp(unsigned long start, unsigned long length)
return 0;
}

static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)
static int __init acpi_parse_sbf(struct acpi_table_header *header)
{
struct acpi_table_sbf *sb;

if (!phys_addr || !size)
if (!header)
return -EINVAL;

sb = (struct acpi_table_sbf *)__acpi_map_table(phys_addr, size);
sb = (struct acpi_table_sbf *)header;
if (!sb) {
printk(KERN_WARNING PREFIX "Unable to map SBF\n");
return -ENODEV;
Expand All @@ -639,16 +639,16 @@ static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)

#ifdef CONFIG_HPET_TIMER

static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
static int __init acpi_parse_hpet(struct acpi_table_header *header)
{
struct acpi_table_hpet *hpet_tbl;
struct resource *hpet_res;
resource_size_t res_start;

if (!phys || !size)
if (!header)
return -EINVAL;

hpet_tbl = (struct acpi_table_hpet *)__acpi_map_table(phys, size);
hpet_tbl = (struct acpi_table_hpet *)header;
if (!hpet_tbl) {
printk(KERN_WARNING PREFIX "Unable to map HPET\n");
return -ENODEV;
Expand Down Expand Up @@ -707,11 +707,11 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
extern u32 pmtmr_ioport;
#endif

static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
static int __init acpi_parse_fadt(struct acpi_table_header *header)
{
struct fadt_descriptor *fadt = NULL;

fadt = (struct fadt_descriptor *)__acpi_map_table(phys, size);
fadt = (struct fadt_descriptor *)header;
if (!fadt) {
printk(KERN_WARNING PREFIX "Unable to map FADT\n");
return 0;
Expand Down Expand Up @@ -901,7 +901,7 @@ static void __init acpi_process_madt(void)
#ifdef CONFIG_X86_LOCAL_APIC
int count, error;

count = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
count = acpi_table_parse("APIC", acpi_parse_madt);
if (count >= 1) {

/*
Expand Down Expand Up @@ -1197,7 +1197,7 @@ int __init acpi_boot_table_init(void)
return error;
}

acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
acpi_table_parse("BOOT", acpi_parse_sbf);

/*
* blacklist may disable ACPI entirely
Expand Down Expand Up @@ -1225,19 +1225,19 @@ int __init acpi_boot_init(void)
if (acpi_disabled && !acpi_ht)
return 1;

acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
acpi_table_parse("BOOT", acpi_parse_sbf);

/*
* set sci_int and PM timer address
*/
acpi_table_parse(ACPI_FADT, acpi_parse_fadt);
acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt);

/*
* Process the Multiple APIC Description Table (MADT), if present
*/
acpi_process_madt();

acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
acpi_table_parse("HPET", acpi_parse_hpet);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/i386/kernel/acpi/earlyquirk.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

static int nvidia_hpet_detected __initdata;

static int __init nvidia_hpet_check(unsigned long phys, unsigned long size)
static int __init nvidia_hpet_check(struct acpi_table_header *header)
{
nvidia_hpet_detected = 1;
return 0;
Expand All @@ -30,7 +30,7 @@ static int __init check_bridge(int vendor, int device)
is enabled. */
if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) {
nvidia_hpet_detected = 0;
acpi_table_parse(ACPI_HPET, nvidia_hpet_check);
acpi_table_parse("HPET", nvidia_hpet_check);
if (nvidia_hpet_detected == 0) {
acpi_skip_timer_override = 1;
printk(KERN_INFO "Nvidia board "
Expand Down
9 changes: 0 additions & 9 deletions arch/i386/mach-es7000/es7000.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@ struct es7000_oem_table {
};

#ifdef CONFIG_ACPI
struct acpi_table_sdt {
unsigned long pa;
unsigned long count;
struct {
unsigned long pa;
enum acpi_table_id id;
unsigned long size;
} entry[50];
};

struct oem_table {
struct acpi_table_header Header;
Expand Down
53 changes: 8 additions & 45 deletions arch/i386/mach-es7000/es7000plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,51 +160,14 @@ parse_unisys_oem (char *oemptr)
int __init
find_unisys_acpi_oem_table(unsigned long *oem_addr)
{
struct acpi_table_rsdp *rsdp = NULL;
unsigned long rsdp_phys = 0;
struct acpi_table_header *header = NULL;
int i;
struct acpi_table_sdt sdt;

rsdp_phys = acpi_find_rsdp();
rsdp = __va(rsdp_phys);
if (rsdp->rsdt_address) {
struct acpi_table_rsdt *mapped_rsdt = NULL;
sdt.pa = rsdp->rsdt_address;

header = (struct acpi_table_header *)
__acpi_map_table(sdt.pa, sizeof(struct acpi_table_header));
if (!header)
return -ENODEV;

sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 3;
mapped_rsdt = (struct acpi_table_rsdt *)
__acpi_map_table(sdt.pa, header->length);
if (!mapped_rsdt)
return -ENODEV;

header = &mapped_rsdt->header;

for (i = 0; i < sdt.count; i++)
sdt.entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
};
for (i = 0; i < sdt.count; i++) {

header = (struct acpi_table_header *)
__acpi_map_table(sdt.entry[i].pa,
sizeof(struct acpi_table_header));
if (!header)
continue;
if (!strncmp((char *) &header->signature, "OEM1", 4)) {
if (!strncmp((char *) &header->oem_id, "UNISYS", 6)) {
void *addr;
struct oem_table *t;
acpi_table_print(header, sdt.entry[i].pa);
t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length);
addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize);
*oem_addr = (unsigned long) addr;
return 0;
}
struct acpi_table_header *header = NULL;
int i = 0;
while (ACPI_SUCCESS(acpi_get_table("OEM1", i++, &header))) {
if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) {
struct oem_table *t = (struct oem_table *)header;
*oem_addr = (unsigned long)__acpi_map_table(t->OEMTableAddr,
t->OEMTableSize);
return 0;
}
}
return -1;
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/pci/mmconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void __init pci_mmcfg_init(int type)
if ((pci_probe & PCI_PROBE_MMCONF) == 0)
return;

acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
acpi_table_parse("MCFG", acpi_parse_mcfg);
if ((pci_mmcfg_config_num == 0) ||
(pci_mmcfg_config == NULL) ||
(pci_mmcfg_config[0].base_address == 0))
Expand Down
Loading

0 comments on commit ceb6c46

Please sign in to comment.