HWI_restore
Application Program Interface
2-171
C Interface
Syntax
HWI_restore(oldST1);
Parameters
Uns
oldST1;
Returns
Void
Reentrant
yes
Description
HWI_restore sets the intm bit in the st1 register using bit 11 of the oldst1
parameter. If bit 11 is 1, the intm bit is not modified. If bit 11 is 0, the intm
bit is set to 0, which enables interrupts.
When you call HWI_disable, the previous contents of the st1 register are
returned. You can use this returned value with HWI_restore.
A context switch may occur when calling HWI_restore if HWI_restore
reenables interrupts and if a higher-priority HWI occurred while interrupts
were disabled.
HWI_restore may be called from main(). However, since HWI_enable
cannot be called from main(), interrupts are always disabled in main(),
and a call to HWI_restore has no effect.
Constraints and
Calling Context
❏
HWI_restore must be called with interrupts disabled. The parameter
passed to HWI_restore must be the value returned by HWI_disable.
Example
oldST1 = HWI_disable
()
; /* disable interrupts */
'do some critical operation'
HWI_restore(oldST1);
/* re-enable interrupts if they
were enabled at the start of the
critical section */
See Also
HWI_restore
Restore global interrupt enable state