next up previous contents index
Next: 29.5.3 Functions Up: 29.5 Internals Previous: 29.5.1 Namespace Management Rules

29.5.2 Variables

current

This is a global variable that points to the state for the current process. It is mostly used by drivers to set or clear the interruptible state of the process.

jiffies

Many Linux device drivers depend on a global variable called jiffies, which in Linux contains a clock tick counter that is incremented by one at each 10-millisecond (100Hz) clock tick. The device drivers typically read this counter while polling a device during a (hopefully short) interrupt-enabled busy-wait loop. Although a few drivers take the global clock frequency symbol HZ into account when determining timeout values and such, most of the drivers just used hard-coded values when using the jiffies counter for timeouts, and therefore assume that jiffies increments ``about'' 100 times per second.

irq2dev_map

This variable is an array of pointers to network device structures. The array is indexed by the interrupt request line (IRQ) number. Linux network drivers use it in interrupt handlers to find the interrupting network device given the IRQ number passed to them by the kernel.

blk_dev

This variable is an array of ``struct blk_dev_struct'' structures. It is indexed by the major device number. Each element contains the I/O request queue and a pointer to the I/O request function in the driver. The kernel queues I/O requests on the request queue, and calls the request function to process the queue.

blk_size

This variable is an array of pointers to integers. It is indexed by the major device number. The subarray is indexed by the minor device number. Each cell of the subarray contains the size of the device in 1024 byte units. The subarray pointer can be NULL, in which case, the kernel does not check the size and range of an I/O request for the device.

blksize_size

This variable is an array of pointers to integers. It is indexed by the major device number. The subarray is indexed by the minor device number. Each cell of the subarray contains the block size of the device in bytes. The subarray can be NULL, in which case, the kernel uses the global definition BLOCK_SIZE (currently 1024 bytes) in its calculations.

hardsect_size

This variable is an array of pointers to integers. It is indexed by the major device number. The subarray is indexed by the minor device number. Each cell of the subarray contains the hardware sector size of the device in bytes. If the subarray is NULL, the kernel uses 512 bytes in its calculations.

read_ahead

This variable is an array of integers indexed by the major device number. It specifies how many sectors of read-ahead the kernel should perform on the device. The drivers only initialize the values in this array; the Linux kernel block buffer code is the actual user of these values.

wait_for_request

The Linux kernel uses a static array of I/O request structures. When all I/O request structures are in use, a process sleeps on this variable. When a driver finishes an I/O request and frees the I/O request structure, it performs a wake up on this variable.

EISA_bus

If this variable is non-zero, it indicates that the machine has an EISA bus. It is initialized bye the Linux kernel prior to device configuration.

high_memory

This variable contains the address of the last byte of physical memory plus one. It is initialized by the Linux kernel prior to device configuration.

intr_count

This variable gets incremented on entry to an interrupt handler, and decremented on exit. Its purpose is let driver code determine if it was called from an interrupt handler.

kstat

This variable contains Linux kernel statistics counters. Linux drivers increment various fields in it when certain events occur.

tq_timer

Linux has a notion of ``bottom half'' handlers. These handlers have a higher priority than any user level process but lower priority than hardware interrupts. They are analogous to software interrupts in BSD. Linux checks if any ``bottom half'' handlers need to be run when it is returning to user mode. Linux provides a number of lists of such handlers that are scheduled on the occurrence of specific events. tq_timer is one such list. On every clock interrupt, Linux checks if any handlers are on this list, and if there are, immediately schedules the handlers to run.

timer_active

This integer variable indicates which of the timers in timer_table (described below) are active. A bit is set if the timer is active, otherwise it is clear.

timer_table

This variable is an array of ``struct timer_struct'' elements. The array is index by global constants defined in <linux/timer.h>. Each element contains the duration of timeout, and a pointer to a function that will be invoked when the timer expires.

system_utsname

This variable holds the Linux version number. Some drivers check the kernel version to account for feature differences between different kernel releases.


next up previous contents index
Next: 29.5.3 Functions Up: 29.5 Internals Previous: 29.5.1 Namespace Management Rules

University of Utah Flux Research Group