Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48687
b: refs/heads/master
c: 6eb87fe
h: refs/heads/master
i:
  48685: b0cf0fa
  48683: 58848e1
  48679: a3b89e6
  48671: 4cc991f
v: v3
  • Loading branch information
Len Brown committed Feb 13, 2007
1 parent defaf44 commit 5399f22
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a8765a84c31ea51baf1f6c78116cd877bd8cd64
refs/heads/master: 6eb87fed52b7f6ac200eaa649cc3221e239d0113
8 changes: 1 addition & 7 deletions trunk/drivers/acpi/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS]
int __cpuinitdata node_to_pxm_map[MAX_NUMNODES]
= { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };

extern int __init acpi_table_parse_madt_family(char *id,
unsigned long madt_size,
int entry_id,
acpi_table_entry_handler handler,
unsigned int max_entries);

int __cpuinit pxm_to_node(int pxm)
{
if (pxm < 0)
Expand Down Expand Up @@ -210,7 +204,7 @@ int __init
acpi_table_parse_srat(enum acpi_srat_type id,
acpi_table_entry_handler handler, unsigned int max_entries)
{
return acpi_table_parse_madt_family(ACPI_SIG_SRAT,
return acpi_table_parse_entries(ACPI_SIG_SRAT,
sizeof(struct acpi_table_srat), id,
handler, max_entries);
}
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/acpi/tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,40 +170,40 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header * header)


int __init
acpi_table_parse_madt_family(char *id,
unsigned long madt_size,
acpi_table_parse_entries(char *id,
unsigned long table_size,
int entry_id,
acpi_table_entry_handler handler,
unsigned int max_entries)
{
struct acpi_table_header *madt = NULL;
struct acpi_table_header *table_header = NULL;
struct acpi_subtable_header *entry;
unsigned int count = 0;
unsigned long madt_end;
unsigned long table_end;

if (!handler)
return -EINVAL;

/* Locate the MADT (if exists). There should only be one. */
acpi_get_table(id, 0, &madt);
/* Locate the table (if exists). There should only be one. */
acpi_get_table(id, 0, &table_header);

if (!madt) {
if (!table_header) {
printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
return -ENODEV;
}

madt_end = (unsigned long)madt + madt->length;
table_end = (unsigned long)table_header + table_header->length;

/* Parse all entries looking for a match. */

entry = (struct acpi_subtable_header *)
((unsigned long)madt + madt_size);
((unsigned long)table_header + table_size);

while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
madt_end) {
table_end) {
if (entry->type == entry_id
&& (!max_entries || count++ < max_entries))
if (handler(entry, madt_end))
if (handler(entry, table_end))
return -EINVAL;

entry = (struct acpi_subtable_header *)
Expand All @@ -221,7 +221,7 @@ int __init
acpi_table_parse_madt(enum acpi_madt_type id,
acpi_table_entry_handler handler, unsigned int max_entries)
{
return acpi_table_parse_madt_family(ACPI_SIG_MADT,
return acpi_table_parse_entries(ACPI_SIG_MADT,
sizeof(struct acpi_table_madt), id,
handler, max_entries);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ int acpi_numa_init (void);

int acpi_table_init (void);
int acpi_table_parse (char *id, acpi_table_handler handler);
int __init acpi_table_parse_entries(char *id, unsigned long table_size,
int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
int acpi_table_parse_srat (enum acpi_srat_type id, acpi_table_entry_handler handler, unsigned int max_entries);
int acpi_parse_mcfg (struct acpi_table_header *header);
Expand Down

0 comments on commit 5399f22

Please sign in to comment.