Motorola MCP750 Specifications Page 299

  • Download
  • Add to my manuals
  • Print
  • Page
    / 344
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 298
Writing a User-Level Device Drive
r
17-23
The vme_address(3C) Library Routine 17
The vme_address(3C) routine enables you to obtain a 32-bit physical address for an
A16 or an A24 (H)VME address generated by a particular device. A 32-bit physical
address is required when you use the shmbind(2) system call or the shmconfig(1M)
command to bind a shared memory region to a section of physical (H)VME memory. You
might find this routine particularly helpful when you are writing a user-level device driver
and need to bind a shared memory region to the physical address of the (H)VME board.
Use of vme_address(3C) is explained in the PowerUX Real-Time Guide; reference
information is provided in the corresponding system manual page.
Developing the Driver’s I/O Service Routines 17
A standard interface has been defined for a user-level device driver’s open, close,
aread, awrite, acheck, await, and control routines. The standard interface for each
of these routines is described in the sections that follow. User-level device drivers written
by Concurrent Computer Corporation personnel must adhere to the standard interfaces.
The following information is provided for each type of routine.
A description of the routine and implementation guidelines
The C specification
Detailed descriptions of each parameter
The return value
The open routine is described in “The open Routine” on page 17-23. The asynchronous
I/O support routines are described in “The Asynchronous I/O Support Routines” on page
17-25. The control functions are described in “Control Functions” on page 17-30. The
close routine is described in “The close Routine” on page 17-31.
The open Routine 17
The driver’s open routine allows a user process to open a device in preparation for I/O or
control operations. It is responsible for performing any initialization that is necessary to
use the device. It attaches the driver status region and the device register region to the
calling process’s virtual address space. To perform these functions, the open routine
must make the following calls for each region:
ftok(3C) to obtain an IPC key that is based on the path name of the device
and a character that uniquely identifies a group of cooperating
processes. Note that ftok returns the same key for linked files
when it is called with the same path name and identifier; it returns
different keys when called with the same path name and different
identifiers.
Page view 298
1 2 ... 294 295 296 297 298 299 300 301 302 303 304 ... 343 344

Comments to this Manuals

No comments