Example #1
0
status_t init_module(void)
{
    status_t status = B_ENTRY_NOT_FOUND;
    pci_info info;
    int ix = 0;

    if (get_module(B_PCI_MODULE_NAME, (module_info **)&gPCI))
        return ENOSYS;

    while ((*gPCI->get_nth_pci_info)(ix++, &info) == B_OK) {
        if (VBoxGuestHaikuProbe(&info) == 0) {
            // we found it
            status = VBoxGuestHaikuAttach(&info);
            break;
        }
    }

    return status;
}
Example #2
0
status_t init_module(void)
{
    status_t err = B_ENTRY_NOT_FOUND;
    pci_info info;
    int ix = 0;

    err = get_module(B_PCI_MODULE_NAME, (module_info **)&gPCI);
    if (err != B_OK)
        return err;

    while ((*gPCI->get_nth_pci_info)(ix++, &info) == B_OK)
    {
        if (VBoxGuestHaikuProbe(&info) == 0)
        {
            /* We found it */
            err = VBoxGuestHaikuAttach(&info);
            return err;
        }
    }

    return B_ENTRY_NOT_FOUND;
}