Subject: Re: bus_dmamap_load: struct proc *p: finding process p
To: None <tech-kern@NetBSD.org>
From: Sam Thigpen <sthigpen@sdf.lonestar.org>
List: tech-kern
Date: 10/04/2004 16:36:49
On Mon, 4 Oct 2004, David Young wrote:

> Date: Mon, 4 Oct 2004 02:01:30 -0500
> From: David Young <dyoung@pobox.com>
> To: Sam Thigpen <sthigpen@sdf.lonestar.org>
> Cc: tech-kern@NetBSD.org
> Subject: Re: bus_dmamap_load: struct proc *p: finding process p
> 
> On Mon, Oct 04, 2004 at 02:37:55AM +0000, Sam Thigpen wrote:
>> old question:
>>
>> bus_dmamap_load __P((bus_dma_tag_t tag, bus_dma_handle_t dmah,
>> 	    caddr_t va, size_t size, struct proc *p, int flags));
>>                                      ^^^^^^^^^^^^^^
>> Accepted way getting for getting struct proc *p?
>>
>> ath.c has :
>>
>>         error = bus_dmamap_load(sc->sc_dmat, sc->sc_ddmamap,
>>                                 sc->sc_desc, sc->sc_desc_len,
>>                                 ath_load_cb, &sc->sc_desc_paddr,
>>                                 BUS_DMA_NOWAIT);
>
> You're reading the wrong code. In the #ifdef __NetBSD__ portion, it says:
>
>        if ((error = bus_dmamap_load(sc->sc_dmat, sc->sc_ddmamap, sc->sc_desc,
>            sc->sc_desc_len, NULL, 0)) != 0) {
>                printf("%s: unable to load control data DMA map, error = %d\n",
>                    sc->sc_dev.dv_xname, error);
>                goto fail3;
>        }

So for NetBSD the buffer is typically in kernel space by default?  Are
there cases where it isn't?

Thanks,
-sa.
sthigpen@freeshell.org
http://sthigpen.freeshell.org/code/acx/netbsd