Commit Graph

105 Commits

Author SHA1 Message Date
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
drochner d2b9876081 move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
2002-06-02 14:44:35 +00:00
thorpej e2a2842013 Keep track of which DMA window was actually used to map the
request (not always the passed in DMA tag if we try direct-map
and then fall back to sgmap-mapped).  Use the actual window
when performing dmamap_sync and dmamap_unload operations.

Fixes DMA resource leak on systems with 2G+ RAM.  Thanks to
Matt Thomas for help debugging this.
2002-04-26 04:15:18 +00:00
chris 0e7661f023 Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
2001-09-10 21:19:08 +00:00
thorpej 0fb6b9a8f8 Rework the interrupt code, shaving some cycles off in the process.
Rather than an "iointr" routine that decomposes a vector into an
IRQ, we maintain a vector table directly, hooking up each "iointr"
routine at the correct vector.  This also allows us to hook device
interrupts up to specific vectors (c.f. Jensen).

We can shave even more cycles off, here, and I will, but it requires
some changes to the alpha_shared_intr stuff.
2001-07-27 00:25:18 +00:00
thorpej 63bc6c1370 Since the SGMAP buffer load subroutine doesn't need to modify
the segment index, don't pass it by reference.
2001-07-19 18:20:20 +00:00
thorpej 77e1f86ad4 Implement dmamap_load_uio for SGMAPs. 2001-07-19 18:08:54 +00:00
thorpej e60fffea3b Pay attention to BUS_DMA_READ; don't need to allocate a spill
page if it is set.
2001-07-19 17:08:44 +00:00
thorpej b70733d358 Since DMA frobbing can be done at interrupt time by devies at
multiple levels, protect the extent map w/ splvm().
2001-07-19 14:26:54 +00:00
thorpej 18490eff62 Add support for mbufs to the Alpha SGMAP DMA maps. 2001-07-19 06:40:01 +00:00
thorpej 8617f2c7f5 Simplify the SGMAP code a bit, and move SGVA allocation out of a
common routine into the individual load routines, since each load
routine needs to muddle with the "internals" of this operation.

Add a `prefetch threshold' member to the bus_dma_tag_t, so that
eventually we can determine whether or not to allocate a spill
page on a per-mapping basis.
2001-07-19 04:27:37 +00:00
thorpej 97d7c635b0 bcopy -> memcpy 2001-07-12 23:35:42 +00:00
thorpej 294259060c bzero -> memset 2001-07-12 23:25:39 +00:00
chs e44e9dec8a replace vm_page_t with struct vm_page *. 2001-05-26 21:27:02 +00:00
thorpej 1c3a62e066 Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative.  It may be possible to
optimize these a little more.
2001-04-24 04:30:50 +00:00
soren 912c115675 s/vm_page_alloc_memory/uvm_pglistalloc/ in panic message. 2001-03-21 18:40:28 +00:00
thorpej 09ffed2ba0 ANSI'ify. 2001-01-03 21:40:25 +00:00
thorpej dbe63d5a81 Some more slight cleanup. 2001-01-03 21:39:20 +00:00
thorpej 5602df2e07 Fix a couple of comments. 2001-01-03 21:27:07 +00:00
thorpej c3d730df25 ANSI'ify. 2001-01-03 20:29:58 +00:00
thorpej a2a696618e Restructure alpha_sgmap_dmamap_create() slightly. 2001-01-03 20:12:34 +00:00
thorpej db36913c87 The code that creates/destroys SGMAP DMA maps is the same; put it
in a common place and share it.
2001-01-03 19:15:59 +00:00
thorpej 5edc9ef4a4 When computing the segment size, consider the maximum segment
size in the DMA map.
2000-07-17 04:47:56 +00:00
mrg 80bb8049ba remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-29 09:02:51 +00:00
mrg 2f159a1bac remove/move more mach vm header files:
<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
2000-06-26 14:20:25 +00:00
simonb 889c658b5b Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes.  Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
2000-06-26 04:55:19 +00:00
thorpej 2668e3b213 Switch to the new `evcnt' mechanism for counting interrupts. Maintain
a per-CPU interrupt counter for clock, device, and interprocessor
interrupts.
2000-06-05 21:47:10 +00:00
thorpej e8d65fec30 ANSI'ify function declarations. 2000-06-04 05:27:45 +00:00
simonb 9ff7681a33 Don't need to include <sys/conf.h> here. 2000-03-29 03:43:31 +00:00
thorpej ac93a75106 Point back to the alpha_shared_intr in the intrhand structure. This
allows platform-specific code to access the `intr_private' data via
the intrhand structure.
2000-03-19 01:46:18 +00:00
mjacob 13e13336b2 Allow (re)setting of maxstrays after establishment of a shared interrupt.
This allows sporadic stray interrupt counts to be reset by an acknowledgement
of the same interrupt.
2000-02-10 07:45:02 +00:00
thorpej 0c4f8a876b Implement an internal DMA map flag which prevents coalescing of
adjacent DMA segments.
2000-02-06 01:23:30 +00:00
mjacob d166ec2056 Do not forget to init intr_private 2000-02-01 04:14:18 +00:00
mjacob e1598bac13 fix misspelling 2000-01-20 17:16:25 +00:00
thorpej 8b34a5b689 Revert previous. 1999-12-08 23:54:55 +00:00
thorpej fd6f6e85b2 Slight changes so that bounce buffers can be implemented for the Jensen. 1999-12-08 23:40:35 +00:00
thorpej 25a665e643 Avoid a spurious warning when establishing a pulsed interrupt handler
on an IRQ which was marked "initially-pulsed".
1999-12-07 21:36:16 +00:00
thorpej 7f1ccd57ea Add a way to get/set a private pointer in the shared interrupt header. 1999-11-29 19:59:19 +00:00
thorpej abff7cb610 Update for pmap_enter() API change. 1999-11-13 00:27:21 +00:00
thorpej 11cae42531 Centralize the declaration and clearing of `cold'. 1999-09-17 19:59:35 +00:00
chs f3a668ed84 eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
1999-09-12 01:16:55 +00:00
thorpej 3ebbe095e0 Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
1999-07-08 18:05:21 +00:00
thorpej 5832084eaf bus_dmamem_map() maps DMA safe memory, which is usually one or more
managed pages, into KVA space.  Since the pages are managed, we should
use pmap_enter(), not pmap_kenter_pa().

Also, when entering the mappings, enter with an access_type of
VM_PROT_READ | VM_PROT_WRITE.  We do this for a couple of reasons:

	(1) On systems that have H/W mod/ref attributes, the hardware
	    may not be able to track mod/ref done by a bus master.

	(2) On systems that have to do mod/ref emulation, this prevents
	    a mod/ref page fault from potentially happening while in an
	    interrupt context, which can be problematic.

This latter change is fairly important if we ever want to be able to
transfer DMA-safe memory pages to anonymous memory objects; we will need
to know that the pages are modified, or else data could be lost!

Note that while the pages are unowned (i.e. "just DMA-safe memory pages"),
they won't consume any swap resources, as the mappings are wired, and
the pages aren't on the active or inactive queues.
1999-05-25 23:14:03 +00:00
mycroft 9c6b797796 Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
  because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
  avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot.  Also, DO NOT use
  pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
  access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
  access_type = 0.  This should probably be revisited.
1999-03-26 23:41:25 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
mycroft 579eeb8cf7 If we have to increase the boundary due to the spill pages, use the old
boundary as an alignment.  Otherwise we fail to enforce the old boundary,
causing massive lossage.
1999-02-18 08:55:16 +00:00
thorpej 02d221f94a Fix printf format problems on Alpha. 1999-02-12 06:25:13 +00:00
thorpej 2671c2fa42 Make bus_dmamap_load_uio() work, from Kevin Lahey <kml@nas.nasa.gov>. 1998-09-21 22:51:56 +00:00
thorpej e7a551d60e Some internal cleanup; pass a tag around, not individual arguments. 1998-08-17 20:15:55 +00:00
thorpej d5df55112a vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t 1998-08-14 16:50:00 +00:00