aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include/bus_dma.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix $FreeBSD$.David E. O'Brien2005-07-221-1/+2
| | | | Notes: svn path=/head/; revision=148275
* Refactor the bus_dma header files so that the interface is described inScott Long2005-03-141-247/+13
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=143598
* MFi386: whitespace, copyright header, etc updatesPeter Wemm2005-01-211-1/+1
| | | | Notes: svn path=/head/; revision=140553
* Introduce bus_dmamap_load_mbuf_sg(). Instead of taking a callback arg, thisScott Long2005-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. Notes: svn path=/head/; revision=139840
* Cosmetic and/or trivial sync up with i386.Peter Wemm2003-11-211-9/+9
| | | | | | | Approved by: re (rwatson) Notes: svn path=/head/; revision=122940
* Document the lockfunc and lockfuncarg arguments to bus_dma_tag_create() inScott Long2003-11-071-0/+4
| | | | | | | the busdma headers. Notes: svn path=/head/; revision=122266
* - Introduce a new busdma flag BUS_DMA_ZERO to request for zero'edMaxime Henrion2003-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. Notes: svn path=/head/; revision=118081
* Mega busdma API commit.Scott Long2003-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 Notes: svn path=/head/; revision=117126
* Rename BUS_DMAMEM_NOSYNC to BUS_DMA_COHERENT.Hiten Pandya2003-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) Notes: svn path=/head/; revision=115416
* Bring back bus_dmasync_op_t. It is now a typedef to an int, though theScott Long2003-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) Notes: svn path=/head/; revision=115343
* De-orbit bus_dmamem_alloc_size(). It's a hack and was never used anyways.Scott Long2003-05-261-6/+0
| | | | | | | | | No need for it to pollute the 5.x API any further. Approved by: re (bmah) Notes: svn path=/head/; revision=115316
* AMD64 physical space is much larger than i386, de-i386 the bus_space andPeter Wemm2003-05-121-3/+3
| | | | | | | | | | | bus_dma MD code for AMD64. (And a trivial ifdef update in dev/kbd because of this). More updates are needed here to take advantage of the 64 bit instructions. Approved by: re (blanket amd64/*) Notes: svn path=/head/; revision=114930
* Change the operation parameter of bus_dmamap_sync() from anMaxime Henrion2003-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. Notes: svn path=/head/; revision=113347
* Implement bus_dmamem_alloc_size() and bus_dmamem_free_size() asScott Long2003-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) Notes: svn path=/head/; revision=110030
* New bus_dma interfaces for use by crypto device drivers:Sam Leffler2002-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. Notes: svn path=/head/; revision=104486
* - Moved the bus_dma declarations from bus_{at386,pc98}.h into bus_dma.h.Yoshihiro Takahashi2001-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. Notes: svn path=/head/; revision=84593
* Fix "alignemnt" typo.Alexander Langer2001-06-161-1/+1
| | | | Notes: svn path=/head/; revision=78353
* version 1.7 made some changes to correct problems identifed by compilingMatthew N. Dodd2001-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 Notes: svn path=/head/; revision=73314
* Axe the barrier_{read,write,rw}() helper functions as this method ofJohn Baldwin2000-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 Notes: svn path=/head/; revision=67350
* Add in a simple API for memory barriers to machine/bus.h:John Baldwin2000-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 Notes: svn path=/head/; revision=67285
* Fixed syntax errors and style bugs in previous commit. The syntaxBruce Evans2000-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. Notes: svn path=/head/; revision=61692
* Implement real read/write barriers for the i386. Despite the comment inMike Smith2000-05-181-4/+15
| | | | | | | previous versions of this file, some barrier functionality is required. Notes: svn path=/head/; revision=60672
* Added indirect pio into the bus space stuff for the NEC PC-98. bus.hKATO Takenori2000-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. Notes: svn path=/head/; revision=58762
* Fix clobbers so that GENERIC may compile with GCC 2.95.2.David E. O'Brien1999-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> Notes: svn path=/head/; revision=53139
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Improve compatibility with other systems by changing the defaultWarner Losh1999-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. Notes: svn path=/head/; revision=48527
* Don't pretend to support ix86's with 16-bit ints by using longs justBruce Evans1998-09-291-4/+4
| | | | | | | to ensure 32-bit variables. Doing so broke ix86's with 64-bit longs. Notes: svn path=/head/; revision=39755
* Implement bus_dmamem_* functions and correct a few nits reported by Peter Wemm.Justin T. Gibbs1998-05-061-10/+27
| | | | Notes: svn path=/head/; revision=35767
* Support compiling with `gcc-pedantic' (don't use hard newlines inBruce Evans1998-04-191-74/+74
| | | | | | | (asm) string constants or trailing commas in enum declarations). Notes: svn path=/head/; revision=35300
* Implementation of Bus Space for FreeBSD-x86.Justin T. Gibbs1998-01-151-0/+1264
Obtained From: NetBSD Notes: svn path=/head/; revision=32517