SYS/BIOS  7.00
Data Structures | Typedefs | Functions
GateTask.h File Reference

Detailed Description

Software Interrupt Gate.

GateTask uses Task_disable() and Task_restore() as the resource locking mechanism. This gate can be used whenever the resource is being shared by Tasks.

The duration between the enter and leave should be as short as possible to minimize Task scheduling latency.

Calling Context

Function Hwi Swi Task Main Startup
Params_init Y Y Y Y Y
query Y Y Y Y Y
construct Y Y Y Y N
create N* N* Y Y N
delete N* N* Y Y N
destruct Y Y Y Y N
enter N N Y Y** Y**
leave N N Y Y** Y**
Definitions:
  • Hwi: API is callable from a Hwi thread.
  • Swi: API is callable from a Swi thread.
  • Task: API is callable from a Task thread.
  • Main: API is callable during any of these phases:
    • In your module startup after this module is started (e.g. GateHwi_Module_startupDone() returns true).
    • During xdc.runtime.Startup.lastFxns.
    • During main().
    • During BIOS.startupFxns.
  • Startup: API is callable during any of these phases:
    • During xdc.runtime.Startup.firstFxns.
    • In your module startup before this module is started (e.g. GateHwi_Module_startupDone() returns false).
  • *: Assuming blocking Heap is used for creation.
  • **: Must be used in enter/leave pairs.

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/runtime/Error.h>
Include dependency graph for GateTask.h:

Go to the source code of this file.

Data Structures

struct  GateTask_Params
 
struct  GateTask_Struct
 

Typedefs

typedef struct GateTask_Params GateTask_Params
 
typedef struct GateTask_Struct GateTask_Struct
 
typedef struct GateTask_Struct GateTask_Object
 
typedef GateTask_ObjectGateTask_Handle
 

Functions

bool GateTask_canBePreempted (void)
 query Gate 'preempt' characteristics More...
 
bool GateTask_canBlock (void)
 query Gate 'blocking' characteristics More...
 
GateTask_Handle GateTask_create (const GateTask_Params *prms, Error_Block *eb)
 Create a GateTask gate. More...
 
GateTask_Handle GateTask_construct (GateTask_Struct *obj, const GateTask_Params *prms)
 Construct a GateTask gate. More...
 
void GateTask_delete (GateTask_Handle *gate)
 Delete a GateTask gate. More...
 
void GateTask_destruct (GateTask_Struct *obj)
 Destruct a GateTask gate. More...
 
void GateTask_Params_init (GateTask_Params *prms)
 Initialize the GateTask_Params structure with default values. More...
 
intptr_t GateTask_enter (GateTask_Handle gate)
 enter the GateTask gate More...
 
void GateTask_leave (GateTask_Handle gate, intptr_t key)
 leave the GateTask gate More...
 

Typedef Documentation

§ GateTask_Params

§ GateTask_Struct

§ GateTask_Object

§ GateTask_Handle

Function Documentation

§ GateTask_canBePreempted()

bool GateTask_canBePreempted ( void  )

query Gate 'preempt' characteristics

GateTask can be preempted by an Hwi or Swi interrupt. Always returns true.

Return values
true

§ GateTask_canBlock()

bool GateTask_canBlock ( void  )

query Gate 'blocking' characteristics

GateTask enter will never block. This API always returns false.

Return values
false

§ GateTask_create()

GateTask_Handle GateTask_create ( const GateTask_Params prms,
Error_Block eb 
)

Create a GateTask gate.

Parameters
prmsoptional parameters
eberror block
Return values
GateTaskhandle (NULL on failure)

§ GateTask_construct()

GateTask_Handle GateTask_construct ( GateTask_Struct obj,
const GateTask_Params prms 
)

Construct a GateTask gate.

GateTask_construct is equivalent to GateHwi_create except that the GateTask_Struct is pre-allocated.

Parameters
objpointer to a GateTask object
prmsoptional parameters
Return values
GateTaskhandle (NULL on failure)

§ GateTask_delete()

void GateTask_delete ( GateTask_Handle gate)

Delete a GateTask gate.

Note that GateTask_delete takes a pointer to a GateHwi_Handle which enables GateTask_delete to set the GateHwi handle to NULL.

Parameters
gatepointer to a GateTask handle

§ GateTask_destruct()

void GateTask_destruct ( GateTask_Struct obj)

Destruct a GateTask gate.

Parameters
objpointer to a GateTask objects

§ GateTask_Params_init()

void GateTask_Params_init ( GateTask_Params prms)

Initialize the GateTask_Params structure with default values.

GateTask_Params_init initializes the GateHwi_Params structure with default values. GateTask_Params_init should always be called before setting individual parameter fields. This allows new fields to be added in the future with compatible defaults – existing source code does not need to change when new fields are added.

Parameters
prmspointer to uninitialized params structure

§ GateTask_enter()

intptr_t GateTask_enter ( GateTask_Handle  gate)

enter the GateTask gate

GateTask_enter enters the GateHwi gate and returns a key for use by GateTask_enter. GateHwi_enter calls can be nested and the key is used to unlock the gate on the final call to GateTask_leave.

Parameters
gateGateTask handle
Return values
opaquekey to be passed to GateTask_leave()

§ GateTask_leave()

void GateTask_leave ( GateTask_Handle  gate,
intptr_t  key 
)

leave the GateTask gate

GateTask_leave exits the GateHwi gate if key matches the outermost call to GateTask_enter. If GateHwi_enter calls are nested, the key will keep the nested calls from leaving the gate.

Parameters
gateGateTask handle
keyopaque key to unlock the gate
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale