revert additional assertion check which breaks used of hw_alias macro outside of functions (#635)

* revert additional assertion check which breaks used of hw_alias macros outside of functions
This commit is contained in:
Graham Sanderson
2021-10-26 16:07:21 -05:00
committed by GitHub
parent 5641cd0a4a
commit b04a09110f
2 changed files with 8 additions and 6 deletions

View File

@ -81,11 +81,13 @@ typedef ioptr const const_ioptr;
#define _REG_(x)
// Helper method used by hw_alias macros to optionally check input validity
static __force_inline uint32_t hw_alias_check_addr(volatile void *addr) {
uint32_t rc = (uintptr_t)addr;
invalid_params_if(ADDRESS_ALIAS, rc < 0x40000000); // catch likely non HW pointer types
return rc;
}
#define hw_alias_check_addr(addr) ((uintptr_t)(addr))
// can't use the following impl as it breaks existing static declarations using hw_alias, so would be a backwards incompatibility
//static __force_inline uint32_t hw_alias_check_addr(volatile void *addr) {
// uint32_t rc = (uintptr_t)addr;
// invalid_params_if(ADDRESS_ALIAS, rc < 0x40000000); // catch likely non HW pointer types
// return rc;
//}
// Helper method used by xip_alias macros to optionally check input validity
static __force_inline uint32_t xip_alias_check_addr(const void *addr) {