Subject: Re: structural bus_space_handles
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 06/05/2006 03:24:48
In article <4483934C.8050505@tadpole.com>,
Garrett D'Amore  <garrett_damore@tadpole.com> wrote:
>Christos Zoulas wrote:
>> In article <44830CB6.5070402@tadpole.com>,
>> Garrett D'Amore  <garrett_damore@tadpole.com> wrote:
>>   
>>> SPARC64 uses a struct instead of an address or pointer for a
>>> bus_space_handle_t.  This creates an ugly situation in some code (ath in
>>> particular), forcing us to have #ifdef __sparc64__ in this code to
>>> handle this case.  (The Atheros HAL layer wants a single pointer for a
>>> bus_space_handle_t.)
>>>
>>> It would be cleaner to have a macro in bus.h, ala
>>> __BUS_SPACE_HANDLE_IS_STRUCT, so that I could test for that flag instead
>>> of having a test for a specific port.  What do folks think?
>>>     
>>
>> Maybe a bus_space_get_handle() macro?
>>
>> christos
>>   
>
>The problem is that I need to store these things in a void *.  Because
>that's all the binary HAL gives me.

Then:
	void *bus_space_externalize(bus_space_tag_t *)
and
	bus_space_tag_t *bus_space_internalize(void *)

christos