diff options
Diffstat (limited to 'fr_FR.ISO8859-1/books/developers-handbook/pci/chapter.xml')
-rw-r--r-- | fr_FR.ISO8859-1/books/developers-handbook/pci/chapter.xml | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/fr_FR.ISO8859-1/books/developers-handbook/pci/chapter.xml b/fr_FR.ISO8859-1/books/developers-handbook/pci/chapter.xml index 22b31e9a33..80b08beeff 100644 --- a/fr_FR.ISO8859-1/books/developers-handbook/pci/chapter.xml +++ b/fr_FR.ISO8859-1/books/developers-handbook/pci/chapter.xml @@ -7,8 +7,7 @@ Original revision: 1.3 $FreeBSD$ --> - -<chapter id="pci"> +<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="pci"> <title>Les périphériques PCI</title> <para>Ce chapître traitera des mécanismes de FreeBSD pour @@ -212,8 +211,8 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting> <para>Informations complémentaires <itemizedlist> - <listitem><simpara><ulink url="http://www.pcisig.org">PCI - Special Interest Group</ulink></simpara></listitem> + <listitem><simpara><link xlink:href="http://www.pcisig.org">PCI + Special Interest Group</link></simpara></listitem> <listitem><simpara>PCI System Architecture, Fourth Edition by Tom Shanley, et al.</simpara></listitem> @@ -243,32 +242,32 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting> <para>Par exemple, un pilote typique aura sa fonction <function>attach()</function> similaire à ceci : </para> -<programlisting> sc->bar0id = 0x10; - sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar0id), +<programlisting> sc->bar0id = 0x10; + sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar0id), 0, ~0, 1, RF_ACTIVE); - if (sc->bar0res == NULL) { + if (sc->bar0res == NULL) { uprintf("Allocation memoire du registre PCI de base 0 echouee!\n"); error = ENXIO; goto fail1; } - sc->bar1id = 0x14; - sc->bar1res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar1id), + sc->bar1id = 0x14; + sc->bar1res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar1id), 0, ~0, 1, RF_ACTIVE); - if (sc->bar1res == NULL) { + if (sc->bar1res == NULL) { uprintf("Allocation memoire du registre PCI de base 1 echouee!\n"); error = ENXIO; goto fail2; } - sc->bar0_bt = rman_get_bustag(sc->bar0res); - sc->bar0_bh = rman_get_bushandle(sc->bar0res); - sc->bar1_bt = rman_get_bustag(sc->bar1res); - sc->bar1_bh = rman_get_bushandle(sc->bar1res); + sc->bar0_bt = rman_get_bustag(sc->bar0res); + sc->bar0_bh = rman_get_bushandle(sc->bar0res); + sc->bar1_bt = rman_get_bustag(sc->bar1res); + sc->bar1_bh = rman_get_bushandle(sc->bar1res); </programlisting> <para>Des références pour chaque registre d'adresse de base sont gardées - dans la structure <structname>softc</structname> afin qu'elle puisse + dans la structure <varname remap="structname">softc</varname> afin qu'elle puisse être utilisée pour écrire dans le périphérique plus tard.</para> <para>Ces références peuvent alors être utilisées pour lire ou écrire @@ -279,7 +278,7 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting> <programlisting>uint16_t board_read(struct ni_softc *sc, uint16_t address) { - return bus_space_read_2(sc->bar1_bt, sc->bar1_bh, address); + return bus_space_read_2(sc->bar1_bt, sc->bar1_bh, address); } </programlisting> @@ -287,7 +286,7 @@ board_read(struct ni_softc *sc, uint16_t address) { <programlisting>void board_write(struct ni_softc *sc, uint16_t address, uint16_t value) { - bus_space_write_2(sc->bar1_bt, sc->bar1_bh, address, value); + bus_space_write_2(sc->bar1_bt, sc->bar1_bh, address, value); } </programlisting> @@ -310,10 +309,10 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) { <programlisting>/* Recupere la ressource IRQ */ - sc->irqid = 0x0; - sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &(sc->irqid), + sc->irqid = 0x0; + sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &(sc->irqid), 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); - if (sc->irqres == NULL) { + if (sc->irqres == NULL) { uprintf("Allocation IRQ echouee!\n"); error = ENXIO; goto fail3; @@ -321,15 +320,15 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) { /* Maitnenant nous choisissons notre gestionnaire d'interruption */ - error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_MISC, - my_handler, sc, &(sc->handler)); + error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_MISC, + my_handler, sc, &(sc->handler)); if (error) { printf("Ne peut regler l'IRQ\n"); goto fail4; } - sc->irq_bt = rman_get_bustag(sc->irqres); - sc->irq_bh = rman_get_bushandle(sc->irqres); + sc->irq_bt = rman_get_bustag(sc->irqres); + sc->irq_bh = rman_get_bushandle(sc->irqres); </programlisting> </sect2> @@ -373,5 +372,3 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) { </sect1> </chapter> - - |