SYS/BIOS
7.00
|
Hardware Interrupt Gate.
GateHwi uses disabling and enabling of interrupts as the resource locking mechanism. Such a gate guarantees exclusive access to the CPU. This gate can be used whenever the resource is being shared by Tasks, Swis, and/or Hwis.
The duration between the enter and leave should be as short as possible to minimize Hwi latency.
GateHwi inherits from xdc.runtime.IGateProvider, therefore supports nesting.
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 | Y | Y | Y | Y** | Y** |
leave | Y | Y | Y | Y** | Y** |
Definitions:
|
Go to the source code of this file.
Data Structures | |
struct | GateHwi_Params |
struct | GateHwi_Struct |
Typedefs | |
typedef struct GateHwi_Params | GateHwi_Params |
typedef struct GateHwi_Struct | GateHwi_Struct |
typedef struct GateHwi_Struct | GateHwi_Object |
typedef GateHwi_Object * | GateHwi_Handle |
Functions | |
bool | GateHwi_canBePreempted (void) |
query Gate 'preempt' characteristics More... | |
bool | GateHwi_canBlock (void) |
query Gate 'blocking' characteristics More... | |
GateHwi_Handle | GateHwi_create (const GateHwi_Params *prms, Error_Block *eb) |
Create a GateHwi gate. More... | |
GateHwi_Handle | GateHwi_construct (GateHwi_Struct *obj, const GateHwi_Params *prms) |
Construct a GateHwi gate. More... | |
void | GateHwi_delete (GateHwi_Handle *gate) |
Delete a GateHwi gate. More... | |
void | GateHwi_destruct (GateHwi_Struct *obj) |
Destruct a GateHwi gate. More... | |
void | GateHwi_Params_init (GateHwi_Params *prms) |
Initialize the GateHwi_Params structure with default values. More... | |
intptr_t | GateHwi_enter (GateHwi_Handle gate) |
enter the GateHwi gate More... | |
void | GateHwi_leave (GateHwi_Handle gate, intptr_t key) |
leave the GateHwi gate More... | |
typedef struct GateHwi_Params GateHwi_Params |
typedef struct GateHwi_Struct GateHwi_Struct |
typedef struct GateHwi_Struct GateHwi_Object |
typedef GateHwi_Object* GateHwi_Handle |
bool GateHwi_canBePreempted | ( | void | ) |
query Gate 'preempt' characteristics
GateHwi cannot be preempted. This API always returns false
.
false |
bool GateHwi_canBlock | ( | void | ) |
query Gate 'blocking' characteristics
GateHwi enter will never block. This API always returns false
.
false |
GateHwi_Handle GateHwi_create | ( | const GateHwi_Params * | prms, |
Error_Block * | eb | ||
) |
Create a GateHwi
gate.
prms | optional parameters |
eb | error block |
GateHwi | handle (NULL on failure) |
GateHwi_Handle GateHwi_construct | ( | GateHwi_Struct * | obj, |
const GateHwi_Params * | prms | ||
) |
Construct a GateHwi
gate.
GateHwi_construct is equivalent to GateHwi_create except that the GateHwi_Struct is pre-allocated.
obj | pointer to a GateHwi object |
prms | optional parameters |
GateHwi | handle (NULL on failure) |
void GateHwi_delete | ( | GateHwi_Handle * | gate | ) |
Delete a GateHwi
gate.
Note that GateHwi_delete takes a pointer to a GateHwi_Handle which enables GateHwi_delete to set the GateHwi handle to NULL.
gate | pointer to a GateHwi handle |
void GateHwi_destruct | ( | GateHwi_Struct * | obj | ) |
Destruct a GateHwi
gate.
obj | pointer to a GateHwi objects |
void GateHwi_Params_init | ( | GateHwi_Params * | prms | ) |
Initialize the GateHwi_Params structure with default values.
GateHwi_Params_init initializes the GateHwi_Params structure with default values. GateHwi_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 GateHwi_enter | ( | GateHwi_Handle | gate | ) |
enter the GateHwi gate
GateHwi_enter enters the GateHwi gate and returns a key for use by GateHwi_enter. GateHwi_enter calls can be nested and the key is used to unlock the gate on the final call to GateHwi_leave.
gate | GateHwi handle |
opaque | key to be passed to GateHwi_leave() |
void GateHwi_leave | ( | GateHwi_Handle | gate, |
intptr_t | key | ||
) |
leave the GateHwi gate
GateHwi_leave exits the GateHwi gate if key matches the outermost call to GateHwi_enter. If GateHwi_enter calls are nested, the key will keep the nested calls from leaving the gate.
gate | GateHwi handle |
key | opaque key to unlock the gate |