Motorola MCP750 Specifications Page 317

  • Download
  • Add to my manuals
  • Print
  • Page
    / 344
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 316
Writing a User-Level Device Drive
r
17-41
Provide Debug and Status Information 17
You might want to provide the -d option to facilitate debugging. To support the -d
option, the device configuration program displays the values that the device register
region and the driver status region contain. The type of information that you choose to
provide depends upon the nature of the device and the driver.
Restore the Device to its Initial State 17
The purposes of the -x option are (1) to destroy the user-level device driver’s association
with a device and (2) to restore the device to its initial state as defined by the kernel device
driver. To support the -x option, the device configuration program must perform the
following functions:
Disconnect the user-level interrupt process from the interrupt vector, and
remove the defined interrupt vector connection, if applicable.
Use the ICON_DISC iconnect(3C) library routine call to perform this
function. The program must have the P_USERINT privilege.
Detach and remove the driver status and device register regions.
Remove global data structures that contain information about a particular
device and the locations of its driver status and device register regions.
Restore important device registers to their initial state (for example,
interrupt vectors, interrupt-enabled flags, and so on).
Debugging the Driver 17
You can debug most components of a user-level device driver by using one of the standard
user-level debuggers: adb(1), gdb(1),orNightView(1). You cannot use one of
these debuggers to debug the interrupt-handling routine, however, because it executes at
interrupt level; you can, instead, use the console processor to obtain some debugging
capability for this routine (refer to the PowerUX Real-Time Guide for an explanation of
the procedures for debugging the interrupt-handling routine).
A debugger uses ptrace(2) to access memory in the debugged process. If you use a
debugger to examine memory that is mapped to I/O memory addresses, you can cause the
system to panic. (For information on the ptrace(2) system call, refer to the
corresponding system manual page.)
When you are developing and debugging a user-level device driver, it is recommended that
you use the following techniques:
Debug a user-level driver on a single-user system because it is possible for
the driver to cause the system to crash.
Keep the work in the interrupt-handling routine to a minimum.
Page view 316
1 2 ... 312 313 314 315 316 317 318 319 320 321 322 ... 343 344

Comments to this Manuals

No comments