-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Medium
-
SITSW-12542
-
12.00.00
-
12.02.00
-
Problem: As per a customer's SCI request header(customer is using GCC compiler), the upper address field (address_hi) is incorrectly populated with 0xFFFFFFFF. We are suspecting that this appears to be caused by a direct cast from a 32-bit void* pointer to a 64-bit integer, which triggers a sign extension on the 32-bit R5F core. This corrupts the upper 32 bits of the address(ex: 0xXXXXXXXX becomes 0xFFFFFFFFXXXXXXXX).
Udma_defaultVirtToPhyFxn does not takes the compiler dependency into account.
A fixed version of the API can be as follows:
static uint64_t Udma_defaultVirtToPhyFxn(const void *virtAddr, uint32_t chNum, void *appData) { #if defined (__aarch64__) uint64_t temp = (uint64_t)virtAddr; #else /* R5 is a 32-bit machine; need to truncate to avoid sign extension */ uint32_t temp = (uint32_t)virtAddr; #endif return ((uint64_t) temp); }