freebsd-dev/sys/sparc64/include
Thomas Moestl 928a49644f Lock down the IOMMU bus_dma implementation to make it safe to use
without Giant held.

A quick outline of the locking strategy:
Since all IOMMUs are synchronized, there is a single lock, iommu_mtx,
which protects the hardware registers (where needed) and the global and
per-IOMMU software states. As soon as the IOMMUs are divorced, each struct
iommu_state will have its own mutex (and the remaining global state
will be moved into the struct).
The dvma rman has its own internal mutex; the TSB slots may only be
accessed by the owner of the corresponding resource, so neither needs
extra protection.
Since there is a second access path to maps via LRU queues, the consumer-
provided locking is not sufficient; therefore, each map which is on a
queue is additionally protected by iommu_mtx (in part, there is one
member which only the map owner may access). Each map on a queue may
be accessed and removed from or repositioned in a queue in any context as
long as the lock is held; only the owner may insert a map.
To reduce lock contention, some bus_dma functions remove the map from
the queue temporarily (on behalf of the map owner) for some operations and
reinsert it when they are done. Shorter operations and operations which are
not done on behalf of the lock owner are completely covered by the lock.

To facilitate the locking, reorganize the streaming buffer handling;
while being there, fix an old oversight which would cause the streaming
buffer to always be flushed, regardless of whether streaming was enabled
in the TSB entry. The streaming buffer is still disabled for now, since
there are a number of drivers which lack critical bus_dmamp_sync() calls.

Additional testing by:	jake
2003-07-10 23:27:35 +00:00
..
_inttypes.h Since printf(3) now supports the `j' conversion specifier, use that 2002-06-30 05:48:03 +00:00
_limits.h sys/sys/limits.h: 2003-05-19 20:29:07 +00:00
_stdint.h Create a new header <machine/_stdint.h> for storing MD parts of 2002-07-29 17:41:23 +00:00
_types.h - Add vm_paddr_t, a physical address type. This is required for systems 2003-03-25 00:07:06 +00:00
asi.h Add ASI definitions of UltraSPARC-III (Cu) processors, and add some 2002-07-16 16:22:25 +00:00
asm.h - Fix placement of cvs ids in previous commit to match .S files in libc. 2003-04-29 00:37:41 +00:00
asmacros.h I was wrong, the ENTRY bits in asm.h did have a purpose -- for userland. 2003-04-26 20:54:45 +00:00
atomic.h Make the atomic arithmetic functions return the old value, since they're 2002-12-21 08:53:26 +00:00
bus_common.h Always initialize the UPA target module id in the interrupt mapping 2002-12-01 23:30:26 +00:00
bus_memio.h
bus_pio.h
bus_private.h Lock down the IOMMU bus_dma implementation to make it safe to use 2003-07-10 23:27:35 +00:00
bus.h Lock down the IOMMU bus_dma implementation to make it safe to use 2003-07-10 23:27:35 +00:00
cache.h Use vm_paddr_t for physical addresses. 2003-04-08 06:35:09 +00:00
ccr.h
clock.h Add two extern's for adjkerntz and wall_cmos_clock, all other 2002-10-05 20:14:49 +00:00
cpu.h Add declarations for btext and etext. 2002-07-28 01:01:14 +00:00
cpufunc.h add support for peeking at pci busses on UltraSparc systems. This prevents 2003-06-22 01:26:08 +00:00
critical.h
db_machdep.h BKPT_INST is supposed to be a breakpoint, not 0. 2003-06-07 18:24:37 +00:00
eeprom.h Add missing header for the eeprom driver frontents. 2002-04-05 02:40:54 +00:00
elf.h Make imgact_elf32.c compile on sparc64. 2003-01-05 03:48:55 +00:00
endian.h Be careful not to define GCC-specific optimizations in the non-GCC 2002-09-23 04:32:17 +00:00
exec.h
float.h Implement fpclassify(): 2003-02-08 20:37:55 +00:00
floatingpoint.h
fp.h - Rename pcb_fpstate to pcb_ufp (user floating point), and change it to 2003-04-01 04:02:45 +00:00
frame.h - Expand struct trapframe to 256 bytes, make all fields fixed width and the 2002-10-22 18:03:15 +00:00
fsr.h Clean up a bit, and add some more macros to access %fsr fields. 2002-09-14 17:58:54 +00:00
idprom.h
ieee.h
ieeefp.h Use the definitions in machine/fsr.h instead of duplicating these magic 2002-09-14 18:00:44 +00:00
in_cksum.h
instr.h Add new UltraSPARC-III VIS II instructions. 2002-07-16 17:44:01 +00:00
intr_machdep.h Renamed intr_enqueue to intr_vector and intr_dequeue to intr_fast, to 2002-09-28 03:06:35 +00:00
iommureg.h Some cleanup: 2003-01-06 17:10:07 +00:00
iommuvar.h Lock down the IOMMU bus_dma implementation to make it safe to use 2003-07-10 23:27:35 +00:00
kerneldump.h Use vm_paddr_t for physical addresses. 2003-04-08 06:35:09 +00:00
kse.h Add files that are new for KSE. 2002-06-29 07:04:59 +00:00
ktr.h Two tokens that don't together form a vaid preprocssor token cannot be 2003-04-26 17:00:10 +00:00
limits.h sys/sys/limits.h: 2003-05-19 20:29:07 +00:00
lsu.h Add new LSU bits for UltraSPARC-III. 2002-07-16 16:24:03 +00:00
md_var.h Use vm_paddr_t for physical addresses. 2003-04-08 06:35:09 +00:00
metadata.h Slight reorg and added AMD64 support. A couple of the MODINFOMD_* values 2003-05-01 03:31:18 +00:00
mutex.h
nexusvar.h
ofw_bus.h Add the new sparc64 OFW PCI framework, conditional on options OFW_NEWPCI 2003-07-01 14:52:47 +00:00
ofw_machdep.h
ofw_mem.h - Declare sparc64_memreg and sparc64_nmemreg in machine/ofw_mem.h. 2003-06-07 18:29:29 +00:00
ofw_nexus.h
ofw_upa.h
param.h Migrate the thread stack management functions from the machine-dependent 2003-06-14 23:23:55 +00:00
pcb.h - Add space for kernel floating point registers to the pcb. These will be 2003-04-03 18:28:03 +00:00
pcpu.h Remove unused fields. 2003-03-18 08:15:24 +00:00
pmap.h - Move the routine for flushing all user mappings from the tlb from pmap to 2003-04-13 21:54:58 +00:00
proc.h Remove unneeded include. 2002-05-08 04:21:58 +00:00
profile.h Add definitions for statistical and high-resolution profiling. The calling 2002-07-30 06:14:34 +00:00
pstate.h
ptrace.h
reg.h - Expand struct trapframe to 256 bytes, make all fields fixed width and the 2002-10-22 18:03:15 +00:00
reloc.h
resource.h
runq.h Move the "- 1" into the RQB_FFS(mask) macro itself so that 2002-06-20 06:21:20 +00:00
setjmp.h Fix namespace issues by using visibility conditionals from 2002-10-05 05:47:56 +00:00
sigframe.h
signal.h Split 4.x and 5.x signal handling so that we can keep 4.x signal 2002-10-25 19:10:58 +00:00
smp.h Use vm_paddr_t for physical addresses. 2003-04-08 06:35:09 +00:00
stdarg.h o Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:01:07 +00:00
sysarch.h Add support for an alternate signal trampoline; add a sysarch call to register 2002-04-29 18:08:26 +00:00
tick.h Initialize tick_MHz and related variables much earlier. After the last 2002-10-25 17:42:14 +00:00
tlb.h - Move the routine for flushing all user mappings from the tlb from pmap to 2003-04-13 21:54:58 +00:00
trap.h Allow fast instruction and data access mmu miss traps to be handled by 2003-04-29 21:30:59 +00:00
tsb.h Use vm_paddr_t for physical addresses. 2003-04-08 06:35:09 +00:00
tstate.h
tte.h Handle the fictitious pages created by the device pager. For fictitious 2003-03-27 02:16:31 +00:00
ucontext.h Don't allow user process to set an invalid window state through sigreturn. 2003-01-10 00:04:56 +00:00
upa.h Lower UPA_MEMSTART to 0x1c000000000. This is required for some larger 2002-04-02 17:38:52 +00:00
utrap.h Allow fast instruction and data access mmu miss traps to be handled by 2003-04-29 21:30:59 +00:00
varargs.h Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:02:06 +00:00
ver.h Add two new workaround for firmware anomalies: 2002-11-07 16:07:46 +00:00
vmparam.h Define UMA_MD_SMALL_ALLOC so that uma_small_alloc and uma_small_free will 2002-12-27 19:31:26 +00:00
watch.h Use vm_paddr_t for physical addresses. 2003-04-08 06:35:09 +00:00
wstate.h