Date: Sat, 29 Mar 1997 12:20:33 -0800 From: Amancio Hasty <hasty@rah.star-gate.com> To: Richard Tobin <richard@cogsci.ed.ac.uk> Cc: Steve Passe <smp@csn.net>, multimedia@freebsd.org Subject: Re: newest bt848 driver Message-ID: <199703292020.MAA10154@rah.star-gate.com> In-Reply-To: Your message of "Sat, 29 Mar 1997 15:12:10 GMT." <27837.199703291512@pitcairn.cogsci.ed.ac.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
>From The Desk Of Richard Tobin : > #define DMA_PROG_ALLOC 8 > ... > bktr->dma_prog = get_bktr_mem(unit, DMA_PROG_ALLOC); > > This appears to be allocating only 8 bytes for the DMA program??? > > -- Richard > get_bktr_mem allocates memory in terms of pages (4096 bytes) static vm_offset_t get_bktr_mem( int unit, unsigned size ) { vm_offset_t addr = 0; addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff, 1<<24); if (addr == 0) addr = vm_page_alloc_contig(size, 0x100000, 0xffffffff, PAGE_SIZE); if (addr == 0) { printf("meteor%d: Unable to allocate %d bytes of memory.\n", unit, size); } return addr; } in /sys/vm/vm_page.c: vm_offset_t vm_page_alloc_contig(size, low, high, alignment) vm_offset_t size; vm_offset_t low; vm_offset_t high; vm_offset_t alignment; { return ((vm_offset_t)contigmalloc(size, M_DEVBUF, M_NOWAIT, low, high, alignment, 0ul)); } Have fun, Amancio
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703292020.MAA10154>