summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/bus_dma.h
Commit message (Collapse)AuthorAgeFilesLines
* Refactor the bus_dma header files so that the interface is described inscottl2005-03-141-235/+2
| | | | | | | | | | sys/bus_dma.h instead of being copied in every single arch. This slightly reorders a flag that was specific to AXP and thus changes the ABI there. The interface still relies on bus_space definitions found in <machine/bus.h> so it cannot be included on its own yet, but that will be fixed at a later date. Add an MD <machine/bus_dma.h> for ever arch for consistency and to allow for future MD augmentation of the API. sparc64 makes heavy use of this right now due to its different bus_dma implemenation.
* Introduce bus_dmamap_load_mbuf_sg(). Instead of taking a callback arg, thisscottl2005-01-071-0/+5
| | | | | | | cuts to the chase and fills in a provided s/g list. This is meant to optimize out the cost of the callback since the callback doesn't serve much purpose for mbufs since mbuf loads will never be deferred. This is just for amd64 and i386 at the moment, other arches will be coming shortly.
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Document the lockfunc and lockfuncarg arguments to bus_dma_tag_create() inscottl2003-11-071-0/+4
| | | | the busdma headers.
* Spelling and grammar fixes.anholt2003-11-051-8/+8
| | | | | PR: kern/54658 Submitted by: Roderick van Domburg <r.s.a.vandomburg@student.utwente.nl>
* - Introduce a new busdma flag BUS_DMA_ZERO to request for zero'edmux2003-07-271-0/+1
| | | | | | | memory in bus_dmamem_alloc(). This is possible now that contigmalloc() supports the M_ZERO flag. - Remove the locking of Giant around calls to contigmalloc() since contigmalloc() now grabs Giant itself.
* Mega busdma API commit.scottl2003-07-011-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Rename BUS_DMAMEM_NOSYNC to BUS_DMA_COHERENT.hmp2003-05-301-1/+1
| | | | | | | | | | | | | | | | | The current name is confusing, because it indicates to the client that a bus_dmamap_sync() operation is not necessary when the flag is specified, which is wrong. The main purpose of this flag is to hint the underlying architecture that DMA memory should be mapped in a coherent way, but the architecture can ignore it. But if the architecture does supports coherent mapping of memory, then it makes bus_dmamap_sync() calls cheap. This flag is the same as the one in NetBSD's Bus DMA. Reviewed by: gibbs, scottl, des (implicitly) Approved by: re@ (jhb)
* Bring back bus_dmasync_op_t. It is now a typedef to an int, though thescottl2003-05-271-1/+2
| | | | | | | | BUS_DMASYNC_ definitions remain as before. The does not change the ABI, and reverts the API to be a bit more compatible and flexible. This has survived a full 'make universe'. Approved by: re (bmah)
* De-orbit bus_dmamem_alloc_size(). It's a hack and was never used anyways.scottl2003-05-261-6/+0
| | | | | | No need for it to pollute the 5.x API any further. Approved by: re (bmah)
* Change the operation parameter of bus_dmamap_sync() from anmux2003-04-101-10/+6
| | | | | | enum to an int and redefine the BUS_DMASYNC_* constants as flags. This allows us to specify several operations in one call to bus_dmamap_sync() as in NetBSD.
* Implement bus_dmamem_alloc_size() and bus_dmamem_free_size() asscottl2003-01-291-0/+6
| | | | | | | | | | | | | | | | | | | | counterparts to bus_dmamem_alloc() and bus_dmamem_free(). This allows the caller to specify the size of the allocation instead of it defaulting to the max_size field of the busdma tag. This is intended to aid in converting drivers to busdma. Lots of hardware cannot understand scatter/gather lists, which forces the driver to copy the i/o buffers to a single contiguous region before sending it to the hardware. Without these new methods, this would require a new busdma tag for each operation, or a complex internal allocator/cache for each driver. Allocations greater than PAGE_SIZE are rounded up to the next PAGE_SIZE by contigmalloc(), so this is not suitable for multiple static allocations that would be better served by a single fixed-length subdivided allocation. Reviewed by: jake (sparc64)
* New bus_dma interfaces for use by crypto device drivers:sam2002-10-041-0/+23
| | | | | | | | o bus_dmamap_load_mbuf o bus_dmamap_load_uio Test on i386. Known to compile on alpha and sparc64, but not tested. Otherwise untried.
* - Moved the bus_dma declarations from bus_{at386,pc98}.h into bus_dma.h.nyan2001-10-061-1082/+3
| | | | | (bus_dma.h is repo-copied from bus_at386.h) - Added '#include <machine/bus_dma.h>' into bus.h for backward compatibility.
* Fix "alignemnt" typo.alex2001-06-161-1/+1
|
* version 1.7 made some changes to correct problems identifed by compilingmdodd2001-03-021-1/+0
| | | | | | | | | | | with egcs-1.1.1. bus_space_write_multi_2() had an extra operation that should have been removed. Remove it. This fixes the panic when bus_space_write_multi_2() is used. Obtained from: jake
* Axe the barrier_{read,write,rw}() helper functions as this method ofjhb2000-10-201-24/+0
| | | | | | | doing memory barriers doesn't really scale well for the ia64. Also, memory barriers are more a property of the CPU than bus space. Requested by: dfr
* Add in a simple API for memory barriers to machine/bus.h:jhb2000-10-181-0/+23
| | | | | | - barrier_read() enforces a memory read barrier - barrier_write() enforces a memory write barrier - barrier_rw() enforces a memory read/write barrier
* Fixed syntax errors and style bugs in previous commit. The syntaxbde2000-06-141-2/+2
| | | | | | errors were normally harmless because they were in unreachable code and gcc apparently doesn't check the syntax inside asm statements that it optimizes away.
* Implement real read/write barriers for the i386. Despite the comment inmsmith2000-05-181-4/+15
| | | | previous versions of this file, some barrier functionality is required.
* Added indirect pio into the bus space stuff for the NEC PC-98. bus.hkato2000-03-291-3/+3
| | | | | | | | | | | includes one of bus_at386.h and bus_pc98.h. Becuase only bus_pc98.h supports indirect pio and bus_at386.h is identical to old bus.h, there is no functional change in PC-AT's kernels. That is, it cannot cause performance loss. Submitted by: nyan Reviewed by: imp bde and luoqi provided useful comments for earlier version.
* Fix clobbers so that GENERIC may compile with GCC 2.95.2.obrien1999-11-141-83/+84
| | | | | | | | | | | | | | | | | | | | Historically, the documentation of extended asm was lacking, namely you should NOT specify the same register as an input, and a clobber. If the register is clobbered, it should be specified as an output as well, e.g., by linking input and output through the "number" notation. (Beware of lvalues, some local variables needed...) URL:http://egcs.cygnus.com/faq.html In versions up to egcs-1.1.1, the compiler did not even warn about it, but it was liable to output bad code. Newer egcs are pickier and simply refuse to swallow such code. Note, since *addr changes, it needs to be an output operand. We might be excessive in saying that all memory has changed. Obtained from: OpenBSD w/extra thanks to Marc Espie <Marc.Espie@liafa.jussieu.fr>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Improve compatibility with other systems by changing the defaultimp1999-07-031-1/+10
| | | | | | | | | | | | | | | | | | | | | behavior slightly. If machine/bus.h is included, but neither bus_memio.h nor bus_pio.h are included, then behave as if both were included. This won't change existing drivers, all of which include one or more of bus_{p,mem}io.h, but will allow drivers from other systems to come over with fewer changes. I freely admit that this might not be optimal for some drivers, but those drivers can be optimized for FreeBSD after the initial bringup happens. Without the change, there is a bug that preclude drivers from compiling with strange warning/errors. I've been running this here for a while now w/o ill effects. Reviewed by: gibbs Not objected to by: bde, arch@ list.
* Don't pretend to support ix86's with 16-bit ints by using longs justbde1998-09-291-4/+4
| | | | to ensure 32-bit variables. Doing so broke ix86's with 64-bit longs.
* Implement bus_dmamem_* functions and correct a few nits reported by Peter Wemm.gibbs1998-05-061-10/+27
|
* Support compiling with `gcc-pedantic' (don't use hard newlines inbde1998-04-191-74/+74
| | | | (asm) string constants or trailing commas in enum declarations).
* Implementation of Bus Space for FreeBSD-x86.gibbs1998-01-151-0/+1264
Obtained From: NetBSD
OpenPOWER on IntegriCloud