Use of DVMA in a Sun Device Driver

Guest Account guest at cspi.com
Wed Oct 18 05:06:32 AEST 1989



I am modifying a device driver for an on-board array processor (AP) that
is attached to the VME bus of a Sun 3/260 running SunOS 4.0.3.
I would like to implement support for DMA, but TFM leaves out a lot
of details.  Perhaps there is someone out there who can help?

1) Which system call maps user space to DVMA space?  Is it just a call
to mapin?

2) When explaining the MB_CANTWAIT flag of mbsetup, the manual
states that it is "highly unlikely" that no "slots in the map
or in DVMA space" will be available. How can this be true? In
my situation, multiple devices will be performing huge, i.e.
several megabytes large, DMA's simultaneously. Won't they compete
for that 1 MB of DVMA space?  In other words, if several devices
are simultaneously attempting DMA's (of size 1 MB each), then
won't they have to wait for each other?

3) In our scenario, we would like a user program (a C program running on
the Sun which controls the AP)  to be able to append a
DMA operation (a data transfer between a user declared buffer and AP memory)
onto the AP's task queue without being forced to sleep until DMA completion.
The DMA controller resides on the AP board.  Ideally, the user program
could continue with other work knowing that the DMA would happen at some
later time.  When the AP found the DMA operation in its queue of tasks, it
would send an interrupt to the Sun in order to request that the user buffer be
readied, i.e. that it be mapped to DVMA space, locked in place, etc...
As I see it, my biggest problem here is that user process context cannot
be assumed from within xx_int.  How will I map the user buffer to DVMA
space when I don't have user context?  Don't I need to get to the top half of
the driver and restore context for the user process that requested the DMA?

One suggestion has been to call mbsetup, etc... when the user program
first queues the DMA on the AP (when user process context is still present).
This solution won't work for me because I want to be able to queue lots
of DMA's without having the user process suspend waiting for DVMA space to
become available.  The DMA's could happen long after they were queued
(eyeblink time to a human, but eons to a high speed AP).  I don't want to
tie up DVMA space in the interim.  
-- 

Eran Strod			E-mail: {apollo,decvax,uunet!tci}!cspi!strod



More information about the Comp.unix.wizards mailing list