mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
software/bios/cmds/cmd_bios: Make crc command 64-bit clean
On 64-bit: litex/soc/software/bios/cmds/cmd_bios.c: In function 'crc_handler': litex/soc/software/bios/cmds/cmd_bios.c:110:30: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] printf("CRC32: %08x", crc32((unsigned char *)addr, length)); ^ Fix this by using the appropriate types (uintptr_t and size_t) for memory addresses and sizes, which are defined to 32-bit or 64-bit, depending on the platform. Note that the specified length must still be smaller than 4 GiB on 64-bit, or it will be truncated, as the crc32() function is currently limited to a 32-bit size anyway. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
857ef69b3f
commit
cbd54e7b5c
1 changed files with 2 additions and 2 deletions
|
@ -87,8 +87,8 @@ define_command(uptime, uptime_handler, "Uptime of the system since power-up", SY
|
||||||
static void crc_handler(int nb_params, char **params)
|
static void crc_handler(int nb_params, char **params)
|
||||||
{
|
{
|
||||||
char *c;
|
char *c;
|
||||||
unsigned int addr;
|
uintptr_t addr;
|
||||||
unsigned int length;
|
size_t length;
|
||||||
|
|
||||||
if (nb_params < 2) {
|
if (nb_params < 2) {
|
||||||
printf("crc <address> <length>");
|
printf("crc <address> <length>");
|
||||||
|
|
Loading…
Reference in a new issue