On 12/10/08 08:18, Andrew Gallatin wrote:
Paul Durrant wrote:
Andrew Gallatin wrote:
The above suggests that all my allocation requests should fail,
since all my allocation requests are for 1520 bytes, and that's
not a multiple of 4095...

Drew,

I didn't notice the 'multiple' rule when I started using it; to be honest I just went off what I found in the source code ;-) (The relevant bits of code are in the rootnex driver, if I remember correctly).

Let's hope nobody "fixes" the code to match the man page :)

Be very very careful here. The different platforms have different implementations of the rootnex stuff, as I recently discovered on 32-bit platforms. (Apparently I discovered a strange failure mode when align == 2, but minxfer == 4. It worked on amd64, but caused an allocation failure on 32-bit systems. Bumping align up to 4 fixed the problem in my driver, although to be fair the problem was *probably* a bug in the DDI DMA code for the i386.)

I would avoid depending too much on specific allocation behaviors like this, if I had a choice. Better, I think to just allocate one or more pages and manage the the division yourself internally.

   -- Garrett

Drew
_______________________________________________
driver-discuss mailing list
driver-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

_______________________________________________
driver-discuss mailing list
driver-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to