This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Why using the different function in appMemMap and appMemGetVirt2PhyBufPtr?

Part Number: TDA4VM

In the QNX platform.

The appMemMap function using mmap to transform the physical address to virtual address.

But the appMemGetVirt2PhyBufPtr using mem_offset64 to transform the virtual address to physical address.

Function implement in file :

PSDKRA/vision_apps/utils/console_io/src/app_log_qnx.c 

PSDKRA/vision_apps/utils/mem/src/app_mem_qnx.c

Why it is different ? In my opinion, the mmap -> mem_offset, the mmap64 -> mem_offset64.

More question, If I do the following step:

1) I transform the phycial address 0xB200_0000 to virtual address using mmap.
2) And then transform it back to phycial address using mem_offset.
3) I got a 64bit return value.

Can I ignore the high 32 bits, only using the low 32 bits ?

  • Correction:

    1) I transform the phycial address 0xB200_0000 to virtual address using mmap.
    2) And then transform it back to phycial address using *mem_offset64*.
    3) I got a 64bit return value.

  • Hi,

    The mmap() an mmap64() APIs are documented at - mmap(), mmap64(), mmap_handle() (qnx.com).

    The mmap64() will return a 64 bit virtual address, the mmap() will return a 32 bit virtual address.   Ideally the mmap() in  PSDKRA/vision_apps/utils/mem/src/app_mem_qnx.c should be using mmap64() instead.

    The mem_offset64() API is documented at - mem_offset(), mem_offset64() (qnx.com).  This API will return a 64bit physical address.   The API does not mention any restrictions on the virtual address that is used as input.

    Regards,

    kb

  • Hi KB,

    > Ideally the mmap() in  PSDKRA/vision_apps/utils/mem/src/app_mem_qnx.c should be using mmap64() instead.

    Whether to consider correcting in the next version of the SDK ?

    > The API does not mention any restrictions on the virtual address that is used as input.

    So, about my question, Is it possible to ignore the high 32bit bits?

  • Hi,

    A TI internal ticket has been raised to get the aforementioned code updated to use mmap64().

    Regarding "Is it possible to ignore the high 32 bit bits".  The address that is provided by mem_offset64() in 'offset', is a physical address, and if that memory is located at an address above 2G, then the upper 32 bits would need to be considered. 

    Regards,

    kb