Interrupt control. More...
Functions | |
| int | BZ_IrqDisable (int irq) |
| Disable or enable the IRQ interrupt. | |
| int | BZ_FiqDisable (int fiq) |
| Disable or enable the FIQ interrupt. | |
| int | BZ_SwapWord (int data, int *addr) |
| Atomic swap with a memory word. | |
| char | BZ_SwapByte (char data, char *addr) |
| Atomic swap with a memory byte. | |
Interrupt control.
When dealing with hardware, you often must disable interrupts for short intervals. The kernel provides functions that allow you to enable and disable them. Furthermore, even though the kernel does not support the fast interrupt mechanism of the ARM core, it provides the functions to enable and disable FIQ, in case you want to implement your own FIQ handler. In addition, the atomic swap with a memory word is also provided.
| int BZ_FiqDisable | ( | int | fiq | ) |
Disable or enable the FIQ interrupt.
The function disables or enables the FIQ interrupt and returns its status prior to the effect of the function.
| fiq | The desiredt state of the FIQ disable flag. If the parameter is 0 (i.e. false), then the FIQ will be enabled. If it is non-0, then FIQ interrupts will be disabled. |
| int BZ_IrqDisable | ( | int | irq | ) |
Disable or enable the IRQ interrupt.
The function disables or enables the IRQ interrupt and returns its status prior to the effect of the function.
| irq | The desiredt state of the IRQ disable flag. If the parameter is 0 (i.e. false), then the IRQ will be enabled. If it is non-0, then IRQ interrupts will be disabled. |
| char BZ_SwapByte | ( | char | data, | |
| char * | addr | |||
| ) |
Atomic swap with a memory byte.
The function stores its first argument at the byte in memory pinted by its second argument and returns the content of the memory byte before the store. The reading of the memory byte and the subsequent writing of the argument into it is atomic, not even a DMA operation can interveen between the two accesses.
| data | The data to be stored in the memory byte | |
| addr | The address of the memory byte |
| int BZ_SwapWord | ( | int | data, | |
| int * | addr | |||
| ) |
Atomic swap with a memory word.
The function stores its first argument at the integer word in memory pointed by its second argument and returns the content of the word before the store. The reading of the memory word and the subsequent writing of the argument into it is atomic, not even a DMA operation can interveen between the two accesses.
| data | The data to be stored in the memory word | |
| addr | The address of the memory word |
1.7.1