Motorola MCP750 Specifications Page 141

  • Download
  • Add to my manuals
  • Print
  • Page
    / 344
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 140
Understanding the Kernel Environmen
t
9-21
device unit identifier or a pointer to a configuration structure. When the interrupt becomes
active, the interrupt handler parameter is passed as the first and only parameter to the inter-
rupt routine.
Following is an example code fragment that shows how to allocate an interrupt vector and
associate an interrupt handler with that vector:
register int i;
uint myhandlr_param;
extern void myintr_handlr(uint handlr_param);
/*
* Allocate and initialize an interrupt vector
*/
if ((i = ivec_alloc()) == -1 )
{
/* Attempt to obtain interrupt vector failed: return */
cmn_err(CE_WARN,
"mydriver: \
Can’t allocate an interrupt vector!\n");
return(FALSE);
}
/* Obtained interrupt vector successfully:
* Register an interrupt handler for the interrupt vector
*/
ivec_init(i, &myintr_handlr, myhandlr_param);
Debug Routines 9
The kernel provides a very useful routine, cmn_err(D3), that allows you to send an
error message to the system console or the circular kernel buffer putbuf. This routine
can also be used during debugging to display a panic message and halt the system. For
additional information on the use of cmn_err, refer to Chapter 15, “Driver Testing and
Debugging.
Small vs. Large Offset Drivers 9
Starting with PowerMAX OS 4.2, drivers may be compiled one of two ways: as large off-
set drivers or as small offset drivers.
The small offset driver is the traditional type of driver provided by the earlier revisions of
PowerMAX OS. These drivers are passed (and return) offsets which are of type off_t.
Since the off_t type is really a 32-bit integer type, small offset drivers cannot handle
devices (such as disk partitions) larger than 4 Gigabytes.
To handle today's newer and larger devices, the ability to create large offset drivers has
been introduced. A driver compiled as a large offset driver is given (and returns) 64-bit
Page view 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 343 344

Comments to this Manuals

No comments