Commit 87959907 authored by danh-arm's avatar danh-arm
Browse files

Merge pull request #530 from antonio-nino-diaz-arm/an/p_printf

Add support for %p in tf_printf()
parents 84d1099f f0dd061a
...@@ -103,8 +103,8 @@ void runtime_svc_init(void) ...@@ -103,8 +103,8 @@ void runtime_svc_init(void)
*/ */
rc = validate_rt_svc_desc(&rt_svc_descs[index]); rc = validate_rt_svc_desc(&rt_svc_descs[index]);
if (rc) { if (rc) {
ERROR("Invalid runtime service descriptor 0x%lx (%s)\n", ERROR("Invalid runtime service descriptor %p (%s)\n",
(uintptr_t) &rt_svc_descs[index], (void *) &rt_svc_descs[index],
rt_svc_descs[index].name); rt_svc_descs[index].name);
goto error; goto error;
} }
......
...@@ -229,7 +229,8 @@ int load_image(meminfo_t *mem_layout, ...@@ -229,7 +229,8 @@ int load_image(meminfo_t *mem_layout,
return io_result; return io_result;
} }
INFO("Loading image id=%u at address 0x%lx\n", image_id, image_base); INFO("Loading image id=%u at address %p\n", image_id,
(void *) image_base);
/* Find the size of the image */ /* Find the size of the image */
io_result = io_size(image_handle, &image_size); io_result = io_size(image_handle, &image_size);
...@@ -242,8 +243,8 @@ int load_image(meminfo_t *mem_layout, ...@@ -242,8 +243,8 @@ int load_image(meminfo_t *mem_layout,
/* Check that the memory where the image will be loaded is free */ /* Check that the memory where the image will be loaded is free */
if (!is_mem_free(mem_layout->free_base, mem_layout->free_size, if (!is_mem_free(mem_layout->free_base, mem_layout->free_size,
image_base, image_size)) { image_base, image_size)) {
WARN("Failed to reserve memory: 0x%lx - 0x%lx\n", WARN("Failed to reserve memory: %p - %p\n", (void *) image_base,
image_base, image_base + image_size); (void *) (image_base + image_size));
dump_load_info(image_base, image_size, mem_layout); dump_load_info(image_base, image_size, mem_layout);
io_result = -ENOMEM; io_result = -ENOMEM;
goto exit; goto exit;
...@@ -268,8 +269,8 @@ int load_image(meminfo_t *mem_layout, ...@@ -268,8 +269,8 @@ int load_image(meminfo_t *mem_layout,
reserve_mem(&mem_layout->free_base, &mem_layout->free_size, reserve_mem(&mem_layout->free_base, &mem_layout->free_size,
image_base, image_size); image_base, image_size);
} else { } else {
INFO("Skip reserving memory: 0x%lx - 0x%lx\n", INFO("Skip reserving memory: %p - %p\n", (void *) image_base,
image_base, image_base + image_size); (void *) (image_base + image_size));
} }
image_data->image_base = image_base; image_data->image_base = image_base;
...@@ -284,8 +285,8 @@ int load_image(meminfo_t *mem_layout, ...@@ -284,8 +285,8 @@ int load_image(meminfo_t *mem_layout,
*/ */
flush_dcache_range(image_base, image_size); flush_dcache_range(image_base, image_size);
INFO("Image id=%u loaded: 0x%lx - 0x%lx\n", image_id, image_base, INFO("Image id=%u loaded: %p - %p\n", image_id, (void *) image_base,
image_base + image_size); (void *) (image_base + image_size));
exit: exit:
io_close(image_handle); io_close(image_handle);
......
...@@ -68,6 +68,7 @@ static void string_print(const char *str) ...@@ -68,6 +68,7 @@ static void string_print(const char *str)
* %u - unsigned 32 bit decimal format * %u - unsigned 32 bit decimal format
* %ld and %lld - signed 64 bit decimal format * %ld and %lld - signed 64 bit decimal format
* %lu and %llu - unsigned 64 bit decimal format * %lu and %llu - unsigned 64 bit decimal format
* %p - pointer format
* Exits on all other formats. * Exits on all other formats.
*******************************************************************/ *******************************************************************/
...@@ -107,6 +108,14 @@ loop: ...@@ -107,6 +108,14 @@ loop:
str = va_arg(args, char *); str = va_arg(args, char *);
string_print(str); string_print(str);
break; break;
case 'p':
unum = (uint64_t)va_arg(args, void *);
if (unum)
string_print("0x");
unsigned_num_print(unum, 16);
break;
case 'x': case 'x':
if (bit64) if (bit64)
unum = va_arg(args, uint64_t); unum = va_arg(args, uint64_t);
......
...@@ -60,8 +60,8 @@ uintptr_t gicv3_get_rdist(uintptr_t gicr_base, uint64_t mpidr) ...@@ -60,8 +60,8 @@ uintptr_t gicv3_get_rdist(uintptr_t gicr_base, uint64_t mpidr)
/* Disable this print for now as it appears every time /* Disable this print for now as it appears every time
* when using PSCI CPU_SUSPEND. * when using PSCI CPU_SUSPEND.
* TODO: Print this only the first time for each CPU. * TODO: Print this only the first time for each CPU.
* INFO("GICv3 - Found RDIST for MPIDR(0x%lx) at 0x%lx\n", * INFO("GICv3 - Found RDIST for MPIDR(0x%lx) at %p\n",
* mpidr, addr); * mpidr, (void *) addr);
*/ */
return addr; return addr;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment