Minidriver system page entry
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]; };
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:
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"); }
QNX Neutrino