[SPARC64]: Kill all external references to sp_banks[]

Thus, we can mark sp_banks[] static in arch/sparc64/mm/init.c

Signed-off-by: David S. Miller <davem@davemloft.net>

+29 -47
+6 -27
arch/sparc64/kernel/traps.c
··· 757 757 ecache_flush_size = (2 * largest_size); 758 758 ecache_flush_linesize = smallest_linesize; 759 759 760 - /* Discover a physically contiguous chunk of physical 761 - * memory in 'sp_banks' of size ecache_flush_size calculated 762 - * above. Store the physical base of this area at 763 - * ecache_flush_physbase. 764 - */ 765 - for (node = 0; ; node++) { 766 - if (sp_banks[node].num_bytes == 0) 767 - break; 768 - if (sp_banks[node].num_bytes >= ecache_flush_size) { 769 - ecache_flush_physbase = sp_banks[node].base_addr; 770 - break; 771 - } 772 - } 760 + ecache_flush_physbase = find_ecache_flush_span(ecache_flush_size); 773 761 774 - /* Note: Zero would be a valid value of ecache_flush_physbase so 775 - * don't use that as the success test. :-) 776 - */ 777 - if (sp_banks[node].num_bytes == 0) { 762 + if (ecache_flush_physbase == ~0UL) { 778 763 prom_printf("cheetah_ecache_flush_init: Cannot find %d byte " 779 - "contiguous physical memory.\n", ecache_flush_size); 764 + "contiguous physical memory.\n", 765 + ecache_flush_size); 780 766 prom_halt(); 781 767 } 782 768 ··· 1331 1345 /* Return non-zero if PADDR is a valid physical memory address. */ 1332 1346 static int cheetah_check_main_memory(unsigned long paddr) 1333 1347 { 1334 - int i; 1348 + unsigned long vaddr = PAGE_OFFSET + paddr; 1335 1349 1336 - for (i = 0; ; i++) { 1337 - if (sp_banks[i].num_bytes == 0) 1338 - break; 1339 - if (paddr >= sp_banks[i].base_addr && 1340 - paddr < (sp_banks[i].base_addr + sp_banks[i].num_bytes)) 1341 - return 1; 1342 - } 1343 - return 0; 1350 + return kern_addr_valid(vaddr); 1344 1351 } 1345 1352 1346 1353 void cheetah_cee_handler(struct pt_regs *regs, unsigned long afsr, unsigned long afar)
-2
arch/sparc64/mm/fault.c
··· 32 32 33 33 #define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0])) 34 34 35 - extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; 36 - 37 35 /* 38 36 * To debug kernel to catch accesses to certain virtual/physical addresses. 39 37 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
+22 -1
arch/sparc64/mm/init.c
··· 41 41 42 42 extern void device_scan(void); 43 43 44 - struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; 44 + struct sparc_phys_banks { 45 + unsigned long base_addr; 46 + unsigned long num_bytes; 47 + }; 48 + 49 + #define SPARC_PHYS_BANKS 32 50 + 51 + static struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; 45 52 46 53 unsigned long *sparc64_valid_addr_bitmap __read_mostly; 47 54 ··· 1431 1424 PAGE_OFFSET + phys_end); 1432 1425 } 1433 1426 #endif 1427 + 1428 + unsigned long __init find_ecache_flush_span(unsigned long size) 1429 + { 1430 + unsigned long i; 1431 + 1432 + for (i = 0; ; i++) { 1433 + if (sp_banks[i].num_bytes == 0) 1434 + break; 1435 + if (sp_banks[i].num_bytes >= size) 1436 + return sp_banks[i].base_addr; 1437 + } 1438 + 1439 + return ~0UL; 1440 + } 1434 1441 1435 1442 static void __init prom_probe_memory(void) 1436 1443 {
-17
include/asm-sparc64/page.h
··· 140 140 #define virt_to_phys __pa 141 141 #define phys_to_virt __va 142 142 143 - /* The following structure is used to hold the physical 144 - * memory configuration of the machine. This is filled in 145 - * probe_memory() and is later used by mem_init() to set up 146 - * mem_map[]. We statically allocate SPARC_PHYS_BANKS of 147 - * these structs, this is arbitrary. The entry after the 148 - * last valid one has num_bytes==0. 149 - */ 150 - 151 - struct sparc_phys_banks { 152 - unsigned long base_addr; 153 - unsigned long num_bytes; 154 - }; 155 - 156 - #define SPARC_PHYS_BANKS 32 157 - 158 - extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; 159 - 160 143 #endif /* !(__ASSEMBLY__) */ 161 144 162 145 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
+1
include/asm-sparc64/pgtable.h
··· 342 342 extern pmd_t swapper_low_pmd_dir[2048]; 343 343 344 344 extern void paging_init(void); 345 + extern unsigned long find_ecache_flush_span(unsigned long size); 345 346 346 347 /* These do nothing with the way I have things setup. */ 347 348 #define mmu_lockarea(vaddr, len) (vaddr)