Example #1
0
//--------------------------------------------------------------------------------------------------
LE_SHARED size_t appCfg_GetSecStoreLimit
(
    appCfg_Iter_t appIterRef    ///< [IN] Apps iterator
)
{
    CheckFor(appIterRef, ITER_TYPE_APP);

    return le_cfg_GetInt(appIterRef->cfgIter, CFG_LIMIT_SEC_STORE, DEFAULT_LIMIT_SEC_STORE);
}
Example #2
0
//--------------------------------------------------------------------------------------------------
LE_SHARED appCfg_FaultAction_t appCfg_GetProcFaultAction
(
    appCfg_Iter_t procIterRef   ///< [IN] Apps iterator
)
{
    CheckFor(procIterRef, ITER_TYPE_PROC);

    char faultActionStr[LIMIT_MAX_FAULT_ACTION_NAME_BYTES];
    le_result_t result = le_cfg_GetString(procIterRef->cfgIter,
                                          CFG_NODE_FAULT_ACTION,
                                          faultActionStr,
                                          sizeof(faultActionStr),
                                          "");

    if (result != LE_OK)
    {
        LE_CRIT("Fault action string for process is too long.  Assume fault action is 'ignore'.");
        return APPCFG_FAULT_ACTION_IGNORE;
    }

    if (strcmp(faultActionStr, RESTART_STR) == 0)
    {
        return APPCFG_FAULT_ACTION_RESTART;
    }

    if (strcmp(faultActionStr, RESTART_APP_STR) == 0)
    {
        return APPCFG_FAULT_ACTION_RESTART_APP;
    }

    if (strcmp(faultActionStr, STOP_APP_STR) == 0)
    {
        return APPCFG_FAULT_ACTION_STOP_APP;
    }

    if (strcmp(faultActionStr, REBOOT_STR) == 0)
    {
        return APPCFG_FAULT_ACTION_REBOOT;
    }

    if (strcmp(faultActionStr, IGNORE_STR) == 0)
    {
        return APPCFG_FAULT_ACTION_IGNORE;
    }

    LE_WARN("Unrecognized fault action '%s'.  Defaulting to fault action 'ignore'.",
            faultActionStr);

    return APPCFG_FAULT_ACTION_IGNORE;
}
Example #3
0
//--------------------------------------------------------------------------------------------------
LE_SHARED le_result_t appCfg_GetProcExecName
(
    appCfg_Iter_t procIterRef,  ///< [IN] Apps iterator
    char* bufPtr,               ///< [OUT] Buffer to store the app name.
    size_t bufSize              ///< [IN] Size of the buffer.
)
{
    CheckFor(procIterRef, ITER_TYPE_PROC);

    if (le_cfg_NodeExists(procIterRef->cfgIter, "") == false)
    {
        return LE_NOT_FOUND;
    }

    return le_cfg_GetString(procIterRef->cfgIter, CFG_PROC_EXEC_NAME, bufPtr, bufSize, "");
}
Example #4
0
//--------------------------------------------------------------------------------------------------
LE_SHARED appCfg_StartMode_t appCfg_GetStartMode
(
    appCfg_Iter_t appIterRef    ///< [IN] Apps iterator
)
{
    CheckFor(appIterRef, ITER_TYPE_APP);

    bool startManual = le_cfg_GetBool(appIterRef->cfgIter, CFG_APP_START_MANUAL, false);

    if (startManual)
    {
        return APPCFG_START_MODE_MANUAL;
    }

    return APPCFG_START_MODE_AUTO;
}
Example #5
0
//--------------------------------------------------------------------------------------------------
LE_SHARED le_result_t appCfg_GetVersion
(
    appCfg_Iter_t appIterRef,   ///< [IN] Apps iterator
    char* bufPtr,               ///< [OUT] Buffer to store the app version.
    size_t bufSize              ///< [IN] Size of the buffer.
)
{
    CheckFor(appIterRef, ITER_TYPE_APP);

    if (le_cfg_NodeExists(appIterRef->cfgIter, "") == false)
    {
        return LE_NOT_FOUND;
    }

    return le_cfg_GetString(appIterRef->cfgIter, CFG_APP_VERSION, bufPtr, bufSize, "");
}
Example #6
0
//--------------------------------------------------------------------------------------------------
LE_SHARED le_result_t appCfg_GetAppName
(
    appCfg_Iter_t appIterRef,   ///< [IN] Apps iterator
    char* bufPtr,               ///< [OUT] Buffer to store the app name.
    size_t bufSize              ///< [IN] Size of the buffer.
)
{
    CheckFor(appIterRef, ITER_TYPE_APP);

    if (le_cfg_NodeExists(appIterRef->cfgIter, "") == false)
    {
        return LE_NOT_FOUND;
    }

    return le_cfg_GetNodeName(appIterRef->cfgIter, "", bufPtr, bufSize);
}
Example #7
0
//--------------------------------------------------------------------------------------------------
LE_SHARED appCfg_Iter_t appCfg_CreateAppProcIter
(
    appCfg_Iter_t appIterRef    ///< [IN] Apps iterator
)
{
    CheckFor(appIterRef, ITER_TYPE_APP);

    char pathStr[LE_CFG_STR_LEN_BYTES] = "";
    le_cfg_GetPath(appIterRef->cfgIter, "", pathStr, sizeof(pathStr));

    AppsIter_t* iterPtr = le_mem_ForceAlloc(AppIterPool);

    iterPtr->type = ITER_TYPE_PROC;
    iterPtr->cfgIter = le_cfg_CreateReadTxn(pathStr);
    le_cfg_GoToNode(iterPtr->cfgIter, CFG_PROCS_LIST);
    iterPtr->atFirst = true;

    return iterPtr;
}
Example #8
0
bool PatchTimers(u32 FirstVal, u32 Buffer)
{
    /* The floats in the data sections */
    if( FirstVal == FLT_TIMER_CLOCK_BUS_GC )
    {
        write32(Buffer, FLT_TIMER_CLOCK_BUS_WII);
        dbgprintf("PatchTimers:[Timer Clock float Bus] applied (0x%08X)\r\n", Buffer );
        return true;
    }
    if( FirstVal == FLT_TIMER_CLOCK_CPU_GC )
    {
        write32(Buffer, FLT_TIMER_CLOCK_CPU_WII);
        dbgprintf("PatchTimers:[Timer Clock float CPU] applied (0x%08X)\r\n", Buffer );
        return true;
    }
    if( FirstVal == FLT_TIMER_CLOCK_SECS_GC )
    {
        write32(Buffer, FLT_TIMER_CLOCK_SECS_WII);
        dbgprintf("PatchTimers:[Timer Clock float s] applied (0x%08X)\r\n", Buffer );
        return true;
    }
    if( FirstVal == FLT_TIMER_CLOCK_MSECS_GC )
    {
        write32(Buffer, FLT_TIMER_CLOCK_MSECS_WII);
        dbgprintf("PatchTimers:[Timer Clock float ms] applied (0x%08X)\r\n", Buffer );
        return true;
    }
    if( FirstVal == FLT_ONE_DIV_CLOCK_SECS_GC )
    {
        write32(Buffer, FLT_ONE_DIV_CLOCK_SECS_WII);
        dbgprintf("PatchTimers:[Timer Clock float 1/s] applied (0x%08X)\r\n", Buffer );
        return true;
    }
    if( FirstVal == FLT_ONE_DIV_CLOCK_MSECS_GC )
    {
        write32(Buffer, FLT_ONE_DIV_CLOCK_MSECS_WII);
        dbgprintf("PatchTimers:[Timer Clock float 1/ms] applied (0x%08X)\r\n", Buffer );
        return true;
    }
    if( FirstVal == FLT_ONE_DIV_CLOCK_1200_GC )
    {
        write32(Buffer, FLT_ONE_DIV_CLOCK_1200_WII);
        dbgprintf("PatchTimers:[Timer Clock float 1/1200] applied (0x%08X)\r\n", Buffer );
        return true;
    }
    /* For Nintendo Puzzle Collection */
    if( FirstVal == 0x38C00BB8 && (u32)Buffer == 0x770528 )
    {   //it IS a smooth 1.5 BUT the game is actually not properly timed, good job devs
        write32(Buffer, 0x38C01194);
        dbgprintf("PatchTimers:[Timer Clock Panel de Pon] applied (0x%08X)\r\n", Buffer );
        return true;
    }
    /* Coded in values */
    FirstVal &= 0xFC00FFFF;
    if( FirstVal == 0x3C0009A7 )
    {
        u32 NextP = CheckFor(Buffer, 0x6000EC80);
        if(NextP > 0)
        {
            W16(Buffer + 2, U32_TIMER_CLOCK_BUS_WII >> 16);
            W16(NextP + 2, U32_TIMER_CLOCK_BUS_WII & 0xFFFF);
            dbgprintf("PatchTimers:[Timer Clock ori Bus] applied (0x%08X)\r\n", Buffer );
            return true;
        }