Commit Graph

12 Commits

Author SHA1 Message Date
fvdl d786742d91 Provide workaround (by Charles Hannum) for error in register allocation that
could occur in bus_space_write_multi*
1997-10-01 08:25:15 +00:00
cgd efecf08fef Sync with bus_space(9):
* make map and alloc take 'flags' rather than 'cacheable,' for
  more flexibility.
* rename BUS_BARRIER_* to BUS_SPACE_BARRIER_*, for consistency.
* rename bus_space_copy_* to bus_space_copy_region_* and make their
  defns match the updated spec.
Backward compatibility is provided by defining __BUS_SPACE_COMPAT_OLDDEFS,
which is currently defined by default.
1997-08-15 00:45:16 +00:00
perry 03c3f2c28f fix spelling error, pr-3974 from Dave Huang 1997-08-12 23:53:54 +00:00
cgd 9989c90b52 rename i386 bus_space_{map,unmap,subregion,alloc,free} implementation
functions (which only work on memory and i/o space) to i386_memio_*,
and make bus_space_* in bus.h be #defines which invoke them.  This makes
life easier for people who need to define the all of the bus_space functions
so that they work on spaces other than memory and I/O space.  Also, add
an _i386_memio_map function which is like i386_memio_map but doesn't do
the extent map checking or allocation.  _i386_memio_map and i386_memio_*
are for use only by machine-dependent code.
1997-07-10 02:36:44 +00:00
thorpej 7a15aef7ea Pull thorpej-bus-dma branch into mainline. 1997-06-06 23:24:31 +00:00
thorpej 3883cff7fb Oops, bus_space_set_{multi,region}_N() is supposed to have an `offset'
argument.  Add one to the `prototype' in the comment which preceeds
`not implemented' :-)
1996-12-02 05:35:13 +00:00
thorpej e463f9241e Two things pointed out by Chris Demetriou <cgd@cs.cmu.edu>:
- The boundary argument to bus_space_alloc() should be a bus_size_t, not
  a bus_addr_t.
- The buffer arguments in the "multiple write" methods should have
  const qualifiers.

And one from me:
- Make bus_space_barrier() eat up the arguments passed to it so that
  the compiler doesn't needlessly whine.
1996-11-10 03:19:25 +00:00
thorpej 16c4c5af26 New bus.h implementation/interface:
- No more distinction between i/o-mapped and memory-mapped
	  devices.  It's all "bus space" now, and space tags
	  differentiate the space with finer grain than the
	  bus chipset tag.
	- Add memory barrier methods.
	- Implement space alloc/free methods.
	- Implement region read/write methods (like memcpy to/from
	  bus space).
This interface provides a better abstraction for dealing with
machine-independent chipset drivers.
1996-10-21 22:24:37 +00:00
thorpej 8c2f15c6fc New implementation of bus_io_{,un}map() for the i386. Details:
- A fixed extent map (statically allocated descriptor storage) is
	  created in init386(), just before the call to consinit().  The
	  fixed descriptor storage has enough room for 8 region entires,
	  which is plenty for early initialization, but doesn't chew up
	  that much memory.

	  This extent map (ioport_ex) manages the i386 i/o port
	  space (0x0 - 0xffff).

	- Just before the call to configure() in cpu_startup(), a
	  flag is set which notifies the bus_io functions that it is
	  safe to use malloc() to allocate descriptor storage, in the
	  event that more than 8 regions are needed.

	- bus_io_map() attempts to allocate the specified region from
	  ioport_ex.  If the allocation succeeds, the io handle is
	  filled in.  If the allocation fails, it is implied that
	  something else is already using that io space, and an
	  error condition is returned.

	- bus_io_unmap() frees a region previously allocated from
	  ioport_ex in bus_io_map().  If the free fails, a warning
	  is printed on the conole.

These changes implement "port accounting".  This is required for
proper autoconfiguration on the i386 port, and makes dealing with,
among other things, PCMCIA io mappings _much_ easier.
1996-06-23 19:59:06 +00:00
christos 1044435088 Avoid unused variable warnings, by using the first argument to the bus
functions.
1996-05-03 19:22:18 +00:00
thorpej 84c7027789 Add bus_io_{read,write}_multi_{1,2,4,8}() to the <machine/bus.h>
interface, and implement them (except for the 8-byte versions) on
the i386.
1996-04-05 23:59:37 +00:00
cgd 6826c7bf48 bus memory and I/O space access functions/macros, to be used by
machine-independent code for more sane access to bus resources.
New functions will be added to this set, in the future, as appropriate,
but this is a good starting set.  Defines:
	bus_{io,mem}_{map,unmap}
	bus_{io,mem}_{read,write}_{1,2,4,8}
functions, and several types to go with them.
1996-03-08 20:11:23 +00:00