DNT MemoPen Data Spezifikationen Seite 34

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 52
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 33
This is the Title of the Book, eMatter Edition
Copyright © 2005 O’Reilly & Associates, Inc. All rights reserved.
Direct Memory Access
|
445
The mask should show the bits that your device can address; if it is limited to 24 bits,
for example, you would pass
mask as 0x0FFFFFF. The return value is nonzero if DMA
is possible with the given
mask;ifdma_set_mask returns 0, you are not able to use
DMA operations with this device. Thus, the initialization code in a driver for a device
limited to 24-bit DMA operations might look like:
if (dma_set_mask (dev, 0xffffff))
card->use_dma = 1;
else {
card->use_dma = 0; /* We'll have to live without DMA */
printk (KERN_WARN, "mydev: DMA not supported\n");
}
Again, if your device supports normal, 32-bit DMA operations, there is no need to
call dma_set_mask.
DMA mappings
A DMA mapping is a combination of allocating a DMA buffer and generating an
address for that buffer that is accessible by the device. It is tempting to get that
address with a simple call to virt_to_bus, but there are strong reasons for avoiding
that approach. The first of those is that reasonable hardware comes with an IOMMU
that provides a set of mapping registers for the bus. The IOMMU can arrange for any
physical memory to appear within the address range accessible by the device, and it
can cause physically scattered buffers to look contiguous to the device. Making use
of the IOMMU requires using the generic DMA layer; virt_to_bus is not up to the
task.
Note that not all architectures have an IOMMU; in particular, the popular x86 plat-
form has no IOMMU support. A properly written driver need not be aware of the I/O
support hardware it is running over, however.
Setting up a useful address for the device may also, in some cases, require the estab-
lishment of a bounce buffer. Bounce buffers are created when a driver attempts to
perform DMA on an address that is not reachable by the peripheral device—a high-
memory address, for example. Data is then copied to and from the bounce buffer as
needed. Needless to say, use of bounce buffers can slow things down, but some-
times there is no alternative.
DMA mappings must also address the issue of cache coherency. Remember that mod-
ern processors keep copies of recently accessed memory areas in a fast, local cache;
without this cache, reasonable performance is not possible. If your device changes an
area of main memory, it is imperative that any processor caches covering that area be
invalidated; otherwise the processor may work with an incorrect image of main mem-
ory, and data corruption results. Similarly, when your device uses DMA to read data
from main memory, any changes to that memory residing in processor caches must be
flushed out first. These cache coherency issues can create no end of obscure and diffi-
cult-to-find bugs if the programmer is not careful. Some architectures manage cache
,ch15.13676 Page 445 Friday, January 21, 2005 11:04 AM
Seitenansicht 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 ... 51 52

Kommentare zu diesen Handbüchern

Keine Kommentare

Philips Faxgerät für Normalpapier manuals

Owner’s manuals and user’s guides for Computer Accessories Philips Faxgerät für Normalpapier.
We providing 1 pdf manuals Philips Faxgerät für Normalpapier for download free by document types: User Manual






More products and manuals for Computer Accessories Philips

Models Document Type
Brilliance LED-Monitor User Manual    Philips Brilliance LED-Monitor Benutzerhandbuch [en] , 55 pages
Brilliance LCD-Monitor mit Webcam und MultiView User Manual   Philips Brilliance LCD-Monitor mit Webcam und MultiView Benutzerhandbuch [en] , 53 pages
LED-Monitor mit SmartTouch User Manual   Philips LED-Monitor mit SmartTouch Benutzerhandbuch [en] , 3 pages
LCD-Monitor mit HDMI- u. Audioanschluss User Manual   Philips LCD-Monitor mit HDMI- u. Audioanschluss Benutzerhandbuch [en] , 3 pages
Jam Jacket Grafik User Manual   Philips Jam Jacket Grafik Benutzerhandbuch [en] , 2 pages
Perfect sound Schnurloses Telefon mit Anrufbeantwo User Manual   Philips Perfect sound Schnurloses Telefon mit Anrufbeantworter Benutzerhandbuch [en] , 8 pages
LCD-Monitor mit LED-Hintergrundbeleuchtung User Manual    Philips LCD-Monitor mit LED-Hintergrundbeleuchtung Benutzerhandbuch, 44 pages
Fernbedienung für DVD-Recorder User Manual   Philips Fernbedienung für DVD-Recorder Benutzerhandbuch [en] , 2 pages
LCD-Monitor mit LED-Hintergrundbeleuchtung User Manual    Philips LCD-Monitor mit LED-Hintergrundbeleuchtung Benutzerhandbuch, 37 pages
LCD-Monitor mit 2 ms SmartResponse User Manual   Philips LCD-Monitor mit 2 ms SmartResponse Benutzerhandbuch [en] , 52 pages
Design collection Schnurloses Telefon mit Anrufbea User Manual   Philips Design collection Schnurloses Telefon mit Anrufbeantworter Benutzerhandbuch [en] , 2 pages
Intelligentes Universalgerät User Manual   Philips Intelligentes Universalgerät Benutzerhandbuch, 3 pages
Brilliance LCD-Monitor mit SmartImage User Manual   Philips Brilliance LCD-Monitor mit SmartImage Benutzerhandbuch [en] , 3 pages
FaxPro Faxgerät für Normalpapier User Manual   Philips FaxPro Faxgerät für Normalpapier Benutzerhandbuch [en] , 2 pages
Multimedia-Lautsprecher 2.0 User Manual   Philips Multimedia-Lautsprecher 2.0 Benutzerhandbuch [en] , 2 pages
Perfect sound Schnurlostelefon mit Anrufbeantworte User Manual   Philips Perfect sound Schnurlostelefon mit Anrufbeantworter Benutzerhandbuch [en] , 44 pages
MultiLife Auto-Ladegerät User Manual   Philips MultiLife Auto-Ladegerät Benutzerhandbuch [en] , 2 pages
Universal-Fernbedienung User Manual     Philips Universal-Fernbedienung User Manual [en] , 84 pages
Internes Bulk-Laufwerk User Manual   Philips Internes Bulk-Laufwerk Benutzerhandbuch, 3 pages
Perfect sound Schnurlostelefon User Manual   Philips Perfect sound Schnurlostelefon Benutzerhandbuch [en] , 2 pages