mirror of
https://xff.cz/git/u-boot/
synced 2025-08-31 16:22:36 +02:00
display_options: Drop #ifdef for MEM_SUPPORT_64BIT_DATA
This is defined only when __lp64__ is defined. That means that ulong is
64 bits long. Therefore we don't need to use a separate u64 type on those
architectures.
Fix up the code to take advantage of that, removing the preprocessor
conditions.
Also include the missing header file that defines MEM_SUPPORT_64BIT_DATA
Fixes: 0914011310
("command: Remove the cmd_tbl_t typedef")
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -138,19 +138,13 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
|
|||||||
{
|
{
|
||||||
/* linebuf as a union causes proper alignment */
|
/* linebuf as a union causes proper alignment */
|
||||||
union linebuf {
|
union linebuf {
|
||||||
#if MEM_SUPPORT_64BIT_DATA
|
|
||||||
uint64_t uq[MAX_LINE_LENGTH_BYTES/sizeof(uint64_t) + 1];
|
uint64_t uq[MAX_LINE_LENGTH_BYTES/sizeof(uint64_t) + 1];
|
||||||
#endif
|
|
||||||
uint32_t ui[MAX_LINE_LENGTH_BYTES/sizeof(uint32_t) + 1];
|
uint32_t ui[MAX_LINE_LENGTH_BYTES/sizeof(uint32_t) + 1];
|
||||||
uint16_t us[MAX_LINE_LENGTH_BYTES/sizeof(uint16_t) + 1];
|
uint16_t us[MAX_LINE_LENGTH_BYTES/sizeof(uint16_t) + 1];
|
||||||
uint8_t uc[MAX_LINE_LENGTH_BYTES/sizeof(uint8_t) + 1];
|
uint8_t uc[MAX_LINE_LENGTH_BYTES/sizeof(uint8_t) + 1];
|
||||||
} lb;
|
} lb;
|
||||||
int i;
|
int i;
|
||||||
#if MEM_SUPPORT_64BIT_DATA
|
ulong x;
|
||||||
uint64_t __maybe_unused x;
|
|
||||||
#else
|
|
||||||
uint32_t __maybe_unused x;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (linelen*width > MAX_LINE_LENGTH_BYTES)
|
if (linelen*width > MAX_LINE_LENGTH_BYTES)
|
||||||
linelen = MAX_LINE_LENGTH_BYTES / width;
|
linelen = MAX_LINE_LENGTH_BYTES / width;
|
||||||
@@ -169,20 +163,16 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
|
|||||||
for (i = 0; i < thislinelen; i++) {
|
for (i = 0; i < thislinelen; i++) {
|
||||||
if (width == 4)
|
if (width == 4)
|
||||||
x = lb.ui[i] = *(volatile uint32_t *)data;
|
x = lb.ui[i] = *(volatile uint32_t *)data;
|
||||||
#if MEM_SUPPORT_64BIT_DATA
|
else if (MEM_SUPPORT_64BIT_DATA && width == 8)
|
||||||
else if (width == 8)
|
x = lb.uq[i] = *(volatile ulong *)data;
|
||||||
x = lb.uq[i] = *(volatile uint64_t *)data;
|
|
||||||
#endif
|
|
||||||
else if (width == 2)
|
else if (width == 2)
|
||||||
x = lb.us[i] = *(volatile uint16_t *)data;
|
x = lb.us[i] = *(volatile uint16_t *)data;
|
||||||
else
|
else
|
||||||
x = lb.uc[i] = *(volatile uint8_t *)data;
|
x = lb.uc[i] = *(volatile uint8_t *)data;
|
||||||
#if defined(CONFIG_SPL_BUILD)
|
#if defined(CONFIG_SPL_BUILD)
|
||||||
printf(" %x", (uint)x);
|
printf(" %x", (uint)x);
|
||||||
#elif defined(MEM_SUPPORT_64BIT_DATA)
|
|
||||||
printf(" %0*llx", width * 2, (long long)x);
|
|
||||||
#else
|
#else
|
||||||
printf(" %0*x", width * 2, x);
|
printf(" %0*lx", width * 2, x);
|
||||||
#endif
|
#endif
|
||||||
data += width;
|
data += width;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user