RTEMS CPU Kit with SuperCore
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <drvmgr/drvmgr.h>
#include "drvmgr_internal.h"
Functions | |
int | drvmgr_get_dev (struct drvmgr_drv *drv, int minor, struct drvmgr_dev **pdev) |
Get Device pointer from Driver and Driver minor number. More... | |
int | drvmgr_freq_get (struct drvmgr_dev *dev, int options, unsigned int *freq_hz) |
Get Bus frequency in Hertz. More... | |
int | drvmgr_get_dev_prefix (struct drvmgr_dev *dev, char *dev_prefix) |
Get device name prefix, this name can be used to register a unique name in the bus->error filesystem or to get an idea where the device is located. More... | |
int | drvmgr_interrupt_register (struct drvmgr_dev *dev, int index, const char *info, drvmgr_isr isr, void *arg) |
Register a shared interrupt handler. More... | |
int | drvmgr_interrupt_unregister (struct drvmgr_dev *dev, int index, drvmgr_isr isr, void *arg) |
Unregister an interrupt handler. More... | |
int | drvmgr_interrupt_clear (struct drvmgr_dev *dev, int index) |
Clear (ACK) pending interrupt. More... | |
int | drvmgr_interrupt_unmask (struct drvmgr_dev *dev, int index) |
Force unmasking/enableing an interrupt on the interrupt controller, this is not normally used, if used the caller has masked/disabled the interrupt just before. More... | |
int | drvmgr_interrupt_mask (struct drvmgr_dev *dev, int index) |
Force masking/disable an interrupt on the interrupt controller, this is not normally performed since this will stop all other (shared) ISRs to be disabled until _unmask() is called. More... | |
int | drvmgr_on_rootbus (struct drvmgr_dev *dev) |
Return 0 if dev is not located on the root bus, 1 if on root bus. | |
int drvmgr_freq_get | ( | struct drvmgr_dev * | dev, |
int | options, | ||
unsigned int * | freq_hz | ||
) |
Get Bus frequency in Hertz.
Frequency is stored into address of freq_hz.
dev | The Device to get Bus frequency for. |
options | Bus-type specific options |
freq_hz | Location where Bus Frequency will be stored. |
int drvmgr_get_dev | ( | struct drvmgr_drv * | drv, |
int | minor, | ||
struct drvmgr_dev ** | pdev | ||
) |
Get Device pointer from Driver and Driver minor number.
drv | Driver the device is united with. |
minor | Driver minor number assigned to device. |
pdev | Location where the Device point will be stored. |
int drvmgr_get_dev_prefix | ( | struct drvmgr_dev * | dev, |
char * | dev_prefix | ||
) |
Get device name prefix, this name can be used to register a unique name in the bus->error filesystem or to get an idea where the device is located.
dev | The Device to get the device Prefix for. |
dev_prefix | Location where the prefix will be stored. |
References drvmgr_bus_params::dev_prefix, drvmgr_bus::ops, and drvmgr_dev::parent.
int drvmgr_interrupt_clear | ( | struct drvmgr_dev * | dev, |
int | index | ||
) |
Clear (ACK) pending interrupt.
dev | Device to clear interrupt for. |
index | Index is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number. |
isr | Interrupt Service Routine, previously registered. |
arg | Optional ISR argument, previously registered. |
int drvmgr_interrupt_mask | ( | struct drvmgr_dev * | dev, |
int | index | ||
) |
Force masking/disable an interrupt on the interrupt controller, this is not normally performed since this will stop all other (shared) ISRs to be disabled until _unmask() is called.
dev | Device to mask interrupt for. |
index | Index is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number. |
int drvmgr_interrupt_register | ( | struct drvmgr_dev * | dev, |
int | index, | ||
const char * | info, | ||
drvmgr_isr | isr, | ||
void * | arg | ||
) |
Register a shared interrupt handler.
Since this service is shared among interrupt drivers/handlers the handler[arg] must be installed before the interrupt can be cleared or disabled. The handler is by default disabled after registration.
index | Index is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number. |
isr | Interrupt Service Routine. |
arg | Optional ISR argument. |
int drvmgr_interrupt_unmask | ( | struct drvmgr_dev * | dev, |
int | index | ||
) |
Force unmasking/enableing an interrupt on the interrupt controller, this is not normally used, if used the caller has masked/disabled the interrupt just before.
dev | Device to clear interrupt for. |
index | Index is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number. |
isr | Interrupt Service Routine, previously registered. |
arg | Optional ISR argument, previously registered. |
int drvmgr_interrupt_unregister | ( | struct drvmgr_dev * | dev, |
int | index, | ||
drvmgr_isr | isr, | ||
void * | arg | ||
) |
Unregister an interrupt handler.
This also disables the interrupt before unregistering the interrupt handler.
index | Index is used to identify the IRQ number if hardware has multiple IRQ sources. Normally Index is set to 0 to indicated the first and only IRQ source. A negative index is interpreted as a absolute bus IRQ number. |
isr | Interrupt Service Routine, previously registered. |
arg | Optional ISR argument, previously registered. |