summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/mm')
-rw-r--r--arch/sparc64/mm/fault.c2
-rw-r--r--arch/sparc64/mm/init.c23
2 files changed, 22 insertions, 3 deletions
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 80793d61f31..31fbc67719a 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -32,8 +32,6 @@
#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
-extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
-
/*
* To debug kernel to catch accesses to certain virtual/physical addresses.
* Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 63a7b9bafaf..48851a2e4fe 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -41,7 +41,14 @@
extern void device_scan(void);
-struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
+struct sparc_phys_banks {
+ unsigned long base_addr;
+ unsigned long num_bytes;
+};
+
+#define SPARC_PHYS_BANKS 32
+
+static struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
unsigned long *sparc64_valid_addr_bitmap __read_mostly;
@@ -1425,6 +1432,20 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
}
#endif
+unsigned long __init find_ecache_flush_span(unsigned long size)
+{
+ unsigned long i;
+
+ for (i = 0; ; i++) {
+ if (sp_banks[i].num_bytes == 0)
+ break;
+ if (sp_banks[i].num_bytes >= size)
+ return sp_banks[i].base_addr;
+ }
+
+ return ~0UL;
+}
+
static void __init prom_probe_memory(void)
{
struct linux_mlist_p1275 *mlist;