• <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • System Task Manager SDK Reference  5.10
    All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
    stm_manager.h File Reference

    Detailed Description

    STM Runtime.

    Overview: STM is a co-operative, non-preemptive, static scheduling framework for real-time systems. The STM runtime is a library that executes a schedule produced offline by the STM compiler, enforcing data dependency ordering and control flow ordering across engines on a Tegra SoC.

    STM Manager: Manager correspond to a single process controlling schedule execution. Manager is expected to launch and connect with Master before any Client connect to Master.

    STM Master: Alongside STM clients, STM master expects a Manager process to connect with it. STM Manager will block at the call to stmScheduleManagerInit() until the STM master process has been launched.

    Definition in file stm_manager.h.

    Go to the source code of this file.

    Functions

    STM_API stmErrorCode_t stmScheduleManagerExit (void)
     Cleans up STM schedule Manager context. No STM APIs can be called after this. More...
     
    STM_API stmErrorCode_t stmScheduleManagerInit (const char *scheduleManagerName)
     Initialize STM schedule manager context. More...
     
    STM_API stmErrorCode_t stmScheduleManagerInitWithDiscriminator (const char *scheduleManagerName, int32_t discriminator)
     Initialize STM schedule manager context with a discriminator. More...
     
    STM_API stmErrorCode_t stmStartSchedule (uint16_t scheduleId)
     Schedule Management API for starting Schedule Execution. More...
     
    STM_API stmErrorCode_t stmStopSchedule (uint16_t scheduleId)
     Schedule Management API for stopping Schedule Execution. More...
     

    Function Documentation

    ◆ stmScheduleManagerExit()

    STM_API stmErrorCode_t stmScheduleManagerExit ( void  )

    Cleans up STM schedule Manager context. No STM APIs can be called after this.

    Remarks
    This API can only be called once per call to stmScheduleManagerInit(); doing so multiple times will cause undefined behavior.
    Returns
    stmErrorCode_t, the completion code of the operation:
    • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
    • STM_ERROR_GENERIC if fail to release some OS resources. check debug logs for further information

    ◆ stmScheduleManagerInit()

    STM_API stmErrorCode_t stmScheduleManagerInit ( const char *  scheduleManagerName)

    Initialize STM schedule manager context.

    Remarks
    This API must be called before any other STM Schedule Management APIs. This API will block until the STM master process is started. Manager's context should be cleaned up with stmScheduleManagerExit() after STM has completed its execution. There is only one schedule manager in the system
    Returns
    stmErrorCode_t, the completion code of the operation:
    • STM_ERROR_INSUFFICIENT_MEMORY : failure of memory allocation of STM.
    • STM_ERROR_BAD_VALUE : unsupported value for discriminator.
    • STM_ERROR_NOT_SUPPORTED : connection to master not enabled. ignore this error for dual SOC case and soc is secondary
    • STM_ERROR_GENERIC : Failed to receive messages from master.

    ◆ stmScheduleManagerInitWithDiscriminator()

    STM_API stmErrorCode_t stmScheduleManagerInitWithDiscriminator ( const char *  scheduleManagerName,
    int32_t  discriminator 
    )

    Initialize STM schedule manager context with a discriminator.

    Remarks
    This API must be called before any other STM Schedule Management APIs. This API will block until the STM master process with this discriminator is started. Manager's context should be cleaned up with stmScheduleManagerExit() after STM has completed its execution. Manager must call at most one of the two: stmScheduleManagerInit() or stmScheduleManagerInitWithDiscriminator(), if both are called single or multiple times, it will cause undefined behavior. There is only one schedule manager in the system. All negative values of discriminator are equivalent and the same as calling stmScheduleManagerInit()
    Returns
    stmErrorCode_t, the completion code of the operation:
    • STM_ERROR_INSUFFICIENT_MEMORY : failure of memory allocation of STM.
    • STM_ERROR_BAD_VALUE : unsupported value for discriminator.
    • STM_ERROR_NOT_SUPPORTED : connection to master not enabled. ignore this error for dual SOC case and soc is secondary
    • STM_ERROR_GENERIC : Failed to receive messages from master.

    ◆ stmStartSchedule()

    STM_API stmErrorCode_t stmStartSchedule ( uint16_t  scheduleId)

    Schedule Management API for starting Schedule Execution.

    Remarks
    This API must be called between stmScheduleManagerInit()/stmScheduleManagerInitWithDiscriminator() and stmScheduleManagerExit()
    Returns
    stmErrorCode_t, the completion code of the operation:
    • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
    • STM_ERROR_BAD_STATE_TRANSITION : If current state is not READY
    • STM_ERROR_BAD_VALUE : if format of state messages are incorrect.
    • STM_ERROR_INSUFFICIENT_MEMORY : if malloc failure happened.
    • STM_ERROR_GENERIC : if message send/receive fails.

    ◆ stmStopSchedule()

    STM_API stmErrorCode_t stmStopSchedule ( uint16_t  scheduleId)

    Schedule Management API for stopping Schedule Execution.

    Remarks
    This API must be called between stmScheduleManagerInit()/stmScheduleManagerInitWithDiscriminator() and stmScheduleManagerExit()
    Returns
    stmErrorCode_t, the completion code of the operation:
    • STM_ERROR_NOT_INITIALIZED if not init api was called or called but failed.
    • STM_ERROR_BAD_STATE_TRANSITION : If current state is not RUNNING.
    • STM_ERROR_BAD_VALUE : if format of state messages are incorrect.
    • STM_ERROR_INSUFFICIENT_MEMORY : if malloc failure happened.
    • STM_ERROR_GENERIC : if message send/receive fails.
    人人超碰97caoporen国产