rt-thread/libcpu/arm/common/showmem.c

39 lines
693 B
C
Raw Normal View History

2013-01-08 21:05:02 +08:00
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
2013-01-08 21:05:02 +08:00
*
* SPDX-License-Identifier: Apache-2.0
2013-01-08 21:05:02 +08:00
*
* Change Logs:
* Date Author Notes
* 2008-07-29 Bernard first version from QiuYi implementation
*/
#include <rtthread.h>
void rt_hw_show_memory(rt_uint32_t addr, rt_uint32_t size)
{
unsigned int i = 0, j = 0;
2013-01-08 21:05:02 +08:00
2021-03-27 17:51:56 +08:00
RT_ASSERT(addr);
2013-01-08 21:05:02 +08:00
2021-03-27 17:51:56 +08:00
addr = addr & ~0xF;
2022-07-25 10:21:18 +08:00
size = 4 * ((size + 3) / 4);
2013-01-08 21:05:02 +08:00
2022-07-25 10:21:18 +08:00
while (i < size)
2021-03-27 17:51:56 +08:00
{
2022-07-25 10:21:18 +08:00
rt_kprintf("0x%08x: ", addr);
2013-01-08 21:05:02 +08:00
2022-07-25 10:21:18 +08:00
for (j = 0; j < 4; j++)
2021-03-27 17:51:56 +08:00
{
rt_kprintf("0x%08x ", *(rt_uint32_t *)addr);
2013-01-08 21:05:02 +08:00
2021-03-27 17:51:56 +08:00
addr += 4;
i++;
}
2013-01-08 21:05:02 +08:00
2021-03-27 17:51:56 +08:00
rt_kprintf("\n");
}
2013-01-08 21:05:02 +08:00
2021-03-27 17:51:56 +08:00
return;
2013-01-08 21:05:02 +08:00
}