Author: myles Date: Wed Mar 31 16:57:55 2010 New Revision: 5343 URL: https://tracker.coreboot.org/trac/coreboot/changeset/5343
Log: Consolidate ifdefs in src/lib/cbmem.c for readability.
Signed-off-by: Myles Watson mylesgw@gmail.com Acked-by: Stefan Reinauer stepan@coresystems.de
Modified: trunk/src/lib/cbmem.c
Modified: trunk/src/lib/cbmem.c ============================================================================== --- trunk/src/lib/cbmem.c Wed Mar 31 16:47:43 2010 (r5342) +++ trunk/src/lib/cbmem.c Wed Mar 31 16:57:55 2010 (r5343) @@ -44,6 +44,9 @@
#ifndef __PRE_RAM__ struct cbmem_entry *bss_cbmem_toc; +#define get_cbmem_toc() bss_cbmem_toc +#else +#define get_cbmem_toc() (struct cbmem_entry *)(get_top_of_ram() - HIGH_MEMORY_SIZE) #endif
/** @@ -99,11 +102,7 @@ { struct cbmem_entry *cbmem_toc; int i; -#ifdef __PRE_RAM__ - cbmem_toc = (struct cbmem_entry *)(get_top_of_ram() - HIGH_MEMORY_SIZE); -#else - cbmem_toc = bss_cbmem_toc; -#endif + cbmem_toc = get_cbmem_toc(); if (cbmem_toc == NULL) { return NULL; @@ -155,11 +154,7 @@ { struct cbmem_entry *cbmem_toc; int i; -#ifdef __PRE_RAM__ - cbmem_toc = (struct cbmem_entry *)(get_top_of_ram() - HIGH_MEMORY_SIZE); -#else - cbmem_toc = bss_cbmem_toc; -#endif + cbmem_toc = get_cbmem_toc(); if (cbmem_toc == NULL) return NULL; @@ -201,11 +196,7 @@ { struct cbmem_entry *cbmem_toc; int i; -#ifdef __PRE_RAM__ - cbmem_toc = (struct cbmem_entry *)(get_top_of_ram() - HIGH_MEMORY_SIZE); -#else - cbmem_toc = bss_cbmem_toc; -#endif + cbmem_toc = get_cbmem_toc(); if (cbmem_toc == NULL) return;