mdriver_entry

Minidriver system page entry

Synopsis:

struct mdriver_entry
{
   uint32_t    intr;
   int         (*handler)(int state, void *data);
   void        *data;
   paddr32_t   data_paddr;
   uint32_t    data_size;
   uint32_t    name;
   uint32_t    internal;
   uint32_t    spare[1];
};

Description:

Each entry for a minidriver is stored in the system page. In order for a full (process time) driver to find a minidriver and gain access to its data area, it must access the system page. The members of this structure are:

intr
The interrupt, which the minidriver is attached to.
handler
The minidriver handler function.
data
The physical address of the minidriver's data area.
data_paddr
data_size
The size of the minidriver's data area, in bytes.
name
The name of the minidriver, added by mdriver_add(). This value is the offset into the system page strings section where the name is stored.

Access to this information is done through the SYSPAGE_ENTRY() macro: SYSPAGE_ENTRY(mdriver)[i].data_paddr Where i is the index into the minidriver section. You can use the name field can be used to locate a specific minidriver if there are multiple ones running in the system, possibly attached to the same interrupt. Sample code used to access this information would look like:

int i, num_drivers = 0;
struct mdriver_entry    *mdriver;

mdriver = (struct mdriver_entry *) SYSPAGE_ENTRY(mdriver);
num_drivers = _syspage_ptr->mdriver.entry_size/sizeof(*mdriver);
printf("Number of Installed minidrivers = %d\n\n", num_drivers);
for (i = 0; i < num_drivers; i++)
    {
        printf("Minidriver entry .. %d\n", i);
        printf("Name .............. %s\n",
           SYSPAGE_ENTRY(strings)->data + mdriver[i].name);
        printf("Interrupt ......... 0x%X\n", mdriver[i].intr);
        printf("Data size ......... %d\n", mdriver[i].data_size);
        printf("\n");
    }

Classification:

QNX Neutrino