coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
memlayout.h File Reference
#include <arch/memlayout.h>
#include <vb2_constants.h>
#include "fmap_config.h"
Include dependency graph for memlayout.h:

Go to the source code of this file.

Macros

#define ARCH_POINTER_ALIGN_SIZE   8
 
#define ARCH_CACHELINE_ALIGN_SIZE   64
 
#define STR(x)   XSTR(x)
 
#define XSTR(x)   #x
 
#define ALIGN_COUNTER(align)    . = ALIGN(align);
 
#define SET_COUNTER(name, addr)
 
#define SYMBOL(name, addr)
 
#define RECORD_SIZE(name)    _##name##_size = ABSOLUTE(_e##name - _##name);
 
#define REGION(name, addr, size, expected_align)
 
#define ALIAS_REGION(name, alias)
 
#define REGION_START(name, addr)   SYMBOL(name, addr)
 
#define REGION_END(name, addr)
 
#define SRAM_START(addr)   REGION_START(sram, addr)
 
#define SRAM_END(addr)   REGION_END(sram, addr)
 
#define DRAM_START(addr)   REGION_START(dram, addr)
 
#define TIMESTAMP(addr, size)
 
#define PRERAM_CBMEM_CONSOLE(addr, size)    REGION(preram_cbmem_console, addr, size, 4)
 
#define EARLYRAM_STACK(addr, size)    REGION(earlyram_stack, addr, size, ARCH_STACK_ALIGN_SIZE)
 
#define CBFS_CACHE(addr, size)
 
#define FMAP_CACHE(addr, sz)
 
#define CBFS_MCACHE(addr, sz)    REGION(cbfs_mcache, addr, sz, 4)
 
#define PRERAM_CBFS_CACHE(addr, size)    REGION(preram_cbfs_cache, addr, size, 4)
 
#define POSTRAM_CBFS_CACHE(addr, size)
 
#define DECOMPRESSOR(addr, sz)    REGION(decompressor, addr, sz, 1)
 
#define OVERLAP_DECOMPRESSOR_ROMSTAGE(addr, sz)   ROMSTAGE(addr, sz)
 
#define OVERLAP_DECOMPRESSOR_VERSTAGE_ROMSTAGE(addr, sz)    OVERLAP_VERSTAGE_ROMSTAGE(addr, sz)
 
#define BOOTBLOCK(addr, sz)    REGION(bootblock, addr, sz, 1)
 
#define ROMSTAGE(addr, sz)    REGION(romstage, addr, sz, 1)
 
#define RAMSTAGE(addr, sz)    REGION(ramstage, addr, sz, 1)
 
#define VBOOT2_WORK(addr, sz)
 
#define TPM_TCPA_LOG(addr, size)
 
#define VERSTAGE(addr, sz)    REGION(verstage, addr, sz, 1)
 
#define OVERLAP_VERSTAGE_ROMSTAGE(addr, size)   ROMSTAGE(addr, size)
 
#define POSTCAR(addr, sz)    REGION(postcar, addr, sz, 1)
 
#define WATCHDOG_TOMBSTONE(addr, size)
 

Macro Definition Documentation

◆ ALIAS_REGION

#define ALIAS_REGION (   name,
  alias 
)
Value:
_##alias = ABSOLUTE(_##name); \
_e##alias = ABSOLUTE(_e##name); \
RECORD_SIZE(alias)
const char * name
Definition: mmu.c:92

Definition at line 46 of file memlayout.h.

◆ ALIGN_COUNTER

#define ALIGN_COUNTER (   align)     . = ALIGN(align);

Definition at line 25 of file memlayout.h.

◆ ARCH_CACHELINE_ALIGN_SIZE

#define ARCH_CACHELINE_ALIGN_SIZE   64

Definition at line 19 of file memlayout.h.

◆ ARCH_POINTER_ALIGN_SIZE

#define ARCH_POINTER_ALIGN_SIZE   8

Definition at line 15 of file memlayout.h.

◆ BOOTBLOCK

#define BOOTBLOCK (   addr,
  sz 
)     REGION(bootblock, addr, sz, 1)

Definition at line 133 of file memlayout.h.

◆ CBFS_CACHE

#define CBFS_CACHE (   addr,
  size 
)
Value:
REGION(cbfs_cache, addr, size, 4) \
ALIAS_REGION(cbfs_cache, preram_cbfs_cache) \
ALIAS_REGION(cbfs_cache, postram_cbfs_cache)
struct mem_pool cbfs_cache
Definition: cbfs.c:26
static u32 addr
Definition: cirrus.c:14
#define REGION(name, addr, size, expected_align)
Definition: memlayout.h:39

Definition at line 75 of file memlayout.h.

◆ CBFS_MCACHE

#define CBFS_MCACHE (   addr,
  sz 
)     REGION(cbfs_mcache, addr, sz, 4)

Definition at line 85 of file memlayout.h.

◆ DECOMPRESSOR

#define DECOMPRESSOR (   addr,
  sz 
)     REGION(decompressor, addr, sz, 1)

Definition at line 116 of file memlayout.h.

◆ DRAM_START

#define DRAM_START (   addr)    REGION_START(dram, addr)

Definition at line 62 of file memlayout.h.

◆ EARLYRAM_STACK

#define EARLYRAM_STACK (   addr,
  size 
)     REGION(earlyram_stack, addr, size, ARCH_STACK_ALIGN_SIZE)

Definition at line 71 of file memlayout.h.

◆ FMAP_CACHE

#define FMAP_CACHE (   addr,
  sz 
)
Value:
REGION(fmap_cache, addr, sz, 4) \
_ = ASSERT(sz >= FMAP_SIZE, \
STR(FMAP does not fit in FMAP_CACHE! (sz < FMAP_SIZE)));
#define ASSERT(x)
Definition: assert.h:44
static struct region_device fmap_cache
Definition: fmap.c:20
#define STR(x)
Definition: memlayout.h:22
#define FMAP_CACHE(addr, sz)
Definition: memlayout.h:80
Definition: jpeg.c:27

Definition at line 80 of file memlayout.h.

◆ OVERLAP_DECOMPRESSOR_ROMSTAGE

#define OVERLAP_DECOMPRESSOR_ROMSTAGE (   addr,
  sz 
)    ROMSTAGE(addr, sz)

Definition at line 119 of file memlayout.h.

◆ OVERLAP_DECOMPRESSOR_VERSTAGE_ROMSTAGE

#define OVERLAP_DECOMPRESSOR_VERSTAGE_ROMSTAGE (   addr,
  sz 
)     OVERLAP_VERSTAGE_ROMSTAGE(addr, sz)

Definition at line 120 of file memlayout.h.

◆ OVERLAP_VERSTAGE_ROMSTAGE

#define OVERLAP_VERSTAGE_ROMSTAGE (   addr,
  size 
)    ROMSTAGE(addr, size)

Definition at line 192 of file memlayout.h.

◆ POSTCAR

#define POSTCAR (   addr,
  sz 
)     REGION(postcar, addr, sz, 1)

Definition at line 204 of file memlayout.h.

◆ POSTRAM_CBFS_CACHE

#define POSTRAM_CBFS_CACHE (   addr,
  size 
)
Value:
REGION(postram_cbfs_cache, addr, size, 4) \
ALIAS_REGION(postram_cbfs_cache, cbfs_cache)

Definition at line 97 of file memlayout.h.

◆ PRERAM_CBFS_CACHE

#define PRERAM_CBFS_CACHE (   addr,
  size 
)     REGION(preram_cbfs_cache, addr, size, 4)

Definition at line 95 of file memlayout.h.

◆ PRERAM_CBMEM_CONSOLE

#define PRERAM_CBMEM_CONSOLE (   addr,
  size 
)     REGION(preram_cbmem_console, addr, size, 4)

Definition at line 68 of file memlayout.h.

◆ RAMSTAGE

#define RAMSTAGE (   addr,
  sz 
)     REGION(ramstage, addr, sz, 1)

Definition at line 159 of file memlayout.h.

◆ RECORD_SIZE

#define RECORD_SIZE (   name)     _##name##_size = ABSOLUTE(_e##name - _##name);

Definition at line 36 of file memlayout.h.

◆ REGION

#define REGION (   name,
  addr,
  size,
  expected_align 
)
Value:
_ = ASSERT(. == ALIGN(expected_align), \
STR(name must be aligned to expected_align!)); \
SYMBOL(e##name, addr + size) \
RECORD_SIZE(name)
#define ALIGN
Definition: asm.h:22
#define SYMBOL(name, addr)
Definition: memlayout.h:32

Definition at line 39 of file memlayout.h.

◆ REGION_END

#define REGION_END (   name,
  addr 
)
Value:
SYMBOL(e##name, addr) \
RECORD_SIZE(name)

Definition at line 53 of file memlayout.h.

◆ REGION_START

#define REGION_START (   name,
  addr 
)    SYMBOL(name, addr)

Definition at line 51 of file memlayout.h.

◆ ROMSTAGE

#define ROMSTAGE (   addr,
  sz 
)     REGION(romstage, addr, sz, 1)

Definition at line 146 of file memlayout.h.

◆ SET_COUNTER

#define SET_COUNTER (   name,
  addr 
)
Value:
_ = ASSERT(. <= addr, STR(name overlaps the previous region!)); \
. = addr;
Definition: region.h:76

Definition at line 28 of file memlayout.h.

◆ SRAM_END

#define SRAM_END (   addr)    REGION_END(sram, addr)

Definition at line 60 of file memlayout.h.

◆ SRAM_START

#define SRAM_START (   addr)    REGION_START(sram, addr)

Definition at line 58 of file memlayout.h.

◆ STR

#define STR (   x)    XSTR(x)

Definition at line 22 of file memlayout.h.

◆ SYMBOL

#define SYMBOL (   name,
  addr 
)
Value:
_##name = ABSOLUTE(.);
#define SET_COUNTER(name, addr)
Definition: memlayout.h:28

Definition at line 32 of file memlayout.h.

◆ TIMESTAMP

#define TIMESTAMP (   addr,
  size 
)
Value:
REGION(timestamp, addr, size, 8) \
_ = ASSERT(size >= 212, "Timestamp region must fit timestamp_cache!");

Definition at line 64 of file memlayout.h.

◆ TPM_TCPA_LOG

#define TPM_TCPA_LOG (   addr,
  size 
)
Value:
REGION(tpm_tcpa_log, addr, size, 16) \
_ = ASSERT(size >= 2K, "tpm tcpa log buffer must be at least 2K!");

Definition at line 171 of file memlayout.h.

◆ VBOOT2_WORK

#define VBOOT2_WORK (   addr,
  sz 
)
Value:
REGION(vboot2_work, addr, sz, 16) \
_ = ASSERT(sz == VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE, \
STR(vboot2 work buffer size must be equivalent to \
VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE! (sz)));
u8 buffer[C2P_BUFFER_MAXSIZE]
Definition: psp_smm.c:18

Definition at line 165 of file memlayout.h.

◆ VERSTAGE

#define VERSTAGE (   addr,
  sz 
)     REGION(verstage, addr, sz, 1)

Definition at line 189 of file memlayout.h.

◆ WATCHDOG_TOMBSTONE

#define WATCHDOG_TOMBSTONE (   addr,
  size 
)
Value:
REGION(watchdog_tombstone, addr, size, 4) \
_ = ASSERT(size == 4, "watchdog tombstones should be exactly 4 byte!");

Definition at line 208 of file memlayout.h.

◆ XSTR

#define XSTR (   x)    #x

Definition at line 23 of file memlayout.h.