diff --git a/src/include/memlayout.h b/src/include/memlayout.h index 6280b200eb..07addbbcde 100644 --- a/src/include/memlayout.h +++ b/src/include/memlayout.h @@ -60,6 +60,8 @@ #define SRAM_END(addr) REGION_END(sram, addr) #define DRAM_START(addr) REGION_START(dram, addr) +/* This should rarely be used because DRAM-size is usually not compile-time constant. */ +#define DRAM_END(addr) REGION_END(dram, addr) #define TIMESTAMP(addr, size) \ REGION(timestamp, addr, size, 8) \ diff --git a/src/include/symbols.h b/src/include/symbols.h index 36e4c109cf..48ff832afd 100644 --- a/src/include/symbols.h +++ b/src/include/symbols.h @@ -5,8 +5,6 @@ #include -extern u8 _dram[]; - #define REGION_SIZE(name) ((size_t)_##name##_size) #define DECLARE_REGION(name) \ @@ -28,6 +26,7 @@ extern u8 _dram[]; __maybe_unused __weak extern u8 _##name##_size[]; DECLARE_REGION(sram) +DECLARE_OPTIONAL_REGION(dram) DECLARE_OPTIONAL_REGION(timestamp) DECLARE_REGION(preram_cbmem_console) DECLARE_REGION(cbmem_init_hooks)