···757 ecache_flush_size = (2 * largest_size);758 ecache_flush_linesize = smallest_linesize;759760- /* Discover a physically contiguous chunk of physical761- * memory in 'sp_banks' of size ecache_flush_size calculated762- * above. Store the physical base of this area at763- * 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- }773774- /* Note: Zero would be a valid value of ecache_flush_physbase so775- * don't use that as the success test. :-)776- */777- if (sp_banks[node].num_bytes == 0) {778 prom_printf("cheetah_ecache_flush_init: Cannot find %d byte "779- "contiguous physical memory.\n", ecache_flush_size);0780 prom_halt();781 }782···1331/* Return non-zero if PADDR is a valid physical memory address. */1332static int cheetah_check_main_memory(unsigned long paddr)1333{1334- int i;13351336- 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;1344}13451346void cheetah_cee_handler(struct pt_regs *regs, unsigned long afsr, unsigned long afar)
···757 ecache_flush_size = (2 * largest_size);758 ecache_flush_linesize = smallest_linesize;759760+ ecache_flush_physbase = find_ecache_flush_span(ecache_flush_size);000000000000761762+ if (ecache_flush_physbase == ~0UL) {000763 prom_printf("cheetah_ecache_flush_init: Cannot find %d byte "764+ "contiguous physical memory.\n",765+ ecache_flush_size);766 prom_halt();767 }768···1345/* Return non-zero if PADDR is a valid physical memory address. */1346static int cheetah_check_main_memory(unsigned long paddr)1347{1348+ unsigned long vaddr = PAGE_OFFSET + paddr;13491350+ return kern_addr_valid(vaddr);00000001351}13521353void cheetah_cee_handler(struct pt_regs *regs, unsigned long afsr, unsigned long afar)
-2
arch/sparc64/mm/fault.c
···3233#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))3435-extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];36-37/*38 * To debug kernel to catch accesses to certain virtual/physical addresses.39 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
···3233#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))340035/*36 * To debug kernel to catch accesses to certain virtual/physical addresses.37 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
···4142extern void device_scan(void);4344+struct sparc_phys_banks {45+ unsigned long base_addr;46+ unsigned long num_bytes;47+};48+49+#define SPARC_PHYS_BANKS 3250+51+static struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];5253unsigned long *sparc64_valid_addr_bitmap __read_mostly;54···1424 PAGE_OFFSET + phys_end);1425}1426#endif1427+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+}14411442static void __init prom_probe_memory(void)1443{
-17
include/asm-sparc64/page.h
···140#define virt_to_phys __pa141#define phys_to_virt __va142143-/* The following structure is used to hold the physical144- * memory configuration of the machine. This is filled in145- * probe_memory() and is later used by mem_init() to set up146- * mem_map[]. We statically allocate SPARC_PHYS_BANKS of147- * these structs, this is arbitrary. The entry after the148- * 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 32157-158-extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];159-160#endif /* !(__ASSEMBLY__) */161162#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
···342extern pmd_t swapper_low_pmd_dir[2048];343344extern void paging_init(void);0345346/* These do nothing with the way I have things setup. */347#define mmu_lockarea(vaddr, len) (vaddr)
···342extern pmd_t swapper_low_pmd_dir[2048];343344extern void paging_init(void);345+extern unsigned long find_ecache_flush_span(unsigned long size);346347/* These do nothing with the way I have things setup. */348#define mmu_lockarea(vaddr, len) (vaddr)