VirtualBox

Ignore:
Timestamp:
Aug 15, 2016 12:25:41 AM (8 years ago)
Author:
vboxsync
Message:

VBoxGuest-netbsd.c: don't save a pointer to transient pci_attach_args,
we only really need pci chipset tag (to disestablish the interrupt).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-netbsd.c

    r63411 r63449  
    7676{
    7777    device_t sc_dev;
    78     struct pci_attach_args *pa;
     78    pci_chipset_tag_t pc;
    7979    bus_space_tag_t io_tag;
    8080    bus_space_handle_t io_handle;
     
    124124 */
    125125static void VBoxGuestNetBSDRemoveIRQ(vboxguest_softc *sc);
    126 static int  VBoxGuestNetBSDAddIRQ(vboxguest_softc *pvState);
     126static int  VBoxGuestNetBSDAddIRQ(vboxguest_softc *pvState, struct pci_attach_args *pa);
    127127static int  VBoxGuestNetBSDISR(void *pvState);
    128128
     
    420420 * @returns NetBSD error code.
    421421 * @param   vboxguest  Pointer to the state info structure.
    422  */
    423 static int VBoxGuestNetBSDAddIRQ(vboxguest_softc *vboxguest)
     422 * @param   pa  Pointer to the PCI attach arguments.
     423 */
     424static int VBoxGuestNetBSDAddIRQ(vboxguest_softc *vboxguest, struct pci_attach_args *pa)
    424425{
    425426    int iResId = 0;
    426427    int rc = 0;
    427     struct pci_attach_args *pa = vboxguest->pa;
    428428    const char *intrstr;
    429429#if __NetBSD_Prereq__(6, 99, 39)
     
    437437        return VERR_DEV_IO_ERROR;
    438438    }
    439     intrstr = pci_intr_string(vboxguest->pa->pa_pc, vboxguest->ih
     439    intrstr = pci_intr_string(vboxguest->pc, vboxguest->ih
    440440#if __NetBSD_Prereq__(6, 99, 39)
    441441                              , intstrbuf, sizeof(intstrbuf)
     
    443443                              );
    444444    aprint_normal_dev(vboxguest->sc_dev, "interrupting at %s\n", intrstr);
    445     vboxguest->pfnIrqHandler = pci_intr_establish(vboxguest->pa->pa_pc, vboxguest->ih, IPL_BIO, VBoxGuestNetBSDISR, vboxguest);
     445    vboxguest->pfnIrqHandler = pci_intr_establish(vboxguest->pc, vboxguest->ih, IPL_BIO, VBoxGuestNetBSDISR, vboxguest);
    446446    if (vboxguest->pfnIrqHandler == NULL) {
    447447        aprint_error_dev(vboxguest->sc_dev, "couldn't establish interrupt\n");
     
    463463    if (vboxguest->pfnIrqHandler)
    464464    {
    465         pci_intr_disestablish(vboxguest->pa->pa_pc, vboxguest->pfnIrqHandler);
     465        pci_intr_disestablish(vboxguest->pc, vboxguest->pfnIrqHandler);
    466466    }
    467467}
     
    496496    }
    497497
    498     vboxguest->pa = pa;
     498    vboxguest->pc = pa->pa_pc;
    499499
    500500    /*
     
    530530                 * Add IRQ of VMMDev.
    531531                 */
    532                 rc = VBoxGuestNetBSDAddIRQ(vboxguest);
     532                rc = VBoxGuestNetBSDAddIRQ(vboxguest, pa);
    533533                if (RT_SUCCESS(rc))
    534534                {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette