Consolidate ifdefs in src/lib/cbmem.c for readability.
Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5343 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
64ed2b7345
commit
84b685af5f
|
@ -44,6 +44,9 @@ struct cbmem_entry {
|
|||
|
||||
#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 @@ void *cbmem_add(u32 id, u64 size)
|
|||
{
|
||||
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 @@ void *cbmem_find(u32 id)
|
|||
{
|
||||
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 @@ void cbmem_list(void)
|
|||
{
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue