vserver 1.9.5.x5
[linux-2.6.git] / drivers / acpi / numa.c
index 0646b29..9bfce46 100644 (file)
@@ -22,7 +22,7 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
  */
-
+#include <linux/module.h>
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -51,6 +51,7 @@ acpi_table_print_srat_entry (
        switch (header->type) {
 
        case ACPI_SRAT_PROCESSOR_AFFINITY:
+#ifdef ACPI_DEBUG_OUTPUT
        {
                struct acpi_table_processor_affinity *p =
                        (struct acpi_table_processor_affinity*) header;
@@ -58,9 +59,11 @@ acpi_table_print_srat_entry (
                       p->apic_id, p->lsapic_eid, p->proximity_domain,
                       p->flags.enabled?"enabled":"disabled"));
        }
+#endif /* ACPI_DEBUG_OUTPUT */
                break;
 
        case ACPI_SRAT_MEMORY_AFFINITY:
+#ifdef ACPI_DEBUG_OUTPUT
        {
                struct acpi_table_memory_affinity *p =
                        (struct acpi_table_memory_affinity*) header;
@@ -70,6 +73,7 @@ acpi_table_print_srat_entry (
                       p->flags.enabled ? "enabled" : "disabled",
                       p->flags.hot_pluggable ? " hot-pluggable" : ""));
        }
+#endif /* ACPI_DEBUG_OUTPUT */
                break;
 
        default:
@@ -94,8 +98,6 @@ acpi_parse_slit (unsigned long phys_addr, unsigned long size)
        /* downcast just for %llu vs %lu for i386/ia64  */
        localities = (u32) slit->localities;
 
-       printk(KERN_INFO PREFIX "SLIT localities %ux%u\n", localities, localities);
-
        acpi_numa_slit_init(slit);
 
        return 0;
@@ -103,7 +105,9 @@ acpi_parse_slit (unsigned long phys_addr, unsigned long size)
 
 
 static int __init
-acpi_parse_processor_affinity (acpi_table_entry_header *header)
+acpi_parse_processor_affinity (
+       acpi_table_entry_header *header,
+       const unsigned long end)
 {
        struct acpi_table_processor_affinity *processor_affinity;
 
@@ -121,7 +125,9 @@ acpi_parse_processor_affinity (acpi_table_entry_header *header)
 
 
 static int __init
-acpi_parse_memory_affinity (acpi_table_entry_header *header)
+acpi_parse_memory_affinity (
+       acpi_table_entry_header *header,
+       const unsigned long end)
 {
        struct acpi_table_memory_affinity *memory_affinity;
 
@@ -148,8 +154,6 @@ acpi_parse_srat (unsigned long phys_addr, unsigned long size)
 
        srat = (struct acpi_table_srat *) __va(phys_addr);
 
-       printk(KERN_INFO PREFIX "SRAT revision %d\n", srat->table_revision);
-
        return 0;
 }
 
@@ -180,18 +184,30 @@ acpi_numa_init()
                result = acpi_table_parse_srat(ACPI_SRAT_MEMORY_AFFINITY,
                                               acpi_parse_memory_affinity,
                                               NR_NODE_MEMBLKS);        // IA64 specific
-       } else {
-               /* FIXME */
-               printk("Warning: acpi_table_parse(ACPI_SRAT) returned %d!\n",result);
        }
 
        /* SLIT: System Locality Information Table */
        result = acpi_table_parse(ACPI_SLIT, acpi_parse_slit);
-       if (result < 1) {
-               /* FIXME */
-               printk("Warning: acpi_table_parse(ACPI_SLIT) returned %d!\n",result);
-       }
 
        acpi_numa_arch_fixup();
        return 0;
 }
+
+int
+acpi_get_pxm(acpi_handle h)
+{
+       unsigned long pxm;
+       acpi_status status;
+       acpi_handle handle;
+       acpi_handle phandle = h;
+
+       do {
+               handle = phandle;
+               status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
+               if (ACPI_SUCCESS(status))
+                       return (int)pxm;
+               status = acpi_get_parent(handle, &phandle);
+       } while(ACPI_SUCCESS(status));
+       return -1;
+}
+EXPORT_SYMBOL(acpi_get_pxm);