The translation is temporarily closed for contributions due to maintenance, please come back later.

Translation

Free the memory allocated by <function>bus_dmamem_alloc()</function>. At present, freeing of the memory allocated with ISA restrictions is not implemented. Because ofDue to this the recommended model of use is to keep and re-use the allocated areas for as long as possible. Do not lightly free some area and then shortly allocate it again. That does not mean that <function>bus_dmamem_free()</function> should not be used at all: hopefully it will be properly implemented soon.
(itstool) path: listitem/para
English
Free the memory allocated by <function>bus_dmamem_alloc()</function>. At present, freeing of the memory allocated with ISA restrictions is not implemented. Due to this the recommended model of use is to keep and re-use the allocated areas for as long as possible. Do not lightly free some area and then shortly allocate it again. That does not mean that <function>bus_dmamem_free()</function> should not be used at all: hopefully it will be properly implemented soon.
Context English Chinese (Simplified) (zh_CN) State
<emphasis>flags</emphasis> - a bitmap of flags. The only interesting flags are: <emphasis>flags</emphasis> - 旗标的位图。感兴趣的旗标只有:
<emphasis>BUS_DMA_ALLOCNOW</emphasis> - requests to allocate all the potentially needed bounce pages when creating the tag. <emphasis>BUS_DMA_ALLOCNOW</emphasis> - 创建标签时请求分配所有可能用到的反射页面。
<emphasis>BUS_DMA_ISA</emphasis> - mysterious flag used only on Alpha machines. It is not defined for the i386 machines. Probably it should be used by all the ISA drivers for Alpha machines but it looks like there are no such drivers yet. <emphasis>BUS_DMA_ISA</emphasis> - 比较神秘的一个标志,仅用于Alpha机器。i386机器没有定义它。Alpha机器的所有ISA设备都应当使用这个标志,但似乎还没有这样的驱动程序。
<emphasis>dmat</emphasis> - pointer to the storage for the new tag to be returned. <emphasis>dmat</emphasis> - 指向返回的新标签的存储的指针。
<function>int bus_dma_tag_destroy(bus_dma_tag_t dmat)</function> <function>int bus_dma_tag_destroy(bus_dma_tag_t dmat)</function>
Destroy a tag. Returns 0 on success, the error code otherwise. 销毁标签。成功则返回0,否则返回错误码。
dmat - the tag to be destroyed. dmat - 被销毁的标签。
<function>int bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, bus_dmamap_t *mapp)</function> <function>int bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, bus_dmamap_t *mapp)</function>
Allocate an area of contiguous memory described by the tag. The size of memory to be allocated is tag's maxsize. Returns 0 on success, the error code otherwise. The result still has to be loaded by <function>bus_dmamap_load()</function> before being used to get the physical address of the memory. 分配标签所描述的一块连续内存区。被分配的内存的大小为标签的maxsize。成功则返回0,否则返回错误码。调用结果被用于获取内存的物理地址,但在此之前必须用<function>bus_dmamap_load()</function>将其加载。
<emphasis>dmat</emphasis> - the tag <emphasis>dmat</emphasis> - 标签
<emphasis>vaddr</emphasis> - pointer to the storage for the kernel virtual address of the allocated area to be returned. <emphasis>vaddr</emphasis> - 指向存储的指针,该存储空间用于返回的分配区域的内核虚地址。
flags - a bitmap of flags. The only interesting flag is: flags - 旗标的位图。唯一感兴趣的旗标为:
<emphasis>BUS_DMA_NOWAIT</emphasis> - if the memory is not immediately available return the error. If this flag is not set then the routine is allowed to sleep until the memory becomes available. <emphasis>BUS_DMA_NOWAIT</emphasis> - 如果内存不能立即可用则返回错误。如果此标志没有设置,则允许例程睡眠,直到内存可用为止。
<emphasis>mapp</emphasis> - pointer to the storage for the new map to be returned. <emphasis>mapp</emphasis> - 指向返回的新映射的存储的指针。
<function>void bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)</function> <function>void bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)</function>
Free the memory allocated by <function>bus_dmamem_alloc()</function>. At present, freeing of the memory allocated with ISA restrictions is not implemented. Due to this the recommended model of use is to keep and re-use the allocated areas for as long as possible. Do not lightly free some area and then shortly allocate it again. That does not mean that <function>bus_dmamem_free()</function> should not be used at all: hopefully it will be properly implemented soon. 释放由<function>bus_dmamem_alloc()</function>分配的内存。目前,对分配的带有ISA限制的内存的释放没有实现。因此,建议的使用模型为尽可能长时间地保持和重用分配的区域。不要轻易地释放某些区域,然后再短时间地分配它。这并不意味着不应当使用<function>bus_dmamem_free()</function>:希望很快它就会被完整地实现。
<emphasis>vaddr</emphasis> - the kernel virtual address of the memory <emphasis>vaddr</emphasis> - 内存的内核虚地址
<emphasis>map</emphasis> - the map of the memory (as returned from <function>bus_dmamem_alloc()</function>) <emphasis>map</emphasis> - 内存的映射(跟<function>bus_dmamem_alloc()</function>返回的一样)
<function>int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)</function> <function>int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)</function>
Create a map for the tag, to be used in <function>bus_dmamap_load()</function> later. Returns 0 on success, the error code otherwise. 为标签创建映射,以后用于<function>bus_dmamap_load()</function>。成功则返回0,否则返回错误码。
<emphasis>flags</emphasis> - theoretically, a bit map of flags. But no flags are defined yet, so at present it will be always 0. <emphasis>flags</emphasis> - 理论上是旗标的位图。但还从未定义过任何旗标,因此目前总是0。
<emphasis>mapp</emphasis> - pointer to the storage for the new map to be returned <emphasis>mapp</emphasis> - 指向返回的新映射的存储的指针。
<function>int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map)</function> <function>int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map)</function>
Destroy a map. Returns 0 on success, the error code otherwise. 销毁映射。成功则返回0,否则返回错误码。
dmat - the tag to which the map is associated dmat - 与映射关联的标签
map - the map to be destroyed map - 将要被销毁的映射
<function>int bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, bus_size_t buflen, bus_dmamap_callback_t *callback, void *callback_arg, int flags)</function> <function>int bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, bus_size_t buflen, bus_dmamap_callback_t *callback, void *callback_arg, int flags)</function>
Load a buffer into the map (the map must be previously created by <function>bus_dmamap_create()</function> or <function>bus_dmamem_alloc()</function>). All the pages of the buffer are checked for conformance to the tag requirements and for those not conformant the bounce pages are allocated. An array of physical segment descriptors is built and passed to the callback routine. This callback routine is then expected to handle it in some way. The number of bounce buffers in the system is limited, so if the bounce buffers are needed but not immediately available the request will be queued and the callback will be called when the bounce buffers will become available. Returns 0 if the callback was executed immediately or <errorname>EINPROGRESS</errorname> if the request was queued for future execution. In the latter case the synchronization with queued callback routine is the responsibility of the driver. 加载缓冲区到映射中(映射必须事先由<function>bus_dmamap_create()</function>或者<function>bus_dmamem_alloc()</function>)创建。缓冲区的所有页面都会被检查,看是否符合标签的要求,并为那些不符合的分配反弹页面。会创建物理段描述符的数组,并将其传递给回调函数。回调函数以某种方式处理这个数组。系统中的反弹缓冲区是受限的,因此如果需要的反弹缓冲区不能立即获得,则将请求入队,当反弹缓冲区可用时再调用回调函数。如果回调函数立即执行则返回0,如果请求被排队,等待将来执行,则返回<errorname>EINPROGRESS</errorname>。后一种情况下,与排队的回调函数之间的同步由驱动程序负责。
<emphasis>map</emphasis> - the map <emphasis>map</emphasis> - 映射
<emphasis>buf</emphasis> - kernel virtual address of the buffer <emphasis>buf</emphasis> - 缓冲区的内核虚地址
<emphasis>buflen</emphasis> - length of the buffer <emphasis>buflen</emphasis> - 缓冲区的长度

Loading…

Free the memory allocated by <function>bus_dmamem_alloc()</function>. At present, freeing of the memory allocated with ISA restrictions is not implemented. Because ofDue to this the recommended model of use is to keep and re-use the allocated areas for as long as possible. Do not lightly free some area and then shortly allocate it again. That does not mean that <function>bus_dmamem_free()</function> should not be used at all: hopefully it will be properly implemented soon.
a month ago
Browse all component changes

Glossary

English Chinese (Simplified) (zh_CN)
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: listitem/para
Source string location
book.translate.xml:17506
String age
a month ago
Source string age
a month ago
Translation file
books/zh_CN/arch-handbook.po, string 1897