void __init acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) { unsigned long paddr, size; int pxm; struct node_memblk_s *p, *q, *pend; pxm = get_memory_proximity_domain(ma); /* fill node memory chunk structure */ paddr = ma->base_address; size = ma->length; /* Ignore disabled entries */ if (!(ma->flags & ACPI_SRAT_MEM_ENABLED)) return; /* record this node in proximity bitmap */ pxm_bit_set(pxm); /* Insertion sort based on base address */ pend = &node_memblk[num_node_memblks]; for (p = &node_memblk[0]; p < pend; p++) { if (paddr < p->start_paddr) break; } if (p < pend) { for (q = pend - 1; q >= p; q--) *(q + 1) = *q; } p->start_paddr = paddr; p->size = size; p->nid = pxm; num_node_memblks++; }
void __init acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) { unsigned long paddr, size; int pxm; struct node_memblk_s *p, *q, *pend; pxm = get_memory_proximity_domain(ma); paddr = ma->base_address; size = ma->length; if (!(ma->flags & ACPI_SRAT_MEM_ENABLED)) return; pxm_bit_set(pxm); pend = &node_memblk[num_node_memblks]; for (p = &node_memblk[0]; p < pend; p++) { if (paddr < p->start_paddr) break; } if (p < pend) { for (q = pend - 1; q >= p; q--) *(q + 1) = *q; } p->start_paddr = paddr; p->size = size; p->nid = pxm; num_node_memblks++; }