GATE(4)

NAME
gate - SLIC gate usage

DESCRIPTION
Drivers in DYNIX need to use gates, locks, and semaphores. Since the SLIC chip provides a finite number of gates to build these constructs, the gates must be allocated to the various functions in the operating system.

Of the 64 gates currently supported by the SLIC chip, the last 10 are pre-allocated by the DYNIX kernel for the purpose of building device-drivers and related code. These gates are defined in /sys/machine/gate.h, via:

    #define	G_DRIVERMIN	54
    #define	G_DRIVERMAX	63

The current usage of gates by the drivers supported by DYNIX is given below:
    ttyc*	SEC Console Ports	54
    rts*	SEC Tape	57
    sd*	SEC Disk	58
    se*	SEC Ether	59
    tty[hijk]*	MULTIBUS Systech MTI-800/1600	61
    xp*	MULTIBUS Xylogics 450 Disk	62
    xt*	MULTIBUS Xylogics 472 Tape	62

The implementation of sleep()/wakeup() for mono-processor drivers uses gate 63. This gate is not used unless there are mono-processor drivers in the system.

The typical use of gates in a driver is to build locks and semaphores. Since these constructs hold the gate for brief periods, contention on the gate is low. Thus it is acceptable to use a given gate in multiple drivers.

Most drivers configure the gate(s) they're using in their binary configuration file (for example in /sys/conf/conf_sd.c), using a line like:
    gate_t sdgate = 58;

This technique is recommended since it removes the dependency on an explicit gate from the driver source. This also better supports the ability to tune the usage of the gates for a given hardware/software configuration.

FILES

/sys/machine/gate.h
    defines SLIC gate usage

/sys/conf/conf_*.c
    driver binary-configuration files

CAVEAT
This description is implementation specific and subject to change. There will always be at least 10 gates pre-allocated to driver purposes, however.

BUGS
A more dynamic allocation strategy for gates might be better.