Skip to contentSkip to conversation

Cleanup i386 discontigmem [1/2]

PATCH Martin J. Bligh 1 participant 1 message Aug 23, 2002 Memory management

lore
Share & tools
lore
#0 lore raw

This mainly changes the PLAT_MY_MACRO_IS_ALL_CAPS() stuff to be normal_macro(), and takes out some unnecessary redirection of function names. No functionality changes, nothing touched outside i386 discontigmem ... just makes code readable. Rumour has it that the PLAT_* stuff came from IRIX - I don't see that as a good reason to make the Linux code unreadable. Tested on 16-way NUMA-Q.

Please apply to your tree, and feed upwards ;-)

M.

----------------------

arch/i386/kernel/numaq.c +3 -3
diff -urN -X /home/mbligh/.diff.exclude 2.5.31-22-pmd_populate/arch/i386/kernel/numaq.c 2.5.31-25-clean_plat/arch/i386/kernel/numaq.c
@@ -83,7 +83,7 @@
 #define MB_TO_ELEMENT(x) (x >> ELEMENT_REPRESENTS)
 #define PA_TO_MB(pa) (pa >> 20) 	/* assumption: a physical address is in bytes */
 
-int numaqpa_to_nid(u64 pa)
+int pa_to_nid(u64 pa)
 {
 	int nid;
 	
@@ -96,9 +96,9 @@
 	return nid;
 }
 
-int numaqpfn_to_nid(unsigned long pfn)
+int pfn_to_nid(unsigned long pfn)
 {
-	return numaqpa_to_nid(((u64)pfn) << PAGE_SHIFT);
+	return pa_to_nid(((u64)pfn) << PAGE_SHIFT);
 }
 
 /*
arch/i386/mm/discontig.c +4 -4
diff -urN -X /home/mbligh/.diff.exclude 2.5.31-22-pmd_populate/arch/i386/mm/discontig.c 2.5.31-25-clean_plat/arch/i386/mm/discontig.c
@@ -39,7 +39,7 @@
 	unsigned long max_pfn;
 };
 
-struct plat_pglist_data *plat_node_data[MAX_NUMNODES];
+struct pglist_data *node_data[MAX_NUMNODES];
 bootmem_data_t plat_node_bdata;
 struct pfns plat_node_bootpfns[MAX_NUMNODES];
 
@@ -74,8 +74,8 @@
 	}
 	plat_node_bootpfns[nid].max_pfn = end;
 
-	node_datasz = PFN_UP(sizeof(struct plat_pglist_data));
-	PLAT_NODE_DATA(nid) = (struct plat_pglist_data *)(__va(min_low_pfn << PAGE_SHIFT));
+	node_datasz = PFN_UP(sizeof(struct pglist_data));
+	NODE_DATA(nid) = (struct pglist_data *)(__va(min_low_pfn << PAGE_SHIFT));
 	min_low_pfn += node_datasz;
 }
 
@@ -289,7 +289,7 @@
 	num_physpages = highend_pfn;
 
 	for (nid = 0; nid < numnodes; nid++) {
-		lmax_mapnr = PLAT_NODE_DATA_STARTNR(nid) + PLAT_NODE_DATA_SIZE(nid);
+		lmax_mapnr = node_startnr(nid) + node_size(nid);
 		if (lmax_mapnr > max_mapnr) {
 			max_mapnr = lmax_mapnr;
 		}
include/asm-i386/mmzone.h +15 -38

85 lines not on this page · raw message

include/asm-i386/numaq.h +2 -4
diff -urN -X /home/mbligh/.diff.exclude 2.5.31-22-pmd_populate/include/asm-i386/numaq.h 2.5.31-25-clean_plat/include/asm-i386/numaq.h
@@ -38,14 +38,12 @@
 #define MAX_ELEMENTS 256
 #define ELEMENT_REPRESENTS 8 /* 256 Mb */
 
-#define PHYSADDR_TO_NID(pa) numaqpa_to_nid(pa)
-#define PFN_TO_NID(pa) numaqpfn_to_nid(pa)
 #define MAX_NUMNODES		8
 #ifdef CONFIG_NUMA
 #define _cpu_to_node(cpu) (cpu_to_logical_apicid(cpu) >> 4)
 #endif /* CONFIG_NUMA */
-extern int numaqpa_to_nid(u64);
-extern int numaqpfn_to_nid(unsigned long);
+extern int pa_to_nid(u64);
+extern int pfn_to_nid(unsigned long);
 extern void get_memcfg_numaq(void);
 #define get_memcfg_numa() get_memcfg_numaq()
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/