From ccc34028d46230f715eeda4c8cce27e919934fad Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 1 May 2008 21:28:59 -0700 Subject: 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 --- arch/sparc/prom/memory.c | 103 ++--------------------------------------------- 1 file changed, 4 insertions(+), 99 deletions(-) (limited to 'arch/sparc/prom') 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; itermemorysize); - 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; } -- cgit v1.2.3