Functions | |
__inline__ unsigned short | lock (void) |
__inline__ void | unlock (void) |
__inline__ void | restore (unsigned short mask) |
__inline__ void | interruption_point (void) |
sei
) and enabling them after the critical section. In general, this method assumes the processor accepts interrupts when lock()
is called. This strategy is not suitable to implement functions that will be called with interrupts masked because this will create a side-effect: enable interrupts.
Example:
lock (); ... unlock ();
Example:
unsigned short mask; mask = lock (); ... restore (mask);
Sometimes it is necessary to allow interrupt processing again to make sure interrupts are not masked for a too long period. In this case, unlocking and relocking interrupts afterwards allows this. The function interruption_point
is defined for this.
|
Define an interruption point. In a big masked section, it is sometimes useful to release the interrupt mask to accept pending interrupts. This operation is intended to be used in some very specific situations where interrupts are masked and the code is ready to release the lock for a while. It must not be used within a critical section: it would break it.
Definition at line 135 of file asm-m68hc11/locks.h. |
|
Lock the processor to prevent interrupts to occur. When the processor is locked, interrupts are not accepted. They are deferred until the processor is unlocked. The previous locking mask is returned in the high part (bits 15..8) to avoid a tab instruction.
Definition at line 91 of file asm-m68hc11/locks.h. |
|
Restore the interrupt mask of the processor. The mask is assumed to be in the high part (bits 15..8) to avoid a tba instruction.
Definition at line 118 of file asm-m68hc11/locks.h. |
|
Unlock the processor to accept interrupts. When the processor is unlocked, interrupts are accepted. Use this operation if you want, authoritatively, accept the interrupts.
Definition at line 106 of file asm-m68hc11/locks.h. |