problems with physio()

Beau James {Manager - SW Devel - Ultra Networks} beau at ultra.com
Sat Sep 2 04:16:04 AEST 1989


--> I am porting a device driver which worked under SunOS 3.x to Sun4.0.1, and
--> am having some problems.  The driver uses physio() (as per the Guide to
--> Writing Device Drivers) to lock down the user's i/o buffer and map it into
--> the kernel.

Physio() does not map the user buffer into kernel virtual address space in
4.0.  That's not normally necessary, since you are typically only locking
the buffer down in order to DMA into/out of it.  When you call mbsetup()
to map the buffer onto the bus, the buffer does get mapped inot DVMA
space, which is also a valid part of kernel virtual address space.

This has the additional benefit of avoiding double-mapping the pages in
kernel virtual address space.  That saves kernel page table entries and
helps avoid cache aliasing problems.

If you also want to examine the contents of the buffer while in the
kernel, the safest thing to do is to look at it at is DVMA-mapped address.

Beau James				beau at Ultra.COM
Ultra Network Technologies		{sun,ames}!ultra.com!beau



More information about the Comp.sys.sun mailing list