mirror of https://github.com/wolfSSL/wolfBoot.git
For the hal_flash API's make the change to uintptr_t to support 64-bit explicit using `ARCH_64BIT` or known 64-bit architectures.
parent
7190392245
commit
b9949b0a0c
|
@ -532,7 +532,7 @@ void hal_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
|
int hal_flash_write(uint32_t address, const uint8_t *data, int len)
|
||||||
{
|
{
|
||||||
(void)address;
|
(void)address;
|
||||||
(void)data;
|
(void)data;
|
||||||
|
@ -541,7 +541,7 @@ int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int hal_flash_erase(uintptr_t address, int len)
|
int hal_flash_erase(uint32_t address, int len)
|
||||||
{
|
{
|
||||||
(void)address;
|
(void)address;
|
||||||
(void)len;
|
(void)len;
|
||||||
|
|
|
@ -45,13 +45,20 @@ void hal_set_external_flash_file(const char* file);
|
||||||
void hal_deinit();
|
void hal_deinit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(ARCH_64BIT) && \
|
||||||
|
(defined(ARCH_x86_64) || defined(ARCH_AARCH64) || defined(ARCH_SIM))
|
||||||
|
#define ARCH_64BIT
|
||||||
|
#endif
|
||||||
|
|
||||||
void hal_init(void);
|
void hal_init(void);
|
||||||
#if !defined(FORCE_32BIT) && INTPTR_MAX == INT64_MAX /* 64-bit platform */
|
#ifdef ARCH_64BIT
|
||||||
int hal_flash_write(uintptr_t address, const uint8_t *data, int len);
|
typedef uintptr_t haladdr_t; /* 64-bit platforms */
|
||||||
int hal_flash_erase(uintptr_t address, int len);
|
int hal_flash_write(uintptr_t address, const uint8_t *data, int len);
|
||||||
|
int hal_flash_erase(uintptr_t address, int len);
|
||||||
#else
|
#else
|
||||||
int hal_flash_write(uint32_t address, const uint8_t *data, int len);
|
typedef uint32_t haladdr_t; /* original 32-bit */
|
||||||
int hal_flash_erase(uint32_t address, int len);
|
int hal_flash_write(uint32_t address, const uint8_t *data, int len);
|
||||||
|
int hal_flash_erase(uint32_t address, int len);
|
||||||
#endif
|
#endif
|
||||||
void hal_flash_unlock(void);
|
void hal_flash_unlock(void);
|
||||||
void hal_flash_lock(void);
|
void hal_flash_lock(void);
|
||||||
|
|
|
@ -32,11 +32,11 @@ static int locked = 0;
|
||||||
void hal_init(void)
|
void hal_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
|
int hal_flash_write(haladdr_t address, const uint8_t *data, int len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int hal_flash_erase(uintptr_t address, int len)
|
int hal_flash_erase(haladdr_t address, int len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ void printmsg(const char *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
|
int hal_flash_write(haladdr_t address, const uint8_t *data, int len)
|
||||||
{
|
{
|
||||||
(void)address;
|
(void)address;
|
||||||
(void)data;
|
(void)data;
|
||||||
|
@ -96,7 +96,7 @@ int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int hal_flash_erase(uintptr_t address, int len)
|
int hal_flash_erase(haladdr_t address, int len)
|
||||||
{
|
{
|
||||||
(void)address;
|
(void)address;
|
||||||
(void)len;
|
(void)len;
|
||||||
|
|
|
@ -68,11 +68,11 @@ static int locked = 0;
|
||||||
void hal_init(void)
|
void hal_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
|
int hal_flash_write(haladdr_t address, const uint8_t *data, int len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int hal_flash_erase(uintptr_t address, int len)
|
int hal_flash_erase(haladdr_t address, int len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,11 +37,11 @@ static int locked = 0;
|
||||||
void hal_init(void)
|
void hal_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
int hal_flash_write(uintptr_t address, const uint8_t *data, int len)
|
int hal_flash_write(haladdr_t address, const uint8_t *data, int len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int hal_flash_erase(uintptr_t address, int len)
|
int hal_flash_erase(haladdr_t address, int len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue