aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/mm/fault.c')
-rw-r--r--arch/sparc/mm/fault.c61
1 files changed, 6 insertions, 55 deletions
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index f25876a56fe..abd50795a7b 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -47,64 +47,15 @@ int vac_size, vac_linesize, vac_do_hw_vac_flushes;
47int vac_entries_per_context, vac_entries_per_segment; 47int vac_entries_per_context, vac_entries_per_segment;
48int vac_entries_per_page; 48int vac_entries_per_page;
49 49
50/* Nice, simple, prom library does all the sweating for us. ;) */ 50/* Return how much physical memory we have. */
51int prom_probe_memory (void) 51unsigned long probe_memory(void)
52{ 52{
53 register struct linux_mlist_v0 *mlist; 53 unsigned long total = 0;
54 register unsigned long bytes, base_paddr, tally; 54 int i;
55 register int i;
56
57 i = 0;
58 mlist= prom_meminfo();
59 bytes = tally = mlist->num_bytes;
60 base_paddr = (unsigned long) mlist->start_adr;
61
62 sp_banks[0].base_addr = base_paddr;
63 sp_banks[0].num_bytes = bytes;
64
65 while (mlist->theres_more != (void *) 0){
66 i++;
67 mlist = mlist->theres_more;
68 bytes = mlist->num_bytes;
69 tally += bytes;
70 if (i > SPARC_PHYS_BANKS-1) {
71 printk ("The machine has more banks than "
72 "this kernel can support\n"
73 "Increase the SPARC_PHYS_BANKS "
74 "setting (currently %d)\n",
75 SPARC_PHYS_BANKS);
76 i = SPARC_PHYS_BANKS-1;
77 break;
78 }
79
80 sp_banks[i].base_addr = (unsigned long) mlist->start_adr;
81 sp_banks[i].num_bytes = mlist->num_bytes;
82 }
83
84 i++;
85 sp_banks[i].base_addr = 0xdeadbeef;
86 sp_banks[i].num_bytes = 0;
87
88 /* Now mask all bank sizes on a page boundary, it is all we can
89 * use anyways.
90 */
91 for(i=0; sp_banks[i].num_bytes != 0; i++)
92 sp_banks[i].num_bytes &= PAGE_MASK;
93
94 return tally;
95}
96
97/* Traverse the memory lists in the prom to see how much physical we
98 * have.
99 */
100unsigned long
101probe_memory(void)
102{
103 int total;
104 55
105 total = prom_probe_memory(); 56 for (i = 0; sp_banks[i].num_bytes; i++)
57 total += sp_banks[i].num_bytes;
106 58
107 /* Oh man, much nicer, keep the dirt in promlib. */
108 return total; 59 return total;
109} 60}
110 61