summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-01 21:28:59 -0700
committerDavid S. Miller <davem@davemloft.net>2008-05-02 05:22:53 -0700
commitccc34028d46230f715eeda4c8cce27e919934fad (patch)
treefa9ef4679b6c30c5b439471ba39c5e383011c25e /arch
parent2678fefedbbc03a3ae6f5c254791bf147d6c52fd (diff)
downloadlinux-3.10-ccc34028d46230f715eeda4c8cce27e919934fad.tar.gz
linux-3.10-ccc34028d46230f715eeda4c8cce27e919934fad.tar.bz2
linux-3.10-ccc34028d46230f715eeda4c8cce27e919934fad.zip
sparc32: Kill totally unused memory information tables.
The code in arch/sparc/prom/memory.c computes three tables, the list of total memory, the list of available memory (total minus what firmware is using), and the list of firmware taken memory. Only the available memory list is even used. Therefore, kill those unused tables and make prom_meminfo() return just the available memory list. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/mm/fault.c2
-rw-r--r--arch/sparc/prom/memory.c103
2 files changed, 5 insertions, 100 deletions
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index e4d9c8e19df..f25876a56fe 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -55,7 +55,7 @@ int prom_probe_memory (void)
register int i;
i = 0;
- mlist= *prom_meminfo()->v0_available;
+ mlist= prom_meminfo();
bytes = tally = mlist->num_bytes;
base_paddr = (unsigned long) mlist->start_adr;
diff --git a/arch/sparc/prom/memory.c b/arch/sparc/prom/memory.c
index b0c0f9c4fc1..08ac1bf2e58 100644
--- a/arch/sparc/prom/memory.c
+++ b/arch/sparc/prom/memory.c
@@ -1,5 +1,4 @@
-/* $Id: memory.c,v 1.15 2000/01/29 01:09:12 anton Exp $
- * memory.c: Prom routine for acquiring various bits of information
+/* memory.c: Prom routine for acquiring various bits of information
* about RAM on the machine, both virtual and physical.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -22,19 +21,9 @@
*/
struct linux_prom_registers prom_reg_memlist[64];
-struct linux_prom_registers prom_reg_tmp[64];
-struct linux_mlist_v0 prom_phys_total[64];
-struct linux_mlist_v0 prom_prom_taken[64];
struct linux_mlist_v0 prom_phys_avail[64];
-struct linux_mlist_v0 *prom_ptot_ptr = prom_phys_total;
-struct linux_mlist_v0 *prom_ptak_ptr = prom_prom_taken;
-struct linux_mlist_v0 *prom_pavl_ptr = prom_phys_avail;
-
-struct linux_mem_v0 prom_memlist;
-
-
/* Internal Prom library routine to sort a linux_mlist_v0 memory
* list. Used below in initialization.
*/
@@ -77,23 +66,6 @@ void __init prom_meminit(void)
switch(prom_vers) {
case PROM_V0:
/* Nice, kind of easier to do in this case. */
- /* First, the total physical descriptors. */
- for(mptr = (*(romvec->pv_v0mem.v0_totphys)), iter=0;
- mptr; mptr=mptr->theres_more, iter++) {
- prom_phys_total[iter].start_adr = mptr->start_adr;
- prom_phys_total[iter].num_bytes = mptr->num_bytes;
- prom_phys_total[iter].theres_more = &prom_phys_total[iter+1];
- }
- prom_phys_total[iter-1].theres_more = NULL;
- /* Second, the total prom taken descriptors. */
- for(mptr = (*(romvec->pv_v0mem.v0_prommap)), iter=0;
- mptr; mptr=mptr->theres_more, iter++) {
- prom_prom_taken[iter].start_adr = mptr->start_adr;
- prom_prom_taken[iter].num_bytes = mptr->num_bytes;
- prom_prom_taken[iter].theres_more = &prom_prom_taken[iter+1];
- }
- prom_prom_taken[iter-1].theres_more = NULL;
- /* Last, the available physical descriptors. */
for(mptr = (*(romvec->pv_v0mem.v0_available)), iter=0;
mptr; mptr=mptr->theres_more, iter++) {
prom_phys_avail[iter].start_adr = mptr->start_adr;
@@ -101,9 +73,6 @@ void __init prom_meminit(void)
prom_phys_avail[iter].theres_more = &prom_phys_avail[iter+1];
}
prom_phys_avail[iter-1].theres_more = NULL;
- /* Sort all the lists. */
- prom_sortmemlist(prom_phys_total);
- prom_sortmemlist(prom_prom_taken);
prom_sortmemlist(prom_phys_avail);
break;
case PROM_V2:
@@ -124,69 +93,12 @@ void __init prom_meminit(void)
&prom_phys_avail[iter+1];
}
prom_phys_avail[iter-1].theres_more = NULL;
-
- num_regs = prom_getproperty(node, "reg",
- (char *) prom_reg_memlist,
- sizeof(prom_reg_memlist));
- num_regs = (num_regs/sizeof(struct linux_prom_registers));
- for(iter=0; iter<num_regs; iter++) {
- prom_phys_total[iter].start_adr =
- (char *) prom_reg_memlist[iter].phys_addr;
- prom_phys_total[iter].num_bytes =
- (unsigned long) prom_reg_memlist[iter].reg_size;
- prom_phys_total[iter].theres_more =
- &prom_phys_total[iter+1];
- }
- prom_phys_total[iter-1].theres_more = NULL;
-
- node = prom_getchild(prom_root_node);
- node = prom_searchsiblings(node, "virtual-memory");
- num_regs = prom_getproperty(node, "available",
- (char *) prom_reg_memlist,
- sizeof(prom_reg_memlist));
- num_regs = (num_regs/sizeof(struct linux_prom_registers));
-
- /* Convert available virtual areas to taken virtual
- * areas. First sort, then convert.
- */
- for(iter=0; iter<num_regs; iter++) {
- prom_prom_taken[iter].start_adr =
- (char *) prom_reg_memlist[iter].phys_addr;
- prom_prom_taken[iter].num_bytes =
- (unsigned long) prom_reg_memlist[iter].reg_size;
- prom_prom_taken[iter].theres_more =
- &prom_prom_taken[iter+1];
- }
- prom_prom_taken[iter-1].theres_more = NULL;
-
- prom_sortmemlist(prom_prom_taken);
-
- /* Finally, convert. */
- for(iter=0; iter<num_regs; iter++) {
- prom_prom_taken[iter].start_adr =
- prom_prom_taken[iter].start_adr +
- prom_prom_taken[iter].num_bytes;
- prom_prom_taken[iter].num_bytes =
- prom_prom_taken[iter+1].start_adr -
- prom_prom_taken[iter].start_adr;
- }
- prom_prom_taken[iter-1].num_bytes =
- 0xffffffff - (unsigned long) prom_prom_taken[iter-1].start_adr;
-
- /* Sort the other two lists. */
- prom_sortmemlist(prom_phys_total);
prom_sortmemlist(prom_phys_avail);
break;
case PROM_SUN4:
#ifdef CONFIG_SUN4
/* how simple :) */
- prom_phys_total[0].start_adr = NULL;
- prom_phys_total[0].num_bytes = *(sun4_romvec->memorysize);
- prom_phys_total[0].theres_more = NULL;
- prom_prom_taken[0].start_adr = NULL;
- prom_prom_taken[0].num_bytes = 0x0;
- prom_prom_taken[0].theres_more = NULL;
prom_phys_avail[0].start_adr = NULL;
prom_phys_avail[0].num_bytes = *(sun4_romvec->memoryavail);
prom_phys_avail[0].theres_more = NULL;
@@ -196,20 +108,13 @@ void __init prom_meminit(void)
default:
break;
};
-
- /* Link all the lists into the top-level descriptor. */
- prom_memlist.v0_totphys=&prom_ptot_ptr;
- prom_memlist.v0_prommap=&prom_ptak_ptr;
- prom_memlist.v0_available=&prom_pavl_ptr;
-
- return;
}
/* This returns a pointer to our libraries internal v0 format
- * memory descriptor.
+ * available memory list.
*/
-struct linux_mem_v0 *
+struct linux_mlist_v0 *
prom_meminfo(void)
{
- return &prom_memlist;
+ return prom_phys_avail;
}