DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

remap_driver_cpu(D3oddi)


remap_driver_cpu -- bind an interrupt service routine to a CPU

Synopsis

   int remap_driver_cpu (int user_value, int driver_value);

Description

The remap_driver_cpu(D3oddi) function is used to populate the processor_mask member of the driver_info(D4oddi) and shareg_ex(D4osdi) structures for drivers that support distributed interrupts. It provides the kernel support necessary for binding an interrupt service routine (ISR) to a CPU.

Arguments


user_value
Set to a value of 1 if driver does not support distributed interrupts; set to a value of 0 if driver does support distributed interrupts.

driver_value
bitmask of the driver's CPU assignment preference; typically ICPU_EXANY.

Return values

On success, remap_driver_cpu( ) returns the mask.

Usage

The following code fragment illustrates how to implement a driver interrupt handler that, by default, runs on all CPUs, but can be tuned to allow all processing associated with a particular device to always occur on a particular CPU:

The processor_mask member of the driver_info(D4oddi) or shareg_ex(D4osdi) structure is populated as follows:

   extern int xx_processor;
   driver_info di;
   ...
   di.processor_mask=remap_driver_cpu(xx_processor, ICPU_EXANY);
The xx_processor variable should be defined
   #include "sys/deverg.h"
   

int xx_processor = DRIVER_CPU_DEFAULT;

The system administrator can then modify the driver's space.c file to choose the processors on which the interrupt handler will be allowed to run, or to allow it to run on any processor. For MDI drivers, a netconfig(ADM) Advanced Option can be used to provide a more user-friendly interface to these settings.

Context and synchronization

Initialization context

Hardware applicability

All

Version applicability

oddi: 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

DDI does not support this function. See ``Interrupt handlers, attaching and registering'' in HDK Technical Reference for information about attaching interrupts in DDI drivers.

References

driver_info(D4oddi), idistributed(D3oddi), shareg_ex(D4osdi), Sharegister(D3osdi)

``Interrupt handlers, attaching and registering'' in HDK Technical Reference

Examples

See the idistributed(D3oddi) and Sharegister(D3osdi) manual pages for examples illustrating the use of remap_driver_cpu( ).
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005