* master.d/README
*
* For additional information, see the master(4) man page and the
* IRIX Device Driver Programming Kit (marketing code: M4-DVDR-3.0).
*
* Any object which is to be included in a kernel by the self
* configuration boot program must have a corresponding master file which
* contains configuration specifications. The master file name is the
* basename of the object it describes.
*
* There are three sections in a master file: a tabulated ordering of
* flags, phrases and values interpreted by the configuration program and
* used to build device tables and the like, a list of stub routines, and
* a section of (mostly) C code. The first non-blank, non-comment line
* is interpreted for flags, phrases and values. Any other (non-comment)
* lines, up to a line that begins with a dollar sign ('$'), specify stubs.
* All phrases uttered after the line beginning with a dollar sign is
* processed to interpret special characters, then compiled (by the C
* compiler) into the kernel. Special characters are discussed below.
* Flags, phrases, values, et al...
*FLAG PREFIX SOFT #DEV DEPENDENCIES
* FLAG
*
* Flags, and their meanings, include the following:
*
* k: this is a kernel object file -- only one such object can be
* configured into a kernel.
* j: file system type
* f: framework/stream type device
* m: framework/stream module
* o: allow only one specification of device
* t: create cdevsw[].d_ttys "prefix|_tty"
* r: required device
* b: block type device
* c: character type device
* s: software device driver
* x: not a driver; a configurable object module -- all driver related
* data is ignored.
* n: driver is semaphored
* p: driver is unsemaphored and must be executed on master processor only
* u: this module represents stub functions. It will always be loaded after
all other modules
* w: driver is prepared to perform any cache write back operation required
on write data passed via the strategy routine
* d: dynamically loadable kernel module
* R: auto-registerable dynamically loadable kernel module
* N: don't allow a dynamically loadable kernel module to be auto-unloaded
* D: load, then unload a dynamically loadable kernel module
* PREFIX
*
* The prefix is a string of characters used to generate entries in
* various tables ( e.g., the file system switch table).
* SOFT -- External Major Numbers
*
* The external major number (the major number used in the special file
* for the device) is explicitly assigned in the /usr/sysgen/master.d file for
* that driver, whether it is a hardware driver or a "software" module.
*
* Multiple external major numbers may be specified in a single master.d
* file by specifying the list of external major numbers, separated by
* commas.
*
* Note that the number used must not exceed 511, this is a change from
* previous releases of IRIX. A '-' is ignored for modules that do not
* require external major numbers; for modules that require external major
* numbers, a '-' specifies that the configuration program should allocate
* a convenient major number for it. Also, some numbers are RESERVED for
* specified drivers and should not be used.
*
* The reserved numbers may be found in the include file <sys/major.h>.
*
* Internal Major Numbers
*
* The internal major number is assigned by the self configuring boot
* program at the time the drivers are loaded. In general, these numbers
* will be different after each boot. Since the internal major number is
* the number used to index into the [cb]devsw table, a driver may need
* some way to determine this number. The internal major number may be
* obtained in two ways. First, it appears in the MAJOR[] translation
* table built by the boot program:
*
* unsigned short MAJOR[512];
*
* This table is indexed by the external major number. Thus, the internal
* major number which corresponds to the external major number "X" is just:
*
* internal_major = MAJOR[X]
*
* or the getmajor() ddi routine may be used by passing the dev_t:
*
* internal_major = getmajor(dev)
*
* The second means is via the capability of the master file syntax for
* expressions. The builtin function `##M' is used to refer to the internal
* major number for the current driver.
* DEPENDENCIES
* A dependency names another module to be included at configuration time.
* Format: dependency [, dependency ]
* STUBS
*
* A stub specifies a routine stub to be generated (if necessary) at link
* time, if the module is excluded by the configuration program. All text
* after the initial flags/prefix line, and before a line beginning with
* '$' is interpreted as a stub specifier.
*
* The stub format is "rtn(){keyword}".
*
* KEYWORD STUB
* ------ ----
* rtn() { }
* nulldev rtn() { nulldev(); }
* nosys rtn() { return(nosys()); }
* nodev rtn() { return(nodev()); }
* true rtn() { return(1); }
* false rtn() { return(0); }
* fsnull rtn() { return(fsnull()); }
* fsstray rtn() { return(fsstray()); }
* nopkg rtn() { nopkg(); }
* noreach rtn() { noreach(); }
* $$$
*
* Specifications beyond a `$' in the first column are C code, with the
* exceptions that `##M' gets replaced with the Internal Major Number,
* `##D' is replaced with the number of devices (#DEV field), and `##C' is
* replaced by the number of controllers associated with the module -- the
* number of controllers is determined at configuration (see /usr/sysgen/system).