Subject: Re: Adding bus_space_{peek,poke}_N() to bus_space(9)
To: Steve Woodford <scw@netbsd.org>
From: Allen Briggs <briggs@wasabisystems.com>
List: tech-kern
Date: 11/22/2000 13:21:06
On Wed, Nov 22, 2000 at 05:11:40PM +0000, Steve Woodford wrote:
> Alternatively, the above functions don't change but are supplemented by a
> bus_space_probe() function similar to vme_probe():
> 
> 	int bus_space_probe(bus_space_tag_t tag,
> 		bus_addr_t offset,
> 		bus_size_t size,
> 		int (*callback)(void *, bus_space_tag_t,
> 				bus_space_handle_t);
> 		void *arg);

mac68k already has the following:

int
mac68k_bus_space_probe(bus_space_tag_t t,
        bus_space_handle_t bsh,
        bus_size_t offset,
        int sz);

It does a "badaddr()"-like call for the specified bus_space access
(where sz is 1, 2, or 4).  It returns 1 if the access is successful
as 0 if it generates a bus error.  I think this is almost the same
thing that you're after.

-allen