Date: Fri, 15 Dec 2006 10:19:20 +0100 From: Hans Petter Selasky <hselasky@c2i.net> To: freebsd-hackers@freebsd.org Cc: Suleiman Souhlal <ssouhlal@freebsd.org>, Marc =?iso-8859-1?q?L=F6rner?= <marc.loerner@hob.de> Subject: Re: Allocate aligned memory Message-ID: <200612151019.22622.hselasky@c2i.net> In-Reply-To: <458261DE.2040607@FreeBSD.org> References: <200612150937.37737.marc.loerner@hob.de> <458261DE.2040607@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 15 December 2006 09:50, Suleiman Souhlal wrote: > Marc L=F6rner wrote: > > Hello all, > > > > I want to allocate 120KB of memory thats aligned to 32KB. > > I already saw/found the function contigmalloc, now my question is, why > > following functioncall never does return with an resulting address, > > instead null is returned? > > > > unsigned long *p =3D (unsigned long*) > > contigmalloc(120*1024, M_DEVBUF, M_WAITOK, 0, (1<<22), 32*1024, > > 1024*1024); > > Have you considered the fact that there might be no 32K-aligned 120KB chu= nk > of memory in the range you specified? > > My suggestion is to make the your high limit (currently 1 << 22) MUCH > higher, if possible. Also, getting rid of the 1MB boundary might help. > PS: contigmalloc is on the way out. Please use "man bus_dma" instead. For a= n=20 example see: http://www.turbocat.net/~hselasky/isdn4bsd/sources/src/sys/dev/usb/usb_subr= =2Ec And the function "usbd_mem_alloc_sub()". =2D-HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612151019.22622.hselasky>