SYS/BIOS
7.00
|
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.
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:
|
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/runtime/Error.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_Object * | GateTask_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 struct GateTask_Params GateTask_Params |
typedef struct GateTask_Struct GateTask_Struct |
typedef struct GateTask_Struct GateTask_Object |
typedef GateTask_Object* GateTask_Handle |
bool GateTask_canBePreempted | ( | void | ) |
query Gate 'preempt' characteristics
GateTask can be preempted by an Hwi or Swi interrupt. Always returns true
.
true |
bool GateTask_canBlock | ( | void | ) |
query Gate 'blocking' characteristics
GateTask enter will never block. This API always returns false
.
false |
GateTask_Handle GateTask_create | ( | const GateTask_Params * | prms, |
Error_Block * | eb | ||
) |
Create a GateTask
gate.
prms | optional parameters |
eb | error block |
GateTask | handle (NULL on failure) |
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.
obj | pointer to a GateTask object |
prms | optional parameters |
GateTask | handle (NULL on failure) |
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.
gate | pointer to a GateTask handle |
void GateTask_destruct | ( | GateTask_Struct * | obj | ) |
Destruct a GateTask
gate.
obj | pointer to a GateTask objects |
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.
prms | pointer to uninitialized params structure |
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.
gate | GateTask handle |
opaque | key to be passed to 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.
gate | GateTask handle |
key | opaque key to unlock the gate |