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.

RTOS/PROCESSOR-SDK-TDAX: Use of chains_common_osal by network_ctrl

Part Number: PROCESSOR-SDK-TDAX

Tool/software: TI-RTOS

In the process of adding my own command to network_ctrl for our TDA2Px EVM, I noticed that NetworkCtrl_cmdHandlerEcho() calls ChainsCommon_Osal_getVirtAddr(). Why is this needed? Two of the functions in chains_common_osal.c make no sense to me, since they just return the parameter that was passed to them. It does not appear to even act as a cast, since the return type is the same. Do I need to use this to for some reason?

UInt32 ChainsCommon_Osal_getVirtAddr(UInt32 phyAddr)
{
    return (phyAddr);
}

UInt32 ChainsCommon_Osal_getPhysAddr(UInt32 virtAddr)
{
    return (virtAddr);
}

As a sidenote, does Osal mean?

Thanks.

  • Hello ,

    In the same file you have 2 definitions of the same functions covered under the macro
    #if defined(LINUX_BUILD) || defined(QNX_BUILD)
    UInt32 ChainsCommon_Osal_getVirtAddr(UInt32 phyAddr)
    {
    UInt32 virtAddr;

    virtAddr = OSA_memPhys2Virt(
    (unsigned int)phyAddr,
    OSA_MEM_REGION_TYPE_AUTO);

    return (virtAddr);
    }

    UInt32 ChainsCommon_Osal_getPhysAddr(UInt32 virtAddr)
    {
    UInt32 physAddr;

    physAddr = OSA_memVirt2Phys(
    (unsigned int)virtAddr,
    OSA_MEM_REGION_TYPE_AUTO);

    return (physAddr);
    }
    else
    UInt32 ChainsCommon_Osal_getVirtAddr(UInt32 phyAddr)
    {
    return (phyAddr);
    }

    UInt32 ChainsCommon_Osal_getPhysAddr(UInt32 virtAddr)
    {
    return (virtAddr);
    }
    #endif

    In case of linux/hlos we need to convert the physical to virtual , in case of bios it will not impact hence it returns the same address .

    Regards
    Chetan.M