Specifications
Writing a User-Level Device Drive
r
17-3
7
For those user-level interrupt applications that want to bind some portion of their address
space to local memory on a Series 6000 system that has more than one CPU board, the
following steps must be taken in order to prevent data incoherences.
1. Determine which CPU is receiving the interrupt to which you want to
connect the user-level interrupt process.
You can do so by using one of the following methods: (1) use the
intstat(1M) utility, or (2) invoke the mpadvise(3C) library routine
from a program and specify the MPA_CPU_INTVEC or the MPA_CPU_VMELEV
command. (For (H)VME interrupts, use the MPA_CPU_VMELEV command;
for other interrupts, use the MPA_CPU_INTVEC command.) For additional
information, refer to the intstat(1M) and mpadvise(3C) system
manual pages.
2. Set the process's CPU bias to include, at most, those CPUs that reside on
the same processor board where the interrupt is received.
You can do so by using the mpadvise(3C) library routine and
specifying the MPA_CPU_LMEM and MPA_PRC_SETBIAS or MPA_PRC_SETRUN
commands as explained in the corresponding system manual page.
3. If desirable, create one or more shared memory regions that are bound to
local memory.
You can do so by using the shmget(2) system call, the
shmdefine(1) utility, or the shmconfig(1M) utility as explained in
the PowerUX Programming Guide.
Constraints on Interrupt-Handling Routines 17
To develop the driver’s interrupt-handling routine, you must take into consideration the
constraints that are imposed on that routine. A complete discussion of those constraints is
provided in the PowerUX Real-Time Guide. Some of the most significant ones are sum-
marized as follows:
• One parameter is passed to a user-level interrupt-handling routine: the
value that is specified in the ic_value field of the icon_conn structure
supplied on the iconnect(3C) call that defines the connection between
the user-level interrupt process and an interrupt vector. The interrupt-
handling routine is entered in user mode with the connected interrupt still
active.
• An interrupt-handling routine can reference any memory location that is in
the virtual address space of the user-level interrupt process--including
VME I/0 memory space to which the process’s virtual address space has
previously been bound. Portions of the user-level interrupt process’s
address space that are referenced by the interrupt-handling routine must
have been locked into physical memory prior to enabling the interrupt vec-
tor connection.
• Any type of exception (page fault, floating point exception, and so on) is
fatal during execution of an interrupt-handling routine. In the PowerUX