Udma_defaultVirtToPhyFxn does not takes the compiler dependency into account

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • SITSW-12542
    • 12.00.00
    • 12.02.00
    • Hide
      am62xx-sk
      am62xx-sk-lp
      am62x-sip-sk
      am62a-sk
      am62p-sk
      am62d-evm
      am275x-evm
      am243x-evm
      am243x-lp
      am64xx-evm
      am64xx-sk
      Show
      am62xx-sk am62xx-sk-lp am62x-sip-sk am62a-sk am62p-sk am62d-evm am275x-evm am243x-evm am243x-lp am64xx-evm am64xx-sk

      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);
      } 

       

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-6889 - Udma_defaultVirtToPhyFxn does not t...
                ERROR
                • Last Sync Date: