diff --git a/en_US.ISO8859-1/books/arch-handbook/pci/chapter.sgml b/en_US.ISO8859-1/books/arch-handbook/pci/chapter.sgml index d0cce3dbfc..c2fd942afc 100644 --- a/en_US.ISO8859-1/books/arch-handbook/pci/chapter.sgml +++ b/en_US.ISO8859-1/books/arch-handbook/pci/chapter.sgml @@ -47,20 +47,11 @@ d_write_t mypci_write; /* Character device entry points */ static struct cdevsw mypci_cdevsw = { - mypci_open, - mypci_close, - mypci_read, - mypci_write, - noioctl, - nopoll, - nommap, - nostrategy, - "mypci", - 36, /* reserved for lkms - /usr/src/sys/conf/majors */ - nodump, - nopsize, - D_TTY, - -1 + .d_open = mypci_open, + .d_close = mypci_close, + .d_read = mypci_read, + .d_write = mypci_write, + .d_name = "mypci", }; /* vars */ @@ -325,10 +316,28 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) { sc->irq_bh = rman_get_bushandle(sc->irqres); </programlisting> + <para>Some care must be taken in the detach routine of the + driver. You must quiess the device's interrupt stream, and + remove the interrupt hanlder. Once + <function>bus_space_teardown_intr()</function> has returned, you + know that your interrupt handler will no longer be called, and + that all threads that might have been this interrupt handler + have returned. Depending on the locking strategy of your + driver, you will also need to be careful with what locks you + hold when you do this to avoid deadlock.</para> + </sect2> <sect2> <title>DMA</title> + <para>This section is obsolete, and present only for historical + reasons. The proper methods for dealing with these issues is to + use the <function>bus_space_dma*()</function> functions instead. + This paragraph can be removed when this section is updated to reflect + that usage. However, at the moment, the API is in a bit of + flux, so once that settles down, it would be good to update this + section to reflect that.</para> + <para>On the PC, peripherals that want to do bus-mastering DMA must deal with physical addresses. This is a problem since FreeBSD uses virtual memory and deals almost exclusively with diff --git a/en_US.ISO8859-1/books/developers-handbook/pci/chapter.sgml b/en_US.ISO8859-1/books/developers-handbook/pci/chapter.sgml index d0cce3dbfc..c2fd942afc 100644 --- a/en_US.ISO8859-1/books/developers-handbook/pci/chapter.sgml +++ b/en_US.ISO8859-1/books/developers-handbook/pci/chapter.sgml @@ -47,20 +47,11 @@ d_write_t mypci_write; /* Character device entry points */ static struct cdevsw mypci_cdevsw = { - mypci_open, - mypci_close, - mypci_read, - mypci_write, - noioctl, - nopoll, - nommap, - nostrategy, - "mypci", - 36, /* reserved for lkms - /usr/src/sys/conf/majors */ - nodump, - nopsize, - D_TTY, - -1 + .d_open = mypci_open, + .d_close = mypci_close, + .d_read = mypci_read, + .d_write = mypci_write, + .d_name = "mypci", }; /* vars */ @@ -325,10 +316,28 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) { sc->irq_bh = rman_get_bushandle(sc->irqres); </programlisting> + <para>Some care must be taken in the detach routine of the + driver. You must quiess the device's interrupt stream, and + remove the interrupt hanlder. Once + <function>bus_space_teardown_intr()</function> has returned, you + know that your interrupt handler will no longer be called, and + that all threads that might have been this interrupt handler + have returned. Depending on the locking strategy of your + driver, you will also need to be careful with what locks you + hold when you do this to avoid deadlock.</para> + </sect2> <sect2> <title>DMA</title> + <para>This section is obsolete, and present only for historical + reasons. The proper methods for dealing with these issues is to + use the <function>bus_space_dma*()</function> functions instead. + This paragraph can be removed when this section is updated to reflect + that usage. However, at the moment, the API is in a bit of + flux, so once that settles down, it would be good to update this + section to reflect that.</para> + <para>On the PC, peripherals that want to do bus-mastering DMA must deal with physical addresses. This is a problem since FreeBSD uses virtual memory and deals almost exclusively with