summaryrefslogtreecommitdiffstats
path: root/sys/sys/bus_dma.h
Commit message (Collapse)AuthorAgeFilesLines
* Style cleanups after r285270zbb2015-07-081-4/+4
| | | | | | | There should be no semicolons in added macro definitions. Define empty macro as "do {} while (0)". Pointed out by: jmg
* Add memory barrier to bus_dmamap_sync()zbb2015-07-081-1/+13
| | | | | | | | | | | On platforms which are fully IO-coherent, the map might be null. We need to guarantee that all data is observable after the sync operation is called. Add a memory barrier to ensure that on ARM. Reviewed by: andrew, kib Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3012
* Update NetBSD Foundation copyrights to 2-clause BSDemaste2014-03-181-7/+0
| | | | | | | | | | | The NetBSD Foundation states "Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license." This change removes clauses 3 and 4 from copyright / license blocks that list The NetBSD Foundation as the only copyright holder. Sponsored by: The FreeBSD Foundation
* Add bus_dmamap_load_ma() function to load map with the array ofkib2013-10-271-0/+13
| | | | | | | | | | vm_pages. Provide trivial implementation which forwards the load to _bus_dmamap_load_phys() page by page. Right now all architectures use bus_dmamap_load_ma_triv(). Tested by: pho (as part of the functional patch) Sponsored by: The FreeBSD Foundation MFC after: 1 month
* Add bus_dmamap_load_bio for non-CAM disk drivers that wish to enablejimharris2013-03-291-0/+7
| | | | | | | unmapped I/O. Sponsored by: Intel Reviewed by: kib
* Reform the busdma API so that new types may be added without modifyingkib2013-02-121-29/+79
| | | | | | | | | | | | | | | | | | | | | every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. The cam changes unify the bus_dmamap_load* handling in cam drivers. The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map. Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)
* - Change contigmalloc() to use the vm_paddr_t type instead of an unsignedjhb2012-03-011-1/+1
| | | | | | | | | | | | | | | long for specifying a boundary constraint. - Change bus_dma tags to use bus_addr_t instead of bus_size_t for boundary constraints. These allow boundary constraints to be fully expressed for cases where sizeof(bus_addr_t) != sizeof(bus_size_t). Specifically, it allows a driver to properly specify a 4GB boundary in a PAE kernel. Note that this cannot be safely MFC'd without a lot of compat shims due to KBI changes, so I do not intend to merge it. Reviewed by: scottl
* When bouncing pages, allow a new option to preserve the intra-pageimp2009-02-081-0/+7
| | | | | | | | | | | | | | | | offset. This is needed for the ehci hardware buffer rings that assume this behavior. This is an interim solution, and a more general one is being worked on. This solution doesn't break anything that doesn't ask for it directly. The mbuf and uio variants with this flag likely don't work and haven't been tested. Universe builds with these changes. I don't have a huge-memory machine to test these changes with, but will be happy to work with folks that do and hps if this changes turns out not to be sufficient. Submitted by: alfred@ from Hans Peter Selasky's original
* BUS_DMA_ISA is left over from Alpha, and is not used in the tree atimp2008-03-151-1/+0
| | | | | | | all. The reference in ia64 code is due to cutNpaste in its history and can safely be removed. Revired by: cognet, raj, marcel, jhb and maybe one other whom I'm forgetting
* Break out typedefs from bus_dma.h to _bus_dma.h so that we can get thejmg2006-09-031-29/+2
| | | | | typedef for bus_dma_tag_t in sys/bus.h w/o poluting the namespace... This is in preperation for adding bus_get_dma_tag to sys/bus.h...
* fix arm wrt to busdma...jmg2005-03-151-6/+11
| | | | | also wrap the two macros that have bare if's w/ do {} while(0) so that my epe driver doesn't get a warning about braces around confused else...
* Refactor the bus_dma header files so that the interface is described inscottl2005-03-141-19/+45
| | | | | | | | | | 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