Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / i386 / kernel / srat.c
index 7b3b27d..52b3ed5 100644 (file)
@@ -137,8 +137,8 @@ static void __init parse_memory_affinity_structure (char *sratp)
                 "enabled and removable" : "enabled" ) );
 }
 
-#if MAX_NR_ZONES != 3
-#error "MAX_NR_ZONES != 3, chunk_to_zone requires review"
+#if MAX_NR_ZONES != 4
+#error "MAX_NR_ZONES != 4, chunk_to_zone requires review"
 #endif
 /* Take a chunk of pages from page frame cstart to cend and count the number
  * of pages in each zone, returned via zones[].
@@ -213,12 +213,18 @@ static __init void node_read_chunk(int nid, struct node_memory_chunk_s *memory_c
                node_end_pfn[nid] = memory_chunk->end_pfn;
 }
 
+static u8 pxm_to_nid_map[MAX_PXM_DOMAINS];/* _PXM to logical node ID map */
+
+int pxm_to_node(int pxm)
+{
+       return pxm_to_nid_map[pxm];
+}
+
 /* Parse the ACPI Static Resource Affinity Table */
 static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
 {
        u8 *start, *end, *p;
        int i, j, nid;
-       u8 pxm_to_nid_map[MAX_PXM_DOMAINS];/* _PXM to logical node ID map */
        u8 nid_to_pxm_map[MAX_NUMNODES];/* logical node ID to _PXM map */
 
        start = (u8 *)(&(sratp->reserved) + 1); /* skip header */
@@ -321,7 +327,12 @@ int __init get_memcfg_from_srat(void)
        int tables = 0;
        int i = 0;
 
-       acpi_find_root_pointer(ACPI_PHYSICAL_ADDRESSING, rsdp_address);
+       if (ACPI_FAILURE(acpi_find_root_pointer(ACPI_PHYSICAL_ADDRESSING,
+                                               rsdp_address))) {
+               printk("%s: System description tables not found\n",
+                      __FUNCTION__);
+               goto out_err;
+       }
 
        if (rsdp_address->pointer_type == ACPI_PHYSICAL_POINTER) {
                printk("%s: assigning address to rsdp\n", __FUNCTION__);