At Fri, 10 Oct 2003 11:03:36 +0200 (CEST), [EMAIL PROTECTED] wrote: > > Hello, > > > the hdsp-madi card with the hdspm driver seems to work now. > so I want do a clean out of the code: > > I asking how should I do this: > > > > at least I have to allocate one page more = 4194304+4096, to get no > > > Segmentation fault, but that could be the hardware too, since hdsp > > > also needs one page more ? > > > > the SG-buffer allocation size is aligned (round up) to PAGE_SIZE. > > (note that PAGE_SIZE is not always 4K byte on other architectures.) > > > > Ok on my i386 architecture I have 4k pages and > the rme card needs 4k buffers. > > So how to code this that it works on all architectures getting > a SG Buf with 4k buffers. > > Do I have to do something by doing preallocation ?
on linux, the least page size is 4K byte (so far, all architectures are so). thus, simply do a loop like offset = 0; /* bytes */ while (offset < total_size) { dma_addr_t addr = snd_sgbuf_get_addr(sgbuf, offset); map_this_addr_to_my_hw_table(addr); offset += 4096; /* 4k */ } Takashi ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel