|
22 | 22 | #define MAX(a, b) ((a) > (b) ? (a) : (b))
|
23 | 23 | #define MIN(a, b) ((a) < (b) ? (a) : (b))
|
24 | 24 |
|
| 25 | +#ifdef ARCH_CPU_64BIT |
| 26 | +#define MIN_BIT 16 |
| 27 | +#else |
| 28 | +#define MIN_BIT 8 |
| 29 | +#endif |
| 30 | + |
25 | 31 | #ifndef RT_INIT_MEMORY_REGIONS
|
26 | 32 | #define RT_INIT_MEMORY_REGIONS 128
|
27 | 33 | #endif
|
@@ -155,16 +161,16 @@ static rt_err_t _memblock_add_range(struct rt_memblock *memblock,
|
155 | 161 |
|
156 | 162 | rt_err_t rt_memblock_add_memory(const char *name, rt_size_t start, rt_size_t end, mmblk_flag_t flags)
|
157 | 163 | {
|
158 |
| - LOG_D("add physical address range [%p-%p) with flag 0x%x" \ |
159 |
| - " to overall memory regions\n", base, base + size, flag); |
| 164 | + LOG_D("add physical address range [0x%.*lx-0x%.*lx) with flag 0x%x" \ |
| 165 | + " to overall memory regions\n", MIN_BIT, base, MIN_BIT, base + size, flag); |
160 | 166 |
|
161 | 167 | return _memblock_add_range(&mmblk_memory, name, start, end, flags);
|
162 | 168 | }
|
163 | 169 |
|
164 | 170 | rt_err_t rt_memblock_reserve_memory(const char *name, rt_size_t start, rt_size_t end, mmblk_flag_t flags)
|
165 | 171 | {
|
166 |
| - LOG_D("add physical address range [%p-%p) to reserved memory regions\n",\ |
167 |
| - base, base + size); |
| 172 | + LOG_D("add physical address range %s [0x%.*lx-0x%.*lx) to reserved memory regions\n", |
| 173 | + name, MIN_BIT, start, MIN_BIT, end); |
168 | 174 |
|
169 | 175 | return _memblock_add_range(&mmblk_reserved, name, start, end, flags);
|
170 | 176 | }
|
@@ -347,14 +353,14 @@ void rt_memblock_setup_memory_environment(void)
|
347 | 353 |
|
348 | 354 | rt_slist_for_each_entry(iter, &(mmblk_memory.reg_list), node)
|
349 | 355 | {
|
350 |
| - LOG_I(" %-*.s [%p, %p]", RT_NAME_MAX, iter->memreg.name, iter->memreg.start, iter->memreg.end); |
| 356 | + LOG_I(" %-*.s [0x%.*lx, 0x%.*lx]", RT_NAME_MAX, iter->memreg.name, MIN_BIT, iter->memreg.start, MIN_BIT, iter->memreg.end); |
351 | 357 | }
|
352 | 358 |
|
353 | 359 | LOG_I("Reserved memory:");
|
354 | 360 |
|
355 | 361 | rt_slist_for_each_entry(iter, &(mmblk_reserved.reg_list), node)
|
356 | 362 | {
|
357 |
| - LOG_I(" %-*.s [%p, %p]", RT_NAME_MAX, iter->memreg.name, iter->memreg.start, iter->memreg.end); |
| 363 | + LOG_I(" %-*.s [0x%.*lx, 0x%.*lx]", RT_NAME_MAX, iter->memreg.name, MIN_BIT, iter->memreg.start, MIN_BIT, iter->memreg.end); |
358 | 364 |
|
359 | 365 | if (iter->flags != MEMBLOCK_NONE)
|
360 | 366 | {
|
|
0 commit comments