Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ int(D2DK) — Motorola System V 88k Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

int(D2DK)  —  MISC. REFERENCE MANUAL PAGES

.IX \f4int\fP(D2DK)

NAME

int − process a device interrupt

SYNOPSIS

void prefixint(int ctlr);

ARGUMENT

ctlr Specifies the unique number associated with the the controller that is generating the interrupt.  These numbers are unique within each type of controller and start with zero.  ctlr represents the controller number extracted from the board field of the /stand/edt_data file. 

DESCRIPTION

The int routine is the interrupt handler for both block and character hardware drivers.  The interrupt handler is responsible for determining the reason for an interrupt, servicing the interrupt, and waking up any base-level driver processes sleeping on the interrupt completion.  For example, when a disk drive has transferred information to the host to satisfy a read request, the disk drive’s controller generates an interrupt.  The CPU acknowledges the interrupt and calls the interrupt handler associated with that controller and disk drive.  The interrupt routine services the interrupt and then wakes up the driver base-level process waiting for data.  The base-level portion of the driver then conveys the data to the user. 

In general, most interrupt routines must do the following tasks:

keep a record of interrupt occurrences

return immediately if no devices controlled by a driver caused the interrupt (only for systems supporting shared interrupts)

interpret the interrupt routine argument ctlr

reject requests for devices that are not served by the device’s controller

process interrupts that happen without cause (called spurious interrupts)

handle all possible device errors

wake processes that are sleeping on the resolution of an interrupt request

There are also many tasks the int routine must perform that are driver-type and device specific.  For example, the following types of drivers require different functions from their int routines:

A block driver dequeues requests, wakes up processes sleeping on an I/O request, and ensures that system generation has completed. 

A terminal driver receives and sends characters. 

A printer driver ensures that characters are sent. 

In addition, the functions of an int routine are device dependent.  You should know the exact chip set that produces the interrupt for your device.  You need to know the exact bit patterns of the device’s control and status register and how data is transmitted into and out of your computer.  These specifics differ for every device you access. 

The int routine for an intelligent controller that does not use individual interrupt vectors for each subdevice must access the completion queue to determine which subdevice generated the interrupt.  It must also update the status information, set/clear flags, set/clear error indicators, and so forth to complete the handling of a job.  The code should also be able to handle a spurious completion interrupt identified by an empty completion queue.  When the routine finishes, it should advance the unload pointer to the next entry in the completion queue. 

If the driver called biowait(D3DK) or SV_WAIT_SIG(D3DK) to await the completion of an operation, the int routine must call biodone(D3DK) or SV_SIGNAL(D3DK) to signal the process to resume. 

int is only used with hardware drivers, not software drivers. 

CAUTION: The int routine must never:

contain calls to the sleep kernel function

use functions that call sleep

drop the interrupt priority level below the level at which the interrupt routine was entered

call any function or routine that requires user context (that is, if it accesses or alters information associated with the running process)

NOTE: uiomove(D3DK) cannot be used in an interrupt routine when the uio_segflg member of the uio(D4DK) structure is set to UIO_USERSPACE (indicating a transfer between user and kernel space). 

SEE ALSO

biowait(D3DK), SV_SIGNAL(D3DK), biodone(D3DK), SV_WAIT_SIG(D3DK)

  —  DDI

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026