Use named (enumeration) indexes instead of magic numbers.

This fixes an off-by-one issue, as well as making it easier to add
entries or re-order entries from optional to required.
Use PAGE_OFFSET instead of IO_BASE for kernel virtual memory base.

MIPS kernel uses PAGE_OFFSET as the base of virtual memory on 64-bit
(XXX at least the 2.6.37 version does).

XXX note I hand-edited the 0002- patch so it may not be formatted
correctly according to patch anymore; this should be checked.  I don't
have a git tree for the Linux source to re-generate a patch on.