Home | History | Annotate | only in /src/sys/arch/hp300
History log of /src/sys/arch/hp300
RevisionDateAuthorComments
 1.12 25-Oct-2008  apb Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.11 06-Jan-2003  lukem branches: 1.11.104; 1.11.108; 1.11.114;
Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile. Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
 1.10 12-Jun-1998  cgd branches: 1.10.32;
Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.9 11-Oct-1997  mycroft Use m68k/Makefile.inc.
 1.8 11-Oct-1997  mycroft Nuke NOOBJ.
 1.7 11-Oct-1997  mycroft Update all the tags goo, and use bsd.subdir.mk.
 1.6 07-May-1997  mycroft branches: 1.6.4;
Don't use _SUBDIRUSE outside of bsd.subdir.mk.
 1.5 04-Aug-1995  thorpej Spring cleaning.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 27-Apr-1994  hpeyerl make a make and a make install work
 1.2 31-Jul-1993  mycroft Add RCS indentifiers.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.32.1 07-Jan-2003  thorpej Sync with HEAD.
 1.11.114.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.11.108.1 04-May-2009  yamt sync with head.
 1.11.104.1 17-Jan-2009  mjf Sync with HEAD.
 1.6 08-Sep-2023  andvar fix few typos in the text of Debug.tips and TODO.hp300 docs.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 16-May-2004  wiz "panicking" needs a k.
 1.3 22-Jul-2001  wiz branches: 1.3.6; 1.3.22;
seperate -> separate
 1.2 26-Oct-1994  cgd branches: 1.2.46;
new RCS ID format.
 1.1 23-May-1994  mycroft From 4.4-Lite.
 1.2.46.1 03-Aug-2001  lukem update to -current
 1.3.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.22.1 03-Aug-2004  skrll Sync with HEAD
 1.3.6.2 22-Jul-2001  wiz seperate -> separate
 1.3.6.1 22-Jul-2001  wiz file Debug.tips was added on branch nathanw_sa on 2001-07-22 13:34:05 +0000
 1.7 14-May-2024  andvar fix recently committed typos by msaitoh in few more places, as well as few more.
mainly s/contigous/contiguous/ and s/miliseconds/milliseconds/ in comments.
 1.6 08-Sep-2023  andvar s/Insruction/Instruction/
 1.5 11-Feb-2002  wiz s/seperate/separate/
 1.4 16-Sep-2001  wiz branches: 1.4.4;
Spell 'occurred' with two 'r's.
 1.3 22-Jul-2001  wiz branches: 1.3.2;
seperate -> separate
 1.2 26-Oct-1994  cgd branches: 1.2.46;
new RCS ID format.
 1.1 23-May-1994  mycroft From 4.4-Lite.
 1.2.46.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.46.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.46.1 03-Aug-2001  lukem update to -current
 1.3.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.4.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.1 16-Sep-2001  nathanw file HPMMU.notes was added on branch nathanw_sa on 2002-02-28 04:09:20 +0000
 1.10 31-Dec-2007  ad Remove COMPAT_HPUX.
 1.9 08-Mar-2006  lukem branches: 1.9.40; 1.9.46; 1.9.54;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.8 24-Nov-2001  isaki branches: 1.8.32; 1.8.46; 1.8.48; 1.8.50; 1.8.52;
fix typo s/68551/68851/ in a comment.
 1.7 12-Sep-1997  mycroft branches: 1.7.30; 1.7.34;
The FPCOPROC option no longer exists.
 1.6 31-Jan-1997  carrel branches: 1.6.8;
Make "options HP340" actually work without having "option HP360".
 1.5 13-Oct-1996  christos backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 05-Jul-1994  mycroft HPFPLIB --> FPSP
 1.1 23-May-1994  mycroft From 4.4-Lite.
 1.6.8.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.34.1 08-Jan-2002  nathanw Catch up to -current.
 1.7.30.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.52.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.8.50.1 13-Mar-2006  yamt sync with head.
 1.8.48.1 22-Apr-2006  simonb Sync with head.
 1.8.46.1 09-Sep-2006  rpaulo sync with head
 1.8.32.2 21-Jan-2008  yamt sync with head
 1.8.32.1 21-Jun-2006  yamt sync with head.
 1.9.54.1 02-Jan-2008  bouyer Sync with HEAD
 1.9.46.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.40.1 09-Jan-2008  matt sync with HEAD
 1.4 06-Dec-2001  wiz File contents not interesting anymore, and even partially wrong.
Remove it. Ok'd by chuq.
 1.3 13-Mar-2000  soren branches: 1.3.8; 1.3.12;
Fix doubled 'the's in comments.
 1.2 26-Oct-1994  cgd branches: 1.2.32;
new RCS ID format.
 1.1 23-May-1994  mycroft From 4.4-Lite.
 1.2.32.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3 08-Dec-2001  gmcgarry Update list to reflect reality
 1.2 26-Oct-1994  cgd branches: 1.2.46; 1.2.50;
new RCS ID format.
 1.1 23-May-1994  mycroft From 4.4-Lite.
 1.2.50.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.46.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2 03-Jul-1994  mycroft Clean up deleted files.
 1.1 23-May-1994  mycroft From 4.4-Lite.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft From 4.4-Lite.
 1.4 08-Sep-2023  andvar fix few typos in the text of Debug.tips and TODO.hp300 docs.
 1.3 12-Apr-2022  andvar s/sould/should/ and s/shoud/should/
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft From 4.4-Lite.
 1.3 06-Jan-2003  lukem Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile. Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
 1.2 26-Oct-1994  cgd branches: 1.2.50;
new RCS ID format.
 1.1 17-May-1993  cgd make sure hp300/compile stays in the distribution
 1.2.50.1 07-Jan-2003  thorpej Sync with HEAD.
 1.1 06-Jan-2003  lukem branches: 1.1.2;
Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile. Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
 1.1.2.2 07-Jan-2003  thorpej Sync with HEAD.
 1.1.2.1 06-Jan-2003  thorpej file Makefile was added on branch nathanw_sa on 2003-01-07 21:08:38 +0000
 1.42 08-Feb-2002  gmcgarry Remove old, custom files.
 1.41 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.40 17-Nov-2001  gmcgarry Update for new RTC and HIL attachments.
 1.39 08-Jul-2001  abs branches: 1.39.2; 1.39.8;
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.38 02-Jan-2001  simonb Add ELF support.

Thanks to Steve Woodford for his help!
 1.37 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.36 14-Jun-2000  veego Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.35 12-Feb-2000  thorpej branches: 1.35.2;
Nuke NKMEMCLUSTERS.
 1.34 14-Dec-1999  thorpej Add COMPAT_LINUX, COMPAT_SVR4, EXEC_ELF32.
 1.33 19-Sep-1999  thorpej branches: 1.33.2; 1.33.8;
Remove ipfilter, add IPv6 and IPSec.
 1.32 19-Sep-1999  thorpej Correct a comment: aging `basalt' is no longer a file server, but now
just a mere workstation.
 1.31 19-Sep-1999  thorpej Add SYSV* IPC options.
 1.30 31-Jul-1999  thorpej Add HP385.
 1.29 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.28 23-Jun-1999  thorpej Enable DDB history.
 1.27 19-Dec-1998  thorpej branches: 1.27.4;
Wire down some SCSI disk units.
 1.26 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.25 04-May-1998  thorpej options UVM no longer needed; it's standard
 1.24 01-May-1998  thorpej TCP_CWM option doesn't exist anymore; it's all run-time.
 1.23 29-Apr-1998  thorpej Turn off TCP_COMPAT_42, turn on TCP_CWM.
 1.22 24-Feb-1998  thorpej Switch this kernel to UVM.
 1.21 22-Dec-1997  thorpej Add COMPAT_13.
 1.20 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.19 07-May-1997  lukem cleanup unecessary quotage of options
 1.18 06-May-1997  lukem be consistent with use of spaces and tabs.
don't need quotes around options with _'s in the name
 1.17 31-Mar-1997  thorpej Build these kernels with full debugging symbols.
 1.16 12-Mar-1997  thorpej Add 9660 file system, and set DDB_ONPANIC to 0.
 1.15 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.14 30-Jan-1997  thorpej Update for new-style config.
 1.13 20-Jan-1997  scottr Remove obsolete timezone specification
 1.12 07-Jan-1997  mrg branches: 1.12.2;
use pseudo-device ipfilter, not ipl.
 1.11 06-Jan-1997  thorpej Add ipl pseudo-device.
 1.10 09-Dec-1996  thorpej Sync with reality.
 1.9 09-Dec-1996  thorpej Add EXEC_SCRIPT (I don't even want to know how I forgot it before...)
 1.8 15-Oct-1996  thorpej Don't need "options GENERIC" anymore.
 1.7 03-Oct-1996  thorpej Add EXEC_AOUT to all kernels.
 1.6 10-Sep-1996  thorpej Document COMPAT_M68K4K, but leave it disabled by default.
 1.5 22-Aug-1996  thorpej Add COMPAT_12 to all kernels, and COMPAT_11 to a few as well.
 1.4 29-Dec-1995  thorpej Increase maxusers from 16 to 32.
 1.3 28-Nov-1995  thorpej Enable COMPAT_HPUX.
 1.2 21-Sep-1995  thorpej Add 4 vnds to each, add 4 ccds to GENERIC, update BASALT to match
current reality.
 1.1 04-Aug-1995  thorpej Kernel configuration file for my hp380.
 1.12.2.1 30-Jan-1997  thorpej update from trunk
 1.27.4.2 02-Aug-1999  thorpej Update from trunk.
 1.27.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.33.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.33.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.33.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.35.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.39.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.39.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.39.8.1 08-Jul-2001  nathanw file BASALT was added on branch nathanw_sa on 2002-01-08 00:24:29 +0000
 1.39.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.39.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.39.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2 08-Feb-2002  gmcgarry Remove old, custom files.
 1.1 30-May-1998  thorpej branches: 1.1.28; 1.1.32;
Profiling version of the BASALT kernel.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 16-Mar-2002  jdolecek Catch up with -current.
 1.34 10-Feb-2002  gmcgarry Don't need these.
 1.33 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.32 14-Dec-2001  gmcgarry Use bootp, to match the recent change to the bootblocks.
 1.31 17-Nov-2001  gmcgarry Update for new RTC and HIL attachments.
 1.30 08-Jul-2001  abs branches: 1.30.2; 1.30.8;
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.29 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.28 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.27 31-Jul-1999  thorpej branches: 1.27.2;
Add HP385.
 1.26 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.25 28-Aug-1998  thorpej branches: 1.25.8;
Use NFS_BOOT_BOOTPARAMS until we change the boot program to use DHCP
 1.24 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.23 01-Dec-1997  kleink Add COMPAT_13.
 1.22 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.21 12-May-1997  thorpej Add the following drivers:
- frodo at intio
- dnkbd at frodo (commented out until integrated)
- apci at frodo
 1.20 07-May-1997  lukem whitespacos i missed
 1.19 07-May-1997  lukem cleanup unecessary quotage of options
 1.18 06-May-1997  lukem be consistent with use of spaces and tabs.
don't need quotes around options with _'s in the name
 1.17 27-Apr-1997  thorpej Update for new SPU options.
 1.16 31-Mar-1997  thorpej Build these kernels with full debugging symbols.
 1.15 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.14 30-Jan-1997  scottr Add DIOVERBOSE per Jason; clean up formatting for some options.
 1.13 30-Jan-1997  thorpej Update for new-style config.
 1.12 20-Jan-1997  scottr Remove obsolete timezone specification
 1.11 11-Dec-1996  thorpej branches: 1.11.2;
Fix typo in comment.
 1.10 09-Dec-1996  thorpej Add EXEC_SCRIPT (I don't even want to know how I forgot it before...)
 1.9 03-Oct-1996  thorpej Add EXEC_AOUT to all kernels.
 1.8 10-Sep-1996  thorpej Document COMPAT_M68K4K, but leave it disabled by default.
 1.7 25-Aug-1996  thorpej Add the United Kingdom and Swedish HIL keyboard maps to the kernels
used in the binary snapshots.
 1.6 22-Aug-1996  thorpej Add COMPAT_12 to all kernels, and COMPAT_11 to a few as well.
 1.5 29-Dec-1995  thorpej branches: 1.5.4;
Enable COMPAT_HPUX by default. It's still not 100% yet, but it doesn't
seem to really hurt anything, either. Makes it easier for folks using
binary snapshots only to try it out.

GENERIC: now that the PT map allocation is fixed, increase the default
maxusers to 32.
 1.4 28-Nov-1995  thorpej Note the new status of COMPAT_HPUX, but keep is disabled by default.
 1.3 10-Oct-1995  thorpej Add another dca and grf
 1.2 21-Sep-1995  thorpej Add 4 vnds to each, add 4 ccds to GENERIC, update BASALT to match
current reality.
 1.1 02-Sep-1995  thorpej Example configuration for a diskless hp300.
 1.5.4.2 25-Aug-1996  thorpej Add COMPAT_11 to the kernels used in the binary snapshots.
 1.5.4.1 25-Aug-1996  thorpej Pull up from trunk:

Add the United Kingdom and Swedish HIL keyboard maps to the kernels
used in the binary snapshots.
 1.11.2.1 30-Jan-1997  thorpej update from trunk
 1.25.8.1 02-Aug-1999  thorpej Update from trunk.
 1.27.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.30.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.30.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.30.8.1 08-Jul-2001  nathanw file DISKLESS was added on branch nathanw_sa on 2002-01-08 00:24:29 +0000
 1.30.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.30.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.30.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.39 29-Dec-2000  mycroft Long gone.
 1.38 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.37 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.36 31-Jul-1999  thorpej branches: 1.36.2;
Add HP385.
 1.35 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.34 26-Jun-1998  lukem branches: 1.34.10;
remove options FIFO; it's now the default
 1.33 22-Dec-1997  thorpej Add COMPAT_13.
 1.32 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.31 07-May-1997  lukem whitespacos i missed
 1.30 07-May-1997  lukem cleanup unecessary quotage of options
 1.29 06-May-1997  lukem be consistent with use of spaces and tabs.
don't need quotes around options with _'s in the name
 1.28 27-Apr-1997  thorpej Update for new SPU options.
 1.27 14-Mar-1997  mycroft Update this to new config.
 1.26 12-Mar-1997  thorpej Enable COMPAT_M68K4K.
 1.25 20-Jan-1997  scottr Remove obsolete timezone specification
 1.24 11-Dec-1996  thorpej branches: 1.24.2;
Fix typo in comment.
 1.23 09-Dec-1996  thorpej Add EXEC_SCRIPT (I don't even want to know how I forgot it before...)
 1.22 03-Oct-1996  thorpej Add EXEC_AOUT to all kernels.
 1.21 10-Sep-1996  thorpej Document COMPAT_M68K4K, but leave it disabled by default.
 1.20 22-Aug-1996  thorpej Add COMPAT_12 to all kernels, and COMPAT_11 to a few as well.
 1.19 20-May-1996  mrg document PORTAL
 1.18 12-May-1995  mycroft Add vnd.
 1.17 31-Mar-1995  mycroft Update.
 1.16 05-Mar-1995  mycroft Remove file systems.
 1.15 23-Feb-1995  mycroft More disks, tapes, MSDOSFS...
 1.14 26-Oct-1994  cgd new RCS ID format.
 1.13 17-Aug-1994  mycroft No COMPAT_HPUX at the moment.
 1.12 05-Jul-1994  mycroft branches: 1.12.2;
Add FPSP magic.
 1.11 03-Jul-1994  mycroft Switch to Motorola emulator.
 1.10 23-May-1994  mycroft `clock' is no longer a device.
 1.9 20-May-1994  mycroft Add label location overrides.
 1.8 17-May-1994  cgd no SYSVSHM
 1.7 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.6 24-Apr-1994  mycroft Add COMPAT_09.
 1.5 09-Jan-1994  mycroft Enable DDB.
 1.4 05-Jan-1994  mycroft Bleah.
 1.3 30-Aug-1993  deraadt pagers are now options, not pseudo-devices
 1.2 19-Aug-1993  mycroft Add COMPAT_NOMID.
 1.1 10-Aug-1993  mycroft Rename my kernel config.
 1.12.2.1 17-Aug-1994  mycroft update from trunk
 1.24.2.1 30-Jan-1997  thorpej update from trunk
 1.34.10.1 02-Aug-1999  thorpej Update from trunk.
 1.36.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.36.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4 10-Feb-2002  gmcgarry Don't need these.
 1.3 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.2 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.1 01-Jul-2001  gmcgarry branches: 1.1.2; 1.1.8;
Example options to reduce kernel memory footprint.
 1.1.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.8.1 01-Jul-2001  nathanw file FOURMEG was added on branch nathanw_sa on 2002-01-08 00:24:30 +0000
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.216 04-Jun-2025  tsutsui Use native wskbd keymap on X.Org server for hp300 and luna68k.

Also disable the no-longer-needed WSKBD_COMPAT_RAWKBD option in GENERIC.

It's more straightforward to use the native wskbd keymap provided by
the WSKBDIO_GETMAP ioctl, rather than relying on WSKBD_COMPAT_RAWKBD,
which emulates raw PS/2 "pc105" scancodes assumed by the
xf86-input-keyboard driver if no specific keymap is not found.

Tested on HP9000/382 and LUNA-II.
 1.215 31-May-2025  tsutsui Disable obsolete gendiofb(4) in GENERIC, sti(4) at dio is enough.
 1.214 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.213 07-Dec-2024  tsutsui Specify -fno-unwind-tables to shrink kernel binary size.
 1.212 29-Jan-2024  christos branches: 1.212.2;
PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.211 12-Feb-2023  abs Add optoion GENERIC.local include to the end of ~all GENERIC configs

This excludes atari, sgimips, evbmips, evbppc, evbsh3, and hpcarm
all of which have somewhat specific kernel config file layouts
 1.210 29-Sep-2022  riastradh swwdog(4): Add to GENERIC kernels.

Plus a handful of others that I'm familiar with. Lots of special-
purpose kernels should probably have this too but I'm not going
through all the arm, mips, and ppc evaluation board kernels to see
which ones are relevant.

Omitted from systems I know to be very small:
- sun2/GENERIC
- dreamcast/GENERIC
Feel free to remove it from others that need to be kept smaller.

Compile-tested a few of these just in case:
- alpha/GENERIC
- amd64/GENERIC
- evbmips/OCTEON
- i386/GENERIC
- riscv/GENERIC

PR kern/29702
 1.209 07-Aug-2022  simonb UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.
 1.208 29-May-2021  tsutsui Reorder entries and reorganize comments for maintainability.

No functional change intended.
 1.207 21-Jan-2021  nia branches: 1.207.4; 1.207.6;
add a commented out compat_ossaudio wherever there's compat_linux

requested by mrg
 1.206 27-Sep-2020  roy branches: 1.206.2;
vether: Add to kernel configurations

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.205 10-Aug-2020  rin Add -fno-omit-frame-pointer to m68k kernels with DDB for backtraces.
-omit-frame-pointer is enabled for -O1 and higher for GCC8 by default.
 1.204 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.203 26-Apr-2019  sevan Enable BUFQ_PRIOCSCAN, CARP, Veriexec by default in GENERIC kernel configs.
On ports without a GENERIC kernel config enable in individul files, e.g evbmips.
Omit on:
atari, dreamcast, emips, epoc32, evbppc/VIRTEX*, ia64, luna68x, mvme68k,
mvmeppc, playstation2, riscv, sun2, sun3, x68k, zaurus due to resource
constraints or port infancy.
 1.202 13-Apr-2019  isaki Add drvctl to kernel which has audio device.
audiocfg(1) requires drvctl(4).
 1.201 14-Mar-2019  thorpej G/C "MAPPECOPY". It is the deadest of wood, and never actually worked in
NetBSD.
 1.200 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.199 01-Aug-2018  maxv Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
 1.198 23-Jan-2018  sevan branches: 1.198.2; 1.198.4;
Alternate buffer queue strategies no longer considered experimental, update
description.

Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
 1.197 14-Sep-2017  mrg clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
 1.196 13-Sep-2017  sevan Remove support for VERIFIED_EXEC_FP_RMD160, VERIFIED_EXEC_FP_SHA1, and VERIFIED_EXEC_FP_MD5 options.
These algorithms are either broken or on their way to being broken.

Discussed on tech-security
http://mail-index.netbsd.org/tech-security/2017/08/21/msg000936.html

ok riastradh
 1.195 28-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 1.
 1.194 13-Dec-2016  christos branches: 1.194.8;
wildcard speaker attachments, now that we can handle many of them.
 1.193 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.192 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.191 08-Aug-2015  maxv branches: 1.191.2;
Remove KMEMSTATS.
 1.190 16-Nov-2014  manu branches: 1.190.2;
Remove unused extended attributes kernel options

As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate
 1.189 12-Nov-2014  manu Support for UFS1 extended attributes in GENERIC and GENERIC-like kernels

This change just brings UFS1 extended attribute *support* in the kernel,
extended attributes are not enabled unless three conditions are met:
1) filesystem is UFS1 (newfs -O1)
2) .attribute/system and .attribute/user directories are created at fs root
3) filesystem is mounted with -o extattr

Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
 1.188 24-Aug-2014  tsutsui Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.

The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.

The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
 1.187 24-Aug-2014  jnemeth Create an "options MODULAR_DEFAULT_AUTOLOAD" config option and add
it to all kernel configs that contain "options MODULAR". This
option turns on module autoloading by default (which is the current
default). This allows people who don't want module autoloading on
by default to disable it by simply removing/commentting this line.
 1.186 23-Aug-2014  dholland Systematize (and in many cases, fix) the comments on options COMPAT_NN.

There are quite a few configs that are missing some COMPAT_NN options
in ways that don't make sense; this should probably get cleaned up
too, but for the time being I've not added or removed anything.
 1.185 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.184 18-Jul-2014  tsutsui branches: 1.184.2;
More tweaks to GENERIC.

- reduce maxusers from 32 to 8 as other m68k ports
- make NFS_BOOT_DHCP default rather than NFS_BOOT_BOOTP
(and move these options in "Networking options" block)
- use 8x16 font instead of 12x22 for machines with small screen like HP362
 1.183 18-Jul-2014  tsutsui Shrink GENERIC and enable MODULAR instead.
 1.182 05-Jul-2014  tsutsui Use COPTS="-O2 -fno-reorder-blocks" as defined in sys.mk for userland.

with "-O2":
text data bss dec hex filename
3717740 86092 152864 3956696 3c5fd8 netbsd

with "-O2 -fno-reorder-blocks":
text data bss dec hex filename
3304404 86092 152864 3543360 361140 netbsd
 1.181 19-Apr-2014  tsutsui Add proper RealTime Clock support for HP9000/425e.

As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.

Tested on HP425e (with mcclock) and HP362 (with old rtc).
 1.180 16-Aug-2013  tsutsui branches: 1.180.2;
Make FPU_EMULATE work on NetBSD/hp300. Commented out by default in GENERIC.

Tested on HP9000/362 without optional MC68882 FPU in its socket.
 1.179 30-Jun-2013  rmind G/C PFIL_HOOKS from the kernel configs.
 1.178 05-Jun-2013  christos branches: 1.178.2;
remove obsolete networking options
 1.177 27-Apr-2013  christos the bogus number police
 1.176 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.175 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.174 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.173 11-Jan-2013  tsutsui Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
 1.172 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.171 17-Aug-2012  abs branches: 1.171.2;
Update all kernel configs mentioning WSEMUL_* but not already including
WSDISPLAY_COMPAT_USL using the following rules:
- If WSEMUL_ is commented out, add commented out out WSDISPLAY_COMPAT_USL
- If INSTALL or obviously memory constrained, add WSDISPLAY_DEFAULTSCREENS=1
and commented out WSDISPLAY_COMPAT_USL
- Otherwise add WSDISPLAY_COMPAT_USL

Some of the INSTALL configs for larger memory machines are probably suitable
for adding WSDISPLAY_COMPAT_USL.

Now wsconscfg(8) should be able to switch VTs when expected.

Implemented after no objection from tech-kern to the following:

On 5 June 2012 09:47, David Brownlee <abs@absd.org> wrote:
> wsconscfg(8) requires WSDISPLAY_COMPAT_USL in order to switch virtual
> terminals.
>
> Except when in an exceptionally memory or space constrained
> environment (INSTALL being the obvious case), is there any reason why
> all GENERIC and GENERIC-like kernels which have wscons enabled
> shouldn't also have WSDISPLAY_COMPAT_USL?
 1.170 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.169 18-Dec-2011  dholland branches: 1.169.2; 1.169.6; 1.169.8;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.168 22-Nov-2011  tls branches: 1.168.2;

The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself. Move it to std. This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports. Thanks to Havard Eidnes for
pointing them out.
 1.167 30-Jun-2011  wiz branches: 1.167.2;
dependant -> dependent
 1.166 21-May-2011  tsutsui Add sti at sgc configuration for SGC EVRX framebuffers found on
some later HP4xx models. Untested, and disabled in GENERIC for now.
 1.165 06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.164 12-Feb-2011  tsutsui Pull Apollo Domain keyboard and mouse support from OpenBSD.
Untested (no hardware), but no bad sideeffect on 425t without Domain keyboard.

This is the last portion of "new hp300 kernel features" submitted in
PR port-hp300/3528 back in 1997, and I think finally we can close it.
 1.163 12-Feb-2011  tsutsui Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.
 1.162 12-Feb-2011  tsutsui Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.161 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.160 06-Feb-2011  tsutsui - adjust a comment for frodo (362 doesn't have frodo)
- whitespace nits
 1.159 03-Jan-2011  tsutsui branches: 1.159.2; 1.159.4;
Xref module(7) in comments.
 1.158 23-Nov-2010  hannken Remove unused count from pseudo-device md.
 1.157 16-Oct-2010  tsutsui - add commented out options MODULAR
- comment out historical options COMPAT_44
 1.156 07-Jul-2010  chs enable DDB_HISTORY_SIZE in a few more configs where DDB is enabled.
 1.155 08-May-2010  mrg enable IPFILTER_COMPAT in all kernels that have ipfilter already.
canonicalise several of the ipf option segments in various files
(this mostly means adding commented out IPFILTER_DEFAULT_BLOCK,
or adding commented or uncommented IPFILTER_LOG or IPFILTER_LOOKUP
option statements.)

i built about 20 of these kernels to check, but not all of them.
 1.154 29-Apr-2010  chs enable TMPFS in all GENERICs that have MFS enabled.
 1.153 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.152 08-Feb-2010  joerg branches: 1.152.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
 1.151 05-Dec-2009  pooka branches: 1.151.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.150 12-Jan-2009  tsutsui Add options COMPAT_50.
 1.149 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.148 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.147 10-Aug-2008  tls branches: 1.147.2;
Add accept filters to GENERIC kernels where they exist.
 1.146 31-Jul-2008  simonb Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.145 31-Dec-2007  ad branches: 1.145.6; 1.145.10; 1.145.12; 1.145.16;
Remove systrace. Ok core@.
 1.144 31-Dec-2007  ad Remove COMPAT_HPUX.
 1.143 04-Nov-2007  xtraeme branches: 1.143.2; 1.143.8;
Remove System V semaphores and share memory options to set the limits:
SEMMNI, SEMMNS, SEMUME and SHMMAXPGS.

They can be tweaked via sysctl now. Ports that were setting values on
them weren't touched, I only removed the ones that were commented out.
 1.142 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.141 06-Aug-2007  adrianp branches: 1.141.2; 1.141.6;
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.140 25-Jun-2007  tsutsui branches: 1.140.2; 1.140.4; 1.140.8;
Add options COMPAT_40.
 1.139 04-Jun-2007  martin Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.138 11-Nov-2006  jmmv branches: 1.138.2; 1.138.8; 1.138.10; 1.138.16; 1.138.18;
Remove tmpfs's experimental status. OK'ed by core@.
 1.137 26-Aug-2006  christos branches: 1.137.2; 1.137.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.136 26-Aug-2006  tsutsui options<space><tab>
 1.135 26-Aug-2006  tsutsui Remove netns and netccitt options.
 1.134 26-Aug-2006  tsutsui Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.133 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.132 20-Jul-2006  tsutsui branches: 1.132.2;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.131 28-Jun-2006  liamjfoy Add CARP to GENERIC kernel configs. CARP is not enabled by default.

ok: christos
 1.130 28-Mar-2006  pavel branches: 1.130.4;
Add stf to all kernel configs which have INET6 and gif, except the INSTALL
ones and those for specific machines of developers. PR 32304.

OK'ed by rpaulo.

N.B. stf is a cloning device, so it still must be enabled by
"ifconfig stf0 create".
 1.129 05-Feb-2006  cube branches: 1.129.2; 1.129.4; 1.129.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.128 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.127 02-Feb-2006  reinoud branches: 1.127.2;
Add commented out UDF file-system entry in all GENERIC configurations.
 1.126 09-Dec-2005  elad branches: 1.126.2; 1.126.4;
Add (commented out) Veriexec options and pseudo-device to GENERIC kernels,
and remove the i386 GENERIC_VERIEXEC config.
 1.125 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.124 03-Nov-2005  chs turn off DEBUG and DIAGNOSTIC in GENERIC kernels so that they
are compatible with the LKMs that are part of the release.
 1.123 10-Sep-2005  jmmv Initial addition of tmpfs, an efficient memory file-system. This project
was developed as part of Google's Summer of Code 2005 program. This
change adds the kernel code, the mount_tmpfs utility, a regression test
suite and does all other related changes to integrate these.

The file-system is still *experimental*. Therefore, it is disabled by
default in all kernels. However, as typically done, a commented-out
entry is added in them to ease its setup.

Note that I haven't commited the required mountd(8) changes to be able
to export tmpfs file-systems because NFS support is still very unstable
and because, before enabling it, I'd like to do some other changes.

OK'ed by my project mentor, William Studenmund (wrstuden@).
 1.122 20-Aug-2005  tsutsui options<space><tab>
 1.121 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.120 19-Aug-2005  christos 64 bit inode changes.
 1.119 31-Jul-2005  yamt revert "defflag VMSWAP" changes for now.
there seems to be far more people who don't want to edit
their kernel config files than i thought.
 1.118 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.117 17-Jul-2005  hubertf Add support for reading cloop2 compressed filesystem image,
enable by putting VND_COMPRESSION into kernel config file.
Written by Cliff Wright, polished up slightly by me.
 1.116 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.115 25-Jun-2005  rpaulo branches: 1.115.2;
Add file-system PTYFS (commented out) so that people know its existence.

Ok'ed by Christos Zoulas and Hubert Feyrer.
 1.114 09-Jun-2005  tsutsui - Rename options NEW_BUFQ_STRATEGY -> options BUFQ_READPRIO.
(still commented out)
- Add (also commented out) options BUFQ_PRIOCSCAN.

Suggested by perry and soda on tech-kern.
Please refer options(4) for details for these options.
 1.113 18-Feb-2005  dsl branches: 1.113.4;
Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.112 11-Feb-2005  dsl Add 'option FFS_SNAPSHOT' to most of the config files.
Commented out for kernels that appear to hace space constraints.
 1.111 31-Jan-2005  hannken Add file system snapshots to kernel configs.

- Ffs internal snapshots get compiled in unconditionally.

- File system snapshot device fss(4) added to all kernel configs that
have a disk. Device is commented out on all non-GENERIC kernels.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
 1.110 28-Jan-2005  rumble Sprinkle options UFS_DIRHASH on GENERIC kernels. It's presently
commented out and labeled experimental pending further review and
testing.
 1.109 17-Jan-2005  cube branches: 1.109.2;
Add tap(4) support to a random^Wcarefully chosen set of kernel configs.
All those kernels have a line for both tun and bridge, and if either is
commented out, tap is commented out also. With the exception of i386's
GENERIC_TINY.

XXX: we _need_ some way of making this more simple.
 1.108 05-Jan-2005  tsutsui branches: 1.108.2;
options<space><tab>
 1.107 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.106 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.105 28-Aug-2004  thorpej Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
 1.104 18-Jul-2004  tsutsui Add options COMPAT_20.
 1.103 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.102 28-Jun-2004  bouyer Add options P1003_1B_SEMAPHORE
to all GENERIC-like kernel config files where SYSV* options were already
present (commented out if the SYSV* options are commented out).
Fix lib/25897 and lib/25898.
 1.101 26-Jun-2004  abs Add (commented out) ALTQ options to all GENERIC-like files
 1.100 22-Jun-2004  itojun have pf and pflog pseudo-device (commented out).
reviewed by matt, perry, christos
 1.99 18-Jun-2004  christos ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM
 1.98 16-Jun-2004  christos Add pseudo-device ptm on all the generic flavored kernels.
 1.97 22-Nov-2003  tsutsui branches: 1.97.2;
Add an entry of "com0 at dio0 scode 9" so that /dev/ttyC0 and
compat symlink (/dev/tty0) are always reserved for DCA serial.
 1.96 08-Nov-2003  tsutsui Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.95 22-Sep-2003  cl add COMPAT_15/COMPAT_16
 1.94 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.93 24-May-2003  gmcgarry branches: 1.93.2;
Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.92 26-Apr-2003  ragge Add pseudo-device ksyms.
 1.91 10-Apr-2003  christos Bye Bye UCONSOLE
 1.90 27-Feb-2003  perseant Make BRIDGE_IPF an option, and document it. Add it (commented) to GENERIC.
Let brconfig tell whether the bridge is using the ipfilter hook, or not.
 1.89 22-Dec-2002  gmcgarry Make the DMA controller a separate device attached to intio. Intio
devices can use the DMA controller too.
 1.88 22-Nov-2002  wiz Fix typo (responsiness -> responsiveness).
 1.87 18-Oct-2002  junyoung Add NEW_BUFQ_STRATEGY (disabled by default).
 1.86 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.85 06-Oct-2002  provos add SYSTRACE; approved perry.
 1.84 25-Sep-2002  martti Add one space between "#option" and "<tab>IPFILTER_DEFAULT_BLOCK"
 1.83 20-Sep-2002  martti Added (commented out) IPFILTER_DEFAULT_BLOCK.
 1.82 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.81 17-Jun-2002  lukem Enable "pseudo-device clockctl" in all kernels, except
installation related kernels (INSTALL* and RAMDISK*).
This enables rc.conf(5) $ntpd_chroot to be used "out of the box"
 1.80 07-May-2002  gmcgarry branches: 1.80.2; 1.80.4;
Make more featureful.
 1.79 25-Apr-2002  atatat Add the INCLUDE_CONFIG_FILE option to all config files. In config
files that are generic (ie, GENERIC, GENERICSBC, GENERIC32, ALL, or
ALPHA), it is uncommented.
 1.78 12-Apr-2002  gmcgarry Add commented-out USERCONF option. Mainly useful for install media
and can be optionally enabled based on miniroot and ramdisk size
requirements.
 1.77 23-Feb-2002  gmcgarry Cleanup options for binary compatibility. HPUX and SUNOS are known to work.
 1.76 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.75 19-Jan-2002  oster Add new RF_* options for RAIDframe bits that are no longer built by default.

While we're here, enable RAIDframe (and RAID_AUTOCONFIG) by default for
architectures that I'm comfortable can deal with it being on by default.

Also: bump the number of 'raid' devices from 4 to 8, since 4 seems to
be insufficient in practise.
 1.74 28-Dec-2001  martin Add PPPoE to all generic kernels that should be able to use it.
XXX TODO: do this for INSTALL kernels too, add sysinst support and make the
XXX needed binaries available on the ramdisk root fs.
 1.73 14-Dec-2001  gmcgarry Use bootp, to match the recent change to the bootblocks.
 1.72 14-Dec-2001  gmcgarry Add a blurb to the top of all GENERIC files. This serves three purposes:
- to clarify some terminology
- to clarify the intention of the GENERIC file
- to cross-reference some useful man pages
 1.71 23-Nov-2001  atatat The bridge(4) pseudo-device no longer requires the port to
__HAVE_GENERIC_SOFT_INTERRUPTS, so add it back to all GENERIC configs.
 1.70 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.69 17-Nov-2001  gmcgarry Update for new RTC and HIL attachments.
 1.68 01-Sep-2001  atatat branches: 1.68.6;
Comment out bridge pseudo devices from ports that don't
__HAVE_GENERIC_SOFT_INTERRUPTS. bridge(4) doesn't compile there.
 1.67 01-Sep-2001  atatat Add bridge pseudo devices to GENERIC configs
 1.66 08-Jul-2001  abs branches: 1.66.2;
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.65 30-Jun-2001  darcy Add System V semaphore resource limits to each GENERIC file that has an
option for System V semaphores. It appears that there are no overrides
in the code and each file has the following added.

options SYSVSEM # System V semaphores
+#options SEMMNI=10 # number of semaphore identifiers
+#options SEMMNS=60 # number of semaphores in system
+#options SEMUME=10 # max number of undo entries per process
+#options SEMMNU=30 # number of undo structures in system
options SYSVSHM # System V shared memory

If anyone thinks that this is incorrect for any of these files, please
correct it.

Note - the i386 port was not forgotten. It was done separately.
 1.64 02-Jan-2001  simonb Add ELF support.

Thanks to Steve Woodford for his help!
 1.63 19-Dec-2000  tsutsui Remove "rnd is EXPERIMENTAL" comments.
 1.62 19-Dec-2000  bouyer Add pseudo-device vlan
 1.61 04-Oct-2000  itojun enable rnd device. they are now mandatory for ssh/sshd support,
so it makes more sense to enable it.
please disable them if there's any issues, but in that case, in-tree
ssh/sshd won't work.
 1.60 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.59 13-Aug-2000  itojun move "options PULLDOWN_TEST" into sys/sys/mbuf.h (in #ifdef _KERNEL),
as it is no wthe default setting for everyone.

the reason we still use the name "PULLDOWN_TEST" while it is now default:
kame code sharing.
 1.58 27-Jul-2000  mason Moving to a default of 64 PTYs.
 1.57 30-Jun-2000  itojun add PULLDOWN_TEST for all the platforms.
XXX should be moved to somewhere else when stabilized
 1.56 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.55 14-Jun-2000  veego branches: 1.55.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.54 19-Apr-2000  itojun branches: 1.54.2;
add stf pseudo interface (commented out due to possible security risks)
 1.53 29-Feb-2000  simonb Do the "<space><tab>" thing with the RAID_AUTOCONFIG option.
 1.52 26-Feb-2000  oster Defopt 'RAID_AUTOCONFIG'. Adding 'options RAID_AUTOCONFIG' turns on
the component auto-detection and auto-configuration of RAID sets.
Also, add "#options RAID_AUTOCONFIG" to the GENERIC config files.
 1.51 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.50 23-Jan-2000  hubertf Add commented out "ident"-command
 1.49 21-Nov-1999  itojun bring in content of GENERIC.v6 into GENERIC.
remove GENERIC.v6 file (as it is part of GENERIC now).

"faith" interface is commented out by default as it is not really for
general use.
IPsec items are commented out as well, though we can enable "options IPSEC"
without export-related issue ("options IPSEC" will enable authentication
portion only). We may need to think about it again.

if you have problem compiling with INET6 on archs I do not have access to,
please contact me.

XXX what to do with arch/arm32/SHARK{,.v6}?
 1.48 15-Nov-1999  fvdl Add commented out option SOFTDEP to all GENERIC kernels.
 1.47 31-Jul-1999  thorpej branches: 1.47.2; 1.47.8;
Add HP385.
 1.46 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.45 20-Jul-1999  christos enable PPP_BSDCOMP, PPP_DEFLATE, PPP_FILTER, PFIL_HOOKS, IPFILTER_LOG
on the GENERIC kernels that had them commented out.
XXX: Please note, that not all the kernels have all the options defined!
 1.44 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.43 15-Dec-1998  itohy branches: 1.43.2; 1.43.4;
Added options COMPAT_LINUX and EXEC_ELF32 as comments
to GENERIC configuration files.
 1.42 25-Nov-1998  hwr Add (commented out) 'gre' pseudo device line. Feedback is welcome.
Inspired by Klaus Klein.
 1.41 16-Nov-1998  oster Added a (commented out) configuration line for the RAIDframe device driver.
 1.40 28-Aug-1998  thorpej Use NFS_BOOT_BOOTPARAMS until we change the boot program to use DHCP
 1.39 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.38 18-Mar-1998  bouyer Add commented out "options FFS_EI"
 1.37 01-Dec-1997  kleink Add COMPAT_13.
 1.36 20-Nov-1997  fair add pseudo-device rnd, commented out
 1.35 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.34 23-Aug-1997  mjacob branches: 1.34.4;
add a before tab to SCSIVERBOSE
 1.33 20-Aug-1997  mjacob add commented out reference SCSIVERBOSE option
 1.32 12-May-1997  thorpej branches: 1.32.4;
Add the following drivers:
- frodo at intio
- dnkbd at frodo (commented out until integrated)
- apci at frodo
 1.31 07-May-1997  lukem whitespacos i missed
 1.30 07-May-1997  lukem cleanup unecessary quotage of options
 1.29 06-May-1997  lukem be consistent with use of spaces and tabs.
don't need quotes around options with _'s in the name
 1.28 27-Apr-1997  thorpej Update for new SPU options.
 1.27 31-Mar-1997  thorpej Build these kernels with full debugging symbols.
 1.26 18-Feb-1997  mrg comment PFIL_HOOKS as it is redundant (as an option) when used with ipfilter. minor format
 1.25 02-Feb-1997  thorpej branches: 1.25.4;
Add "options LKM", suggested by Klaus Klein <kleink@layla.inka.de>.
 1.24 02-Feb-1997  thorpej Oops, need PFIL_HOOKS.
 1.23 31-Jan-1997  thorpej Gah, missed another NFSCLIENT -> NFS.
 1.22 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.21 30-Jan-1997  scottr Add DIOVERBOSE per Jason; clean up formatting for some options.
 1.20 30-Jan-1997  thorpej Update for new-style config.
 1.19 20-Jan-1997  scottr Remove obsolete timezone specification
 1.18 07-Jan-1997  mrg branches: 1.18.2;
use pseudo-device ipfilter, not ipl.
 1.17 06-Jan-1997  thorpej Add PFIL_HOOKS and ipl pseudo-device.
 1.16 11-Dec-1996  thorpej Fix typo in comment.
 1.15 09-Dec-1996  thorpej Add EXEC_SCRIPT (I don't even want to know how I forgot it before...)
 1.14 15-Oct-1996  thorpej Don't need "options GENERIC" anymore.
 1.13 03-Oct-1996  thorpej Add EXEC_AOUT to all kernels.
 1.12 10-Sep-1996  thorpej Document COMPAT_M68K4K, but leave it disabled by default.
 1.11 25-Aug-1996  thorpej Add the United Kingdom and Swedish HIL keyboard maps to the kernels
used in the binary snapshots.
 1.10 22-Aug-1996  thorpej Add COMPAT_12 to all kernels, and COMPAT_11 to a few as well.
 1.9 24-Feb-1996  thorpej branches: 1.9.4;
Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.8 29-Dec-1995  thorpej Enable COMPAT_HPUX by default. It's still not 100% yet, but it doesn't
seem to really hurt anything, either. Makes it easier for folks using
binary snapshots only to try it out.

GENERIC: now that the PT map allocation is fixed, increase the default
maxusers to 32.
 1.7 28-Nov-1995  thorpej Note the new status of COMPAT_HPUX, but keep is disabled by default.
 1.6 10-Oct-1995  thorpej Add another dca and grf
 1.5 02-Oct-1995  thorpej Add mt0.
 1.4 21-Sep-1995  thorpej Add 4 vnds to each, add 4 ccds to GENERIC, update BASALT to match
current reality.
 1.3 18-Aug-1995  thorpej Bring this up to speed.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 18-Jul-1994  mycroft branches: 1.1.2;
Add some missing options to GENERIC, and rename.
 1.1.2.2 18-Jul-1994  mycroft Add some missing options to GENERIC, and rename.
 1.1.2.1 18-Jul-1994  mycroft file GENERIC was added on branch netbsd-1-0 on 1994-07-18 07:15:46 +0000
 1.9.4.2 25-Aug-1996  thorpej Add COMPAT_11 to the kernels used in the binary snapshots.
 1.9.4.1 25-Aug-1996  thorpej Pull up from trunk:

Add the United Kingdom and Swedish HIL keyboard maps to the kernels
used in the binary snapshots.
 1.18.2.1 30-Jan-1997  thorpej update from trunk
 1.25.4.1 11-Mar-1997  is merge in changes from Trunk.
 1.32.4.2 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.32.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.34.4.1 20-Nov-1997  mellon Pull rev 1.36 up from trunk (fair)
 1.43.4.2 02-Aug-1999  thorpej Update from trunk.
 1.43.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.43.2.1 03-Jun-2000  he Apply patch (requested by he):
Disable the UNION file system, to avoid a repeat of the 1.4.1
and 1.4.2 LAST_MINUTE changes. It is reportedly buggy, and can
be used by ordinary users to crash the system.
 1.47.8.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.47.8.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.47.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.47.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.54.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.55.2.4 01-May-2001  he Pull up revisions 1.62-1.63 (requested by he):
Add pseudo-device vlan.
Make sure "rnd is EXPERIMENTAL" comment is removed.
 1.55.2.3 04-Oct-2000  itojun pullup (approved by releng-1-5)

enable rnd device. they are now mandatory for ssh/sshd support,
so it makes more sense to enable it.
please disable them if there's any issues, but in that case, in-tree
ssh/sshd won't work.

cvs rdiff -r1.166 -r1.167 syssrc/sys/arch/alpha/conf/GENERIC
cvs rdiff -r1.149 -r1.150 syssrc/sys/arch/amiga/conf/GENERIC
cvs rdiff -r1.11 -r1.12 syssrc/sys/arch/arm26/conf/GENERIC
cvs rdiff -r1.72 -r1.73 syssrc/sys/arch/atari/conf/GENERIC
cvs rdiff -r1.60 -r1.61 syssrc/sys/arch/hp300/conf/GENERIC
cvs rdiff -r1.10 -r1.11 syssrc/sys/arch/luna68k/conf/GENERIC
cvs rdiff -r1.35 -r1.36 syssrc/sys/arch/next68k/conf/GENERIC
cvs rdiff -r1.32 -r1.33 syssrc/sys/arch/ofppc/conf/GENERIC
cvs rdiff -r1.73 -r1.74 syssrc/sys/arch/sun3/conf/GENERIC
cvs rdiff -r1.80 -r1.81 syssrc/sys/arch/vax/conf/GENERIC
cvs rdiff -r1.52 -r1.53 syssrc/sys/arch/x68k/conf/GENERIC
 1.55.2.2 11-Aug-2000  mason Move to default of 64 PTYs in GENERIC kernel config.
Requested by mason, approved by jhawk.
 1.55.2.1 23-Jun-2000  fvdl As on the trunk, update these for the move of ffs_softdep.c into the
kernel source itself. Remove prefix construction, and add the SOFTDEP
option to GENERIC kernels.
 1.66.2.7 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.66.2.6 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.66.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.66.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.66.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.66.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.66.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.68.6.9 29-Dec-2002  thorpej Sync with HEAD.
 1.68.6.8 11-Dec-2002  thorpej Sync with HEAD.
 1.68.6.7 11-Nov-2002  nathanw Catch up to -current
 1.68.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.68.6.5 20-Jun-2002  nathanw Catch up to -current.
 1.68.6.4 17-Apr-2002  nathanw Catch up to -current.
 1.68.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.68.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.68.6.1 01-Sep-2001  nathanw file GENERIC was added on branch nathanw_sa on 2002-01-08 00:24:30 +0000
 1.80.4.2 24-Oct-2002  lukem Pull up upgrade to IPfilter 3.4.29 (requested by martti in ticket #905).
Affected files & revisions:

dist/ipf/HISTORY 1.14
dist/ipf/fils.c 1.17-1.21
dist/ipf/ipf.c 1.11-1.13
dist/ipf/ipfs.c 1.8-1.10
dist/ipf/ipft_ef.c 1.6-1.7
dist/ipf/ipft_td.c 1.6-1.7
dist/ipf/ipft_tx.c 1.7-1.8
dist/ipf/ipmon.c 1.12-1.17
dist/ipf/ipnat.c 1.11-1.12
dist/ipf/ipsend/ip_var.h 1.2
dist/ipf/ipsend/ipsend.c 1.8
dist/ipf/ipsend/iptests.c 1.5
dist/ipf/ipt.c 1.8-1.10
dist/ipf/kmem.c 1.8-1.10
dist/ipf/man/ipf.4 1.10
dist/ipf/man/ipf.5 1.8
dist/ipf/man/ipftest.1 1.3
dist/ipf/man/ipmon.8 1.10
dist/ipf/man/ipnat.5 1.9-1.10
dist/ipf/man/ipnat.8 1.4
dist/ipf/misc.c 1.7
dist/ipf/natparse.c 1.10
dist/ipf/parse.c 1.13
dist/ipf/printnat.c 1.8-1.10
dist/ipf/relay.c 1.5-1.6
dist/ipf/rules/example.9 1.2
etc/rc.d/ipnat 1.8
regress/sys/kern/ipf/Makefile 1.3-1.4
regress/sys/kern/ipf/dotest6 1.2
regress/sys/kern/ipf/expected/f13 1.1.1.2
regress/sys/kern/ipf/expected/i12 1.1.1.1
regress/sys/kern/ipf/expected/ni3 1.1.1.1
regress/sys/kern/ipf/expected/ni5 1.2
regress/sys/kern/ipf/input/f13 1.1.1.2
regress/sys/kern/ipf/input/ipv6.1 1.1.1.1
regress/sys/kern/ipf/input/ni3 1.1.1.1
regress/sys/kern/ipf/regress/i12 1.1.1.1
regress/sys/kern/ipf/regress/ipv6.1 1.1.1.1
regress/sys/kern/ipf/regress/ni3.ipf 1.1.1.1
regress/sys/kern/ipf/regress/ni3.nat 1.1.1.1
sys/arch/alpha/conf/ALPHA 1.169,1.171
sys/arch/amiga/conf/GENERIC 1.185-1.186
sys/arch/arc/conf/GENERIC 1.71-1.72
sys/arch/atari/conf/GENERIC.in 1.24-1.25
sys/arch/cats/conf/GENERIC 1.31-1.32
sys/arch/cobalt/conf/GENERIC 1.34-1.35
sys/arch/hp300/conf/GENERIC 1.83-1.84
sys/arch/i386/conf/CARDBUS 1.66-1.67
sys/arch/i386/conf/GENERIC 1.510,1.512
sys/arch/i386/conf/GENERIC_LAPTOP 1.58-1.59
sys/arch/i386/conf/GENERIC_PS2TINY 1.19-1.20
sys/arch/i386/conf/GENERIC_TINY 1.47-1.48
sys/arch/luna68k/conf/GENERIC 1.33-1.33
sys/arch/mac68k/conf/GENERIC 1.130-1.131
sys/arch/mac68k/conf/GENERICSBC 1.21-1.22
sys/arch/mac68k/conf/SMALLRAM 1.4-1.5
sys/arch/macppc/conf/GENERIC 1.142-1.143
sys/arch/mipsco/conf/GENERIC 1.21-1.22
sys/arch/mmeye/conf/GENERIC 1.44-1.45
sys/arch/news68k/conf/GENERIC 1.36-1.37
sys/arch/news68k/conf/GENERIC_TINY 1.18-1.19
sys/arch/newsmips/conf/GENERIC 1.50-1.51
sys/arch/ofppc/conf/GENERIC 1.56-1.57
sys/arch/pmax/conf/GENERIC 1.103-1.104
sys/arch/prep/conf/GENERIC 1.55-1.56
sys/arch/sbmips/conf/GENERIC 1.11-1.12
sys/arch/sgimips/conf/GENERIC 1.7-1.8
sys/arch/sparc/conf/GENERIC 1.138-1.139
sys/arch/sparc64/conf/GENERIC32 1.46-1.47
sys/arch/vax/conf/GENERIC 1.102-1.103
sys/arch/x68k/conf/ALL 1.55-1.56
sys/arch/x68k/conf/GENERIC 1.80-1.81
sys/lkm/netinet/if_ipl/mln_ipl.c 1.29
sys/netinet/fil.c 1.57-1.58
sys/netinet/ip_auth.c 1.29-1.30
sys/netinet/ip_compat.h 1.30-1.31
sys/netinet/ip_fil.c 1.81-1.86
sys/netinet/ip_fil.h 1.46-1.49
sys/netinet/ip_frag.c 1.33-1.34
sys/netinet/ip_frag.h 1.18
sys/netinet/ip_ftp_pxy.c 1.25-1.26
sys/netinet/ip_h323_pxy.c 1.5-1.6
sys/netinet/ip_log.c 1.22-1.23
sys/netinet/ip_nat.c 1.51-1.53
sys/netinet/ip_nat.h 1.27
sys/netinet/ip_netbios_pxy.c 1.4
sys/netinet/ip_proxy.c 1.35-1.36
sys/netinet/ip_proxy.h 1.18
sys/netinet/ip_state.c 1.41-1.42
sys/netinet/ip_state.h 1.23
sys/netinet/ipl.h 1.14
 1.80.4.1 01-Aug-2002  lukem Pull up revision 1.81 (requested by lukem in ticket #312):
Enable "pseudo-device clockctl" in all kernels, except
installation related kernels (INSTALL* and RAMDISK*).
This enables rc.conf(5) $ntpd_chroot to be used "out of the box"
 1.80.2.1 14-Jul-2002  gehenna catch up with -current.
 1.93.2.12 11-Dec-2005  christos Sync with head.
 1.93.2.11 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.93.2.10 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.93.2.9 15-Feb-2005  skrll Sync with HEAD.
 1.93.2.8 04-Feb-2005  skrll Sync with HEAD.
 1.93.2.7 24-Jan-2005  skrll Sync with HEAD.
 1.93.2.6 17-Jan-2005  skrll Sync with HEAD.
 1.93.2.5 14-Nov-2004  skrll Sync with HEAD.
 1.93.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.93.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.93.2.2 03-Sep-2004  skrll Sync with HEAD
 1.93.2.1 03-Aug-2004  skrll Sync with HEAD
 1.97.2.4 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.97.2.3 15-Jul-2004  he branches: 1.97.2.3.2; 1.97.2.3.4;
Pull up revision 1.103 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.97.2.2 02-Jul-2004  he Pull up revision 1.102 (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.97.2.1 30-Jun-2004  jdc Pull up revision 1.101 (requested by abs in ticket #567).

Add (commented out) ALTQ options to all GENERIC-like files
 1.97.2.3.4.1 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.97.2.3.2.1 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.108.2.1 29-Apr-2005  kent sync with -current
 1.109.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.109.2.1 12-Feb-2005  yamt sync with head.
 1.113.4.4 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net&#64;
Ok'ed by core&#64;
 1.113.4.3 05-Nov-2005  tron branches: 1.113.4.3.2; 1.113.4.3.4;
Pull up following revision(s) (requested by chs in ticket #929):
sys/arch/hp300/conf/GENERIC: revision 1.124
sys/arch/acorn32/conf/GENERIC: revision 1.62
sys/arch/pdp10/conf/GENERIC: revision 1.19
sys/arch/mvme68k/conf/GENERIC: revision 1.61
sys/arch/netwinder/conf/GENERIC: revision 1.70
sys/arch/sbmips/conf/GENERIC: revision 1.46
sys/arch/macppc/conf/GENERIC: revision 1.214
sys/arch/bebox/conf/GENERIC: revision 1.89
sys/arch/cobalt/conf/GENERIC: revision 1.83
sys/arch/cats/conf/GENERIC: revision 1.92
sys/arch/shark/conf/GENERIC: revision 1.53
sys/arch/amiga/conf/GENERIC.in: revision 1.45
sys/arch/acorn26/conf/GENERIC: revision 1.37
sys/arch/cesfic/conf/GENERIC: revision 1.38
sys/arch/iyonix/conf/GENERIC: revision 1.21
sys/arch/alpha/conf/GENERIC: revision 1.277
sys/arch/vax/conf/GENERIC: revision 1.143
sys/arch/atari/conf/GENERIC.in: revision 1.56
sys/arch/mipsco/conf/GENERIC: revision 1.53
sys/arch/ofppc/conf/GENERIC: revision 1.85
sys/arch/next68k/conf/GENERIC: revision 1.96
sys/arch/arc/conf/GENERIC: revision 1.125
sys/arch/dreamcast/conf/GENERIC: revision 1.62
turn off DEBUG and DIAGNOSTIC in GENERIC kernels so that they
are compatible with the LKMs that are part of the release.
 1.113.4.2 14-Aug-2005  riz Pull up revision 1.117 (requested by hubertf in ticket #625):
Add support for reading cloop2 compressed filesystem images,
enable by putting VND_COMPRESSION into kernel config file.
Written by Cliff Wright, polished up slightly by me.
 1.113.4.1 18-Jul-2005  riz Pull up revision 1.116 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.113.4.3.4.1 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.113.4.3.2.1 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.115.2.5 21-Jan-2008  yamt sync with head
 1.115.2.4 15-Nov-2007  yamt sync with head.
 1.115.2.3 03-Sep-2007  yamt sync with head.
 1.115.2.2 30-Dec-2006  yamt sync with head.
 1.115.2.1 21-Jun-2006  yamt sync with head.
 1.126.4.1 09-Sep-2006  rpaulo sync with head
 1.126.2.1 18-Feb-2006  yamt sync with head.
 1.127.2.1 22-Apr-2006  simonb Sync with head.
 1.129.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.129.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.129.2.3 03-Sep-2006  yamt sync with head.
 1.129.2.2 11-Aug-2006  yamt sync with head
 1.129.2.1 01-Apr-2006  yamt sync with head.
 1.130.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.132.2.2 22-Sep-2006  riz Pull up following revision(s) (requested by tsutsui in ticket #170):
sys/arch/sparc64/conf/GENERIC: revision 1.63
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.55
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.54
sys/arch/next68k/conf/GENERIC: revision 1.105
sys/arch/ews4800mips/conf/GENERIC: revision 1.12
sys/arch/arc/conf/GENERIC: revision 1.142
sys/arch/sun3/conf/GENERIC3X: revision 1.91
sys/arch/amd64/conf/GENERIC: revision 1.105
sys/arch/sun2/conf/GENERIC: revision 1.58
sys/arch/amiga/conf/GENERIC.in: revision 1.55
sys/arch/mac68k/conf/GENERIC: revision 1.175
sys/arch/acorn26/conf/GENERIC: revision 1.46
sys/arch/shark/conf/GENERIC: revision 1.65
sys/arch/cesfic/conf/GENERIC: revision 1.45
sys/arch/sandpoint/conf/GENERIC: revision 1.36
sys/arch/iyonix/conf/GENERIC: revision 1.32
sys/arch/mvme68k/conf/GENERIC: revision 1.69
sys/arch/evbarm/conf/ARMADILLO210: revision 1.3
sys/arch/vax/conf/GENERIC: revision 1.154
sys/arch/mipsco/conf/GENERIC: revision 1.61
sys/arch/evbarm/conf/ARMADILLO9: revision 1.14
sys/arch/cobalt/conf/GENERIC: revision 1.103
sys/arch/ofppc/conf/GENERIC: revision 1.94
sys/arch/hp700/conf/GENERIC: revision 1.69
sys/arch/playstation2/conf/GENERIC: revision 1.8
sys/arch/dreamcast/conf/GENERIC: revision 1.73
sys/arch/news68k/conf/GENERIC: revision 1.81
sys/arch/macppc/conf/GENERIC: revision 1.234
sys/arch/hp300/conf/GENERIC: revision 1.134
sys/arch/mmeye/conf/GENERIC: revision 1.83
sys/arch/ibmnws/conf/GENERIC: revision 1.26
sys/arch/cats/conf/GENERIC: revision 1.109
sys/arch/sparc/conf/GENERIC: revision 1.191
sys/arch/pdp10/conf/GENERIC: revision 1.27
sys/arch/acorn32/conf/GENERIC: revision 1.75
sys/arch/luna68k/conf/GENERIC: revision 1.74
sys/arch/bebox/conf/GENERIC: revision 1.101
sys/arch/pmax/conf/GENERIC: revision 1.148
sys/arch/x68k/conf/GENERIC: revision 1.130
sys/arch/sun3/conf/GENERIC: revision 1.134
sys/arch/prep/conf/GENERIC: revision 1.126
sys/arch/alpha/conf/GENERIC: revision 1.293
sys/arch/newsmips/conf/GENERIC: revision 1.94
sys/arch/netwinder/conf/GENERIC: revision 1.83
sys/arch/hpcsh/conf/GENERIC: revision 1.69
sys/arch/sbmips/conf/GENERIC: revision 1.55
sys/arch/pc532/conf/GENERIC: revision 1.65
sys/arch/hpcmips/conf/GENERIC: revision 1.192
Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.132.2.1 14-Aug-2006  tron Pull up following revision(s) (requested by elad in ticket #17):
sys/arch/sparc/conf/KRUPS: revision 1.38
sys/arch/i386/conf/XEN2_DOMU: revision 1.2
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.197
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.53
sys/arch/evbsh5/conf/SIMULATOR: revision 1.12
sys/arch/sparc/conf/MRCOFFEE: revision 1.17
sys/arch/next68k/conf/GENERIC: revision 1.104
sys/arch/i386/conf/VIRTUALPC: revision 1.44
sys/arch/ews4800mips/conf/GENERIC: revision 1.11
sys/arch/evbsh5/conf/CAYMAN: revision 1.23
sys/arch/arc/conf/GENERIC: revision 1.141
sys/arch/amd64/conf/GENERIC: revision 1.103
sys/arch/sun3/conf/GENERIC3X: revision 1.90
sys/arch/evbarm/conf/HDL_G: revision 1.3
sys/arch/sun2/conf/GENERIC: revision 1.57
sys/arch/news68k/conf/GENERIC_TINY: revision 1.51
sys/arch/evbppc/conf/EXPLORA451: revision 1.27
sys/arch/amiga/conf/GENERIC.in: revision 1.54
sys/arch/mac68k/conf/GENERIC: revision 1.174
sys/arch/acorn26/conf/GENERIC: revision 1.45
sys/arch/shark/conf/GENERIC: revision 1.64
sys/arch/cesfic/conf/GENERIC: revision 1.44
sys/arch/mvme68k/conf/GENERIC: revision 1.68
sys/arch/i386/conf/XEN2_DOM0: revision 1.4
sys/arch/atari/conf/GENERIC.in: revision 1.63
sys/arch/amiga/conf/GENERIC: revision 1.240
sys/arch/i386/conf/LAMB: revision 1.65
sys/arch/i386/conf/GENERIC: revision 1.773
sys/arch/acorn32/conf/EB7500ATX: revision 1.26
sys/arch/x68k/conf/GENERIC: revision 1.128
sys/arch/vax/conf/GENERIC: revision 1.153
sys/arch/atari/conf/ATARITT: revision 1.81
sys/arch/mipsco/conf/GENERIC: revision 1.60
sys/arch/cobalt/conf/GENERIC: revision 1.101
sys/arch/evbarm/conf/ARMADILLO9: revision 1.13
sys/arch/ofppc/conf/GENERIC: revision 1.93
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.51
sys/arch/arc/conf/RPC44: revision 1.26
sys/arch/sparc64/conf/GENERIC: revision 1.59
sys/arch/i386/conf/XEN3_DOMU: revision 1.2
sys/arch/hp700/conf/GENERIC: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.47
sys/arch/macppc/conf/GENERIC: revision 1.231
sys/arch/dreamcast/conf/GENERIC: revision 1.72
sys/arch/news68k/conf/GENERIC: revision 1.80
sys/arch/hp300/conf/GENERIC: revision 1.133
sys/arch/mmeye/conf/GENERIC: revision 1.82
sys/arch/macppc/conf/MAMBO: revision 1.2
sys/arch/cats/conf/GENERIC: revision 1.107
sys/arch/atari/conf/FALCON: revision 1.79
sys/arch/acorn32/conf/GENERIC: revision 1.71
sys/arch/sparc/conf/GENERIC: revision 1.190
sys/arch/news68k/conf/LIBERO: revision 1.40
sys/arch/amiga/conf/DRACO: revision 1.114
sys/arch/cobalt/conf/INSTALL: revision 1.23
sys/arch/luna68k/conf/GENERIC: revision 1.73
sys/arch/bebox/conf/GENERIC: revision 1.100
sys/arch/pmax/conf/GENERIC: revision 1.147
sys/arch/amiga/conf/WSCONS: revision 1.52
sys/arch/macppc/conf/POWERMAC_G5: revision 1.2
sys/arch/alpha/conf/ALPHA: revision 1.218
sys/arch/sun3/conf/GENERIC: revision 1.133
sys/arch/prep/conf/GENERIC: revision 1.124
sys/arch/alpha/conf/GENERIC: revision 1.291
sys/arch/atari/conf/HADES: revision 1.71
sys/arch/newsmips/conf/GENERIC: revision 1.93
sys/arch/netwinder/conf/GENERIC: revision 1.82
sys/arch/hpcmips/conf/GENERIC: revision 1.190
sys/arch/amiga/conf/AMIGA: revision 1.98
sys/arch/sbmips/conf/GENERIC: revision 1.54
sys/arch/pc532/conf/GENERIC: revision 1.64
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.53
Disable SYSTRACE by default on all kernels (discussed with core)
 1.137.4.1 10-Dec-2006  yamt sync with head.
 1.137.2.1 18-Nov-2006  ad Sync with head.
 1.138.18.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.138.16.2 03-Oct-2007  garbled Sync with HEAD
 1.138.16.1 26-Jun-2007  garbled Sync with HEAD.
 1.138.10.1 11-Jul-2007  mjf Sync with head.
 1.138.8.4 03-Dec-2007  ad Sync with HEAD.
 1.138.8.3 20-Aug-2007  ad Sync with HEAD.
 1.138.8.2 15-Jul-2007  ad Sync with head.
 1.138.8.1 09-Jun-2007  ad Sync with head.
 1.138.2.2 25-Aug-2007  liamjfoy Pull up following revision(s) (requested by adrianp in ticket #820):
sys/arch/hp300/conf/GENERIC: revision 1.141
sys/arch/alpha/conf/GENERIC: revision 1.315
sys/arch/amd64/conf/GENERIC: revision 1.154
sys/arch/cats/conf/GENERIC: revision 1.116
sys/arch/arc/conf/GENERIC: revision 1.148
sys/arch/acorn32/conf/GENERIC: revision 1.80
sys/arch/sparc/conf/GENERIC: revision 1.200
sys/arch/sparc64/conf/GENERIC: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.68
sys/arch/amiga/conf/GENERIC: revision 1.248
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66
sys/arch/i386/conf/GENERIC: revision 1.840
sys/arch/amiga/conf/GENERIC.in: revision 1.61
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68
sys/arch/mac68k/conf/GENERIC: revision 1.182
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.138.2.1 05-Jun-2007  bouyer Pull up following revision(s) (requested by martin in ticket #699):
sys/arch/hpcmips/conf/GENERIC: revision 1.196
sys/arch/hp700/conf/GENERIC: revision 1.74
sys/arch/i386/conf/GENERIC: revision 1.831
sys/arch/next68k/conf/GENERIC: revision 1.108
sys/arch/alpha/conf/GENERIC: revision 1.313
sys/arch/arc/conf/GENERIC: revision 1.146
sys/arch/cats/conf/GENERIC: revision 1.115
sys/arch/ews4800mips/conf/GENERIC: revision 1.18
sys/arch/landisk/conf/GENERIC: revision 1.8 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.85
sys/arch/pmax/conf/GENERIC: revision 1.152
sys/arch/iyonix/conf/GENERIC: revision 1.38 via patch
sys/arch/amiga/conf/GENERIC: revision 1.245
sys/arch/vax/conf/GENERIC: revision 1.157
sys/arch/prep/conf/GENERIC: revision 1.135
sys/arch/pc532/conf/GENERIC: revision 1.70
sys/arch/sbmips/conf/GENERIC: revision 1.61
sys/arch/mipsco/conf/GENERIC: revision 1.65
sys/arch/cobalt/conf/GENERIC: revision 1.108
sys/arch/ofppc/conf/GENERIC: revision 1.98
sys/arch/amd64/conf/GENERIC: revision 1.148
sys/arch/acorn26/conf/GENERIC: revision 1.50
sys/arch/dreamcast/conf/GENERIC: revision 1.78
sys/arch/mac68k/conf/GENERIC: revision 1.181
sys/arch/hp300/conf/GENERIC: revision 1.139
sys/arch/mmeye/conf/GENERIC: revision 1.88
sys/arch/news68k/conf/GENERIC: revision 1.88
sys/arch/mvme68k/conf/GENERIC: revision 1.71
sys/arch/acorn32/conf/GENERIC: revision 1.79
sys/arch/sparc/conf/GENERIC: revision 1.199
sys/arch/luna68k/conf/GENERIC: revision 1.78
sys/arch/bebox/conf/GENERIC: revision 1.105
sys/arch/macppc/conf/GENERIC: revision 1.256 via patch
sys/arch/x68k/conf/GENERIC: revision 1.134
sys/arch/sun3/conf/GENERIC: revision 1.138
sys/arch/newsmips/conf/GENERIC: revision 1.98
Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.140.8.2 04-Nov-2007  jmcneill Sync with HEAD.
 1.140.8.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.140.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.140.2.1 07-Aug-2007  matt Sync with HEAD.
 1.141.6.1 13-Nov-2007  bouyer Sync with HEAD
 1.141.2.2 09-Jan-2008  matt sync with HEAD
 1.141.2.1 06-Nov-2007  matt sync with HEAD
 1.143.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.143.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.145.16.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.145.16.1 19-Oct-2008  haad Sync with HEAD.
 1.145.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.145.10.3 11-Aug-2010  yamt sync with head.
 1.145.10.2 11-Mar-2010  yamt sync with head
 1.145.10.1 04-May-2009  yamt sync with head.
 1.145.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.145.6.1 28-Sep-2008  mjf Sync with HEAD.
 1.147.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.151.2.3 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.151.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.151.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.152.2.4 31-May-2011  rmind sync with head
 1.152.2.3 21-Apr-2011  rmind sync with head
 1.152.2.2 05-Mar-2011  rmind sync with head
 1.152.2.1 30-May-2010  rmind sync with head
 1.159.4.3 17-Feb-2011  bouyer Sync with HEAD
 1.159.4.2 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.159.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.159.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.167.2.4 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.167.2.3 23-Jan-2013  yamt sync with head
 1.167.2.2 30-Oct-2012  yamt sync with head
 1.167.2.1 17-Apr-2012  yamt sync with head
 1.168.2.2 11-Mar-2012  mrg sync to latest -current
 1.168.2.1 18-Feb-2012  mrg merge to -current.
 1.169.8.1 22-May-2018  martin Apply patch requested by maxv in ticket #1500:

* disable compat_svr4 and compat_svr4_32 everywhere
* disable compat_ibcs2 everywhere but on Vax
* remove the svr4/svr4_32/ibcs2/freebsd entries from the autoload list
 1.169.6.1 22-May-2018  martin Apply patch requested by maxv in ticket #1500:

* disable compat_svr4 and compat_svr4_32 everywhere
* disable compat_ibcs2 everywhere but on Vax
* remove the svr4/svr4_32/ibcs2/freebsd entries from the autoload list
 1.169.2.2 22-May-2018  martin Apply patch requested by maxv in ticket #1500:

* disable compat_svr4 and compat_svr4_32 everywhere
* disable compat_ibcs2 everywhere but on Vax
* remove the svr4/svr4_32/ibcs2/freebsd entries from the autoload list
 1.169.2.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.171.2.5 03-Dec-2017  jdolecek update from HEAD
 1.171.2.4 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.171.2.3 23-Jun-2013  tls resync from head
 1.171.2.2 25-Feb-2013  tls resync with head
 1.171.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.178.2.2 18-May-2014  rmind sync with head
 1.178.2.1 28-Aug-2013  rmind sync with head
 1.180.2.1 10-Aug-2014  tls Rebase.
 1.184.2.4 15-May-2015  snj Pull up following revision(s) (requested by jnemeth in ticket #762):
share/man/man4/options.4: revision 1.442
sys/arch/amd64/conf/ALL: revision 1.18
sys/arch/amd64/conf/GENERIC: revision 1.396
sys/arch/dreamcast/conf/GENERIC: revision 1.119
sys/arch/epoc32/conf/GENERIC: revision 1.6
sys/arch/evbarm/conf/BCM5301X: revision 1.24
sys/arch/evbarm/conf/BCM56340: revision 1.9
sys/arch/evbarm/conf/IMX23_OLINUXINO: revision 1.9
sys/arch/evbarm/conf/std.beagle: revision 1.13
sys/arch/evbarm/conf/std.kobo: revision 1.2
sys/arch/evbarm/conf/std.netwalker: revision 1.10
sys/arch/evbppc/conf/P2020DS: revision 1.25
sys/arch/evbppc/conf/RB800: revision 1.30
sys/arch/evbppc/conf/TWRP1025: revision 1.18
sys/arch/hp300/conf/GENERIC: revision 1.187
sys/arch/hpcsh/conf/GENERIC: revision 1.104
sys/arch/i386/conf/GENERIC: revision 1.1111
sys/arch/i386/conf/MONOLITHIC: revision 1.17
sys/arch/landisk/conf/GENERIC: revision 1.43
sys/arch/luna68k/conf/GENERIC: revision 1.117
sys/arch/macppc/conf/GENERIC: revision 1.316
sys/arch/macppc/conf/GENERIC_601: revision 1.5
sys/arch/mmeye/conf/MMEYE_WLF: revision 1.16
sys/arch/news68k/conf/GENERIC: revision 1.123
sys/arch/sandpoint/conf/GENERIC: revision 1.85
sys/arch/shark/conf/GENERIC: revision 1.119
sys/arch/sparc/conf/GENERIC: revision 1.246
sys/arch/sparc64/conf/GENERIC: revision 1.174
sys/arch/sun3/conf/GENERIC3X: revision 1.125
sys/arch/sun3/conf/GENERIC: revision 1.169
sys/arch/x68k/conf/GENERIC: revision 1.177
sys/arch/zaurus/conf/GENERIC: revision 1.62
sys/conf/files: revision 1.1099
sys/kern/kern_module.c: revisions 1.98, 1.99
Create an "options MODULAR_DEFAULT_AUTOLOAD" config option and add
it to all kernel configs that contain "options MODULAR". This
option turns on module autoloading by default (which is the current
default). This allows people who don't want module autoloading on
by default to disable it by simply removing/commentting this line.
--
fix typo. (s/MODULE_DEFAULT_AUTOLOAD/MODULAR_DEFAULT_AUTOLOAD/)
 1.184.2.3 18-Nov-2014  snj Pull up following revision(s) (requested by manu in ticket #251):
sys/arch/acorn26/conf/GENERIC: revision 1.81
sys/arch/acorn32/conf/GENERIC: revision 1.116
sys/arch/alpha/conf/GENERIC: revision 1.362
sys/arch/amd64/conf/ALL: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.404
sys/arch/amd64/conf/XEN3_DOM0: revision 1.112
sys/arch/amd64/conf/XEN3_DOMU: revision 1.60
sys/arch/amiga/conf/GENERIC.in: revision 1.129
sys/arch/amiga/conf/GENERIC: revision 1.311
sys/arch/amigappc/conf/GENERIC: revision 1.24
sys/arch/arc/conf/GENERIC: revision 1.184
sys/arch/bebox/conf/GENERIC: revision 1.145
sys/arch/cats/conf/GENERIC: revision 1.155
sys/arch/cesfic/conf/GENERIC: revision 1.65
sys/arch/cobalt/conf/GENERIC: revision 1.147
sys/arch/dreamcast/conf/GENERIC: revision 1.121
sys/arch/emips/conf/GENERIC: revision 1.15
sys/arch/epoc32/conf/GENERIC: revision 1.8
sys/arch/ews4800mips/conf/GENERIC: revision 1.51
sys/arch/hp300/conf/GENERIC: revision 1.190
sys/arch/hpcmips/conf/GENERIC: revision 1.229
sys/arch/hpcsh/conf/GENERIC: revision 1.106
sys/arch/hppa/conf/GENERIC: revision 1.6
sys/arch/i386/conf/ALL: revision 1.389
sys/arch/i386/conf/GENERIC: revision 1.1118
sys/arch/i386/conf/XEN3_DOM0: revision 1.93
sys/arch/i386/conf/XEN3_DOMU: revision 1.65
sys/arch/ibmnws/conf/GENERIC: revision 1.46
sys/arch/iyonix/conf/GENERIC: revision 1.88
sys/arch/landisk/conf/GENERIC: revision 1.45
sys/arch/luna68k/conf/GENERIC: revision 1.119
sys/arch/mac68k/conf/GENERIC: revision 1.220
sys/arch/macppc/conf/GENERIC: revision 1.320
sys/arch/macppc/conf/MAMBO: revision 1.24
sys/arch/macppc/conf/POWERMAC_G5: revision 1.25
sys/arch/mipsco/conf/GENERIC: revision 1.88
sys/arch/mmeye/conf/GENERIC: revision 1.120
sys/arch/mvme68k/conf/GENERIC: revision 1.94
sys/arch/mvmeppc/conf/GENERIC: revision 1.24
sys/arch/netwinder/conf/GENERIC: revision 1.126
sys/arch/news68k/conf/GENERIC: revision 1.125
sys/arch/newsmips/conf/GENERIC: revision 1.129
sys/arch/next68k/conf/GENERIC: revision 1.139
sys/arch/ofppc/conf/GENERIC: revision 1.157
sys/arch/pmax/conf/GENERIC64: revision 1.21
sys/arch/pmax/conf/GENERIC: revision 1.185
sys/arch/prep/conf/GENERIC: revision 1.174
sys/arch/rs6000/conf/GENERIC: revision 1.33
sys/arch/sandpoint/conf/GENERIC: revision 1.88
sys/arch/sbmips/conf/GENERIC: revision 1.101
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.28
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.104
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.106
sys/arch/shark/conf/GENERIC: revision 1.121
sys/arch/sparc/conf/GENERIC: revision 1.248
sys/arch/sparc/conf/TADPOLE3GX: revision 1.65
sys/arch/sparc64/conf/GENERIC: revision 1.177
sys/arch/sparc64/conf/NONPLUS64: revision 1.44
sys/arch/sun2/conf/GENERIC: revision 1.94
sys/arch/sun3/conf/GENERIC: revision 1.171
sys/arch/vax/conf/GENERIC: revision 1.193
sys/arch/vax/conf/VAX780: revision 1.19
sys/arch/x68k/conf/GENERIC: revision 1.179
sys/arch/zaurus/conf/GENERIC: revision 1.65
sys/ufs/files.ufs: revision 1.38
Remove unused extended attributes kernel options

As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate
 1.184.2.2 14-Nov-2014  martin Pull up following revision(s) (requested by manu in ticket #232):
sys/arch/next68k/conf/GENERIC: revision 1.138
sys/arch/cobalt/conf/GENERIC: revision 1.146
sys/arch/mvme68k/conf/GENERIC: revision 1.93
sys/arch/vax/conf/VAX780: revision 1.18
sys/arch/newsmips/conf/GENERIC: revision 1.128
sys/arch/luna68k/conf/GENERIC: revision 1.118
sys/arch/sbmips/conf/GENERIC: revision 1.100
sys/arch/pmax/conf/GENERIC: revision 1.184
sys/arch/alpha/conf/GENERIC: revision 1.361
sys/arch/sparc64/conf/GENERIC: revision 1.176
sys/arch/sun3/conf/GENERIC: revision 1.170
sys/arch/shark/conf/GENERIC: revision 1.120
sys/arch/landisk/conf/GENERIC: revision 1.44
sys/arch/bebox/conf/GENERIC: revision 1.144
sys/arch/sparc64/conf/NONPLUS64: revision 1.43
sys/arch/sandpoint/conf/GENERIC: revision 1.87
sys/arch/emips/conf/GENERIC: revision 1.14
sys/arch/amd64/conf/XEN3_DOM0: revision 1.111
sys/arch/dreamcast/conf/GENERIC: revision 1.120
sys/arch/cesfic/conf/GENERIC: revision 1.64
sys/arch/mmeye/conf/GENERIC: revision 1.119
sys/arch/epoc32/conf/GENERIC: revision 1.7
sys/arch/x68k/conf/GENERIC: revision 1.178
sys/arch/iyonix/conf/GENERIC: revision 1.87
sys/arch/sun2/conf/GENERIC: revision 1.93
sys/arch/ews4800mips/conf/GENERIC: revision 1.50
sys/arch/amd64/conf/XEN3_DOMU: revision 1.59
sys/arch/acorn26/conf/GENERIC: revision 1.80
sys/arch/acorn32/conf/GENERIC: revision 1.115
sys/arch/macppc/conf/POWERMAC_G5: revision 1.24
sys/arch/i386/conf/GENERIC: revision 1.1117
sys/arch/arc/conf/GENERIC: revision 1.183
sys/arch/cats/conf/GENERIC: revision 1.154
sys/arch/amiga/conf/GENERIC.in: revision 1.128
sys/arch/zaurus/conf/GENERIC: revision 1.64
sys/arch/netwinder/conf/GENERIC: revision 1.125
sys/arch/hppa/conf/GENERIC: revision 1.5
sys/arch/mvmeppc/conf/GENERIC: revision 1.23
sys/arch/macppc/conf/GENERIC: revision 1.319
sys/arch/amiga/conf/GENERIC: revision 1.310
sys/arch/pmax/conf/GENERIC64: revision 1.20
sys/arch/macppc/conf/MAMBO: revision 1.23
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.27
sys/arch/amigappc/conf/GENERIC: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.403
sys/arch/ofppc/conf/GENERIC: revision 1.156
sys/arch/mac68k/conf/GENERIC: revision 1.219
sys/arch/i386/conf/XEN3_DOMU: revision 1.64
sys/arch/mipsco/conf/GENERIC: revision 1.87
sys/arch/hp300/conf/GENERIC: revision 1.189
sys/arch/vax/conf/GENERIC: revision 1.192
sys/arch/news68k/conf/GENERIC: revision 1.124
sys/arch/ibmnws/conf/GENERIC: revision 1.45
sys/arch/hpcsh/conf/GENERIC: revision 1.105
sys/arch/sparc/conf/TADPOLE3GX: revision 1.64
sys/arch/i386/conf/XEN3_DOM0: revision 1.92
sys/arch/sparc/conf/GENERIC: revision 1.247
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.105
sys/arch/prep/conf/GENERIC: revision 1.173
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.103
sys/arch/rs6000/conf/GENERIC: revision 1.32
sys/arch/hpcmips/conf/GENERIC: revision 1.228
Support for UFS1 extended attributes in GENERIC and GENERIC-like kernels
This change just brings UFS1 extended attribute *support* in the kernel,
extended attributes are not enabled unless three conditions are met:
1) filesystem is UFS1 (newfs -O1)
2) .attribute/system and .attribute/user directories are created at fs root
3) filesystem is mounted with -o extattr
Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
 1.184.2.1 29-Aug-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #62):
sys/arch/hp300/conf/files.hp300: revision 1.89
share/man/man4/arcofi.4: revision 1.1
share/man/man4/arcofi.4: revision 1.2
share/man/man4/Makefile: revision 1.617
sys/arch/hp300/hp300/intr.c: revision 1.41
sys/conf/files: revision 1.1100
sys/arch/hp300/hp300/locore.s: revision 1.171
distrib/sets/lists/man/mi: revision 1.1486
sys/dev/ic/arcofivar.h: revision 1.1
sys/arch/hp300/conf/majors.hp300: revision 1.26
sys/arch/hp300/dev/arcofi_dio.c: revision 1.1
sys/arch/hp300/conf/GENERIC: revision 1.188
sys/dev/ic/arcofi.c: revision 1.1
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.
The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.
The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
Add a man page for arcofi(4) driver. From OpenBSD.
Fix date.
 1.190.2.3 28-Aug-2017  skrll Sync with HEAD
 1.190.2.2 05-Feb-2017  skrll Sync with HEAD
 1.190.2.1 22-Sep-2015  skrll Sync with HEAD
 1.191.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.194.8.1 26-Jan-2018  martin Pull up following revision(s) (requested by sevan in ticket #510):
sys/arch/sun3/conf/GENERIC3X: revision 1.130
sys/arch/sparc64/conf/GENERIC: revision 1.203
sys/arch/news68k/conf/LIBERO: revision 1.66
sys/arch/amiga/conf/DRACO: revision 1.185
sys/arch/evbarm/conf/MV2120: revision 1.35
sys/arch/x68k/conf/GENERIC: revision 1.187
sys/arch/rs6000/conf/GENERIC: revision 1.39
sys/arch/news68k/conf/GENERIC_TINY: revision 1.86
sys/arch/i386/conf/XEN3_DOMU: revision 1.88
sys/arch/iyonix/conf/GENERIC: revision 1.97
sys/arch/evbarm64/conf/A64EMUL: revision 1.11
sys/arch/mvme68k/conf/GENERIC: revision 1.98
sys/arch/acorn32/conf/GENERIC: revision 1.124
sys/arch/i386/conf/XEN3_DOM0: revision 1.125
sys/arch/cobalt/conf/INSTALL: revision 1.65
sys/arch/macppc/conf/GENERIC_601: revision 1.16
sys/arch/hppa/conf/GENERIC: revision 1.17
sys/arch/amiga/conf/GENERIC.in: revision 1.137
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.33
sys/arch/netwinder/conf/GENERIC: revision 1.134
sys/arch/amd64/conf/XEN3_DOMU: revision 1.83
sys/arch/mac68k/conf/GENERIC: revision 1.225
sys/arch/arc/conf/RPC44: revision 1.54
sys/arch/mipsco/conf/GENERIC: revision 1.92
sys/arch/cats/conf/GENERIC: revision 1.166
sys/arch/amd64/conf/XEN3_DOM0: revision 1.145
sys/arch/amigappc/conf/GENERIC: revision 1.33
sys/arch/sun3/conf/GENERIC: revision 1.176
sys/arch/news68k/conf/GENERIC: revision 1.130
sys/arch/hpcsh/conf/GENERIC: revision 1.110
sys/arch/hp300/conf/GENERIC: revision 1.198
sys/arch/atari/conf/GENERIC.in: revision 1.115
sys/arch/sparc/conf/MRCOFFEE: revision 1.54
sys/arch/evbppc/conf/EXPLORA451: revision 1.62
sys/arch/cesfic/conf/GENERIC: revision 1.69
sys/arch/vax/conf/GENERIC: revision 1.204
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.115
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.112
sys/arch/sparc/conf/GENERIC: revision 1.258
sys/arch/next68k/conf/GENERIC: revision 1.145
sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.34
sys/arch/prep/conf/GENERIC: revision 1.185
sys/arch/amiga/conf/INSTALL: revision 1.129
sys/arch/newsmips/conf/GENERIC: revision 1.133
sys/arch/cobalt/conf/GENERIC: revision 1.156
sys/arch/sun2/conf/GENERIC: revision 1.99
sys/arch/luna68k/conf/INSTALL: revision 1.25
sys/arch/amigappc/conf/NULL: revision 1.53
sys/arch/acorn26/conf/GENERIC: revision 1.85
sys/arch/vax/conf/VAX780: revision 1.25
sys/arch/luna68k/conf/GENERIC: revision 1.125
sys/arch/ews4800mips/conf/GENERIC: revision 1.56
sys/arch/macppc/conf/POWERMAC_G5: revision 1.29
sys/arch/arc/conf/GENERIC: revision 1.189
sys/arch/macppc/conf/MAMBO: revision 1.27
sys/arch/acorn32/conf/EB7500ATX: revision 1.64
sys/arch/pmax/conf/GENERIC: revision 1.196
sys/arch/pmax/conf/GENERIC64: revision 1.28
sys/arch/amiga/conf/GENERIC: revision 1.319
sys/arch/evbarm/conf/MPCSA_GENERIC: revision 1.55
sys/arch/macppc/conf/GENERIC: revision 1.339
sys/arch/emips/conf/GENERIC: revision 1.21
sys/arch/sandpoint/conf/GENERIC: revision 1.97
sys/arch/landisk/conf/GENERIC: revision 1.58
sys/arch/bebox/conf/GENERIC: revision 1.157
sys/arch/alpha/conf/GENERIC: revision 1.379
Alternate buffer queue strategies no longer considered experimental, update
description.
Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
 1.198.4.1 10-Jun-2019  christos Sync with HEAD
 1.198.2.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.198.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.206.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.207.6.1 31-May-2021  cjep sync with head
 1.207.4.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.212.2.1 02-Aug-2025  perseant Sync with HEAD
 1.10 18-Jul-1994  mycroft Clean up deleted files.
 1.9 18-Jul-1994  cgd add COMPAT_44
 1.8 03-Jul-1994  mycroft branches: 1.8.2;
Switch to Motorola emulator.
 1.7 23-May-1994  mycroft Merge with 4.4-Lite.
 1.6 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.5 09-Mar-1994  ws Make FFS optional
 1.4 30-Aug-1993  deraadt pagers are now options, not pseudo-devices
 1.3 07-Jul-1993  cgd everybody needs a vnode pager...
 1.2 29-May-1993  cgd change kernel names where necessary, also, other minor hacks
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.8.2.1 18-Jul-1994  cgd updates from trunk
 1.3 21-Nov-1999  itojun bring in content of GENERIC.v6 into GENERIC.
remove GENERIC.v6 file (as it is part of GENERIC now).

"faith" interface is commented out by default as it is not really for
general use.
IPsec items are commented out as well, though we can enable "options IPSEC"
without export-related issue ("options IPSEC" will enable authentication
portion only). We may need to think about it again.

if you have problem compiling with INET6 on archs I do not have access to,
please contact me.

XXX what to do with arch/arm32/SHARK{,.v6}?
 1.2 09-Jul-1999  thorpej branches: 1.2.2; 1.2.8;
Add examples for including the kernel crypto bits from either crypto-us
or crypto-intl, commented out, with instructions to use only one, and
adjust the prefix as necessary.
 1.1 01-Jul-1999  itojun branches: 1.1.2;
kernel configuration for IPv6/IPsec. should be in GENERIC in the future.
(source code will be committed soon)
 1.1.2.3 02-Aug-1999  thorpej Update from trunk.
 1.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 01-Jul-1999  thorpej file GENERIC.v6 was added on branch chs-ubc2 on 1999-07-01 23:07:13 +0000
 1.2.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.16 08-Feb-2002  gmcgarry Remove old, custom files.
 1.15 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.14 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.13 17-Nov-2001  gmcgarry Update for new RTC and HIL attachments.
 1.12 08-Jul-2001  abs branches: 1.12.2; 1.12.8;
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.11 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.10 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.9 31-Jul-1999  thorpej branches: 1.9.2;
Add HP385.
 1.8 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.7 26-Jun-1998  lukem branches: 1.7.10;
remove options FIFO; it's now the default
 1.6 05-Jan-1998  perry RCSID Police.
 1.5 22-Dec-1997  thorpej Add COMPAT_13.
 1.4 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.3 02-Nov-1997  carrel All hail HAYDON!
 1.2 06-May-1997  lukem branches: 1.2.8;
be consistent with use of spaces and tabs.
don't need quotes around options with _'s in the name
 1.1 02-Feb-1997  carrel My config files. To quote from thorpej: "for kicks".
 1.2.8.1 02-Nov-1997  mellon Pull rev 1.3 up from trunk
 1.7.10.1 02-Aug-1999  thorpej Update from trunk.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.12.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.12.8.1 08-Jul-2001  nathanw file HAYDON was added on branch nathanw_sa on 2002-01-08 00:24:30 +0000
 1.12.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.12.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.12.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12 18-Jul-1994  mycroft Clean up deleted files.
 1.11 03-Jul-1994  mycroft Switch to Motorola emulator.
 1.10 23-May-1994  mycroft Merge with 4.4-Lite.
 1.9 23-May-1994  mycroft `clock' is no longer a device.
 1.8 17-May-1994  cgd no SYSVSHM
 1.7 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.6 09-Mar-1994  ws Make FFS optional
 1.5 21-Dec-1993  brezak Add pseudo-device vn
 1.4 30-Aug-1993  deraadt pagers are now options, not pseudo-devices
 1.3 07-Aug-1993  cgd squish KGDB options
 1.2 29-May-1993  cgd change kernel names where necessary, also, other minor hacks
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.72 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.71 29-Jan-2024  christos branches: 1.71.2;
PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.70 07-Aug-2022  simonb UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.
 1.69 29-May-2021  tsutsui Reduce diffs from GENERIC for maintainability.

No functional change intended.
 1.68 29-May-2021  tsutsui Reduce maxusers to 8 as GENERIC.

Should be pulled up to netbsd-9 and netbsd-8.
 1.67 29-May-2021  tsutsui Add missed 'nhpib at intio' for internal HP-IB. Found on testing HPDisk.

Also fix comments for HP-IB devices.
Should be pulled up to netbsd-8 and netbsd-9.
 1.66 12-Dec-2020  tsutsui branches: 1.66.4; 1.66.6;
Remove options (NVNODE, NBUF, and BUFPAGES) for small RAM machines.

These options make extracting binary sets much slower even on miniroot.
Instead, use "options BUFCACHE=5" (use 5% of memory for buffercache) and
also specify "-fno-unwind-tables" for COPTS to shrink INSTALL kernel.

Worth to pullup to netbsd-9.
 1.65 27-Sep-2020  roy branches: 1.65.2;
vether: Add to kernel configurations

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.64 14-Mar-2019  thorpej branches: 1.64.4;
G/C "MAPPECOPY". It is the deadest of wood, and never actually worked in
NetBSD.
 1.63 01-Aug-2018  maxv Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
 1.62 14-Sep-2017  mrg branches: 1.62.2; 1.62.4;
clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
 1.61 28-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 1.
 1.60 23-Aug-2014  dholland branches: 1.60.2; 1.60.12;
Systematize (and in many cases, fix) the comments on options COMPAT_NN.

There are quite a few configs that are missing some COMPAT_NN options
in ways that don't make sense; this should probably get cleaned up
too, but for the time being I've not added or removed anything.
 1.59 16-Aug-2014  apb Add commented out "#options COMPAT_70" to all kernel configuration
files that already had commented out "#options COMPAT_60".
 1.58 30-Apr-2014  tsutsui Add and enable sti(4) at sgc in install kernels for 425e.

Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.57 29-Apr-2014  tsutsui Add "pseudo-device wsmux" in INSTALL (and RAMDISK) kernels.

On NetBSD/hp300, hilkbd(4) is probed in config_interrupts(9)
so it's always attached after wsdisplay(4). In that case,
wskbd can't be used as a console input device without wsmux(4).
(i.e. keyboard didn't work on installer using screen console)

Should be pulled up to all netbsd-6* branches.
 1.56 19-Apr-2014  tsutsui Add proper RealTime Clock support for HP9000/425e.

As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.

Tested on HP425e (with mcclock) and HP362 (with old rtc).
 1.55 30-Jun-2013  rmind branches: 1.55.4;
G/C PFIL_HOOKS from the kernel configs.
 1.54 05-Jun-2013  christos branches: 1.54.2;
remove obsolete networking options
 1.53 27-Apr-2013  christos the bogus number police
 1.52 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.51 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.50 17-Oct-2012  apb Add commented out "#options COMPAT_60" to all kernel configuration files
that already had commented out "#options COMPAT_50".
 1.49 17-Aug-2012  abs branches: 1.49.2;
Update all kernel configs mentioning WSEMUL_* but not already including
WSDISPLAY_COMPAT_USL using the following rules:
- If WSEMUL_ is commented out, add commented out out WSDISPLAY_COMPAT_USL
- If INSTALL or obviously memory constrained, add WSDISPLAY_DEFAULTSCREENS=1
and commented out WSDISPLAY_COMPAT_USL
- Otherwise add WSDISPLAY_COMPAT_USL

Some of the INSTALL configs for larger memory machines are probably suitable
for adding WSDISPLAY_COMPAT_USL.

Now wsconscfg(8) should be able to switch VTs when expected.

Implemented after no objection from tech-kern to the following:

On 5 June 2012 09:47, David Brownlee <abs@absd.org> wrote:
> wsconscfg(8) requires WSDISPLAY_COMPAT_USL in order to switch virtual
> terminals.
>
> Except when in an exceptionally memory or space constrained
> environment (INSTALL being the obvious case), is there any reason why
> all GENERIC and GENERIC-like kernels which have wscons enabled
> shouldn't also have WSDISPLAY_COMPAT_USL?
 1.48 18-Dec-2011  dholland branches: 1.48.2;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.47 22-Nov-2011  tls branches: 1.47.2;

The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself. Move it to std. This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports. Thanks to Havard Eidnes for
pointing them out.
 1.46 30-Jun-2011  wiz branches: 1.46.2;
dependant -> dependent
 1.45 06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.44 12-Feb-2011  tsutsui Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.
 1.43 12-Feb-2011  tsutsui Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.42 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.41 16-Apr-2010  pooka branches: 1.41.2; 1.41.4;
Remove unused count (invariably "4") from pseudo-device fss.
 1.40 08-Feb-2010  joerg branches: 1.40.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
 1.39 12-Jan-2009  tsutsui branches: 1.39.4;
Add options COMPAT_50.
 1.38 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.37 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.36 31-Jul-2008  simonb branches: 1.36.2;
Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.35 17-Oct-2007  garbled branches: 1.35.16; 1.35.20; 1.35.22; 1.35.26;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.34 25-Jun-2007  tsutsui branches: 1.34.10;
Add options COMPAT_40.
 1.33 02-Oct-2006  chs branches: 1.33.8; 1.33.10; 1.33.16;
remove MALLOC_NOINLINE, it doesn't do anything anymore.
 1.32 20-Jul-2006  tsutsui branches: 1.32.4; 1.32.6;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.31 21-Mar-2006  tsutsui Disable KERNFS since installer will use dmesg(8).
 1.30 05-Feb-2006  cube branches: 1.30.2; 1.30.4; 1.30.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.29 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.28 07-Dec-2005  tsutsui branches: 1.28.2; 1.28.4; 1.28.6;
Remove obsolete options VNODE_OP_NOINLINE.
 1.27 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.26 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.25 19-Aug-2005  christos 64 bit inode changes.
 1.24 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.23 18-Feb-2005  dsl branches: 1.23.4; 1.23.6;
Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.22 11-Feb-2005  dsl Add 'option FFS_SNAPSHOT' to most of the config files.
Commented out for kernels that appear to hace space constraints.
 1.21 31-Jan-2005  hannken Add file system snapshots to kernel configs.

- Ffs internal snapshots get compiled in unconditionally.

- File system snapshot device fss(4) added to all kernel configs that
have a disk. Device is commented out on all non-GENERIC kernels.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
 1.20 05-Jan-2005  tsutsui branches: 1.20.2; 1.20.4;
options<space><tab>
 1.19 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.18 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.17 28-Aug-2004  thorpej Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
 1.16 18-Jul-2004  tsutsui Add options COMPAT_20.
 1.15 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.14 22-Nov-2003  tsutsui branches: 1.14.2;
Add an entry of "com0 at dio0 scode 9" so that /dev/ttyC0 and
compat symlink (/dev/tty0) are always reserved for DCA serial.
 1.13 08-Nov-2003  tsutsui Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.12 22-Sep-2003  cl add COMPAT_15/COMPAT_16
 1.11 06-Sep-2003  itojun add rnd(4) device to installation media.
necessary for many purposes, including password seeding, tcp sequence number,
and more. see tech-security
 1.10 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.9 22-Dec-2002  gmcgarry branches: 1.9.2;
Make the DMA controller a separate device attached to intio. Intio
devices can use the DMA controller too.
 1.8 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.7 05-Jul-2002  abs Ensure all INSTALL config files consistantly include PIPE_SOCKETPAIR,
MALLOC_NOINLINE, and VNODE_OP_NOINLINE. The exceptions are when they
include another config files that already defines the options, or if
they are for an embedded board, just define a few extra options, and
do not already define PIPE_SOCKETPAIR.
 1.6 07-May-2002  gmcgarry branches: 1.6.2;
FPSP required. Noted by Michael Wolfson.
 1.5 25-Apr-2002  atatat Add the INCLUDE_CONFIG_FILE option to all config files. In config
files that are generic (ie, GENERIC, GENERICSBC, GENERIC32, ALL, or
ALPHA), it is uncommented.
 1.4 12-Apr-2002  gmcgarry Add commented-out USERCONF option. Mainly useful for install media
and can be optionally enabled based on miniroot and ramdisk size
requirements.
 1.3 17-Mar-2002  gmcgarry Include MFS in the INSTALL kernel for the miniroot install.
 1.2 23-Feb-2002  gmcgarry branches: 1.2.2; 1.2.8;
Don't need printer support during installation.
 1.1 10-Feb-2002  gmcgarry Up-to-date kernels for installation media.
 1.2.8.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.8.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.8.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.2.8.1 23-Feb-2002  jdolecek file INSTALL was added on branch kqueue on 2002-03-16 15:57:32 +0000
 1.2.2.8 29-Dec-2002  thorpej Sync with HEAD.
 1.2.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.6 01-Aug-2002  nathanw Catch up to -current.
 1.2.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.2.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.2.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 23-Feb-2002  nathanw file INSTALL was added on branch nathanw_sa on 2002-02-28 04:09:22 +0000
 1.6.2.1 16-Jul-2002  gehenna catch up with -current.
 1.9.2.11 11-Dec-2005  christos Sync with head.
 1.9.2.10 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.9 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.2.8 15-Feb-2005  skrll Sync with HEAD.
 1.9.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.9.2.6 17-Jan-2005  skrll Sync with HEAD.
 1.9.2.5 14-Nov-2004  skrll Sync with HEAD.
 1.9.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.2 03-Sep-2004  skrll Sync with HEAD
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.14.2.1 15-Jul-2004  he Pull up revision 1.15 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.20.4.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.4.1 12-Feb-2005  yamt sync with head.
 1.20.2.1 29-Apr-2005  kent sync with -current
 1.23.6.3 03-Sep-2007  yamt sync with head.
 1.23.6.2 30-Dec-2006  yamt sync with head.
 1.23.6.1 21-Jun-2006  yamt sync with head.
 1.23.4.1 18-Jul-2005  riz Pull up revision 1.24 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.28.6.1 22-Apr-2006  simonb Sync with head.
 1.28.4.1 09-Sep-2006  rpaulo sync with head
 1.28.2.1 18-Feb-2006  yamt sync with head.
 1.30.6.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.30.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.30.2.2 11-Aug-2006  yamt sync with head
 1.30.2.1 01-Apr-2006  yamt sync with head.
 1.32.6.1 22-Oct-2006  yamt sync with head
 1.32.4.1 18-Nov-2006  ad Sync with head.
 1.33.16.1 26-Jun-2007  garbled Sync with HEAD.
 1.33.10.1 11-Jul-2007  mjf Sync with head.
 1.33.8.1 15-Jul-2007  ad Sync with head.
 1.34.10.1 06-Nov-2007  matt sync with HEAD
 1.35.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.35.26.1 19-Oct-2008  haad Sync with HEAD.
 1.35.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.35.20.3 11-Aug-2010  yamt sync with head.
 1.35.20.2 11-Mar-2010  yamt sync with head
 1.35.20.1 04-May-2009  yamt sync with head.
 1.35.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.35.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.36.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.39.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.40.2.3 21-Apr-2011  rmind sync with head
 1.40.2.2 05-Mar-2011  rmind sync with head
 1.40.2.1 30-May-2010  rmind sync with head
 1.41.4.3 17-Feb-2011  bouyer Sync with HEAD
 1.41.4.2 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.41.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.41.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.46.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.46.2.2 30-Oct-2012  yamt sync with head
 1.46.2.1 17-Apr-2012  yamt sync with head
 1.47.2.1 18-Feb-2012  mrg merge to -current.
 1.48.2.2 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.48.2.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1057):
sys/arch/hp300/conf/RAMDISK: revision 1.14
sys/arch/hp300/conf/INSTALL: revision 1.57
Add "pseudo-device wsmux" in INSTALL (and RAMDISK) kernels.
On NetBSD/hp300, hilkbd(4) is probed in config_interrupts(9)
so it's always attached after wsdisplay(4). In that case,
wskbd can't be used as a console input device without wsmux(4).
(i.e. keyboard didn't work on installer using screen console)
Should be pulled up to all netbsd-6* branches.
Disable options NVNODE, NBUF and BUFPAGES in the RAMDISK kernel.
These options were specified in the INSTALL kernel for 4MB machines,
but nowadays even the INSTALL kernel would not boot on such machines
and the RAMDISK kernel assumes the target machine has more memories.
Furthermore, these options makes extracting binary sets much slower
and also could cause "wapbl_register_deallocation: out of resources"
panic during extracting binaries into a 32GB SSD with 4KB fragments.
Should be pulled up to netbsd-6* branches.
 1.49.2.4 03-Dec-2017  jdolecek update from HEAD
 1.49.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.49.2.2 23-Jun-2013  tls resync from head
 1.49.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.54.2.2 18-May-2014  rmind sync with head
 1.54.2.1 28-Aug-2013  rmind sync with head
 1.55.4.1 10-Aug-2014  tls Rebase.
 1.60.12.1 05-Jun-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1680):

sys/arch/hp300/conf/INSTALL: revision 1.67
sys/arch/hp300/conf/INSTALL: revision 1.68

Add missed 'nhpib at intio' for internal HP-IB. Found on testing HPDisk.
Also fix comments for HP-IB devices.
Should be pulled up to netbsd-8 and netbsd-9.

Reduce maxusers to 8 as GENERIC.
Should be pulled up to netbsd-9 and netbsd-8.
 1.60.2.1 28-Aug-2017  skrll Sync with HEAD
 1.62.4.1 10-Jun-2019  christos Sync with HEAD
 1.62.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.64.4.2 05-Jun-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1280):

sys/arch/hp300/conf/INSTALL: revision 1.67
sys/arch/hp300/conf/INSTALL: revision 1.68

Add missed 'nhpib at intio' for internal HP-IB. Found on testing HPDisk.
Also fix comments for HP-IB devices.
Should be pulled up to netbsd-8 and netbsd-9.

Reduce maxusers to 8 as GENERIC.
Should be pulled up to netbsd-9 and netbsd-8.
 1.64.4.1 14-Dec-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #1152):

sys/arch/hp300/conf/RAMDISK: revision 1.16
sys/arch/hp300/conf/INSTALL: revision 1.66

Remove options (NVNODE, NBUF, and BUFPAGES) for small RAM machines.

These options make extracting binary sets much slower even on miniroot.

Instead, use "options BUFCACHE=5" (use 5% of memory for buffercache) and
also specify "-fno-unwind-tables" for COPTS to shrink INSTALL kernel.

Worth to pullup to netbsd-9.
 1.65.2.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.66.6.1 31-May-2021  cjep sync with head
 1.66.4.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.71.2.1 02-Aug-2025  perseant Sync with HEAD
 1.14 08-Feb-2002  gmcgarry Remove old, custom files.
 1.13 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.12 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.11 17-Nov-2001  gmcgarry Update for new RTC and HIL attachments.
 1.10 08-Jul-2001  abs branches: 1.10.2; 1.10.8;
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.9 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.8 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.7 29-Jul-1999  augustss branches: 1.7.2;
It's time to be COMPAT_14.
 1.6 26-Jun-1998  lukem branches: 1.6.10;
remove options FIFO; it's now the default
 1.5 05-Jan-1998  perry RCSID Police.
 1.4 22-Dec-1997  thorpej Add COMPAT_13.
 1.3 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.2 06-May-1997  lukem be consistent with use of spaces and tabs.
don't need quotes around options with _'s in the name
 1.1 02-Feb-1997  carrel My config files. To quote from thorpej: "for kicks".
 1.6.10.1 02-Aug-1999  thorpej Update from trunk.
 1.7.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.10.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.10.8.1 08-Jul-2001  nathanw file KARLA was added on branch nathanw_sa on 2002-01-08 00:24:30 +0000
 1.10.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.10.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.10.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28 02-Apr-2001  hpeyerl This machine hasn't existed for some time.
 1.27 24-Sep-2000  jdolecek branches: 1.27.2;
don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.26 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.25 29-Jul-1999  augustss branches: 1.25.2;
It's time to be COMPAT_14.
 1.24 26-Jun-1998  lukem branches: 1.24.10;
remove options FIFO; it's now the default
 1.23 19-May-1998  hpeyerl duh. need SYSV* stuff.
 1.22 21-Dec-1997  hpeyerl update for correct SPU type and COMPAT_13.
 1.21 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.20 07-May-1997  lukem cleanup unecessary quotage of options
 1.19 06-May-1997  lukem be consistent with use of spaces and tabs.
don't need quotes around options with _'s in the name
 1.18 16-Mar-1997  hpeyerl Lager is now config.new. ya ya, I've been busy.
 1.17 12-Mar-1997  thorpej Enable COMPAT_M68K4K.
 1.16 20-Jan-1997  scottr Remove obsolete timezone specification
 1.15 11-Dec-1996  thorpej branches: 1.15.2;
Fix typo in comment.
 1.14 09-Dec-1996  thorpej Add EXEC_SCRIPT (I don't even want to know how I forgot it before...)
 1.13 21-Oct-1996  hpeyerl Force some drive mappings for reasons I won't get into.
 1.12 03-Oct-1996  thorpej Add EXEC_AOUT to all kernels.
 1.11 10-Sep-1996  thorpej Document COMPAT_M68K4K, but leave it disabled by default.
 1.10 22-Aug-1996  thorpej Add COMPAT_12 to all kernels, and COMPAT_11 to a few as well.
 1.9 26-May-1996  hpeyerl Update to reflect reality (such as it is).
 1.8 28-Mar-1995  hpeyerl Update to reflect reality.
 1.7 24-Jan-1995  hpeyerl NULLFS
 1.6 23-Jan-1995  hpeyerl options GATEWAY.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 04-Oct-1994  hpeyerl begone 'softcar' begone!
hello 'ppp'.
goodbye 'ccd'.
 1.3 03-Jul-1994  mycroft Switch to Motorola emulator.
 1.2 27-Jun-1994  hpeyerl woops. Not OLD_DISKLABEL
 1.1 24-Jun-1994  hpeyerl Changes for ccd.
 1.15.2.1 30-Jan-1997  thorpej update from trunk
 1.24.10.1 02-Aug-1999  thorpej Update from trunk.
 1.25.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.25.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.27.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.3 15-May-1996  thorpej These haven't been kept up to date...
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 18-Jul-1994  mycroft branches: 1.1.2;
Add some missing options to GENERIC, and rename.
 1.1.2.2 18-Jul-1994  mycroft Add some missing options to GENERIC, and rename.
 1.1.2.1 18-Jul-1994  mycroft file LINT was added on branch netbsd-1-0 on 1994-07-18 07:15:48 +0000
 1.6 18-Jul-1994  mycroft Clean up deleted files.
 1.5 23-May-1994  mycroft `clock' is no longer a device.
 1.4 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.3 09-Mar-1994  ws Make FFS optional
 1.2 29-May-1993  cgd change kernel names where necessary, also, other minor hacks
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.95 21-Aug-2019  skrll Fix the pmap_bootstrap.o dependency (it was spelt pmap_boostrap.o before)
 1.94 22-Sep-2018  rin - Determine KERN_AS automatically depending on whether OPT_MODULAR is
set or not, in the same way as libcompat.

- Specify OPT_MODULAR in the port Makefile instead of KERN_AS.

Now, KERN_AS=library is used for kernels without module(7) for all ports.

OK christos
 1.93 25-Feb-2018  mrg branches: 1.93.2; 1.93.4;
add a special rule to build m68k/fpu.c to avoid passing -msoft-float.
fixes GCC 6 kernel builds that use this file.
 1.92 06-Sep-2015  uebayasi Declare dependency on fpsp.o via newly introduced ${MD_LIBS} instead of
${MD_OBJS}.

${MD_OBJS} should be used only for objects that must be linked first (i.e.,
start code). Objects have to be compiled following common compile rules,
and have to be generated into common places (i.e., top of kernel build
directory).

${MD_LIBS} defines libraries that are built by separate makefiles, under
separate directories. `Makefile.kern.inc' doesn't know intermediate library
objects.
 1.91 31-Aug-2015  uebayasi Fix build of .s files.
 1.90 15-Apr-2015  mrg remove various HAVE_GCC=45 fragments.
 1.89 09-Jul-2011  mrg branches: 1.89.12; 1.89.30;
apply -Wno-cast-qual upon diofb.c.
 1.88 21-Jan-2011  joerg Switch remaining platforms to modern CPP for assembler.
 1.87 11-Dec-2005  christos branches: 1.87.100; 1.87.106; 1.87.108;
merge ktrace-lwp.
 1.86 31-May-2005  christos s/GENASSYM/GENASSYM_CONF/ so we can use "GENASSYM" as the program name.
 1.85 04-Jun-2004  thorpej Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
 1.84 26-Nov-2002  thorpej branches: 1.84.6; 1.84.10;
The traditional C preprocessor is fixed in GCC 3.3 now, so no need
to skip -traditional-cpp for HAVE_GCC3.
 1.83 04-Jun-2002  thorpej Don't use -traditional-cpp if HAVE_GCC3.
 1.82 09-Dec-2001  atatat branches: 1.82.8;
Roll the rest of the ports over to the new MI kernel build machinery.
Any problems reported by testers have been fixed, and massive
cross-compiling of kernels has shown that any problems that remain
with actually building kernels are not related to this.
 1.81 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.80 26-Oct-2001  jmc branches: 1.80.2;
Change defaults for kernel compiles. Default all to USETOOLS?=no and have
the etc Makefile override that by putting USETOOLS into $.MAKEOVERRIDES
This way the default for kernel compiles is still to use the installed
toolchain instead of depending on $TOOLDIR. $TOOLDIR can be used by
simply adding USETOOLS=yes to the command line as usual.

Adjust each ports template to set the default no setting and also pull in
bsd.own.mk if they weren't already to ensure they'll build correctly
with the new toolchain setup.
 1.79 23-Oct-2001  thorpej branches: 1.79.2;
Set MACHINE_ARCH explicitly in Makefiles for which it is constant.
Also, since config(8) now explcitly sets MACHINE, there is no need
to do it here in the Makefile.
 1.78 29-May-2001  mrg branches: 1.78.2;
define _KERNEL_OPT as well as _KERNEL. we will use this in the future to
get kernel "opt_foo.h" headers, rather than _KERNEL && !_LKM.
 1.77 17-Dec-2000  jdolecek branches: 1.77.2;
delete obsolete comment
 1.76 09-May-2000  hubertf Add "install" target, so "make install" after building the kernel
does something useful. The target can be redefined by putting a
install-kernel-${MACHINE_NAME} target that fits your needs into
/etc/mk.conf.
 1.75 09-May-2000  thorpej HAVE_GCC28 -> HAVE_EGCS, and make it match gcc 2.9 as well. Also,
make the use of -Wno-uninitialized explicit, don't rely on a compiler
hack to do it for us.
 1.74 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.73 24-Jan-2000  tron Add "dependall" target for comfort.
 1.72 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.71 19-Jan-2000  tsutsui Change STRIPFLAGS=-g for cross-toolchains.
 1.70 26-Jul-1999  cgd branches: 1.70.2;
be more efficient when doing the SYSTEM_LD_TAIL for -g kernels: don't
copy them just to strip them, use strip -o.
 1.69 09-Jul-1999  mrg clean up a bit after jason :)

- fix emitrules() like emitfiles() to deal with the prefix (otherwise it
would attempt to find the file in the normal base for the NORMAL_C rule).
- add emitincludes() which adds include directives for each prefix to the
$INCLUDES variable in the makefile.
- add %INCLUDES to each Makefile.arch to deal with the above.

this makes "prefix" actually work in a usable manner, and now i can move
on to fixing compiler warnings (errors) in the ESP code. :)
 1.68 15-Jan-1999  thorpej branches: 1.68.4;
Some minor, mostly costmetic, changes to CPPFLAGS/CFLAGS.
 1.67 15-Jan-1999  thorpej Don't define "mc68020". Nothing uses it.
 1.66 08-Jan-1999  augustss Add -Wpointer-arith warning since `void *' arithmetic is not ANSI C.
 1.65 15-Oct-1998  drochner change handling of libkern:
-sys/lib/libkern builds as library per default (as it was documented all
the time)
-ports able to LKM set "KERN_AS=obj" explicitely in their Makefiles
(for now; should depend on actual "option LKM" or -better- functions
included for LKM use should be pulled in by a stub)
-always link libcompat before libkern - libkern stuff can be referred to
by libcompat, but not the other way
 1.64 05-Sep-1998  lukem distclean is a synonym for cleandir
 1.63 31-May-1998  thorpej Specify a non-profiling C rule.
 1.62 12-Apr-1998  tv Add -Wno-main conditional on compiler being gcc 2.8 or egcs. (This adds
a HAVE_GCC28 check-variable that can now be used to add other gcc-2.8
flags in cases where they may be useful, or to remove gcc 2.7.2 "bug
workaround" flags.)
 1.61 12-Nov-1997  thorpej Make sure CPP, AR, AS, and RANLIB are defined.
 1.60 12-Nov-1997  thorpej Define LORDER, NM, and TSORT here, like we do the rest of the tools.
 1.59 03-Oct-1997  lukem branches: 1.59.2;
define SIZE?=size, and use ${SIZE} instead of size. makes cross
compilation easier
 1.58 30-Sep-1997  christos PR/4162: Chris Jones: make cleandir does not work properly; it does not
remove the object files and the .depend file in the kernel build directory.
 1.57 12-Sep-1997  mycroft The FPCOPROC option no longer exists.
 1.56 12-Sep-1997  mycroft Fix an error from when Locore.c was removed.
 1.55 12-Jul-1997  leo branches: 1.55.2;
Generate assym.h dependencies when making 'depend'.
 1.54 01-Apr-1997  scottr Specify more aggressive warning options for C code.
 1.53 16-Mar-1997  thorpej Remove reference to Locore.c
 1.52 14-Mar-1997  mycroft Put the genassym.sh output in a temp file, and mv -f it, in case
it fails spectacularly and doesn't clean up. Also, don't depend genassym.c
(since it no longer exists), and remove dependencies for genassym.o (since it
no longer exists).
 1.51 13-Mar-1997  thorpej Use genassym.sh to facilitate cross compiling.
 1.50 04-Feb-1997  perry Nuke some options GENERIC residue.
 1.49 04-Feb-1997  perry Nuke some GENERIC residue.
 1.48 01-Feb-1997  thorpej - Garbage-collect a kludge necessary when we were using old config.
- Synch the "clean" rule with the i386 port's.
- Add a commented-out rule for generating assym.h w/ the new genassym.sh.
Some slight changes need to be made to genassym.h to make it work with
m68k, so we can't use it just yet.
 1.47 26-Jan-1997  hpeyerl ::->: :-)
 1.46 06-Jan-1997  thorpej branches: 1.46.2;
Kludge newvers rule, so that it works with old and new config.
 1.45 01-Dec-1996  jonathan * Replace explicit -O2 in CFLAGS with COPTS macro. Default COPTS?= -O2.
Lets users over-ride with makeoptions COPTS="..." in kernel config files.

Leave `mandatory' flags (like -msoft-float which on m68k enforces no
FP in kernel) in CFLAGS.
 1.44 09-Sep-1996  mycroft Move strip(1) flags into a separate variable, so that $STRIP can
be passed to subordinate make(1)s. Remove $TOUCH. Add HOSTED_CC,
HOSTED_CPPFLAGS, and HOSTED_CFLAGS, and use them when depending genassym.
 1.43 31-Aug-1996  mycroft Wrap the default definition of `S' in `.ifndef'.
 1.42 12-Aug-1996  mycroft Put into . Remove hooks for `config-dependent' and
`device-driver' flags.
 1.41 10-Aug-1996  mycroft * Add a HOSTED_C_C variable, which strips `-p', `-pg', and
`-nostdinc', and use it when building genassym.
* Use `-nostdinc' just to be sure we're self-contained.
 1.40 10-Aug-1996  mycroft * Define CWARNFLAGS and MKDEP in some moderately consistent fashion.
* Make S expand to an absolute path at compile time.
* Use `-S' rather than `-x' to remove debugging symbols.
* Garbage collect unused variables.
* Reverse a handful of port-specific changes that do not correspond to
the common build model and are not needed.
 1.39 11-May-1996  mycroft Make `make depend' work for libraries.
 1.38 01-Mar-1996  scottr Don't try to make dependencies for SFILES if it isn't defined.
 1.37 29-Feb-1996  cgd Do not build vnode_if.[ch] for each kernel. Build them once, like the
various syscall sources/headers, and just compile them. From PR 2142, OK'd
by mycroft.
 1.36 26-Feb-1996  mycroft Define build programs with `?=', so they can be overridden with `makeoptions'.
 1.35 09-Feb-1996  mycroft Fix mkdep problems due to missing flags.
 1.34 03-Feb-1996  mycroft config.old uses vers.o, not newvers.
 1.33 03-Feb-1996  mycroft Use `-traditional-cpp' when building .s and .S files.
 1.32 02-Feb-1996  mycroft config.old doesn't grok %SFILES.
 1.31 02-Feb-1996  mycroft Clone these, and fix many bugs.
 1.30 02-Feb-1996  mycroft assym.s -> assym.h
(Some ports did this already.)
 1.29 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.28 22-Oct-1995  thorpej We no longer need -fno-builtin; syscall namespace has been cleaned up a bit.
 1.27 18-Oct-1995  thorpej Recompile genassym if the Makefile changes.
 1.26 19-Sep-1995  thorpej branches: 1.26.2;
Compile the kernel with -fno-builtin.
 1.25 05-Aug-1995  mycroft Remove vnode_if.[ch] when cleaning.
 1.24 24-Jul-1995  mycroft Add -Werror.
 1.23 24-Jun-1995  christos Makefile.`arch`: - Add -lcompat
- Change clean: target to be a double dep one,
so libraries can use the clean target too
- Add genassym to the clean targets
 1.22 16-May-1995  jtc Removing -DKERNEL, transition to _KERNEL has been completed
 1.21 23-Mar-1995  jtc Added -D_KERNEL to CFLAGS alongside each -DKERNEL.
 1.20 26-Oct-1994  cgd new RCS ID format.
 1.19 18-Sep-1994  mycroft Make genassym depend on genassym.c
 1.18 18-Jul-1994  mycroft Add some missing options to GENERIC, and rename.
 1.17 05-Jul-1994  mycroft branches: 1.17.2;
Add FPSP magic.
 1.16 16-Jun-1994  hpeyerl Fix for vnode_if
 1.15 08-Jun-1994  mycroft Build vnode_if.o.
 1.14 23-May-1994  mycroft Merge with 4.4-Lite.
 1.13 16-Apr-1994  cgd kill symbols.{raw,sort}; no longer necessary, with kvm dbs.
 1.12 25-Jan-1994  brezak Set text address at 0
 1.11 10-Jan-1994  mycroft Nuke args to newvers.sh.
 1.10 06-Jan-1994  mycroft Don't know why LOAD_ADDRESS was ever here, but it's toast.
 1.9 13-Oct-1993  cgd deal with libkern
 1.8 16-Aug-1993  mycroft Remove *netbsd, not *vmunix.
 1.7 14-Aug-1993  mycroft Note new location of pte.h, and don't strip kernel by default.
 1.6 31-Jul-1993  mycroft Add RCS indentifiers.
 1.5 07-Jul-1993  cgd deal with make/shell strangenesses, and fix newvers problem
 1.4 29-May-1993  cgd update for "arch"
 1.3 27-May-1993  deraadt compile directory has moved, relative paths change
-DKERNEL in Makefile, not in genassym.c, same as i386
 1.2 18-May-1993  cgd pseudo-update for new config changes
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.17.2.2 06-Oct-1994  mycroft Update from trunk.
 1.17.2.1 18-Jul-1994  cgd from trunk, per charles.
 1.26.2.2 22-Oct-1995  thorpej Update from trunk; No longer need -fno-builtin.
 1.26.2.1 18-Oct-1995  thorpej Update from trunk; recompile genassym if Makefile changes.
 1.46.2.1 30-Jan-1997  thorpej update from trunk
 1.55.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.55.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.59.2.1 12-Nov-1997  thorpej Pull up "make sure tools are defined" changes from trunk.
 1.68.4.1 02-Aug-1999  thorpej Update from trunk.
 1.70.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.70.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.77.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.78.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.78.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.79.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.80.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.80.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.80.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.80.2.1 26-Oct-2001  nathanw file Makefile.hp300 was added on branch nathanw_sa on 2002-01-08 00:24:30 +0000
 1.82.8.1 14-Jul-2002  gehenna catch up with -current.
 1.84.10.1 06-Feb-2005  jmc Pull up patch (requested by martti in ticket #1086)
Move ipf to sys/dist/ipf and sync w. trunk
 1.84.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.84.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.84.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.84.6.1 03-Aug-2004  skrll Sync with HEAD
 1.87.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.87.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.87.100.1 05-Mar-2011  rmind sync with head
 1.89.30.2 22-Sep-2015  skrll Sync with HEAD
 1.89.30.1 06-Jun-2015  skrll Sync with HEAD
 1.89.12.1 03-Dec-2017  jdolecek update from HEAD
 1.93.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.93.4.1 10-Jun-2019  christos Sync with HEAD
 1.93.2.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.2 30-Jan-1997  thorpej These files are no longer needed.
 1.1 17-Dec-1996  thorpej branches: 1.1.2;
Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.1.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.8 15-May-1996  thorpej These haven't been kept up to date...
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 23-May-1994  mycroft `clock' is no longer a device.
 1.5 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.4 09-Mar-1994  ws Make FFS optional
 1.3 30-Aug-1993  deraadt pagers are now options, not pseudo-devices
 1.2 29-May-1993  cgd change kernel names where necessary, also, other minor hacks
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.16 12-Dec-2020  tsutsui Remove options (NVNODE, NBUF, and BUFPAGES) for small RAM machines.

These options make extracting binary sets much slower even on miniroot.
Instead, use "options BUFCACHE=5" (use 5% of memory for buffercache) and
also specify "-fno-unwind-tables" for COPTS to shrink INSTALL kernel.

Worth to pullup to netbsd-9.
 1.15 29-Dec-2015  christos branches: 1.15.22; 1.15.30;
Holiday food satiation.
 1.14 29-Apr-2014  tsutsui branches: 1.14.4;
Disable options NVNODE, NBUF and BUFPAGES in the RAMDISK kernel.

These options were specified in the INSTALL kernel for 4MB machines,
but nowadays even the INSTALL kernel would not boot on such machines
and the RAMDISK kernel assumes the target machine has more memories.
Furthermore, these options makes extracting binary sets much slower
and also could cause "wapbl_register_deallocation: out of resources"
panic during extracting binaries into a 32GB SSD with 4KB fragments.

Should be pulled up to netbsd-6* branches.
 1.13 23-Nov-2010  hannken branches: 1.13.8; 1.13.14; 1.13.18; 1.13.22; 1.13.32;
Remove unused count from pseudo-device md.
 1.12 06-Feb-2009  jym branches: 1.12.6;
Changes to MEMORY_RBFLAGS option:
- renamed to MEMORY_DISK_RBFLAGS to better fit the rest of the
MEMORY_DISK options(4)
- change default value to RB_AUTOBOOT instead of RB_SINGLE, and adapt
the config(5) files accordingly
- document this option inside options(4)

See also http://mail-index.netbsd.org/tech-kern/2008/12/25/msg003924.html

Reviewed by abs@ in private mail.
 1.11 26-May-2008  he branches: 1.11.6;
Bump ramdisk size from 1.5M to 1.6M to compensate for recent bloat.
 1.10 23-Feb-2003  he branches: 1.10.104; 1.10.106; 1.10.108; 1.10.110;
Bump ramdisk image size from 1444k to 1500k.
 1.9 23-Jan-2003  jdolecek ramdisk image overflew, bump by 4K
 1.8 22-Apr-2002  gmcgarry Bump ramdisk size.
 1.7 02-Apr-2002  gmcgarry cosmetic formatting
 1.6 02-Apr-2002  lukem Rename MEMORY_DISK_SIZE (formerly MINIROOTSIZE) to MEMORY_DISK_ROOT_SIZE,
which was suggested by Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> as
being more consistent with what it's controlling...
 1.5 17-Mar-2002  gmcgarry Include MFS in the INSTALL kernel for the miniroot install.
 1.4 10-Mar-2002  lukem branches: 1.4.2;
* rename MINIROOTSIZE to MEMORY_DISK_SIZE, so that all md(4) options
are now consistently named
* fold opt_mdsize.h into opt_md.h
 1.3 23-Feb-2002  gmcgarry branches: 1.3.2;
Trim down to 1.2MB ramdisk for booting on 4MB machines.
 1.2 13-Feb-2002  gmcgarry Bump ramdisk to 2MB.
 1.1 10-Feb-2002  gmcgarry Up-to-date kernels for installation media.
 1.3.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.3.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.3.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.2.1 23-Feb-2002  nathanw file RAMDISK was added on branch nathanw_sa on 2002-02-28 04:09:23 +0000
 1.4.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.4.2.1 10-Mar-2002  jdolecek file RAMDISK was added on branch kqueue on 2002-03-16 15:57:33 +0000
 1.10.110.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.10.108.1 04-May-2009  yamt sync with head.
 1.10.106.1 04-Jun-2008  yamt sync with head
 1.10.104.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.6.1 03-Mar-2009  skrll Sync with HEAD.
 1.12.6.1 05-Mar-2011  rmind sync with head
 1.13.32.1 10-Aug-2014  tls Rebase.
 1.13.22.1 18-May-2014  rmind sync with head
 1.13.18.2 03-Dec-2017  jdolecek update from HEAD
 1.13.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.14.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1057):
sys/arch/hp300/conf/RAMDISK: revision 1.14
sys/arch/hp300/conf/INSTALL: revision 1.57
Add "pseudo-device wsmux" in INSTALL (and RAMDISK) kernels.
On NetBSD/hp300, hilkbd(4) is probed in config_interrupts(9)
so it's always attached after wsdisplay(4). In that case,
wskbd can't be used as a console input device without wsmux(4).
(i.e. keyboard didn't work on installer using screen console)
Should be pulled up to all netbsd-6* branches.
Disable options NVNODE, NBUF and BUFPAGES in the RAMDISK kernel.
These options were specified in the INSTALL kernel for 4MB machines,
but nowadays even the INSTALL kernel would not boot on such machines
and the RAMDISK kernel assumes the target machine has more memories.
Furthermore, these options makes extracting binary sets much slower
and also could cause "wapbl_register_deallocation: out of resources"
panic during extracting binaries into a 32GB SSD with 4KB fragments.
Should be pulled up to netbsd-6* branches.
 1.13.8.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.4.1 19-Mar-2016  skrll Sync with HEAD
 1.15.30.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.15.22.1 14-Dec-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #1152):

sys/arch/hp300/conf/RAMDISK: revision 1.16
sys/arch/hp300/conf/INSTALL: revision 1.66

Remove options (NVNODE, NBUF, and BUFPAGES) for small RAM machines.

These options make extracting binary sets much slower even on miniroot.

Instead, use "options BUFCACHE=5" (use 5% of memory for buffercache) and
also specify "-fno-unwind-tables" for COPTS to shrink INSTALL kernel.

Worth to pullup to netbsd-9.
 1.4 10-Aug-1993  mycroft Clean up deleted files.
 1.3 07-Aug-1993  mycroft Add PANICWAIT.
 1.2 07-Aug-1993  mycroft Add RCS identifier.
 1.1 07-Aug-1993  mycroft Add config file for my test machine.
 1.5 28-Apr-1995  cgd rename files files for new config/config.old naming
 1.4 07-Jan-1995  mycroft Add mt.
 1.3 17-Aug-1994  mycroft vn --> vnd
 1.2 24-Jun-1994  hpeyerl branches: 1.2.2;
Changes for ccd.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.2.2.1 17-Aug-1994  mycroft update from trunk
 1.5 30-Jan-1997  thorpej These files are no longer needed.
 1.4 07-Jan-1995  mycroft Add mt.
 1.3 17-Aug-1994  mycroft vn --> vnd
 1.2 24-Jun-1994  hpeyerl branches: 1.2.2;
Changes for ccd.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.2.2.1 17-Aug-1994  mycroft update from trunk
 1.98 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.97 18-Jan-2024  thorpej branches: 1.97.2;
Make the M68K_MMU_* defines real kernel options, available in opt_m68k_arch.h.
For 68030, 68040, and 68060, infer M68K_MMU_MOTOROLA. For 68010 and 68020, it
must be an explicit option (set in std.${MACHINE} or, in the case of hp300,
inferred from the specific model option).
 1.96 18-Jan-2024  thorpej Rather than testing for and defining the M680x0 CPU option in
hp300spu.h, make the individual model options (e.g. HP320, HP425,
etc.) declare a dependency on the correponding M680x0 options.
This makes them appear correctly in opt_m68k_arch.h rather than
having to pull in all of <machine/cpu.h>.
 1.95 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.94 13-Jan-2024  thorpej Switch hp300 over to the common m68k vector table.
 1.93 09-Jan-2024  thorpej Remove duplicated / slightly-tweaked loadustp() (load user segment table)
routines from all of the m68k ports using the shared pmap. Instead, in
pmap_init(), set up a function pointer to the appropriate mmu_load_urp*()
function in mmu_subr.s.
 1.92 18-Feb-2019  thorpej Refactor the 68040 writeback() from each m68k port's trap handler into a
shared copy: m68040_writeback(). It is essentially a copy of the Atari
version, with some minor cosmetic tweaks and one small performance optimization
from the mvme68k port.

Tested by rjs@ on a Quadra 950. (Thanks!)
 1.91 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.90 25-Feb-2018  mrg branches: 1.90.2; 1.90.4;
add a special rule to build m68k/fpu.c to avoid passing -msoft-float.
fixes GCC 6 kernel builds that use this file.
 1.89 24-Aug-2014  tsutsui Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.

The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.

The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
 1.88 20-Apr-2014  tsutsui branches: 1.88.2;
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.

The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.

Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.

Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).

XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
 1.87 19-Apr-2014  tsutsui Add proper RealTime Clock support for HP9000/425e.

As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.

Tested on HP425e (with mcclock) and HP362 (with old rtc).
 1.86 16-Aug-2013  tsutsui branches: 1.86.2;
Make FPU_EMULATE work on NetBSD/hp300. Commented out by default in GENERIC.

Tested on HP9000/362 without optional MC68882 FPU in its socket.
 1.85 12-Jun-2011  rmind branches: 1.85.2; 1.85.8; 1.85.12; 1.85.16;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.84 21-May-2011  tsutsui branches: 1.84.2;
Add sti at sgc configuration for SGC EVRX framebuffers found on
some later HP4xx models. Untested, and disabled in GENERIC for now.
 1.83 18-Feb-2011  tsutsui sgc takes slot, not scode.
 1.82 12-Feb-2011  tsutsui Pull Apollo Domain keyboard and mouse support from OpenBSD.
Untested (no hardware), but no bad sideeffect on 425t without Domain keyboard.

This is the last portion of "new hp300 kernel features" submitted in
PR port-hp300/3528 back in 1997, and I think finally we can close it.
 1.81 12-Feb-2011  tsutsui Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.
 1.80 12-Feb-2011  tsutsui Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.79 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.78 31-Dec-2007  ad branches: 1.78.32; 1.78.38; 1.78.40;
Remove COMPAT_HPUX.
 1.77 03-Dec-2007  ad branches: 1.77.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.76 04-Mar-2007  tsutsui branches: 1.76.2; 1.76.18; 1.76.20; 1.76.26;
Make hp300 use common m68k/softintr.c.
 1.75 20-Jul-2006  tsutsui branches: 1.75.10;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.74 11-Dec-2005  christos branches: 1.74.4; 1.74.8;
merge ktrace-lwp.
 1.73 07-Dec-2004  chs branches: 1.73.12;
use the m68k-common procfs_machdep.c on all m68k platforms.
 1.72 14-Sep-2004  jdolecek do not include "compat/aout/files.aout", COMPAT_AOUT is soon to be removed
 1.71 28-Aug-2004  thorpej Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
 1.70 07-Jul-2004  mycroft Move spc into the MI area.
 1.69 08-Nov-2003  tsutsui Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.68 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.67 27-Jul-2003  thorpej Since everyone uses clock_subr.c (or should, if they don't currently),
list it in conf/files instead of in every port's files.*.
 1.66 28-Jun-2003  he branches: 1.66.2;
Defflag PANICBUTTON, now that machdep.h includes opt_panicbutton.h.
 1.65 24-May-2003  gmcgarry Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.64 06-Mar-2003  thorpej * No need for an interface attribute on "dma".
* Take the "dma" attribute off fhpib and nhpib, so that leaving out "dma"
causes a compile-time error, rather than a run-time crash.
 1.63 22-Dec-2002  gmcgarry Make the DMA controller a separate device attached to intio. Intio
devices can use the DMA controller too.
 1.62 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.61 03-Nov-2002  chs use a merged sys_machdep.c for all the motorola-MMU m68k platforms.
 1.60 03-Nov-2002  chs merge all the m68k copies of kgdb_machdep.c.
 1.59 02-Nov-2002  chs enhance the common m68k db_memrw.c to handle read-only kernel text
and switch all the motorola-MMU m68k platforms to use it.
 1.58 26-Oct-2002  jdolecek now that mem_no is emitted by config(8), there is no reason to keep
copy of more or less identical iskmemdev() for every arch; move the function
to spec_vnop.c, and g/c machine-dependant copies
 1.57 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.56 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.55 23-Feb-2002  gmcgarry branches: 1.55.8;
Recognise md as a valid root device. And since md disks don't get
device_register()'d, don't go looking on our device list for them.
Ramdisk kernel now boot.
 1.54 21-Jan-2002  jdolecek Switch to MI dev/md_root.c for archs which don't have any special
memory disk hooks (i.e. everything except atari).
 1.53 14-Dec-2001  gmcgarry Arrange in correct order.
 1.52 08-Dec-2001  gmcgarry softintr(9) interface for hp300
 1.51 02-Dec-2001  gmcgarry Don't use dev/cninit.c, since we have our own custom implementation.
 1.50 28-Nov-2001  lukem - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
"options FOO=xxx"). options that take a value were converted to
defparam recently.
- minor whitespace & formatting cleanups
 1.49 20-Nov-2001  lukem - replace "defopt" with "defparam" for options which must take a value,
as config(8) will warn for value-less defparam options
- minor whitespace/formatting cleanup
- consolidate opt_tcp_recvspace.h and opt_tcp_sendspace.h into opt_tcp_space.h
 1.48 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.47 17-Nov-2001  gmcgarry Update for new RTC and HIL attachments.
 1.46 11-Oct-2001  tsutsui branches: 1.46.4;
hp300 now uses dev/clock_subr.c.
 1.45 18-Jun-2001  christos branches: 1.45.2;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.44 17-Jan-2001  fvdl branches: 1.44.2;
Add machdep file for procfs. Currently only used for linux-style
/proc/cpuinfo (only active when procfs is mounted with -o linux).
For ports other than the i386 this currently produces an empty
string.
 1.43 02-Jan-2001  simonb Add ELF support.

Thanks to Steve Woodford for his help!
 1.42 14-Mar-2000  oster Add the RAIDframe device major to the machine-dependent config files
so that the right entries get added to dev_name2blk[]. Needed for / on RAID.
(Whoops! I missed checking these in when adding the RAID_AUTOCONFIG stuff.)
 1.41 31-Jul-1999  thorpej branches: 1.41.2;
defopt HP385.
 1.40 07-Jun-1999  thorpej Only declare block major numbers for devices which can be the root device.
 1.39 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.38 15-Dec-1998  itohy branches: 1.38.4;
Added COMPAT_LINUX support.
 1.37 21-Jul-1998  drochner adapt to LANCE driver split
 1.36 15-Jul-1998  thorpej Remove the raw HYPERchannel kludge.
 1.35 31-May-1998  thorpej Build pmap_boostrap.o without profiling; we can't call mcount before the
mmu is enabled!
 1.34 16-Feb-1998  thorpej Remove "class" declarations, and add "devclass" declarations where
appropriate. Fix several inconsistencies between device class and
attributes. Mostly from Chris Demetriou.
 1.33 01-Feb-1998  is Amiga uses the common m68k/sig_machdep.c now. Also moved its definition from
the other 68k ports' files.${port} to arch/m68k/conf/files.m68k.
 1.32 12-Jan-1998  thorpej Put SPU options in opt_spuconf.h, add device classes.
 1.31 11-Jan-1998  thorpej Add bus_space.c
 1.30 05-Oct-1997  carrel Bring sunos compat files in when COMPAT_SUNOS defined
 1.29 21-Sep-1997  thorpej Glue in memory_disk_hooks.
 1.28 12-May-1997  thorpej branches: 1.28.4;
Add apci driver glue.
 1.27 05-May-1997  thorpej - Make "USELEDS" a defopt'd option, so we can generate dependencies on
it. Conditionally compile leds.c on USELEDS.
- Rearrange mainbus and intio declarations slightly.
- Add declaration for the forthcoming "frodo" driver.
 1.26 27-Apr-1997  thorpej Generate option headers for SPU type options, so that we may generate
dependencies on them.
 1.25 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.24 09-Apr-1997  thorpej - Remove redundant file directives
- Pull in m68k/m68k/sig_machdep.c
 1.23 17-Mar-1997  gwr Separate bcopy and copypage stuff from copy.s
 1.22 30-Jan-1997  scottr Add missing major number decls, from Klaus Klein (closes PR 3165).
 1.21 30-Jan-1997  thorpej Garbage-collect some uneeded stuff now that we're new config only.
 1.20 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.19 28-Apr-1995  cgd rename files files for new config/config.old naming
 1.18 11-Apr-1995  mellon Reference cninit.c as well as cons.c
 1.17 08-Feb-1995  mycroft Include common m68k version of copy.s.
 1.16 07-Jan-1995  mycroft Add mt.
 1.15 26-Oct-1994  cgd new RCS ID format.
 1.14 03-Jun-1994  hpeyerl Tell config we need .h files for sd/ct/rd/st
 1.13 25-May-1994  mycroft Add some stuff.
 1.12 23-May-1994  mycroft `clock' is no longer a device.
 1.11 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.10 06-Feb-1994  mycroft Fix typo.
 1.9 06-Feb-1994  mycroft Use common version of cons.c.
 1.8 08-Jan-1994  cgd trim files which are now common.
 1.7 06-Jan-1994  mycroft Implement procfs stubs.
 1.6 21-Dec-1993  brezak Use machine independant vn.c
 1.5 07-Jul-1993  cgd sd and st are "device-driver" under new scheme
 1.4 29-May-1993  cgd make it work with new config. still needs some cleanup
 1.3 20-May-1993  deraadt First cut at cpu independent disklabels.
There will be niggly little details no doubt..
 1.2 18-May-1993  cgd pseudo-update for new config changes
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.28.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.28.4.1 29-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.38.4.2 02-Aug-1999  thorpej Update from trunk.
 1.38.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.41.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.41.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.41.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.44.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.45.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.45.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.45.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.45.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.46.4.6 29-Dec-2002  thorpej Sync with HEAD.
 1.46.4.5 11-Nov-2002  nathanw Catch up to -current
 1.46.4.4 17-Sep-2002  nathanw Catch up to -current.
 1.46.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.46.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.46.4.1 11-Oct-2001  nathanw file files.hp300 was added on branch nathanw_sa on 2002-01-08 00:24:31 +0000
 1.55.8.2 17-May-2002  gehenna Remove old block majors list.
 1.55.8.1 16-May-2002  gehenna Include the list of block/character major numbers.
 1.66.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.66.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.66.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.66.2.2 03-Sep-2004  skrll Sync with HEAD
 1.66.2.1 03-Aug-2004  skrll Sync with HEAD
 1.73.12.4 21-Jan-2008  yamt sync with head
 1.73.12.3 07-Dec-2007  yamt sync with head
 1.73.12.2 03-Sep-2007  yamt sync with head.
 1.73.12.1 30-Dec-2006  yamt sync with head.
 1.74.8.1 11-Aug-2006  yamt sync with head
 1.74.4.1 09-Sep-2006  rpaulo sync with head
 1.75.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.76.26.2 18-Feb-2008  mjf Sync with HEAD.
 1.76.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.76.20.1 09-Jan-2008  matt sync with HEAD
 1.76.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.76.2.1 03-Dec-2007  ad Sync with HEAD.
 1.77.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.78.40.3 05-Mar-2011  bouyer Sync with HEAD
 1.78.40.2 17-Feb-2011  bouyer Sync with HEAD
 1.78.40.1 08-Feb-2011  bouyer Sync with HEAD
 1.78.38.1 06-Jun-2011  jruoho Sync with HEAD.
 1.78.32.3 31-May-2011  rmind sync with head
 1.78.32.2 05-Mar-2011  rmind sync with head
 1.78.32.1 18-Mar-2010  rmind Unify /dev/{mem,kmem,zero,null} implementations in MI code. Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
 1.84.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.85.16.2 18-May-2014  rmind sync with head
 1.85.16.1 28-Aug-2013  rmind sync with head
 1.85.12.2 03-Dec-2017  jdolecek update from HEAD
 1.85.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.85.8.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.85.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.86.2.1 10-Aug-2014  tls Rebase.
 1.88.2.1 29-Aug-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #62):
sys/arch/hp300/conf/files.hp300: revision 1.89
share/man/man4/arcofi.4: revision 1.1
share/man/man4/arcofi.4: revision 1.2
share/man/man4/Makefile: revision 1.617
sys/arch/hp300/hp300/intr.c: revision 1.41
sys/conf/files: revision 1.1100
sys/arch/hp300/hp300/locore.s: revision 1.171
distrib/sets/lists/man/mi: revision 1.1486
sys/dev/ic/arcofivar.h: revision 1.1
sys/arch/hp300/conf/majors.hp300: revision 1.26
sys/arch/hp300/dev/arcofi_dio.c: revision 1.1
sys/arch/hp300/conf/GENERIC: revision 1.188
sys/dev/ic/arcofi.c: revision 1.1
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.
The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.
The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
Add a man page for arcofi(4) driver. From OpenBSD.
Fix date.
 1.90.4.1 10-Jun-2019  christos Sync with HEAD
 1.90.2.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.97.2.1 02-Aug-2025  perseant Sync with HEAD
 1.31 30-Jan-1997  thorpej These files are no longer needed.
 1.30 05-Jan-1997  thorpej Oops, build dio.o in the old config case, too. Pointed out by
Dave Carrel <carrel@cisco.com>.
 1.29 15-Oct-1996  thorpej Use the hp300 version of db_memrw.c (forgot to commit this change the
other day).
 1.28 07-Sep-1996  thorpej Don't `config-dependent' machdep.c; we already depend on the Makefile,
which accomplishes the same thing.
 1.27 10-Jun-1996  thorpej Add "needs-count" to the `ac' driver so an ac.h file gets generated.
 1.26 07-May-1996  thorpej branches: 1.26.4;
Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.
 1.25 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.24 22-Feb-1996  gwr Add m68k/db_memrw.c
 1.23 14-Feb-1996  thorpej Compile the new interrupt handling code.
 1.22 08-Jan-1996  thorpej Oops, compile hpux_machdep.c if COMPAT_HPUX. Forgetfulness pointed
out by Dave Carrel.
 1.21 28-Nov-1995  thorpej Compile compat/hpux/hpux_exec.c and compat/hpux/hpux_file.c if COMPAT_HPUX
is defined.
 1.20 18-Aug-1995  thorpej Haven't had hpfplib for a long time.
 1.19 10-May-1995  christos Fixed compat hpux files.
 1.18 11-Apr-1995  mellon Reference cninit.c as well as cons.c
 1.17 08-Feb-1995  mycroft Include common m68k version of copy.s.
 1.16 07-Jan-1995  mycroft Add mt.
 1.15 26-Oct-1994  cgd new RCS ID format.
 1.14 03-Jun-1994  hpeyerl Tell config we need .h files for sd/ct/rd/st
 1.13 25-May-1994  mycroft Add some stuff.
 1.12 23-May-1994  mycroft `clock' is no longer a device.
 1.11 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.10 06-Feb-1994  mycroft Fix typo.
 1.9 06-Feb-1994  mycroft Use common version of cons.c.
 1.8 08-Jan-1994  cgd trim files which are now common.
 1.7 06-Jan-1994  mycroft Implement procfs stubs.
 1.6 21-Dec-1993  brezak Use machine independant vn.c
 1.5 07-Jul-1993  cgd sd and st are "device-driver" under new scheme
 1.4 29-May-1993  cgd make it work with new config. still needs some cleanup
 1.3 20-May-1993  deraadt First cut at cpu independent disklabels.
There will be niggly little details no doubt..
 1.2 18-May-1993  cgd pseudo-update for new config changes
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.26.4.1 10-Jun-1996  thorpej Update from trunk:

Add "needs-count" to the `ac' driver so an ac.h file gets generated.
 1.29 04-Apr-2020  jdolecek mark nsmb major obsolete
 1.28 28-Jan-2019  dholland Systematize handling of removed drivers.

- Every driver that was removed and whose number hasn't already been
reused is now listed with a commented-out "obsolete" line.
- The format of these has been systematized. Future format changes can
probably be safely done with a script.
- This does not include a few cases of assignments that only lasted a
couple days, or stuff from before major reorgs. Some of these may
be included nonetheless, because there was a lot of ground to cover
and therefore not a lot of time to dig into history in detail.

Note that the obsolete listings do not mean the major numbers can
never be reused; that's up to portmasters and/or core. It does mean
that they won't be reused by accident, however, which in some cases
(depending on the driver, how widely used it was, its family of device
nodes, their default permissions, etc.) can be quite dangerous.

Note that some of the things now explicitly listed as obsolete are
really ancient history. My scan went back as far as when the majors
files were added. (But not before that.)
 1.27 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.26 24-Aug-2014  tsutsui branches: 1.26.18; 1.26.20;
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.

The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.

The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
 1.25 30-Jun-2011  wiz branches: 1.25.12; 1.25.28;
dependant -> dependent
 1.24 06-Mar-2011  tsutsui Remove trailing spaces.
 1.23 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.22 12-Nov-2008  ad branches: 1.22.8; 1.22.10; 1.22.12;
Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.21 31-Dec-2007  ad branches: 1.21.6; 1.21.10; 1.21.16; 1.21.18;
Remove systrace. Ok core@.
 1.20 24-Nov-2006  wiz branches: 1.20.28; 1.20.34; 1.20.42;
s/independant/independent/, from Zafer.
 1.19 11-Dec-2005  christos branches: 1.19.20; 1.19.22;
merge ktrace-lwp.
 1.18 17-Sep-2005  yamt make VMSWAP optional again.
 1.17 31-Jul-2005  yamt revert "defflag VMSWAP" changes for now.
there seems to be far more people who don't want to edit
their kernel config files than i thought.
 1.16 30-Jul-2005  yamt defflag VMSWAP.
 1.15 10-May-2005  jdolecek branches: 1.15.2;
assign major for nsmb(4)
 1.14 10-Dec-2003  jmc Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
 1.13 08-Nov-2003  tsutsui Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.12 24-Oct-2003  jdolecek add major for 'ses' for archs which have the other scsi devices
 1.11 10-Oct-2003  jdolecek reassing majors for crypto and pf to use the newly defined MI major
range
 1.10 10-Oct-2003  jdolecek update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
 1.9 05-Oct-2003  jdolecek Add some framework for MI assignment of device majors - add sys/dev/majors
which is automatically included during kernel config, and add comments
to individual machine-dependant majors.* files to assign new MI majors
in MI file.

Range 0-191 is reserved for machine-specific assignments, range
192+ are MI assignments.

Follows recent discussion on tech-kern@
 1.8 22-Aug-2003  itojun create /dev/crypto
 1.7 01-Aug-2003  tsutsui Add majors for MI SCSI devices (cd, ch, ss, and uk).
 1.6 01-Aug-2003  tsutsui Reserve some major numbers for wscons, as per comments in hp300/conf.c
(which is in Attic) rev 1.47.
 1.5 27-Jul-2003  itojun reserve cdev major # for PF. ok'ed by technical-exec
 1.4 25-Apr-2003  ragge branches: 1.4.2;
Add ksyms device major.
 1.3 04-Oct-2002  elric branches: 1.3.2;
assign majors for raw and cooked cgd's.
 1.2 06-Sep-2002  gehenna branches: 1.2.2;
Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.1 16-May-2002  gehenna branches: 1.1.2;
file majors.hp300 was initially added on branch gehenna-devsw.
 1.1.2.3 14-Jul-2002  gehenna catch up with -current.
 1.1.2.2 30-May-2002  gehenna Add $NetBSD$
 1.1.2.1 16-May-2002  gehenna Add the list of block/character majors.
 1.2.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.2.2.1 06-Sep-2002  nathanw file majors.hp300 was added on branch nathanw_sa on 2002-09-17 21:14:27 +0000
 1.3.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.2.1 04-Oct-2002  jdolecek file majors.hp300 was added on branch kqueue on 2002-10-10 18:32:36 +0000
 1.4.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.15.2.3 21-Jan-2008  yamt sync with head
 1.15.2.2 30-Dec-2006  yamt sync with head.
 1.15.2.1 21-Jun-2006  yamt sync with head.
 1.19.22.1 10-Dec-2006  yamt sync with head.
 1.19.20.1 12-Jan-2007  ad Sync with head.
 1.20.42.1 02-Jan-2008  bouyer Sync with HEAD
 1.20.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.20.28.1 09-Jan-2008  matt sync with HEAD
 1.21.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.21.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.21.10.1 04-May-2009  yamt sync with head.
 1.21.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.22.12.1 08-Feb-2011  bouyer Sync with HEAD
 1.22.10.1 06-Jun-2011  jruoho Sync with HEAD.
 1.22.8.2 21-Apr-2011  rmind sync with head
 1.22.8.1 05-Mar-2011  rmind sync with head
 1.25.28.1 29-Aug-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #62):
sys/arch/hp300/conf/files.hp300: revision 1.89
share/man/man4/arcofi.4: revision 1.1
share/man/man4/arcofi.4: revision 1.2
share/man/man4/Makefile: revision 1.617
sys/arch/hp300/hp300/intr.c: revision 1.41
sys/conf/files: revision 1.1100
sys/arch/hp300/hp300/locore.s: revision 1.171
distrib/sets/lists/man/mi: revision 1.1486
sys/dev/ic/arcofivar.h: revision 1.1
sys/arch/hp300/conf/majors.hp300: revision 1.26
sys/arch/hp300/dev/arcofi_dio.c: revision 1.1
sys/arch/hp300/conf/GENERIC: revision 1.188
sys/dev/ic/arcofi.c: revision 1.1
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.
The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.
The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
Add a man page for arcofi(4) driver. From OpenBSD.
Fix date.
 1.25.12.1 03-Dec-2017  jdolecek update from HEAD
 1.26.20.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.26.20.1 10-Jun-2019  christos Sync with HEAD
 1.26.18.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.11 19-Sep-2010  tsutsui - add m68k/conf/std.m68k, which includes common standard options for m68k,
options EXEC_ELF32, EXEC_SCRIPTS, and CPU_IN_CKSUM for md cpu_in_cksum.c
- make all m68k ports include common arch/m68k/conf/std.m68k
from MD std.${MACHINE}
 1.10 11-Dec-2005  christos branches: 1.10.78; 1.10.98; 1.10.100;
merge ktrace-lwp.
 1.9 17-Sep-2005  yamt include "conf/std".
 1.8 02-Jan-2001  simonb branches: 1.8.24; 1.8.40;
Add ELF support.

Thanks to Steve Woodford for his help!
 1.7 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.6 15-Nov-1999  fvdl branches: 1.6.4;
Add

prefix ../gnu/sys
cinclude "conf/files.softdep"
prefix

to all std.* files, so that soft dependencies can be activated using
"options SOFTDEP".
 1.5 12-Sep-1999  chs branches: 1.5.2; 1.5.8;
eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
 1.4 24-Mar-1999  mrg clean up kernel/config files files for machVM lossage.
 1.3 04-May-1998  thorpej Switch to UVM.
 1.2 30-Jan-1997  thorpej Garbage-collect some uneeded stuff now that we're new config only.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.5.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.4.1 23-Jun-2000  fvdl As on the trunk, update these for the move of ffs_softdep.c into the
kernel source itself. Remove prefix construction, and add the SOFTDEP
option to GENERIC kernels.
 1.8.40.1 21-Jun-2006  yamt sync with head.
 1.8.24.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.100.1 05-Mar-2011  rmind sync with head
 1.10.98.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.10.78.1 09-Oct-2010  yamt sync with head
 1.5 10-Jan-2014  christos don't include bsd.sys.mk
 1.4 28-Dec-2010  tsutsui branches: 1.4.8; 1.4.18; 1.4.22;
Include <bsd.own.mk> to pull ${TOOL_AWK}.
 1.3 19-Oct-2008  apb branches: 1.3.16;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.2 30-Jan-1997  thorpej branches: 1.2.162; 1.2.166; 1.2.172;
Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.2.172.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.2.166.1 04-May-2009  yamt sync with head.
 1.2.162.1 17-Jan-2009  mjf Sync with HEAD.
 1.3.16.1 05-Mar-2011  rmind sync with head
 1.4.22.1 18-May-2014  rmind sync with head
 1.4.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.8.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 23-May-1994  mycroft Clean up deleted files.
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.21 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.20 29-Jun-2003  fvdl branches: 1.20.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.19 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.18 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.17 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.14 15-Mar-2002  gmcgarry branches: 1.14.4;
malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.13 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.12 19-May-2000  thorpej branches: 1.12.6; 1.12.8; 1.12.12;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.11 12-Jan-1998  thorpej branches: 1.11.14;
Update for changes to config.
 1.10 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.9 02-Apr-1997  scottr branches: 1.9.4;
Fix printf() and other warnings when compiled with DEBUG defined.
 1.8 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.7 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.6 13-Oct-1996  christos backout previous kprintf changes
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.3 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.9.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.12.5 11-Nov-2002  nathanw Catch up to -current
 1.12.12.4 18-Oct-2002  nathanw Catch up to -current.
 1.12.12.3 17-Sep-2002  nathanw Catch up to -current.
 1.12.12.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.12.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.12.8.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.12.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.14.4.1 17-May-2002  gehenna Add device switch.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.2 26-Oct-1994  cgd branches: 1.2.66;
new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.5 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.4 31-Mar-1997  scottr branches: 1.4.34; 1.4.56;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.3 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.4.56.1 03-Aug-2004  skrll Sync with HEAD
 1.4.34.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.26 08-Nov-2003  tsutsui Remove obsolete files by MI com(4) driver support.
 1.25 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.24 29-Jun-2003  fvdl branches: 1.24.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.23 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.22 06-Mar-2003  thorpej Update for consdev changes.
 1.21 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.20 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.19 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.18 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.17 17-Apr-2002  gmcgarry branches: 1.17.2;
Don't frob MCR_IEN bit if on a 425e. Problem initially reported
by Christoph Badura:

It looks to me like the 425e uses reverse polarity of the MCR_IEN bit with
respect to the other 4xx models. That could be because it doesn't have
an inverter wired behind the IEN(OUT2) output of the UART.

Fix is inspired by change in OpenBSD. Serial console input is
confirmed working on 425e by Thilo Manske.
 1.16 17-Apr-2002  gmcgarry Attach apci console as an intio device, not a dio device.
Fixes console attach on 425e noted by Thilo Manske.
 1.15 17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.14 15-Mar-2002  gmcgarry Add RCSIDs.
 1.13 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.12 12-Jun-2001  wiz branches: 1.12.2; 1.12.4; 1.12.8;
receive, not recieve
 1.11 02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.10 27-Nov-2000  jdolecek branches: 1.10.2;
Replace the (no longer working) check for tp->t_line == 0 with
tp->t_linesw == linesw[0]. Hopefully this is correct.
 1.9 02-Nov-2000  eeh Adapt to the new line discipline scheme.
 1.8 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.7 10-Sep-1999  bad branches: 1.7.2;
In apciparam() in the ospeed == 0 case, actually set the cfcr to the new
value.
 1.6 01-Aug-1999  thorpej Fix APCI console initialization; we were forgetting to update cn_tab.

From Christoph Badura.
 1.5 31-Jul-1999  thorpej Nuke apcicheckdca(). Since "serial 1" only exists as an APCI serial
port on the 425e, key off that instead.
 1.4 28-Mar-1998  thorpej branches: 1.4.10;
Adjust for recent ttyopen() and dialout device changes.
 1.3 12-Jan-1998  thorpej Update for changes to config.
 1.2 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 12-May-1997  thorpej branches: 1.1.4;
Add a kernel driver for the APCI 8250-like UARTs that live in the
Frodo ASIC, originally contributed by Mike Smith
<mike@pressed.spam.frisbee.net.au>, but reworked by me to:
- Essentially duplicate the dca driver, modifiying where necessary
to work with the APCI.
- Deal with the different Frodo autoconfiguration model.
- Don't attach a tty to the 0th UART - it's not really useful for much
more than the Domain keyboard.
- Added a routine to check for the existence of a DCA at select code 9.
On most models, the 1'th UART is mapped to select code 9 by the PROM,
and on these models, we do _NOT_ want to attach the device as an APCI.
However, on the 425e, this mapping does not take place, so we attach
as an APCI. The 2'th and 3'th UARTs always get tty instances.
- Add console support which will only be invoked on the 425e (i.e. check
for DCA at 9, and defer console to it if it exists).
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.10.1 02-Aug-1999  thorpej Update from trunk.
 1.7.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.7.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.7.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.8.7 11-Nov-2002  nathanw Catch up to -current
 1.12.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.12.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.12.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.12.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.12.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.12.8.1 12-Jun-2001  nathanw file apci.c was added on branch nathanw_sa on 2002-01-08 00:24:31 +0000
 1.12.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.12.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.12.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.12.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.17.2.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3 08-Nov-2003  tsutsui Move apcireg.h and dcareg.h to stand/common since they are no longer used
by kernel.
 1.2 12-May-1997  thorpej branches: 1.2.56;
Garbage-collect an unneeded definition.
 1.1 14-Apr-1997  thorpej Regsiter description for APCI UART found on HP 9000/400-series
systems with a Frodo Utility Chip. This is essientially an 8250 with
3 bytes of padding between each register. From mike smith
<miff@spam.frisbee.net.au>.
 1.2.56.1 03-Aug-2004  skrll Sync with HEAD
 1.3 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.2 08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.1 24-Aug-2014  tsutsui branches: 1.1.2; 1.1.20; 1.1.24; 1.1.26;
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.

The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.

The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
 1.1.26.2 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.1.26.1 21-Apr-2019  isaki Adapt to audio2.
- Use mulaw as default format. HW supports slinear_be:16 actually
but it's hard to use due to several hardware restrictions.
- Improve data transfer and interrupt.
Tested by tsutsui@ (a few months ago). Thank you.
 1.1.24.1 10-Jun-2019  christos Sync with HEAD
 1.1.20.2 03-Dec-2017  jdolecek update from HEAD
 1.1.20.1 24-Aug-2014  jdolecek file arcofi_dio.c was added on branch tls-maxphys on 2017-12-03 11:36:13 +0000
 1.1.2.2 29-Aug-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #62):
sys/arch/hp300/conf/files.hp300: revision 1.89
share/man/man4/arcofi.4: revision 1.1
share/man/man4/arcofi.4: revision 1.2
share/man/man4/Makefile: revision 1.617
sys/arch/hp300/hp300/intr.c: revision 1.41
sys/conf/files: revision 1.1100
sys/arch/hp300/hp300/locore.s: revision 1.171
distrib/sets/lists/man/mi: revision 1.1486
sys/dev/ic/arcofivar.h: revision 1.1
sys/arch/hp300/conf/majors.hp300: revision 1.26
sys/arch/hp300/dev/arcofi_dio.c: revision 1.1
sys/arch/hp300/conf/GENERIC: revision 1.188
sys/dev/ic/arcofi.c: revision 1.1
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.
The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.
The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
Add a man page for arcofi(4) driver. From OpenBSD.
Fix date.
 1.1.2.1 24-Aug-2014  martin file arcofi_dio.c was added on branch netbsd-7 on 2014-08-29 11:42:15 +0000
 1.6 06-Jun-1994  mycroft Clean up deleted files.
 1.5 11-May-1994  mycroft Get rid of private *read() and *write() functions.
 1.4 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.3 11-Jan-1994  mycroft *strategy functions return void.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.3 24-Jun-1994  mycroft Clean up deleted files.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.10 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.9 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.8 28-Apr-2008  martin branches: 1.8.86; 1.8.88;
Remove clause 3 and 4 from TNF licenses
 1.7 14-Mar-2008  cube branches: 1.7.2; 1.7.4;
Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.6 03-Dec-2007  ad branches: 1.6.10; 1.6.14;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.5 13-Jul-2006  gdamore branches: 1.5.14; 1.5.32; 1.5.34; 1.5.40;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8; 1.4.16;
merge ktrace-lwp.
 1.3 02-Jan-2005  tsutsui branches: 1.3.10;
u_intNN_t -> uintNN_t
 1.2 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.1 08-Nov-2003  tsutsui branches: 1.1.4;
Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.1.4.6 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.4 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.3 03-Sep-2004  skrll Sync with HEAD
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 08-Nov-2003  skrll file com_dio.c was added on branch ktrace-lwp on 2004-08-03 10:34:22 +0000
 1.3.10.3 17-Mar-2008  yamt sync with head.
 1.3.10.2 07-Dec-2007  yamt sync with head
 1.3.10.1 30-Dec-2006  yamt sync with head.
 1.4.16.1 18-Jun-2006  gdamore COM_INIT_REGS-ify these. Compiles okay, but no real hardware test. :-)
 1.4.8.1 11-Aug-2006  yamt sync with head
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.40.1 08-Dec-2007  mjf Sync with HEAD.
 1.5.34.2 23-Mar-2008  matt sync with HEAD
 1.5.34.1 09-Jan-2008  matt sync with HEAD
 1.5.32.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.5.14.1 03-Dec-2007  ad Sync with HEAD.
 1.6.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.6.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.10.1 24-Mar-2008  keiichi sync with head.
 1.7.4.1 16-May-2008  yamt sync with head.
 1.7.2.1 18-May-2008  yamt sync with head.
 1.8.88.1 10-Jun-2019  christos Sync with HEAD
 1.8.86.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.1 08-Nov-2003  tsutsui branches: 1.1.4;
Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.1.4.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.4 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.3 03-Sep-2004  skrll Sync with HEAD
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 08-Nov-2003  skrll file com_dioreg.h was added on branch ktrace-lwp on 2004-08-03 10:34:22 +0000
 1.4 14-May-2008  tsutsui Normalize my licenses.
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.76; 1.3.78; 1.3.80;
merge ktrace-lwp.
 1.2 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.1 08-Nov-2003  tsutsui branches: 1.1.4;
Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.1.4.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.4 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.3 03-Sep-2004  skrll Sync with HEAD
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 08-Nov-2003  skrll file com_diovar.h was added on branch ktrace-lwp on 2004-08-03 10:34:22 +0000
 1.3.80.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.3.78.1 16-May-2008  yamt sync with head.
 1.3.76.1 18-May-2008  yamt sync with head.
 1.3.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.11 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.10 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.9 20-Apr-2014  tsutsui branches: 1.9.26; 1.9.28;
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.

The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.

Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.

Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).

XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
 1.8 28-Apr-2008  martin branches: 1.8.34; 1.8.40; 1.8.44; 1.8.50; 1.8.60;
Remove clause 3 and 4 from TNF licenses
 1.7 14-Mar-2008  cube branches: 1.7.2; 1.7.4;
Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.6 03-Dec-2007  ad branches: 1.6.10; 1.6.14;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.5 13-Jul-2006  gdamore branches: 1.5.14; 1.5.32; 1.5.34; 1.5.40;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8; 1.4.16;
merge ktrace-lwp.
 1.3 28-Aug-2004  thorpej branches: 1.3.12;
Use ANSI function decls, static, and const.
 1.2 10-Apr-2004  tsutsui branches: 1.2.2;
It turns out that not only HP425e but other HP4xx models also require
COM_HW_NOIEN for APCI com(4) ports.

Now I can login HP425t via both com[12] at frodo0.
 1.1 08-Nov-2003  tsutsui branches: 1.1.2;
Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.1.2.1 11-Apr-2004  jmc Pullup rev 1.2 (requested by tsutsui in ticket #116)

Adjust fd_name in struct frodo_device frodo_subdevs[]
since MD apci(4) has been switched to MI com(4).
Adjust FRODO_BASE macro since com_frodo uses bus_space_map(9)
which takes offset from intiobase instead of KVA.
It turns out that not only HP425e but other HP4xx models also require
COM_HW_NOIEN for APCI com(4) ports.
 1.2.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.3 03-Sep-2004  skrll Sync with HEAD
 1.2.2.2 03-Aug-2004  skrll Sync with HEAD
 1.2.2.1 10-Apr-2004  skrll file com_frodo.c was added on branch ktrace-lwp on 2004-08-03 10:34:22 +0000
 1.3.12.3 17-Mar-2008  yamt sync with head.
 1.3.12.2 07-Dec-2007  yamt sync with head
 1.3.12.1 30-Dec-2006  yamt sync with head.
 1.4.16.1 18-Jun-2006  gdamore COM_INIT_REGS-ify these. Compiles okay, but no real hardware test. :-)
 1.4.8.1 11-Aug-2006  yamt sync with head
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.40.1 08-Dec-2007  mjf Sync with HEAD.
 1.5.34.2 23-Mar-2008  matt sync with HEAD
 1.5.34.1 09-Jan-2008  matt sync with HEAD
 1.5.32.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.5.14.1 03-Dec-2007  ad Sync with HEAD.
 1.6.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.6.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.10.1 24-Mar-2008  keiichi sync with head.
 1.7.4.1 16-May-2008  yamt sync with head.
 1.7.2.1 18-May-2008  yamt sync with head.
 1.8.60.1 10-Aug-2014  tls Rebase.
 1.8.50.1 18-May-2014  rmind sync with head
 1.8.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.40.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.8.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.28.1 10-Jun-2019  christos Sync with HEAD
 1.9.26.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.4 14-May-2008  tsutsui Normalize my licenses.
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.76; 1.3.78; 1.3.80;
merge ktrace-lwp.
 1.2 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.1 08-Nov-2003  tsutsui branches: 1.1.4;
Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.1.4.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.4 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.3 03-Sep-2004  skrll Sync with HEAD
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 08-Nov-2003  skrll file com_frodovar.h was added on branch ktrace-lwp on 2004-08-03 10:34:22 +0000
 1.3.80.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.3.78.1 16-May-2008  yamt sync with head.
 1.3.76.1 18-May-2008  yamt sync with head.
 1.3.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.64 21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.63 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.62 05-Jul-2021  tsutsui Pull HP-IB probe fixes from OpenBSD/hp300.

https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2
> Overhaul the way HP-IB devices are probed. We will now do an exhaustive
> probe of the (slave, punit) tuple space, since this is the only way we
> can get a dual disk or dual tape enclosure to attach two devices of the
> same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.
 1.61 25-Jul-2014  dholland branches: 1.61.32; 1.61.44;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.60 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.59 24-Mar-2014  christos branches: 1.59.2;
- remove unused
- use cpu_{g,s}etmodel
 1.58 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.57 13-Jan-2009  yamt branches: 1.57.14; 1.57.24; 1.57.28;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.56 17-Jun-2008  he branches: 1.56.4;
Add a missing parenthesis so that this builds again.
 1.55 13-Jun-2008  cegger use device_lookup_private to get softc
 1.54 28-Apr-2008  martin branches: 1.54.2; 1.54.4;
Remove clause 3 and 4 from TNF licenses
 1.53 29-Mar-2008  tsutsui branches: 1.53.2; 1.53.4;
Split device_t/softc, and misc cosmetic changes.
 1.52 02-Jan-2008  ad branches: 1.52.6;
Merge vmlocking2 to head.
 1.51 17-Oct-2007  garbled branches: 1.51.2; 1.51.4; 1.51.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.50 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.49 29-Jul-2007  ad branches: 1.49.4; 1.49.6; 1.49.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.48 04-Mar-2007  christos branches: 1.48.2; 1.48.10; 1.48.12; 1.48.14;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.47 21-Jul-2006  tsutsui branches: 1.47.10;
Some KNF.
 1.46 28-Mar-2006  thorpej Use device_unit().
 1.45 23-Feb-2006  thorpej branches: 1.45.2; 1.45.4; 1.45.6;
Use device_parent().
 1.44 11-Dec-2005  christos branches: 1.44.2; 1.44.4; 1.44.6;
merge ktrace-lwp.
 1.43 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.42 02-Jun-2005  tsutsui branches: 1.42.2;
Add const.
 1.41 14-Mar-2005  tsutsui Include "ioconf.h" for struct cfdriver *_cd decls.
 1.40 05-Feb-2005  chs make this compile with DEBUG.
 1.39 28-Oct-2004  yamt branches: 1.39.4; 1.39.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.38 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.37 17-Nov-2003  tsutsui TAB/space cleanup.
 1.36 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.35 29-Jun-2003  fvdl branches: 1.35.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.34 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.33 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.32 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.31 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.30 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.29 26-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.28 15-Mar-2002  gmcgarry branches: 1.28.4;
Add RCSIDs.
 1.27 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.26 27-May-2001  kleink branches: 1.26.2; 1.26.4; 1.26.8;
Add 35401A drive (not picker) support; from Jarkko Teppo in PR
port-hp300/11183.
 1.25 19-May-2000  thorpej branches: 1.25.6;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.24 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.23 12-Jan-1998  thorpej branches: 1.23.14; 1.23.20;
Update for changes to config.
 1.22 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.21 02-Apr-1997  scottr branches: 1.21.4;
Fix printf() and other warnings when compiled with DEBUG defined.
 1.20 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.19 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.18 14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.17 13-Oct-1996  christos backout previous kprintf changes
 1.16 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.15 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.14 23-Jan-1996  scottr Eliminate unnecessary goto and labels, and other minor cleanup.
 1.13 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.12 09-Oct-1995  thorpej Pass correct number of arguments to hpibgo().
 1.11 04-Aug-1995  thorpej Update for conf.h changes.
 1.10 23-Feb-1995  mycroft Move common code for finishing a buffer into a separate function.
 1.9 26-Oct-1994  cgd new RCS ID format.
 1.8 23-May-1994  mycroft Merge with 4.4-Lite.
 1.7 11-May-1994  mycroft Get rid of private *read() and *write() functions.
 1.6 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.5 06-Feb-1994  mycroft Use b_actb, not b_actl.
 1.4 06-Feb-1994  mycroft Add a prototype, to eliminate silly warnings.
 1.3 11-Jan-1994  mycroft *strategy functions return void.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.21.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.20.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.23.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.25.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.26.8.7 11-Nov-2002  nathanw Catch up to -current
 1.26.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.26.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.26.8.4 01-Aug-2002  nathanw Catch up to -current.
 1.26.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.26.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.26.8.1 27-May-2001  nathanw file ct.c was added on branch nathanw_sa on 2002-01-08 00:24:31 +0000
 1.26.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.26.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.26.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.26.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.26.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.4.2 30-Aug-2002  gehenna catch up with -current.
 1.28.4.1 17-May-2002  gehenna Add device switch.
 1.35.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.8 01-Apr-2005  skrll Sync with HEAD.
 1.35.2.7 06-Feb-2005  skrll Sync with HEAD.
 1.35.2.6 24-Jan-2005  skrll Adapt to branch.
 1.35.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.35.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.2 03-Sep-2004  skrll Sync with HEAD
 1.35.2.1 03-Aug-2004  skrll Sync with HEAD
 1.39.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.39.6.1 12-Feb-2005  yamt sync with head.
 1.39.4.1 29-Apr-2005  kent sync with -current
 1.42.2.5 21-Jan-2008  yamt sync with head
 1.42.2.4 27-Oct-2007  yamt sync with head.
 1.42.2.3 03-Sep-2007  yamt sync with head.
 1.42.2.2 30-Dec-2006  yamt sync with head.
 1.42.2.1 21-Jun-2006  yamt sync with head.
 1.44.6.1 22-Apr-2006  simonb Sync with head.
 1.44.4.1 09-Sep-2006  rpaulo sync with head
 1.44.2.1 01-Mar-2006  yamt sync with head.
 1.45.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.45.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.45.2.2 11-Aug-2006  yamt sync with head
 1.45.2.1 01-Apr-2006  yamt sync with head.
 1.47.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.48.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.48.12.1 07-Aug-2007  matt Sync with HEAD.
 1.48.10.2 16-Oct-2007  garbled Sync with HEAD
 1.48.10.1 03-Oct-2007  garbled Sync with HEAD
 1.48.2.2 09-Oct-2007  ad Sync with head.
 1.48.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.49.8.1 14-Oct-2007  yamt sync with head.
 1.49.6.2 09-Jan-2008  matt sync with HEAD
 1.49.6.1 06-Nov-2007  matt sync with HEAD
 1.49.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.51.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.51.4.1 31-Dec-2007  ad Make compile with new buffer cache locking scheme.

XXX This should be largely MI, please do not make another clone of disksubr.c.
 1.51.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.52.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.52.6.3 29-Jun-2008  mjf Sync with HEAD.
 1.52.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.52.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.53.4.2 04-May-2009  yamt sync with head.
 1.53.4.1 16-May-2008  yamt sync with head.
 1.53.2.2 17-Jun-2008  yamt sync with head.
 1.53.2.1 18-May-2008  yamt sync with head.
 1.54.4.1 18-Jun-2008  simonb Sync with head.
 1.54.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.56.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.57.28.1 18-May-2014  rmind sync with head
 1.57.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.57.14.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.59.2.1 10-Aug-2014  tls Rebase.
 1.61.44.1 01-Aug-2021  thorpej Sync with HEAD.
 1.61.32.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.11 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.10 11-Dec-2005  christos branches: 1.10.170; 1.10.182;
merge ktrace-lwp.
 1.9 19-Apr-2004  wiz Spell removable with only two es. Inspired by jmc@openbsd.
 1.8 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.7 27-May-2001  kleink branches: 1.7.8; 1.7.24;
Add 35401A drive (not picker) support; from Jarkko Teppo in PR
port-hp300/11183.
 1.6 09-Feb-1996  scottr branches: 1.6.42;
Info from Mike Hibler <mike@cs.utah.edu> indicates that the probable
intent for the value of the C_REL constant was 0xc0. Testing has turned
up no adverse effect on tape or disk devices, and in fact this change
apparently makes my 9145 tape work as expected. (!) Closes PRs 1874 and
1971.
 1.5 31-Dec-1995  thorpej XXX TEMPORARY STOP-GAP MEASURE! A 12-bit command modifier was being
squished into an 8-bit position in a command stream! Which one is wrong?
Changed the constant from 0x140 to 0x40, which is what ended up happening
anyhow. This exists in the old Utah sources, too! How long has this
bug existed?!
 1.4 26-Oct-1994  cgd branches: 1.4.2;
new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.2.1 12-Feb-1996  thorpej Bring in C_REL fix from main branch; reported to make 9145 tapes work
properly, and even seems to make HP-IB disks a bit faster.
 1.6.42.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.24.1 03-Aug-2004  skrll Sync with HEAD
 1.7.8.2 27-May-2001  kleink Add 35401A drive (not picker) support; from Jarkko Teppo in PR
port-hp300/11183.
 1.7.8.1 27-May-2001  kleink file ctreg.h was added on branch nathanw_sa on 2001-05-27 09:09:06 +0000
 1.10.182.1 01-Aug-2021  thorpej Sync with HEAD.
 1.10.170.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.59 08-Nov-2003  tsutsui Remove obsolete files by MI com(4) driver support.
 1.58 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.57 29-Jun-2003  fvdl branches: 1.57.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.56 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.55 24-May-2003  gmcgarry Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.54 06-Mar-2003  thorpej Update for consdev changes.
 1.53 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.52 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.51 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.50 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.49 17-Mar-2002  atatat branches: 1.49.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.48 15-Mar-2002  gmcgarry Increase the delay when resetting the port so that the output doesn't
get scrambled when we're the console. Add RCSID while here.
 1.47 23-Feb-2002  gmcgarry Unnecessary to cast splx() to void.
 1.46 08-Feb-2002  gmcgarry Enter DDB on break if console.
 1.45 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.44 12-Jun-2001  wiz branches: 1.44.2; 1.44.4; 1.44.8;
receive, not recieve
 1.43 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.42 02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.41 27-Nov-2000  tsutsui branches: 1.41.2;
More fixes for linesw changes.
 1.40 02-Nov-2000  eeh Adapt to the new line discipline scheme.
 1.39 20-Jul-1998  thorpej branches: 1.39.14;
Don't deref a NULL tty pointer in the interrupt routine. This can happen
if we're the serial console, we have not yet been open'd, and we get an
interrupt for one reason or another.
 1.38 28-Mar-1998  thorpej Adjust for recent ttyopen() and dialout device changes.
 1.37 12-Jan-1998  thorpej Update for changes to config.
 1.36 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.35 05-May-1997  thorpej branches: 1.35.4;
Use dio_intr_establish().
 1.34 14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.33 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.32 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.31 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.30 09-Dec-1996  thorpej isrlink() now returns a cookie. We're not interested in the cookie, so
cast to (void).
 1.29 14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.28 13-Oct-1996  christos backout previous kprintf changes
 1.27 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.26 06-Oct-1996  mycroft Serial console changes:
* Enable FIFO with trigger level 1.
* Set DTR and RTS so terminals are happy.
* Do not set IEN.
 1.25 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.24 06-Jun-1996  thorpej Add calls to tty_attach() and tty_detach() where appropriate.
 1.23 03-Mar-1996  thorpej branches: 1.23.4;
Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.22 26-Feb-1996  thorpej Avoid accidentally lowering a devices console priority.
 1.21 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.20 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.19 31-Dec-1995  thorpej Re-work the serial console support a bit; it doesn't depend on statically
allocated softc's now.
 1.18 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.

Clean up namespace, remove several instances of global arrays. Instead,
use a softc to carry state around. Where possible, pass a pointer to the
softc rather than a unit number.
 1.17 04-Oct-1995  thorpej Several changes:
* Reset the card on "fresh open" as a sanity measure.
* Use the "secret bit" to enable interrupts.
* Make some parts look/behave like their cousins in dev/isa/com.c
* Set the FIFO threshold based on line speed.
* Be a little more informative when port is attached.
* Implement TIOC{G,S}FLAGS; ttyflags now works.
First two items prevent deadlock on some systems (notably the 380,
425, and 433) which some people have been reporting. Use of the
"secret bit" seems to be safe on systems which don't need it. Changes
tested on a 319, 340, 345, and 380.
 1.16 19-Apr-1995  mycroft Kluge the *tty() routines until this port is converted to config.new.
 1.15 10-Apr-1995  mycroft Most of the console functions return void.
 1.14 26-Oct-1994  cgd new RCS ID format.
 1.13 23-May-1994  mycroft Merge with 4.4-Lite.
 1.12 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.11 06-Feb-1994  mycroft Remove outdated console handling code.
 1.10 06-Feb-1994  mycroft Use common version of cons.c.
 1.9 29-Aug-1993  deraadt tty XXstart() routines return void
 1.8 12-Jul-1993  mycroft Change tty code to use clist interface, but with ring buffer implementation.
Also, fix a couple of bugs in tty.c and pccons.c, and some gross kluginess
in the hp300 stuff.
 1.7 07-Jul-1993  deraadt the "struct tty *cn_tty" field in cons.c wasn't being used by anything
 1.6 06-Jun-1993  cgd make getc() and ungetc() be rb{un,}getc(), so getc() and ungetc()
don't conflict w/ansi prototypes...
 1.5 29-May-1993  cgd fix for t_raw, rather than t_rawq for the tsleeps...
 1.4 27-May-1993  deraadt Changes to hp300 code to support two things:
1. dynamic tty allocation
2. use ring buffers instead of clists
Of course, I can't test it :-)
 1.3 22-May-1993  cgd add include of select.h if necessary for protos, or delete if extraneous
 1.2 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.23.4.2 10-Dec-1996  mycroft From trunk:
Set serial port parameters sanely for a serial console.
 1.23.4.1 06-Jun-1996  thorpej Update from trunk:

Add calls to tty_attach() and tty_detach() where appropriate.
 1.35.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.39.14.2 08-Dec-2000  bouyer Sync with HEAD.
 1.39.14.1 22-Nov-2000  bouyer Sync with HEAD.
 1.41.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.44.8.7 11-Nov-2002  nathanw Catch up to -current
 1.44.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.44.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.44.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.44.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.44.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.44.8.1 12-Jun-2001  nathanw file dca.c was added on branch nathanw_sa on 2002-01-08 00:24:32 +0000
 1.44.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.44.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.44.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.44.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.44.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.44.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.49.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.57.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8 08-Nov-2003  tsutsui Move apcireg.h and dcareg.h to stand/common since they are no longer used
by kernel.
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 24-Feb-1996  thorpej branches: 1.6.64;
Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.5 31-Dec-1995  thorpej Re-work the serial console support a bit; it doesn't depend on statically
allocated softc's now.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6.64.1 03-Aug-2004  skrll Sync with HEAD
 1.94 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.93 08-Sep-2023  andvar hp300/dcm(4): set dsp value after sc is initialized.
fixes DCMSTATS enabled build for hp300.
 1.92 21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.91 15-Jan-2023  tsutsui TAB/space cleanup.
 1.90 10-Apr-2022  andvar branches: 1.90.4;
fix various typos in comments and output/log messages.
 1.89 29-Dec-2020  tsutsui Use C99 designated initializers for struct consdev.
 1.88 15-Nov-2014  christos branches: 1.88.4; 1.88.10; 1.88.32;
centralize the call unit / dialout macros
 1.87 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.86 22-May-2014  dholland Use accessor functions for the tty's table of control characters.
(at least from outside the core tty sources)

Move some xon/xoff code from net/ppp_tty.c to kern/tty.c.
 1.85 24-Mar-2014  christos branches: 1.85.2;
- remove unused
- use cpu_{g,s}etmodel
 1.84 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.83 24-Apr-2011  rmind branches: 1.83.4; 1.83.14; 1.83.18;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.82 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.81 13-Jun-2008  cegger branches: 1.81.18; 1.81.24; 1.81.26;
use device_lookup_private to get softc
 1.80 28-Apr-2008  martin branches: 1.80.2; 1.80.4;
Remove clause 3 and 4 from TNF licenses
 1.79 29-Mar-2008  tsutsui branches: 1.79.2; 1.79.4;
Split device_t/softc, and misc cosmetic changes.
 1.78 19-Nov-2007  ad branches: 1.78.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.77 04-Mar-2007  christos branches: 1.77.2; 1.77.18; 1.77.20; 1.77.24; 1.77.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.76 01-Oct-2006  elad branches: 1.76.4;
Fix typos (tty -> tp), pointed out by Matt Fleming, thanks!
 1.75 30-Sep-2006  elad Implement the "device" scope.

It uses an authorization wrapper per device class on the system to
ensure type-safety.

For now, it supports only terminal (TTY) devices, and has two actions
for them: "open terminal" and "privileged set". Sample usage has been
added to i386 and hp300 code for reference.

Update documentation.
 1.74 09-Sep-2006  tsutsui branches: 1.74.2;
time.tv_sec -> time_second
 1.73 23-Jul-2006  ad branches: 1.73.4;
Use the LWP cached credentials where sane.
 1.72 21-Jul-2006  tsutsui Some KNF.
 1.71 14-May-2006  elad integrate kauth.
 1.70 29-Mar-2006  thorpej Use device_cfdata().
 1.69 28-Mar-2006  thorpej Use device_unit().
 1.68 11-Dec-2005  christos branches: 1.68.4; 1.68.6; 1.68.8; 1.68.10; 1.68.12;
merge ktrace-lwp.
 1.67 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.66 14-Mar-2005  tsutsui branches: 1.66.4;
Include "ioconf.h" for struct cfdriver *_cd decls.
 1.65 28-Aug-2004  thorpej branches: 1.65.4; 1.65.6;
Use ANSI function decls, static, and const.
 1.64 25-Apr-2004  matt Constify the speedtab arrays
 1.63 17-Nov-2003  tsutsui TAB/space cleanup.
 1.62 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.61 29-Jun-2003  fvdl branches: 1.61.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.60 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.59 24-May-2003  gmcgarry Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.58 04-May-2003  gmcgarry Fix from Steve Peurifoy in PR#18849:

"Occasionally a blocking open of dcm port 0 will hang in ttyopen()
waiting for carrier detect to be asserted when it's already
present.

The problem is that dcmmint() will return before updating the
value of sc->sc_mcndlast if the device is not open. If carrier
detect drops after the device is closed, sc->sc_mcndlast will
no longer correctly represent the "previous" state of the
signals when the next transition of carrier detect occurs.
A subsequent blocking open will wait forever for an event
which has in fact taken place."
 1.57 06-Mar-2003  thorpej Update for consdev changes.
 1.56 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.55 20-Oct-2002  gmcgarry Fix flow control in dcmmint() by checking termios control flags for
CCTS_OFLOW rather than tty t_flags. From Steve Peurifoy in PR-18735.
 1.54 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.53 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.52 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.51 17-Mar-2002  atatat branches: 1.51.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.50 15-Mar-2002  gmcgarry Add RCSIDs.
 1.49 23-Feb-2002  gmcgarry Unnecessary to cast splx() to void.
 1.48 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.47 30-May-2001  lukem branches: 1.47.2; 1.47.4; 1.47.8;
add missing #include "opt_kgdb.h"
 1.46 02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.45 02-Nov-2000  eeh branches: 1.45.2;
Adapt to the new line discipline scheme.
 1.44 28-Mar-1998  thorpej branches: 1.44.14;
Adjust for recent ttyopen() and dialout device changes.
 1.43 12-Jan-1998  thorpej Update for changes to config.
 1.42 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.41 05-May-1997  thorpej branches: 1.41.4;
Use dio_intr_establish().
 1.40 15-Apr-1997  scottr dcmreadbuf() should not return immediately if the tty hasn't been opened;
this fixes a kgdb goof. Found by inspection.
 1.39 14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.38 04-Apr-1997  scottr Changes to make a dcm-based console work properly:

- While servicing an rx, tx, or modem status interrupt: if we have a
NULL struct tty * or if the tty isn't open, just return.
- Skip the self test if we are the console; it manages to do funny
things to autoconfig messages. (XXX - this should be fixed)
 1.37 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.36 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.

Also, handle sc_flags better so that we don't lose track of the
DCM_ISCONSOLE bit.
 1.35 30-Jan-1997  thorpej - Garbage-collect the old-style configuration glue.
- Make sure we don't get interrupts in dcmselftest().
 1.34 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.33 09-Dec-1996  thorpej isrlink() now returns a cookie. We're not interested in the cookie, so
cast to (void).
 1.32 14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.31 13-Oct-1996  christos backout previous kprintf changes
 1.30 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.29 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.28 06-Jun-1996  thorpej Add calls to tty_attach() and tty_detach() where appropriate.
 1.27 17-May-1996  thorpej branches: 1.27.4;
Add 2 missing ";"s ... they weren't noticed before because of the
old implementation of DELAY().
 1.26 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.25 26-Feb-1996  thorpej Avoid accidentally lowering a devices console priority.
 1.24 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.23 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.22 31-Dec-1995  thorpej Re-work the serial console support a bit; it doesn't depend on statically
allocated softc's now.
 1.21 29-Dec-1995  thorpej Correct some comments about 8-port DCM boards. (Thanks, Mike, for
pointing out the True Nature of The Force...)
 1.20 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.

Clean up namespace, remove several instances of global arrays. Instead,
use a softc to carry state around. Where possible, pass a pointer to
the softc rather than a unit number.

Pointers to hardware and software constructs are now stored per port
in each instance of the softc (one softc per board) rather than indexed
by minor number.
 1.19 04-Oct-1995  thorpej Say what I really meant in a printf()...
 1.18 04-Oct-1995  thorpej Couple of changes:
* Implement TIOC{G,S}FLAGS; ttyflags works now.
* Reset the card on a "fresh open" as a sanity measure.
* Make dcmopen() and dcmclose() a little more like the
corresponding routines in the new dca.c
 1.17 19-Apr-1995  mycroft Kluge the *tty() routines until this port is converted to config.new.
 1.16 10-Apr-1995  mycroft Most of the console functions return void.
 1.15 26-Oct-1994  cgd new RCS ID format.
 1.14 23-May-1994  mycroft Merge with 4.4-Lite.
 1.13 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.12 06-Feb-1994  mycroft Remove outdated console handling code.
 1.11 06-Feb-1994  mycroft Use common version of cons.c.
 1.10 30-Jan-1994  mycroft Remove bogus declaration.
 1.9 29-Aug-1993  deraadt tty XXstart() routines return void
 1.8 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.7 12-Jul-1993  mycroft Change tty code to use clist interface, but with ring buffer implementation.
Also, fix a couple of bugs in tty.c and pccons.c, and some gross kluginess
in the hp300 stuff.
 1.6 07-Jul-1993  deraadt the "struct tty *cn_tty" field in cons.c wasn't being used by anything
 1.5 29-May-1993  cgd fix for t_raw, rather than t_rawq for the tsleeps...
 1.4 27-May-1993  deraadt Changes to hp300 code to support two things:
1. dynamic tty allocation
2. use ring buffers instead of clists
Of course, I can't test it :-)
 1.3 22-May-1993  cgd add include of select.h if necessary for protos, or delete if extraneous
 1.2 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.27.4.1 06-Jun-1996  thorpej Update from trunk:

Add calls to tty_attach() and tty_detach() where appropriate.
 1.41.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.44.14.1 22-Nov-2000  bouyer Sync with HEAD.
 1.45.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.47.8.7 11-Nov-2002  nathanw Catch up to -current
 1.47.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.47.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.47.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.47.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.47.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.47.8.1 30-May-2001  nathanw file dcm.c was added on branch nathanw_sa on 2002-01-08 00:24:32 +0000
 1.47.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.47.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.47.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.47.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.47.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.47.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.51.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.61.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.61.2.6 01-Apr-2005  skrll Sync with HEAD.
 1.61.2.5 24-Jan-2005  skrll Adapt to branch.
 1.61.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.61.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.61.2.2 03-Sep-2004  skrll Sync with HEAD
 1.61.2.1 03-Aug-2004  skrll Sync with HEAD
 1.65.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.65.4.1 29-Apr-2005  kent sync with -current
 1.66.4.4 07-Dec-2007  yamt sync with head
 1.66.4.3 03-Sep-2007  yamt sync with head.
 1.66.4.2 30-Dec-2006  yamt sync with head.
 1.66.4.1 21-Jun-2006  yamt sync with head.
 1.68.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.68.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.68.10.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.68.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.68.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.68.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.68.8.4 14-Sep-2006  yamt sync with head.
 1.68.8.3 11-Aug-2006  yamt sync with head
 1.68.8.2 24-May-2006  yamt sync with head.
 1.68.8.1 01-Apr-2006  yamt sync with head.
 1.68.6.2 01-Jun-2006  kardel Sync with head.
 1.68.6.1 22-Apr-2006  simonb Sync with head.
 1.68.4.1 09-Sep-2006  rpaulo sync with head
 1.73.4.1 18-Nov-2006  ad Sync with head.
 1.74.2.1 22-Oct-2006  yamt sync with head
 1.76.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.77.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.77.24.1 21-Nov-2007  bouyer Sync with HEAD
 1.77.20.1 09-Jan-2008  matt sync with HEAD
 1.77.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.77.2.1 03-Dec-2007  ad Sync with HEAD.
 1.78.14.3 29-Jun-2008  mjf Sync with HEAD.
 1.78.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.78.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.79.4.2 04-May-2009  yamt sync with head.
 1.79.4.1 16-May-2008  yamt sync with head.
 1.79.2.2 17-Jun-2008  yamt sync with head.
 1.79.2.1 18-May-2008  yamt sync with head.
 1.80.4.1 18-Jun-2008  simonb Sync with head.
 1.80.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.81.26.1 17-Feb-2011  bouyer Sync with HEAD
 1.81.24.1 06-Jun-2011  jruoho Sync with HEAD.
 1.81.18.2 31-May-2011  rmind sync with head
 1.81.18.1 05-Mar-2011  rmind sync with head
 1.83.18.1 18-May-2014  rmind sync with head
 1.83.14.2 03-Dec-2017  jdolecek update from HEAD
 1.83.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.83.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.85.2.1 10-Aug-2014  tls Rebase.
 1.88.32.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.88.10.1 27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.88.4.1 20-Jul-2016  pgoyette Adapt the machine/arch dependent code to the new {b,c}devsw reference
counting.

XXX Most of these will require testing by someone other than myself, as
I have a limited selection of hardware!
 1.90.4.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.11 15-Jan-2023  tsutsui TAB/space cleanup.
 1.10 22-May-2014  dholland branches: 1.10.58;
Use uintptr_t so this file can be compile-tested on foreign arches.
 1.9 08-Feb-2011  rmind branches: 1.9.14; 1.9.28;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.8 11-Dec-2005  christos branches: 1.8.100; 1.8.106; 1.8.108;
merge ktrace-lwp.
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 06-Jan-2003  wiz branches: 1.6.2;
interrupt with two rs.
 1.5 24-Feb-1996  thorpej branches: 1.5.48;
Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.48.1 07-Jan-2003  thorpej Sync with HEAD.
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.8.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.100.1 05-Mar-2011  rmind sync with head
 1.9.28.1 10-Aug-2014  tls Rebase.
 1.9.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.58.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.10 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.9 20-Oct-1996  thorpej Remove declaration for now-gone function.
 1.8 14-Oct-1996  thorpej Add some new config glue to the legacy hp300 device structures. This is
a transitional thing.
 1.7 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.6 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.5 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 15-Dec-2003  jmc Fixes from PR#23177. Various lint/logic fixes:
Fix some non-initialized variables
close the output files when done
Redo the printing for RCS strings so they don't expand in the awk script too
Do proper tests for variables existance before accessing

Verified output from all scripts is identical to original versions
 1.5 09-Jan-1998  thorpej branches: 1.5.48;
Put RCS IDs into generated files, in the correct place.
 1.4 08-Jan-1998  thorpej Back out RCS ID related changes.
 1.3 05-Jan-1998  perry make script insert RCS ids into generated files
 1.2 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.5.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.48.1 03-Aug-2004  skrll Sync with HEAD
 1.43 16-Jan-2024  thorpej Fix computation of the appropriate auto-vector interrupt level to use
for the DMA controller by tracking all of the DIO devices that have
"ISRPRI_BIO" interrupt handlers, and finding the highest auto-vector
level among them and informing the DMA controller.

Previously, in a post-flattening world, the DMA controller was always
told to interrupt at lev5, which is fine I guess although definitely not
ideal, but would not work on aaaancient HP320 Rev A DMA boards. To that
effect, print a warning if a Rev B DMA board ends up at ipl != 3 (we can't
differentiate between a Rev A and a Rev B board).
 1.42 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.41 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.40 24-Apr-2021  thorpej branches: 1.40.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.39 26-Mar-2014  christos branches: 1.39.44;
kill sprintf
 1.38 06-Mar-2011  tsutsui branches: 1.38.4; 1.38.14; 1.38.18;
Remove trailing spaces.
 1.37 28-Apr-2008  martin branches: 1.37.22; 1.37.28;
Remove clause 3 and 4 from TNF licenses
 1.36 29-Mar-2008  tsutsui branches: 1.36.2; 1.36.4;
Split device_t/softc, and misc cosmetic changes.
 1.35 04-Mar-2007  christos branches: 1.35.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.34 21-Jul-2006  tsutsui branches: 1.34.10;
Use bus_space_map(9) and bus_space_vaddr(9) rather than iomap().
 1.33 21-Jul-2006  tsutsui Some KNF.
 1.32 24-Dec-2005  perry branches: 1.32.4; 1.32.8;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.31 11-Dec-2005  christos merge ktrace-lwp.
 1.30 26-Aug-2005  drochner s/locdesc_t/int/g
 1.29 28-Jun-2005  drochner branches: 1.29.2;
convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)
 1.28 02-Jan-2005  tsutsui u_intNN_t -> uintNN_t
 1.27 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.26 17-Nov-2003  tsutsui TAB/space cleanup.
 1.25 01-Aug-2003  tsutsui Add "oddbyte" bus_space(9) access ops for DIO devices which have
odd byte address space.
 1.24 01-Aug-2003  tsutsui Modify hp300 bus_space(9) structures/functions to add hooks to override
access functions. This is required by some DIO devices to use MI drivers.
 1.23 24-May-2003  gmcgarry branches: 1.23.2;
Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.22 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.21 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.20 22-Dec-2002  gmcgarry Make the DMA controller a separate device attached to intio. Intio
devices can use the DMA controller too.
 1.19 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.18 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.17 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.16 15-Mar-2002  gmcgarry Add RCSIDs.
 1.15 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.14 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.13 01-Jul-1998  thorpej branches: 1.13.28; 1.13.32;
If sysflags tells us we have an internal HP-IB interface, don't bother
reading the DIO device ID at select code 7, but rather hard-wire the ID
to the IHPIB ID. This prevents us reading what might look like a valid
ID to another device when IHPIB is present. (IHPIB doesn't always return
a correct device ID, grumble.)
 1.12 12-Jan-1998  thorpej Update for changes to config.
 1.11 11-Jan-1998  thorpej Pass down bus space tags to children, and use types appropriate for
bus.h.
 1.10 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.9 01-Oct-1997  kleink Remove duplicate inclusion of <sys/device.h>.
 1.8 18-Jul-1997  jtk branches: 1.8.2;
remove old *_UNK style default defines, use standard names from locators.h
 1.7 05-May-1997  thorpej - Initialize the DMA controller in dioattach().
- Implement dio_intr_establish() and dio_intr_disestablish().
 1.6 27-Apr-1997  thorpej These files depend on things in <machine/hp300spu.h>
 1.5 04-Apr-1997  thorpej #ifdef DIOVERBOSE a variable needed only in such code.
 1.4 31-Mar-1997  scottr Add missing argument to diagnostic printf()
 1.3 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.2 12-Jan-1997  thorpej Fix botch in PA calculation for DIO-II devices. Bug noticed and fix
provided by Klaus Klein <kleink@layla.inka.de>, PR #3097.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.8.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.32.5 03-Jan-2003  thorpej Sync with HEAD.
 1.13.32.4 29-Dec-2002  thorpej Sync with HEAD.
 1.13.32.3 18-Oct-2002  nathanw Catch up to -current.
 1.13.32.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.13.32.1 08-Jan-2002  nathanw Catch up to -current.
 1.13.28.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.13.28.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.13.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.23.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.23.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.23.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.23.2.2 03-Sep-2004  skrll Sync with HEAD
 1.23.2.1 03-Aug-2004  skrll Sync with HEAD
 1.29.2.3 03-Sep-2007  yamt sync with head.
 1.29.2.2 30-Dec-2006  yamt sync with head.
 1.29.2.1 21-Jun-2006  yamt sync with head.
 1.32.8.1 11-Aug-2006  yamt sync with head
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.34.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.35.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.35.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.36.4.1 16-May-2008  yamt sync with head.
 1.36.2.1 18-May-2008  yamt sync with head.
 1.37.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.37.22.1 21-Apr-2011  rmind sync with head
 1.38.18.1 18-May-2014  rmind sync with head
 1.38.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.38.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.39.44.2 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.39.44.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.40.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.14 19-Feb-2011  tsutsui Move recently supported framebuffers out of the "unsupported" list.
 1.13 06-Feb-2011  tsutsui Pull description about TurboVRX ("tigershark") display from OpenBSD.
 1.12 06-Feb-2011  tsutsui RENASSIANCE -> RENAISSANCE
 1.11 31-Dec-2010  tsutsui branches: 1.11.2; 1.11.4;
Use more specific info and names for 362/382 internal framebuffers.

Taken from various WWW pages (and my 362/382):
http://www.hpmuseum.net/collection_document.php
http://www.ambry.com/page/model.asp?model_nu=A1473A
http://mail-index.NetBSD.org/port-hp300/2003/11/03/0005.html
http://www.ambry.com/page/model.asp?model_nu=A1474A
http://mail-index.NetBSD.org/port-hp300/1999/07/16/0000.html
http://mail-index.NetBSD.org/port-hp300/1999/07/16/0001.html
http://mail-index.NetBSD.org/port-hp300/2009/04/30/msg000018.html
 1.10 28-Dec-2010  tsutsui Add IDs for 362/382 internal displays. From OpenBSD.
 1.9 28-Apr-2008  martin branches: 1.9.22;
Remove clause 3 and 4 from TNF licenses
 1.8 11-Dec-2005  christos branches: 1.8.74; 1.8.76; 1.8.78;
merge ktrace-lwp.
 1.7 23-Nov-2003  tsutsui Change device ID for 98624A HP-IB from 0x80 to 0x01.
nhpib.c in Lite2 used 0x01 and my 98624 also has an ID 0x01.
 1.6 25-May-2003  tsutsui branches: 1.6.2;
Fix part number of DIO SCSI interfaces.
It should be 98265A, and 98625A is fast HP-IB interface.
 1.5 17-Apr-2002  gmcgarry typo in previous
 1.4 17-Apr-2002  gmcgarry device id 0x13 is "digital audio" as reported by Thilo Manske.
 1.3 09-Oct-1997  jtc branches: 1.3.30; 1.3.34;
Fix tipo inherited from old version of TNF copyright template.
 1.2 30-Jan-1997  thorpej branches: 1.2.8;
Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.2.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.34.1 20-Jun-2002  nathanw Catch up to -current.
 1.3.30.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.78.1 16-May-2008  yamt sync with head.
 1.8.76.1 18-May-2008  yamt sync with head.
 1.8.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.22.1 05-Mar-2011  rmind sync with head
 1.11.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.11.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17 19-Feb-2011  tsutsui Regen from diodevs rev 1.14:
> Move recently supported framebuffers out of the "unsupported" list.
 1.16 06-Feb-2011  tsutsui Regen from diodevs rev 1.13:
> Pull description about TurboVRX ("tigershark") display from OpenBSD.
 1.15 06-Feb-2011  tsutsui Regen from diodevs rev 1.12:
> RENASSIANCE -> RENAISSANCE
 1.14 31-Dec-2010  tsutsui branches: 1.14.2; 1.14.4;
Regen from diodevs rev 1.11:
> Use more specific info and names for 362/382 internal framebuffers.
 1.13 28-Dec-2010  tsutsui Regen from diodevs rev 1.10:
> Add IDs for 362/382 internal displays. From OpenBSD.
 1.12 28-Apr-2008  martin branches: 1.12.22;
Remove clause 3 and 4 from TNF licenses
 1.11 11-Dec-2005  christos branches: 1.11.74; 1.11.76; 1.11.78;
merge ktrace-lwp.
 1.10 23-Nov-2003  tsutsui Regen from diodevs rev 1.7:
> Change device ID for 98624A HP-IB from 0x80 to 0x01.
> nhpib.c in Lite2 used 0x01 and my 98624 also has an ID 0x01.
 1.9 25-May-2003  tsutsui branches: 1.9.2;
Regen from diodevs rev 1.6:
> Fix part number of DIO SCSI interfaces.
> It should be 98265A, and 98625A is fast HP-IB interface.
 1.8 17-Apr-2002  gmcgarry Regen: "digital audio"
 1.7 09-Jan-1998  thorpej branches: 1.7.28; 1.7.32;
Regen.
 1.6 08-Jan-1998  thorpej Regen: Back out RCS ID related changes.
 1.5 05-Jan-1998  perry RCSID Police.
 1.4 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.3 30-Jan-1997  thorpej branches: 1.3.8;
Regen to clear up RCS id snafu.
 1.2 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Generate initial copies of these files.
 1.3.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.32.1 20-Jun-2002  nathanw Catch up to -current.
 1.7.28.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.11.78.1 16-May-2008  yamt sync with head.
 1.11.76.1 18-May-2008  yamt sync with head.
 1.11.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.22.1 05-Mar-2011  rmind sync with head
 1.14.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.14.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.14.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17 19-Feb-2011  tsutsui Regen from diodevs rev 1.14:
> Move recently supported framebuffers out of the "unsupported" list.
 1.16 06-Feb-2011  tsutsui Regen from diodevs rev 1.13:
> Pull description about TurboVRX ("tigershark") display from OpenBSD.
 1.15 06-Feb-2011  tsutsui Regen from diodevs rev 1.12:
> RENASSIANCE -> RENAISSANCE
 1.14 31-Dec-2010  tsutsui branches: 1.14.2; 1.14.4;
Regen from diodevs rev 1.11:
> Use more specific info and names for 362/382 internal framebuffers.
 1.13 28-Dec-2010  tsutsui Regen from diodevs rev 1.10:
> Add IDs for 362/382 internal displays. From OpenBSD.
 1.12 28-Apr-2008  martin branches: 1.12.22;
Remove clause 3 and 4 from TNF licenses
 1.11 11-Dec-2005  christos branches: 1.11.74; 1.11.76; 1.11.78;
merge ktrace-lwp.
 1.10 23-Nov-2003  tsutsui Regen from diodevs rev 1.7:
> Change device ID for 98624A HP-IB from 0x80 to 0x01.
> nhpib.c in Lite2 used 0x01 and my 98624 also has an ID 0x01.
 1.9 25-May-2003  tsutsui branches: 1.9.2;
Regen from diodevs rev 1.6:
> Fix part number of DIO SCSI interfaces.
> It should be 98265A, and 98625A is fast HP-IB interface.
 1.8 17-Apr-2002  gmcgarry Regen: "digital audio"
 1.7 09-Jan-1998  thorpej branches: 1.7.28; 1.7.32;
Regen.
 1.6 08-Jan-1998  thorpej Regen: Back out RCS ID related changes.
 1.5 05-Jan-1998  perry RCSID Police.
 1.4 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.3 30-Jan-1997  thorpej branches: 1.3.8;
Regen to clear up RCS id snafu.
 1.2 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Generate initial copies of these files.
 1.3.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.32.1 20-Jun-2002  nathanw Catch up to -current.
 1.7.28.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.11.78.1 16-May-2008  yamt sync with head.
 1.11.76.1 18-May-2008  yamt sync with head.
 1.11.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.22.1 05-Mar-2011  rmind sync with head
 1.14.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.14.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.14.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10 01-May-2024  tsutsui Fix topcat(4) problems on some models that cause garbages on screen.

- Make sure that windowmove (hardware BITBLT) ops complete by checking
tc_busywait() before calling putchar functions by MI rasops(9).
It looks CPU accesses against VRAM during windowmove (copy, erase,
and cursor) ops causes unexpected garbages at least on 98543 on HP360,
98547 on HP370, and also on 98543 on 040 HP380 (but not on 98549).

- Handle 'sparse VRAM' on 98543 (and probably 98542) properly:
- Prepare and use own topcat_putchar1_4() function for sparse VRAM.
- Pass proper 'VRAM width' rather than actuall font width to all
windowmove (copycols, erasecols, copyrows, eraserows, and do_cursor)
operation functions.

Now all topcat(4) consoles on 98543 on HP360/HP380 and 98547 on HP370
work fine, and no visible regression on 98549 on HP380 and 98544 on HP360.

Worth to pullup netbsd-10.
 1.9 29-Apr-2024  tsutsui Fix MD allocattr to return proper attributes what MI rasops(9) expects.
 1.8 29-Apr-2024  tsutsui Move a check of topcat(4) specific fb width quirks to topcat.c.

We need to check fb->planes but it's propbed in topcat.c after
common diofb_fbinquire() is called.

Also add a comment that it looks these 1 bpp and 4 bpp boards have
VRAM with sparse address layout and we have to handle
512 pixels per line with 1024 bytes per line.
 1.7 07-Aug-2021  thorpej branches: 1.7.6;
Merge thorpej-cfargs2.
 1.6 24-Apr-2021  thorpej branches: 1.6.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.5 15-Apr-2021  tsutsui Fix two problems on old topcat(4) framebuffers found on HP332/340.

- Fix panic on monochrome framebuffers. They don't have palette registers.
The problem was reported from Anders Gustafsson and also Andrew Gillham
back in 2013:
https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000086.html
https://mail-index.netbsd.org/port-hp300/2013/09/28/msg000087.html
- Fix incorrect framebuffer width of 98542/98544 framebuffers on HP332.
Reported from Andrew Gillham (98542) as above and Chris Hanson (98543):
https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000083.html
https://mail-index.netbsd.org/port-hp300/2020/05/01/msg000164.html

Worth to pullup to netbsd-9.
 1.4 24-Mar-2014  christos branches: 1.4.34; 1.4.44;
- remove unused
- use cpu_{g,s}etmodel
 1.3 18-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.8; 1.3.18; 1.3.22;
Use aprint_normal(9) and variants.
 1.2 12-Feb-2011  tsutsui - make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.4 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file diofb.c was added on branch bouyer-quota2 on 2011-02-08 16:19:20 +0000
 1.3.22.1 18-May-2014  rmind sync with head
 1.3.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 18-Feb-2011  jruoho file diofb.c was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 18-Feb-2011  rmind file diofb.c was added on branch rmind-uvmplock on 2011-03-05 20:50:20 +0000
 1.4.44.2 17-Apr-2021  thorpej Sync with HEAD.
 1.4.44.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.4.34.1 21-Apr-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1248):

sys/arch/hp300/dev/topcat.c: revision 1.5
sys/arch/hp300/dev/diofb.c: revision 1.5

Fix two problems on old topcat(4) framebuffers found on HP332/340.

- Fix panic on monochrome framebuffers. They don't have palette registers.
The problem was reported from Anders Gustafsson and also Andrew Gillham
back in 2013:
https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000086.html
https://mail-index.netbsd.org/port-hp300/2013/09/28/msg000087.html

- Fix incorrect framebuffer width of 98542/98544 framebuffers on HP332.
Reported from Andrew Gillham (98542) as above and Chris Hanson (98543):
https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000083.html
https://mail-index.netbsd.org/port-hp300/2020/05/01/msg000164.html

Worth to pullup to netbsd-9.
 1.6.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.7.6.1 16-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #690):

sys/arch/hp300/dev/topcat.c: revision 1.7
sys/arch/hp300/dev/topcat.c: revision 1.8
sys/arch/hp300/dev/topcat.c: revision 1.9
sys/arch/hp300/dev/diofb.c: revision 1.8
sys/arch/hp300/dev/diofb.c: revision 1.9
sys/arch/hp300/dev/diofb.c: revision 1.10
sys/arch/hp300/dev/topcat.c: revision 1.10
sys/arch/hp300/dev/topcat.c: revision 1.11
sys/arch/hp300/dev/topcat.c: revision 1.12
sys/arch/hp300/dev/topcatreg.h: revision 1.5
distrib/notes/hp300/hardware: revision 1.28
sys/arch/hp300/dev/diofbvar.h: revision 1.5
share/man/man4/man4.hp300/topcat.4: revision 1.8

Increase DELAY() for waitbusy macroes as pre-wscons and 4.4BSD did.

It looks necessary for sane palette ops at least on HP98543 topcat
on 68030 HP 9000/360.

Move a check of topcat(4) specific fb width quirks to topcat.c.

We need to check fb->planes but it's propbed in topcat.c after
common diofb_fbinquire() is called.

Also add a comment that it looks these 1 bpp and 4 bpp boards have
VRAM with sparse address layout and we have to handle
512 pixels per line with 1024 bytes per line.

Fix MD allocattr to return proper attributes what MI rasops(9) expects.
Use proper planemask per a vaild number of planes.

Check tc_waitbusy() before writing palette registers in topcat_setcolor().
This seems to make palette operations more stable on my HP360 with HP98543.

Add DELAY(9) to make palette register settings stable on 98543 in HP360.
Note 98547 (6 bpp variant) on HP370 (68030 33MHz) doesn't need these
DELAYs so maybe only some old variants (98543 and 98545?) on 020/030
have such restriction (actually only one nop seems enough.)

Fix topcat(4) problems on some models that cause garbages on screen.
- Make sure that windowmove (hardware BITBLT) ops complete by checking
tc_busywait() before calling putchar functions by MI rasops(9).
It looks CPU accesses against VRAM during windowmove (copy, erase,
and cursor) ops causes unexpected garbages at least on 98543 on HP360,
98547 on HP370, and also on 98543 on 040 HP380 (but not on 98549).
- Handle 'sparse VRAM' on 98543 (and probably 98542) properly:
- Prepare and use own topcat_putchar1_4() function for sparse VRAM.
- Pass proper 'VRAM width' rather than actuall font width to all
windowmove (copycols, erasecols, copyrows, eraserows, and do_cursor)
operation functions.
Now all topcat(4) consoles on 98543 on HP360/HP380 and 98547 on HP370
work fine, and no visible regression on 98549 on HP380 and 98544 on HP360.

Note that 98542 and 98543 variants are also supported by topcat(4).

Add 98542 and 98543 framebuffers to supported "Graphics Devices" section.
I hope someone will sync a list of supported devices in port wiki pages
with one in this installation notes.

Add comments about quirks of 98542/98543 framebuffers with 1024x400 pixels.
 1.3 31-May-2025  tsutsui Use C99 exact width integer types, and misc KNF. (sync with stand/common)
 1.2 12-Feb-2011  tsutsui branches: 1.2.2; 1.2.6; 1.2.96;
- make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file diofb_mono.c was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.2.96.1 02-Aug-2025  perseant Sync with HEAD
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 12-Feb-2011  jruoho file diofb_mono.c was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 12-Feb-2011  rmind file diofb_mono.c was added on branch rmind-uvmplock on 2011-03-05 20:50:20 +0000
 1.4 15-Jan-2023  tsutsui TAB/space cleanup.
 1.3 12-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.90;
- make local functions static
- some KNF
 1.2 12-Feb-2011  tsutsui Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file diofbreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.3.90.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 12-Feb-2011  jruoho file diofbreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 12-Feb-2011  rmind file diofbreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:20 +0000
 1.5 01-May-2024  tsutsui Fix topcat(4) problems on some models that cause garbages on screen.

- Make sure that windowmove (hardware BITBLT) ops complete by checking
tc_busywait() before calling putchar functions by MI rasops(9).
It looks CPU accesses against VRAM during windowmove (copy, erase,
and cursor) ops causes unexpected garbages at least on 98543 on HP360,
98547 on HP370, and also on 98543 on 040 HP380 (but not on 98549).

- Handle 'sparse VRAM' on 98543 (and probably 98542) properly:
- Prepare and use own topcat_putchar1_4() function for sparse VRAM.
- Pass proper 'VRAM width' rather than actuall font width to all
windowmove (copycols, erasecols, copyrows, eraserows, and do_cursor)
operation functions.

Now all topcat(4) consoles on 98543 on HP360/HP380 and 98547 on HP370
work fine, and no visible regression on 98549 on HP380 and 98544 on HP360.

Worth to pullup netbsd-10.
 1.4 15-Jan-2023  tsutsui TAB/space cleanup.
 1.3 12-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.90;
- make local functions static
- some KNF
 1.2 12-Feb-2011  tsutsui Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file diofbvar.h was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.3.90.2 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.3.90.1 16-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #690):

sys/arch/hp300/dev/topcat.c: revision 1.7
sys/arch/hp300/dev/topcat.c: revision 1.8
sys/arch/hp300/dev/topcat.c: revision 1.9
sys/arch/hp300/dev/diofb.c: revision 1.8
sys/arch/hp300/dev/diofb.c: revision 1.9
sys/arch/hp300/dev/diofb.c: revision 1.10
sys/arch/hp300/dev/topcat.c: revision 1.10
sys/arch/hp300/dev/topcat.c: revision 1.11
sys/arch/hp300/dev/topcat.c: revision 1.12
sys/arch/hp300/dev/topcatreg.h: revision 1.5
distrib/notes/hp300/hardware: revision 1.28
sys/arch/hp300/dev/diofbvar.h: revision 1.5
share/man/man4/man4.hp300/topcat.4: revision 1.8

Increase DELAY() for waitbusy macroes as pre-wscons and 4.4BSD did.

It looks necessary for sane palette ops at least on HP98543 topcat
on 68030 HP 9000/360.

Move a check of topcat(4) specific fb width quirks to topcat.c.

We need to check fb->planes but it's propbed in topcat.c after
common diofb_fbinquire() is called.

Also add a comment that it looks these 1 bpp and 4 bpp boards have
VRAM with sparse address layout and we have to handle
512 pixels per line with 1024 bytes per line.

Fix MD allocattr to return proper attributes what MI rasops(9) expects.
Use proper planemask per a vaild number of planes.

Check tc_waitbusy() before writing palette registers in topcat_setcolor().
This seems to make palette operations more stable on my HP360 with HP98543.

Add DELAY(9) to make palette register settings stable on 98543 in HP360.
Note 98547 (6 bpp variant) on HP370 (68030 33MHz) doesn't need these
DELAYs so maybe only some old variants (98543 and 98545?) on 020/030
have such restriction (actually only one nop seems enough.)

Fix topcat(4) problems on some models that cause garbages on screen.
- Make sure that windowmove (hardware BITBLT) ops complete by checking
tc_busywait() before calling putchar functions by MI rasops(9).
It looks CPU accesses against VRAM during windowmove (copy, erase,
and cursor) ops causes unexpected garbages at least on 98543 on HP360,
98547 on HP370, and also on 98543 on 040 HP380 (but not on 98549).
- Handle 'sparse VRAM' on 98543 (and probably 98542) properly:
- Prepare and use own topcat_putchar1_4() function for sparse VRAM.
- Pass proper 'VRAM width' rather than actuall font width to all
windowmove (copycols, erasecols, copyrows, eraserows, and do_cursor)
operation functions.
Now all topcat(4) consoles on 98543 on HP360/HP380 and 98547 on HP370
work fine, and no visible regression on 98549 on HP380 and 98544 on HP360.

Note that 98542 and 98543 variants are also supported by topcat(4).

Add 98542 and 98543 framebuffers to supported "Graphics Devices" section.
I hope someone will sync a list of supported devices in port wiki pages
with one in this installation notes.

Add comments about quirks of 98542/98543 framebuffers with 1024x400 pixels.
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 12-Feb-2011  jruoho file diofbvar.h was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 12-Feb-2011  rmind file diofbvar.h was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.8 06-Mar-2011  tsutsui Remove trailing spaces.
 1.7 28-Apr-2008  martin branches: 1.7.22; 1.7.28;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.74; 1.6.76; 1.6.78;
merge ktrace-lwp.
 1.5 02-Jan-2005  tsutsui u_intNN_t -> uintNN_t
 1.4 09-Oct-1997  jtc branches: 1.4.50;
Fix tipo inherited from old version of TNF copyright template.
 1.3 30-Jan-1997  thorpej branches: 1.3.8;
Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.2 12-Jan-1997  thorpej Fix botch in PA calculation for DIO-II devices. Bug noticed and fix
provided by Klaus Klein <kleink@layla.inka.de>, PR #3097.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.3.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.50.1 17-Jan-2005  skrll Sync with HEAD.
 1.6.78.1 16-May-2008  yamt sync with head.
 1.6.76.1 18-May-2008  yamt sync with head.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.22.1 21-Apr-2011  rmind sync with head
 1.13 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.12 11-Dec-2005  christos branches: 1.12.74; 1.12.76; 1.12.78;
merge ktrace-lwp.
 1.11 02-Jan-2005  tsutsui u_intNN_t -> uintNN_t
 1.10 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.9 01-Aug-2003  tsutsui Add "oddbyte" bus_space(9) access ops for DIO devices which have
odd byte address space.
 1.8 24-May-2003  gmcgarry branches: 1.8.2;
Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.7 11-Jan-1998  thorpej Pass down bus space tags to children, and use types appropriate for
bus.h.
 1.6 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.5 18-Jul-1997  jtk branches: 1.5.2;
remove old *_UNK style default defines, use standard names from locators.h
 1.4 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all *UNK uses in
hpib code with the native names from locators.h
 1.3 05-May-1997  thorpej Prototype dio_intr_establish() and dio_intr_disestablish().
 1.2 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.5.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.8.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.2 03-Sep-2004  skrll Sync with HEAD
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.78.1 16-May-2008  yamt sync with head.
 1.12.76.1 18-May-2008  yamt sync with head.
 1.12.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.48 30-Apr-2024  tsutsui Fix another fatal typo that prevents dma(4) interrupts.
 1.47 16-Jan-2024  thorpej Fix computation of the appropriate auto-vector interrupt level to use
for the DMA controller by tracking all of the DIO devices that have
"ISRPRI_BIO" interrupt handlers, and finding the highest auto-vector
level among them and informing the DMA controller.

Previously, in a post-flattening world, the DMA controller was always
told to interrupt at lev5, which is fine I guess although definitely not
ideal, but would not work on aaaancient HP320 Rev A DMA boards. To that
effect, print a warning if a Rev B DMA board ends up at ipl != 3 (we can't
differentiate between a Rev A and a Rev B board).
 1.46 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.45 15-Jan-2023  tsutsui TAB/space cleanup.
 1.44 06-Sep-2021  andvar branches: 1.44.4;
fix typos in word "segment" and two additional typos in if_tl.c.
 1.43 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.42 22-Jun-2008  tsutsui branches: 1.42.16; 1.42.18;
Don't recompute an ipl level for IPL_VM during or after cpu_configure(9)
and use a static and possible highest ipl value (ipl 5) for IPL_VM
so that we can put ipl2psl_table[] conversion into makeiplcookie(9),
which could be called before cpu_configure(9).

Fixes "panic: sbappendaddr" on NFS load.
 1.41 15-Jun-2008  tsutsui Unify splraiseipl(9) implementation among m68k ports as per
suggestion from isaki@ on port-m68k.

For hp300:
- use ipl2psl_table[] for makeiplcookie() conversion
- use uint16_t for ipl2psl_table[]
 1.40 28-Apr-2008  martin branches: 1.40.2; 1.40.4;
Remove clause 3 and 4 from TNF licenses
 1.39 29-Mar-2008  tsutsui branches: 1.39.2; 1.39.4;
Split device_t/softc, and misc cosmetic changes.
 1.38 05-Dec-2007  tsutsui branches: 1.38.12;
Use queue(3) macro.
 1.37 17-Oct-2007  garbled branches: 1.37.2; 1.37.4;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.36 12-Jul-2007  he branches: 1.36.8; 1.36.10;
Adapt to new signature for callout_init().
 1.35 21-Dec-2006  yamt branches: 1.35.6; 1.35.14;
merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.34 21-Jul-2006  tsutsui branches: 1.34.4; 1.34.6;
Some KNF.
 1.33 11-Dec-2005  christos branches: 1.33.4; 1.33.8;
merge ktrace-lwp.
 1.32 03-Jun-2005  tsutsui branches: 1.32.2;
Replace badbaddr() with hp300_bus_space_probe() to avoid -Wcast-qual warning.
 1.31 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.30 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.29 01-Apr-2003  thorpej branches: 1.29.2;
Use PAGE_SIZE rather than NBPG.
 1.28 22-Dec-2002  gmcgarry Make the DMA controller a separate device attached to intio. Intio
devices can use the DMA controller too.
 1.27 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.26 15-Mar-2002  gmcgarry Add RCSIDs.
 1.25 23-Mar-2000  thorpej branches: 1.25.8; 1.25.12;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.24 01-Aug-1999  thorpej branches: 1.24.2;
Store computed PSL values in an array indexed by abstract interrupt
level, rather than individual shortwords.
 1.23 20-Aug-1998  kleink branches: 1.23.8;
vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.22 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.21 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.20 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.19 05-May-1997  thorpej branches: 1.19.4;
Do a bit of spring cleaning.
 1.18 27-Apr-1997  thorpej Use information provided by <machine/hp300spu.h> to determine if we
might have a physical address cache.
 1.17 14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.16 06-Apr-1997  mycroft Fix some #ifdef lossage if HP340, HP360, or HP375 is defined, but HP370 is not.
 1.15 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.14 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall.
 1.13 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.12 31-Jan-1997  carrel Make "options HP340" actually work without having "option HP360".
 1.11 30-Jan-1997  thorpej - Use indicies, rather than pointer arithmetic, to track DMA chain
segments.
- Use a much more obvious DMA job queueing scheme.
- Fixup some debugging code.
 1.10 09-Dec-1996  thorpej Defer hooking up the DMA controller interrupt. Add a new funciton,
dmacomputeipl(), which is called by drivers which use DMA once they've
hooked up their interrupts. This new function computes the appropriate
ipl to use for the DMA controller and (re-)establishes it's interrupt.
 1.9 13-Oct-1996  christos backout previous kprintf changes
 1.8 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.7 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.6 02-Dec-1995  thorpej Make the DMA controller driver a little more new config-friendly. Still
more work to do, but this is a step in the right direction.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.19.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.8.1 02-Aug-1999  thorpej Update from trunk.
 1.24.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.25.12.3 29-Dec-2002  thorpej Sync with HEAD.
 1.25.12.2 11-Nov-2002  nathanw Catch up to -current
 1.25.12.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.25.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.29.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.29.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.29.2.2 03-Sep-2004  skrll Sync with HEAD
 1.29.2.1 03-Aug-2004  skrll Sync with HEAD
 1.32.2.3 07-Dec-2007  yamt sync with head
 1.32.2.2 03-Sep-2007  yamt sync with head.
 1.32.2.1 30-Dec-2006  yamt sync with head.
 1.33.8.1 11-Aug-2006  yamt sync with head
 1.33.4.1 09-Sep-2006  rpaulo sync with head
 1.34.6.1 06-Oct-2006  tsutsui Reorganize IPL macros for proper splraiseipl() implementation:
- merge HP300_IPL_* and IPL_* macros
- prepare independent _IPL_SOFT_* macro to determine softintr(9) handlers
- rename hp300_ipls[] array to hp300_ipl2psl[]
- then use these macro for makeiplcookie() and splraiseipl()
Tested on HP382.
 1.34.4.1 12-Jan-2007  ad Sync with head.
 1.35.14.1 03-Oct-2007  garbled Sync with HEAD
 1.35.6.1 15-Jul-2007  ad Sync with head.
 1.36.10.2 09-Jan-2008  matt sync with HEAD
 1.36.10.1 06-Nov-2007  matt sync with HEAD
 1.36.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.37.4.1 08-Dec-2007  ad Sync with head.
 1.37.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.38.12.3 29-Jun-2008  mjf Sync with HEAD.
 1.38.12.2 02-Jun-2008  mjf Sync with HEAD.
 1.38.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.39.4.3 11-Aug-2010  yamt sync with head.
 1.39.4.2 04-May-2009  yamt sync with head.
 1.39.4.1 16-May-2008  yamt sync with head.
 1.39.2.2 17-Jun-2008  yamt sync with head.
 1.39.2.1 18-May-2008  yamt sync with head.
 1.40.4.2 27-Jun-2008  simonb Sync with head.
 1.40.4.1 18-Jun-2008  simonb Sync with head.
 1.40.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.42.18.1 03-Jul-2010  rmind sync with head
 1.42.16.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.44.4.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.17 24-Mar-2014  christos - remove unused
- use cpu_{g,s}etmodel
 1.16 19-Jul-2006  tsutsui branches: 1.16.96; 1.16.106; 1.16.112;
Define base address offsets of intio devices in intioreg.h
and replace various magic numbers with the macro.
 1.15 11-Dec-2005  christos branches: 1.15.4; 1.15.8;
merge ktrace-lwp.
 1.14 03-Jun-2005  tsutsui branches: 1.14.2;
Replace badbaddr() with hp300_bus_space_probe() to avoid -Wcast-qual warning.
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.12 05-May-1997  thorpej branches: 1.12.56;
Do a bit of spring cleaning.
 1.11 27-Apr-1997  thorpej These files depend on things in <machine/hp300spu.h>
 1.10 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall.
 1.9 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.8 30-Jan-1997  thorpej - Use indicies, rather than pointer arithmetic, to track DMA chain
segments.
- Use a much more obvious DMA job queueing scheme.
- Fixup some debugging code.
 1.7 09-Dec-1996  thorpej Garbage-collect DMAINTLVL; it's not needed any more.
 1.6 02-Dec-1995  thorpej Make the DMA controller driver a little more new config-friendly. Still
more work to do, but this is a step in the right direction.
 1.5 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.12.56.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.56.1 03-Aug-2004  skrll Sync with HEAD
 1.14.2.1 30-Dec-2006  yamt sync with head.
 1.15.8.1 11-Aug-2006  yamt sync with head
 1.15.4.1 09-Sep-2006  rpaulo sync with head
 1.16.112.1 18-May-2014  rmind sync with head
 1.16.106.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.96.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15 16-Jan-2024  thorpej Fix computation of the appropriate auto-vector interrupt level to use
for the DMA controller by tracking all of the DIO devices that have
"ISRPRI_BIO" interrupt handlers, and finding the highest auto-vector
level among them and informing the DMA controller.

Previously, in a post-flattening world, the DMA controller was always
told to interrupt at lev5, which is fine I guess although definitely not
ideal, but would not work on aaaancient HP320 Rev A DMA boards. To that
effect, print a warning if a Rev B DMA board ends up at ipl != 3 (we can't
differentiate between a Rev A and a Rev B board).
 1.14 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.13 11-Dec-2005  christos branches: 1.13.74; 1.13.76; 1.13.78;
merge ktrace-lwp.
 1.12 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.10 04-Oct-1997  thorpej branches: 1.10.50;
Copyright assigned to The NetBSD Foundation.
 1.9 01-Apr-1997  scottr branches: 1.9.4;
Add prototypes, and make this compile with -Wall.
 1.8 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.7 30-Jan-1997  thorpej - Use indicies, rather than pointer arithmetic, to track DMA chain
segments.
- Use a much more obvious DMA job queueing scheme.
- Fixup some debugging code.
 1.6 09-Dec-1996  thorpej Defer hooking up the DMA controller interrupt. Add a new funciton,
dmacomputeipl(), which is called by drivers which use DMA once they've
hooked up their interrupts. This new function computes the appropriate
ipl to use for the DMA controller and (re-)establishes it's interrupt.
 1.5 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.50.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.50.3 18-Sep-2004  skrll Sync with HEAD.
 1.10.50.2 03-Sep-2004  skrll Sync with HEAD
 1.10.50.1 03-Aug-2004  skrll Sync with HEAD
 1.13.78.1 16-May-2008  yamt sync with head.
 1.13.76.1 18-May-2008  yamt sync with head.
 1.13.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.16 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.15 16-Jan-2024  thorpej branches: 1.15.2;
Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.14 15-Jan-2023  tsutsui TAB/space cleanup.
 1.13 07-Aug-2021  thorpej branches: 1.13.6;
Merge thorpej-cfargs2.
 1.12 24-Apr-2021  thorpej branches: 1.12.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.11 26-Dec-2020  tsutsui branches: 1.11.2;
Fix a longstanding bug in hilkbd (and dnkbd) console attachment.

cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.
Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.
Should be pulleld up to netbsd-8 and netbsd-9.
 1.10 08-Apr-2017  tsutsui branches: 1.10.6; 1.10.18; 1.10.26;
Remove auto-repeat key functions in WSKBD_RAW mode.

Pulled from OpenBSD:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/hp300/dev/Attic/dnkbd.c#rev1.18
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/hil/hilkbd.c#rev1.15
> WSKBD_RAW mode used in X, but X independently implements auto-repeat keys.

Tested with Xorg server on HP425t with topcat.
 1.9 25-Mar-2017  tsutsui In RAWKBD mode, don't schedule autorepeat callout(9) after KEY_UP events.

Now Apollo Domain keyboard works propery on Xorg server on my 425t.
Changes are taken from sys/dev/hil/hilkbd.c.

Note as OpenBSD says in the following commit log:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/hp300/dev/Attic/dnkbd.c#rev1.18
>> Auto-repeat keys in WSKBD_RAW mode is not needed.
>> WSKBD_RAW mode used in X, but X independently implements auto-repeat keys.
these autorepeat code will be removed later, but I commit this fix first
for the record.
 1.8 25-Mar-2017  tsutsui Send break signal to reset keyboard state before keyboard probe.

Now Apollo Domain keyboard is probed properly even after
any keys are typed before boot (i.e. on bootloader prompt).

Tested on 425e and A1630-82001 keyboard
(that were contributed by Miod Vallat).
 1.7 24-Apr-2014  tsutsui branches: 1.7.4; 1.7.8; 1.7.12;
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
 1.6 24-Apr-2014  tsutsui Make the Apollo Domain keyboard actually work.

Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
 1.5 18-Feb-2011  tsutsui branches: 1.5.2; 1.5.6; 1.5.8; 1.5.14; 1.5.18; 1.5.22; 1.5.32;
Use aprint_normal(9) and variants.
 1.4 12-Feb-2011  tsutsui branches: 1.4.2;
- make local functions static
- some KNF
 1.3 12-Feb-2011  tsutsui Fix one more porting botch inside #ifdef WSDISPLAY_COMPAT_RAWKBD.
 1.2 12-Feb-2011  tsutsui Make this compile properly with options WSDISPLAY_COMPAT_RAWKBD.
 1.1 12-Feb-2011  tsutsui Pull Apollo Domain keyboard and mouse support from OpenBSD.
Untested (no hardware), but no bad sideeffect on 425t without Domain keyboard.

This is the last portion of "new hp300 kernel features" submitted in
PR port-hp300/3528 back in 1997, and I think finally we can close it.
 1.4.2.3 05-Mar-2011  bouyer Sync with HEAD
 1.4.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.4.2.1 12-Feb-2011  bouyer file dnkbd.c was added on branch bouyer-quota2 on 2011-02-17 11:59:38 +0000
 1.5.32.1 10-Aug-2014  tls Rebase.
 1.5.22.1 18-May-2014  rmind sync with head
 1.5.18.2 03-Dec-2017  jdolecek update from HEAD
 1.5.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.14.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.5.8.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.5.6.1 18-Feb-2011  jruoho file dnkbd.c was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.5.2.2 05-Mar-2011  rmind sync with head
 1.5.2.1 18-Feb-2011  rmind file dnkbd.c was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.7.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.7.8.1 26-Apr-2017  pgoyette Sync with HEAD
 1.7.4.1 28-Aug-2017  skrll Sync with HEAD
 1.10.26.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.10.18.1 28-Dec-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #1161):

sys/arch/hp300/dev/dnkbd.c: revision 1.11
sys/arch/hp300/dev/hil_intio.c: revision 1.4

Fix a longstanding bug in hilkbd (and dnkbd) console attachment.
cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.

Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.

Should be pulleld up to netbsd-8 and netbsd-9.
 1.10.6.1 28-Dec-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #1642):

sys/arch/hp300/dev/dnkbd.c: revision 1.11
sys/arch/hp300/dev/hil_intio.c: revision 1.4

Fix a longstanding bug in hilkbd (and dnkbd) console attachment.
cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.

Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.

Should be pulleld up to netbsd-8 and netbsd-9.
 1.11.2.1 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.12.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.13.6.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.15.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 19-Feb-2011  tsutsui branches: 1.3.2; 1.3.6;
u_int8_t -> uint8_t
 1.2 12-Feb-2011  tsutsui branches: 1.2.2;
Make sure to include "opt_wsdisplay_compat.h" for WSDISPLAY_COMPAT_RAWKBD.
 1.1 12-Feb-2011  tsutsui Pull Apollo Domain keyboard and mouse support from OpenBSD.
Untested (no hardware), but no bad sideeffect on 425t without Domain keyboard.

This is the last portion of "new hp300 kernel features" submitted in
PR port-hp300/3528 back in 1997, and I think finally we can close it.
 1.2.2.3 05-Mar-2011  bouyer Sync with HEAD
 1.2.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.2.2.1 12-Feb-2011  bouyer file dnkbdmap.c was added on branch bouyer-quota2 on 2011-02-17 11:59:38 +0000
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 19-Feb-2011  jruoho file dnkbdmap.c was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 19-Feb-2011  rmind file dnkbdmap.c was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.2 19-Feb-2011  tsutsui branches: 1.2.2; 1.2.6;
u_int8_t -> uint8_t
 1.1 12-Feb-2011  tsutsui branches: 1.1.2;
Pull Apollo Domain keyboard and mouse support from OpenBSD.
Untested (no hardware), but no bad sideeffect on 425t without Domain keyboard.

This is the last portion of "new hp300 kernel features" submitted in
PR port-hp300/3528 back in 1997, and I think finally we can close it.
 1.1.2.3 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 12-Feb-2011  bouyer file dnkbdmap.h was added on branch bouyer-quota2 on 2011-02-17 11:59:38 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 19-Feb-2011  jruoho file dnkbdmap.h was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 19-Feb-2011  rmind file dnkbdmap.h was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.5 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.4 15-Jan-2023  tsutsui branches: 1.4.6;
TAB/space cleanup.
 1.3 18-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.90;
Use aprint_normal(9) and variants.
 1.2 12-Feb-2011  tsutsui - make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.4 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file dvbox.c was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.3.90.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 18-Feb-2011  jruoho file dvbox.c was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 18-Feb-2011  rmind file dvbox.c was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.4.6.1 02-Aug-2025  perseant Sync with HEAD
 1.2 12-Feb-2011  tsutsui branches: 1.2.2; 1.2.6;
- make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file dvboxreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 12-Feb-2011  jruoho file dvboxreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 12-Feb-2011  rmind file dvboxreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.44 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.43 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42 24-Apr-2021  thorpej branches: 1.42.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.41 29-Sep-2020  msaitoh branches: 1.41.4;
s/occurence/occurrence/
 1.40 24-Mar-2014  christos - remove unused
- use cpu_{g,s}etmodel
 1.39 28-Apr-2008  martin branches: 1.39.34; 1.39.44; 1.39.50;
Remove clause 3 and 4 from TNF licenses
 1.38 29-Mar-2008  tsutsui branches: 1.38.2; 1.38.4;
Split device_t/softc, and misc cosmetic changes.
 1.37 05-Dec-2007  tsutsui branches: 1.37.12;
Use queue(3) macro.
 1.36 17-Oct-2007  garbled branches: 1.36.2; 1.36.4;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.35 12-Jul-2007  he branches: 1.35.8; 1.35.10;
Adapt to the new signature of callout_init().
 1.34 21-Jul-2006  tsutsui branches: 1.34.14; 1.34.22;
Use bus_space_map(9) and bus_space_vaddr(9) rather than iomap().
 1.33 21-Jul-2006  tsutsui Some KNF.
 1.32 28-Mar-2006  thorpej Use device_unit().
 1.31 23-Feb-2006  thorpej branches: 1.31.2; 1.31.4; 1.31.6;
Use device_parent().
 1.30 11-Dec-2005  christos branches: 1.30.2; 1.30.4; 1.30.6;
merge ktrace-lwp.
 1.29 28-Aug-2004  thorpej branches: 1.29.12;
Use ANSI function decls, static, and const.
 1.28 17-Nov-2003  tsutsui TAB/space cleanup.
 1.27 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.26 24-May-2003  gmcgarry branches: 1.26.2;
Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.25 03-May-2003  wiz DMA, not dma nor Dma.
 1.24 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.23 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.22 15-Mar-2002  gmcgarry Add RCSIDs.
 1.21 23-Mar-2000  thorpej branches: 1.21.8; 1.21.12;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.20 12-Jan-1998  thorpej branches: 1.20.14;
Update for changes to config.
 1.19 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.18 05-May-1997  thorpej branches: 1.18.4;
Use dio_intr_establish().
 1.17 14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.16 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.15 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.14 30-Jan-1997  thorpej - Convert these drivers to new-style autoconfiguration. Old-style
configuration is no longer supported.
- Use a much more obvious HP-IB job queueing scheme.
 1.13 13-Oct-1996  christos backout previous kprintf changes
 1.12 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.11 18-May-1996  thorpej Back most (not all) of the previous delay-related changes now that
delay is calibrated properly.
 1.10 17-May-1996  thorpej Change "DELAY(1)" to "DELAY(5)". This is basically equivalent to how
the old implementation of DELAY() behaved with small values.
 1.9 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.8 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.7 19-Nov-1995  thorpej Do an indirect driver a little more like an indirect driver would like to
be done. Set up a structure filled with function pointers in the
controller-specific probe routines, and jump through them, instead of
if()'ing our way though each operation.

Be a little more discriptive; print out the controller type found
during the probe in a way that's somewhat meaningful.
 1.6 07-Jan-1995  mycroft Various diffs from Mike Hibler; necessary for mt driver.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.18.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.20.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.21.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.21.12.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.21.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.21.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.26.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.26.2.2 03-Sep-2004  skrll Sync with HEAD
 1.26.2.1 03-Aug-2004  skrll Sync with HEAD
 1.29.12.4 07-Dec-2007  yamt sync with head
 1.29.12.3 03-Sep-2007  yamt sync with head.
 1.29.12.2 30-Dec-2006  yamt sync with head.
 1.29.12.1 21-Jun-2006  yamt sync with head.
 1.30.6.1 22-Apr-2006  simonb Sync with head.
 1.30.4.1 09-Sep-2006  rpaulo sync with head
 1.30.2.1 01-Mar-2006  yamt sync with head.
 1.31.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.31.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.31.2.2 11-Aug-2006  yamt sync with head
 1.31.2.1 01-Apr-2006  yamt sync with head.
 1.34.22.1 03-Oct-2007  garbled Sync with HEAD
 1.34.14.1 15-Jul-2007  ad Sync with head.
 1.35.10.2 09-Jan-2008  matt sync with HEAD
 1.35.10.1 06-Nov-2007  matt sync with HEAD
 1.35.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.36.4.1 08-Dec-2007  ad Sync with head.
 1.36.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.37.12.2 02-Jun-2008  mjf Sync with HEAD.
 1.37.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.38.4.1 16-May-2008  yamt sync with head.
 1.38.2.1 18-May-2008  yamt sync with head.
 1.39.50.1 18-May-2014  rmind sync with head
 1.39.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.39.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.41.4.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.42.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 26-Oct-1994  cgd branches: 1.4.66;
new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.66.1 03-Aug-2004  skrll Sync with HEAD
 1.36 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.35 25-Nov-2022  tsutsui Service mode switch should not be treated as an error.

Use aprint_normal(9) to avoid confusing dmesg.
 1.34 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.33 24-Apr-2021  thorpej branches: 1.33.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.32 30-Apr-2014  tsutsui branches: 1.32.42;
Probe mcclock only on 425e to avoid an extra "not configured" message.
 1.31 19-Apr-2014  tsutsui Add proper RealTime Clock support for HP9000/425e.

As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.

Tested on HP425e (with mcclock) and HP362 (with old rtc).
 1.30 12-Feb-2011  tsutsui branches: 1.30.4; 1.30.10; 1.30.14; 1.30.18; 1.30.28;
Fix comment (362 doesn't have frodo).
 1.29 28-Apr-2008  martin branches: 1.29.22; 1.29.28; 1.29.30;
Remove clause 3 and 4 from TNF licenses
 1.28 29-Mar-2008  tsutsui branches: 1.28.2; 1.28.4;
Split device_t/softc, and misc cosmetic changes.
 1.27 04-Mar-2007  christos branches: 1.27.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 20-Jul-2006  tsutsui branches: 1.26.10;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.25 19-Jul-2006  tsutsui some KNF
 1.24 19-Jul-2006  tsutsui Use iobase address passed from attach args.
 1.23 24-Dec-2005  perry branches: 1.23.4; 1.23.8;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.22 11-Dec-2005  christos merge ktrace-lwp.
 1.21 26-Aug-2005  drochner s/locdesc_t/int/g
 1.20 28-Jun-2005  drochner branches: 1.20.2;
convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)
 1.19 02-Jan-2005  tsutsui u_intNN_t -> uintNN_t
 1.18 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.17 07-Apr-2004  tsutsui Adjust fd_name in struct frodo_device frodo_subdevs[]
since MD apci(4) has been switched to MI com(4).
 1.16 17-Nov-2003  tsutsui branches: 1.16.2;
TAB/space cleanup.
 1.15 08-Nov-2003  tsutsui Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.14 01-Jan-2003  thorpej branches: 1.14.2;
Use aprint_normal() for cfprint routines.
 1.13 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.11 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.10 17-Mar-2002  gmcgarry Don't match on trailing spaces in the module name.
 1.9 15-Mar-2002  gmcgarry Add RCSIDs.
 1.8 08-Dec-2001  gmcgarry Update for structural interrupt changes. No functional change.
 1.7 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.6 17-Nov-2001  gmcgarry Update for new intio parent interface.
 1.5 31-Jul-1999  thorpej branches: 1.5.16; 1.5.20;
Skip "serial 1" on non-425e models. It's mapped to DCA at 9 on every
other 4xx model, and the "not configured" could be pretty annoying.
 1.4 12-Jan-1998  thorpej branches: 1.4.10;
Update for changes to config.
 1.3 11-Jan-1998  thorpej ia->ia_addr is a physical address, not a kernel virtual address.
 1.2 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 12-May-1997  thorpej branches: 1.1.4;
Add a driver for the Apollo Utility Chip (a.k.a. "frodo"), contributed
by Mike Smith <mike@pressed.spam.frisbee.net.au>, with some changes to
the autoconfiguration model and slight changes to the interrupt glue
by me.
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.10.1 02-Aug-1999  thorpej Update from trunk.
 1.5.20.4 03-Jan-2003  thorpej Sync with HEAD.
 1.5.20.3 18-Oct-2002  nathanw Catch up to -current.
 1.5.20.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.5.20.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.16.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.16.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.14.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.2 03-Sep-2004  skrll Sync with HEAD
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.2.1 11-Apr-2004  jmc Pullup rev 1.17 (requested by tsutsui in ticket #116)

Adjust fd_name in struct frodo_device frodo_subdevs[]
since MD apci(4) has been switched to MI com(4).
Adjust FRODO_BASE macro since com_frodo uses bus_space_map(9)
which takes offset from intiobase instead of KVA.
It turns out that not only HP425e but other HP4xx models also require
COM_HW_NOIEN for APCI com(4) ports.
 1.20.2.3 03-Sep-2007  yamt sync with head.
 1.20.2.2 30-Dec-2006  yamt sync with head.
 1.20.2.1 21-Jun-2006  yamt sync with head.
 1.23.8.1 11-Aug-2006  yamt sync with head
 1.23.4.1 09-Sep-2006  rpaulo sync with head
 1.26.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.27.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.28.4.1 16-May-2008  yamt sync with head.
 1.28.2.1 18-May-2008  yamt sync with head.
 1.29.30.1 17-Feb-2011  bouyer Sync with HEAD
 1.29.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.22.1 05-Mar-2011  rmind sync with head
 1.30.28.1 10-Aug-2014  tls Rebase.
 1.30.18.1 18-May-2014  rmind sync with head
 1.30.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.30.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.32.42.2 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.32.42.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.33.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 15-Jan-2023  tsutsui TAB/space cleanup.
 1.5 19-Apr-2014  tsutsui branches: 1.5.58;
Add proper RealTime Clock support for HP9000/425e.

As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.

Tested on HP425e (with mcclock) and HP362 (with old rtc).
 1.4 19-Jul-2006  tsutsui branches: 1.4.96; 1.4.102; 1.4.106; 1.4.112; 1.4.122;
Define base address offsets of intio devices in intioreg.h
and replace various magic numbers with the macro.
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.8;
merge ktrace-lwp.
 1.2 07-Apr-2004  tsutsui branches: 1.2.12;
Adjust FRODO_BASE macro since com_frodo uses bus_space_map(9)
which takes offset from intiobase instead of KVA.

Now com* at frodo? is probed properly.
(but not tested because I don't have a special cable for apci ports yet)
 1.1 12-May-1997  thorpej branches: 1.1.56; 1.1.58;
Add a driver for the Apollo Utility Chip (a.k.a. "frodo"), contributed
by Mike Smith <mike@pressed.spam.frisbee.net.au>, with some changes to
the autoconfiguration model and slight changes to the interrupt glue
by me.
 1.1.58.1 11-Apr-2004  jmc Pullup rev 1.2 (requested by tsutsui in ticket #116)

Adjust fd_name in struct frodo_device frodo_subdevs[]
since MD apci(4) has been switched to MI com(4).
Adjust FRODO_BASE macro since com_frodo uses bus_space_map(9)
which takes offset from intiobase instead of KVA.
It turns out that not only HP425e but other HP4xx models also require
COM_HW_NOIEN for APCI com(4) ports.
 1.1.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.56.1 03-Aug-2004  skrll Sync with HEAD
 1.2.12.1 30-Dec-2006  yamt sync with head.
 1.3.8.1 11-Aug-2006  yamt sync with head
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.122.1 10-Aug-2014  tls Rebase.
 1.4.112.1 18-May-2014  rmind sync with head
 1.4.106.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.102.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.4.96.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.58.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 29-Mar-2008  tsutsui branches: 1.8.2; 1.8.4;
Split device_t/softc, and misc cosmetic changes.
 1.7 11-Dec-2005  christos branches: 1.7.74;
merge ktrace-lwp.
 1.6 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.5 08-Nov-2003  tsutsui Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.4 04-Oct-1997  thorpej branches: 1.4.50;
Copyright assigned to The NetBSD Foundation.
 1.3 19-Jul-1997  kleink branches: 1.3.2;
Add missing `#include "locators.h"' from last commit.
 1.2 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.1 12-May-1997  thorpej Add a driver for the Apollo Utility Chip (a.k.a. "frodo"), contributed
by Mike Smith <mike@pressed.spam.frisbee.net.au>, with some changes to
the autoconfiguration model and slight changes to the interrupt glue
by me.
 1.3.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.50.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.50.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.50.2 03-Sep-2004  skrll Sync with HEAD
 1.4.50.1 03-Aug-2004  skrll Sync with HEAD
 1.7.74.2 02-Jun-2008  mjf Sync with HEAD.
 1.7.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.4.1 16-May-2008  yamt sync with head.
 1.8.2.1 18-May-2008  yamt sync with head.
 1.4 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.3 18-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.96;
Use aprint_normal(9) and variants.
 1.2 12-Feb-2011  tsutsui - make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.4 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file gbox.c was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.3.96.1 02-Aug-2025  perseant Sync with HEAD
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 18-Feb-2011  jruoho file gbox.c was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 18-Feb-2011  rmind file gbox.c was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.2 12-Feb-2011  tsutsui branches: 1.2.2; 1.2.6;
- make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file gboxreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 12-Feb-2011  jruoho file gboxreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 12-Feb-2011  rmind file gboxreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.2 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.1 12-Feb-2011  tsutsui branches: 1.1.2; 1.1.4; 1.1.8; 1.1.98;
Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.1.98.1 02-Aug-2025  perseant Sync with HEAD
 1.1.8.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.8.1 12-Feb-2011  jruoho file gendiofb.c was added on branch jruoho-x86intr on 2011-06-06 09:05:35 +0000
 1.1.4.2 05-Mar-2011  rmind sync with head
 1.1.4.1 12-Feb-2011  rmind file gendiofb.c was added on branch rmind-uvmplock on 2011-03-05 20:50:21 +0000
 1.1.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 12-Feb-2011  bouyer file gendiofb.c was added on branch bouyer-quota2 on 2011-02-17 11:59:39 +0000
 1.67 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.66 17-Jun-2008  he branches: 1.66.18; 1.66.24; 1.66.26;
Remove now unused local "unit" variable, so this builds again.
 1.65 13-Jun-2008  cegger use device_lookup_private to get softc
 1.64 29-Mar-2008  tsutsui branches: 1.64.2; 1.64.4; 1.64.6; 1.64.8;
Split device_t/softc, and misc cosmetic changes.
 1.63 25-Jan-2008  oster branches: 1.63.6;
Fix fallout from v_specinfo removal. hp300 builds again.
 1.62 31-Dec-2007  ad Remove COMPAT_HPUX.
 1.61 04-Mar-2007  christos branches: 1.61.20; 1.61.26; 1.61.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.60 21-Jul-2006  tsutsui branches: 1.60.10;
Some KNF.
 1.59 19-Jul-2006  tsutsui Define base address offsets of intio devices in intioreg.h
and replace various magic numbers with the macro.
 1.58 11-Dec-2005  christos branches: 1.58.4; 1.58.8;
merge ktrace-lwp.
 1.57 19-Feb-2005  tsutsui branches: 1.57.6;
Include "ioconf.h" for struct cfdriver *_cd decls.
 1.56 28-Aug-2004  thorpej branches: 1.56.4; 1.56.6;
Use ANSI function decls, static, and const.
 1.55 17-Nov-2003  tsutsui TAB/space cleanup.
 1.54 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.53 29-Jun-2003  fvdl branches: 1.53.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.52 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.51 23-Feb-2003  he Cast the result of VM_DEFAULT_ADDRESS to caddr_t, to make this compile again.
 1.50 20-Feb-2003  atatat Introduce "top down" memory management for mmap()ed allocations. This
means that the dynamic linker gets mapped in at the top of available
user virtual memory (typically just below the stack), shared libraries
get mapped downwards from that point, and calls to mmap() that don't
specify a preferred address will get mapped in below those.

This means that the heap and the mmap()ed allocations will grow
towards each other, allowing one or the other to grow larger than
before. Previously, the heap was limited to MAXDSIZ by the placement
of the dynamic linker (and the process's rlimits) and the space
available to mmap was hobbled by this reservation.

This is currently only enabled via an *option* for the i386 platform
(though other platforms are expected to follow). Add "options
USE_TOPDOWN_VM" to your kernel config file, rerun config, and rebuild
your kernel to take advantage of this.

Note that the pmap_prefer() interface has not yet been modified to
play nicely with this, so those platforms require a bit more work
(most notably the sparc) before they can use this new memory
arrangement.

This change also introduces a VM_DEFAULT_ADDRESS() macro that picks
the appropriate default address based on the size of the allocation or
the size of the process's text segment accordingly. Several drivers
and the SYSV SHM address assignment were changed to use this instead
of each one picking their own "default".
 1.49 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.48 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.47 10-Oct-2002  jdolecek replace the somewhat strange poll routine with standard nopoll() (a.k.a
seltrue())
 1.46 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.45 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.44 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.43 15-Mar-2002  gmcgarry branches: 1.43.4;
malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.42 26-Dec-2001  thorpej Remove (incorrect) extern decl of emul_hpux.
 1.41 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.40 17-Nov-2001  gmcgarry Don't try to mmap the framebuffer as executable. Fixes MMU faults
when executing the X server.
 1.39 04-Apr-2001  tsutsui branches: 1.39.2; 1.39.4; 1.39.8;
Remove an unused variable which was caused on KERN_* error code removal.
 1.38 15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.37 29-Jun-2000  mrg branches: 1.37.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.36 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.35 22-Jun-1999  oster branches: 1.35.2; 1.35.12;
Add a '#include <sys/resourcevar.h>' to each of these to allow them
to compile again.
 1.34 18-Jun-1999  thorpej Add the guts of mlockall(MCL_FUTURE). This requires that a process's
"memlock" resource limit to uvm_mmap(). Update all calls accordingly.
 1.33 10-Apr-1999  drochner remove unneeded old-vm includes
 1.32 24-Mar-1999  mrg branches: 1.32.2;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.31 11-Oct-1998  chuck remove unused share map code from UVM:
- update calls to uvm_unmap_remove/uvm_unmap (mainonly boolean arg
has been removed)
 1.30 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.29 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.28 16-Feb-1998  thorpej Add support for UVM.
 1.27 12-Jan-1998  thorpej Update for changes to config.
 1.26 12-Oct-1997  thorpej Remove extern declaration of devioc[].
 1.25 02-Apr-1997  scottr branches: 1.25.4;
Fix printf() and other warnings when compiled with DEBUG defined.
 1.24 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.23 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.22 10-Jan-1997  scottr Normally, iteon() returns an int. If NITE == 0, define iteon() to be 0.
Closes PR 3091.
 1.21 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.20 13-Oct-1996  christos backout previous kprintf changes
 1.19 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.18 12-Sep-1996  thorpej Update for poll(2) changes.
 1.17 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.16 28-Nov-1995  thorpej Update a #include for the "new" location of HP-UX emulation code.
 1.15 19-Nov-1995  thorpej Cosmetically change one #include directive.
 1.14 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.13 10-Apr-1995  mycroft Switch grfmap and grfmmap.
 1.12 26-Oct-1994  cgd new RCS ID format.
 1.11 25-May-1994  mycroft Merge with 4.4-Lite.
 1.10 17-May-1994  cgd pass pointer to vm_map, not vm_map
 1.9 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.8 04-May-1994  mycroft Update to match proc.h.
 1.7 08-Apr-1994  hpeyerl Delete MAP_FILE here too.
 1.6 10-Feb-1994  mycroft Rearrange some #includes.
 1.5 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.4 12-Nov-1993  cgd new specfs.h and fifo.h locations
 1.3 06-Sep-1993  mycroft Add missing arg to vm_mmap() call in grfmmap().
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.25.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.32.2.1 15-Apr-1999  kleink branches: 1.32.2.1.2;
Pull up rev. 1.33; approved by perry.
 1.32.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.32.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.35.12.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.35.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.35.2.2 27-Mar-2001  bouyer Sync with HEAD.
 1.35.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.37.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.39.8.12 03-Jan-2003  thorpej Sync with HEAD.
 1.39.8.11 11-Nov-2002  nathanw Catch up to -current
 1.39.8.10 18-Oct-2002  nathanw Catch up to -current.
 1.39.8.9 17-Sep-2002  nathanw Catch up to -current.
 1.39.8.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.39.8.7 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.39.8.6 21-Jun-2002  gmcgarry typo
 1.39.8.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.39.8.4 08-Jan-2002  nathanw Catch up to -current.
 1.39.8.3 15-Dec-2001  gmcgarry Pull up revision 1.40 from trunk:

Don't try to mmap the framebuffer as executable. Fixes MMU faults
when executing the X server.
 1.39.8.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.39.8.1 04-Apr-2001  scw file grf.c was added on branch nathanw_sa on 2001-11-18 18:09:32 +0000
 1.39.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.39.2.5 10-Oct-2002  jdolecek use nokqfilter (or seltrue_kqfilter()) for drivers which provide poll
routine very similar to seltrue(); the poll routines would be cleaned
up on trunk
 1.39.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.39.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.39.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.39.2.1 12-Sep-2001  thorpej Add noop kqueue entry points.
 1.43.4.1 17-May-2002  gehenna Add device switch.
 1.53.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.53.2.5 24-Jan-2005  skrll Adapt to branch.
 1.53.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.53.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.53.2.2 03-Sep-2004  skrll Sync with HEAD
 1.53.2.1 03-Aug-2004  skrll Sync with HEAD
 1.56.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.56.4.1 29-Apr-2005  kent sync with -current
 1.57.6.5 04-Feb-2008  yamt sync with head.
 1.57.6.4 21-Jan-2008  yamt sync with head
 1.57.6.3 03-Sep-2007  yamt sync with head.
 1.57.6.2 30-Dec-2006  yamt sync with head.
 1.57.6.1 21-Jun-2006  yamt sync with head.
 1.58.8.1 11-Aug-2006  yamt sync with head
 1.58.4.1 09-Sep-2006  rpaulo sync with head
 1.60.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.61.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.61.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.61.20.2 23-Mar-2008  matt sync with HEAD
 1.61.20.1 09-Jan-2008  matt sync with HEAD
 1.63.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.63.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.64.8.1 18-Jun-2008  simonb Sync with head.
 1.64.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.64.4.1 04-May-2009  yamt sync with head.
 1.64.2.1 17-Jun-2008  yamt sync with head.
 1.66.26.1 08-Feb-2011  bouyer Sync with HEAD
 1.66.24.1 06-Jun-2011  jruoho Sync with HEAD.
 1.66.18.1 05-Mar-2011  rmind sync with head
 1.5 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.4 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.3 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 25-May-1994  mycroft Merge with 4.4-Lite.
 1.41 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.40 28-Apr-2008  martin branches: 1.40.22; 1.40.28; 1.40.30;
Remove clause 3 and 4 from TNF licenses
 1.39 29-Mar-2008  tsutsui branches: 1.39.2; 1.39.4;
Split device_t/softc, and misc cosmetic changes.
 1.38 31-Dec-2007  ad branches: 1.38.6;
Remove COMPAT_HPUX.
 1.37 04-Mar-2007  tsutsui branches: 1.37.20; 1.37.26; 1.37.32;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.36 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 21-Jul-2006  tsutsui branches: 1.35.10;
Use bus_space_map(9) and bus_space_vaddr(9).
 1.34 21-Jul-2006  tsutsui Use more proper macro.
 1.33 21-Jul-2006  tsutsui Some KNF.
 1.32 31-May-2006  tsutsui Use a proper macro to determine I/O size for DIO-II devices.
 1.31 31-May-2006  tsutsui Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.30 11-Dec-2005  christos branches: 1.30.4; 1.30.6; 1.30.8; 1.30.14;
merge ktrace-lwp.
 1.29 02-Jan-2005  tsutsui branches: 1.29.8; 1.29.10; 1.29.18;
u_intNN_t -> uintNN_t
 1.28 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.27 08-Apr-2004  tsutsui Check mapped device VA by badaddr() in cnattach functions for framebuffers.

Now consinit() no longer hangs at least on HP425t with Topcat console.
 1.26 17-Nov-2003  tsutsui branches: 1.26.2;
TAB/space cleanup.
 1.25 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.24 01-Apr-2003  thorpej branches: 1.24.2;
Use PAGE_SIZE rather than NBPG.
 1.23 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.21 17-Mar-2002  gmcgarry branches: 1.21.6;
Don't match on trailing spaces in the module name.
 1.20 15-Mar-2002  gmcgarry Add RCSIDs.
 1.19 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.18 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.17 17-Nov-2001  gmcgarry Update for new intio parent interface.
 1.16 22-Jul-2001  wiz branches: 1.16.6;
seperate -> separate
 1.15 25-Jun-1998  thorpej branches: 1.15.28;
defopt COMPAT_HPUX
 1.14 12-Jan-1998  thorpej Update for changes to config.
 1.13 11-Jan-1998  thorpej ia->ia_addr is of type `bus_addr_t'.
 1.12 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.11 31-Mar-1997  scottr branches: 1.11.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.10 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.9 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.8 05-Oct-1996  thorpej If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.7 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.6 26-Feb-1996  thorpej Avoid accidentally lowering a devices console priority.
 1.5 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.11.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.28.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.15.28.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.28.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.28.1 03-Aug-2001  lukem update to -current
 1.16.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.16.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.16.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.16.6.1 22-Jul-2001  nathanw file grf_dv.c was added on branch nathanw_sa on 2002-01-08 00:24:33 +0000
 1.21.6.1 12-Apr-2004  jmc Pullup patch (requested by tsutsui in ticket #1666)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.24.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.24.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.2 03-Sep-2004  skrll Sync with HEAD
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.2.2 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.26.2.1 11-Apr-2004  jmc branches: 1.26.2.1.2; 1.26.2.1.4;
Pullup rev 1.27 (requested by tsutsui in ticket #117)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.26.2.1.4.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.26.2.1.2.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.29.18.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.29.10.4 21-Jan-2008  yamt sync with head
 1.29.10.3 03-Sep-2007  yamt sync with head.
 1.29.10.2 30-Dec-2006  yamt sync with head.
 1.29.10.1 21-Jun-2006  yamt sync with head.
 1.29.8.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.30.14.1 19-Jun-2006  chap Sync with head.
 1.30.8.2 11-Aug-2006  yamt sync with head
 1.30.8.1 26-Jun-2006  yamt sync with head.
 1.30.6.1 01-Jun-2006  kardel Sync with head.
 1.30.4.1 09-Sep-2006  rpaulo sync with head
 1.35.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.37.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.37.20.1 09-Jan-2008  matt sync with HEAD
 1.38.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.38.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.39.4.1 16-May-2008  yamt sync with head.
 1.39.2.1 18-May-2008  yamt sync with head.
 1.40.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.40.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.40.22.1 05-Mar-2011  rmind sync with head
 1.8 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.7 11-Dec-2005  christos branches: 1.7.100; 1.7.106; 1.7.108;
merge ktrace-lwp.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 26-Oct-1994  cgd branches: 1.5.66;
new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 08-Aug-1993  mycroft Avoid `e-' in numeric constants.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.66.1 03-Aug-2004  skrll Sync with HEAD
 1.7.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.7.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.100.1 05-Mar-2011  rmind sync with head
 1.40 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.39 28-Apr-2008  martin branches: 1.39.22; 1.39.28; 1.39.30;
Remove clause 3 and 4 from TNF licenses
 1.38 29-Mar-2008  tsutsui branches: 1.38.2; 1.38.4;
Split device_t/softc, and misc cosmetic changes.
 1.37 31-Dec-2007  ad branches: 1.37.6;
Remove COMPAT_HPUX.
 1.36 04-Mar-2007  tsutsui branches: 1.36.20; 1.36.26; 1.36.32;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.35 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.34 21-Jul-2006  tsutsui branches: 1.34.10;
Use bus_space_map(9) and bus_space_vaddr(9).
 1.33 21-Jul-2006  tsutsui Use more proper macro.
 1.32 21-Jul-2006  tsutsui Some KNF.
 1.31 31-May-2006  tsutsui Use a proper macro to determine I/O size for DIO-II devices.
 1.30 31-May-2006  tsutsui Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.29 11-Dec-2005  christos branches: 1.29.4; 1.29.6; 1.29.8; 1.29.14;
merge ktrace-lwp.
 1.28 02-Jan-2005  tsutsui branches: 1.28.8; 1.28.10; 1.28.18;
u_intNN_t -> uintNN_t
 1.27 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.26 08-Apr-2004  tsutsui Check mapped device VA by badaddr() in cnattach functions for framebuffers.

Now consinit() no longer hangs at least on HP425t with Topcat console.
 1.25 17-Nov-2003  tsutsui branches: 1.25.2;
TAB/space cleanup.
 1.24 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.23 01-Apr-2003  thorpej branches: 1.23.2;
Use PAGE_SIZE rather than NBPG.
 1.22 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.21 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20 17-Mar-2002  gmcgarry branches: 1.20.6;
Don't match on trailing spaces in the module name.
 1.19 15-Mar-2002  gmcgarry Add RCSIDs.
 1.18 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.17 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.16 17-Nov-2001  gmcgarry Update for new intio parent interface.
 1.15 25-Jun-1998  thorpej branches: 1.15.28; 1.15.32;
defopt COMPAT_HPUX
 1.14 12-Jan-1998  thorpej Update for changes to config.
 1.13 11-Jan-1998  thorpej ia->ia_addr is of type `bus_addr_t'.
 1.12 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.11 31-Mar-1997  scottr branches: 1.11.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.10 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.9 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.8 05-Oct-1996  thorpej If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.7 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.6 26-Feb-1996  thorpej Avoid accidentally lowering a devices console priority.
 1.5 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.11.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.32.3 18-Oct-2002  nathanw Catch up to -current.
 1.15.32.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.15.32.1 08-Jan-2002  nathanw Catch up to -current.
 1.15.28.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.15.28.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.6.1 12-Apr-2004  jmc Pullup patch (requested by tsutsui in ticket #1666)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.23.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.23.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.23.2.2 03-Sep-2004  skrll Sync with HEAD
 1.23.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.2.2 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.25.2.1 11-Apr-2004  jmc branches: 1.25.2.1.2; 1.25.2.1.4;
Pullup rev 1.26 (requested by tsutsui in ticket #117)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.25.2.1.4.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.25.2.1.2.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.28.18.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.28.10.4 21-Jan-2008  yamt sync with head
 1.28.10.3 03-Sep-2007  yamt sync with head.
 1.28.10.2 30-Dec-2006  yamt sync with head.
 1.28.10.1 21-Jun-2006  yamt sync with head.
 1.28.8.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.29.14.1 19-Jun-2006  chap Sync with head.
 1.29.8.2 11-Aug-2006  yamt sync with head
 1.29.8.1 26-Jun-2006  yamt sync with head.
 1.29.6.1 01-Jun-2006  kardel Sync with head.
 1.29.4.1 09-Sep-2006  rpaulo sync with head
 1.34.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.36.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.36.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.36.20.1 09-Jan-2008  matt sync with HEAD
 1.37.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.37.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.38.4.1 16-May-2008  yamt sync with head.
 1.38.2.1 18-May-2008  yamt sync with head.
 1.39.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.39.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.39.22.1 05-Mar-2011  rmind sync with head
 1.7 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.6 11-Dec-2005  christos branches: 1.6.100; 1.6.106; 1.6.108;
merge ktrace-lwp.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 26-Oct-1994  cgd branches: 1.4.66;
new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.66.1 03-Aug-2004  skrll Sync with HEAD
 1.6.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.6.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.100.1 05-Mar-2011  rmind sync with head
 1.38 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.37 28-Apr-2008  martin branches: 1.37.22; 1.37.28; 1.37.30;
Remove clause 3 and 4 from TNF licenses
 1.36 29-Mar-2008  tsutsui branches: 1.36.2; 1.36.4;
Split device_t/softc, and misc cosmetic changes.
 1.35 31-Dec-2007  ad branches: 1.35.6;
Remove COMPAT_HPUX.
 1.34 04-Mar-2007  tsutsui branches: 1.34.20; 1.34.26; 1.34.32;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.33 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.32 21-Jul-2006  tsutsui branches: 1.32.10;
Use bus_space_map(9) and bus_space_vaddr(9).
 1.31 21-Jul-2006  tsutsui Use more proper macro.
 1.30 21-Jul-2006  tsutsui Some KNF.
 1.29 31-May-2006  tsutsui Use a proper macro to determine I/O size for DIO-II devices.
 1.28 31-May-2006  tsutsui Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.27 19-Mar-2006  tsutsui branches: 1.27.2;
- TAB/space cleanup
- use do{}while(/*CONSTCOND*/0) for macro with multiple statements
 1.26 11-Dec-2005  christos branches: 1.26.4; 1.26.6; 1.26.8; 1.26.10; 1.26.12;
merge ktrace-lwp.
 1.25 03-Jun-2005  tsutsui branches: 1.25.2;
Make fbmem volatile to appease gcc -Wcast-qual.
 1.24 02-Jan-2005  tsutsui branches: 1.24.8; 1.24.10;
u_intNN_t -> uintNN_t
 1.23 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.22 08-Apr-2004  tsutsui Check mapped device VA by badaddr() in cnattach functions for framebuffers.

Now consinit() no longer hangs at least on HP425t with Topcat console.
 1.21 17-Nov-2003  tsutsui branches: 1.21.2;
TAB/space cleanup.
 1.20 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.19 01-Apr-2003  thorpej branches: 1.19.2;
Use PAGE_SIZE rather than NBPG.
 1.18 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.17 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.16 15-Mar-2002  gmcgarry branches: 1.16.6;
Add RCSIDs.
 1.15 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.14 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.13 22-Jul-2001  wiz branches: 1.13.6;
seperate -> separate
 1.12 25-Jun-1998  thorpej branches: 1.12.28;
defopt COMPAT_HPUX
 1.11 12-Jan-1998  thorpej Update for changes to config.
 1.10 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.9 31-Mar-1997  scottr branches: 1.9.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.8 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.7 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.6 05-Oct-1996  thorpej If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.5 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.4 26-Feb-1996  thorpej Avoid accidentally lowering a devices console priority.
 1.3 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 25-May-1994  mycroft Merge with 4.4-Lite.
 1.9.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.28.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.12.28.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.28.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.28.1 03-Aug-2001  lukem update to -current
 1.13.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.13.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.13.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.13.6.1 22-Jul-2001  nathanw file grf_hy.c was added on branch nathanw_sa on 2002-01-08 00:24:33 +0000
 1.16.6.1 12-Apr-2004  jmc Pullup patch (requested by tsutsui in ticket #1666)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.19.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.19.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.19.2.2 03-Sep-2004  skrll Sync with HEAD
 1.19.2.1 03-Aug-2004  skrll Sync with HEAD
 1.21.2.2 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.21.2.1 11-Apr-2004  jmc branches: 1.21.2.1.2; 1.21.2.1.4;
Pullup rev 1.22 (requested by tsutsui in ticket #117)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.21.2.1.4.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.21.2.1.2.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.24.10.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.24.8.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.25.2.4 21-Jan-2008  yamt sync with head
 1.25.2.3 03-Sep-2007  yamt sync with head.
 1.25.2.2 30-Dec-2006  yamt sync with head.
 1.25.2.1 21-Jun-2006  yamt sync with head.
 1.26.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.26.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.26.8.3 11-Aug-2006  yamt sync with head
 1.26.8.2 26-Jun-2006  yamt sync with head.
 1.26.8.1 01-Apr-2006  yamt sync with head.
 1.26.6.2 01-Jun-2006  kardel Sync with head.
 1.26.6.1 22-Apr-2006  simonb Sync with head.
 1.26.4.1 09-Sep-2006  rpaulo sync with head
 1.27.2.1 19-Jun-2006  chap Sync with head.
 1.32.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.34.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.34.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.34.20.1 09-Jan-2008  matt sync with HEAD
 1.35.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.35.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.36.4.1 16-May-2008  yamt sync with head.
 1.36.2.1 18-May-2008  yamt sync with head.
 1.37.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.37.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.37.22.1 05-Mar-2011  rmind sync with head
 1.5 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106; 1.4.108;
merge ktrace-lwp.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 26-Oct-1994  cgd branches: 1.2.66;
new RCS ID format.
 1.1 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.4.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 05-Mar-2011  rmind sync with head
 1.8 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.7 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.6 13-Oct-1996  christos backout previous kprintf changes
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.3 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 25-May-1994  mycroft Merge with 4.4-Lite.
 1.42 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.41 06-Feb-2011  tsutsui RENASSIANCE -> RENAISSANCE
 1.40 28-Apr-2008  martin branches: 1.40.22; 1.40.28; 1.40.30;
Remove clause 3 and 4 from TNF licenses
 1.39 29-Mar-2008  tsutsui branches: 1.39.2; 1.39.4;
Split device_t/softc, and misc cosmetic changes.
 1.38 31-Dec-2007  ad branches: 1.38.6;
Remove COMPAT_HPUX.
 1.37 04-Mar-2007  tsutsui branches: 1.37.20; 1.37.26; 1.37.32;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.36 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 21-Jul-2006  tsutsui branches: 1.35.10;
Use bus_space_map(9) and bus_space_vaddr(9).
 1.34 21-Jul-2006  tsutsui Use more proper macro.
 1.33 21-Jul-2006  tsutsui Some KNF.
 1.32 31-May-2006  tsutsui Use a proper macro to determine I/O size for DIO-II devices.
 1.31 31-May-2006  tsutsui Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.30 11-Dec-2005  christos branches: 1.30.4; 1.30.6; 1.30.8; 1.30.14;
merge ktrace-lwp.
 1.29 02-Jan-2005  tsutsui branches: 1.29.8; 1.29.10; 1.29.18;
u_intNN_t -> uintNN_t
 1.28 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.27 08-Apr-2004  tsutsui Check mapped device VA by badaddr() in cnattach functions for framebuffers.

Now consinit() no longer hangs at least on HP425t with Topcat console.
 1.26 17-Nov-2003  tsutsui branches: 1.26.2;
TAB/space cleanup.
 1.25 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.24 01-Apr-2003  thorpej branches: 1.24.2;
Use PAGE_SIZE rather than NBPG.
 1.23 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.21 17-Mar-2002  gmcgarry branches: 1.21.6;
Don't match on trailing spaces in the module name.
 1.20 15-Mar-2002  gmcgarry Add RCSIDs.
 1.19 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.18 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.17 17-Nov-2001  gmcgarry Update for new intio parent interface.
 1.16 22-Jul-2001  wiz branches: 1.16.6;
seperate -> separate
 1.15 25-Jun-1998  thorpej branches: 1.15.28;
defopt COMPAT_HPUX
 1.14 12-Jan-1998  thorpej Update for changes to config.
 1.13 11-Jan-1998  thorpej ia->ia_addr is of type `bus_addr_t'.
 1.12 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.11 31-Mar-1997  scottr branches: 1.11.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.10 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.9 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.8 05-Oct-1996  thorpej If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.7 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.6 26-Feb-1996  thorpej Avoid accidentally lowering a devices console priority.
 1.5 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.11.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.28.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.15.28.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.28.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.28.1 03-Aug-2001  lukem update to -current
 1.16.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.16.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.16.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.16.6.1 22-Jul-2001  nathanw file grf_rb.c was added on branch nathanw_sa on 2002-01-08 00:24:33 +0000
 1.21.6.1 12-Apr-2004  jmc Pullup patch (requested by tsutsui in ticket #1666)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.24.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.24.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.2 03-Sep-2004  skrll Sync with HEAD
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.2.2 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.26.2.1 11-Apr-2004  jmc branches: 1.26.2.1.2; 1.26.2.1.4;
Pullup rev 1.27 (requested by tsutsui in ticket #117)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.26.2.1.4.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.26.2.1.2.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.29.18.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.29.10.4 21-Jan-2008  yamt sync with head
 1.29.10.3 03-Sep-2007  yamt sync with head.
 1.29.10.2 30-Dec-2006  yamt sync with head.
 1.29.10.1 21-Jun-2006  yamt sync with head.
 1.29.8.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.30.14.1 19-Jun-2006  chap Sync with head.
 1.30.8.2 11-Aug-2006  yamt sync with head
 1.30.8.1 26-Jun-2006  yamt sync with head.
 1.30.6.1 01-Jun-2006  kardel Sync with head.
 1.30.4.1 09-Sep-2006  rpaulo sync with head
 1.35.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.37.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.37.20.1 09-Jan-2008  matt sync with HEAD
 1.38.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.38.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.39.4.1 16-May-2008  yamt sync with head.
 1.39.2.1 18-May-2008  yamt sync with head.
 1.40.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.40.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.40.22.1 05-Mar-2011  rmind sync with head
 1.9 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.8 07-Mar-2007  he branches: 1.8.66; 1.8.72; 1.8.74;
Fix an instance of "void *v, x;" and cast to char* before doing
pointer arithmetic.
 1.7 11-Dec-2005  christos branches: 1.7.26;
merge ktrace-lwp.
 1.6 17-Nov-2003  tsutsui branches: 1.6.16;
TAB/space cleanup.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 26-Oct-1994  cgd branches: 1.4.66;
new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.66.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 03-Sep-2007  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.74.1 08-Feb-2011  bouyer Sync with HEAD
 1.8.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.66.1 05-Mar-2011  rmind sync with head
 1.18 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.17 28-Apr-2008  martin branches: 1.17.22; 1.17.28; 1.17.30;
Remove clause 3 and 4 from TNF licenses
 1.16 29-Mar-2008  tsutsui branches: 1.16.2; 1.16.4;
Split device_t/softc, and misc cosmetic changes.
 1.15 04-Mar-2007  tsutsui branches: 1.15.40;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.14 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 19-Mar-2006  tsutsui branches: 1.13.14;
Replace MALLOC(9) with malloc(9) in non critical path.
 1.12 11-Dec-2005  christos branches: 1.12.4; 1.12.6; 1.12.8; 1.12.10; 1.12.12;
merge ktrace-lwp.
 1.11 28-Aug-2004  thorpej branches: 1.11.12;
Use ANSI function decls, static, and const.
 1.10 17-Nov-2003  tsutsui TAB/space cleanup.
 1.9 01-Jan-2003  thorpej branches: 1.9.2;
Use aprint_normal() for cfprint routines.
 1.8 15-Mar-2002  gmcgarry malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.7 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.6 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.5 09-Oct-1997  jtc branches: 1.5.30; 1.5.34;
Fix tipo inherited from old version of TNF copyright template.
 1.4 31-Mar-1997  scottr branches: 1.4.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.3 31-Jan-1997  carrel Patch from thorpej to mark non-console grf's and ite's alive.
 1.2 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.4.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.34.3 03-Jan-2003  thorpej Sync with HEAD.
 1.5.34.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.5.34.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.30.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.30.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.2 03-Sep-2004  skrll Sync with HEAD
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.11.12.2 03-Sep-2007  yamt sync with head.
 1.11.12.1 21-Jun-2006  yamt sync with head.
 1.12.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.12.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.12.8.1 01-Apr-2006  yamt sync with head.
 1.12.6.1 22-Apr-2006  simonb Sync with head.
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.13.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.15.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.16.4.1 16-May-2008  yamt sync with head.
 1.16.2.1 18-May-2008  yamt sync with head.
 1.17.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.17.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.22.1 05-Mar-2011  rmind sync with head
 1.43 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.42 28-Apr-2008  martin branches: 1.42.22; 1.42.28; 1.42.30;
Remove clause 3 and 4 from TNF licenses
 1.41 29-Mar-2008  tsutsui branches: 1.41.2; 1.41.4;
Split device_t/softc, and misc cosmetic changes.
 1.40 31-Dec-2007  ad branches: 1.40.6;
Remove COMPAT_HPUX.
 1.39 04-Mar-2007  tsutsui branches: 1.39.20; 1.39.26; 1.39.32;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.38 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 21-Jul-2006  tsutsui branches: 1.37.10;
Use bus_space_map(9) and bus_space_vaddr(9).
 1.36 21-Jul-2006  tsutsui Use more proper macro.
 1.35 21-Jul-2006  tsutsui Some KNF.
 1.34 31-May-2006  tsutsui Use a proper macro to determine I/O size for DIO-II devices.
 1.33 31-May-2006  tsutsui Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.32 11-Dec-2005  christos branches: 1.32.4; 1.32.6; 1.32.8; 1.32.14;
merge ktrace-lwp.
 1.31 02-Jan-2005  tsutsui branches: 1.31.8; 1.31.10; 1.31.18;
u_intNN_t -> uintNN_t
 1.30 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.29 08-Apr-2004  tsutsui Check mapped device VA by badaddr() in cnattach functions for framebuffers.

Now consinit() no longer hangs at least on HP425t with Topcat console.
 1.28 17-Nov-2003  tsutsui branches: 1.28.2;
TAB/space cleanup.
 1.27 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.26 01-Apr-2003  thorpej branches: 1.26.2;
Use PAGE_SIZE rather than NBPG.
 1.25 28-Jan-2003  wiz unknown, not unkown. Noted by mjl.
 1.24 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.23 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.22 17-Mar-2002  gmcgarry branches: 1.22.6;
Don't match on trailing spaces in the module name.
 1.21 15-Mar-2002  gmcgarry Add RCSIDs.
 1.20 16-Dec-2001  gmcgarry When attaching as console, unmap the device on failure.
 1.19 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.18 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.17 17-Nov-2001  gmcgarry Update for new intio parent interface.
 1.16 22-Jul-2001  wiz branches: 1.16.6;
seperate -> separate
 1.15 25-Jun-1998  thorpej branches: 1.15.28;
defopt COMPAT_HPUX
 1.14 12-Jan-1998  thorpej Update for changes to config.
 1.13 11-Jan-1998  thorpej ia->ia_addr is of type `bus_addr_t'.
 1.12 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.11 31-Mar-1997  scottr branches: 1.11.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.10 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.9 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.8 05-Oct-1996  thorpej If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.7 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.6 26-Feb-1996  thorpej Avoid accidentally lowering a devices console priority.
 1.5 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.11.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.28.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.15.28.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.28.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.28.1 03-Aug-2001  lukem update to -current
 1.16.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.16.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.16.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.16.6.1 22-Jul-2001  nathanw file grf_tc.c was added on branch nathanw_sa on 2002-01-08 00:24:34 +0000
 1.22.6.1 12-Apr-2004  jmc Pullup patch (requested by tsutsui in ticket #1666)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.26.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.26.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.26.2.2 03-Sep-2004  skrll Sync with HEAD
 1.26.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.2.2 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.28.2.1 11-Apr-2004  jmc branches: 1.28.2.1.2; 1.28.2.1.4;
Pullup rev 1.29 (requested by tsutsui in ticket #117)

Check mapped device VA by badaddr() in cnattach functions for framebuffers.
 1.28.2.1.4.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.28.2.1.2.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #10634):
sys/arch/hp300/dev/grf_rb.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_tc.c: revision 1.33 via patch
sys/arch/hp300/dev/grf_hy.c: revision 1.28 via patch
sys/arch/hp300/dev/grf_dv.c: revision 1.31 via patch
sys/arch/hp300/dev/grf_gb.c: revision 1.30 via patch
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.31.18.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.31.10.4 21-Jan-2008  yamt sync with head
 1.31.10.3 03-Sep-2007  yamt sync with head.
 1.31.10.2 30-Dec-2006  yamt sync with head.
 1.31.10.1 21-Jun-2006  yamt sync with head.
 1.31.8.1 04-Jun-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1348):
sys/arch/hp300/dev/grf_rb.c: revision 1.31
sys/arch/hp300/dev/grf_tc.c: revision 1.33
sys/arch/hp300/dev/grf_hy.c: revision 1.28
sys/arch/hp300/dev/grf_dv.c: revision 1.31
sys/arch/hp300/dev/grf_gb.c: revision 1.30
Check scode range for DIO-II based framebuffers correctly
in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
 1.32.14.1 19-Jun-2006  chap Sync with head.
 1.32.8.2 11-Aug-2006  yamt sync with head
 1.32.8.1 26-Jun-2006  yamt sync with head.
 1.32.6.1 01-Jun-2006  kardel Sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.37.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.39.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.39.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.39.20.1 09-Jan-2008  matt sync with HEAD
 1.40.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.40.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.41.4.1 16-May-2008  yamt sync with head.
 1.41.2.1 18-May-2008  yamt sync with head.
 1.42.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.42.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.42.22.1 05-Mar-2011  rmind sync with head
 1.9 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.8 11-Dec-2005  christos branches: 1.8.100; 1.8.106; 1.8.108;
merge ktrace-lwp.
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 26-Oct-1994  cgd branches: 1.6.66;
new RCS ID format.
 1.5 25-May-1994  mycroft Merge with 4.4-Lite.
 1.4 08-Aug-1993  mycroft Avoid `e-' in numeric constants.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.66.1 03-Aug-2004  skrll Sync with HEAD
 1.8.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.8.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.100.1 05-Mar-2011  rmind sync with head
 1.10 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.9 04-Mar-2007  tsutsui branches: 1.9.66; 1.9.72; 1.9.74;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.8 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 11-Dec-2005  christos branches: 1.7.26;
merge ktrace-lwp.
 1.6 07-Aug-2003  agc branches: 1.6.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 26-Oct-1994  cgd branches: 1.5.66;
new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.66.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 03-Sep-2007  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.74.1 08-Feb-2011  bouyer Sync with HEAD
 1.9.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.66.1 05-Mar-2011  rmind sync with head
 1.6 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.5 19-Jul-2006  tsutsui branches: 1.5.84; 1.5.90; 1.5.92;
Define base address offsets of intio devices in intioreg.h
and replace various magic numbers with the macro.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 26-Oct-1994  cgd branches: 1.2.66;
new RCS ID format.
 1.1 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 30-Dec-2006  yamt sync with head.
 1.4.8.1 11-Aug-2006  yamt sync with head
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.92.1 08-Feb-2011  bouyer Sync with HEAD
 1.5.90.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.84.1 05-Mar-2011  rmind sync with head
 1.25 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.24 29-Mar-2008  tsutsui branches: 1.24.26; 1.24.32; 1.24.34;
Split device_t/softc, and misc cosmetic changes.
 1.23 31-Dec-2007  ad branches: 1.23.6;
Remove COMPAT_HPUX.
 1.22 04-Mar-2007  tsutsui branches: 1.22.20; 1.22.26; 1.22.32;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.21 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20 11-Dec-2005  christos branches: 1.20.26;
merge ktrace-lwp.
 1.19 03-Jun-2005  tsutsui branches: 1.19.2;
Add a const.
 1.18 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.17 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.16 29-Jun-2003  fvdl branches: 1.16.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.15 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.14 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.13 17-Jul-2000  scottr branches: 1.13.2; 1.13.4; 1.13.8;
Correct return type of grfaddr(). From Steve Peurifoy via PR #10603.
 1.12 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.11 25-Jun-1998  thorpej branches: 1.11.14; 1.11.24;
defopt COMPAT_HPUX
 1.10 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.9 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.8 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.7 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.6 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.11.24.2 22-Jul-2000  simonb Pull up rev 1.13 from scottr:
Correct return type of grfaddr(). From Steve Peurifoy via PR #10603.
 1.11.24.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.11.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.13.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.16.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.16.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.16.2.2 03-Sep-2004  skrll Sync with HEAD
 1.16.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.2.2 21-Jan-2008  yamt sync with head
 1.19.2.1 03-Sep-2007  yamt sync with head.
 1.20.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.22.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.22.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.22.20.1 09-Jan-2008  matt sync with HEAD
 1.23.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.24.34.1 08-Feb-2011  bouyer Sync with HEAD
 1.24.32.1 06-Jun-2011  jruoho Sync with HEAD.
 1.24.26.1 05-Mar-2011  rmind sync with head
 1.84 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.83 21-Nov-2009  rmind branches: 1.83.4; 1.83.6; 1.83.8;
Use lwp_getpcb() on hppa and ia64, clean from struct user usage.
 1.82 13-Jun-2008  cegger use device_lookup_private to get softc
 1.81 29-Mar-2008  tsutsui branches: 1.81.2; 1.81.4; 1.81.6; 1.81.8;
Split device_t/softc, and misc cosmetic changes.
 1.80 01-Mar-2008  rmind Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.79 31-Dec-2007  ad branches: 1.79.2; 1.79.6;
Remove COMPAT_HPUX.
 1.78 17-Oct-2007  garbled branches: 1.78.2; 1.78.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.77 30-Sep-2007  tsutsui Make this compile with #ifdef DEBUG.
 1.76 04-Mar-2007  tsutsui branches: 1.76.2; 1.76.10; 1.76.18; 1.76.20; 1.76.22;
Use appropriate temporary variables to handle pointer passed via (void *).
 1.75 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.74 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.73 09-Sep-2006  tsutsui branches: 1.73.6;
Use microtime(9), rather than copying time directly.
 1.72 23-Jul-2006  ad branches: 1.72.4;
Use the LWP cached credentials where sane.
 1.71 21-Jul-2006  tsutsui Some KNF.
 1.70 15-May-2006  yamt include kauth.h for kauth_cred_geteuid.
 1.69 14-May-2006  elad integrate kauth.
 1.68 26-Mar-2006  tsutsui Make this compile with options DEBUG.
 1.67 19-Mar-2006  tsutsui TAB/space cleanup.
 1.66 11-Dec-2005  christos branches: 1.66.4; 1.66.6; 1.66.8; 1.66.10; 1.66.12;
merge ktrace-lwp.
 1.65 19-Feb-2005  tsutsui branches: 1.65.6;
Include "ioconf.h" for struct cfdriver *_cd decls.
 1.64 28-Aug-2004  thorpej branches: 1.64.4; 1.64.6;
Use ANSI function decls, static, and const.
 1.63 10-Apr-2004  tsutsui "extern char *us_keymap" is not equivalent with "extern char us_keymap[]"
in prototype declarations.
Now hilkbdcngetc() works on "unknown" keyboards with proper default map.
 1.62 09-Apr-2004  tsutsui Include "ite.h" before the first reference of NITE.
Fixes panic with unknown type keyboards (including JP one).
 1.61 17-Nov-2003  tsutsui branches: 1.61.2;
TAB/space cleanup.
 1.60 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.59 29-Jun-2003  fvdl branches: 1.59.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.58 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.57 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.56 02-Feb-2003  wiz Recognize with one i only. From miod@openbsd.
 1.55 02-Feb-2003  wiz guarantee, not guarentee. Idea from miod@openbsd.
 1.54 28-Jan-2003  wiz success, not sucess. Noted by mjl.
 1.53 26-Nov-2002  christos si_ -> sel_
 1.52 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.51 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.50 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.49 06-Jul-2002  gmcgarry Fix console bell.
 1.48 17-Mar-2002  gmcgarry branches: 1.48.4; 1.48.6;
Don't match on trailing spaces in the module name.
 1.47 15-Mar-2002  gmcgarry Introduce iteinstallkeymap() which allows the keyboard driver to
register its keymap with ite. Add RCSIDs while here.
 1.46 23-Feb-2002  gmcgarry Make the keyboard attach printf a little less cryptic.
 1.45 14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.44 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.43 17-Nov-2001  gmcgarry Convert hil to standard device attachment.
 1.42 12-Apr-2001  thorpej branches: 1.42.2; 1.42.4; 1.42.8;
splimp -> splvm (XXX Time critical sections, but don't want to block
the clock).
 1.41 10-Oct-2000  he branches: 1.41.2;
Add randomness sampling from hil, sd and rd devices.
 1.40 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.39 13-Mar-2000  soren branches: 1.39.4;
Fix doubled 'the's in comments.
 1.38 13-Aug-1999  bad branches: 1.38.2;
Another sacrifice to appease egcs: wrap "if .. if .. else" in braces.
 1.37 09-Nov-1998  frueauf branches: 1.37.4;
Add braces to make egcs happy.
 1.36 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.35 16-Oct-1997  carrel Remove unneeded and incomplete includes of vm/vm_*.h
 1.34 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.33 01-Apr-1997  scottr Relocate some prototypes needed for COMPAT_HPUX to hilvar.h
 1.32 01-Apr-1997  scottr Relocate some prototypes needed by other MD code.
 1.31 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.30 20-Mar-1997  thorpej Correct keyboard map references in the default case. From
Klaus Klein <kleink@layla.inka.de>, PR #3361.
 1.29 14-Oct-1996  thorpej Default the HIL keyboard to "US ASCII". This should fix a bug where
an unrecognized keyboard produced garbage on keypresses in the kernel,
but worked in the boot program (which has this default). The bug is
that the keymap pointers are unitialized.
 1.28 13-Oct-1996  christos backout previous kprintf changes
 1.27 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.26 05-Oct-1996  thorpej If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.25 04-Oct-1996  thorpej Garbage-collect some now-unused PANICBUTTON code.
 1.24 12-Sep-1996  thorpej Correct a somewhat confusing typo in a comment, pointed out by
Scott Reynolds.
 1.23 12-Sep-1996  thorpej Update for poll(2) changes.
 1.22 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.21 10-Jan-1996  thorpej Fix declaration of hilqfree(), from Daniel Hagerty <hag@wizardz.com>,
PR #1918.
 1.20 02-Dec-1995  thorpej Change "hilloop" to "hilsoftc" and make slightly more new config-friendly.
Remove all uses of curproc.
 1.19 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.18 10-Apr-1995  mycroft hilmap --> hilmmap
 1.17 26-Oct-1994  cgd new RCS ID format.
 1.16 25-May-1994  deraadt match char->u_char change in tty subsystem
 1.15 25-May-1994  mycroft Merge with 4.4-Lite.
 1.14 24-May-1994  mycroft MIN --> min
 1.13 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.12 04-May-1994  mycroft Update to match proc.h.
 1.11 10-Apr-1994  hpeyerl Make hil input work. From <deraadt@fsa.ca>
 1.10 10-Feb-1994  mycroft Rearrange some #includes.
 1.9 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.8 09-Jan-1994  mycroft Turn panic button into a debugger trap if DDB.
 1.7 08-Aug-1993  mycroft Just comment out undefined hilq_to_b (for now).
 1.6 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.5 12-Jul-1993  mycroft Change tty code to use clist interface, but with ring buffer implementation.
Also, fix a couple of bugs in tty.c and pccons.c, and some gross kluginess
in the hp300 stuff.
 1.4 07-Jul-1993  cgd changes for ring buffers vs. clists.
 1.3 22-May-1993  cgd add include of select.h if necessary for protos, or delete if extraneous
 1.2 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.37.4.1 12-Oct-2000  he Pull up revision 1.41 (requested by he):
Add randomness sampling for hil, sd and rd on the hp300 port.
 1.38.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.38.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.39.4.2 18-Oct-2000  tv Pullup 1.41 [he]:
Add randomness sampling from hil, sd and rd devices.
 1.39.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.41.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.42.8.9 11-Dec-2002  thorpej Sync with HEAD.
 1.42.8.8 11-Nov-2002  nathanw Catch up to -current
 1.42.8.7 18-Oct-2002  nathanw Catch up to -current.
 1.42.8.6 17-Sep-2002  nathanw Catch up to -current.
 1.42.8.5 01-Aug-2002  nathanw Catch up to -current.
 1.42.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.42.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.42.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.42.8.1 12-Apr-2001  nathanw file hil.c was added on branch nathanw_sa on 2002-01-08 00:24:34 +0000
 1.42.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.42.2.10 11-Oct-2002  jdolecek cosmetic XXXLUKEM comment change
 1.42.2.9 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.42.2.8 02-Oct-2002  jdolecek use (intptr_t) rathern than (u_long) to cast kn_hook pointer to dev_t
use (void *)(intptr_t) to cast dev_t to kn_hook pointer
 1.42.2.7 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.42.2.6 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.42.2.5 18-Jun-2002  jdolecek make compile
 1.42.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.42.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.42.2.2 09-Sep-2001  thorpej Oops,oversight in last.
 1.42.2.1 09-Sep-2001  thorpej Add kqueue support. Note yet compiled. Note: kqueue's semantics
mean that an HP-UX semantic can't be provided in the read filter.
Requires more attention.
 1.48.6.2 12-Apr-2004  jmc Pullup patch (requested by tsutsui in ticket #1668)

Include "ite.h" before the first reference of NITE.
Fixes panic with unknown type keyboards (including JP one).
 1.48.6.1 07-Jul-2002  lukem Pull up revision 1.49 (requested by gmcgarry in ticket #439):
Fix console bell.
 1.48.4.2 16-Jul-2002  gehenna catch up with -current.
 1.48.4.1 17-May-2002  gehenna Add device switch.
 1.59.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.59.2.5 24-Jan-2005  skrll Adapt to branch.
 1.59.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.59.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.59.2.2 03-Sep-2004  skrll Sync with HEAD
 1.59.2.1 03-Aug-2004  skrll Sync with HEAD
 1.61.2.1 11-Apr-2004  jmc Pullup rev 1.62-1.63 (requested by tsutsui in ticket #119)

Include ite.h before the first reference of NITE. Change us_keymap extern
 1.64.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.64.4.1 29-Apr-2005  kent sync with -current
 1.65.6.7 17-Mar-2008  yamt sync with head.
 1.65.6.6 21-Jan-2008  yamt sync with head
 1.65.6.5 27-Oct-2007  yamt sync with head.
 1.65.6.4 03-Sep-2007  yamt sync with head.
 1.65.6.3 26-Feb-2007  yamt sync with head.
 1.65.6.2 30-Dec-2006  yamt sync with head.
 1.65.6.1 21-Jun-2006  yamt sync with head.
 1.66.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.66.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.66.10.2 19-Apr-2006  elad sync with head - hopefully this will work
 1.66.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.66.8.4 14-Sep-2006  yamt sync with head.
 1.66.8.3 11-Aug-2006  yamt sync with head
 1.66.8.2 24-May-2006  yamt sync with head.
 1.66.8.1 01-Apr-2006  yamt sync with head.
 1.66.6.2 01-Jun-2006  kardel Sync with head.
 1.66.6.1 22-Apr-2006  simonb Sync with head.
 1.66.4.1 09-Sep-2006  rpaulo sync with head
 1.72.4.1 18-Nov-2006  ad Sync with head.
 1.73.6.2 12-Mar-2007  rmind Sync with HEAD.
 1.73.6.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.76.22.1 06-Oct-2007  yamt sync with head.
 1.76.20.3 23-Mar-2008  matt sync with HEAD
 1.76.20.2 09-Jan-2008  matt sync with HEAD
 1.76.20.1 06-Nov-2007  matt sync with HEAD
 1.76.18.1 02-Oct-2007  joerg Sync with HEAD.
 1.76.10.1 03-Oct-2007  garbled Sync with HEAD
 1.76.2.1 09-Oct-2007  ad Sync with head.
 1.78.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.78.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.79.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.79.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.79.2.1 24-Mar-2008  keiichi sync with head.
 1.81.8.1 18-Jun-2008  simonb Sync with head.
 1.81.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.81.4.2 11-Mar-2010  yamt sync with head
 1.81.4.1 04-May-2009  yamt sync with head.
 1.81.2.1 17-Jun-2008  yamt sync with head.
 1.83.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.83.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.83.4.1 05-Mar-2011  rmind sync with head
 1.5 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.4 26-Dec-2020  tsutsui Fix a longstanding bug in hilkbd (and dnkbd) console attachment.

cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.
Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.
Should be pulleld up to netbsd-8 and netbsd-9.
 1.3 19-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.52; 1.3.64; 1.3.72;
Actually check that the configured console device is a wsdisplay.
 1.2 19-Feb-2011  tsutsui - make local functions static
- use aprint_erorr(9)
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file hil_intio.c was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.3.72.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.3.64.1 28-Dec-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #1161):

sys/arch/hp300/dev/dnkbd.c: revision 1.11
sys/arch/hp300/dev/hil_intio.c: revision 1.4

Fix a longstanding bug in hilkbd (and dnkbd) console attachment.
cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.

Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.

Should be pulleld up to netbsd-8 and netbsd-9.
 1.3.52.1 28-Dec-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #1642):

sys/arch/hp300/dev/dnkbd.c: revision 1.11
sys/arch/hp300/dev/hil_intio.c: revision 1.4

Fix a longstanding bug in hilkbd (and dnkbd) console attachment.
cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.

Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.

Should be pulleld up to netbsd-8 and netbsd-9.
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 19-Feb-2011  jruoho file hil_intio.c was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 19-Feb-2011  rmind file hil_intio.c was added on branch rmind-uvmplock on 2011-03-05 20:50:22 +0000
 1.15 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.14 11-Dec-2005  christos branches: 1.14.100; 1.14.106; 1.14.108;
merge ktrace-lwp.
 1.13 02-Jun-2005  tsutsui Add const.
 1.12 31-May-2004  tsutsui Fix usage of NULL, '\0' and "" again.
 1.11 17-Nov-2003  tsutsui TAB/space cleanup.
 1.10 26-Oct-2003  tsutsui Replace (a bunch of) NULL with '\0'. (we should define NUL?)
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 15-Mar-2002  gmcgarry branches: 1.8.12;
Add RCSIDs.
 1.7 31-Mar-1997  scottr branches: 1.7.36; 1.7.40;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.6 06-Dec-1995  thorpej Keymap for the Swedish HIL keyboard, from Tomas Tengling <ltt@cd.chalmers.se>.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.7.40.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.36.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.12.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.12.1 03-Aug-2004  skrll Sync with HEAD
 1.14.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.14.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.14.100.1 05-Mar-2011  rmind sync with head
 1.10 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.9 19-Mar-2006  tsutsui branches: 1.9.88; 1.9.94; 1.9.96;
TAB/space cleanup.
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.6; 1.8.8; 1.8.10; 1.8.12;
merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 26-Oct-1994  cgd branches: 1.6.66;
new RCS ID format.
 1.5 25-May-1994  mycroft Somehow this got truncated by 8 bytes...
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 02-Sep-1993  mycroft For some reason I don't understand, a change disappeared from the CVS tree.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.66.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.8.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.8.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.8.8.1 01-Apr-2006  yamt sync with head.
 1.8.6.1 22-Apr-2006  simonb Sync with head.
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.96.1 08-Feb-2011  bouyer Sync with HEAD
 1.9.94.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.88.1 05-Mar-2011  rmind sync with head
 1.10 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.9 19-Mar-2006  tsutsui branches: 1.9.88; 1.9.94; 1.9.96;
TAB/space cleanup.
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.6; 1.8.8; 1.8.10; 1.8.12;
merge ktrace-lwp.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 02-Feb-1997  thorpej branches: 1.6.60;
Definition of splhil() is in param.h now.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 02-Sep-1993  mycroft For some reason I don't understand, a change disappeared from the CVS tree.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.60.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.8.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.8.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.8.8.1 01-Apr-2006  yamt sync with head.
 1.8.6.1 22-Apr-2006  simonb Sync with head.
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.96.1 08-Feb-2011  bouyer Sync with HEAD
 1.9.94.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.88.1 05-Mar-2011  rmind sync with head
 1.26 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.25 29-Mar-2008  tsutsui branches: 1.25.26; 1.25.32; 1.25.34;
Split device_t/softc, and misc cosmetic changes.
 1.24 31-Dec-2007  ad branches: 1.24.6;
Remove COMPAT_HPUX.
 1.23 04-Mar-2007  christos branches: 1.23.20; 1.23.26; 1.23.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.21 11-Dec-2005  christos branches: 1.21.26;
merge ktrace-lwp.
 1.20 28-Aug-2004  thorpej branches: 1.20.12;
Use ANSI function decls, static, and const.
 1.19 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.18 14-Dec-2001  gmcgarry branches: 1.18.16;
Update hardware drivers with console attachments to the new console
attachment interface.
 1.17 17-Nov-2001  gmcgarry Convert hil to standard device attachment.
 1.16 10-Oct-2000  he branches: 1.16.2; 1.16.4; 1.16.8;
Add randomness sampling from hil, sd and rd devices.
 1.15 25-Jun-1998  thorpej branches: 1.15.8; 1.15.14; 1.15.24;
defopt COMPAT_HPUX
 1.14 01-Apr-1997  scottr Relocate some prototypes needed for COMPAT_HPUX to hilvar.h
 1.13 01-Apr-1997  scottr Relocate some prototypes needed by other MD code.
 1.12 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.11 11-Dec-1995  thorpej Oops ... missed this file in the last round of device changes.
 1.10 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.9 02-Dec-1995  thorpej Change "hilloop" to "hilsoftc" and make slightly more new config-friendly.
Remove all uses of curproc.
 1.8 26-Oct-1994  cgd new RCS ID format.
 1.7 25-May-1994  mycroft Merge with 4.4-Lite.
 1.6 10-Apr-1994  hpeyerl Make hil input work. From <deraadt@fsa.ca>
 1.5 07-Aug-1993  cgd some more ring buffer -> clist changes
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 04-Jul-1993  cgd use ringb rather than clist
 1.2 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.15.24.1 18-Oct-2000  tv Pullup 1.16 [he]:
Add randomness sampling from hil, sd and rd devices.
 1.15.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.15.8.1 12-Oct-2000  he Pull up revision 1.16 (requested by he):
Add randomness sampling for hil, sd and rd on the hp300 port.
 1.16.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.16.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.18.16.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.16.3 18-Sep-2004  skrll Sync with HEAD.
 1.18.16.2 03-Sep-2004  skrll Sync with HEAD
 1.18.16.1 03-Aug-2004  skrll Sync with HEAD
 1.20.12.3 21-Jan-2008  yamt sync with head
 1.20.12.2 03-Sep-2007  yamt sync with head.
 1.20.12.1 26-Feb-2007  yamt sync with head.
 1.21.26.2 12-Mar-2007  rmind Sync with HEAD.
 1.21.26.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.23.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.23.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.23.20.1 09-Jan-2008  matt sync with HEAD
 1.24.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.25.34.1 08-Feb-2011  bouyer Sync with HEAD
 1.25.32.1 06-Jun-2011  jruoho Sync with HEAD.
 1.25.26.1 05-Mar-2011  rmind sync with head
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 01-Aug-2003  tsutsui branches: 1.1.4;
Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 01-Aug-2003  skrll file hp98265reg.h was added on branch ktrace-lwp on 2004-08-03 10:34:23 +0000
 1.45 15-Jan-2023  tsutsui TAB/space cleanup.
 1.44 07-Aug-2021  thorpej branches: 1.44.6;
Merge thorpej-cfargs2.
 1.43 05-Jul-2021  tsutsui branches: 1.43.2;
Pull HP-IB probe fixes from OpenBSD/hp300.

https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2
> Overhaul the way HP-IB devices are probed. We will now do an exhaustive
> probe of the (slave, punit) tuple space, since this is the only way we
> can get a dual disk or dual tape enclosure to attach two devices of the
> same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.
 1.42 24-Apr-2021  thorpej branches: 1.42.2;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.41 18-Nov-2020  thorpej branches: 1.41.2;
malloc(9) -> kmem(9)
 1.40 10-Nov-2019  chs branches: 1.40.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.39 13-Oct-2012  tsutsui branches: 1.39.38; 1.39.42;
struct device * -> device_t, struct cfdata * -> cfdata_t
use device_xname() (from chs@)
 1.38 13-Jun-2008  cegger branches: 1.38.30; 1.38.40;
use device_lookup_private to get softc
 1.37 28-Apr-2008  martin branches: 1.37.2; 1.37.4;
Remove clause 3 and 4 from TNF licenses
 1.36 29-Mar-2008  tsutsui branches: 1.36.2; 1.36.4;
Split device_t/softc, and misc cosmetic changes.
 1.35 05-Dec-2007  tsutsui branches: 1.35.12;
Use queue(3) macro.
 1.34 21-Jul-2006  tsutsui branches: 1.34.32; 1.34.34; 1.34.40; 1.34.44;
Some KNF.
 1.33 28-Mar-2006  thorpej Use device_unit().
 1.32 19-Mar-2006  tsutsui Replace MALLOC(9) with malloc(9) in non critical path.
 1.31 11-Dec-2005  christos branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10; 1.31.12;
merge ktrace-lwp.
 1.30 26-Aug-2005  drochner s/locdesc_t/int/g
 1.29 04-Jul-2005  drochner branches: 1.29.2;
some autoconf cleanup fallout, leftover of last week, mostly from
Havard Eidnes
 1.28 19-Feb-2005  tsutsui Include "ioconf.h" for struct cfdriver *_cd decls.
 1.27 28-Aug-2004  thorpej branches: 1.27.4; 1.27.6;
Use ANSI function decls, static, and const.
 1.26 17-Nov-2003  tsutsui TAB/space cleanup.
 1.25 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.24 01-Jan-2003  thorpej branches: 1.24.2;
Use aprint_normal() for cfprint routines.
 1.23 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.21 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.20 15-Mar-2002  gmcgarry malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.19 12-Jan-1998  thorpej branches: 1.19.28; 1.19.32;
Update for changes to config.
 1.18 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.17 18-Jul-1997  jtk branches: 1.17.2;
remove old *_UNK style default defines, use standard names from locators.h
 1.16 27-Apr-1997  thorpej These files depend on things in <machine/hp300spu.h>
 1.15 14-Apr-1997  thorpej Remove unnecssary #include.
 1.14 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.13 30-Jan-1997  thorpej - Convert these drivers to new-style autoconfiguration. Old-style
configuration is no longer supported.
- Use a much more obvious HP-IB job queueing scheme.
 1.12 09-Dec-1996  thorpej isrlink() now returns a cookie. We're not interested in the cookie, so
cast to (void).

Call dmacomputeipl() after we've hooked up our interrupt handler.
 1.11 13-Oct-1996  christos backout previous kprintf changes
 1.10 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.9 17-May-1996  thorpej Adjust for the new values of cpuspeed.
 1.8 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.7 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.6 19-Nov-1995  thorpej Do an indirect driver a little more like an indirect driver would like to
be done. Set up a structure filled with function pointers in the
controller-specific probe routines, and jump through them, instead of
if()'ing our way though each operation.

Be a little more discriptive; print out the controller type found
during the probe in a way that's somewhat meaningful.
 1.5 07-Jan-1995  mycroft Various diffs from Mike Hibler; necessary for mt driver.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.17.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.19.32.3 03-Jan-2003  thorpej Sync with HEAD.
 1.19.32.2 18-Oct-2002  nathanw Catch up to -current.
 1.19.32.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.19.28.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.19.28.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.24.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.24.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.2 03-Sep-2004  skrll Sync with HEAD
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.27.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.27.4.1 29-Apr-2005  kent sync with -current
 1.29.2.3 07-Dec-2007  yamt sync with head
 1.29.2.2 30-Dec-2006  yamt sync with head.
 1.29.2.1 21-Jun-2006  yamt sync with head.
 1.31.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.31.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.31.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.31.8.2 11-Aug-2006  yamt sync with head
 1.31.8.1 01-Apr-2006  yamt sync with head.
 1.31.6.1 22-Apr-2006  simonb Sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.34.44.1 08-Dec-2007  ad Sync with head.
 1.34.40.1 08-Dec-2007  mjf Sync with HEAD.
 1.34.34.1 09-Jan-2008  matt sync with HEAD
 1.34.32.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.35.12.3 29-Jun-2008  mjf Sync with HEAD.
 1.35.12.2 02-Jun-2008  mjf Sync with HEAD.
 1.35.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.36.4.2 04-May-2009  yamt sync with head.
 1.36.4.1 16-May-2008  yamt sync with head.
 1.36.2.2 17-Jun-2008  yamt sync with head.
 1.36.2.1 18-May-2008  yamt sync with head.
 1.37.4.1 18-Jun-2008  simonb Sync with head.
 1.37.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.38.40.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.38.30.1 30-Oct-2012  yamt sync with head
 1.39.42.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.39.38.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.40.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.41.2.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.41.2.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.41.2.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.41.2.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.41.2.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.41.2.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.42.2.1 01-Aug-2021  thorpej Sync with HEAD.
 1.43.2.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.44.6.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.24 09-Jul-2021  tsutsui Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.
 1.23 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.22 05-Jul-2021  tsutsui Pull HP-IB probe fixes from OpenBSD/hp300.

https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2
> Overhaul the way HP-IB devices are probed. We will now do an exhaustive
> probe of the (slave, punit) tuple space, since this is the only way we
> can get a dual disk or dual tape enclosure to attach two devices of the
> same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.
 1.21 13-Oct-2012  tsutsui branches: 1.21.42; 1.21.54;
struct device * -> device_t, struct cfdata * -> cfdata_t
use device_xname() (from chs@)
 1.20 28-Apr-2008  martin branches: 1.20.34; 1.20.44;
Remove clause 3 and 4 from TNF licenses
 1.19 29-Mar-2008  tsutsui branches: 1.19.2; 1.19.4;
Split device_t/softc, and misc cosmetic changes.
 1.18 04-Mar-2007  christos branches: 1.18.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.17 11-Dec-2005  christos branches: 1.17.26;
merge ktrace-lwp.
 1.16 02-Jan-2005  tsutsui branches: 1.16.10;
u_intNN_t -> uintNN_t
 1.15 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.13 04-Oct-1997  thorpej branches: 1.13.50;
Copyright assigned to The NetBSD Foundation.
 1.12 18-Jul-1997  jtk branches: 1.12.2;
remove old *_UNK style default defines, use standard names from locators.h
 1.11 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all *UNK uses in
hpib code with the native names from locators.h
 1.10 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.9 30-Jan-1997  thorpej - Convert these drivers to new-style autoconfiguration. Old-style
configuration is no longer supported.
- Use a much more obvious HP-IB job queueing scheme.
 1.8 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.7 19-Nov-1995  thorpej Do an indirect driver a little more like an indirect driver would like to
be done. Set up a structure filled with function pointers in the
controller-specific probe routines, and jump through them, instead of
if()'ing our way though each operation.

Be a little more discriptive; print out the controller type found
during the probe in a way that's somewhat meaningful.
 1.6 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.5 07-Jan-1995  mycroft Various diffs from Mike Hibler; necessary for mt driver.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.12.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.50.5 17-Jan-2005  skrll Sync with HEAD.
 1.13.50.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.50.3 18-Sep-2004  skrll Sync with HEAD.
 1.13.50.2 03-Sep-2004  skrll Sync with HEAD
 1.13.50.1 03-Aug-2004  skrll Sync with HEAD
 1.16.10.1 03-Sep-2007  yamt sync with head.
 1.17.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.18.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.18.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.19.4.1 16-May-2008  yamt sync with head.
 1.19.2.1 18-May-2008  yamt sync with head.
 1.20.44.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.20.34.1 30-Oct-2012  yamt sync with head
 1.21.54.1 01-Aug-2021  thorpej Sync with HEAD.
 1.21.42.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.4 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.3 18-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.96;
Use aprint_normal(9) and variants.
 1.2 12-Feb-2011  tsutsui - make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.4 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file hyper.c was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.3.96.1 02-Aug-2025  perseant Sync with HEAD
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 18-Feb-2011  jruoho file hyper.c was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 18-Feb-2011  rmind file hyper.c was added on branch rmind-uvmplock on 2011-03-05 20:50:22 +0000
 1.3 06-Mar-2011  bouyer branches: 1.3.4;
merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.2 12-Feb-2011  tsutsui branches: 1.2.2;
- make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file hyperreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.2.2.3 21-Apr-2011  rmind sync with head
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 12-Feb-2011  rmind file hyperreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:22 +0000
 1.3.4.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.4.1 06-Mar-2011  jruoho file hyperreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.63 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.62 19-Jan-2010  pooka Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.61 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.60 04-Apr-2008  tsutsui branches: 1.60.2; 1.60.4;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.59 21-Jul-2006  tsutsui branches: 1.59.58;
Some KNF.
 1.58 11-Dec-2005  christos branches: 1.58.4; 1.58.8;
merge ktrace-lwp.
 1.57 02-Jan-2005  tsutsui branches: 1.57.10;
u_intNN_t -> uintNN_t
 1.56 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.55 17-Nov-2003  tsutsui TAB/space cleanup.
 1.54 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.53 24-May-2003  gmcgarry branches: 1.53.2;
Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.52 20-Oct-2002  gmcgarry - merge if_levar.h into if_le.c
- de-__P(), ansify
- remove unnecessary headers
 1.51 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.50 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.49 15-Mar-2002  gmcgarry Add RCSIDs.
 1.48 30-May-2001  mrg branches: 1.48.2; 1.48.8;
use _KERNEL_OPT
 1.47 15-Aug-1998  mycroft branches: 1.47.24;
Assign my copyrights to TNF.
 1.46 21-Jul-1998  drochner adapt to LANCE driver split
 1.45 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.44 11-Jan-1998  thorpej Convert the hp300 LANCE driver to use bus.h
 1.43 05-May-1997  thorpej - Use dio_intr_establish().
- Update for USELEDS changes.
 1.42 03-May-1997  mycroft Eliminate unused variable when !USELEDS.
 1.41 14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.40 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.39 17-Mar-1997  thorpej #include <net/if_media.h>
 1.38 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.37 30-Jan-1997  thorpej branches: 1.37.4;
Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.36 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.35 09-Dec-1996  thorpej isrlink() now returns a cookie. We're not interested in the cookie, so
cast to (void).
 1.34 14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.33 13-Oct-1996  christos backout previous kprintf changes
 1.32 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.31 09-May-1996  thorpej Correct typos, PR #2382.
 1.30 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.29 22-Apr-1996  christos Add a hardware dependent initialization function lehwinit()
 1.28 18-Apr-1996  cgd change LANCE copy & zero functions' names to start with amd7990_, and
remove their 'integrate' (usually defined to be 'static') keywords.
when lance drivers are split up by attachment, more than one file will
reference the copy/zero functions (i.e. not just the file that pulls in
am7990.c... and eventually inclusion of am7990.c should go away entirely).
 1.27 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.26 02-Jan-1996  thorpej Implement a suggestion from Charles; use a wrapper function before
leintr() to deal with das blinkenlights. Also squishes the need
for LEINTR_UNIT.
 1.25 30-Dec-1995  thorpej Fix something the switch to the MI LANCE code broke: use LE_TINT_HOOK
and LE_RINT_HOOK to blink the "LAN transmit" and "LAN receive" LEDs on
the front panels of 400-series machines iff the CPP symbol USELEDS is
defined in the kernel config file.
 1.24 10-Dec-1995  mycroft Use the MI LANCE code.
 1.23 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.22 04-Aug-1995  thorpej Kill bogus if_addrlist check.
 1.21 19-Apr-1995  mycroft Update for global changes.
 1.20 26-Oct-1994  cgd new RCS ID format.
 1.19 29-Sep-1994  mycroft Fix byte order problem in multicast filter calculation.
 1.18 18-Sep-1994  mycroft Add LED frobnication code, from 4.4-Lite.
 1.17 25-Jul-1994  mycroft Look for errors in the right place in a transmit descriptor, and count
collisions.
 1.16 15-Jul-1994  mycroft Fix a bogon relating to >16-bit addresses that I introduced. Fix up BPF
support for received packets.
 1.15 10-Jul-1994  mycroft Clean up a bit.
 1.14 07-Jul-1994  mycroft branches: 1.14.2;
This #endif got truncated...
 1.13 06-Jul-1994  mycroft Speed this up a bit, do multiple transmit buffers, etc.
 1.12 13-May-1994  mycroft Update to match other code.
 1.11 16-Feb-1994  mycroft Fix a couple of bogons I just created.
 1.10 16-Feb-1994  mycroft Use IFF_ALLMULTI correctly.
 1.9 14-Feb-1994  mycroft Fix some weirdness in the multicast initialization.
 1.8 06-Feb-1994  mycroft Strict prototyping and a couple of other nits.
 1.7 05-Feb-1994  mycroft Remember to set txcnt before it bites me.
 1.6 05-Feb-1994  mycroft Allow multiple transmit buffers to be outstanding. Original code by Hibler;
some cleanup by me.
 1.5 05-Feb-1994  mycroft Add multicast support. Lots of other cleanup, mostly from the SPARC port.
 1.4 30-Jan-1994  mycroft Fix Theo's typos.
 1.3 24-Jan-1994  deraadt delete RMP code
ether_input() takes ether_type in net byte order now
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.14.2.5 01-Oct-1994  cgd from trunk
 1.14.2.4 26-Jul-1994  cgd from trunk.
 1.14.2.3 15-Jul-1994  cgd update from trunk.
 1.14.2.2 12-Jul-1994  cgd from trunk, per mycroft
 1.14.2.1 07-Jul-1994  cgd file if_le.c was added on branch netbsd-1-0 on 1994-07-12 23:30:21 +0000
 1.37.4.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.37.4.1 03-Mar-1997  is change to new world order.
 1.47.24.1 21-Jun-2001  nathanw Catch up to -current.
 1.48.8.4 11-Nov-2002  nathanw Catch up to -current
 1.48.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.48.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.48.8.1 30-May-2001  nathanw file if_le.c was added on branch nathanw_sa on 2002-04-01 07:39:52 +0000
 1.48.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.48.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.53.2.5 17-Jan-2005  skrll Sync with HEAD.
 1.53.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.53.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.53.2.2 03-Sep-2004  skrll Sync with HEAD
 1.53.2.1 03-Aug-2004  skrll Sync with HEAD
 1.57.10.1 30-Dec-2006  yamt sync with head.
 1.58.8.1 11-Aug-2006  yamt sync with head
 1.58.4.1 09-Sep-2006  rpaulo sync with head
 1.59.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.60.4.2 11-Mar-2010  yamt sync with head
 1.60.4.1 16-May-2008  yamt sync with head.
 1.60.2.1 18-May-2008  yamt sync with head.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 11-Jan-1998  thorpej branches: 1.9.48;
Convert the hp300 LANCE driver to use bus.h
 1.8 10-Dec-1995  mycroft Use the MI LANCE code.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 06-Jul-1994  mycroft Speed this up a bit, do multiple transmit buffers, etc.
 1.5 06-Feb-1994  mycroft Strict prototyping and a couple of other nits.
 1.4 05-Feb-1994  mycroft Increase # of transmit buffers.
 1.3 05-Feb-1994  mycroft Add multicast support. Lots of other cleanup, mostly from the SPARC port.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.48.1 03-Aug-2004  skrll Sync with HEAD
 1.11 20-Oct-2002  gmcgarry - merge if_levar.h into if_le.c
- de-__P(), ansify
- remove unnecessary headers
 1.10 15-Aug-1998  mycroft branches: 1.10.30;
Assign my copyrights to TNF.
 1.9 11-Jan-1998  thorpej Convert the hp300 LANCE driver to use bus.h
 1.8 14-Apr-1997  thorpej Remove unnecessary softc member.
 1.7 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.6 30-Jan-1997  thorpej branches: 1.6.4;
Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.5 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.4 07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.3 02-Jan-1996  thorpej Implement a suggestion from Charles; use a wrapper function before
leintr() to deal with das blinkenlights. Also squishes the need
for LEINTR_UNIT.
 1.2 30-Dec-1995  thorpej Fix something the switch to the MI LANCE code broke: use LE_TINT_HOOK
and LE_RINT_HOOK to blink the "LAN transmit" and "LAN receive" LEDs on
the front panels of 400-series machines iff the CPP symbol USELEDS is
defined in the kernel config file.
 1.1 10-Dec-1995  mycroft Use the MI LANCE code.
 1.6.4.1 03-Mar-1997  is change to new world order.
 1.10.30.1 11-Nov-2002  nathanw Catch up to -current
 1.33 30-Apr-2024  tsutsui Fix fatal typo that prevents all intio devices probed.
 1.32 28-Jan-2024  thorpej Rather than having different "builtin" tables (3xx, 362, 382, 4xx),
just have a single "builtin" table with a mask indicating which of
those groups of machines have a particular built-in device.
 1.31 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.30 24-Apr-2021  thorpej branches: 1.30.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.29 31-Dec-2010  tsutsui branches: 1.29.74;
According to the 362/382 Service Handbook by HP, only 382 has a utility chip
(i.e. frodo and apci) for RS-232C so don't try to attach frodo on HP362.

XXX: HP362 detection code in locore.s and bootloader still doesn't work
XXX: if on-board framebuffer is disabled by a jumper switch, though
XXX: it's still detected as HP360 and just works.
 1.28 28-Apr-2008  martin branches: 1.28.22;
Remove clause 3 and 4 from TNF licenses
 1.27 29-Mar-2008  tsutsui branches: 1.27.2; 1.27.4;
Split device_t/softc, and misc cosmetic changes.
 1.26 04-Mar-2007  christos branches: 1.26.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.25 20-Jul-2006  tsutsui branches: 1.25.10;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.24 19-Jul-2006  tsutsui oops, fix typo
 1.23 19-Jul-2006  tsutsui - strncpy() -> strlcpy()
- adjust buffer length
 1.22 19-Jul-2006  tsutsui Define base address offsets of intio devices in intioreg.h
and replace various magic numbers with the macro.
 1.21 19-Jul-2006  tsutsui - use __arraycount()
- remove parentheses from return values
 1.20 11-Dec-2005  christos branches: 1.20.4; 1.20.8;
merge ktrace-lwp.
 1.19 28-Aug-2004  thorpej branches: 1.19.12;
Use ANSI function decls, static, and const.
 1.18 17-Nov-2003  tsutsui TAB/space cleanup.
 1.17 01-Aug-2003  tsutsui Modify hp300 bus_space(9) structures/functions to add hooks to override
access functions. This is required by some DIO devices to use MI drivers.
 1.16 05-Jul-2003  tsutsui cosmetics
 1.15 24-May-2003  gmcgarry branches: 1.15.2;
Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.14 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.13 22-Dec-2002  gmcgarry Make the DMA controller a separate device attached to intio. Intio
devices can use the DMA controller too.
 1.12 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.11 05-May-2002  gmcgarry 400-series machines only have DIO framebuffers. From discussion
with Michael Lorenz and Bernd Sieker.
 1.10 05-Apr-2002  gmcgarry actually, we didn't want to print pa, not kva
 1.9 17-Mar-2002  gmcgarry Don't match on trailing spaces in the module name.
 1.8 15-Mar-2002  gmcgarry Don't display ipl if the device isn't actually attaching.
Add RCSID while here.
 1.7 17-Nov-2001  gmcgarry Overhaul the intio device attachment. Devices are direct connected and
attached based on machine id.
 1.6 12-Jan-1998  thorpej branches: 1.6.28; 1.6.32;
Update for changes to config.
 1.5 11-Jan-1998  thorpej Oops, fix a printf format.
 1.4 11-Jan-1998  thorpej Pass down bus space tags to children, and use types appropriate for
bus.h.
 1.3 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.2 30-Jan-1997  thorpej branches: 1.2.8;
Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.2.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.32.7 03-Jan-2003  thorpej Sync with HEAD.
 1.6.32.6 29-Dec-2002  thorpej Sync with HEAD.
 1.6.32.5 18-Oct-2002  nathanw Catch up to -current.
 1.6.32.4 20-Jun-2002  nathanw Catch up to -current.
 1.6.32.3 17-Apr-2002  nathanw Catch up to -current.
 1.6.32.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.32.1 08-Jan-2002  nathanw Catch up to -current.
 1.6.28.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.28.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.2 03-Sep-2004  skrll Sync with HEAD
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.12.2 03-Sep-2007  yamt sync with head.
 1.19.12.1 30-Dec-2006  yamt sync with head.
 1.20.8.1 11-Aug-2006  yamt sync with head
 1.20.4.1 09-Sep-2006  rpaulo sync with head
 1.25.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.40.2 02-Jun-2008  mjf Sync with HEAD.
 1.26.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.27.4.1 16-May-2008  yamt sync with head.
 1.27.2.1 18-May-2008  yamt sync with head.
 1.28.22.1 05-Mar-2011  rmind sync with head
 1.29.74.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.30.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 19-Jul-2006  tsutsui branches: 1.4.58; 1.4.60; 1.4.62;
Define base address offsets of intio devices in intioreg.h
and replace various magic numbers with the macro.
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.8;
merge ktrace-lwp.
 1.2 17-Nov-2003  tsutsui branches: 1.2.16;
TAB/space cleanup.
 1.1 17-Nov-2001  gmcgarry branches: 1.1.2; 1.1.4; 1.1.20;
Overhaul the intio device attachment. Devices are direct connected and
attached based on machine id.
 1.1.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.20.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 17-Nov-2001  thorpej file intioreg.h was added on branch kqueue on 2002-01-10 19:42:56 +0000
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 17-Nov-2001  nathanw file intioreg.h was added on branch nathanw_sa on 2002-01-08 00:24:35 +0000
 1.2.16.1 30-Dec-2006  yamt sync with head.
 1.3.8.1 11-Aug-2006  yamt sync with head
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.62.1 16-May-2008  yamt sync with head.
 1.4.60.1 18-May-2008  yamt sync with head.
 1.4.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.15 28-Jan-2024  thorpej Rather than having different "builtin" tables (3xx, 362, 382, 4xx),
just have a single "builtin" table with a mask indicating which of
those groups of machines have a particular built-in device.
 1.14 07-Aug-2023  mrg fix indentation issues.

found by GCC 12.
 1.13 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.12 19-Jul-2006  tsutsui branches: 1.12.58; 1.12.60; 1.12.62;
- strncpy() -> strlcpy()
- adjust buffer length
 1.11 19-Mar-2006  tsutsui TAB/space cleanup.
 1.10 24-Dec-2005  perry branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10; 1.10.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 02-Jun-2005  tsutsui branches: 1.8.2;
Add a const.
 1.7 02-Jan-2005  tsutsui u_intNN_t -> uintNN_t
 1.6 17-Nov-2003  tsutsui TAB/space cleanup.
 1.5 17-Nov-2001  gmcgarry branches: 1.5.16;
Overhaul the intio device attachment. Devices are direct connected and
attached based on machine id.
 1.4 11-Jan-1998  thorpej branches: 1.4.28; 1.4.32;
Pass down bus space tags to children, and use types appropriate for
bus.h.
 1.3 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.2 30-Jan-1997  thorpej branches: 1.2.8;
Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.1 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.2.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.32.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.16.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.16.4 17-Jan-2005  skrll Sync with HEAD.
 1.5.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.16.1 03-Aug-2004  skrll Sync with HEAD
 1.8.2.2 30-Dec-2006  yamt sync with head.
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.10.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.10.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.10.8.2 11-Aug-2006  yamt sync with head
 1.10.8.1 01-Apr-2006  yamt sync with head.
 1.10.6.1 22-Apr-2006  simonb Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.12.62.1 16-May-2008  yamt sync with head.
 1.12.60.1 18-May-2008  yamt sync with head.
 1.12.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106; 1.4.108;
merge ktrace-lwp.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 26-Oct-1994  cgd branches: 1.2.66;
new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.4.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 05-Mar-2011  rmind sync with head
 1.84 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.83 18-Apr-2009  tsutsui branches: 1.83.4; 1.83.6; 1.83.8;
- remove a cast against malloc
- (type *)0 -> NULL
- misc KNF
 1.82 13-Jun-2008  cegger branches: 1.82.4; 1.82.10;
use device_lookup_private to get softc
 1.81 28-Apr-2008  martin branches: 1.81.2; 1.81.4;
Remove clause 3 and 4 from TNF licenses
 1.80 29-Mar-2008  tsutsui branches: 1.80.2; 1.80.4;
Split device_t/softc, and misc cosmetic changes.
 1.79 19-Nov-2007  ad branches: 1.79.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.78 18-Oct-2007  joerg branches: 1.78.2;
Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
 1.77 04-Mar-2007  christos branches: 1.77.2; 1.77.18; 1.77.20; 1.77.24;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.76 01-Oct-2006  elad branches: 1.76.4;
Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.75 23-Jul-2006  ad branches: 1.75.4; 1.75.6;
Use the LWP cached credentials where sane.
 1.74 21-Jul-2006  tsutsui Some KNF.
 1.73 14-May-2006  elad integrate kauth.
 1.72 28-Mar-2006  thorpej Use device_unit().
 1.71 19-Mar-2006  tsutsui TAB/space cleanup.
 1.70 19-Mar-2006  tsutsui Replace MALLOC(9) with malloc(9) in non critical path.
 1.69 11-Dec-2005  christos branches: 1.69.4; 1.69.6; 1.69.8; 1.69.10; 1.69.12;
merge ktrace-lwp.
 1.68 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.67 02-Jun-2005  tsutsui branches: 1.67.2;
Add a const.
 1.66 19-Feb-2005  tsutsui Include "ioconf.h" for struct cfdriver *_cd decls.
 1.65 28-Aug-2004  thorpej branches: 1.65.4; 1.65.6;
Use ANSI function decls, static, and const.
 1.64 31-May-2004  tsutsui Fix usage of NULL, '\0' and "" again.
 1.63 31-May-2004  tsutsui Handle CAPSLOCK correctly. Fixes port-hp300/4689.
 1.62 17-Nov-2003  tsutsui branches: 1.62.2;
TAB/space cleanup.
 1.61 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.60 29-Jun-2003  fvdl branches: 1.60.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.59 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.58 06-Mar-2003  thorpej Update for consdev changes.
 1.57 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.56 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.55 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.54 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.53 05-Jul-2002  gmcgarry Invert test of EPASSTHROUGH. Problem reported by
Bernd Sieker <bsieker@freenet.de>.
 1.52 17-Mar-2002  atatat branches: 1.52.4; 1.52.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.51 15-Mar-2002  gmcgarry Introduce iteinstallkeymap() which allows the keyboard driver to
register its keymap with ite. Add RCSIDs while here.
 1.50 14-Dec-2001  gmcgarry Make the ite interface look a little more like wscons. This is done
by allowing the hardware drivers to register keyboard and display
support with the ite framework. Removes the dependence on the hil
keyboard and should make support for dnkbd easier.

An interim fix until wscons arrives.
 1.49 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.48 17-Nov-2001  gmcgarry Convert hil to standard device attachment.
 1.47 02-May-2001  scw branches: 1.47.2; 1.47.4; 1.47.8;
Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.46 27-Nov-2000  tsutsui branches: 1.46.2;
More fixes for linesw changes.
 1.45 02-Nov-2000  eeh Adapt to the new line discipline scheme.
 1.44 04-Aug-2000  tsutsui Fix keyboard related panic when ite device is configured
but not attached, per port-hp300/10750.
Approved by thorpej.
 1.43 23-Mar-2000  thorpej branches: 1.43.4;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.42 13-Mar-2000  soren Fix doubled 'the's in comments.
 1.41 20-Apr-1998  frueauf branches: 1.41.8; 1.41.14;
egcs warning: don't use a char for array index, cast it to int.
 1.40 12-Jan-1998  thorpej Update for changes to config.
 1.39 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.38 31-Mar-1997  scottr branches: 1.38.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.37 02-Feb-1997  thorpej Use splkbd().
 1.36 31-Jan-1997  carrel Patch from thorpej to mark non-console grf's and ite's alive.
 1.35 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.34 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.33 13-Oct-1996  christos backout previous kprintf changes
 1.32 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.31 05-Oct-1996  thorpej If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.30 06-Jun-1996  thorpej Add calls to tty_attach() and tty_detach() where appropriate.
 1.29 24-Feb-1996  thorpej branches: 1.29.4;
Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.28 19-Nov-1995  thorpej Prevent the ITE_ACTIVE bit from being cleared in iteoff() if the ITE_ISCONS
bit is set. Works around the fact that the last process to have the
console open exits, the bit is cleared, and "syncing disks...", etc. is
not seen if the system is rebooted with reboot(8). Fixes PR #1455.
 1.27 19-Apr-1995  mycroft branches: 1.27.2;
Kluge the *tty() routines until this port is converted to config.new.
 1.26 10-Apr-1995  mycroft Most of the console functions return void.
 1.25 16-Dec-1994  mycroft Fix typo in previous.
 1.24 13-Dec-1994  mycroft Add dummy itestart(), and use ttrstrt() rather than a local version of the same.
 1.23 26-Oct-1994  cgd new RCS ID format.
 1.22 25-May-1994  mycroft Merge with 4.4-Lite.
 1.21 24-May-1994  mycroft MIN --> min
 1.20 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.19 10-Feb-1994  mycroft Rearrange some #includes.
 1.18 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.17 06-Feb-1994  mycroft Remove outdated console handling code.
 1.16 06-Feb-1994  mycroft Use common version of cons.c.
 1.15 30-Jan-1994  mycroft Remove bogus declaration.
 1.14 06-Dec-1993  mycroft Dummy iteattach() for new config.
 1.13 06-Dec-1993  mycroft Fix a couple of compiler warnings.
 1.12 29-Aug-1993  deraadt tty XXstart() routines return void
 1.11 08-Aug-1993  mycroft Slight restructuring to avoid relying on the tty structure associated with
an ITE until we're sure it's allocated.
 1.10 07-Aug-1993  cgd some more ring buffer -> clist changes
 1.9 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.8 12-Jul-1993  mycroft Change tty code to use clist interface, but with ring buffer implementation.
Also, fix a couple of bugs in tty.c and pccons.c, and some gross kluginess
in the hp300 stuff.
 1.7 07-Jul-1993  deraadt the "struct tty *cn_tty" field in cons.c wasn't being used by anything
 1.6 01-Jul-1993  mycroft This has got to be a bug.
 1.5 06-Jun-1993  cgd make getc() and ungetc() be rb{un,}getc(), so getc() and ungetc()
don't conflict w/ansi prototypes...
 1.4 27-May-1993  deraadt Changes to hp300 code to support two things:
1. dynamic tty allocation
2. use ring buffers instead of clists
Of course, I can't test it :-)
 1.3 22-May-1993  cgd add include of select.h if necessary for protos, or delete if extraneous
 1.2 18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.27.2.1 19-Nov-1995  thorpej Update from trunk; don't clear the ITE_ACTIVE bit if ITE_ISCONS, so that
messages printed during shutdown are visible.
 1.29.4.1 06-Jun-1996  thorpej Update from trunk:

Add calls to tty_attach() and tty_detach() where appropriate.
 1.38.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.41.14.3 08-Dec-2000  bouyer Sync with HEAD.
 1.41.14.2 22-Nov-2000  bouyer Sync with HEAD.
 1.41.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.41.8.1 14-Aug-2000  he Pull up revision 1.44 (requested by tsutsui):
Fix keyboard related panic when ite device is configured
but not attached. Fixes PR#10750.
 1.43.4.1 04-Aug-2000  tsutsui pull up 1.44 (approved by thorpej):
Fix keyboard related panic when ite device is configured
but not attached, per port-hp300/10750.
 1.46.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.47.8.7 11-Nov-2002  nathanw Catch up to -current
 1.47.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.47.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.47.8.4 01-Aug-2002  nathanw Catch up to -current.
 1.47.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.47.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.47.8.1 02-May-2001  nathanw file ite.c was added on branch nathanw_sa on 2002-01-08 00:24:35 +0000
 1.47.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.47.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.47.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.47.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.47.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.47.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.52.6.1 06-Jul-2002  lukem Pull up revision 1.53 (requested by gmcgarry in ticket #436):
Invert test of EPASSTHROUGH. Problem reported by
Bernd Sieker <bsieker@freenet.de>.
 1.52.4.2 16-Jul-2002  gehenna catch up with -current.
 1.52.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.60.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.60.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.60.2.5 24-Jan-2005  skrll Adapt to branch.
 1.60.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.60.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.60.2.2 03-Sep-2004  skrll Sync with HEAD
 1.60.2.1 03-Aug-2004  skrll Sync with HEAD
 1.62.2.1 01-Jun-2004  jmc Pullup rev 1.63 (requested by tsutsui in ticket #430)

Handle CAPSLOCK correctly. PR#4689
 1.65.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.65.4.1 29-Apr-2005  kent sync with -current
 1.67.2.5 07-Dec-2007  yamt sync with head
 1.67.2.4 27-Oct-2007  yamt sync with head.
 1.67.2.3 03-Sep-2007  yamt sync with head.
 1.67.2.2 30-Dec-2006  yamt sync with head.
 1.67.2.1 21-Jun-2006  yamt sync with head.
 1.69.12.3 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.69.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.69.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.69.10.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.69.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.69.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.69.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.69.8.3 11-Aug-2006  yamt sync with head
 1.69.8.2 24-May-2006  yamt sync with head.
 1.69.8.1 01-Apr-2006  yamt sync with head.
 1.69.6.2 01-Jun-2006  kardel Sync with head.
 1.69.6.1 22-Apr-2006  simonb Sync with head.
 1.69.4.1 09-Sep-2006  rpaulo sync with head
 1.75.6.1 22-Oct-2006  yamt sync with head
 1.75.4.1 18-Nov-2006  ad Sync with head.
 1.76.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.77.24.2 21-Nov-2007  bouyer Sync with HEAD
 1.77.24.1 25-Oct-2007  bouyer Sync with HEAD.
 1.77.20.2 09-Jan-2008  matt sync with HEAD
 1.77.20.1 06-Nov-2007  matt sync with HEAD
 1.77.18.2 21-Nov-2007  joerg Sync with HEAD.
 1.77.18.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.77.2.2 03-Dec-2007  ad Sync with HEAD.
 1.77.2.1 23-Oct-2007  ad Sync with head.
 1.78.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.79.14.3 29-Jun-2008  mjf Sync with HEAD.
 1.79.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.79.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.80.4.2 04-May-2009  yamt sync with head.
 1.80.4.1 16-May-2008  yamt sync with head.
 1.80.2.2 17-Jun-2008  yamt sync with head.
 1.80.2.1 18-May-2008  yamt sync with head.
 1.81.4.1 18-Jun-2008  simonb Sync with head.
 1.81.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.82.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.82.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.83.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.83.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.83.4.1 05-Mar-2011  rmind sync with head
 1.6 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.3 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 25-May-1994  mycroft Merge with 4.4-Lite.
 1.6 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.15 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.14 11-Dec-2005  christos branches: 1.14.100; 1.14.106; 1.14.108;
merge ktrace-lwp.
 1.13 03-Jun-2005  tsutsui Make fbmem volatile to appease gcc -Wcast-qual.
 1.12 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.11 17-Nov-2003  tsutsui TAB/space cleanup.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 15-Mar-2002  gmcgarry branches: 1.9.12;
Add RCSIDs.
 1.8 31-Mar-1997  scottr branches: 1.8.36; 1.8.40;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.7 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.6 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 02-Sep-1993  mycroft For some reason I don't understand, a change disappeared from the CVS tree.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.8.40.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.36.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.12.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.12.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.12.3 18-Sep-2004  skrll Sync with HEAD.
 1.9.12.2 03-Sep-2004  skrll Sync with HEAD
 1.9.12.1 03-Aug-2004  skrll Sync with HEAD
 1.14.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.14.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.14.100.1 05-Mar-2011  rmind sync with head
 1.6 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4 25-May-1994  mycroft Clean up deleted files.
 1.3 02-Sep-1993  mycroft For some reason I don't understand, a change disappeared from the CVS tree.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.8 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.7 11-Dec-2005  christos branches: 1.7.100; 1.7.106; 1.7.108;
merge ktrace-lwp.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 26-Oct-1994  cgd branches: 1.5.66;
new RCS ID format.
 1.4 25-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.66.1 03-Aug-2004  skrll Sync with HEAD
 1.7.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.7.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.100.1 05-Mar-2011  rmind sync with head
 1.30 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.29 18-Apr-2009  tsutsui branches: 1.29.4; 1.29.6; 1.29.8;
bcopy -> memmove (where possibly overwrapped)
 1.28 18-Mar-2009  cegger bzero -> memset
 1.27 29-Mar-2008  tsutsui branches: 1.27.4; 1.27.12; 1.27.18;
Split device_t/softc, and misc cosmetic changes.
 1.26 04-Mar-2007  tsutsui branches: 1.26.40;
- use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
 1.25 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.24 25-Jun-2006  tsutsui branches: 1.24.10;
Remove unused extern variable declarations. Noticed by gcc4.
 1.23 19-Mar-2006  tsutsui branches: 1.23.4;
TAB/space cleanup.
 1.22 11-Dec-2005  christos branches: 1.22.4; 1.22.6; 1.22.8; 1.22.10; 1.22.12;
merge ktrace-lwp.
 1.21 03-Jun-2005  tsutsui branches: 1.21.2;
Make fbmem volatile to appease gcc -Wcast-qual.
 1.20 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.19 08-Apr-2004  tsutsui Don't panic when kernel tries to print a horizontal tab via itecnputc().
 1.18 07-Aug-2003  agc branches: 1.18.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.17 06-Sep-2002  gehenna branches: 1.17.6;
Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.16 15-Mar-2002  gmcgarry branches: 1.16.4; 1.16.6;
Introduce iteinstallkeymap() which allows the keyboard driver to
register its keymap with ite. Add RCSIDs while here.
 1.15 14-Dec-2001  gmcgarry Make the ite interface look a little more like wscons. This is done
by allowing the hardware drivers to register keyboard and display
support with the ite framework. Removes the dependence on the hil
keyboard and should make support for dnkbd easier.

An interim fix until wscons arrives.
 1.14 31-Mar-1997  scottr branches: 1.14.36; 1.14.40;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.13 30-Jan-1997  thorpej Garbage-collect all old-style autoconfiguration support; it is no
longer supported. The hp300 port uses new config now.
 1.12 09-Jan-1997  scottr Bracket kernel structs with #ifdef _KERNEL so that bootblocks will once
again build.
 1.11 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.10 05-Oct-1996  thorpej If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.9 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.8 19-Nov-1995  thorpej Prevent the ITE_ACTIVE bit from being cleared in iteoff() if the ITE_ISCONS
bit is set. Works around the fact that the last process to have the
console open exits, the bit is cleared, and "syncing disks...", etc. is
not seen if the system is rebooted with reboot(8). Fixes PR #1455.
 1.7 28-Mar-1995  jtc branches: 1.7.2;
KERNEL -> _KERNEL
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 25-May-1994  mycroft Merge with 4.4-Lite.
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 29-May-1993  cgd fix for dynamic tty allocation; was being used in a #define...
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.7.2.1 19-Nov-1995  thorpej Update from trunk; don't clear the ITE_ACTIVE bit if ITE_ISCONS, so that
messages printed during shutdown are visible.
 1.14.40.3 17-Sep-2002  nathanw Catch up to -current.
 1.14.40.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.14.40.1 08-Jan-2002  nathanw Catch up to -current.
 1.14.36.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.36.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.36.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.6.1 12-Apr-2004  jmc Pullup rev 1.19 (requested by tsutsui in ticket #1667)

Don't panic when kernel tries to print a horizontal tab via itecnputc().
 1.16.4.1 19-May-2002  gehenna Remove unnecessary prototype.
 1.17.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.17.6.2 03-Sep-2004  skrll Sync with HEAD
 1.17.6.1 03-Aug-2004  skrll Sync with HEAD
 1.18.2.1 11-Apr-2004  jmc Pullup rev 1.19 (requested by tsutsui in ticket #118)

Don't panic when kernel tries to print a horizontal tab via itecnputc().
 1.21.2.3 03-Sep-2007  yamt sync with head.
 1.21.2.2 30-Dec-2006  yamt sync with head.
 1.21.2.1 21-Jun-2006  yamt sync with head.
 1.22.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.22.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.22.8.2 26-Jun-2006  yamt sync with head.
 1.22.8.1 01-Apr-2006  yamt sync with head.
 1.22.6.1 22-Apr-2006  simonb Sync with head.
 1.22.4.1 09-Sep-2006  rpaulo sync with head
 1.23.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.24.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.27.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.27.4.1 04-May-2009  yamt sync with head.
 1.29.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.29.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.4.1 05-Mar-2011  rmind sync with head
 1.13 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.12 11-Dec-2005  christos branches: 1.12.100; 1.12.106; 1.12.108;
merge ktrace-lwp.
 1.11 02-Jun-2005  tsutsui Add const.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 15-Mar-2002  gmcgarry branches: 1.9.12;
Introduce iteinstallkeymap() which allows the keyboard driver to
register its keymap with ite. Add RCSIDs while here.
 1.8 14-Dec-2001  gmcgarry Make the ite interface look a little more like wscons. This is done
by allowing the hardware drivers to register keyboard and display
support with the ite framework. Removes the dependence on the hil
keyboard and should make support for dnkbd easier.

An interim fix until wscons arrives.
 1.7 05-Oct-1996  thorpej branches: 1.7.42; 1.7.46;
If console is on an ite, make sure the HIL is initialized enough for
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.

While I'm here, eliminate some redundancy in the ite console intialization
code.
 1.6 06-Dec-1995  thorpej Keymap for the Swedish HIL keyboard, from Tomas Tengling <ltt@cd.chalmers.se>.
 1.5 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.7.46.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.46.1 08-Jan-2002  nathanw Catch up to -current.
 1.7.42.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.42.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.12.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.12.1 03-Aug-2004  skrll Sync with HEAD
 1.12.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.12.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.100.1 05-Mar-2011  rmind sync with head
 1.10 31-May-2025  tsutsui Use C99 exact width integer types, and misc KNF. (sync with stand/common)
 1.9 06-Feb-2011  tsutsui branches: 1.9.92;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.8 19-Mar-2006  tsutsui branches: 1.8.88; 1.8.94; 1.8.96;
- TAB/space cleanup
- use do{}while(/*CONSTCOND*/0) for macro with multiple statements
 1.7 24-Dec-2005  perry branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
bare asm -> __asm
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 16-Nov-2001  gmcgarry branches: 1.4.16;
Remove unnecessary trailing argument. Now compiles with new toolchain.
 1.3 31-Mar-1997  scottr branches: 1.3.36; 1.3.40;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3.40.1 08-Jan-2002  nathanw Catch up to -current.
 1.3.36.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.16.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.7.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.7.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.8.1 01-Apr-2006  yamt sync with head.
 1.7.6.1 22-Apr-2006  simonb Sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.96.1 08-Feb-2011  bouyer Sync with HEAD
 1.8.94.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.88.1 05-Mar-2011  rmind sync with head
 1.9.92.1 02-Aug-2025  perseant Sync with HEAD
 1.2 15-Jan-2023  tsutsui TAB/space cleanup.
 1.1 19-Apr-2014  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.12; 1.1.68;
Add proper RealTime Clock support for HP9000/425e.

As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.

Tested on HP425e (with mcclock) and HP362 (with old rtc).
 1.1.68.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.1.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.12.1 19-Apr-2014  tls file mcclock_frodo.c was added on branch tls-maxphys on 2014-08-20 00:03:00 +0000
 1.1.8.2 10-Aug-2014  tls Rebase.
 1.1.8.1 19-Apr-2014  tls file mcclock_frodo.c was added on branch tls-earlyentropy on 2014-08-10 06:53:57 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 19-Apr-2014  yamt file mcclock_frodo.c was added on branch yamt-pagecache on 2014-05-22 11:39:46 +0000
 1.1.4.2 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.1.4.1 19-Apr-2014  bouyer file mcclock_frodo.c was added on branch netbsd-6 on 2014-05-21 20:56:36 +0000
 1.1.2.2 18-May-2014  rmind sync with head
 1.1.2.1 19-Apr-2014  rmind file mcclock_frodo.c was added on branch rmind-smpnet on 2014-05-18 17:45:07 +0000
 1.3 21-Jan-2002  jdolecek Switch to MI dev/md_root.c for archs which don't have any special
memory disk hooks (i.e. everything except atari).
 1.2 17-Mar-1999  sommerfe branches: 1.2.22; 1.2.26;
defopt MINIROOTSIZE
 1.1 21-Sep-1997  thorpej branches: 1.1.2;
Add support for mounting a memory disk as the root device.
 1.1.2.2 29-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.1.2.1 21-Sep-1997  thorpej file md_root.c was added on branch marc-pcmcia on 1997-09-29 07:20:06 +0000
 1.2.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.56 26-Nov-2022  tsutsui Misc KNF and cosmetics.

No binary change.
 1.55 05-Jul-2021  tsutsui Pull HP-IB probe fixes from OpenBSD/hp300.

https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2
> Overhaul the way HP-IB devices are probed. We will now do an exhaustive
> probe of the (slave, punit) tuple space, since this is the only way we
> can get a dual disk or dual tape enclosure to attach two devices of the
> same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.
 1.54 25-Jul-2014  dholland branches: 1.54.32; 1.54.44;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.53 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.52 24-Mar-2014  christos branches: 1.52.2;
- remove unused
- use cpu_{g,s}etmodel
 1.51 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.50 05-Dec-2009  pooka branches: 1.50.12; 1.50.22; 1.50.26;
Convert tsleep(&lbolt) to kpause(). Make ltsleep/mtsleep on lbolt
illegal. I examined all places where lbolt is referenced to make
sure there were pointer aliases of it passed to tsleep, but put a
KASSERT in m/ltsleep() just to be sure.
 1.49 26-May-2009  he Remove a now-unused local variable.
 1.48 26-May-2009  ad Build failure, reported by he@
 1.47 18-May-2009  ad Don't pass a buffer to physio(), let it be allocated dynamically.

This leaves only scsipi and atapi doing the same.
 1.46 13-Jan-2009  yamt g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.45 17-Jun-2008  he branches: 1.45.4;
Correct minor mistakes and restore this to a buildable state.
 1.44 13-Jun-2008  cegger use device_lookup_private to get softc
 1.43 28-Apr-2008  martin branches: 1.43.2; 1.43.4;
Remove clause 3 and 4 from TNF licenses
 1.42 29-Mar-2008  tsutsui branches: 1.42.2; 1.42.4;
Split device_t/softc, and misc cosmetic changes.
 1.41 02-Jan-2008  ad branches: 1.41.6;
Merge vmlocking2 to head.
 1.40 17-Oct-2007  garbled branches: 1.40.2; 1.40.4; 1.40.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.39 29-Jul-2007  ad branches: 1.39.6;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.38 12-Jul-2007  he branches: 1.38.2; 1.38.4;
Adapt to the new signature of callout_init().
 1.37 04-Mar-2007  christos branches: 1.37.2; 1.37.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.36 15-Feb-2007  reinoud branches: 1.36.2;
Rename the B_XXX flag to B_DEVPRIVATE flag since it was never used for
debugging and its main use is in device drivers. Its used there to signal
that the flagged buffer has a special meaning or should be handled
differently.

OK'd by Bill Sudenmund on tech-kern.
 1.35 21-Jul-2006  tsutsui Some KNF.
 1.34 28-Mar-2006  thorpej Use device_unit().
 1.33 19-Mar-2006  tsutsui TAB/space cleanup.
 1.32 23-Feb-2006  thorpej branches: 1.32.2; 1.32.4; 1.32.6;
Use device_parent().
 1.31 11-Dec-2005  christos branches: 1.31.2; 1.31.4; 1.31.6;
merge ktrace-lwp.
 1.30 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.29 02-Jun-2005  tsutsui branches: 1.29.2;
Add const.
 1.28 19-Feb-2005  tsutsui Include "ioconf.h" for struct cfdriver *_cd decls.
 1.27 28-Oct-2004  yamt branches: 1.27.4; 1.27.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.26 22-Sep-2004  yamt fix printf formats to match with sys/buf.h 1.75.
 1.25 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.24 17-Nov-2003  tsutsui TAB/space cleanup.
 1.23 29-Jun-2003  fvdl branches: 1.23.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.22 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.21 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.20 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.19 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.18 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.17 26-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.16 15-Mar-2002  gmcgarry branches: 1.16.4;
Add RCSIDs.
 1.15 23-Feb-2002  gmcgarry Unnecessary to cast splx() to void.
 1.14 19-May-2000  thorpej branches: 1.14.6; 1.14.8; 1.14.12;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.13 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.12 06-Feb-2000  frueauf remove unused variable *dp.
 1.11 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.10 12-Jan-1998  thorpej branches: 1.10.14;
Update for changes to config.
 1.9 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.8 31-Mar-1997  scottr branches: 1.8.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.7 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.6 14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.5 13-Oct-1996  christos backout previous kprintf changes
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.2 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.1 02-Oct-1995  thorpej Driver for HP 7974a, 7978a/b, 7979a, 7980a, and 7980xc 9-track HP-IB tapes.
Original version contributed to Utah by Mt. Xinu. Ported to 4.4BSD by
Mark Davies and Andrew Vignaux.
 1.8.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.12.6 11-Nov-2002  nathanw Catch up to -current
 1.14.12.5 18-Oct-2002  nathanw Catch up to -current.
 1.14.12.4 17-Sep-2002  nathanw Catch up to -current.
 1.14.12.3 01-Aug-2002  nathanw Catch up to -current.
 1.14.12.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.14.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.14.8.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.14.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.8.1 16-Mar-2002  jdolecek Catch up with -current.
 1.14.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.16.4.2 30-Aug-2002  gehenna catch up with -current.
 1.16.4.1 17-May-2002  gehenna Add device switch.
 1.23.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.23.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.23.2.7 24-Jan-2005  skrll Adapt to branch.
 1.23.2.6 02-Nov-2004  skrll Sync with HEAD.
 1.23.2.5 24-Sep-2004  skrll Sync with HEAD.
 1.23.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.23.2.2 03-Sep-2004  skrll Sync with HEAD
 1.23.2.1 03-Aug-2004  skrll Sync with HEAD
 1.27.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.27.4.1 29-Apr-2005  kent sync with -current
 1.29.2.5 21-Jan-2008  yamt sync with head
 1.29.2.4 03-Sep-2007  yamt sync with head.
 1.29.2.3 26-Feb-2007  yamt sync with head.
 1.29.2.2 30-Dec-2006  yamt sync with head.
 1.29.2.1 21-Jun-2006  yamt sync with head.
 1.31.6.1 22-Apr-2006  simonb Sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.31.2.1 01-Mar-2006  yamt sync with head.
 1.32.6.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.32.6.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.32.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.32.2.2 11-Aug-2006  yamt sync with head
 1.32.2.1 01-Apr-2006  yamt sync with head.
 1.36.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.10.1 03-Oct-2007  garbled Sync with HEAD
 1.37.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.37.2.1 15-Jul-2007  ad Sync with head.
 1.38.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.38.2.1 07-Aug-2007  matt Sync with HEAD.
 1.39.6.2 09-Jan-2008  matt sync with HEAD
 1.39.6.1 06-Nov-2007  matt sync with HEAD
 1.40.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.40.4.1 31-Dec-2007  ad Make compile with new buffer cache locking scheme.

XXX This should be largely MI, please do not make another clone of disksubr.c.
 1.40.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.41.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.41.6.3 29-Jun-2008  mjf Sync with HEAD.
 1.41.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.41.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.42.4.4 11-Mar-2010  yamt sync with head
 1.42.4.3 20-Jun-2009  yamt sync with head
 1.42.4.2 04-May-2009  yamt sync with head.
 1.42.4.1 16-May-2008  yamt sync with head.
 1.42.2.2 17-Jun-2008  yamt sync with head.
 1.42.2.1 18-May-2008  yamt sync with head.
 1.43.4.1 18-Jun-2008  simonb Sync with head.
 1.43.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.45.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.50.26.1 18-May-2014  rmind sync with head
 1.50.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.50.12.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.52.2.1 10-Aug-2014  tls Rebase.
 1.54.44.1 01-Aug-2021  thorpej Sync with HEAD.
 1.54.32.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.9 19-Aug-2023  andvar fix typos in documented error codes.
 1.8 26-Nov-2022  tsutsui Misc KNF and cosmetics.

No binary change.
 1.7 05-Dec-2021  msaitoh s/corect/correct/ in comment.
 1.6 28-May-2019  msaitoh s/recieve/receive/
 1.5 06-Mar-2011  tsutsui branches: 1.5.56;
Remove trailing spaces.
 1.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106;
merge ktrace-lwp.
 1.3 24-Feb-2004  wiz occured -> occurred. From Peter Postma.
 1.2 12-Jun-2001  wiz branches: 1.2.8; 1.2.24;
receive, not recieve
 1.1 02-Oct-1995  thorpej branches: 1.1.44;
Driver for HP 7974a, 7978a/b, 7979a, 7980a, and 7980xc 9-track HP-IB tapes.
Original version contributed to Utah by Mt. Xinu. Ported to 4.4BSD by
Mark Davies and Andrew Vignaux.
 1.1.44.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.2 12-Jun-2001  wiz receive, not recieve
 1.2.8.1 12-Jun-2001  wiz file mtreg.h was added on branch nathanw_sa on 2001-06-12 15:17:19 +0000
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 21-Apr-2011  rmind sync with head
 1.5.56.1 10-Jun-2019  christos Sync with HEAD
 1.44 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.43 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42 24-Apr-2021  thorpej branches: 1.42.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.41 24-Mar-2014  christos branches: 1.41.44;
- remove unused
- use cpu_{g,s}etmodel
 1.40 28-Apr-2008  martin branches: 1.40.34; 1.40.44; 1.40.50;
Remove clause 3 and 4 from TNF licenses
 1.39 29-Mar-2008  tsutsui branches: 1.39.2; 1.39.4;
Split device_t/softc, and misc cosmetic changes.
 1.38 05-Dec-2007  tsutsui branches: 1.38.12;
Use queue(3) macro.
 1.37 17-Oct-2007  garbled branches: 1.37.2; 1.37.4;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.36 12-Jul-2007  he branches: 1.36.8; 1.36.10;
Adapt to the new signature of callout_init().
 1.35 21-Jul-2006  tsutsui branches: 1.35.14; 1.35.22;
Some KNF.
 1.34 19-Mar-2006  tsutsui TAB/space cleanup.
 1.33 23-Feb-2006  thorpej branches: 1.33.2; 1.33.4; 1.33.6;
Use device_parent().
 1.32 11-Dec-2005  christos branches: 1.32.2; 1.32.4; 1.32.6;
merge ktrace-lwp.
 1.31 28-Aug-2004  thorpej branches: 1.31.12;
Use ANSI function decls, static, and const.
 1.30 17-Nov-2003  tsutsui TAB/space cleanup.
 1.29 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.28 05-Jul-2003  tsutsui Some cosmetics on bus_space_tag_t initialization.
 1.27 24-May-2003  gmcgarry branches: 1.27.2;
Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.26 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.25 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.24 15-Mar-2002  gmcgarry Add RCSIDs.
 1.23 25-Mar-2000  frueauf branches: 1.23.8; 1.23.12;
Fix typo: calllout_reset -> callout_reset.
 1.22 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.21 17-Sep-1999  thorpej branches: 1.21.2;
Centralize the declaration and clearing of `cold'.
 1.20 01-Jul-1998  thorpej Dont' check sysflags here... just look for NHPIB or IHPIB device IDs.
 1.19 12-Jan-1998  thorpej Update for changes to config.
 1.18 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.17 05-May-1997  thorpej branches: 1.17.4;
Use dio_intr_establish().
 1.16 14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.15 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.14 30-Jan-1997  thorpej - Convert these drivers to new-style autoconfiguration. Old-style
configuration is no longer supported.
- Use a much more obvious HP-IB job queueing scheme.
 1.13 13-Oct-1996  christos backout previous kprintf changes
 1.12 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.11 18-May-1996  thorpej Back most (not all) of the previous delay-related changes now that
delay is calibrated properly.
 1.10 17-May-1996  thorpej Change "DELAY(1)" to "DELAY(5)". This is basically equivalent to how
the old implementation of DELAY() behaved with small values.
 1.9 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.8 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.7 19-Nov-1995  thorpej Do an indirect driver a little more like an indirect driver would like to
be done. Set up a structure filled with function pointers in the
controller-specific probe routines, and jump through them, instead of
if()'ing our way though each operation.

Be a little more discriptive; print out the controller type found
during the probe in a way that's somewhat meaningful.
 1.6 07-Jan-1995  mycroft Various diffs from Mike Hibler; necessary for mt driver.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.17.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.21.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.23.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.23.12.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.23.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.23.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.27.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.27.2.2 03-Sep-2004  skrll Sync with HEAD
 1.27.2.1 03-Aug-2004  skrll Sync with HEAD
 1.31.12.4 07-Dec-2007  yamt sync with head
 1.31.12.3 03-Sep-2007  yamt sync with head.
 1.31.12.2 30-Dec-2006  yamt sync with head.
 1.31.12.1 21-Jun-2006  yamt sync with head.
 1.32.6.1 22-Apr-2006  simonb Sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.32.2.1 01-Mar-2006  yamt sync with head.
 1.33.6.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.33.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.33.2.2 11-Aug-2006  yamt sync with head
 1.33.2.1 01-Apr-2006  yamt sync with head.
 1.35.22.1 03-Oct-2007  garbled Sync with HEAD
 1.35.14.1 15-Jul-2007  ad Sync with head.
 1.36.10.2 09-Jan-2008  matt sync with HEAD
 1.36.10.1 06-Nov-2007  matt sync with HEAD
 1.36.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.37.4.1 08-Dec-2007  ad Sync with head.
 1.37.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.38.12.2 02-Jun-2008  mjf Sync with HEAD.
 1.38.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.39.4.1 16-May-2008  yamt sync with head.
 1.39.2.1 18-May-2008  yamt sync with head.
 1.40.50.1 18-May-2014  rmind sync with head
 1.40.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.41.44.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.42.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 07-Jan-1995  mycroft branches: 1.5.66;
Various diffs from Mike Hibler; necessary for mt driver.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.66.1 03-Aug-2004  skrll Sync with HEAD
 1.48 18-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.47 03-Sep-2018  riastradh branches: 1.47.12;
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.46 25-Mar-2017  tsutsui branches: 1.46.12; 1.46.14;
Include <sys/kernel.h> for hz.

Compile test only. (no HP-IB devices here)
 1.45 25-Jul-2014  dholland branches: 1.45.4; 1.45.8; 1.45.12;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.44 16-Mar-2014  dholland branches: 1.44.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.43 28-Jul-2011  uebayasi branches: 1.43.2; 1.43.12; 1.43.16;
dev_t is uint64_t; use PRIx64 to print it. Fix DEBUG build.
 1.42 18-Jun-2008  tsutsui Make this compile.
 1.41 13-Jun-2008  cegger use device_lookup_private to get softc
 1.40 28-Apr-2008  martin branches: 1.40.2; 1.40.4;
Remove clause 3 and 4 from TNF licenses
 1.39 29-Mar-2008  tsutsui branches: 1.39.2; 1.39.4;
Split device_t/softc, and misc cosmetic changes.
 1.38 17-Oct-2007  garbled branches: 1.38.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.37 12-Jul-2007  he branches: 1.37.10;
Adapt to the new signature of callout_init().
 1.36 04-Mar-2007  christos branches: 1.36.2; 1.36.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 16-Feb-2007  ad branches: 1.35.2;
More spllowersoftclock() fallout.
 1.34 21-Jul-2006  tsutsui Some KNF.
 1.33 28-Mar-2006  thorpej Use device_unit().
 1.32 23-Feb-2006  thorpej branches: 1.32.2; 1.32.4; 1.32.6;
Use device_parent().
 1.31 11-Dec-2005  christos branches: 1.31.2; 1.31.4; 1.31.6;
merge ktrace-lwp.
 1.30 19-Feb-2005  tsutsui branches: 1.30.6;
Include "ioconf.h" for struct cfdriver *_cd decls.
 1.29 28-Aug-2004  thorpej branches: 1.29.4; 1.29.6;
Use ANSI function decls, static, and const.
 1.28 17-Nov-2003  tsutsui TAB/space cleanup.
 1.27 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.26 29-Jun-2003  fvdl branches: 1.26.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.25 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.24 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.21 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.20 15-Mar-2002  gmcgarry branches: 1.20.4;
Add RCSIDs.
 1.19 27-May-2000  thorpej branches: 1.19.6; 1.19.8; 1.19.12;
sleep() -> tsleep()
 1.18 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.17 05-Aug-1999  thorpej branches: 1.17.2;
Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied. Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

This fixes a problem with using the "rnd" pseudo-device from within
interrupt context to extract random data (e.g. from within the softnet
interrupt) where doing so would incorrectly unblock interrupts (causing
all sorts of lossage).

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX. This platforms still have this bug until their
XXX spl*() functions are fixed.
 1.16 12-Jan-1998  thorpej Update for changes to config.
 1.15 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.14 18-Jul-1997  jtk branches: 1.14.2;
remove old *_UNK style default defines, use standard names from locators.h
 1.13 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.12 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.11 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.10 13-Oct-1996  christos backout previous kprintf changes
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.7 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 25-May-1994  mycroft Merge with 4.4-Lite.
 1.4 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.3 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.14.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.17.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.19.12.4 11-Nov-2002  nathanw Catch up to -current
 1.19.12.3 18-Oct-2002  nathanw Catch up to -current.
 1.19.12.2 17-Sep-2002  nathanw Catch up to -current.
 1.19.12.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.19.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.19.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.20.4.1 17-May-2002  gehenna Add device switch.
 1.26.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.26.2.5 24-Jan-2005  skrll Adapt to branch.
 1.26.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.26.2.2 03-Sep-2004  skrll Sync with HEAD
 1.26.2.1 03-Aug-2004  skrll Sync with HEAD
 1.29.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.29.4.1 29-Apr-2005  kent sync with -current
 1.30.6.4 03-Sep-2007  yamt sync with head.
 1.30.6.3 26-Feb-2007  yamt sync with head.
 1.30.6.2 30-Dec-2006  yamt sync with head.
 1.30.6.1 21-Jun-2006  yamt sync with head.
 1.31.6.1 22-Apr-2006  simonb Sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.31.2.1 01-Mar-2006  yamt sync with head.
 1.32.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.32.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.32.2.2 11-Aug-2006  yamt sync with head
 1.32.2.1 01-Apr-2006  yamt sync with head.
 1.35.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.36.10.1 03-Oct-2007  garbled Sync with HEAD
 1.36.2.1 15-Jul-2007  ad Sync with head.
 1.37.10.1 06-Nov-2007  matt sync with HEAD
 1.38.16.3 29-Jun-2008  mjf Sync with HEAD.
 1.38.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.38.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.39.4.2 04-May-2009  yamt sync with head.
 1.39.4.1 16-May-2008  yamt sync with head.
 1.39.2.2 17-Jun-2008  yamt sync with head.
 1.39.2.1 18-May-2008  yamt sync with head.
 1.40.4.1 18-Jun-2008  simonb Sync with head.
 1.40.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.43.16.1 18-May-2014  rmind sync with head
 1.43.12.2 03-Dec-2017  jdolecek update from HEAD
 1.43.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.43.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.44.2.1 10-Aug-2014  tls Rebase.
 1.45.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.45.8.1 26-Apr-2017  pgoyette Sync with HEAD
 1.45.4.1 28-Aug-2017  skrll Sync with HEAD
 1.46.14.1 10-Jun-2019  christos Sync with HEAD
 1.46.12.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.47.12.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 26-Oct-1994  cgd branches: 1.4.66;
new RCS ID format.
 1.3 25-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.66.1 03-Aug-2004  skrll Sync with HEAD
 1.5 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.4 15-Jan-2023  tsutsui branches: 1.4.6;
TAB/space cleanup.
 1.3 18-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.90;
Use aprint_normal(9) and variants.
 1.2 12-Feb-2011  tsutsui - make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.4 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file rbox.c was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.3.90.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 18-Feb-2011  jruoho file rbox.c was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 18-Feb-2011  rmind file rbox.c was added on branch rmind-uvmplock on 2011-03-05 20:50:22 +0000
 1.4.6.1 02-Aug-2025  perseant Sync with HEAD
 1.3 15-Jan-2023  tsutsui TAB/space cleanup.
 1.2 12-Feb-2011  tsutsui branches: 1.2.2; 1.2.6; 1.2.90;
- make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file rboxreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.2.90.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 12-Feb-2011  jruoho file rboxreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 12-Feb-2011  rmind file rboxreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:22 +0000
 1.126 21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.125 12-Feb-2023  andvar fix various typos in comments.
 1.124 03-Dec-2022  tsutsui Explicitly include <sys/kernel.h> for hz(9) as man pages says.

XXX: it looks sys/param.h r1.615 and later also has extern int hz
 1.123 03-Dec-2022  tsutsui Add empty DIOCCACHESYNC ioctl(2) for rd(4).

Without this raid(4) always complains on various raidctl(8) ops:
> raid0: cache flush[0] to component 0 failed (22)

RAID1 configured by raid(4) just works HP-IB disks on hp300.
 1.122 01-Dec-2022  tsutsui Misc KNF and cosmetics.
 1.121 30-Nov-2022  tsutsui Remove more duplicated static function declarations.
 1.120 30-Nov-2022  tsutsui Use proper RAW_PART macro rather than a magic number.
 1.119 30-Nov-2022  tsutsui Set disk_geom parameters required by DIOCGPARTINFO in disk_ioctl().

With this change raid(4) no longer complains before mountroot:
> RAIDframe: can't get disk size for dev rd0 (22)

Should be pulled up to netbsd-9.
 1.118 30-Nov-2022  tsutsui Remove a duplicated static function declaration.
 1.117 30-Nov-2022  tsutsui Pass a correct dev_t arg to disk_ioctl().

Probably harmless.
 1.116 30-Nov-2022  tsutsui Check bounds of each partition by MI bounds_check_with_label(9).

The previous implementation was committed in rev 1.26 about 26 years ago
and it looks there is no quirk to use the old MD one.
 1.115 30-Nov-2022  tsutsui Check bounds of RAW_PART by bounds_check_with_mediasize() as other drivers.

With this check, dd(1) without a count value against a raw partition
is terminated properly at the end of media. Tested on 425t and HPDisk.

Should be pulled up to netbsd-9.
 1.114 25-Nov-2022  tsutsui Remove unnecessary declarations.
 1.113 25-Nov-2022  tsutsui Use proper integer types for HP-IB xfer parameters.

No visible regression on 425t and HPDisk.
 1.112 23-Nov-2022  tsutsui Fix "rd(4) at punits not configured on HPDisk are misprobed" problem.

- check not only stat value returned by C_QSTAT command against
each punit but also desc.d_name returned by C_DESC command
because it looks HPDisk responds to commands against punits supported
but not-configured punits at 1-3
- prepare rdreset_unit() function to manage reset punit ops during
probe without valid softc

The stragety is taken from OpenBSD with several modification.
Tested on 425t with real 9122D and HPDisk emulating two 7937H drives.

Should be pulled up to netbsd-9.
 1.111 21-Nov-2022  tsutsui Use common macro for numbers of cylinders and blocks for HP-IB disks.

No binary changes.
 1.110 31-Jul-2021  andvar s/threshhold/threshold
 1.109 11-Jul-2021  tsutsui Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.
 1.108 09-Jul-2021  tsutsui Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.
 1.107 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.106 05-Jul-2021  tsutsui Move attach messages from common rdident() to explicit rdattach().
 1.105 05-Jul-2021  tsutsui Pull HP-IB probe fixes from OpenBSD/hp300.

https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2
> Overhaul the way HP-IB devices are probed. We will now do an exhaustive
> probe of the (slave, punit) tuple space, since this is the only way we
> can get a dual disk or dual tape enclosure to attach two devices of the
> same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.
 1.104 30-Jun-2021  tsutsui No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.
 1.103 10-Jan-2021  tsutsui branches: 1.103.4;
Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.102 29-Sep-2020  msaitoh branches: 1.102.2;
s/parition/partition/
 1.101 13-Apr-2015  riastradh branches: 1.101.22;
MD rnd.h cleanups. Please let me know if I broke anything!
 1.100 02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.99 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.98 10-Aug-2014  tls branches: 1.98.4;
Merge tls-earlyentropy branch into HEAD.
 1.97 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.96 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.95 24-Mar-2014  christos branches: 1.95.2;
- remove unused
- use cpu_{g,s}etmodel
 1.94 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.93 13-Oct-2012  tsutsui branches: 1.93.2;
struct device * -> device_t, struct cfdata * -> cfdata_t
use device_xname() (from chs@)
 1.92 02-Feb-2012  tls branches: 1.92.6;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.91 28-Jul-2011  uebayasi branches: 1.91.2; 1.91.6;
dev_t is uint64_t; use PRIx64 to print it. Fix DEBUG build.
 1.90 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.89 13-Jan-2009  yamt branches: 1.89.6; 1.89.8; 1.89.10;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.88 17-Jun-2008  he branches: 1.88.4;
Add some missing parenthesis to restore this to a buildable state.
 1.87 13-Jun-2008  cegger use device_lookup_private to get softc
 1.86 28-Apr-2008  martin branches: 1.86.2; 1.86.4;
Remove clause 3 and 4 from TNF licenses
 1.85 29-Mar-2008  tsutsui branches: 1.85.2; 1.85.4;
Split device_t/softc, and misc cosmetic changes.
 1.84 17-Oct-2007  garbled branches: 1.84.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.83 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.82 29-Jul-2007  ad branches: 1.82.4; 1.82.6; 1.82.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.81 12-Jul-2007  he branches: 1.81.2; 1.81.4;
Adapt to the new signature of callout_init().
 1.80 04-Mar-2007  tsutsui branches: 1.80.2; 1.80.10;
Use (char *) cast on pointer arith.
 1.79 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.78 21-Jul-2006  tsutsui branches: 1.78.10;
Some KNF.
 1.77 16-Jun-2006  tsutsui - strncpy -> strlcpy
- 16 -> sizeof(foo)
 1.76 10-Jun-2006  tsutsui branches: 1.76.2;
space nits.
 1.75 14-May-2006  elad branches: 1.75.2;
integrate kauth.
 1.74 14-Apr-2006  blymn Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
 1.73 29-Mar-2006  tsutsui Add a missing parenthesis.
 1.72 28-Mar-2006  thorpej Use device_unit().
 1.71 25-Feb-2006  wiz branches: 1.71.2; 1.71.4; 1.71.6;
Fix some typos.
 1.70 23-Feb-2006  thorpej Use device_parent().
 1.69 11-Dec-2005  christos branches: 1.69.2; 1.69.4; 1.69.6;
merge ktrace-lwp.
 1.68 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.67 19-Feb-2005  tsutsui branches: 1.67.6;
Include "ioconf.h" for struct cfdriver *_cd decls.
 1.66 05-Feb-2005  chs make this compile with DEBUG.
 1.65 28-Oct-2004  yamt branches: 1.65.4; 1.65.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.64 28-Aug-2004  thorpej Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
 1.63 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.62 17-Nov-2003  tsutsui TAB/space cleanup.
 1.61 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.60 29-Jun-2003  fvdl branches: 1.60.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.59 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.58 03-May-2003  wiz DMA, not dma nor Dma.
 1.57 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.56 14-Feb-2003  gmcgarry Handle 64-bit daddr_t.
 1.55 01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.54 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.53 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.52 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.51 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.50 26-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.49 08-Apr-2002  gmcgarry branches: 1.49.2;
Create default disklabel correctly.
 1.48 15-Mar-2002  gmcgarry Add RCSIDs.
 1.47 10-Feb-2002  gmcgarry Implement DIOCGDEFLABEL ioctl.
 1.46 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.45 16-Sep-2001  wiz branches: 1.45.4;
Spell 'occurred' with two 'r's.
 1.44 10-Oct-2000  he branches: 1.44.2; 1.44.4;
Add randomness sampling from hil, sd and rd devices.
 1.43 27-May-2000  thorpej branches: 1.43.4;
sleep() -> tsleep()
 1.42 19-May-2000  thorpej A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.41 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.40 11-Feb-2000  kleink printf format mismatch in DEBUG code (related to already fixed PR hp300/9388).
 1.39 07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.38 31-Jan-2000  kleink Make these build again after buf.h/disksort changes.
 1.37 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.36 12-Jan-1998  thorpej branches: 1.36.8; 1.36.14; 1.36.20;
Update for changes to config.
 1.35 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.34 22-Jul-1997  kleink branches: 1.34.2;
Remove old *_UNK style default defines, use standard names from locators.h.
Missed in "locators.h" cleanup; reported by Thorsten Frueauf in PR 3906.
 1.33 10-Jul-1997  kleink Remove misplaced/unnecessary VM #include cruft; from Thorsten Frueauf
<frueauf@ira.uka.de> in PR port-hp300/3851.
 1.32 24-Jun-1997  thorpej foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
 1.31 05-May-1997  thorpej Update for USELEDS changes.
 1.30 09-Apr-1997  thorpej Use the %x printf format where appropriate
 1.29 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.28 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.27 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.26 07-Jan-1997  thorpej Bring some sanity into my frazzled existence:
- Always ensure that RAW_PART ("c") can be opened.
- Disallow unused or non-existent partitions from being opened.
- Don't do bounds checking or partition translation on RAW_PART.
This is consistent with other disk drivers in the NetBSD source tree,
and fixes a condition where the user could not fix a corrupted disklabel
due to a bogus offset for partition "c".
 1.25 14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.24 13-Oct-1996  christos backout previous kprintf changes
 1.23 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.22 06-Oct-1996  thorpej Fix kernel crash dumps. Still uses the old format for now.
 1.21 06-Jun-1996  thorpej Remove the old-style disk instrumentation support. Nothing uses it
anymore.
 1.20 14-Feb-1996  thorpej branches: 1.20.4;
All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.19 03-Feb-1996  thorpej Remove bogus "return (0);" in rdmatch() that wiggled its way in uninvited.
 1.18 10-Jan-1996  thorpej Kludge around a case where a flaky HP-IB disk might be slow to respond
to the identification request in rdmatch(). Similar in spirit to a
patch from Jason Downs (written eons ago), but limited to the broken
device we're trying to reach. My patch tested (and fixed :-) by
Herb Peyerl.
 1.17 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.16 09-Dec-1995  thorpej Pass the correct number of arguments to readdisklabel().
 1.15 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.14 19-Nov-1995  thorpej Re-arrange things such that we can print out disk geometry regardless of
COMPAT_NOLABEL.

XXX One day when the world doesn't assume DEV_BSIZE bytes/sector, we'll be
able to actually use the stuff sensed from the drive, rather than a table.
 1.13 09-Oct-1995  thorpej Pass correct number of arguments to hpibgo().
 1.12 04-Aug-1995  thorpej Update for conf.h changes.
 1.11 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.10 26-Oct-1994  cgd new RCS ID format.
 1.9 27-May-1994  mycroft Bug fixes from Mike Hibler.
 1.8 23-May-1994  mycroft Merge with 4.4-Lite.
 1.7 11-May-1994  mycroft Get rid of private *read() and *write() functions.
 1.6 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.5 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.4 11-Jan-1994  mycroft *strategy functions return void.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.20.4.1 06-Jun-1996  thorpej Update from trunk:

Remove old-style disk instrumentation support. Nothing uses it
anymore.
 1.34.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.36.20.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.36.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.36.8.1 12-Oct-2000  he Pull up revision 1.44 (requested by he):
Add randomness sampling for hil, sd and rd on the hp300 port.
 1.43.4.1 18-Oct-2000  tv Pullup 1.44 [he]:
Add randomness sampling from hil, sd and rd devices.
 1.44.4.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.44.4.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.44.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.44.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.44.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.44.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.44.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.45.4.9 11-Nov-2002  nathanw Catch up to -current
 1.45.4.8 18-Oct-2002  nathanw Catch up to -current.
 1.45.4.7 17-Sep-2002  nathanw Catch up to -current.
 1.45.4.6 01-Aug-2002  nathanw Catch up to -current.
 1.45.4.5 17-Apr-2002  nathanw Catch up to -current.
 1.45.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.45.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.45.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.45.4.1 16-Sep-2001  nathanw file rd.c was added on branch nathanw_sa on 2002-01-08 00:24:36 +0000
 1.49.2.2 30-Aug-2002  gehenna catch up with -current.
 1.49.2.1 17-May-2002  gehenna Add device switch.
 1.60.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.60.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.60.2.7 06-Feb-2005  skrll Sync with HEAD.
 1.60.2.6 24-Jan-2005  skrll Adapt to branch.
 1.60.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.60.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.60.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.60.2.2 03-Sep-2004  skrll Sync with HEAD
 1.60.2.1 03-Aug-2004  skrll Sync with HEAD
 1.65.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.65.6.1 12-Feb-2005  yamt sync with head.
 1.65.4.1 29-Apr-2005  kent sync with -current
 1.67.6.4 27-Oct-2007  yamt sync with head.
 1.67.6.3 03-Sep-2007  yamt sync with head.
 1.67.6.2 30-Dec-2006  yamt sync with head.
 1.67.6.1 21-Jun-2006  yamt sync with head.
 1.69.6.1 22-Apr-2006  simonb Sync with head.
 1.69.4.1 09-Sep-2006  rpaulo sync with head
 1.69.2.1 01-Mar-2006  yamt sync with head.
 1.71.6.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.71.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.71.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.71.2.4 11-Aug-2006  yamt sync with head
 1.71.2.3 26-Jun-2006  yamt sync with head.
 1.71.2.2 24-May-2006  yamt sync with head.
 1.71.2.1 01-Apr-2006  yamt sync with head.
 1.75.2.1 19-Jun-2006  chap Sync with head.
 1.76.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.78.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.80.10.2 16-Oct-2007  garbled Sync with HEAD
 1.80.10.1 03-Oct-2007  garbled Sync with HEAD
 1.80.2.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.80.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.80.2.1 15-Jul-2007  ad Sync with head.
 1.81.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.81.2.1 07-Aug-2007  matt Sync with HEAD.
 1.82.8.1 14-Oct-2007  yamt sync with head.
 1.82.6.1 06-Nov-2007  matt sync with HEAD
 1.82.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.84.16.4 17-Jan-2009  mjf Sync with HEAD.
 1.84.16.3 29-Jun-2008  mjf Sync with HEAD.
 1.84.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.84.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.85.4.2 04-May-2009  yamt sync with head.
 1.85.4.1 16-May-2008  yamt sync with head.
 1.85.2.2 17-Jun-2008  yamt sync with head.
 1.85.2.1 18-May-2008  yamt sync with head.
 1.86.4.1 18-Jun-2008  simonb Sync with head.
 1.86.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.88.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.89.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.89.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.89.6.1 05-Mar-2011  rmind sync with head
 1.91.6.1 18-Feb-2012  mrg merge to -current.
 1.91.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.91.2.2 30-Oct-2012  yamt sync with head
 1.91.2.1 17-Apr-2012  yamt sync with head
 1.92.6.4 03-Dec-2017  jdolecek update from HEAD
 1.92.6.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.92.6.2 02-Dec-2012  tls Don't pass NULL struct dkdriver to disk_init. That's seriously bogus.
 1.92.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.93.2.1 18-May-2014  rmind sync with head
 1.95.2.2 10-Aug-2014  tls Rebase.
 1.95.2.1 07-Apr-2014  tls Be a little more clear and consistent about harvesting entropy from devices:

1) deprecate RND_FLAG_NO_ESTIMATE

2) define RND_FLAG_COLLECT_TIME, RND_FLAG_COLLECT_VALUE

3) define RND_FLAG_ESTIMATE_TIME, RND_FLAG_ESTIMATE_VALUE

4) define RND_FLAG_DEFAULT: RND_FLAG_COLLECT_TIME|
RND_FLAG_COLLECT_VALUE|RND_FLAG_ESTIMATE_TIME

5) Make entropy harvesting from environmental sensors a little more generic
and remove it from individual sensor drivers.

6) Remove individual open-coded delta-estimators for values from a few
places in the tree (uvm, environmental drivers).

7) 0 -> RND_FLAG_DEFAULT, actually gather entropy from various drivers
that had stubbed out code, other minor cleanups.
 1.98.4.2 06-Jun-2015  skrll Sync with HEAD
 1.98.4.1 06-Apr-2015  skrll Sync with HEAD
 1.101.22.2 06-Dec-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1552):

sys/arch/hp300/dev/rd.c: revision 1.120
sys/arch/hp300/dev/rd.c: revision 1.121
sys/arch/hp300/dev/rd.c: revision 1.122
sys/arch/hp300/dev/rd.c: revision 1.123
sys/arch/hp300/dev/rd.c: revision 1.124
sys/arch/hp300/dev/rdreg.h: revision 1.19
sys/arch/hp300/dev/rd.c: revision 1.111
sys/arch/hp300/dev/rd.c: revision 1.112
sys/arch/hp300/dev/rd.c: revision 1.113
sys/arch/hp300/stand/common/rd.c: revision 1.12
sys/arch/hp300/dev/rd.c: revision 1.114
sys/arch/hp300/stand/common/rd.c: revision 1.13
sys/arch/hp300/dev/rd.c: revision 1.115
sys/arch/hp300/stand/common/rd.c: revision 1.14
sys/arch/hp300/dev/rd.c: revision 1.116
sys/arch/hp300/stand/common/rd.c: revision 1.15
sys/arch/hp300/dev/rd.c: revision 1.117
sys/arch/hp300/dev/rd.c: revision 1.118
sys/arch/hp300/dev/rd.c: revision 1.119
sys/arch/hp300/dev/rdvar.h: revision 1.27
sys/arch/hp300/dev/rdreg.h: revision 1.20

Sync a list of HP-IB disk IDs with kernel's one.
Now bootloader can boot from 2202A, 7908A, 7911A, and 7941A.
Tested on 425t and HPDisk.

Make local variables static and read only ones const.

Use common macro for numbers of cylinders and blocks for HP-IB disks.
No binary changes.

Fix "rd(4) at punits not configured on HPDisk are misprobed" problem.
- check not only stat value returned by C_QSTAT command against
each punit but also desc.d_name returned by C_DESC command
because it looks HPDisk responds to commands against punits supported
but not-configured punits at 1-3
- prepare rdreset_unit() function to manage reset punit ops during
probe without valid softc

The stragety is taken from OpenBSD with several modification.
Tested on 425t with real 9122D and HPDisk emulating two 7937H drives.
Should be pulled up to netbsd-9.

Remove now unused buffer members from softc prepared only for rdreset().

Use proper integer types for HP-IB xfer parameters.
No visible regression on 425t and HPDisk.

Sync with rdreg.h integer type changes.

Remove unnecessary declarations.

Check bounds of RAW_PART by bounds_check_with_mediasize() as other drivers.
With this check, dd(1) without a count value against a raw partition
is terminated properly at the end of media. Tested on 425t and HPDisk.
Should be pulled up to netbsd-9.

Check bounds of each partition by MI bounds_check_with_label(9).
The previous implementation was committed in rev 1.26 about 26 years ago
and it looks there is no quirk to use the old MD one.

Pass a correct dev_t arg to disk_ioctl().
Probably harmless.

Remove a duplicated static function declaration.

Set disk_geom parameters required by DIOCGPARTINFO in disk_ioctl().
With this change raid(4) no longer complains before mountroot:
RAIDframe: can't get disk size for dev rd0 (22)
Should be pulled up to netbsd-9.

Use proper RAW_PART macro rather than a magic number.

Remove more duplicated static function declarations.

Misc KNF and cosmetics.

Add empty DIOCCACHESYNC ioctl(2) for rd(4).
Without this raid(4) always complains on various raidctl(8) ops:
raid0: cache flush[0] to component 0 failed (22)
RAID1 configured by raid(4) just works HP-IB disks on hp300.

Explicitly include <sys/kernel.h> for hz(9) as man pages says.
XXX: it looks sys/param.h r1.615 and later also has extern int hz
 1.101.22.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.102.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.103.4.1 01-Aug-2021  thorpej Sync with HEAD.
 1.13 28-Aug-2004  thorpej Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
 1.12 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.11 17-Nov-2003  tsutsui TAB/space cleanup.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 15-Mar-2002  gmcgarry branches: 1.9.12;
Add RCSIDs.
 1.8 12-Jan-1998  thorpej branches: 1.8.28; 1.8.32;
Update for changes to config.
 1.7 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.6 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.5 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.4 19-Nov-1995  thorpej Re-arrange things such that we can print out disk geometry regardless of
COMPAT_NOLABEL.

XXX One day when the world doesn't assume DEV_BSIZE bytes/sector, we'll be
able to actually use the stuff sensed from the drive, rather than a table.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 16-Jul-1994  cgd get device.h from the right place
 1.1 23-May-1994  mycroft branches: 1.1.2;
Merge with 4.4-Lite.
 1.1.2.1 16-Jul-1994  cgd update from trunk
 1.8.32.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.28.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.12.2 03-Sep-2004  skrll Sync with HEAD
 1.9.12.1 03-Aug-2004  skrll Sync with HEAD
 1.21 10-Feb-2024  andvar s/indicies/indices/ in comments.
 1.20 25-Nov-2022  tsutsui Use proper integer types for HP-IB xfer parameters.

No visible regression on 425t and HPDisk.
 1.19 21-Nov-2022  tsutsui Use common macro for numbers of cylinders and blocks for HP-IB disks.

No binary changes.
 1.18 23-May-2022  andvar s/boundries/boundaries/, s/itterate/iterate/ and few more typos.
 1.17 11-Jul-2021  tsutsui Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.
 1.16 09-Jul-2021  tsutsui Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.
 1.15 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.14 18-May-2021  tsutsui Consistently use #define<tab> here.
 1.13 08-Feb-2011  rmind branches: 1.13.60; 1.13.72; 1.13.74;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.12 11-Dec-2005  christos branches: 1.12.100; 1.12.106; 1.12.108;
merge ktrace-lwp.
 1.11 19-Apr-2004  wiz Spell removable with only two es. Inspired by jmc@openbsd.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 11-Feb-2002  wiz branches: 1.9.16;
"doesn't" should have an 's'.
 1.8 27-May-2001  gmcgarry branches: 1.8.2; 1.8.8;
Alignment fix. rd disks now work on ELF systems.
 1.7 09-Feb-1996  scottr branches: 1.7.42;
Info from Mike Hibler <mike@cs.utah.edu> indicates that the probable
intent for the value of the C_REL constant was 0xc0. Testing has turned
up no adverse effect on tape or disk devices, and in fact this change
apparently makes my 9145 tape work as expected. (!) Closes PRs 1874 and
1971.
 1.6 31-Dec-1995  thorpej XXX TEMPORARY STOP-GAP MEASURE! A 12-bit command modifier was being
squished into an 8-bit position in a command stream! Which one is wrong?
Changed the constant from 0x140 to 0x40, which is what ended up happening
anyhow. This exists in the old Utah sources, too! How long has this
bug existed?!
 1.5 26-Oct-1994  cgd branches: 1.5.2;
new RCS ID format.
 1.4 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.2.1 12-Feb-1996  thorpej Bring in C_REL fix from main branch; reported to make 9145 tapes work
properly, and even seems to make HP-IB disks a bit faster.
 1.7.42.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.8.1 27-May-2001  nathanw file rdreg.h was added on branch nathanw_sa on 2002-02-28 04:09:25 +0000
 1.8.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.9.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.16.1 03-Aug-2004  skrll Sync with HEAD
 1.12.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.12.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.100.1 05-Mar-2011  rmind sync with head
 1.13.74.1 31-May-2021  cjep sync with head
 1.13.72.2 01-Aug-2021  thorpej Sync with HEAD.
 1.13.72.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.13.60.2 06-Dec-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1552):

sys/arch/hp300/dev/rd.c: revision 1.120
sys/arch/hp300/dev/rd.c: revision 1.121
sys/arch/hp300/dev/rd.c: revision 1.122
sys/arch/hp300/dev/rd.c: revision 1.123
sys/arch/hp300/dev/rd.c: revision 1.124
sys/arch/hp300/dev/rdreg.h: revision 1.19
sys/arch/hp300/dev/rd.c: revision 1.111
sys/arch/hp300/dev/rd.c: revision 1.112
sys/arch/hp300/dev/rd.c: revision 1.113
sys/arch/hp300/stand/common/rd.c: revision 1.12
sys/arch/hp300/dev/rd.c: revision 1.114
sys/arch/hp300/stand/common/rd.c: revision 1.13
sys/arch/hp300/dev/rd.c: revision 1.115
sys/arch/hp300/stand/common/rd.c: revision 1.14
sys/arch/hp300/dev/rd.c: revision 1.116
sys/arch/hp300/stand/common/rd.c: revision 1.15
sys/arch/hp300/dev/rd.c: revision 1.117
sys/arch/hp300/dev/rd.c: revision 1.118
sys/arch/hp300/dev/rd.c: revision 1.119
sys/arch/hp300/dev/rdvar.h: revision 1.27
sys/arch/hp300/dev/rdreg.h: revision 1.20

Sync a list of HP-IB disk IDs with kernel's one.
Now bootloader can boot from 2202A, 7908A, 7911A, and 7941A.
Tested on 425t and HPDisk.

Make local variables static and read only ones const.

Use common macro for numbers of cylinders and blocks for HP-IB disks.
No binary changes.

Fix "rd(4) at punits not configured on HPDisk are misprobed" problem.
- check not only stat value returned by C_QSTAT command against
each punit but also desc.d_name returned by C_DESC command
because it looks HPDisk responds to commands against punits supported
but not-configured punits at 1-3
- prepare rdreset_unit() function to manage reset punit ops during
probe without valid softc

The stragety is taken from OpenBSD with several modification.
Tested on 425t with real 9122D and HPDisk emulating two 7937H drives.
Should be pulled up to netbsd-9.

Remove now unused buffer members from softc prepared only for rdreset().

Use proper integer types for HP-IB xfer parameters.
No visible regression on 425t and HPDisk.

Sync with rdreg.h integer type changes.

Remove unnecessary declarations.

Check bounds of RAW_PART by bounds_check_with_mediasize() as other drivers.
With this check, dd(1) without a count value against a raw partition
is terminated properly at the end of media. Tested on 425t and HPDisk.
Should be pulled up to netbsd-9.

Check bounds of each partition by MI bounds_check_with_label(9).
The previous implementation was committed in rev 1.26 about 26 years ago
and it looks there is no quirk to use the old MD one.

Pass a correct dev_t arg to disk_ioctl().
Probably harmless.

Remove a duplicated static function declaration.

Set disk_geom parameters required by DIOCGPARTINFO in disk_ioctl().
With this change raid(4) no longer complains before mountroot:
RAIDframe: can't get disk size for dev rd0 (22)
Should be pulled up to netbsd-9.

Use proper RAW_PART macro rather than a magic number.

Remove more duplicated static function declarations.

Misc KNF and cosmetics.

Add empty DIOCCACHESYNC ioctl(2) for rd(4).
Without this raid(4) always complains on various raidctl(8) ops:
raid0: cache flush[0] to component 0 failed (22)
RAID1 configured by raid(4) just works HP-IB disks on hp300.

Explicitly include <sys/kernel.h> for hz(9) as man pages says.
XXX: it looks sys/param.h r1.615 and later also has extern int hz
 1.13.60.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.27 23-Nov-2022  tsutsui Remove now unused buffer members from softc prepared only for rdreset().
 1.26 09-Jul-2021  tsutsui Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.
 1.25 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.24 04-Jun-2021  tsutsui Consistently use #define<tab> as rdreg.h.
 1.23 14-Apr-2015  riastradh branches: 1.23.22; 1.23.34; 1.23.38;
Include <sys/rndsource.h> where it is actually used.

I had removed <sys/rnd.h> from files that didn't mention anything of
the rnd(9) API. But they included other files which assumed
<sys/rnd.h> had already been included.
 1.22 02-Feb-2012  tls branches: 1.22.6; 1.22.24;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.21 19-Nov-2011  tls branches: 1.21.2;
First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

An initial cleanup and minor reorganization of the entropy pool
code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are
fixed. Some effort is made to accumulate entropy more quickly at
boot time.

A generic interface, "rndsink", is added, for stream generators to
request that they be re-keyed with good quality entropy from the pool
as soon as it is available.

The arc4random()/arc4randbytes() implementation in libkern is
adjusted to use the rndsink interface for rekeying, which helps
address the problem of low-quality keys at boot time.

An implementation of the FIPS 140-2 statistical tests for random
number generator quality is provided (libkern/rngtest.c). This
is based on Greg Rose's implementation from Qualcomm.

A new random stream generator, nist_ctr_drbg, is provided. It is
based on an implementation of the NIST SP800-90 CTR_DRBG by
Henric Jungheim. This generator users AES in a modified counter
mode to generate a backtracking-resistant random stream.

An abstraction layer, "cprng", is provided for in-kernel consumers
of randomness. The arc4random/arc4randbytes API is deprecated for
in-kernel use. It is replaced by "cprng_strong". The current
cprng_fast implementation wraps the existing arc4random
implementation. The current cprng_strong implementation wraps the
new CTR_DRBG implementation. Both interfaces are rekeyed from
the entropy pool automatically at intervals justifiable from best
current cryptographic practice.

In some quick tests, cprng_fast() is about the same speed as
the old arc4randbytes(), and cprng_strong() is about 20% faster
than rnd_extract_data(). Performance is expected to improve.

The AES code in src/crypto/rijndael is no longer an optional
kernel component, as it is required by cprng_strong, which is
not an optional kernel component.

The entropy pool output is subjected to the rngtest tests at
startup time; if it fails, the system will reboot. There is
approximately a 3/10000 chance of a false positive from these
tests. Entropy pool _input_ from hardware random numbers is
subjected to the rngtest tests at attach time, as well as the
FIPS continuous-output test, to detect bad or stuck hardware
RNGs; if any are detected, they are detached, but the system
continues to run.

A problem with rndctl(8) is fixed -- datastructures with
pointers in arrays are no longer passed to userspace (this
was not a security problem, but rather a major issue for
compat32). A new kernel will require a new rndctl.

The sysctl kern.arandom() and kern.urandom() nodes are hooked
up to the new generators, but the /dev/*random pseudodevices
are not, yet.

Manual pages for the new kernel interfaces are forthcoming.
 1.20 08-Feb-2011  rmind branches: 1.20.4;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.19 11-Jan-2009  tsutsui branches: 1.19.6; 1.19.8; 1.19.10;
Add casts to int to rdunit() and rdpart() macro to suppress a warning
since they are unlikely 64 bits.

XXX: actually these should be DISKUNIT() and DISKPART() in <sys/disklabel.h>.
 1.18 29-Mar-2008  tsutsui branches: 1.18.4; 1.18.12;
Split device_t/softc, and misc cosmetic changes.
 1.17 11-Dec-2005  christos branches: 1.17.74;
merge ktrace-lwp.
 1.16 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.15 02-Jun-2005  tsutsui branches: 1.15.2;
Add const.
 1.14 28-Aug-2004  thorpej Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
 1.13 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 26-Jul-2002  hannken branches: 1.11.6;
Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.10 10-Oct-2000  he branches: 1.10.4; 1.10.8; 1.10.16;
Add randomness sampling from hil, sd and rd devices.
 1.9 23-Mar-2000  thorpej branches: 1.9.4;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.8 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.7 31-Mar-1997  scottr branches: 1.7.16; 1.7.22;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.6 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.5 06-Jun-1996  thorpej Remove the old-style disk instrumentation support. Nothing uses it
anymore.
 1.4 07-Jan-1996  thorpej branches: 1.4.4;
New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.3 19-Nov-1995  thorpej Re-arrange things such that we can print out disk geometry regardless of
COMPAT_NOLABEL.

XXX One day when the world doesn't assume DEV_BSIZE bytes/sector, we'll be
able to actually use the stuff sensed from the drive, rather than a table.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.4.4.1 06-Jun-1996  thorpej Update from trunk:

Remove old-style disk instrumentation support. Nothing uses it
anymore.
 1.7.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.16.1 12-Oct-2000  he Pull up revision 1.10 (requested by he):
Add randomness sampling for hil, sd and rd on the hp300 port.
 1.9.4.1 18-Oct-2000  tv Pullup 1.10 [he]:
Add randomness sampling from hil, sd and rd devices.
 1.10.16.1 30-Aug-2002  gehenna catch up with -current.
 1.10.8.1 01-Aug-2002  nathanw Catch up to -current.
 1.10.4.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.11.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.11.6.2 03-Sep-2004  skrll Sync with HEAD
 1.11.6.1 03-Aug-2004  skrll Sync with HEAD
 1.15.2.1 21-Jun-2006  yamt sync with head.
 1.17.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.17.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.18.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.18.4.1 04-May-2009  yamt sync with head.
 1.19.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.19.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.6.1 05-Mar-2011  rmind sync with head
 1.20.4.1 17-Apr-2012  yamt sync with head
 1.21.2.1 18-Feb-2012  mrg merge to -current.
 1.22.24.1 06-Jun-2015  skrll Sync with HEAD
 1.22.6.1 03-Dec-2017  jdolecek update from HEAD
 1.23.38.1 06-Jun-2021  cjep sync with head
 1.23.34.2 01-Aug-2021  thorpej Sync with HEAD.
 1.23.34.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.23.22.2 06-Dec-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1552):

sys/arch/hp300/dev/rd.c: revision 1.120
sys/arch/hp300/dev/rd.c: revision 1.121
sys/arch/hp300/dev/rd.c: revision 1.122
sys/arch/hp300/dev/rd.c: revision 1.123
sys/arch/hp300/dev/rd.c: revision 1.124
sys/arch/hp300/dev/rdreg.h: revision 1.19
sys/arch/hp300/dev/rd.c: revision 1.111
sys/arch/hp300/dev/rd.c: revision 1.112
sys/arch/hp300/dev/rd.c: revision 1.113
sys/arch/hp300/stand/common/rd.c: revision 1.12
sys/arch/hp300/dev/rd.c: revision 1.114
sys/arch/hp300/stand/common/rd.c: revision 1.13
sys/arch/hp300/dev/rd.c: revision 1.115
sys/arch/hp300/stand/common/rd.c: revision 1.14
sys/arch/hp300/dev/rd.c: revision 1.116
sys/arch/hp300/stand/common/rd.c: revision 1.15
sys/arch/hp300/dev/rd.c: revision 1.117
sys/arch/hp300/dev/rd.c: revision 1.118
sys/arch/hp300/dev/rd.c: revision 1.119
sys/arch/hp300/dev/rdvar.h: revision 1.27
sys/arch/hp300/dev/rdreg.h: revision 1.20

Sync a list of HP-IB disk IDs with kernel's one.
Now bootloader can boot from 2202A, 7908A, 7911A, and 7941A.
Tested on 425t and HPDisk.

Make local variables static and read only ones const.

Use common macro for numbers of cylinders and blocks for HP-IB disks.
No binary changes.

Fix "rd(4) at punits not configured on HPDisk are misprobed" problem.
- check not only stat value returned by C_QSTAT command against
each punit but also desc.d_name returned by C_DESC command
because it looks HPDisk responds to commands against punits supported
but not-configured punits at 1-3
- prepare rdreset_unit() function to manage reset punit ops during
probe without valid softc

The stragety is taken from OpenBSD with several modification.
Tested on 425t with real 9122D and HPDisk emulating two 7937H drives.
Should be pulled up to netbsd-9.

Remove now unused buffer members from softc prepared only for rdreset().

Use proper integer types for HP-IB xfer parameters.
No visible regression on 425t and HPDisk.

Sync with rdreg.h integer type changes.

Remove unnecessary declarations.

Check bounds of RAW_PART by bounds_check_with_mediasize() as other drivers.
With this check, dd(1) without a count value against a raw partition
is terminated properly at the end of media. Tested on 425t and HPDisk.
Should be pulled up to netbsd-9.

Check bounds of each partition by MI bounds_check_with_label(9).
The previous implementation was committed in rev 1.26 about 26 years ago
and it looks there is no quirk to use the old MD one.

Pass a correct dev_t arg to disk_ioctl().
Probably harmless.

Remove a duplicated static function declaration.

Set disk_geom parameters required by DIOCGPARTINFO in disk_ioctl().
With this change raid(4) no longer complains before mountroot:
RAIDframe: can't get disk size for dev rd0 (22)
Should be pulled up to netbsd-9.

Use proper RAW_PART macro rather than a magic number.

Remove more duplicated static function declarations.

Misc KNF and cosmetics.

Add empty DIOCCACHESYNC ioctl(2) for rd(4).
Without this raid(4) always complains on various raidctl(8) ops:
raid0: cache flush[0] to component 0 failed (22)
RAID1 configured by raid(4) just works HP-IB disks on hp300.

Explicitly include <sys/kernel.h> for hz(9) as man pages says.
XXX: it looks sys/param.h r1.615 and later also has extern int hz
 1.23.22.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.25 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.24 07-Sep-2025  thorpej Remove unnecessary NULL-initialization of TODR handle fields.
 1.23 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.22 15-Jan-2023  tsutsui TAB/space cleanup.
 1.21 19-Apr-2014  tsutsui branches: 1.21.58;
Add proper RealTime Clock support for HP9000/425e.

As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.

Tested on HP425e (with mcclock) and HP362 (with old rtc).
 1.20 08-Feb-2011  rmind branches: 1.20.4; 1.20.10; 1.20.14; 1.20.18; 1.20.28;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.19 29-Mar-2008  tsutsui branches: 1.19.26; 1.19.32; 1.19.34;
Split device_t/softc, and misc cosmetic changes.
 1.18 22-Feb-2007  tsutsui branches: 1.18.42;
- use todr_[gs]ettime_ymdhms
- use bool
- some KNF
 1.17 04-Sep-2006  gdamore branches: 1.17.8;
Remove unused todr_setcal/todr_getcal and all the assorted stub
implementations.
 1.16 21-Jul-2006  tsutsui Some KNF.
 1.15 11-Dec-2005  christos branches: 1.15.4; 1.15.8;
merge ktrace-lwp.
 1.14 05-Jun-2005  he branches: 1.14.2;
Add volatile to the second argument to _gettime / _settime functions.
 1.13 10-Feb-2005  tsutsui Allocate struct todr_chip_handle in struct rtc_softc rather than
using MALLOC(9).
 1.12 02-Jan-2005  tsutsui branches: 1.12.2; 1.12.4;
u_intNN_t -> uintNN_t
 1.11 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.10 17-Nov-2003  tsutsui TAB/space cleanup.
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 19-Jul-2003  tsutsui Rename clockattach() to todr_attach().
 1.7 05-Jul-2003  tsutsui Initialize bus_space_tag in rtc_softc properly in rtcattch().
 1.6 02-Oct-2002  thorpej branches: 1.6.6;
Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 17-Mar-2002  gmcgarry Don't match on trailing spaces in the module name.
 1.3 15-Mar-2002  gmcgarry malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.2 17-Nov-2001  gmcgarry branches: 1.2.2; 1.2.4;
Merge some fixes from clock.c, revision 1.23.
 1.1 17-Nov-2001  gmcgarry Device attachment for the real-time clock.
 1.2.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 17-Nov-2001  thorpej file rtc.c was added on branch kqueue on 2002-01-10 19:42:58 +0000
 1.2.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 17-Nov-2001  nathanw file rtc.c was added on branch nathanw_sa on 2002-01-08 00:24:36 +0000
 1.6.6.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.6.6 15-Feb-2005  skrll Sync with HEAD.
 1.6.6.5 17-Jan-2005  skrll Sync with HEAD.
 1.6.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.2 03-Sep-2004  skrll Sync with HEAD
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.12.4.1 12-Feb-2005  yamt sync with head.
 1.12.2.1 29-Apr-2005  kent sync with -current
 1.14.2.2 26-Feb-2007  yamt sync with head.
 1.14.2.1 30-Dec-2006  yamt sync with head.
 1.15.8.2 14-Sep-2006  yamt sync with head.
 1.15.8.1 11-Aug-2006  yamt sync with head
 1.15.4.1 09-Sep-2006  rpaulo sync with head
 1.17.8.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.18.42.1 03-Apr-2008  mjf Sync with HEAD.
 1.19.34.1 17-Feb-2011  bouyer Sync with HEAD
 1.19.32.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.26.1 05-Mar-2011  rmind sync with head
 1.20.28.1 10-Aug-2014  tls Rebase.
 1.20.18.1 18-May-2014  rmind sync with head
 1.20.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.20.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.21.58.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 17-Nov-2001  gmcgarry branches: 1.2.2; 1.2.4; 1.2.122; 1.2.124; 1.2.126;
Merge some fixes from clock.c, revision 1.23.
 1.1 17-Nov-2001  gmcgarry Device attachment for the real-time clock.
 1.2.126.1 16-May-2008  yamt sync with head.
 1.2.124.1 18-May-2008  yamt sync with head.
 1.2.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 17-Nov-2001  thorpej file rtcreg.h was added on branch kqueue on 2002-01-10 19:42:59 +0000
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 17-Nov-2001  nathanw file rtcreg.h was added on branch nathanw_sa on 2002-01-08 00:24:36 +0000
 1.38 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.37 25-May-2003  tsutsui branches: 1.37.2;
Fix part number in comment.

hp300/dev/scsireg.h says it's HP 98265A SCSI, and
I can't find any description about 98658.
(typo of 98568A backplane expander?)
 1.36 24-May-2003  gmcgarry Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.35 03-May-2003  wiz DMA, not dma nor Dma.
 1.34 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.33 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.30 15-Mar-2002  gmcgarry Add RCSIDs.
 1.29 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.28 19-May-2000  thorpej branches: 1.28.8; 1.28.12;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.27 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.26 31-Oct-1999  he Print drive vendor_id/product_id/revision strings also for SCSI-3 devices.
before: sd0 at oscsi0 targ 0 lun 0: type 0x0, qual 0x0, ver 3
after: sd0 at oscsi0 targ 0 lun 0: <IBM, DGHS09U, 0350> (SCSI-3)
 1.25 06-Feb-1999  thorpej branches: 1.25.2; 1.25.8; 1.25.10; 1.25.12;
Workaround for disks that respond slowly to selection, provided by
David Jones in PR #3769.

Every day, I hate this driver more and more.
 1.24 12-Jan-1998  thorpej Update for changes to config.
 1.23 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.22 17-Jul-1997  jtk branches: 1.22.2;
use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all *UNK uses in
hpib code with the native names from locators.h
 1.21 05-May-1997  thorpej Use dio_intr_establish().
 1.20 27-Apr-1997  thorpej These files depend on things in <machine/hp300spu.h>
 1.19 14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.18 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.17 31-Mar-1997  thorpej Fix a bogus argument to dmafree(), from Scott Reynolds.
 1.16 10-Mar-1997  thorpej Print the interrupt level in scsiattach().
 1.15 30-Jan-1997  thorpej branches: 1.15.4;
- Convert these drivers to new-style autoconfiguration. Old-style
config is no longer supported.
- Use a much more obvious SCSI job queueing scheme.
 1.14 26-Jan-1997  hpeyerl fix an *old* booboo where the dma queue wasn't being set in unexpected
case. Found, fixed, and dictated by jason. (thorpe)
 1.13 09-Dec-1996  thorpej branches: 1.13.2;
isrlink() now returns a cookie. We're not interested in the cookie, so
cast to (void).

Call dmacomputeipl() after we've hooked up our interrupt handler.
 1.12 13-Oct-1996  christos backout previous kprintf changes
 1.11 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.10 18-May-1996  thorpej Back most (not all) of the previous delay-related changes now that
delay is calibrated properly.
 1.9 17-May-1996  thorpej Adjust for new DELAY() ... s/DELAY(1)/DELAY(5)/ and lengthen some
timeouts.
 1.8 14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.7 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.6 16-Oct-1995  thorpej Deal with vendor, product, and revision strings properly.
 1.5 09-Oct-1995  thorpej branches: 1.5.2;
Remove unneeded RCS ids.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.2.1 16-Oct-1995  thorpej Update from trunk; deal with ID strings correctly.
 1.13.2.1 30-Jan-1997  thorpej update from trunk
 1.15.4.1 11-Mar-1997  is merge in changes from Trunk.
 1.22.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.25.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.25.10.1 15-Nov-1999  fvdl Sync with -current
 1.25.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.25.2.1 31-Oct-1999  he Pull up revision 1.26 (requested by he):
Print vendor/product/rev also for SCSI-3 devices.
 1.28.12.4 03-Jan-2003  thorpej Sync with HEAD.
 1.28.12.3 18-Oct-2002  nathanw Catch up to -current.
 1.28.12.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.28.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.28.8.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.28.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.28.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.37.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6 01-Aug-2003  tsutsui Move dev/scsireg.h into stand/common since it is no longer used by kernel.
 1.5 14-May-2002  matt branches: 1.5.10;
Eliminate more commons or redundant declarations.
 1.4 26-Oct-1994  cgd branches: 1.4.46; 1.4.50;
new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.50.1 20-Jun-2002  nathanw Catch up to -current.
 1.4.46.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.10.1 03-Aug-2004  skrll Sync with HEAD
 1.9 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.8 04-Oct-1997  thorpej branches: 1.8.50;
Copyright assigned to The NetBSD Foundation.
 1.7 31-Mar-1997  scottr branches: 1.7.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.6 30-Jan-1997  thorpej - Convert these drivers to new-style autoconfiguration. Old-style
config is no longer supported.
- Use a much more obvious SCSI job queueing scheme.
 1.5 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.7.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.50.1 03-Aug-2004  skrll Sync with HEAD
 1.65 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.64 29-Jun-2003  fvdl branches: 1.64.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.63 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.62 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.61 03-May-2003  wiz DMA, not dma nor Dma.
 1.60 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.59 25-Feb-2003  thorpej Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and
use it. This fixes a few places where either b_dep or b_interlock were
not properly initialized.
 1.58 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.57 01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.56 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.55 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.54 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.53 10-Sep-2002  gmcgarry Garbage-collect unused sdreset(). Remove commented-out prototypes.
 1.52 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.51 26-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.50 15-Mar-2002  gmcgarry branches: 1.50.4;
malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.49 05-Mar-2002  simonb Sort function declarations.
Fix some KNF whitespace nits.
 1.48 23-Feb-2002  gmcgarry Implement DIOCGDEFLABEL ioctl.
 1.47 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.46 19-Jun-2001  wiz branches: 1.46.2; 1.46.4; 1.46.8;
`existent', not `existant'
 1.45 29-May-2001  chs initialize the b_dep field in malloc()'d buffers. fixes PR 13065.
 1.44 10-Oct-2000  he branches: 1.44.2;
Add randomness sampling from hil, sd and rd devices.
 1.43 17-Jul-2000  scottr Repair format type mismatch in DEBUG code. From Steve Peurifoy via PR #10603.
 1.42 27-May-2000  thorpej branches: 1.42.4;
sleep() -> tsleep()
 1.41 19-May-2000  thorpej A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.40 10-Feb-2000  thorpej Fix a couple of printf format botches. port-hp300/9388, Steve Peurifoy.
 1.39 07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.38 31-Jan-2000  kleink Make these build again after buf.h/disksort changes.
 1.37 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.36 12-Jan-1998  thorpej branches: 1.36.8; 1.36.14; 1.36.20;
Update for changes to config.
 1.35 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.34 10-Jul-1997  kleink branches: 1.34.2;
Remove misplaced/unnecessary VM #include cruft; from Thorsten Frueauf
<frueauf@ira.uka.de> in PR port-hp300/3851.
 1.33 24-Jun-1997  thorpej foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
 1.32 05-May-1997  thorpej Update for USELEDS changes.
 1.31 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.30 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.29 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.28 07-Jan-1997  thorpej Bring some sanity into my frazzled existence:
- Always ensure that RAW_PART ("c") can be opened.
- Disallow unused or non-existent partitions from being opened.
- Don't do bounds checking or partition translation on RAW_PART.
This is consistent with other disk drivers in the NetBSD source tree,
and fixes a condition where the user could not fix a corrupted disklabel
due to a bogus offset for partition "c".
 1.27 14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.26 13-Oct-1996  christos backout previous kprintf changes
 1.25 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.24 06-Oct-1996  thorpej Fix kernel crash dumps. Still uses the old format for now.
 1.23 06-Jun-1996  thorpej Remove the old-style disk instrumentation support. Nothing uses it
anymore.
 1.22 14-Feb-1996  thorpej branches: 1.22.4;
All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.21 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.20 09-Dec-1995  thorpej Pass the correct number of arguments to readdisklabel().
 1.19 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.18 16-Oct-1995  thorpej Deal with vendor, product, and revision strings properly.
 1.17 15-Oct-1995  thorpej Be a tad bit more informative when the drive is attached. Print geometry
info when appropriate, because, darn it, it's useful.
 1.16 09-Oct-1995  thorpej branches: 1.16.2;
Remove unneeded RCS ids.
 1.15 02-Jun-1995  mycroft Arrest the KNF policeman.
 1.14 24-May-1995  hpeyerl KNF police.
 1.13 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.12 18-Jan-1995  mycroft Do not allow opening a device which is not `alive'.
 1.11 26-Oct-1994  cgd new RCS ID format.
 1.10 27-May-1994  mycroft Bug fixes from Mike Hibler.
 1.9 23-May-1994  mycroft Merge with 4.4-Lite.
 1.8 11-May-1994  mycroft Get rid of private *read() and *write() functions.
 1.7 22-Feb-1994  hpeyerl SCSI disklabel support complete with Duct Tape (tm).
 1.6 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.5 25-Jan-1994  mycroft Someone should fix his damned tabs after pasting code.
 1.4 25-Jan-1994  brezak Rudimentary disklabel support.
 1.3 07-Aug-1993  mycroft Modified to use disklabels. Needs more work, but this at least boots.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.16.2.2 16-Oct-1995  thorpej Update from trunk; deal with ID strings correctly.
 1.16.2.1 15-Oct-1995  thorpej Update from trunk; be more informative at drive attach time.
 1.22.4.1 06-Jun-1996  thorpej Update from trunk:

Remove old-style disk instrumentation support. Nothing uses it
anymore.
 1.34.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.36.20.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.36.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.36.8.1 12-Oct-2000  he Pull up revision 1.44 (requested by he):
Add randomness sampling for hil, sd and rd on the hp300 port.
 1.42.4.3 07-Jun-2001  he Pull up revision 1.45 (requested by chs):
Initialize the b_dep field after malloc(). Fixes PR#13065.
 1.42.4.2 18-Oct-2000  tv Pullup 1.44 [he]:
Add randomness sampling from hil, sd and rd devices.
 1.42.4.1 14-Sep-2000  scottr Pull up rev 1.43 from scottr:
Repair format type mismatch in DEBUG code. From Steve Peurifoy
via PR #10603.
 1.44.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.46.8.11 11-Nov-2002  nathanw Catch up to -current
 1.46.8.10 18-Oct-2002  nathanw Catch up to -current.
 1.46.8.9 17-Sep-2002  nathanw Catch up to -current.
 1.46.8.8 01-Aug-2002  nathanw Catch up to -current.
 1.46.8.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.46.8.6 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.46.8.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.46.8.4 28-Feb-2002  nathanw Catch up to -current.
 1.46.8.3 08-Jan-2002  nathanw Catch up to -current.
 1.46.8.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.46.8.1 19-Jun-2001  scw file sd.c was added on branch nathanw_sa on 2001-11-18 18:09:32 +0000
 1.46.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.46.2.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.46.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.46.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.46.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.46.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.50.4.2 30-Aug-2002  gehenna catch up with -current.
 1.50.4.1 17-May-2002  gehenna Add device switch.
 1.64.2.2 03-Aug-2004  skrll Sync with HEAD
 1.64.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.10 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.9 30-May-2002  thorpej branches: 1.9.6;
Account for changes to struct partition.
 1.8 15-Mar-2002  gmcgarry branches: 1.8.4;
Add RCSIDs.
 1.7 12-Jan-1998  thorpej branches: 1.7.28; 1.7.32;
Update for changes to config.
 1.6 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.5 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.4 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 16-Jul-1994  cgd get device.h from the right place
 1.1 23-May-1994  mycroft branches: 1.1.2;
Merge with 4.4-Lite.
 1.1.2.1 16-Jul-1994  cgd update from trunk
 1.7.32.2 20-Jun-2002  nathanw Catch up to -current.
 1.7.32.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.28.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.4.1 14-Jul-2002  gehenna catch up with -current.
 1.9.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.10 26-Jul-2002  hannken branches: 1.10.6;
Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.9 10-Oct-2000  he branches: 1.9.2; 1.9.4; 1.9.8; 1.9.16;
Add randomness sampling from hil, sd and rd devices.
 1.8 21-Jan-2000  thorpej branches: 1.8.4;
Update for sys/buf.h/disksort_*() changes.
 1.7 31-Mar-1997  scottr branches: 1.7.16; 1.7.22;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.6 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.5 06-Jun-1996  thorpej Remove the old-style disk instrumentation support. Nothing uses it
anymore.
 1.4 07-Jan-1996  thorpej branches: 1.4.4;
New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.3 15-Oct-1995  thorpej Be a tad bit more informative when the drive is attached. Print geometry
info when appropriate, because, darn it, it's useful.
 1.2 26-Oct-1994  cgd branches: 1.2.2;
new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2.2.1 15-Oct-1995  thorpej Update from trunk; be more informative at drive attach time.
 1.4.4.1 06-Jun-1996  thorpej Update from trunk:

Remove old-style disk instrumentation support. Nothing uses it
anymore.
 1.7.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.16.1 12-Oct-2000  he Pull up revision 1.9 (requested by he):
Add randomness sampling for hil, sd and rd on the hp300 port.
 1.8.4.1 18-Oct-2000  tv Pullup 1.9 [he]:
Add randomness sampling from hil, sd and rd devices.
 1.9.16.1 30-Aug-2002  gehenna catch up with -current.
 1.9.8.1 01-Aug-2002  nathanw Catch up to -current.
 1.9.4.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.4 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.3 24-Apr-2021  thorpej branches: 1.3.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.2 18-Feb-2011  tsutsui branches: 1.2.2; 1.2.6; 1.2.74;
Make local functions static.
 1.1 12-Feb-2011  tsutsui branches: 1.1.2;
Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.
 1.1.2.3 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 12-Feb-2011  bouyer file sgc.c was added on branch bouyer-quota2 on 2011-02-17 11:59:39 +0000
 1.2.74.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 18-Feb-2011  jruoho file sgc.c was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 18-Feb-2011  rmind file sgc.c was added on branch rmind-uvmplock on 2011-03-05 20:50:22 +0000
 1.3.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 12-Feb-2011  tsutsui branches: 1.1.2; 1.1.4; 1.1.8;
Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.
 1.1.8.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.8.1 12-Feb-2011  jruoho file sgcreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.1.4.2 05-Mar-2011  rmind sync with head
 1.1.4.1 12-Feb-2011  rmind file sgcreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:22 +0000
 1.1.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 12-Feb-2011  bouyer file sgcreg.h was added on branch bouyer-quota2 on 2011-02-17 11:59:39 +0000
 1.1 12-Feb-2011  tsutsui branches: 1.1.2; 1.1.4; 1.1.8;
Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.
 1.1.8.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.8.1 12-Feb-2011  jruoho file sgcvar.h was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.1.4.2 05-Mar-2011  rmind sync with head
 1.1.4.1 12-Feb-2011  rmind file sgcvar.h was added on branch rmind-uvmplock on 2011-03-05 20:50:22 +0000
 1.1.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 12-Feb-2011  bouyer file sgcvar.h was added on branch bouyer-quota2 on 2011-02-17 11:59:39 +0000
 1.9 16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.8 12-Feb-2011  tsutsui Handle LED_DISK per DMA xfer.
 1.7 14-May-2008  tsutsui branches: 1.7.20; 1.7.26; 1.7.28;
Normalize my licenses.
 1.6 31-Mar-2008  tsutsui branches: 1.6.2; 1.6.4; 1.6.6;
Split softc/device_t for spc(4) and misc related cleanup.
 1.5 11-Dec-2005  christos branches: 1.5.74;
merge ktrace-lwp.
 1.4 02-Jan-2005  tsutsui u_intNN_t -> uintNN_t
 1.3 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.2 17-Nov-2003  tsutsui branches: 1.2.4;
TAB/space cleanup.
 1.1 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.2.4.6 17-Jan-2005  skrll Sync with HEAD.
 1.2.4.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.4 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.3 03-Sep-2004  skrll Sync with HEAD
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 17-Nov-2003  skrll file spc.c was added on branch ktrace-lwp on 2004-08-03 10:34:24 +0000
 1.5.74.2 02-Jun-2008  mjf Sync with HEAD.
 1.5.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.6.4.1 16-May-2008  yamt sync with head.
 1.6.2.1 18-May-2008  yamt sync with head.
 1.7.28.1 17-Feb-2011  bouyer Sync with HEAD
 1.7.26.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.20.1 05-Mar-2011  rmind sync with head
 1.40 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.39 29-Jun-2003  fvdl branches: 1.39.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.38 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.37 03-May-2003  wiz DMA, not dma nor Dma.
 1.36 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.35 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.34 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.33 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.32 26-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.31 15-Mar-2002  gmcgarry branches: 1.31.4;
Add RCSIDs.
 1.30 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.29 04-Dec-2001  wiz Replace some misuses of "then" with "than".
 1.28 27-May-2000  thorpej branches: 1.28.6; 1.28.8; 1.28.12;
sleep() -> tsleep()
 1.27 19-May-2000  thorpej A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.26 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.25 17-May-1998  hpeyerl branches: 1.25.14;
Add the HP35470A DAT drive.
 1.24 12-Jan-1998  thorpej Update for changes to config.
 1.23 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.22 02-Apr-1997  scottr branches: 1.22.4;
Fix printf() and other warnings when compiled with DEBUG defined.
 1.21 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.20 22-Mar-1997  mycroft Fix editing error in new config changes.
 1.19 30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.18 14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.17 13-Oct-1996  christos backout previous kprintf changes
 1.16 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.15 10-Jun-1996  thorpej Add the "Python 28849" to the list of `supported' tape drives as a PYTHON
type.
 1.14 14-Feb-1996  thorpej branches: 1.14.4;
All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.13 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.12 16-Oct-1995  thorpej Deal with vendor, product, and revision strings properly.
 1.11 04-Aug-1995  thorpej branches: 1.11.2;
Acknowledge the Archive Viper 60 tape. Fixes pr-863.
 1.10 04-Aug-1995  thorpej Update for conf.h changes.
 1.9 26-Oct-1994  cgd new RCS ID format.
 1.8 23-May-1994  mycroft Merge with 4.4-Lite.
 1.7 11-May-1994  mycroft Get rid of private *read() and *write() functions.
 1.6 10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.5 06-Feb-1994  mycroft Use b_actb, not b_actl.
 1.4 11-Jan-1994  mycroft *strategy functions return void.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.11.2.1 16-Oct-1995  thorpej Update from trunk; deal with ID strings correctly.
 1.14.4.1 10-Jun-1996  thorpej Update from trunk:

Add the "Python 28849" to the list of `supported' tape drives as a PYTHON
type.
 1.22.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.25.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.28.12.6 11-Nov-2002  nathanw Catch up to -current
 1.28.12.5 18-Oct-2002  nathanw Catch up to -current.
 1.28.12.4 17-Sep-2002  nathanw Catch up to -current.
 1.28.12.3 01-Aug-2002  nathanw Catch up to -current.
 1.28.12.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.28.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.28.8.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.28.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.28.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.28.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.31.4.2 30-Aug-2002  gehenna catch up with -current.
 1.31.4.1 17-May-2002  gehenna Add device switch.
 1.39.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4 28-May-2025  tsutsui branches: 1.4.4;
Use explicit STI_CODEBASE_M68K macro defined in MI stireg.h.

No binary change.
 1.3 26-May-2025  tsutsui Also use sti(4) ROM functions for 362/382 framebuffers on bootloader.

Mostly taken on OpenBSD/hp300.
Tested on 382 with VGA-res EVRX, and no visible regression on
425e (sti EVRX), 425t (sti CRX), and 380 (topcat).
 1.2 23-May-2025  tsutsui Remove a redundant cast.
 1.1 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.4.4.2 02-Aug-2025  perseant Sync with HEAD
 1.4.4.1 28-May-2025  perseant file sti_dio.c was added on branch perseant-exfatfs on 2025-08-02 05:55:38 +0000
 1.2 26-May-2025  tsutsui branches: 1.2.4;
Also use sti(4) ROM functions for 362/382 framebuffers on bootloader.

Mostly taken on OpenBSD/hp300.
Tested on 382 with VGA-res EVRX, and no visible regression on
425e (sti EVRX), 425t (sti CRX), and 380 (topcat).
 1.1 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.2.4.2 02-Aug-2025  perseant Sync with HEAD
 1.2.4.1 26-May-2025  perseant file sti_diovar.h was added on branch perseant-exfatfs on 2025-08-02 05:55:38 +0000
 1.7 31-May-2025  tsutsui branches: 1.7.4;
Merge common code block.
 1.6 28-May-2025  tsutsui Use explicit STI_CODEBASE_M68K macro defined in MI stireg.h.

No binary change.
 1.5 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.4 25-May-2025  tsutsui Add mmap(2) support to sti(4) for 362 and 382 framebuffers.

It turns out that on-board framebuffers on both 425e and 382/362 are
treated as the same "EVRX" variant on HP-UX even though they have
different RAMDAC chips (Bt458 on 425e and Bt474 on 362/382).

Now X.org server and other framebuffer applications like mlterm-wscons
work on these machines.
 1.3 19-May-2025  tsutsui Remove an unnecessary #include.
 1.2 17-May-2025  tsutsui Fix RCSId.
 1.1 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.7.4.2 02-Aug-2025  perseant Sync with HEAD
 1.7.4.1 31-May-2025  perseant file sti_machdep.c was added on branch perseant-exfatfs on 2025-08-02 05:55:38 +0000
 1.1 01-May-2025  tsutsui branches: 1.1.4;
Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 01-May-2025  perseant file sti_machdep.h was added on branch perseant-exfatfs on 2025-08-02 05:55:38 +0000
 1.10 28-May-2025  tsutsui Use explicit STI_CODEBASE_M68K macro defined in MI stireg.h.

No binary change.
 1.9 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.8 15-Jan-2023  tsutsui branches: 1.8.6;
TAB/space cleanup.
 1.7 03-Jul-2022  andvar branches: 1.7.4;
fix various typos in comments, mainly s/pallete/palette/.
 1.6 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.5 24-Apr-2021  thorpej branches: 1.5.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.4 23-Dec-2020  tsutsui branches: 1.4.2;
Add bitmap access ops support for SGC CRX (A1659-66001) framebuffer.

Also modify existing 425e EVRX attachment to use updated MI sti(4) ops
more efficiently.

The Xorg server and mlterm-wscons (that support wsdisplay bitmap) work
fine on SGC hp425t.

No particular comments on port-hp300@ and port-hppa@:
https://mail-index.netbsd.org/port-hp300/2020/12/19/msg000184.html
https://mail-index.netbsd.org/port-hp300/2020/12/20/msg000185.html

Special thanks to Miod Vallat again, for contributing the SGC CRX
framebuffer with the SGC connector and flexible cable for HP9000/425t.

He also contributed DIO-II "Hyperion" monochrome framebuffer and
1 plane grayscale SGC GRX (A1924-66001), and I've confirmed hyper(4)
just works even with Xorg server. I will try GRX as the next project.
 1.3 04-May-2020  tsutsui branches: 1.3.2;
Add bitmap access ops support for EVRX framebuffer on HP9000/425e.

8bpp Xorg wsfb server and mlterm-wscons (formerly mlterm-fb) work.
No particular comment on port-hp300@ and port-hppa@:
https://mail-index.netbsd.org/port-hp300/2020/05/02/msg000170.html

Special thanks to Miod Vallat, for his advice about HP-UX implementation
and binutils patches to disassemble old HP-UX a.out-hp300hpux binaries
(and also contributing his 425e back in 2014).
 1.2 20-Apr-2014  tsutsui branches: 1.2.2; 1.2.34;
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.

The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.

Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.

Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).

XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
 1.1 11-Jan-2013  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.14;
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
 1.1.14.1 10-Aug-2014  tls Rebase.
 1.1.6.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.2 25-Feb-2013  tls resync with head
 1.1.6.1 11-Jan-2013  tls file sti_sgc.c was added on branch tls-maxphys on 2013-02-25 00:28:41 +0000
 1.1.4.1 18-May-2014  rmind sync with head
 1.1.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.2.2 23-Jan-2013  yamt sync with head
 1.1.2.1 11-Jan-2013  yamt file sti_sgc.c was added on branch yamt-pagecache on 2013-01-23 00:05:47 +0000
 1.2.34.2 28-Dec-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #1162):

sys/dev/ic/stivar.h: revision 1.11
sys/dev/ic/sti.c: revision 1.23
sys/dev/ic/sti.c: revision 1.24
sys/dev/ic/sti.c: revision 1.25
sys/arch/hp300/dev/sti_sgc.c: revision 1.4

Pull the latest OpenBSD sti(4) changes for bitmap framebuffer support.
- bitmap and colormap ops based on old HP ngle X11 driver:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/ic/sti.c#rev1.76
> Work-in-progress support for non-accelerated X11 on *some* sti(4)
> frame buffers; based upon the old HP ngle X11 driver.
> Currently limited to CRX (720/735/750), Timber (710, old 715),
> Artist (712, 715) and EG (B-series), however the
> colormap isn't set up correctly on Timber and EG yet.
>
> Joint work with Artem Falcon, now in good enough shape to be worked further
> in the tree.
- misc other cosmetic changes to reduce diffs
No particular comments on port-hp300@ and port-hppa@:
https://mail-index.netbsd.org/port-hp300/2020/12/19/msg000184.html
https://mail-index.netbsd.org/port-hp300/2020/12/20/msg000185.html

The MD hp300 attachment for SGC CRX (A1659-66001) will be committed
separately.

Add bitmap access ops support for SGC CRX (A1659-66001) framebuffer.
Also modify existing 425e EVRX attachment to use updated MI sti(4) ops
more efficiently.

The Xorg server and mlterm-wscons (that support wsdisplay bitmap) work
fine on SGC hp425t.

No particular comments on port-hp300@ and port-hppa@:
https://mail-index.netbsd.org/port-hp300/2020/12/19/msg000184.html
https://mail-index.netbsd.org/port-hp300/2020/12/20/msg000185.html

Special thanks to Miod Vallat again, for contributing the SGC CRX
framebuffer with the SGC connector and flexible cable for HP9000/425t.

He also contributed DIO-II "Hyperion" monochrome framebuffer and
1 plane grayscale SGC GRX (A1924-66001), and I've confirmed hyper(4)
just works even with Xorg server. I will try GRX as the next project.

Handle WSSCREEN_REVERSE properly. Based on OpenBSD's sti(4).

Also remove WSSCREEN_UNDERLINE from capabilities that is not handled
by sti(4) ROM routines.

Tested on HP9000/425t with CRX.

Ignore WSDISPLAYIO_PUTCMAP in WSDISPLAYIO_MODE_EMUL, i.e. text mode.

The hardware palette settings are handled by the STI ROM in STI_TEXTMODE
and changing cmap could cause mangled text colors at least on CRX on 425t.

Updating CMAP in EMUL mode isn't expected anyway.

Fixes "red or invisible text" after exiting mlterm-wscons on A1659 CRX.
 1.2.34.1 18-May-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #908):

sys/dev/ic/stivar.h: revision 1.10
sys/dev/ic/sti.c: revision 1.21
sys/arch/hp300/dev/sti_sgc.c: revision 1.3

Add bitmap access ops support for EVRX framebuffer on HP9000/425e.

8bpp Xorg wsfb server and mlterm-wscons (formerly mlterm-fb) work.
No particular comment on port-hp300@ and port-hppa@:
https://mail-index.netbsd.org/port-hp300/2020/05/02/msg000170.html

Special thanks to Miod Vallat, for his advice about HP-UX implementation
and binutils patches to disassemble old HP-UX a.out-hp300hpux binaries
(and also contributing his 425e back in 2014).
 1.2.2.2 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.2.2.1 20-Apr-2014  bouyer file sti_sgc.c was added on branch netbsd-6 on 2014-05-21 20:56:36 +0000
 1.3.2.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.4.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.5.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.7.4.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.8.6.1 02-Aug-2025  perseant Sync with HEAD
 1.2 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.1 20-Apr-2014  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.12; 1.1.74;
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.

The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.

Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.

Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).

XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
 1.1.74.1 02-Aug-2025  perseant Sync with HEAD
 1.1.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.12.1 20-Apr-2014  tls file sti_sgcvar.h was added on branch tls-maxphys on 2014-08-20 00:03:00 +0000
 1.1.8.2 10-Aug-2014  tls Rebase.
 1.1.8.1 20-Apr-2014  tls file sti_sgcvar.h was added on branch tls-earlyentropy on 2014-08-10 06:53:57 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 20-Apr-2014  yamt file sti_sgcvar.h was added on branch yamt-pagecache on 2014-05-22 11:39:46 +0000
 1.1.4.2 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.1.4.1 20-Apr-2014  bouyer file sti_sgcvar.h was added on branch netbsd-6 on 2014-05-21 20:56:36 +0000
 1.1.2.2 18-May-2014  rmind sync with head
 1.1.2.1 20-Apr-2014  rmind file sti_sgcvar.h was added on branch rmind-smpnet on 2014-05-18 17:45:07 +0000
 1.9 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.8 26-Jul-2002  hannken branches: 1.8.6;
Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.7 21-Jan-2000  thorpej branches: 1.7.6; 1.7.8; 1.7.12; 1.7.20;
Update for sys/buf.h/disksort_*() changes.
 1.6 02-Apr-1997  scottr branches: 1.6.22;
Fix printf() and other warnings when compiled with DEBUG defined.
 1.5 31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.20.1 30-Aug-2002  gehenna catch up with -current.
 1.7.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.7.8.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.7.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.15 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.14 26-Feb-2025  andvar Fix typos in comments, mainly s/calcurate/calculate/.
 1.13 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.12 04-May-2024  tsutsui branches: 1.12.2;
Add comments about quirks of 98542/98543 framebuffers with 1024x400 pixels.
 1.11 01-May-2024  tsutsui Fix topcat(4) problems on some models that cause garbages on screen.

- Make sure that windowmove (hardware BITBLT) ops complete by checking
tc_busywait() before calling putchar functions by MI rasops(9).
It looks CPU accesses against VRAM during windowmove (copy, erase,
and cursor) ops causes unexpected garbages at least on 98543 on HP360,
98547 on HP370, and also on 98543 on 040 HP380 (but not on 98549).

- Handle 'sparse VRAM' on 98543 (and probably 98542) properly:
- Prepare and use own topcat_putchar1_4() function for sparse VRAM.
- Pass proper 'VRAM width' rather than actuall font width to all
windowmove (copycols, erasecols, copyrows, eraserows, and do_cursor)
operation functions.

Now all topcat(4) consoles on 98543 on HP360/HP380 and 98547 on HP370
work fine, and no visible regression on 98549 on HP380 and 98544 on HP360.

Worth to pullup netbsd-10.
 1.10 01-May-2024  tsutsui Add DELAY(9) to make palette register settings stable on 98543 in HP360.

Note 98547 (6 bpp variant) on HP370 (68030 33MHz) doesn't need these
DELAYs so maybe only some old variants (98543 and 98545?) on 020/030
have such restriction (actually only one nop seems enough.)
 1.9 29-Apr-2024  tsutsui Check tc_waitbusy() before writing palette registers in topcat_setcolor().

This seems to make palette operations more stable on my HP360 with HP98543.
 1.8 29-Apr-2024  tsutsui Use proper planemask per a vaild number of planes.
 1.7 29-Apr-2024  tsutsui Move a check of topcat(4) specific fb width quirks to topcat.c.

We need to check fb->planes but it's propbed in topcat.c after
common diofb_fbinquire() is called.

Also add a comment that it looks these 1 bpp and 4 bpp boards have
VRAM with sparse address layout and we have to handle
512 pixels per line with 1024 bytes per line.
 1.6 30-Nov-2022  tsutsui branches: 1.6.2;
Fix silent bus error panic on 98543A topcat framebuffer on HP320 and HP360.

It looks DELAY(100)s before checking cmap_busy in old pre-wscons grf_tc.c
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/hp300/dev/Attic/grf_tc.c?rev=1.42
are actually necessary on 68020 (HP320) and 68030 (HP360) machines,
while it works without them on 68040 (HP380).

Should be pulled up to netbsd-9.
 1.5 15-Apr-2021  tsutsui Fix two problems on old topcat(4) framebuffers found on HP332/340.

- Fix panic on monochrome framebuffers. They don't have palette registers.
The problem was reported from Anders Gustafsson and also Andrew Gillham
back in 2013:
https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000086.html
https://mail-index.netbsd.org/port-hp300/2013/09/28/msg000087.html
- Fix incorrect framebuffer width of 98542/98544 framebuffers on HP332.
Reported from Andrew Gillham (98542) as above and Chris Hanson (98543):
https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000083.html
https://mail-index.netbsd.org/port-hp300/2020/05/01/msg000164.html

Worth to pullup to netbsd-9.
 1.4 18-Feb-2011  tsutsui branches: 1.4.2; 1.4.6; 1.4.64; 1.4.74;
Use aprint_normal(9) and variants.
 1.3 18-Feb-2011  tsutsui Make local functions and variables static.
 1.2 12-Feb-2011  tsutsui - make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.4 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file topcat.c was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.4.74.1 17-Apr-2021  thorpej Sync with HEAD.
 1.4.64.2 06-Dec-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1551):

sys/arch/hp300/dev/topcat.c: revision 1.6

Fix silent bus error panic on 98543A topcat framebuffer on HP320 and HP360.

It looks DELAY(100)s before checking cmap_busy in old pre-wscons grf_tc.c
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/hp300/dev/Attic/grf_tc.c?rev=1.42
are actually necessary on 68020 (HP320) and 68030 (HP360) machines,
while it works without them on 68040 (HP380).

Should be pulled up to netbsd-9.
 1.4.64.1 21-Apr-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1248):

sys/arch/hp300/dev/topcat.c: revision 1.5
sys/arch/hp300/dev/diofb.c: revision 1.5

Fix two problems on old topcat(4) framebuffers found on HP332/340.

- Fix panic on monochrome framebuffers. They don't have palette registers.
The problem was reported from Anders Gustafsson and also Andrew Gillham
back in 2013:
https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000086.html
https://mail-index.netbsd.org/port-hp300/2013/09/28/msg000087.html

- Fix incorrect framebuffer width of 98542/98544 framebuffers on HP332.
Reported from Andrew Gillham (98542) as above and Chris Hanson (98543):
https://mail-index.netbsd.org/port-hp300/2013/09/27/msg000083.html
https://mail-index.netbsd.org/port-hp300/2020/05/01/msg000164.html

Worth to pullup to netbsd-9.
 1.4.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.4.6.1 18-Feb-2011  jruoho file topcat.c was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.4.2.2 05-Mar-2011  rmind sync with head
 1.4.2.1 18-Feb-2011  rmind file topcat.c was added on branch rmind-uvmplock on 2011-03-05 20:50:23 +0000
 1.6.2.1 16-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #690):

sys/arch/hp300/dev/topcat.c: revision 1.7
sys/arch/hp300/dev/topcat.c: revision 1.8
sys/arch/hp300/dev/topcat.c: revision 1.9
sys/arch/hp300/dev/diofb.c: revision 1.8
sys/arch/hp300/dev/diofb.c: revision 1.9
sys/arch/hp300/dev/diofb.c: revision 1.10
sys/arch/hp300/dev/topcat.c: revision 1.10
sys/arch/hp300/dev/topcat.c: revision 1.11
sys/arch/hp300/dev/topcat.c: revision 1.12
sys/arch/hp300/dev/topcatreg.h: revision 1.5
distrib/notes/hp300/hardware: revision 1.28
sys/arch/hp300/dev/diofbvar.h: revision 1.5
share/man/man4/man4.hp300/topcat.4: revision 1.8

Increase DELAY() for waitbusy macroes as pre-wscons and 4.4BSD did.

It looks necessary for sane palette ops at least on HP98543 topcat
on 68030 HP 9000/360.

Move a check of topcat(4) specific fb width quirks to topcat.c.

We need to check fb->planes but it's propbed in topcat.c after
common diofb_fbinquire() is called.

Also add a comment that it looks these 1 bpp and 4 bpp boards have
VRAM with sparse address layout and we have to handle
512 pixels per line with 1024 bytes per line.

Fix MD allocattr to return proper attributes what MI rasops(9) expects.
Use proper planemask per a vaild number of planes.

Check tc_waitbusy() before writing palette registers in topcat_setcolor().
This seems to make palette operations more stable on my HP360 with HP98543.

Add DELAY(9) to make palette register settings stable on 98543 in HP360.
Note 98547 (6 bpp variant) on HP370 (68030 33MHz) doesn't need these
DELAYs so maybe only some old variants (98543 and 98545?) on 020/030
have such restriction (actually only one nop seems enough.)

Fix topcat(4) problems on some models that cause garbages on screen.
- Make sure that windowmove (hardware BITBLT) ops complete by checking
tc_busywait() before calling putchar functions by MI rasops(9).
It looks CPU accesses against VRAM during windowmove (copy, erase,
and cursor) ops causes unexpected garbages at least on 98543 on HP360,
98547 on HP370, and also on 98543 on 040 HP380 (but not on 98549).
- Handle 'sparse VRAM' on 98543 (and probably 98542) properly:
- Prepare and use own topcat_putchar1_4() function for sparse VRAM.
- Pass proper 'VRAM width' rather than actuall font width to all
windowmove (copycols, erasecols, copyrows, eraserows, and do_cursor)
operation functions.
Now all topcat(4) consoles on 98543 on HP360/HP380 and 98547 on HP370
work fine, and no visible regression on 98549 on HP380 and 98544 on HP360.

Note that 98542 and 98543 variants are also supported by topcat(4).

Add 98542 and 98543 framebuffers to supported "Graphics Devices" section.
I hope someone will sync a list of supported devices in port wiki pages
with one in this installation notes.

Add comments about quirks of 98542/98543 framebuffers with 1024x400 pixels.
 1.12.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 29-Apr-2024  tsutsui Increase DELAY() for waitbusy macroes as pre-wscons and 4.4BSD did.

It looks necessary for sane palette ops at least on HP98543 topcat
on 68030 HP 9000/360.
 1.4 02-Feb-2024  andvar s/Staus/Status/ in comments.
 1.3 15-Jan-2023  tsutsui TAB/space cleanup.
 1.2 12-Feb-2011  tsutsui branches: 1.2.2; 1.2.6; 1.2.90;
- make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file topcatreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.2.90.2 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.2.90.1 16-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #690):

sys/arch/hp300/dev/topcat.c: revision 1.7
sys/arch/hp300/dev/topcat.c: revision 1.8
sys/arch/hp300/dev/topcat.c: revision 1.9
sys/arch/hp300/dev/diofb.c: revision 1.8
sys/arch/hp300/dev/diofb.c: revision 1.9
sys/arch/hp300/dev/diofb.c: revision 1.10
sys/arch/hp300/dev/topcat.c: revision 1.10
sys/arch/hp300/dev/topcat.c: revision 1.11
sys/arch/hp300/dev/topcat.c: revision 1.12
sys/arch/hp300/dev/topcatreg.h: revision 1.5
distrib/notes/hp300/hardware: revision 1.28
sys/arch/hp300/dev/diofbvar.h: revision 1.5
share/man/man4/man4.hp300/topcat.4: revision 1.8

Increase DELAY() for waitbusy macroes as pre-wscons and 4.4BSD did.

It looks necessary for sane palette ops at least on HP98543 topcat
on 68030 HP 9000/360.

Move a check of topcat(4) specific fb width quirks to topcat.c.

We need to check fb->planes but it's propbed in topcat.c after
common diofb_fbinquire() is called.

Also add a comment that it looks these 1 bpp and 4 bpp boards have
VRAM with sparse address layout and we have to handle
512 pixels per line with 1024 bytes per line.

Fix MD allocattr to return proper attributes what MI rasops(9) expects.
Use proper planemask per a vaild number of planes.

Check tc_waitbusy() before writing palette registers in topcat_setcolor().
This seems to make palette operations more stable on my HP360 with HP98543.

Add DELAY(9) to make palette register settings stable on 98543 in HP360.
Note 98547 (6 bpp variant) on HP370 (68030 33MHz) doesn't need these
DELAYs so maybe only some old variants (98543 and 98545?) on 020/030
have such restriction (actually only one nop seems enough.)

Fix topcat(4) problems on some models that cause garbages on screen.
- Make sure that windowmove (hardware BITBLT) ops complete by checking
tc_busywait() before calling putchar functions by MI rasops(9).
It looks CPU accesses against VRAM during windowmove (copy, erase,
and cursor) ops causes unexpected garbages at least on 98543 on HP360,
98547 on HP370, and also on 98543 on 040 HP380 (but not on 98549).
- Handle 'sparse VRAM' on 98543 (and probably 98542) properly:
- Prepare and use own topcat_putchar1_4() function for sparse VRAM.
- Pass proper 'VRAM width' rather than actuall font width to all
windowmove (copycols, erasecols, copyrows, eraserows, and do_cursor)
operation functions.
Now all topcat(4) consoles on 98543 on HP360/HP380 and 98547 on HP370
work fine, and no visible regression on 98549 on HP380 and 98544 on HP360.

Note that 98542 and 98543 variants are also supported by topcat(4).

Add 98542 and 98543 framebuffers to supported "Graphics Devices" section.
I hope someone will sync a list of supported devices in port wiki pages
with one in this installation notes.

Add comments about quirks of 98542/98543 framebuffers with 1024x400 pixels.
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 12-Feb-2011  jruoho file topcatreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:36 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 12-Feb-2011  rmind file topcatreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:23 +0000
 1.5 30-May-2025  tsutsui Fix inverted logic botch in tvrxcnattach().

This has been wrong since my initial hp300 wscons commit in 2011,
and probably never worked. (sigh)

(Un)fortunately, tvrxcnattach() also failed on 362 and 382 with
EVRX sti(4) because bus_space_map(9) failed with the default 4KB page
size. It turns out it succeeds with an 8KB page setting, then sti(4)
or gendiofb(4) won't be attached in that case.

Should be pulled up to netbsd-9 and netbsd-10.
 1.4 27-May-2025  tsutsui Use C99 designated initializers for wscons structures.
 1.3 18-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.64; 1.3.90; 1.3.96;
Use aprint_normal(9) and variants.
 1.2 12-Feb-2011  tsutsui - make local functions static
- some KNF
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.4 05-Mar-2011  bouyer Sync with HEAD
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file tvrx.c was added on branch bouyer-quota2 on 2011-02-08 16:19:21 +0000
 1.3.96.1 02-Aug-2025  perseant Sync with HEAD
 1.3.90.1 01-Jun-2025  martin Pull up following revision(s) (requested by tsutsui in ticket #1123):

sys/arch/hp300/dev/tvrx.c: revision 1.5

Fix inverted logic botch in tvrxcnattach().

This has been wrong since my initial hp300 wscons commit in 2011,
and probably never worked. (sigh)

(Un)fortunately, tvrxcnattach() also failed on 362 and 382 with
EVRX sti(4) because bus_space_map(9) failed with the default 4KB page
size. It turns out it succeeds with an 8KB page setting, then sti(4)
or gendiofb(4) won't be attached in that case.
 1.3.64.1 01-Jun-2025  martin Pull up following revision(s) (requested by tsutsui in ticket #1957):

sys/arch/hp300/dev/tvrx.c: revision 1.5

Fix inverted logic botch in tvrxcnattach().

This has been wrong since my initial hp300 wscons commit in 2011,
and probably never worked. (sigh)

(Un)fortunately, tvrxcnattach() also failed on 362 and 382 with
EVRX sti(4) because bus_space_map(9) failed with the default 4KB page
size. It turns out it succeeds with an 8KB page setting, then sti(4)
or gendiofb(4) won't be attached in that case.
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 18-Feb-2011  jruoho file tvrx.c was added on branch jruoho-x86intr on 2011-06-06 09:05:37 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 18-Feb-2011  rmind file tvrx.c was added on branch rmind-uvmplock on 2011-03-05 20:50:23 +0000
 1.7 24-Jul-1994  mycroft Clean up deleted files.
 1.6 11-May-1994  mycroft Get rid of private *read() and *write() functions.
 1.5 11-Jan-1994  mycroft *strategy functions return void.
 1.4 12-Nov-1993  cgd new specfs.h and fifo.h locations
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4 24-Jul-1994  mycroft Clean up deleted files.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.17 16-Mar-1997  thorpej Old lint helper, not used anymore, and really quite amazingly out of
date; this is 4.3 vintage. Just nuke it.
 1.16 06-Nov-1996  cgd Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed. Rename remrq() to
remrunqueue().
 1.15 13-Oct-1996  christos backout previous kprintf changes
 1.14 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.12 02-Feb-1996  mycroft Fix #includes.
 1.11 10-Sep-1995  thorpej Add a memcpy() entry as suggested by Gordon Ross. Use <machine/asm.h>
where appropriate.
 1.10 13-Aug-1995  mycroft Add splsoftnet().
 1.9 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.8 09-Mar-1995  mycroft copy*str() should use size_t.
 1.7 08-Feb-1995  mycroft Remove [fs]ui{byte,word}().
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 20-May-1994  mycroft Avoid name clash.
 1.4 13-May-1994  mycroft Keeping up with the Chrises...
 1.3 14-Aug-1993  mycroft Note new location of pte.h.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.117 27-May-2025  tsutsui Avoid a weird semicolon.
 1.116 01-May-2025  tsutsui Add sti(4) support for 9000/362 and 9000/382 on-board framebuffers.

Mostly pulled from OpenBSD/hp300.

This supersedes old and dumb gendiofb. Currently there is no mmap
or cmap (palette) support, but I'll investigate how Bt474 RAMDAC
should be handled.

Tested on 382 with 640x480 and 1024x768 variants, and 362 with 640x480.
No visible regression on 425e (EVRX) and 425t (CRX).
 1.115 20-Dec-2024  tsutsui Remove trailing whitespace.
 1.114 11-May-2024  tsutsui branches: 1.114.2;
Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK
kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.
 1.113 11-May-2024  tsutsui Fix a 20 years old botch by me in setbootdev() on switching to MI SCSI.

setbootdev() updates bootdev data shared between BOOTROM and
it notifies BOOTROM to choose a current root device as a boot device
on the next boot, but I didn't understand the intention and then
it has been broken on SCSI disks. Sigh.
(I wonder if no one has noticed this old feature for 20 years..)

Should be pulled up to netbsd-10 and netbsd-9.
 1.112 16-Jan-2024  thorpej Fix computation of the appropriate auto-vector interrupt level to use
for the DMA controller by tracking all of the DIO devices that have
"ISRPRI_BIO" interrupt handlers, and finding the highest auto-vector
level among them and informing the DMA controller.

Previously, in a post-flattening world, the DMA controller was always
told to interrupt at lev5, which is fine I guess although definitely not
ideal, but would not work on aaaancient HP320 Rev A DMA boards. To that
effect, print a warning if a Rev B DMA board ends up at ipl != 3 (we can't
differentiate between a Rev A and a Rev B board).
 1.111 15-Jan-2023  tsutsui TAB/space cleanup.
 1.110 07-Aug-2021  thorpej branches: 1.110.6;
Merge thorpej-cfargs2.
 1.109 24-Apr-2021  thorpej branches: 1.109.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.108 18-Nov-2020  thorpej branches: 1.108.2;
malloc(9) -> kmem(9)
 1.107 10-Nov-2019  chs branches: 1.107.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.106 29-Jun-2019  tsutsui branches: 1.106.2;
Handle sti(4) graphics at sgc on HP9000/425t properly. PR port-hp300/54255

Should be pulled up to netbsd-8.
 1.105 20-Apr-2014  tsutsui branches: 1.105.20; 1.105.28;
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.

The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.

Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.

Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).

XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
 1.104 24-Mar-2014  christos branches: 1.104.2;
- remove unused
- use cpu_{g,s}etmodel
 1.103 23-Mar-2014  dholland typos in comments
 1.102 11-Jan-2013  tsutsui branches: 1.102.2;
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
 1.101 13-Oct-2012  tsutsui struct device * -> device_t, struct cfdata * -> cfdata_t
use device_xname() (from chs@)
 1.100 29-Jul-2012  mlelstv branches: 1.100.2;
Do not call setroot() from MD code and from MI code, which has
unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.

No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information
as a side effect. Instead call MI rootconf() from MD code which makes
rootconf() now a wrapper to setroot().

Adjust several MD routines to set the global booted_device,booted_partition
variables instead of passing partial information to setroot().

Make cpu_rootconf(9) describe the calling order.
 1.99 27-Jan-2012  para branches: 1.99.2;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.98 10-May-2011  tsutsui branches: 1.98.4; 1.98.8;
Move intr_init() call from early hp300_init() to cpu_configure(9)
since interrupt functions would want evcnt(9).
 1.97 12-Feb-2011  tsutsui Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.96 09-Feb-2011  tsutsui NHIL is no more.
 1.95 09-Feb-2011  tsutsui Remove leftover debug stuff.
 1.94 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.93 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.92 19-Dec-2008  pgoyette branches: 1.92.6; 1.92.8; 1.92.10;
Store config(1)'s root filesystem type as a text string rather than
embedding the address of its xxx_mountroot() in swapnetbsd.c. This
permits booting of kernels with hard-wired filesystem type even if the
filesystem is in a loadable module (ie, not linked into the kernel
image).

Discussed on current-users. Tested on amd64 and i386 with both hard-
wired and '?' filesystem times, and on both modular and monolithic
kernels.

Thanks to pooka@ for code review and suggestions.

Addresses my PR kern/40167
 1.91 22-Jun-2008  tsutsui branches: 1.91.4;
Don't recompute an ipl level for IPL_VM during or after cpu_configure(9)
and use a static and possible highest ipl value (ipl 5) for IPL_VM
so that we can put ipl2psl_table[] conversion into makeiplcookie(9),
which could be called before cpu_configure(9).

Fixes "panic: sbappendaddr" on NFS load.
 1.90 28-Apr-2008  martin branches: 1.90.2; 1.90.4;
Remove clause 3 and 4 from TNF licenses
 1.89 29-Mar-2008  tsutsui branches: 1.89.2; 1.89.4;
Split device_t/softc, and misc cosmetic changes.
 1.88 05-Dec-2007  tsutsui branches: 1.88.12;
Use queue(3) macro.
 1.87 03-Dec-2007  ad branches: 1.87.2;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.86 17-Oct-2007  garbled branches: 1.86.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.85 30-Sep-2007  tsutsui - make this compile with #ifdef DEBUG
- use proper casts
 1.84 04-Mar-2007  tsutsui branches: 1.84.2; 1.84.10; 1.84.18; 1.84.20; 1.84.22;
- add missed '*'
- move extiobase decl into <machine/cpu.h>
 1.83 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.82 24-Jan-2007  hubertf branches: 1.82.2;
Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
 1.81 21-Jul-2006  tsutsui branches: 1.81.4;
Some KNF.
 1.80 19-Jul-2006  tsutsui Define base address offsets of intio devices in intioreg.h
and replace various magic numbers with the macro.
 1.79 21-Mar-2006  tsutsui Fix inverted logic on device_is_a() conversion.
 1.78 19-Mar-2006  tsutsui Replace MALLOC(9) with malloc(9) in non critical path.
 1.77 26-Feb-2006  thorpej branches: 1.77.2; 1.77.4; 1.77.6;
Use device_is_a()
 1.76 23-Feb-2006  thorpej Use device_parent().
 1.75 21-Feb-2006  thorpej Use device_class() instead of accessing dv_class directly.
 1.74 11-Dec-2005  christos branches: 1.74.2; 1.74.4; 1.74.6;
merge ktrace-lwp.
 1.73 26-Aug-2005  drochner s/locdesc_t/int/g
 1.72 04-Jul-2005  drochner branches: 1.72.2;
some autoconf cleanup fallout, leftover of last week, mostly from
Havard Eidnes
 1.71 02-Jun-2005  tsutsui 2nd arg of config_foundroot() is aux, so it should not be strings.
 1.70 23-Oct-2004  thorpej Centralize the declaration of booted_device and booted_partition.
 1.69 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.68 17-Nov-2003  tsutsui TAB/space cleanup.
 1.67 08-Nov-2003  tsutsui Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.66 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.65 01-Aug-2003  tsutsui Switch hp300 to MI SCSI with MI mb89352 SPC SCSI driver (at last),
and remove old hp300 MD oscsi support derived from 4.4BSD-Lite2.
 1.64 01-Aug-2003  tsutsui Modify hp300 bus_space(9) structures/functions to add hooks to override
access functions. This is required by some DIO devices to use MI drivers.
 1.63 27-Jul-2003  tsutsui Remove declaration of hilkbdcnattach() which is declared in dev/hilvar.h.
 1.62 01-Apr-2003  thorpej branches: 1.62.2;
Use PAGE_SIZE rather than NBPG.
 1.61 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.60 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.59 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.58 25-Sep-2002  thorpej Replace resource map usage with extent maps.
 1.57 17-Apr-2002  gmcgarry Attach apci console as an intio device, not a dio device.
Fixes console attach on 425e noted by Thilo Manske.
 1.56 15-Mar-2002  gmcgarry malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.55 04-Mar-2002  simonb Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().
 1.54 23-Feb-2002  gmcgarry Recognise md as a valid root device. And since md disks don't get
device_register()'d, don't go looking on our device list for them.
Ramdisk kernel now boot.
 1.53 14-Dec-2001  gmcgarry Update the console attach interface now that bus_space is available.
Basically means that hardware drivers with console attachments are
now largely machine independent.
 1.52 08-Dec-2001  gmcgarry softintr(9) interface for hp300
 1.51 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.50 17-Nov-2001  gmcgarry Convert hil to standard device attachment.
 1.49 17-Sep-1999  thorpej branches: 1.49.16; 1.49.20;
Centralize the declaration and clearing of `cold'.
 1.48 15-Sep-1999  thorpej Rename the machine-dependent autoconfiguration entry point `cpu_configure()',
and rename config_init() to configure() and call cpu_configure() from there.
 1.47 23-Aug-1999  thorpej Garbage-collect reference to <sys/dmap.h>.
 1.46 07-Jun-1999  thorpej Don't pass a nam2blk around at all; just have setroot() and friends reference
dev_name2blk[] directly. Addresses PR #7622 (ITOH Yasufumi), although
in a different way.
 1.45 10-Apr-1999  kleink It's amazing how many typos I can invent in a new multi-line comment.
 1.44 02-Aug-1998  kleink branches: 1.44.8;
Oops, make a sentence added in previous commit parseable.
 1.43 20-Jul-1998  kleink In configure(), initialize the HIL driver's software state before enabling
interrupts; if there's an interrupt pending (i.e. because the user pressed
a key or moved his mice while the kernel was being loaded), the interrupt
handler may safely be run. Fixes PR port-hp300/5397.
 1.42 17-Jun-1998  kleink In device_register(), explicitly initialize a static local variable
(seen_netdevice) with 0.
 1.41 12-Jan-1998  thorpej Update for changes to config.
 1.40 04-Oct-1997  thorpej branches: 1.40.2;
Copyright assigned to The NetBSD Foundation.
 1.39 21-Sep-1997  thorpej Add support for the memory disk device.
 1.38 05-May-1997  thorpej branches: 1.38.4;
Don't initialize the DMA controller here.
 1.37 27-Apr-1997  thorpej #include <machine/hp300spu.h>
 1.36 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.35 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.34 26-Mar-1997  gwr Move findroot/setroot stuff from configure() to cpu_rootconf().
 1.33 05-Feb-1997  thorpej branches: 1.33.2;
Fix edit-o that caused panic's when root was on HP-IB disk.
 1.32 31-Jan-1997  thorpej Fix typo introduced in new setroot code. (There's only just a little
irony in that, eh?)

From Klaus Klein <kleink@layla.inka.de>, PR #3173.
 1.31 31-Jan-1997  thorpej Use the new machine-independent setroot().
 1.30 30-Jan-1997  thorpej Garbage-collect old-style autoconfiguration code. Adopt boot device
detection code to new-style autoconfiguration.
 1.29 17-Dec-1996  thorpej branches: 1.29.2;
Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.28 09-Dec-1996  thorpej Print the interrupt levels for bio, net, and tty computed during
autoconfiguration.
 1.27 07-Dec-1996  thorpej In setroot(), fix mishandling of the `config netbsd root on nfs' case
that caused a NULL pointer dereference.
 1.26 20-Oct-1996  thorpej Arrange this file into sections (configure(), root device goo, console goo,
old-config goo). Place old-config goo at the end so that it's easy to
#ifdef our or delete (muahahah!).

Garbage collect a couple of unused functions.
 1.25 14-Oct-1996  thorpej New root device detect/set code, lifted mostly from NetBSD/alpha.
The "options GENERIC" entry in kernel config files is not longer necessary
for "swap generic" kernels. Uses new config constructs which work with
some glue in an old config environment. This code will support new config
with minimal changes.
 1.24 13-Oct-1996  christos backout previous kprintf changes
 1.23 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.22 05-Oct-1996  thorpej Don't lower spl before calling main. For now, do it right before
calling hilinit(). Eventually, would like to enable them only after
autoconfiguration is finished.
 1.21 18-Aug-1996  hpeyerl Get rid of dkn stuff. It's deprecated.
 1.20 18-May-1996  thorpej XXX set up alldevs and allevents so that vmstat -i will work.
 1.19 17-May-1996  thorpej Remove cpuspeed from here.
 1.18 07-Apr-1996  thorpej Add a stub config_init() function, so kernel will link. Temporary, until
we use new config.
 1.17 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.16 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.15 14-Feb-1996  thorpej New interrupt handling code. Highlights:
- Interrupt service routines now take a pointer to
the device's softc, rather than a unit number.
- Interrupt handling code in locore.s condensed. Only
remaining "special" handlers are lev0 (spurious),
lev1 (HIL; don't ask), lev6 (clock), and lev7 (NMI).
Only remaining hard-coded device driver reference in
locore is HIL. (clock doesn't count...)
- "dcafastservice" eliminated. DCA driver has new mechanism
to guarantee prompt interrupt service at any ipl (not
just level 5).
- Interrupt code pulled out of autoconf.c and machdep.c and
placed in new file, isr.c
 1.14 30-Dec-1995  thorpej Print unconfigured card id and select code regardless of -DDEBUG.
 1.13 28-Dec-1995  thorpej Move the old-style disk instrumentation "structures" to a central location
(sys/kern/subr_disk.c) and note that they should/will be deperecated.
 1.12 02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting drivers prepared for new config.
 1.11 02-Sep-1995  thorpej Fix thinko in netboot-related changes.
 1.10 02-Sep-1995  thorpej Grok booting from the network.
 1.9 26-Oct-1994  cgd new RCS ID format.
 1.8 25-May-1994  mycroft Merge with 4.4-Lite.
 1.7 23-May-1994  mycroft Merge with 4.4-Lite.
 1.6 14-Aug-1993  mycroft Note new location of pte.h.
 1.5 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.4 07-Jul-1993  cgd get rid of extra strcmp definition
 1.3 04-Jul-1993  cgd strcmp's args are supposed to be "const"...
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.29.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.33.2.1 02-Mar-1997  mrg swapconf() is no more.
 1.38.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.38.4.1 29-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.40.2.1 21-Jul-1998  mellon Pull up 1.43 (kleink)
 1.44.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.49.20.5 18-Oct-2002  nathanw Catch up to -current.
 1.49.20.4 20-Jun-2002  nathanw Catch up to -current.
 1.49.20.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.49.20.2 28-Feb-2002  nathanw Catch up to -current.
 1.49.20.1 08-Jan-2002  nathanw Catch up to -current.
 1.49.16.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.49.16.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.49.16.2 16-Mar-2002  jdolecek Catch up with -current.
 1.49.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.62.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.62.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.62.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.62.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.62.2.2 03-Sep-2004  skrll Sync with HEAD
 1.62.2.1 03-Aug-2004  skrll Sync with HEAD
 1.72.2.6 07-Dec-2007  yamt sync with head
 1.72.2.5 27-Oct-2007  yamt sync with head.
 1.72.2.4 03-Sep-2007  yamt sync with head.
 1.72.2.3 26-Feb-2007  yamt sync with head.
 1.72.2.2 30-Dec-2006  yamt sync with head.
 1.72.2.1 21-Jun-2006  yamt sync with head.
 1.74.6.1 22-Apr-2006  simonb Sync with head.
 1.74.4.1 09-Sep-2006  rpaulo sync with head
 1.74.2.1 01-Mar-2006  yamt sync with head.
 1.77.6.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.77.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.77.2.2 11-Aug-2006  yamt sync with head
 1.77.2.1 01-Apr-2006  yamt sync with head.
 1.81.4.1 01-Feb-2007  ad Sync with head.
 1.82.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.84.22.1 06-Oct-2007  yamt sync with head.
 1.84.20.2 09-Jan-2008  matt sync with HEAD
 1.84.20.1 06-Nov-2007  matt sync with HEAD
 1.84.18.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.84.18.1 02-Oct-2007  joerg Sync with HEAD.
 1.84.10.1 03-Oct-2007  garbled Sync with HEAD
 1.84.2.2 03-Dec-2007  ad Sync with HEAD.
 1.84.2.1 09-Oct-2007  ad Sync with head.
 1.86.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.87.2.1 08-Dec-2007  ad Sync with head.
 1.88.12.4 17-Jan-2009  mjf Sync with HEAD.
 1.88.12.3 29-Jun-2008  mjf Sync with HEAD.
 1.88.12.2 02-Jun-2008  mjf Sync with HEAD.
 1.88.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.89.4.2 04-May-2009  yamt sync with head.
 1.89.4.1 16-May-2008  yamt sync with head.
 1.89.2.1 18-May-2008  yamt sync with head.
 1.90.4.1 27-Jun-2008  simonb Sync with head.
 1.90.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.91.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.92.10.2 17-Feb-2011  bouyer Sync with HEAD
 1.92.10.1 08-Feb-2011  bouyer Sync with HEAD
 1.92.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.92.6.2 31-May-2011  rmind sync with head
 1.92.6.1 05-Mar-2011  rmind sync with head
 1.98.8.1 18-Feb-2012  mrg merge to -current.
 1.98.4.4 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.98.4.3 23-Jan-2013  yamt sync with head
 1.98.4.2 30-Oct-2012  yamt sync with head
 1.98.4.1 17-Apr-2012  yamt sync with head
 1.99.2.2 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.99.2.1 08-Aug-2012  martin Pull up following revision(s) (requested by mlelstv in ticket #466):
sys/arch/amiga/amiga/autoconf.c: revision 1.113
sys/arch/rs6000/rs6000/autoconf.c: revision 1.4
sys/arch/emips/emips/autoconf.c: revision 1.6
sys/arch/sandpoint/sandpoint/autoconf.c: revision 1.27
sys/arch/evbmips/alchemy/autoconf.c: revision 1.18
sys/arch/sgimips/sgimips/autoconf.c: revision 1.43
sys/arch/atari/atari/autoconf.c: revision 1.63
sys/arch/powerpc/oea/ofw_autoconf.c: revision 1.17
sys/arch/mmeye/mmeye/autoconf.c: revision 1.9
distrib/sets/lists/comp/mi: revision 1.1771
sys/arch/mipsco/mipsco/autoconf.c: revision 1.25
sys/arch/iyonix/iyonix/autoconf.c: revision 1.14
sys/arch/hp300/hp300/autoconf.c: revision 1.100
sys/kern/init_main.c: revision 1.445
sys/arch/pmax/pmax/autoconf.c: revision 1.79
sys/arch/netwinder/netwinder/autoconf.c: revision 1.11
sys/arch/dreamcast/dreamcast/autoconf.c: revision 1.10
sys/arch/ibmnws/ibmnws/autoconf.c: revision 1.12
sys/arch/evbppc/ev64260/autoconf.c: revision 1.17
sys/arch/evbmips/gdium/autoconf.c: revision 1.5
sys/arch/algor/algor/autoconf.c: revision 1.21
share/man/man9/Makefile: revision 1.367
sys/arch/ews4800mips/ews4800mips/autoconf.c: revision 1.9
sys/arch/amigappc/amigappc/autoconf.c: revision 1.5
sys/arch/x86/x86/x86_autoconf.c: revision 1.65
sys/arch/acorn26/acorn26/autoconf.c: revision 1.9
sys/arch/mvmeppc/mvmeppc/autoconf.c: revision 1.13
sys/arch/vax/vax/autoconf.c: revision 1.94
sys/arch/usermode/dev/cpu.c: revision 1.72
sys/arch/evbppc/virtex/autoconf.c: revision 1.5
sys/arch/next68k/next68k/autoconf.c: revision 1.26
sys/arch/mac68k/mac68k/autoconf.c: revision 1.73
sys/arch/ia64/ia64/autoconf.c: revision 1.6
sys/arch/evbppc/obs405/obs405_autoconf.c: revision 1.6
share/man/man9/cpu_rootconf.9: revision 1.7
sys/arch/landisk/landisk/autoconf.c: revision 1.6
sys/arch/evbmips/malta/autoconf.c: revision 1.16
sys/arch/sun3/sun3/autoconf.c: revision 1.76
sys/arch/evbppc/explora/autoconf.c: revision 1.13
sys/arch/sun3/sun3/autoconf.c: revision 1.77
sys/arch/evbmips/loongson/autoconf.c: revision 1.3
sys/arch/evbmips/atheros/autoconf.c: revision 1.11
sys/arch/sparc64/sparc64/autoconf.c: revision 1.188
sys/arch/acorn32/acorn32/autoconf.c: revision 1.18
sys/arch/evbarm/evbarm/autoconf.c: revision 1.13
sys/arch/cobalt/cobalt/autoconf.c: revision 1.30
sys/arch/mvme68k/mvme68k/autoconf.c: revision 1.46
sys/arch/hp700/hp700/autoconf.c: revision 1.48
sys/arch/evbmips/adm5120/autoconf.c: revision 1.5
sys/arch/hpcmips/hpcmips/autoconf.c: revision 1.25
sys/arch/alpha/alpha/autoconf.c: revision 1.52
sys/arch/sparc/sparc/autoconf.c: revision 1.244
sys/arch/evbppc/pmppc/autoconf.c: revision 1.7
sys/arch/bebox/bebox/autoconf.c: revision 1.25
sys/arch/luna68k/luna68k/autoconf.c: revision 1.13
sys/arch/hpcarm/hpcarm/autoconf.c: revision 1.20
sys/arch/evbppc/walnut/autoconf.c: revision 1.21
sys/arch/cesfic/cesfic/autoconf.c: revision 1.26
sys/arch/cats/cats/autoconf.c: revision 1.17
sys/arch/x68k/x68k/autoconf.c: revision 1.67
sys/arch/news68k/news68k/autoconf.c: revision 1.21
sys/arch/arc/arc/autoconf.c: revision 1.34
sys/arch/evbsh3/evbsh3/autoconf.c: revision 1.11
sys/sys/conf.h: revision 1.143
sys/arch/evbmips/rasoc/autoconf.c: revision 1.3
sys/arch/hpcsh/hpcsh/autoconf.c: revision 1.26
sys/arch/sun68k/sun68k/autoconf.c: revision 1.29
sys/arch/evbmips/rmixl/autoconf.c: revision 1.6
sys/arch/zaurus/zaurus/autoconf.c: revision 1.12
sys/arch/xen/x86/autoconf.c: revision 1.15
sys/arch/evbppc/mpc85xx/autoconf.c: revision 1.6
sys/arch/shark/shark/autoconf.c: revision 1.18
sys/arch/prep/prep/autoconf.c: revision 1.25
sys/arch/newsmips/newsmips/autoconf.c: revision 1.36
sys/arch/sbmips/sbmips/autoconf.c: revision 1.8
Do not call setroot() from MD code and from MI code, which has
unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.
No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information
as a side effect. Instead call MI rootconf() from MD code which makes
rootconf() now a wrapper to setroot().
Adjust several MD routines to set the global booted_device,booted_partition
variables instead of passing partial information to setroot().
Make cpu_rootconf(9) describe the calling order.
add rootconf(9) as a link to cpu_rootconf(9)
make this compile again
 1.100.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.100.2.2 25-Feb-2013  tls resync with head
 1.100.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.102.2.1 18-May-2014  rmind sync with head
 1.104.2.1 10-Aug-2014  tls Rebase.
 1.105.28.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.105.20.1 08-Jul-2019  martin Pull up following revision(s) (requested by tsutsui in ticket #1284):

sys/arch/hp300/hp300/autoconf.c: revision 1.106

Handle sti(4) graphics at sgc on HP9000/425t properly. PR port-hp300/54255

Should be pulled up to netbsd-8.
 1.106.2.1 17-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1842):

sys/arch/hp300/hp300/autoconf.c: revision 1.113

Fix a 20 years old botch by me in setbootdev() on switching to MI SCSI.
setbootdev() updates bootdev data shared between BOOTROM and
it notifies BOOTROM to choose a current root device as a boot device
on the next boot, but I didn't understand the intention and then
it has been broken on SCSI disks. Sigh.

(I wonder if no one has noticed this old feature for 20 years..)
 1.107.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.108.2.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.108.2.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.108.2.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.108.2.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.108.2.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.108.2.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.109.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.110.6.2 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.110.6.1 17-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #693):

sys/arch/hp300/hp300/autoconf.c: revision 1.113

Fix a 20 years old botch by me in setbootdev() on switching to MI SCSI.
setbootdev() updates bootdev data shared between BOOTROM and
it notifies BOOTROM to choose a current root device as a boot device
on the next boot, but I didn't understand the intention and then
it has been broken on SCSI disks. Sigh.

(I wonder if no one has noticed this old feature for 20 years..)
 1.114.2.1 02-Aug-2025  perseant Sync with HEAD
 1.22 21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.21 24-Mar-2014  christos - remove unused
- use cpu_{g,s}etmodel
 1.20 12-Feb-2011  tsutsui branches: 1.20.4; 1.20.14; 1.20.18;
Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.
 1.19 12-Feb-2011  tsutsui Umm, fix typo.
 1.18 12-Feb-2011  tsutsui Use __func__ to print (correct) function names.
 1.17 28-Apr-2008  martin branches: 1.17.22; 1.17.28; 1.17.30;
Remove clause 3 and 4 from TNF licenses
 1.16 17-Oct-2007  garbled branches: 1.16.16; 1.16.18; 1.16.20;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.15 30-Sep-2007  tsutsui Remove local extiobase declarations, which is in <machine/cpu.h>.
 1.14 12-Mar-2007  tsutsui branches: 1.14.8; 1.14.16; 1.14.18; 1.14.20;
Use vaddr_t casts rather than pointer arithmetic (in #ifdef DIAGNOSTIC).
 1.13 04-Mar-2007  christos branches: 1.13.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.12 21-Jul-2006  tsutsui branches: 1.12.10;
Some KNF.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.8;
merge ktrace-lwp.
 1.10 28-Aug-2004  thorpej branches: 1.10.12;
Use ANSI function decls, static, and const.
 1.9 17-Nov-2003  tsutsui TAB/space cleanup.
 1.8 01-Aug-2003  tsutsui Modify hp300 bus_space(9) structures/functions to add hooks to override
access functions. This is required by some DIO devices to use MI drivers.
 1.7 19-Jul-2003  tsutsui Allow bus_space_map(9) to map DIO address which is not page aligned.
(required by MI com(4) driver support for 98644A DCA serial)
 1.6 27-Sep-2002  provos branches: 1.6.6;
remove trailing \n in panic(). approved perry.
 1.5 25-Sep-2002  thorpej Replace resource map usage with extent maps.
 1.4 15-Mar-2002  gmcgarry Add RCSIDs.
 1.3 17-Nov-2001  gmcgarry For INTIO space, use an offset for the mapping rather than the physical
address.
 1.2 29-Jun-2000  mrg branches: 1.2.4; 1.2.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.1 11-Jan-1998  thorpej branches: 1.1.14;
Initial implementation of bus_space functions for hp300. Some cleanup
of this will be possible once some pmap changes are made.
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.2 03-Sep-2004  skrll Sync with HEAD
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.12.3 27-Oct-2007  yamt sync with head.
 1.10.12.2 03-Sep-2007  yamt sync with head.
 1.10.12.1 30-Dec-2006  yamt sync with head.
 1.11.8.1 11-Aug-2006  yamt sync with head
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.10.2 24-Mar-2007  yamt sync with head.
 1.12.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.13.2.2 09-Oct-2007  ad Sync with head.
 1.13.2.1 13-Mar-2007  ad Sync with head.
 1.14.20.1 06-Oct-2007  yamt sync with head.
 1.14.18.1 06-Nov-2007  matt sync with HEAD
 1.14.16.1 02-Oct-2007  joerg Sync with HEAD.
 1.14.8.1 03-Oct-2007  garbled Sync with HEAD
 1.16.20.1 16-May-2008  yamt sync with head.
 1.16.18.1 18-May-2008  yamt sync with head.
 1.16.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.30.1 17-Feb-2011  bouyer Sync with HEAD
 1.17.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.22.1 05-Mar-2011  rmind sync with head
 1.20.18.1 18-May-2014  rmind sync with head
 1.20.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.41 29-May-2020  rin For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.40 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.39 07-Jan-2008  joerg branches: 1.39.32; 1.39.38; 1.39.40;
Garbage collect !__HAVE_TIMECOUNTER code.
 1.38 09-Sep-2006  tsutsui branches: 1.38.30; 1.38.36; 1.38.44;
Switch hp300 to timecounter with MC6840 interval timer, which is
used for hardclcok(9). Old code is still left for reference.

XXX: possibly problematic if hardclock(9) is blocked more than 1/HZ,
XXX: but old microtime(9) implementation also had the similar problem.
 1.37 04-Sep-2006  tsutsui branches: 1.37.2;
Switch hp300 to MI todr.
 1.36 08-Mar-2006  lukem Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.35 24-Dec-2005  perry branches: 1.35.4; 1.35.6; 1.35.8; 1.35.10;
bare asm -> __asm
 1.34 11-Dec-2005  christos merge ktrace-lwp.
 1.33 02-Jun-2005  tsutsui branches: 1.33.2;
Add workaround for volatile struct timeval time vs. todr_*() function
prototype mismatch. Based on sparc64 fixes.
 1.32 23-May-2005  tsutsui Make sure that microtime(9) returns time greater than the previous value
like other ports. This may close port-hp300/10571.
 1.31 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.30 17-Nov-2003  tsutsui TAB/space cleanup.
 1.29 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.28 19-Jul-2003  tsutsui Rename clockattach() to todr_attach().
 1.27 15-Mar-2002  gmcgarry branches: 1.27.12;
Add RCSIDs.
 1.26 08-Dec-2001  gmcgarry Remove placeholder for event counter; it's done elsewhere
 1.25 03-Dec-2001  gmcgarry Fix path to clockvar.h.
 1.24 17-Nov-2001  gmcgarry Use new RTC attachment.
 1.23 10-Nov-2001  tsutsui Add some definitions for battery backed clock register 5,
and fix one spelling nit.

Mostly from port-hp300/8824, which had already pointed out
y2k (and y2k+1) bugs before 2000, but they were not fixed
till the last month. (I noticed this PR today. Oops)
 1.22 11-Oct-2001  tsutsui branches: 1.22.2; 1.22.4;
Cleanup TOD clock functions:
- Adapt MI functions/structures in sys/dev/clock_subr.[ch]
- Fix year-2001 problem

XXX Maybe TOD clock should be attached as an independent device.
 1.21 12-Oct-1997  thorpej branches: 1.21.26; 1.21.30;
Move the prototype of hp300_calibrate_delay() to cpu.h
 1.20 27-Apr-1997  thorpej branches: 1.20.4;
#include <machine/hp300spu.h>
 1.19 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.18 13-Oct-1996  christos backout previous kprintf changes
 1.17 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.16 05-Oct-1996  thorpej Cast a volatile pointer to caddr_t for a call to badbaddr().
 1.15 04-Oct-1996  thorpej At the end of the delay calibration routine, explcitly reset the timer.

This fixes a critical bug where a clock interrupt would happen sometime
between the call to hp300_calibrate_delay() and when proc0 is initialized.
This ends up dereferencing a bad pointer in itimerdecr(), which scribbles
over the first page of kernel text, specifically vectors 46 and 47 (decimal).

To complicate matters, the way the bug manifested itself was different
depending on whether or not DDB was configured into the kernel. When
DDB is in the kernel, kernel text is mapped read/write. When DDB is not
in the kernel, kernel text is mapped read-only. Note that the kernel
scribble happens early, typically before the console is initialized.

In the non-DDB case, the kernel will hang as soon as it's loaded because
the access causes a fault (before the console is initialized, so you
don't see the trap).

In the DDB case, the access does _not_ cause a fault. However, the
mechanism used to enter the kernel debugger is to issue a "trap #15".
Conveniently, this is one of the corrupted vectors (47), thus rendering
DDB useless (it actually caused a recursive panic/trap loop).

This _WILL_ be in the first 1.2 official patch.
 1.14 18-May-1996  thorpej branches: 1.14.4;
Implement a real delay calibration routine, adapted from Chuck Cranor's
mvme68k delay calibration algorithm.
 1.13 29-Dec-1994  mycroft microtime() returns void.
 1.12 26-Oct-1994  cgd new RCS ID format.
 1.11 23-May-1994  mycroft Merge with 4.4-Lite.
 1.10 17-May-1994  cgd prototyping foo, and kill profclock stuff
 1.9 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.8 08-Apr-1994  hpeyerl Remove "MAP_FILE". okey-dokey'd by Charles.
 1.7 04-Feb-1994  mycroft Use CLKF_PC(), rather than decomposing the frame ourselves.
 1.6 04-Feb-1994  mycroft profclock() takes a pointer to clockframe.
 1.5 06-Dec-1993  mycroft Dummy clockattach() for new config.
 1.4 12-Nov-1993  cgd new specfs.h and fifo.h locations
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.14.4.1 14-Nov-1996  thorpej Pull up from trunk: make sure clock interrupt is disabled at the end
of the delay calibration routine, in order to avoid getting a bad
pointer reference, causing a crash very early in kernels without DDB.
 1.20.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.21.30.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.21.30.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.21.26.1 12-Nov-2001  he Pull up revision 1.22 (via patch, requested by tsutsui):
Fix two bugs, one Year 2000 bug, one Year 2001 bug, related
to usage of two-digit BCD year in TOD clock.
 1.22.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.22.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.22.4.1 11-Oct-2001  nathanw file clock.c was added on branch nathanw_sa on 2002-01-08 00:24:39 +0000
 1.22.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.27.12.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.27.12.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.27.12.3 18-Sep-2004  skrll Sync with HEAD.
 1.27.12.2 03-Sep-2004  skrll Sync with HEAD
 1.27.12.1 03-Aug-2004  skrll Sync with HEAD
 1.33.2.3 21-Jan-2008  yamt sync with head
 1.33.2.2 30-Dec-2006  yamt sync with head.
 1.33.2.1 21-Jun-2006  yamt sync with head.
 1.35.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.35.8.2 14-Sep-2006  yamt sync with head.
 1.35.8.1 13-Mar-2006  yamt sync with head.
 1.35.6.1 22-Apr-2006  simonb Sync with head.
 1.35.4.1 09-Sep-2006  rpaulo sync with head
 1.37.2.1 18-Nov-2006  ad Sync with head.
 1.38.44.1 08-Jan-2008  bouyer Sync with HEAD
 1.38.36.1 18-Feb-2008  mjf Sync with HEAD.
 1.38.30.1 09-Jan-2008  matt sync with HEAD
 1.39.40.1 17-Feb-2011  bouyer Sync with HEAD
 1.39.38.1 06-Jun-2011  jruoho Sync with HEAD.
 1.39.32.1 05-Mar-2011  rmind sync with head
 1.6 17-Nov-2001  gmcgarry Use new RTC attachment.
 1.5 26-Oct-1994  cgd branches: 1.5.46; 1.5.50;
new RCS ID format.
 1.4 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.50.1 28-Feb-2002  nathanw Catch up to -current.
 1.5.46.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.10 08-Mar-2006  lukem branches: 1.10.90; 1.10.96; 1.10.98;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.6; 1.9.8; 1.9.10;
merge ktrace-lwp.
 1.8 07-Aug-2003  agc branches: 1.8.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.7 17-Nov-2001  gmcgarry branches: 1.7.16;
Use new RTC attachment.
 1.6 11-Oct-2001  tsutsui branches: 1.6.4;
Cleanup TOD clock functions:
- Adapt MI functions/structures in sys/dev/clock_subr.[ch]
- Fix year-2001 problem

XXX Maybe TOD clock should be attached as an independent device.
 1.5 26-Oct-1994  cgd branches: 1.5.42; 1.5.46;
new RCS ID format.
 1.4 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.46.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.42.1 12-Nov-2001  he Pull up revision 1.6 (via patch, requested by tsutsui):
Fix two bugs, one Year 2000 bug, one Year 2001 bug, related
to usage of two-digit BCD year in TOD clock.
 1.6.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.4.1 11-Oct-2001  nathanw file clockreg.h was added on branch nathanw_sa on 2002-01-08 00:24:39 +0000
 1.7.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.16.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.9.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.9.8.1 13-Mar-2006  yamt sync with head.
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.98.1 17-Feb-2011  bouyer Sync with HEAD
 1.10.96.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.90.1 05-Mar-2011  rmind sync with head
 1.2 19-Jul-2003  tsutsui Rename clockattach() to todr_attach().
 1.1 17-Nov-2001  gmcgarry branches: 1.1.2; 1.1.4; 1.1.20;
Use new RTC attachment.
 1.1.20.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 17-Nov-2001  thorpej file clockvar.h was added on branch kqueue on 2002-01-10 19:43:03 +0000
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 17-Nov-2001  nathanw file clockvar.h was added on branch nathanw_sa on 2002-01-08 00:24:39 +0000
 1.55 26-Oct-2002  jdolecek now that mem_no is emitted by config(8), there is no reason to keep
copy of more or less identical iskmemdev() for every arch; move the function
to spec_vnop.c, and g/c machine-dependant copies
 1.54 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.53 19-Jul-2002  thorpej Rename cdev_systrace_init() to cdev_clonemisc_init(), so it can
be properly used by any misc. cloning device. While here, correct
a comment to indicate that "open" is the only entry point and that
everything else is handled with fileops.
 1.52 17-Jun-2002  christos MD systrace gluons.
 1.51 15-Mar-2002  gmcgarry branches: 1.51.4;
Add RCSIDs.
 1.50 12-Jan-2002  manu Added clockctl
 1.49 14-Dec-2001  gmcgarry Update the console attach interface now that bus_space is available.
Basically means that hardware drivers with console attachments are
now largely machine independent.
 1.48 17-Nov-2001  gmcgarry Convert hil to standard device attachment.
 1.47 08-Nov-2001  gmcgarry branches: 1.47.2;
Reserve for wscons.
 1.46 26-Mar-2001  lukem branches: 1.46.2; 1.46.6;
- add dev_noimpl(xxx,yyy) macro to replace "(dev_type_xxx((*))) yyy",
and use appropriately

- create more helper macros:
. cdev__xyz_init(c,n), such as cdev__ocri_init() for
/* open, close, read, ioctl */, etc.
. cdev__xRy_init(c,n), where nullop is used instead of enodev to dummy out
method `R' and the comments now read /* xxx (read) yyy */ instead
. cdev__xyz_t_init(c,n,t) - as per cdev__xyz_init, but sets d_type = t
as well

- use seltrue instead of dev_noimpl(poll,*), as (IIRC) cdevsw.d_poll should
always DTRT WRT returning a valid result. (a few devices previously
incorrectly returned ENODEV)

- use dev_noimpl(stop,enodev) instead of dev_noimpl(stop,nullop) if tty
== 0, because it doesn't matter if dev_type_stop isn't implemented in that
case, and it allows the use of the cdev__xyz_init macros. certain ports
(sparc,sparc64,x68k) used the nullop method for dev_type_stop in a few
drivers, whereas everything else uses enodev

- ensure that the comments are accurate WRT the behaviour of a given entry
 1.45 19-Apr-1999  kleink branches: 1.45.2; 1.45.14;
Add COMPAT_SVR4 for m68k.
 1.44 13-Nov-1998  oster branches: 1.44.6;
Updating of bdev's and cdev's to support RAIDframe.
 1.43 18-Oct-1998  thorpej Fix a thinko in previous.
 1.42 10-Oct-1998  thorpej Add scsibus entry points to the cdevsw[].
 1.41 13-Oct-1997  explorer o Make usage of /dev/random dependant on
pseudo-device rnd # /dev/random and in-kernel generator
in config files.

o Add declaration to all architectures.

o Clean up copyright message in rnd.c, rnd.h, and rndpool.c to include
that this code is derived in part from Ted Tyso's linux code.
 1.40 21-Sep-1997  thorpej Add support for the memory disk device.
 1.39 12-May-1997  thorpej branches: 1.39.4;
Add glue for APCI driver at cdev minor #31 and in console switch.
 1.38 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.37 30-Jan-1997  thorpej Garbage-collect old-style autoconfiguration glue.
 1.36 07-Jan-1997  mrg use pseudo-device ipfilter, not ipl.
 1.35 05-Jan-1997  thorpej Add "ipl" device at cdev major 18.
 1.34 17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.33 07-Sep-1996  mycroft Implement poll(2).
 1.32 05-Sep-1996  mycroft Remove duplicate declarations of LKM functions and macros.
 1.31 14-Mar-1996  christos fdopen -> filedescopen
 1.30 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.29 04-Jul-1995  mycroft Make each disk and tape driver define its own read and write functions.
Deprecate rawread() and rawwrite() completely. Remove d_strategy from cdevsw to
force the abstraction barrier.
 1.28 19-Apr-1995  mycroft Update to match conf.h
 1.27 10-Apr-1995  mycroft Minor consistency nits.
 1.26 10-Apr-1995  mycroft map --> mmap
 1.25 10-Apr-1995  mycroft Update to make con[fs].h.
 1.24 25-Jan-1995  cgd vn -> vnd renaming, for consistency
 1.23 05-Jan-1995  mycroft Add LKM stuff. Some general cleanup.
 1.22 16-Dec-1994  mycroft Add mt and pollc stuff.
 1.21 14-Dec-1994  mycroft Remove fp arg to d_open.
 1.20 14-Nov-1994  christos changed open prototype
 1.19 26-Oct-1994  cgd new RCS ID format.
 1.18 16-Sep-1994  mycroft Fix typo.
 1.17 16-Sep-1994  mycroft Add tun.
 1.16 16-Jul-1994  mycroft Make grf truly optional.
 1.15 24-Jun-1994  hpeyerl branches: 1.15.2;
additions for ccd driver.
 1.14 06-Jun-1994  hpeyerl #if out references to cd.c for now.
 1.13 23-May-1994  mycroft Merge with 4.4-Lite.
 1.12 20-May-1994  mycroft Need vnode.h.
 1.11 20-May-1994  mycroft Fix typos.
 1.10 20-May-1994  mycroft Add isdisk() and chrtoblk().
 1.9 17-May-1994  cgd iskmemdev and iszerodev
 1.8 16-May-1994  cgd kill typo
 1.7 11-May-1994  mycroft Get rid of private *read() and *write() functions.
 1.6 15-Feb-1994  mycroft Eliminate a bunch of compiler warnings.
 1.5 06-Feb-1994  mycroft Use common version of cons.c.
 1.4 26-Jan-1994  brezak Fix silly typo for rd disks.
 1.3 11-Jan-1994  mycroft Change return type of strat functions.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.15.2.2 16-Sep-1994  cgd from trunk.
 1.15.2.1 08-Aug-1994  mycroft update from trunk
 1.39.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.39.4.1 29-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.44.6.1 21-Jun-1999  thorpej Sync w/ -current.
 1.45.14.1 09-Apr-2001  nathanw Catch up with -current.
 1.45.2.1 27-Mar-2001  bouyer Sync with HEAD.
 1.46.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.46.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.46.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.46.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.46.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.46.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.46.2.1 10-Jul-2001  lukem add kqfilter cdev methods as appropriate
 1.47.2.8 11-Nov-2002  nathanw Catch up to -current
 1.47.2.7 17-Sep-2002  nathanw Catch up to -current.
 1.47.2.6 01-Aug-2002  nathanw Catch up to -current.
 1.47.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.47.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.47.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.47.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.47.2.1 08-Nov-2001  nathanw file conf.c was added on branch nathanw_sa on 2002-01-08 00:24:39 +0000
 1.51.4.3 21-Jul-2002  gehenna catch up with -current.
 1.51.4.2 14-Jul-2002  gehenna catch up with -current.
 1.51.4.1 16-May-2002  gehenna Bye block/character device swicth tables.
 1.5 06-Feb-1994  mycroft Clean up deleted files.
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 07-Jul-1993  deraadt the "struct tty *cn_tty" field in cons.c wasn't being used by anything
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5 06-Feb-1994  mycroft Clean up deleted files.
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 07-Jul-1993  deraadt the "struct tty *cn_tty" field in cons.c wasn't being used by anything
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6 08-Feb-1995  mycroft Clean up deleted files.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 25-May-1994  mycroft Put back faster version, with tiny bug fix.
 1.3 25-May-1994  mycroft Revert to previous (slower) version for now.
 1.2 24-May-1994  mycroft Optimize these a bit.
 1.1 24-May-1994  mycroft New copy*() functions, cloned from the appropriate functions in libc. Handles
>64k lengths correctly.
 1.12 02-Nov-2002  chs enhance the common m68k db_memrw.c to handle read-only kernel text
and switch all the motorola-MMU m68k platforms to use it.
 1.11 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.10 15-Mar-2002  gmcgarry Add RCSIDs.
 1.9 29-Jun-2000  mrg branches: 1.9.4; 1.9.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.8 31-Aug-1998  frueauf branches: 1.8.12;
Fix typo: dbaddr_t -> db_addr_t.
 1.7 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.6 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.5 10-Jun-1997  veego branches: 1.5.4;
s/hp300_trunc_page/m68k_trunc_page/
 1.4 27-Apr-1997  thorpej #include <machine/hp300spu.h>
 1.3 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.2 09-Dec-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 14-Oct-1996  thorpej Add a db_memrw.c that understands how to write to read-only kernel text
(remaps page read/write/cache-inhibit, does write, restores previous
mapping). Kernel text no longer needs to be read/write with DDB/KGDB
is in the kernel.

Based on a similar module written for the Sun3 port by Gordon Ross,
and modified somewhat by me.
 1.5.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.8.2 11-Nov-2002  nathanw Catch up to -current
 1.9.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.28 03-Apr-2019  christos centralize setdisklabel(9)
 1.27 02-Jan-2008  ad branches: 1.27.98;
Merge vmlocking2 to head.
 1.26 17-Oct-2007  garbled branches: 1.26.2; 1.26.4; 1.26.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.25 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.24 25-Nov-2006  scw branches: 1.24.8; 1.24.16; 1.24.26; 1.24.28; 1.24.30;
Replace the myriad copies of bounds_check_with_label() with a single MI
version.

Add disk_blocksize(9) so that disk drivers can record the physical
block size of a disk if it is different to DEV_BSIZE. Right now this
simply initialises dk_blkshift and dk_byteshift according to the
supplied block size. This information is used in the MI version of
bounds_check_with_label().
 1.23 11-Dec-2005  christos branches: 1.23.20; 1.23.22;
merge ktrace-lwp.
 1.22 02-Jun-2005  tsutsui branches: 1.22.2;
Add a const.
 1.21 24-May-2005  tsutsui - make readdisklabel(9) return more usable default label
if disk doesn't have disklabel (sync with news68k)
- most hp300 machines have a boot patition and partition a doesn't
start at 0, so RAW_PART should be used in bounds_check_with_label(9)
- remove unneeded <sys/syslog.h>
- remove b_cylinder definition, which is in <sys/buf.h>
- some other cosmetics
 1.20 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.19 17-Nov-2003  tsutsui TAB/space cleanup.
 1.18 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.17 12-May-2003  thorpej branches: 1.17.2;
Include <sys/disk.h>.
 1.16 10-May-2003  thorpej Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.15 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.14 15-Mar-2002  gmcgarry Add RCSIDs.
 1.13 05-Mar-2002  simonb Don't cast argument to ffs() to long.
Per discussion on port-alpha, noticed by Robert Elz.
 1.12 19-Feb-2002  wiz strategy should have an 'r'. Inspired by similar change in OpenBSD.
 1.11 20-Apr-2001  he branches: 1.11.2; 1.11.4; 1.11.8;
In the provisional disklabel (which will be used if there is no
valid on-device disk label), set d_npartitions to RAW_PART+1 instead
of to 1. Discovered as a build bug on the netbsd-1-5 branch, affecting
miniroot construction and vnd devices; RAW_PART went missing from the
in-core disklabel, and eventually also the on-device label.
 1.10 20-Nov-2000  chs branches: 1.10.2;
rationalize the use of b_flags for geteblk() buffers.
rather than assigning to the whole field, set or clear individual flags,
which implies that the B_BUSY and B_INVAL flags will remain set.
this allows us to make the assertion in brelse() that B_BUSY is set,
which is the purpose of all this.
 1.9 01-Apr-1997  scottr branches: 1.9.22; 1.9.28; 1.9.32;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.8 02-Feb-1996  scottr Use DISKUNIT()/DISKPART() from <sys/disklabel.h> instead of
our own home-grown versions.
 1.7 02-Feb-1996  mycroft Fix #includes.
 1.6 08-Aug-1995  thorpej Add bounds_check_with_label().
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 13-May-1994  mycroft Liten up.
 1.3 11-Jan-1994  mycroft Get rid of indirection, and change return type of strat functions.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 20-May-1993  deraadt First cut at cpu independent disklabels.
There will be niggly little details no doubt..
 1.9.32.1 20-Apr-2001  he Pull up revision 1.11 (requested by he):
Correctly set d_npartitions in in-core disklabel to RAW_PART+1.
 1.9.28.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.9.22.2 23-Apr-2001  bouyer Sync with HEAD.
 1.9.22.1 22-Nov-2000  bouyer Sync with HEAD.
 1.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.11.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.11.8.1 20-Apr-2001  nathanw file disksubr.c was added on branch nathanw_sa on 2002-02-28 04:09:27 +0000
 1.11.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.11.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.11.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.17.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.2 03-Sep-2004  skrll Sync with HEAD
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.22.2.3 21-Jan-2008  yamt sync with head
 1.22.2.2 27-Oct-2007  yamt sync with head.
 1.22.2.1 30-Dec-2006  yamt sync with head.
 1.23.22.1 10-Dec-2006  yamt sync with head.
 1.23.20.1 12-Jan-2007  ad Sync with head.
 1.24.30.1 14-Oct-2007  yamt sync with head.
 1.24.28.2 09-Jan-2008  matt sync with HEAD
 1.24.28.1 06-Nov-2007  matt sync with HEAD
 1.24.26.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.24.16.1 16-Oct-2007  garbled Sync with HEAD
 1.24.8.1 09-Oct-2007  ad Sync with head.
 1.26.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.26.4.1 31-Dec-2007  ad Make compile with new buffer cache locking scheme.

XXX This should be largely MI, please do not make another clone of disksubr.c.
 1.26.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.27.98.1 10-Jun-2019  christos Sync with HEAD
 1.11 21-Jul-2006  tsutsui Some KNF.
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.8;
merge ktrace-lwp.
 1.9 28-Aug-2004  thorpej branches: 1.9.12;
Use ANSI function decls, static, and const.
 1.8 17-Nov-2003  tsutsui TAB/space cleanup.
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 15-Mar-2002  gmcgarry branches: 1.6.12;
Add RCSIDs.
 1.5 01-Apr-1997  scottr branches: 1.5.36; 1.5.40;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.40.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.5.36.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.12.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.12.3 18-Sep-2004  skrll Sync with HEAD.
 1.6.12.2 03-Sep-2004  skrll Sync with HEAD
 1.6.12.1 03-Aug-2004  skrll Sync with HEAD
 1.9.12.1 30-Dec-2006  yamt sync with head.
 1.10.8.1 11-Aug-2006  yamt sync with head
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.23 13-Mar-1997  thorpej Use the script version to facilitate cross compiling.
 1.22 02-Feb-1997  thorpej - Use <errno.h>, not "extern int errno."
- Define FPU constants.
 1.21 05-Oct-1996  thorpej Define FR_SIZE as sizeof(struct trapframe)
 1.20 11-Sep-1996  thorpej Define the CPU_* constants from <m68k/cpu.h> for assym.h
 1.19 17-May-1996  thorpej Define the machineid and ectype constants.
 1.18 02-Feb-1996  mycroft Don't need unistd.h.
 1.17 02-Feb-1996  mycroft Don't define _KERNEL here.
 1.16 11-Dec-1995  thorpej Rather than using individual HP300 model names, map those model names to
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.

In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.

Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
 1.15 25-May-1995  mycroft Make sure proc0's md_regs is initialized.
 1.14 16-May-1995  jtc Removing -DKERNEL, transition to _KERNEL has been completed
 1.13 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.12 12-Apr-1995  mycroft Add USPACE.
 1.11 28-Mar-1995  jtc Added #define _KERNEL
 1.10 26-Oct-1994  cgd new RCS ID format.
 1.9 23-May-1994  mycroft Merge with 4.4-Lite.
 1.8 21-May-1994  cgd vmmeter
 1.7 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.6 23-Apr-1994  mycroft Garbage collect.
 1.5 06-Jan-1994  mycroft Garbage collection.
 1.4 14-Aug-1993  mycroft Note new location of pte.h.
 1.3 27-May-1993  deraadt -DKERNEL in same place as i386
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.51 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.50 27-Dec-2023  thorpej Re-factor the 680x0 Function Code definitions into their own
separate file (as was done on the sun2/sun3 ports ages ago)
and switch everyone to the common header.
 1.49 27-Dec-2023  thorpej No need to export FC_PURGE here.
 1.48 27-Dec-2023  thorpej Stop using magic numbers for the MMU root pointer attributes and the
Translation Control register, and also get rid of "#if PGSHIFT == ..."
where those magic numbers are used.

Instead, define new macros: MMU51_SRP_BITS, MMU51_CRP_BITS, MMU51_TCR_BITS,
and MMU40_TCR_BITS, in terms of the definitions in mmu_{40,51}.h. These
automagically adapt to 8K and 4K pages based on the machine-specific value
of PGSHIFT.
 1.47 20-Feb-2020  skrll G/C
 1.46 17-Feb-2020  skrll G/C LS{SLEEP,RUN,ONPROC}

LWP status manipulation was moved out of assembly long ago.
 1.45 19-Dec-2018  maxv branches: 1.45.6;
Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.44 14-Jan-2011  rmind branches: 1.44.58; 1.44.60;
Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete. Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
 1.43 27-Dec-2010  tsutsui With a quick test, HP9000/362 doesn't seem to have frodo utility chip,
so probe code to identify HP362 taken from OpenBSD has never worked.

Identify HP362 by probing device IDs of the on-board framebuffer instead.

---

>> NetBSD/hp300 Primary Boot, Revision 1.16 (from NetBSD 5.99.41)
>> HP 9000/362 SPU
>> Enter "reset" to reset system.
Boot: [[[sd0a:]netbsd][-a][-c][-d][-s][-v][-q]] :-
2836828+148212 [343504+216292]=0x361b24
Start @ 0xff003400 [1=0xff2dac50-0x361b24]...
Entry point: 0xff003400
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 5.99.41 (GENERIC) #135: Mon Dec 27 23:30:21 JST 2010
tsutsui@mirage:/usr/src/sys/arch/hp300/compile/GENERIC
HP 9000/362 (25MHz MC68030 CPU+MMU, 25MHz MC68882 FPU)
total memory = 16372 KB
avail memory = 11480 KB
:
 1.42 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.41 13-Dec-2009  tsutsui branches: 1.41.4;
Replace a couple of magic numbers with proper macro.
 1.40 10-Dec-2009  rmind Rename L_ADDR to L_PCB and amend some comments accordingly.
 1.39 20-Sep-2008  tsutsui Remove advertising clause for UCB in various genassym.cf files,
which were derived from genassym.c in 4.4BSD-Lite2 (or 386BSD).
Closes PR misc/39573. Approved by martin@.
 1.38 04-Jun-2008  ad branches: 1.38.4;
Remove ref to uvm.page_idle_zero
 1.37 24-Mar-2008  cube branches: 1.37.2; 1.37.4; 1.37.6;
Don't reference m68k/saframe.h. Zed's dead, baby, Zed's dead.
 1.36 17-Oct-2007  garbled branches: 1.36.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.35 18-May-2007  tsutsui branches: 1.35.10;
Adapt hp300 to yamt-idlelwp. Tested on 9000/382.
 1.34 20-Jul-2006  tsutsui branches: 1.34.14; 1.34.16; 1.34.22;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.33 11-Dec-2005  christos branches: 1.33.4; 1.33.8;
merge ktrace-lwp.
 1.32 12-Dec-2004  tsutsui branches: 1.32.10;
Remove definitions for EFAULT and ENAMETOOLONG.
m68k/copy.s directly includes <sys/errno.h>.
 1.31 04-Nov-2003  dsl Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
 1.30 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.29 08-Apr-2003  thorpej branches: 1.29.2;
Use PAGE_SIZE rather than NBPG.
 1.28 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.27 25-Sep-2002  thorpej Replace resource map usage with extent maps.
 1.26 22-Sep-2002  gmcgarry Add UVM_PAGE_IDLE_ZERO.
 1.25 28-Aug-2002  gmcgarry RAS support for m68k.
 1.24 11-May-2002  jdolecek branches: 1.24.2;
use _KERNEL_OPT rather than _KERNEL && !_LKM
 1.23 08-Dec-2001  gmcgarry softintr(9) interface for hp300
 1.22 29-Nov-2000  jdolecek branches: 1.22.4; 1.22.8;
LKMify
 1.21 21-Nov-2000  tsutsui Define proper macros for FP frame offsets rather than magic numbers.
 1.20 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.19 26-May-2000  thorpej Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor. Test against SONPROC as appropriate rather than
combinations of SRUN and curproc. Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
 1.18 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.17 31-Jul-1999  thorpej branches: 1.17.2; 1.17.4; 1.17.6;
Oops, forgot to add MMUID_385.
 1.16 31-Jul-1999  thorpej Identify the 385 and 425e. Partially from OpenBSD.
 1.15 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.14 28-Mar-1999  simonb branches: 1.14.4;
Hopefully get the last of the "ifdef UVM" bogons in genassym.cf's.
 1.13 01-Oct-1998  thorpej Define SYS_compat_13_sigreturn13.
 1.12 30-Sep-1998  thorpej Make sure SYS_exit and SYS___sigreturn14 are defined. Garbage collect
SYS_sigreturn.
 1.11 16-Feb-1998  thorpej Add support for UVM.
 1.10 06-Jan-1998  thorpej Garbage-collect VM_PMAP.
 1.9 06-Jan-1998  thorpej Garbage-collect pm_stchanged.
 1.8 13-May-1997  gwr Eliminate references to vmspace.vm_pmap
 1.7 05-May-1997  thorpej Garbage-collect LED-related stuff.
 1.6 27-Apr-1997  thorpej - Define new machineid and mmuid constants.
- Rearrange slightly.
 1.5 16-Mar-1997  thorpej Nuke MDP_HPUXTRACE.
 1.4 13-Mar-1997  thorpej Fix a typo (oops).
 1.3 13-Mar-1997  thorpej oops, don't need trap.h here anymore
 1.2 13-Mar-1997  thorpej Don't genassym the trap type values; just include <machine/trap.h>
 1.1 13-Mar-1997  thorpej Use the script version to facilitate cross compiling.
 1.14.4.2 02-Aug-1999  thorpej Update from trunk.
 1.14.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.4.1 15-Nov-1999  fvdl Sync with -current
 1.17.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.17.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.22.8.7 18-Oct-2002  nathanw Catch up to -current.
 1.22.8.6 05-Oct-2002  gmcgarry No more upcall frame.
 1.22.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.22.8.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.22.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.22.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.22.8.1 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.22.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.22.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.22.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.22.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.24.2.1 30-Aug-2002  gehenna catch up with -current.
 1.29.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.29.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.29.2.1 03-Aug-2004  skrll Sync with HEAD
 1.32.10.2 03-Sep-2007  yamt sync with head.
 1.32.10.1 30-Dec-2006  yamt sync with head.
 1.33.8.1 11-Aug-2006  yamt sync with head
 1.33.4.1 09-Sep-2006  rpaulo sync with head
 1.34.22.1 22-May-2007  matt Update to HEAD.
 1.34.16.1 11-Jul-2007  mjf Sync with head.
 1.34.14.1 27-May-2007  ad Sync with head.
 1.35.10.1 06-Nov-2007  matt sync with HEAD
 1.36.16.3 28-Sep-2008  mjf Sync with HEAD.
 1.36.16.2 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.36.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.37.6.2 10-Oct-2008  skrll Sync with HEAD.
 1.37.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.37.4.2 11-Mar-2010  yamt sync with head
 1.37.4.1 04-May-2009  yamt sync with head.
 1.37.2.1 17-Jun-2008  yamt sync with head.
 1.38.4.1 19-Oct-2008  haad Sync with HEAD.
 1.41.4.1 05-Mar-2011  rmind sync with head
 1.44.60.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.44.60.1 10-Jun-2019  christos Sync with HEAD
 1.44.58.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.45.6.1 29-Feb-2020  ad Sync with head.
 1.2 03-Jul-1994  mycroft Clean up deleted files.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.49 31-Dec-2007  ad Remove COMPAT_HPUX.
 1.48 20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.47 04-Mar-2007  christos branches: 1.47.20; 1.47.26; 1.47.28; 1.47.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.46 10-Feb-2007  ad branches: 1.46.2;
Make a couple more updates for signal handling.
 1.45 10-Feb-2007  tsutsui Make COMPAT_HPUX compile by mechanical replacements.
XXX1: not sure if it still works even before newlock2 merge
XXX2: some more mutex locks might be required
 1.44 09-Feb-2007  ad Merge newlock2 to head.
 1.43 21-Jul-2006  tsutsui branches: 1.43.4;
Some KNF.
 1.42 11-Dec-2005  christos branches: 1.42.4; 1.42.8;
merge ktrace-lwp.
 1.41 28-Aug-2004  thorpej branches: 1.41.12;
Use ANSI function decls, static, and const.
 1.40 17-Nov-2003  tsutsui TAB/space cleanup.
 1.39 08-Oct-2003  thorpej * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
result of a trap. Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap. Expands to 0 if the ksiginfo_t was
not the result of a trap. This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern. Reviewed and OK's by Christos.
 1.38 25-Sep-2003  christos constify sendsig/trapsignal
 1.37 22-Sep-2003  cl SA_SIGINFO support for m68k (compat hpux)
 1.36 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.35 29-Jun-2003  fvdl branches: 1.35.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.34 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.33 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.32 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.31 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.30 03-Aug-2002  itojun correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.29 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
sigaction and the trampoline/version. Version 0 means "legacy kernel
provided trampoline". Other versions are coordinated with machine-
dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions. Instead,
sendsig() looks up the handler by peeking in the sigacts for the
process getting the signal (since it has to look in there for the
trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.28 15-Mar-2002  gmcgarry branches: 1.28.4; 1.28.6;
Add RCSIDs.
 1.27 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.26 27-Dec-2000  jdolecek branches: 1.26.4; 1.26.8;
adapt to recent changes of signal structures
 1.25 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.24 26-Jun-2000  mrg remove redundant vm includes.
 1.23 16-Aug-1999  simonb branches: 1.23.2;
Spell "privilege" correctly (correct spelling from Jonathan Stone).
 1.22 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.21 01-Oct-1998  thorpej Update for signal changes.
 1.20 08-May-1998  kleink Fix some arithmetics lossage on typeless pointers.
 1.19 16-Feb-1998  thorpej Add support for UVM.
 1.18 17-Oct-1997  scottr Make this compile again. From Dave Carrel.
 1.17 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.16 12-Sep-1997  mycroft Set the status word as well, and remove a bogus comment.
 1.15 12-Sep-1997  mycroft Always initialize all registers in setregs().
 1.14 11-Sep-1997  mycroft Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)
 1.13 27-Apr-1997  thorpej branches: 1.13.4; 1.13.6;
Garbage-collect a bunch of _very_ hp300-specific code, most of which
doesn't work anyhow (due to current and future fundamental differences
between NetBSD and HP-UX device semantics). This can probably be shared
with other m68k ports now.
 1.12 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.11 01-Apr-1997  scottr Catch up with COMPAT_HPUX changes, and make this compile with -Wall.
 1.10 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.9 16-Mar-1997  thorpej Garbage-collect hpux_dumpu().
 1.8 16-Mar-1997  thorpej Implement hpux_setregs(). While I'm here, nuke the MDP_HPUXTRACE
code. In practice, no one traces NetBSD programs with HP-UX debuggers,
and the evil required to make it work should not be discussed in the
presence of small children.
 1.7 16-Mar-1997  thorpej Move all COMPAT_HPUX signal code into hpux_sendsig() and hpux_sys_sigreturn().
 1.6 15-Mar-1997  thorpej - Make hpux_sys_getcontext() table-driven.
- Use `fputype' at run-time rather than FPCOPROC at compile-time.
 1.5 14-Oct-1996  thorpej Need to include <sys/exec.h>.
 1.4 13-Oct-1996  christos backout previous kprintf changes
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 14-Feb-1996  thorpej New interrupt handling code. Highlights:
- Interrupt service routines now take a pointer to
the device's softc, rather than a unit number.
- Interrupt handling code in locore.s condensed. Only
remaining "special" handlers are lev0 (spurious),
lev1 (HIL; don't ask), lev6 (clock), and lev7 (NMI).
Only remaining hard-coded device driver reference in
locore is HIL. (clock doesn't count...)
- "dcafastservice" eliminated. DCA driver has new mechanism
to guarantee prompt interrupt service at any ipl (not
just level 5).
- Interrupt code pulled out of autoconf.c and machdep.c and
placed in new file, isr.c
 1.1 06-Jan-1996  thorpej Move the obviously machine-dependent HP-UX compat code to hpux_machdep.{c,h}.
A fair bit of this, the m68k core dump and exec goo, can probably be
made into a generic m68k hpux module, eventually.

More to be placed in hpux_machdep.c - keep your eyes peeled...
 1.13.6.1 08-Sep-1997  thorpej Significantly restructure the way signal state for a process is stored.
Rather than using bitmasks to redundantly store the information kept
in the process's sigacts (because the sigacts was kept in the u-area),
hang sigacts directly off the process, and access it directly.

Simplify signal setup code tremendously by storing information in
the sigacts as an array of struct sigactions, rather than in a different
format, since userspace uses sigactions.

Make sigacts sharable by adding reference counting.
 1.13.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.23.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.26.8.9 11-Nov-2002  nathanw Catch up to -current
 1.26.8.8 13-Aug-2002  nathanw Catch up to -current.
 1.26.8.7 01-Aug-2002  nathanw Catch up to -current.
 1.26.8.6 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.26.8.5 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.26.8.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.26.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.26.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.26.8.1 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.26.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.26.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.26.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.6.1 07-Aug-2002  lukem Pull up revision 1.30 (requested by itojun in ticket #616):
correct range check, have overflow check, fix type mismatches,
for cmap args and some other calls. from openbsd
 1.28.4.2 30-Aug-2002  gehenna catch up with -current.
 1.28.4.1 16-Jul-2002  gehenna catch up with -current.
 1.35.2.6 24-Jan-2005  skrll Adapt to branch.
 1.35.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.3 03-Sep-2004  skrll Sync with HEAD
 1.35.2.2 03-Aug-2004  skrll Sync with HEAD
 1.35.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.41.12.5 21-Jan-2008  yamt sync with head
 1.41.12.4 03-Sep-2007  yamt sync with head.
 1.41.12.3 26-Feb-2007  yamt sync with head.
 1.41.12.2 30-Dec-2006  yamt sync with head.
 1.41.12.1 21-Jun-2006  yamt sync with head.
 1.42.8.1 11-Aug-2006  yamt sync with head
 1.42.4.1 09-Sep-2006  rpaulo sync with head
 1.43.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.46.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.47.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.47.28.1 26-Dec-2007  ad Sync with head.
 1.47.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.47.20.1 23-Mar-2008  matt sync with HEAD
 1.4 08-Jan-1994  mycroft Clean up deleted files.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.45 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.44 18-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.43 10-Nov-2019  chs branches: 1.43.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.42 17-Jan-2016  tsutsui branches: 1.42.18;
Fix fatal "intr_dispatch: stray level 6 interrupt" panic by the GENERIC
kernel on machines without arcofi(4) audio (i.e. all hp300 except HP425e).

I failed to pull all necessary changes for arcofi(4) from OpenBSD
and I should have tested 7.0_RC kernels on my HP382 too :-(

Should be pulled up to netbsd-7 and netbsd-7-0.
 1.41 24-Aug-2014  tsutsui branches: 1.41.2;
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.

The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.

The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
 1.40 20-Dec-2010  matt branches: 1.40.18; 1.40.34;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.39 21-Dec-2008  tsutsui branches: 1.39.6;
Remove obsolete code for old software interrupt emulation.
The MI softint(9) handles it in the kernel threads nowadays.

Note "Emulation of VAX REI instruction" is still there to handle ASTs.
 1.38 21-Dec-2008  tsutsui Account idepth in locore.s.
 1.37 22-Jun-2008  tsutsui branches: 1.37.4; 1.37.6;
Make cpu_intr_p() inline.
 1.36 22-Jun-2008  tsutsui Don't recompute an ipl level for IPL_VM during or after cpu_configure(9)
and use a static and possible highest ipl value (ipl 5) for IPL_VM
so that we can put ipl2psl_table[] conversion into makeiplcookie(9),
which could be called before cpu_configure(9).

Fixes "panic: sbappendaddr" on NFS load.
 1.35 15-Jun-2008  tsutsui Unify splraiseipl(9) implementation among m68k ports as per
suggestion from isaki@ on port-m68k.

For hp300:
- use ipl2psl_table[] for makeiplcookie() conversion
- use uint16_t for ipl2psl_table[]
 1.34 28-Apr-2008  martin branches: 1.34.2; 1.34.4;
Remove clause 3 and 4 from TNF licenses
 1.33 03-Dec-2007  tsutsui branches: 1.33.14; 1.33.16; 1.33.18;
Raise hp300_ipl2psl[IPL_VM] in intr_computeipl() accordingly.
(maybe mac68k has the same problem)

XXX: maybe we could use a possible highest device ipl (5 on hp300?) for IPL_VM.
 1.32 03-Dec-2007  ad Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.31 17-Oct-2007  garbled branches: 1.31.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.30 21-May-2007  tsutsui branches: 1.30.8; 1.30.10;
Wrap a sanity check with #ifdef DIAGNOSTIC.
 1.29 21-Dec-2006  yamt branches: 1.29.6; 1.29.8; 1.29.14;
merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.28 21-Jul-2006  tsutsui branches: 1.28.4; 1.28.6;
Some KNF.
 1.27 19-Mar-2006  tsutsui Replace MALLOC(9) with malloc(9) in non critical path.
 1.26 11-Dec-2005  christos branches: 1.26.4; 1.26.6; 1.26.8; 1.26.10; 1.26.12;
merge ktrace-lwp.
 1.25 28-Aug-2004  thorpej branches: 1.25.12;
Use ANSI function decls, static, and const.
 1.24 17-Nov-2003  tsutsui TAB/space cleanup.
 1.23 27-Sep-2002  provos branches: 1.23.6;
remove trailing \n in panic(). approved perry.
 1.22 15-Mar-2002  gmcgarry malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.21 10-Feb-2002  gmcgarry Use LIST_INSERT_HEAD() to access the head on the interrupt list.
 1.20 08-Dec-2001  gmcgarry - rework data structures to align with generic soft interrupts interface
- shift event counters from locore
 1.19 12-Apr-2001  thorpej branches: 1.19.2; 1.19.8;
splimp -> splhigh when frobbing netisr.
 1.18 17-Jul-2000  scottr branches: 1.18.2;
Make this compile again: restore missing prototype.
 1.17 02-Jul-2000  cgd Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.
 1.16 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.15 21-Feb-2000  erh Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.
 1.14 01-Aug-1999  thorpej branches: 1.14.2;
Store computed PSL values in an array indexed by abstract interrupt
level, rather than individual shortwords.
 1.13 28-Jun-1999  itojun - Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.
 1.12 24-Mar-1999  mrg branches: 1.12.4; 1.12.6;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.11 12-Aug-1998  scottr Fix a prototype tyop spotted by Bill Studenmund: s/clnintr/clnlintr/
 1.10 07-Jul-1998  thorpej Loop until all netisrs are consumed; netisrs processed down the list might
cause additional netisrs to be scheduled.
 1.9 05-Jul-1998  jonathan defopt NS, NSIP.
 1.8 05-Jul-1998  jonathan defopt ISO TPIP.
 1.7 05-Jul-1998  jonathan defopt CCITT.
 1.6 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.5 16-Feb-1998  thorpej Add support for UVM.
 1.4 13-Nov-1997  veego Add a missing #if NARP > 0 around arpintr(); and add a #include "arp.h"
for NARP. This is for the 'new' arp system.
 1.3 09-Oct-1997  jtc branches: 1.3.2;
Fix tipo inherited from old version of TNF copyright template.
 1.2 01-May-1997  thorpej branches: 1.2.4;
Correct a comment long since outdated.
 1.1 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.2.1 15-Nov-1997  mellon Pull rev 1.4 up from trunk (veego)
 1.12.6.2 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.12.6.1 28-Jun-1999  itojun KAME/NetBSD 1.4 SNAP kit, dated 19990628.

NOTE: this branch (kame) is used just for refernce. this may not compile
due to multiple reasons.
 1.12.4.2 02-Aug-1999  thorpej Update from trunk.
 1.12.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.14.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.14.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.18.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.19.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.19.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.19.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.19.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.19.8.1 12-Apr-2001  nathanw file intr.c was added on branch nathanw_sa on 2002-01-08 00:24:40 +0000
 1.19.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.19.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.19.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.23.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.23.6.2 03-Sep-2004  skrll Sync with HEAD
 1.23.6.1 03-Aug-2004  skrll Sync with HEAD
 1.25.12.4 07-Dec-2007  yamt sync with head
 1.25.12.3 03-Sep-2007  yamt sync with head.
 1.25.12.2 30-Dec-2006  yamt sync with head.
 1.25.12.1 21-Jun-2006  yamt sync with head.
 1.26.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.26.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.26.8.2 11-Aug-2006  yamt sync with head
 1.26.8.1 01-Apr-2006  yamt sync with head.
 1.26.6.1 22-Apr-2006  simonb Sync with head.
 1.26.4.1 09-Sep-2006  rpaulo sync with head
 1.28.6.1 06-Oct-2006  tsutsui Reorganize IPL macros for proper splraiseipl() implementation:
- merge HP300_IPL_* and IPL_* macros
- prepare independent _IPL_SOFT_* macro to determine softintr(9) handlers
- rename hp300_ipls[] array to hp300_ipl2psl[]
- then use these macro for makeiplcookie() and splraiseipl()
Tested on HP382.
 1.28.4.1 12-Jan-2007  ad Sync with head.
 1.29.14.1 22-May-2007  matt Update to HEAD.
 1.29.8.1 11-Jul-2007  mjf Sync with head.
 1.29.6.3 03-Dec-2007  ad Sync with HEAD.
 1.29.6.2 03-Dec-2007  ad Sync with HEAD.
 1.29.6.1 27-May-2007  ad Sync with head.
 1.30.10.2 09-Jan-2008  matt sync with HEAD
 1.30.10.1 06-Nov-2007  matt sync with HEAD
 1.30.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.31.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.33.18.2 04-May-2009  yamt sync with head.
 1.33.18.1 16-May-2008  yamt sync with head.
 1.33.16.2 17-Jun-2008  yamt sync with head.
 1.33.16.1 18-May-2008  yamt sync with head.
 1.33.14.3 17-Jan-2009  mjf Sync with HEAD.
 1.33.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.33.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.34.4.2 27-Jun-2008  simonb Sync with head.
 1.34.4.1 18-Jun-2008  simonb Sync with head.
 1.34.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.37.6.2 27-Dec-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #207):
sys/arch/hp300/include/intr.h: revision 1.32
sys/arch/hp300/hp300/locore.s: revision 1.145
sys/arch/hp300/hp300/intr.c: revision 1.39
Remove obsolete code for old software interrupt emulation.
The MI softint(9) handles it in the kernel threads nowadays.
Note "Emulation of VAX REI instruction" is still there to handle ASTs.
 1.37.6.1 27-Dec-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #207):
sys/arch/hp300/hp300/locore.s: revision 1.144
sys/arch/hp300/hp300/intr.c: revision 1.38
Account idepth in locore.s.
 1.37.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.39.6.1 05-Mar-2011  rmind sync with head
 1.40.34.2 06-Feb-2016  snj Pull up following revision(s) (requested by tsutsui in ticket #1093):
sys/arch/hp300/hp300/intr.c: revision 1.42
Fix fatal "intr_dispatch: stray level 6 interrupt" panic by the GENERIC
kernel on machines without arcofi(4) audio (i.e. all hp300 except HP425e).
I failed to pull all necessary changes for arcofi(4) from OpenBSD
and I should have tested 7.0_RC kernels on my HP382 too :-(
Should be pulled up to netbsd-7 and netbsd-7-0.
 1.40.34.1 29-Aug-2014  martin branches: 1.40.34.1.2;
Pull up following revision(s) (requested by tsutsui in ticket #62):
sys/arch/hp300/conf/files.hp300: revision 1.89
share/man/man4/arcofi.4: revision 1.1
share/man/man4/arcofi.4: revision 1.2
share/man/man4/Makefile: revision 1.617
sys/arch/hp300/hp300/intr.c: revision 1.41
sys/conf/files: revision 1.1100
sys/arch/hp300/hp300/locore.s: revision 1.171
distrib/sets/lists/man/mi: revision 1.1486
sys/dev/ic/arcofivar.h: revision 1.1
sys/arch/hp300/conf/majors.hp300: revision 1.26
sys/arch/hp300/dev/arcofi_dio.c: revision 1.1
sys/arch/hp300/conf/GENERIC: revision 1.188
sys/dev/ic/arcofi.c: revision 1.1
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.
The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.
The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
Add a man page for arcofi(4) driver. From OpenBSD.
Fix date.
 1.40.34.1.2.1 06-Feb-2016  snj Pull up following revision(s) (requested by tsutsui in ticket #1093):
sys/arch/hp300/hp300/intr.c: revision 1.42
Fix fatal "intr_dispatch: stray level 6 interrupt" panic by the GENERIC
kernel on machines without arcofi(4) audio (i.e. all hp300 except HP425e).
I failed to pull all necessary changes for arcofi(4) from OpenBSD
and I should have tested 7.0_RC kernels on my HP382 too :-(
Should be pulled up to netbsd-7 and netbsd-7-0.
 1.40.18.1 03-Dec-2017  jdolecek update from HEAD
 1.41.2.1 19-Mar-2016  skrll Sync with HEAD
 1.42.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.43.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.8 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.7 02-Apr-1997  christos Add netatalk netisr
 1.6 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.5 09-Dec-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.4 09-Dec-1996  thorpej Dynamically compute the PSL value for spl{bio,net,tty,imp}() calls.
 1.3 13-Oct-1996  christos backout previous kprintf changes
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 14-Feb-1996  thorpej New interrupt handling code. Highlights:
- Interrupt service routines now take a pointer to
the device's softc, rather than a unit number.
- Interrupt handling code in locore.s condensed. Only
remaining "special" handlers are lev0 (spurious),
lev1 (HIL; don't ask), lev6 (clock), and lev7 (NMI).
Only remaining hard-coded device driver reference in
locore is HIL. (clock doesn't count...)
- "dcafastservice" eliminated. DCA driver has new mechanism
to guarantee prompt interrupt service at any ipl (not
just level 5).
- Interrupt code pulled out of autoconf.c and machdep.c and
placed in new file, isr.c
 1.8 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.7 09-Dec-1996  thorpej Dynamically compute the PSL value for spl{bio,net,tty,imp}() calls.
 1.6 28-Feb-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.5 14-Feb-1996  thorpej New interrupt handling code. Highlights:
- Interrupt service routines now take a pointer to
the device's softc, rather than a unit number.
- Interrupt handling code in locore.s condensed. Only
remaining "special" handlers are lev0 (spurious),
lev1 (HIL; don't ask), lev6 (clock), and lev7 (NMI).
Only remaining hard-coded device driver reference in
locore is HIL. (clock doesn't count...)
- "dcafastservice" eliminated. DCA driver has new mechanism
to guarantee prompt interrupt service at any ipl (not
just level 5).
- Interrupt code pulled out of autoconf.c and machdep.c and
placed in new file, isr.c
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4 05-May-1997  thorpej Garbage-collect old KGDB code that is no longer used.
 1.3 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.4 03-Nov-2002  chs merge all the m68k copies of kgdb_machdep.c.
 1.3 15-Mar-2002  gmcgarry Add RCSIDs.
 1.2 20-Aug-1998  kleink branches: 1.2.26; 1.2.30;
vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.1 05-May-1997  thorpej New-style kgdb_machdep.c, mostly duplicated from the sun3 port, modified
slightly by me.
 1.2.30.2 11-Nov-2002  nathanw Catch up to -current
 1.2.30.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.26.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3 05-May-1997  thorpej Garbage-collect old KGDB code that is no longer used.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.8 05-May-1997  thorpej Garbage-collect old KGDB code that is no longer used.
 1.7 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.6 13-Oct-1996  christos backout previous kprintf changes
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 07-Sep-1996  mycroft Use SIGBUS iff we get a legitimate bus fault. Use SIGSEGV for page protection
violations (per Solaris, SVR4, AIX, Linux, Irix, and SunOS).
 1.3 12-Apr-1995  mycroft More UPAGES --> USPACE.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.5 05-May-1997  thorpej Pull the LED frobbing code out of machdep.c. Since there is more than
one LED on an hp300 SPU, rename the file to indicate plurality.
 1.4 05-Oct-1996  thorpej Prototype ledcontrol().
 1.3 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.20 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.19 06-Jan-2011  tsutsui branches: 1.19.2; 1.19.4;
Move VA allocation of ledbase to leds.c just before pmap_enter(9)
to reduce MD quirk in pmap_bootstrap.c.
 1.18 04-Mar-2007  christos branches: 1.18.66;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.17 24-Dec-2005  perry branches: 1.17.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.16 11-Dec-2005  christos merge ktrace-lwp.
 1.15 02-Jan-2005  tsutsui branches: 1.15.10;
u_intNN_t -> uintNN_t
 1.14 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.13 17-Nov-2003  tsutsui TAB/space cleanup.
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 15-Mar-2002  gmcgarry branches: 1.11.12;
Add RCSIDs.
 1.10 26-Dec-2001  thorpej Multi-line string literals are not in ANSI C; don't use them.
 1.9 10-Sep-2001  chris branches: 1.9.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.8 24-Apr-2001  thorpej branches: 1.8.2; 1.8.4;
Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.7 29-Jun-2000  mrg branches: 1.7.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.6 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.5 15-Jun-1999  kleink branches: 1.5.2; 1.5.4; 1.5.8;
Slightly rearrange the inline assembly in ledcontrol() to avoid frobbing a
C symbol name prefix.
 1.4 26-Mar-1999  mycroft branches: 1.4.4;
Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.3 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.2 21-Mar-1998  scottr Charles Hannum pointed out that if a clock interrupt was posted while
we were in ledcontrol(), the heartbeat twinkler would just punt on
updating the LED even though it had already updated the status. (This
was broken in v1.73 of locore.s).

Rather than resurrect the old code, simplify ledcontrol() and don't
bother with mutual exclusion. As mentioned by the comments describing
this function, we really don't need to be that precise. We do, however,
want to guarantee instructions that modify the status variable directly,
so the function is now primarily inline assembly.
 1.1 05-May-1997  thorpej branches: 1.1.8;
Pull the LED frobbing code out of machdep.c. Since there is more than
one LED on an hp300 SPU, rename the file to indicate plurality.
 1.1.8.1 05-May-1998  mycroft Pull up 1.2, per request of scottr.
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.4.1 15-Nov-1999  fvdl Sync with -current
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.8.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.9.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.9.4.1 10-Sep-2001  nathanw file leds.c was added on branch nathanw_sa on 2002-01-08 00:24:40 +0000
 1.11.12.5 17-Jan-2005  skrll Sync with HEAD.
 1.11.12.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.12.3 18-Sep-2004  skrll Sync with HEAD.
 1.11.12.2 03-Sep-2004  skrll Sync with HEAD
 1.11.12.1 03-Aug-2004  skrll Sync with HEAD
 1.15.10.2 03-Sep-2007  yamt sync with head.
 1.15.10.1 21-Jun-2006  yamt sync with head.
 1.17.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.18.66.1 05-Mar-2011  rmind sync with head
 1.19.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.19.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.4 29-Dec-2007  tsutsui branches: 1.4.32; 1.4.38; 1.4.40;
Remove __P().
 1.3 11-Dec-2005  christos branches: 1.3.50; 1.3.56; 1.3.64;
merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 05-May-1997  thorpej branches: 1.1.56;
Pull the LED frobbing code out of machdep.c. Since there is more than
one LED on an hp300 SPU, rename the file to indicate plurality.
 1.1.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.56.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.1 21-Jan-2008  yamt sync with head
 1.3.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.3.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.3.50.1 09-Jan-2008  matt sync with HEAD
 1.4.40.1 17-Feb-2011  bouyer Sync with HEAD
 1.4.38.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.32.1 05-Mar-2011  rmind sync with head
 1.186 04-Feb-2024  andvar fix tripple/quadruple "r" letter typos in comments and log messages.
 1.185 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.184 17-Jan-2024  thorpej Make sigcode.s and sunos_sigcode.s build as their own stand-alone files.
 1.183 17-Jan-2024  thorpej Make compat_13_sigreturn13.s and compat_16_sigreturn14.s build as their
own stand-alone files and G/C the now-empty sigreturn.s.
 1.182 16-Jan-2024  thorpej Build m68k/support.s on its own; don't include it from locore.s
 1.181 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.180 13-Jan-2024  thorpej Switch hp300 over to the common m68k vector table.
 1.179 09-Jan-2024  thorpej Statically-initialize the '851 / '030 protorp with MMU51_SRP_BITS. In
pmap_init(), re-initialize protorp with MMU51_CRP_BITS. Remove the now-
redundant code that does this in each of the m68k platforms.
 1.178 09-Jan-2024  thorpej Remove duplicated / slightly-tweaked loadustp() (load user segment table)
routines from all of the m68k ports using the shared pmap. Instead, in
pmap_init(), set up a function pointer to the appropriate mmu_load_urp*()
function in mmu_subr.s.
 1.177 27-Dec-2023  thorpej Stop using magic numbers for the MMU root pointer attributes and the
Translation Control register, and also get rid of "#if PGSHIFT == ..."
where those magic numbers are used.

Instead, define new macros: MMU51_SRP_BITS, MMU51_CRP_BITS, MMU51_TCR_BITS,
and MMU40_TCR_BITS, in terms of the definitions in mmu_{40,51}.h. These
automagically adapt to 8K and 4K pages based on the machine-specific value
of PGSHIFT.
 1.176 26-Dec-2023  thorpej G/C unused ploadw().
 1.175 25-Dec-2023  thorpej loadustp(): Optimize for the overwhelmingly common case of "not the HP MMU".
Rather than converting the level 1 table address to a page number before
calling loadustp() only to have loadustp() convert it back to an address
for the '851, '030, '040, and '060, instead pass the address and convert
to a page number only in the case of the HP MMU.

This is a wash on HP MMU machines (9000/320 and 9000/350), and saves at
least 4 instructions (2x moveq + 2x lsXl) on every context switch on
everything else.
 1.174 14-Oct-2023  tsutsui Remove ancient and obsolete #if blocks.
 1.173 30-May-2022  andvar branches: 1.173.4;
s/identifing/identifying/ and s/multipler/multiplier/ in comments.
 1.172 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.171 24-Aug-2014  tsutsui branches: 1.171.18; 1.171.20;
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.

The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.

The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
 1.170 15-Mar-2014  tsutsui branches: 1.170.4;
Use common m68k/busaddrerr.s for bus error and address error handlers.

No binary changes on GENERIC.
 1.169 09-Mar-2014  tsutsui Remove an instruction for nonexistent 060 branch prediction error accounting.

It's amiga and atari specific and copied from amiga/locore.s
to mac68k/locore.s in rev 1.80, then pasted into other ports.
Note this is harmless because all these ports don't have 68060 variants
(i.e. it's inside #if defined(M68060) block) and mvme68k (which has 68060)
has removed it since the initial import.
 1.168 09-Mar-2014  tsutsui Remove unused m68k_fault_addr, which is required only on mac68k for SBC.

It looks hp300 one was copied from mac68k in rev 1.75
and then it was pasted to other ports again and again.
 1.167 31-Jan-2014  tsutsui defined(LKM) -> defined(MODULAR)
 1.166 16-Aug-2013  tsutsui Make FPU_EMULATE work on NetBSD/hp300. Commented out by default in GENERIC.

Tested on HP9000/362 without optional MC68882 FPU in its socket.
 1.165 22-Dec-2011  tsutsui branches: 1.165.6; 1.165.10;
Merge m68881_save() and m68881_restore() (using most common mvme68k ones).
All functions are checked by my eyes, and all GENERIC kernels compile.
 1.164 26-Nov-2011  tsutsui branches: 1.164.2;
Make sure to call pflusha before (not after) enabling MMU on
68030/68851 initialization paths.

Pointed out by isaki@ per observation of ATC status on XM6i emulator.
Tested on TT030, HP362, NWS-1750, and X68030 by me.

XXX: probably we can remove existing pflusha or TBIA calls after MMU turned
XXX: on (and before enabling cache) but I leave them as is for now to avoid
XXX: unexcpected side effects.
 1.163 15-Nov-2011  tsutsui Move spread getsfc() and getdfc() functions into common m68k/support.s.

Note:
- ENTRY_NOPROFILE() is okay since they are used only for debug printf
- they are declared to return int so no need to put a return value into %a0
 1.162 05-Nov-2011  tsutsui bgt -> jgt for a short jump.
 1.161 04-Nov-2011  tsutsui Fix indent and some comments.
 1.160 03-Nov-2011  tsutsui unifdef __ELF__
 1.159 06-Mar-2011  tsutsui branches: 1.159.4;
Remove trailing spaces.
 1.158 06-Jan-2011  tsutsui branches: 1.158.2;
Move bootinfo address initialization to locore.s and machdep.c
to reduce MD quirks in pmap_bootstrap.c.
Also print bootinfo_pa in consinit() so that we can see
at least MMU is properly enabled after boot.

Tested on HP382.
 1.157 27-Dec-2010  tsutsui Fix typo (and pasted lines). From OpenBSD.
 1.156 27-Dec-2010  tsutsui With a quick test, HP9000/362 doesn't seem to have frodo utility chip,
so probe code to identify HP362 taken from OpenBSD has never worked.

Identify HP362 by probing device IDs of the on-board framebuffer instead.

---

>> NetBSD/hp300 Primary Boot, Revision 1.16 (from NetBSD 5.99.41)
>> HP 9000/362 SPU
>> Enter "reset" to reset system.
Boot: [[[sd0a:]netbsd][-a][-c][-d][-s][-v][-q]] :-
2836828+148212 [343504+216292]=0x361b24
Start @ 0xff003400 [1=0xff2dac50-0x361b24]...
Entry point: 0xff003400
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 5.99.41 (GENERIC) #135: Mon Dec 27 23:30:21 JST 2010
tsutsui@mirage:/usr/src/sys/arch/hp300/compile/GENERIC
HP 9000/362 (25MHz MC68030 CPU+MMU, 25MHz MC68882 FPU)
total memory = 16372 KB
avail memory = 11480 KB
:
 1.155 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.154 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.153 25-Feb-2010  skrll branches: 1.153.2;
s/cpu_fork/cpu_lwp_fork/ in comment.
 1.152 13-Dec-2009  tsutsui branches: 1.152.2;
Replace a couple of magic numbers with proper macro.
 1.151 13-Dec-2009  tsutsui Now we have Sysseg_pa value so no need to calculate it from KVA Sysseg.
Tested on hp300.

XXX: mac68k seems to have a different VA vs PA mechanism so I leave it for now.
 1.150 12-Dec-2009  tsutsui Allow NetBSD/hp300 kernel work with PGSHIFT==13, i.e. 8KB/page.
Tested on HP9000/382 with 68040.

XXX: 8KB/page won't work on HP MMU machines (i.e. HP320 and HP350).
 1.149 11-Dec-2009  tsutsui Move uvm_setpagesize() calls from locore.s to pmap_bootstrap_finalize().
Also explicitly set uvmexp.pagesize to prepare 8KB/page settings.

XXX: There is #ifdef !defined(amiga) && !defined(atari) workaround
XXX: because they have different pmap initialization functions.
 1.148 02-Dec-2009  tsutsui Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on HP9000/382.
 1.147 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.146 11-Jan-2009  tsutsui Fix inverted logic on FPU type check in fpfault(). From OpenBSD.
 1.145 21-Dec-2008  tsutsui Remove obsolete code for old software interrupt emulation.
The MI softint(9) handles it in the kernel threads nowadays.

Note "Emulation of VAX REI instruction" is still there to handle ASTs.
 1.144 21-Dec-2008  tsutsui Account idepth in locore.s.
 1.143 28-Jan-2008  tsutsui branches: 1.143.6; 1.143.10; 1.143.18; 1.143.20;
- account idepth in a clock interrupt handler too
- use idepth for CLKF_INTR()
 1.142 07-Jan-2008  joerg Garbage collect !__HAVE_TIMECOUNTER code.
 1.141 17-Oct-2007  garbled branches: 1.141.2; 1.141.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.140 12-Jun-2007  mhitch branches: 1.140.10;
Pass a frame pointer to trap() rather than the 'entire frame' trick. Gcc4
was optimizing away modifications to the frame contents (it's not nice to
trick gcc). Pass the pointer as the first argument to reduce the number
of places that would be changed otherwise. Fixes the getcwd regression
test on most m68k ports.
 1.139 18-May-2007  tsutsui Adapt hp300 to yamt-idlelwp. Tested on 9000/382.
 1.138 09-Sep-2006  tsutsui branches: 1.138.4; 1.138.10; 1.138.12; 1.138.18; 1.138.20;
Switch hp300 to timecounter with MC6840 interval timer, which is
used for hardclcok(9). Old code is still left for reference.

XXX: possibly problematic if hardclock(9) is blocked more than 1/HZ,
XXX: but old microtime(9) implementation also had the similar problem.
 1.137 20-Jul-2006  tsutsui branches: 1.137.4;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.136 11-Dec-2005  christos branches: 1.136.4; 1.136.8;
merge ktrace-lwp.
 1.135 31-May-2005  chs branches: 1.135.2;
remove vestigal {,e}intr{names,cnt} symbols now that vmstat doesn't need them.
 1.134 04-Mar-2004  nathanw Centralize identical copies of proc_trampoline code.

(lots more opportunites here for the bored hacker, such as rei and trap0...)
 1.133 17-Nov-2003  tsutsui TAB/space cleanup.
 1.132 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.131 23-Jun-2003  martin branches: 1.131.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.130 27-Apr-2003  ragge Preserve the symbol table in the LKM || KSYMS cases also.
 1.129 08-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.128 02-Feb-2003  wiz guarantee, not guarentee. Idea from miod@openbsd.
 1.127 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.126 22-Dec-2002  gmcgarry Make this compile with LOCK_DEBUG
 1.125 02-Nov-2002  chs branches: 1.125.4;
finish conversion to the common m68k cacheops:
add support for machine-specific flavors of the ops for off-chip caches.
many thanks to Izumi Tsutsui for his help with this.
 1.124 28-Aug-2002  gmcgarry RAS support for m68k.
 1.123 27-Jun-2002  gmcgarry Back out part of revision 1.20 which was causing PROM re-entry
to fail. Reported by Jarle Greipsland <jarle@uninett.no>.
 1.122 30-May-2002  thorpej Make this work with an ISO C preprocessor.
 1.121 19-May-2002  jdolecek branches: 1.121.2;
use 'jmp label:l' to force adressing to be absolute, rather than pc-relative
 1.120 15-Mar-2002  gmcgarry branches: 1.120.4;
Add RCSIDs.
 1.119 10-Feb-2002  gmcgarry Some assemblers will optimise addresses within .text into pc-relative
references. Bogus for our MMU trampoline code which is relocated to
the last physical page before being invoked. This hack enforces all
addresses wrt the MMU trampoline code not to be pc-relative.
 1.118 08-Dec-2001  gmcgarry - shift event counters to intr.c
- use new event counters
- align comments
 1.117 17-Nov-2001  gmcgarry Make hil interrupts come through the standard dispatch mechanism rather
than its custom handler.
 1.116 22-Jul-2001  wiz branches: 1.116.6;
seperate -> separate
 1.115 11-Jun-2001  chs branches: 1.115.2;
make this compile with DEBUG.
 1.114 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.113 12-May-2001  kleink Update to reflect that unlike in m68k a.out environments, where the .align
directive is given a log2 argument, .align is given a linear argument in
m68k ELF environments.
 1.112 26-Nov-2000  jdolecek branches: 1.112.2;
split m68k SunOS and SVR4-specific sigcode.s code to sunos_sigcode.s
and svr4_sigcode.s respectively
adjust individual m68k port's locore.s to include new sigcode files if
appropriate
 1.111 21-Nov-2000  tsutsui Define proper macros for FP frame offsets rather than magic numbers.
 1.110 20-Aug-2000  thorpej Add a lock around the scheduler, and use it as necessary, including
in the non-MULTIPROCESSOR case (LOCKDEBUG requires it). Scheduler
lock is held upon entry to mi_switch() and cpu_switch(), and
cpu_switch() releases the lock before returning.

Largely from Bill Sommerfeld, with some minor bug fixes and
machine-dependent code hacking from me.
 1.109 31-May-2000  thorpej Add a comment on single-processor systems about p_cpu being initialized
by fork1().
 1.108 26-May-2000  thorpej branches: 1.108.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

- Global state: sched_qs (run queues), sched_whichqs (bitmap
of non-empty run queues), sched_slpque (sleep queues).
NOTE: These may collectively move into a struct schedstate
at some point in the future.

- Per-CPU state, struct schedstate_percpu: spc_runtime
(time process on this CPU started running), spc_flags
(replaces struct proc's p_schedflags), and
spc_curpriority (usrpri of processes on this CPU).

- Every platform must now supply a struct cpu_info and
a curcpu() macro. Simplify existing cpu_info declarations
where appropriate.

- All references to per-CPU scheduler state now made through
curcpu(). NOTE: this will likely be adjusted in the future
after further changes to struct proc are made.

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
 1.107 26-May-2000  thorpej Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor. Test against SONPROC as appropriate rather than
combinations of SRUN and curproc. Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
 1.106 14-May-2000  minoura defopt FPSP.
 1.105 14-Dec-1999  thorpej Add a bootinfo facility, as is used on i386 and pmax, ports. We expect
the bootinfo to be located in the first page of kernel text (which has
been zero-filled for a Very Long Time to allow us to unmap KVA 0); the
boot loader will place it there after loading the kernel image.
 1.104 10-Nov-1999  thorpej Add register prefixes that I missed before.
 1.103 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.102 24-Oct-1999  thorpej Next sweep: stack pointers, FP regs, and several control registers.
 1.101 24-Oct-1999  thorpej Next sweep of adding register prefix: %d0 - %d7.
 1.100 21-Oct-1999  thorpej First sweep of adding register prefix: %a0 - %a7.
 1.99 17-Sep-1999  thorpej branches: 1.99.2; 1.99.4; 1.99.6;
Centralize the declaration and clearing of `cold'.
 1.98 01-Aug-1999  thorpej Make sure the branch target of the delay loop is aligned to a cache
half-line (8-byte) boundary. Inspired by a discussion w/ Scott Reynolds.
 1.97 31-Jul-1999  thorpej Identify the 385 and 425e. Partially from OpenBSD.
 1.96 01-May-1999  kleink Fix a label name botch introduced in rev. 1.92; Ignatios owes me a non-beer.
 1.95 29-Apr-1999  christos Include opt_compat_sunos.h
 1.94 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.93 24-Mar-1999  mrg branches: 1.93.2;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.92 25-Feb-1999  is hp300 part of the fix for pr 6152
 1.91 11-Nov-1998  thorpej Changes to support fork_kthread():
- cpu_set_kpc() now takes void *arg third argument, passed to the
entry point.
- cpu_fork() allows parent to be non-curproc iff parent is proc0.
When forking non-curproc, assume its state has already been saved.
- Adjust various pieces of machine-dependent code to account of all of this.
 1.90 30-Sep-1998  thorpej Garbage collect trap #1 and trap #2 handlers; they're moved to
trap_subr.s
 1.89 30-Sep-1998  thorpej Pull in opt_compat_netbsd.h
 1.88 09-Sep-1998  thorpej Adjust for the new "reaper" kernel thread: do not free the vmspace and
u-area in machine-dependent code. Instead, call exit2() to schedule
the reaper to free them for us, once it is safe to do so (i.e. we are
no longer running on the dead proc's vmspace and stack).
 1.87 04-Jul-1998  jonathan defopt DDB.
 1.86 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.85 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.84 21-Mar-1998  scottr Optimize some cycles out of the clock interrupt handler when
USE_LEDS is defined.
 1.83 16-Feb-1998  thorpej Add support for UVM.
 1.82 05-Jan-1998  thorpej Fix a bogosity apparently inherited from when the Utah 4.3BSD code base
was converted to use Mach VM for Net2/4.4BSD. The user segment table
pointer was originally stored in the PCB. When Mach VM came along,
however, it was also stored in the pmap, and loaded into the PCB in
pmap_activate(). pmap_activate() would then note that the PCB's USTP
was now in sync with the pmap's USTP, and the low-level context switch
code would use the value from the PCB.

However, pmap_activate() would also load the hardware MMU context if
the pmap was the current pmap (or, in the case where pmaps can be shared,
such as in NetBSD, if the proc was the current proc). The low-level
context switch code would then reload the hardware _again_ using the
USTP from the PCB.

However, the optimization of not calling pmap_activate() if "stchanged"
was false ended up causing some processes to use stale USTP values from
the PCB when the low-level context switch code reloaded the hardware!
This was noticed by using a real vfork(2) (which worked for some time
before failing, surprisingly!)

Since I'm hard pressed to find any real optimization here (since the
hardware was always reloaded once, sometimes twice!), the code now always
calls pmap_activate(), which uses the correct USTP value (the one in the
pmap). The PCB's USTP is now ignored, and should eventually be g/c'd.

Another optimization can actually be performed, and I have added a comment
describing what it is, but have not yet implemented it.

Also note that most of the loadustp() functions where actually incomplete.
This has been corrected. These functions should probably be split up into
MMU-specific operations, and called indirectly, rather than doing constant
run-time decision making based on values that will never change during the
course of a boot's lifetime.
 1.81 31-Dec-1997  thorpej Make pmap_activate() and pmap_deactivate() take a struct proc *.
 1.80 12-Oct-1997  thorpej Consolidate some pre-main initialization into an hp300_init() function.
 1.79 12-Sep-1997  mycroft Fix a test that should be on fputype rather than cputype.
 1.78 12-Sep-1997  mycroft GC old comment.
 1.77 21-Aug-1997  scottr Make this compile again when we only specify a machine with the
HP MMU (320, 350).
 1.76 18-Aug-1997  scottr Fix typo in getting the 040 access fault address, noticed by
Allen Briggs in the mac68k locore.s
 1.75 14-Jul-1997  thorpej branches: 1.75.2;
New bus error/address error trap handlers, code lifted from mac68k
port, which is lifted from amiga port, plus some changes from me:
- Add support for the HP MMU to the 020/030 bus/address error handler
(mostly lifted wholesale from the old code).
- Rename addrerr and buserr to busaddrerr2030. The new name reflects that
these functions are specific to the 68020 and 68030, and that the same
handler function is used for both vectors.

The vector table is patched once we know our CPU type, before the MMU
is enabled. In the event that we're running on a CPU that we're not
configured for, simply invoke the PROM's "reboot request"; we have no
hope of running in the event of a config botch, since we need working
a working bus error handler for console initialization.

These new functions optimze for common-case page faults, eliminate
many run-time checks, and are sharable.
 1.74 13-May-1997  gwr Eliminate references to vmspace.vm_pmap
 1.73 05-May-1997  thorpej Update for USELEDS changes.
 1.72 27-Apr-1997  thorpej Uniquely identify 345 vs. 375 vs. 400 and 380 vs. 425, useful when
looking for hp4xx-only hardware during autoconfiguration. Code
mostly from Mike Smith, with a few changes by me.
 1.71 25-Apr-1997  thorpej - Don't make assumptions about how C labels are handled, use macros
provided by <machine/asm.h> instead.
- Adjust for <m68k/m68k/trap_subr.s>
 1.70 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.69 13-Apr-1997  thorpej Use common m68k sigcode.
 1.68 09-Apr-1997  thorpej Use <m68k/m68k/proc_subr.s>
 1.67 16-Mar-1997  thorpej Use <m68k/m68k/support.s>
 1.66 16-Mar-1997  thorpej Nuke MDP_HPUXTRACE.
 1.65 15-Mar-1997  thorpej - Garbage-collect doadump(); it hasn't been used for some time.
- Supply an `fputype' global. Since all hp300's have an FPU, default
it to FPU_68881, setting it to FPU_68040 if we detect a 68040 CPU.
- Use `fputype' at run-time rathern than FPCOPROC at compile-time.
- Re-arrange locore slightly; move startup code to the beginning, right
after the vector table.
 1.64 13-Mar-1997  thorpej Don't genassym the trap type values; just include <machine/trap.h>
 1.63 02-Feb-1997  thorpej - Eliminate some unnecessary cpu/mmu checks, based on what CPUs
the kernel was compiled for.
- Add some comments about possible further optimization.
- Garbage-collect extra copypage()
 1.62 06-Nov-1996  cgd Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed. Rename remrq() to
remrunqueue().
 1.61 14-Oct-1996  thorpej Garbage collect the "kernel jump to zero" stuff. VA 0 is now invalid,
so the kernel will fault if the PC gets trashed like that.
 1.60 14-Oct-1996  thorpej Couple more small changes:
- Initialize proc0.p_addr just after setting up the kernel stack, to avoid
getting NULL pointers in trap(). Change suggested by Gordon Ross.
- Panic if main() returns.
- Tidy up a couple of comments.
 1.59 14-Oct-1996  thorpej A few small changes:
- Offset kernel text one page. Stash the PA of this offset page for
use later.
- Add a few comments.
- Free up some registers earlier in the initialization process.
- Use a `prototc' to set the Translation Control register, rather
than relying on a2 pointing just past the MMU trampoline in the
high page. (Suggested by Charles Hannum.)
- Set VBR to the kernel vector table just before turning on the MMU.
- Just before rebooting, set VBR to 0, which is what the BOOTROM expects
it to be.
 1.58 05-Oct-1996  thorpej Check for internal HP-IB in SYSFLAG much earlier (i.e. before the MMU
is turned on).
 1.57 05-Oct-1996  thorpej Handle kernel trace traps and breakpoints like the Sun3 port:
- Only pass user trace traps and breakpoints on to trap().
- Before entering the debugger, switch to a temporary
stack so that the debugger can alter the stack pointer.
- Add glue for KGDB (still not complete).
Clearly mark the MMU enable trampoline code.
 1.56 05-Oct-1996  thorpej Don't lower spl before calling main. For now, do it right before
calling hilinit(). Eventually, would like to enable them only after
autoconfiguration is finished.
 1.55 11-Sep-1996  thorpej Declare a `cputype' global, and set it as appropriate.
 1.54 23-Jun-1996  thorpej From Ignatios Souvatzis <is@NetBSD.ORG>:
- handle fpfault properly on the 68040
- properly distinguish between a bus error and an MMU fault
on systems with 68030 or 68851 MMUs
 1.53 17-May-1996  thorpej branches: 1.53.4;
Put the vector table _after_ the temp stack.
 1.52 17-May-1996  thorpej Couple of changes:

- New delay() function, modeled after sun3/mvme68k delay,
calibrated with a model's known cpu speed.
- Use the defined constants for machineid and ectype
when determining what kind of machine we have, rather
than their expanded equivalents, for clarity.
- Move the vector table to the data segment so that it
can be patched at run-time.
 1.51 16-May-1996  thorpej Add a "_kernel_text" symbol, for libkvm. From Gordon Ross.
 1.50 14-Feb-1996  thorpej New interrupt handling code. Highlights:
- Interrupt service routines now take a pointer to
the device's softc, rather than a unit number.
- Interrupt handling code in locore.s condensed. Only
remaining "special" handlers are lev0 (spurious),
lev1 (HIL; don't ask), lev6 (clock), and lev7 (NMI).
Only remaining hard-coded device driver reference in
locore is HIL. (clock doesn't count...)
- "dcafastservice" eliminated. DCA driver has new mechanism
to guarantee prompt interrupt service at any ipl (not
just level 5).
- Interrupt code pulled out of autoconf.c and machdep.c and
placed in new file, isr.c
 1.49 02-Feb-1996  mycroft assym.s -> assym.h
(Some ports did this already.)
 1.48 31-Jan-1996  thorpej Use the common sigreturn routine.
 1.47 16-Jan-1996  thorpej Remove all the old STACKCHECK stuff; it hasn't been used for a long time.
 1.46 11-Dec-1995  thorpej Rather than using individual HP300 model names, map those model names to
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.

In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.

Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
 1.45 11-Dec-1995  thorpej Move bcopy/ovbcopy/memcpy into m68/m68k/copy.s, which is used by all
m68k ports already anyhow. No use in keeping 6 identical copies of this
function around.
 1.44 08-Oct-1995  thorpej Remove the icode stuff; it hasn't been used in a long time.
 1.43 08-Oct-1995  thorpej Remove __main(), strlen(), bzero(), and bcmp(). They're all in libkern.
 1.42 10-Sep-1995  thorpej Add a memcpy() entry as suggested by Gordon Ross. Use <machine/asm.h>
where appropriate.
 1.41 25-May-1995  mycroft Make sure proc0's md_regs is initialized.
 1.40 12-May-1995  mycroft Add a child_return() function to clean up the child's state correctly, and
use this in cpu_fork(). Generalize proc_trampoline() so it can also be used in
this case.
 1.39 12-May-1995  mycroft main() should never return.
 1.38 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.37 12-Apr-1995  mycroft More UPAGES --> USPACE.
 1.36 08-Feb-1995  mycroft Remove fu/su functions.
 1.35 08-Feb-1995  mycroft Don't include copy.s from here.
 1.34 08-Feb-1995  mycroft Use common m68k version of copy.s.
 1.33 30-Dec-1994  hpeyerl Make the LEDS blink like Jason's heart. from <thorpej@cs.orst.edu>
 1.32 26-Oct-1994  cgd new RCS ID format.
 1.31 20-Oct-1994  mycroft Don't try to load p_priority from the run queue head.
 1.30 09-Sep-1994  mycroft Do a hack similar to the AST optimization for SIRs on syscall exit.
 1.29 09-Sep-1994  mycroft Very simple change to avoid a complete register save/restore pair when handling
ASTs after a syscall.
 1.28 09-Sep-1994  mycroft Remove some functions which are in libkern.
 1.27 09-Sep-1994  mycroft Optimize the run queue frobnication, and add some more DIAGNOSTIC checks.
 1.26 05-Jul-1994  mycroft branches: 1.26.2;
Redo the interface to FPSP, using the supplied glue code.
 1.25 03-Jul-1994  mycroft Switch to Motorola emulator.
 1.24 27-May-1994  mycroft Update RCS id.
 1.23 27-May-1994  mycroft Use 4.4 init bootstrapping method.
 1.22 24-May-1994  mycroft New copy*() functions, cloned from the appropriate functions in libc. Handles
>64k lengths correctly.
 1.21 23-May-1994  mycroft Copy copyinstr() from m68k generic, to deal with len > 64k. XXX I think this
code is buggy.
 1.20 23-May-1994  mycroft Merge with 4.4-Lite.
 1.19 20-May-1994  mycroft swtch() --> cpu_switch()
 1.18 13-May-1994  mycroft Keeping up with the Chrises...
 1.17 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.16 05-Feb-1994  mycroft Simplify calling sequences for hardclock() and profclock().
 1.15 04-Feb-1994  mycroft Reorder clockframe.
 1.14 04-Feb-1994  mycroft Fix comments
 1.13 04-Feb-1994  mycroft Pass a frame pointer to profclock(), too.
 1.12 04-Feb-1994  mycroft Pass a pointer to hardclock()...
 1.11 30-Jan-1994  mycroft Use esym now. Note this *requires* using the NetBSD boot block.
 1.10 30-Jan-1994  mycroft Don't rely on esym being passed in until I am impressed enough with the new
boot program to switch.
 1.9 30-Jan-1994  mycroft Remove functions that are defined in libkern or m68k/copy.s.
 1.8 26-Jan-1994  brezak Deal with DDB symbol table loaded by bootstrap
 1.7 13-Jan-1994  mycroft Add a variable (currently unused in this port) to make DDB happy.
 1.6 06-Dec-1993  mycroft Change the address calculations in icode to match current as.
 1.5 14-Aug-1993  mycroft The NetBSD assembler seems to want the old icode. Don't ask me.
 1.4 07-Aug-1993  mycroft This seems to fix the calculation of the file name and arg string pointers
in icode.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.26.2.2 20-Oct-1994  mycroft Update from trunk.
 1.26.2.1 06-Oct-1994  mycroft Update from trunk.
 1.53.4.1 25-Jun-1996  jtc Pulled up by request from Jason Thorpe
 1.75.2.3 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.75.2.2 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.75.2.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.93.2.1 30-Apr-1999  perry branches: 1.93.2.1.2;
pullup 1.94->1.95 (christos): conflicts manually edited
 1.93.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.93.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.99.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.99.4.1 15-Nov-1999  fvdl Sync with -current
 1.99.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.99.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.108.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.112.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.115.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.115.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.115.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.115.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.115.2.1 03-Aug-2001  lukem update to -current
 1.116.6.10 29-Dec-2002  thorpej Sync with HEAD.
 1.116.6.9 11-Nov-2002  nathanw Catch up to -current
 1.116.6.8 01-Aug-2002  nathanw Catch up to -current.
 1.116.6.7 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.116.6.6 20-Jun-2002  nathanw Catch up to -current.
 1.116.6.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.116.6.4 28-Feb-2002  nathanw Catch up to -current.
 1.116.6.3 08-Jan-2002  nathanw Catch up to -current.
 1.116.6.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.116.6.1 22-Jul-2001  scw file locore.s was added on branch nathanw_sa on 2001-11-18 18:09:32 +0000
 1.120.4.4 30-Aug-2002  gehenna catch up with -current.
 1.120.4.3 16-Jul-2002  gehenna catch up with -current.
 1.120.4.2 14-Jul-2002  gehenna catch up with -current.
 1.120.4.1 30-May-2002  gehenna Catch up with -current.
 1.121.2.1 27-Jun-2002  lukem Pull up revision 1.123 (requested by gmcgarry in ticket #384):
Back out part of revision 1.20 which was causing PROM re-entry
to fail. Reported by Jarle Greipsland <jarle@uninett.no>.
 1.125.4.1 18-Dec-2002  gmcgarry Remove the scheduler semantics from machine-dependent context switch.
 1.131.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.131.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.131.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.131.2.1 03-Aug-2004  skrll Sync with HEAD
 1.135.2.4 04-Feb-2008  yamt sync with head.
 1.135.2.3 21-Jan-2008  yamt sync with head
 1.135.2.2 03-Sep-2007  yamt sync with head.
 1.135.2.1 30-Dec-2006  yamt sync with head.
 1.136.8.2 14-Sep-2006  yamt sync with head.
 1.136.8.1 11-Aug-2006  yamt sync with head
 1.136.4.1 09-Sep-2006  rpaulo sync with head
 1.137.4.1 18-Nov-2006  ad Sync with head.
 1.138.20.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.138.18.2 26-Jun-2007  garbled Sync with HEAD.
 1.138.18.1 22-May-2007  matt Update to HEAD.
 1.138.12.1 11-Jul-2007  mjf Sync with head.
 1.138.10.2 15-Jul-2007  ad Sync with head.
 1.138.10.1 27-May-2007  ad Sync with head.
 1.138.4.1 18-Jun-2007  liamjfoy Pull up following revision(s) (requested by mhitch in ticket #728):
sys/arch/mvme68k/mvme68k/locore.s: revision 1.98
sys/arch/mac68k/mac68k/trap.c: revision 1.128
sys/arch/next68k/next68k/locore.s: revision 1.48
sys/arch/mac68k/mac68k/locore.s: revision 1.152
sys/arch/sun3/sun3/locore.s: revision 1.88
sys/arch/sun2/sun2/locore.s: revision 1.19
sys/arch/sun2/sun2/trap.c: revision 1.32
sys/arch/m68k/m68k/db_trace.c: revision 1.51
sys/arch/mvme68k/mvme68k/trap.c: revision 1.90
sys/arch/news68k/news68k/trap.c: revision 1.53
sys/arch/luna68k/luna68k/locore.s: revision 1.27
sys/arch/atari/atari/locore.s: revision 1.99
sys/arch/sun3/sun3/trap.c: revision 1.130
sys/arch/x68k/x68k/trap.c: revision 1.89
sys/arch/next68k/next68k/trap.c: revision 1.67
sys/arch/x68k/x68k/locore.s: revision 1.79
sys/arch/news68k/news68k/locore.s: revision 1.43
sys/arch/luna68k/luna68k/trap.c: revision 1.46
sys/arch/hp300/hp300/locore.s: revision 1.140
sys/arch/cesfic/cesfic/locore.s: revision 1.15
sys/arch/cesfic/cesfic/trap.c: revision 1.35
sys/arch/m68k/m68k/trap_subr.s: revision 1.12
sys/arch/amiga/amiga/locore.s: revision 1.143
Pass a frame pointer to trap() rather than the 'entire frame' trick. Gcc4
was optimizing away modifications to the frame contents (it's not nice to
trick gcc). Pass the pointer as the first argument to reduce the number
of places that would be changed otherwise. Fixes the getcwd regression
test on most m68k ports.
 1.140.10.3 23-Mar-2008  matt sync with HEAD
 1.140.10.2 09-Jan-2008  matt sync with HEAD
 1.140.10.1 06-Nov-2007  matt sync with HEAD
 1.141.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.141.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.143.20.2 27-Dec-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #207):
sys/arch/hp300/include/intr.h: revision 1.32
sys/arch/hp300/hp300/locore.s: revision 1.145
sys/arch/hp300/hp300/intr.c: revision 1.39
Remove obsolete code for old software interrupt emulation.
The MI softint(9) handles it in the kernel threads nowadays.
Note "Emulation of VAX REI instruction" is still there to handle ASTs.
 1.143.20.1 27-Dec-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #207):
sys/arch/hp300/hp300/locore.s: revision 1.144
sys/arch/hp300/hp300/intr.c: revision 1.38
Account idepth in locore.s.
 1.143.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.143.10.3 11-Aug-2010  yamt sync with head.
 1.143.10.2 11-Mar-2010  yamt sync with head
 1.143.10.1 04-May-2009  yamt sync with head.
 1.143.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.152.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.152.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.153.2.3 21-Apr-2011  rmind sync with head
 1.153.2.2 05-Mar-2011  rmind sync with head
 1.153.2.1 03-Jul-2010  rmind sync with head
 1.158.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.159.4.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.159.4.2 17-Apr-2012  yamt sync with head
 1.159.4.1 10-Nov-2011  yamt sync with head
 1.164.2.1 18-Feb-2012  mrg merge to -current.
 1.165.10.2 18-May-2014  rmind sync with head
 1.165.10.1 28-Aug-2013  rmind sync with head
 1.165.6.2 03-Dec-2017  jdolecek update from HEAD
 1.165.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.170.4.1 29-Aug-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #62):
sys/arch/hp300/conf/files.hp300: revision 1.89
share/man/man4/arcofi.4: revision 1.1
share/man/man4/arcofi.4: revision 1.2
share/man/man4/Makefile: revision 1.617
sys/arch/hp300/hp300/intr.c: revision 1.41
sys/conf/files: revision 1.1100
sys/arch/hp300/hp300/locore.s: revision 1.171
distrib/sets/lists/man/mi: revision 1.1486
sys/dev/ic/arcofivar.h: revision 1.1
sys/arch/hp300/conf/majors.hp300: revision 1.26
sys/arch/hp300/dev/arcofi_dio.c: revision 1.1
sys/arch/hp300/conf/GENERIC: revision 1.188
sys/dev/ic/arcofi.c: revision 1.1
Add new arcofi(4) audio driver for NetBSD/hp300, ported from OpenBSD.
The arcofi(4) is a driver for the HP "Audio1" device
(Siemens PSB 2160 "ARCOFI" phone quality audio chip)
found on the HP9000/425e and HP9000/{705,710,745,747} models
(but only hp300 attachment is ported for now).
The chip supports 8-bit mono 8kHz U-law, A-law and
16-bit mono slinear_be formats.
The old HP9000/425e playing tunes with this new arcofi(4) audio driver
was also demonstrated at Open Source Conference 2014 Shimane.
Add a man page for arcofi(4) driver. From OpenBSD.
Fix date.
 1.171.20.1 10-Jun-2019  christos Sync with HEAD
 1.171.18.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.173.4.1 27-Jun-2024  martin Pull up following revision(s) (requested by rin in ticket #724
to fix build fallout on the branch):

sys/arch/m68k/m68k/compat_16_sigreturn14.s: revision 1.6
sys/arch/mvme68k/mvme68k/locore.s: revision 1.129
sys/arch/news68k/news68k/locore.s: revision 1.84
sys/arch/hp300/hp300/locore.s: revision 1.183
sys/arch/m68k/m68k/compat_13_sigreturn13.s: revision 1.8
sys/arch/m68k/m68k/sigreturn.s: file removal
sys/arch/m68k/include/pte_motorola.h: revision 1.10
sys/arch/atari/atari/locore.s: revision 1.125
sys/arch/amiga/amiga/locore.s: revision 1.169
sys/arch/sun2/sun2/locore.s: revision 1.37
sys/arch/next68k/next68k/locore.s: revision 1.84
sys/arch/x68k/x68k/locore.s: revision 1.130
sys/arch/sun3/sun3x/locore.s: revision 1.77
sys/arch/cesfic/cesfic/locore.s: revision 1.45
sys/arch/m68k/conf/files.m68k: revision 1.53
sys/arch/sun3/sun3/locore.s: revision 1.109
sys/arch/luna68k/luna68k/locore.s: revision 1.81
sys/arch/mac68k/mac68k/locore.s: revision 1.182

Define PTE used in the pmap module int terms of the bit definitions
in mmu_{51,40}.h.

Make compat_13_sigreturn13.s and compat_16_sigreturn14.s build as their
own stand-alone files and G/C the now-empty sigreturn.s.
 1.240 21-Dec-2024  tsutsui Unifdef __ELF__.
 1.239 05-Mar-2024  thorpej branches: 1.239.2;
Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().

It's a small step, but it's a step.
 1.238 15-Jan-2023  tsutsui TAB/space cleanup.
 1.237 16-Oct-2022  tsutsui branches: 1.237.2;
Use complete cpu name strings for readability.
 1.236 09-Oct-2021  tsutsui Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.
 1.235 06-Aug-2021  tsutsui Add comments how mm_md_physacc() for hp300 works.

mm_md_physacc() for all other hp300 pmap based m68k ports that copied
hp300 implemantation should have been fixed properly.

XXX: no mm(9) man pages that describe MD implementation API definitions.
 1.234 11-Jun-2020  ad uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
 1.233 21-Apr-2020  tsutsui Fix garbages in dmesg caused by uninitialized variables slipped in r1.228.

Noticed in HP9000/362 dmesg:
https://dmesgd.nycbug.org/index.cgi?do=view&id=5459

Should be pulled up to netbsd-8 and netbsd-9.
 1.232 31-Dec-2019  ad branches: 1.232.6;
Rename uvm_free() -> uvm_availmem().
 1.231 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.230 14-Mar-2019  thorpej branches: 1.230.4;
G/C "MAPPECOPY". It is the deadest of wood, and never actually worked in
NetBSD.
 1.229 20-Apr-2014  tsutsui branches: 1.229.8; 1.229.18; 1.229.20; 1.229.28;
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.

The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.

Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.

Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).

XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
 1.228 24-Mar-2014  christos branches: 1.228.2;
- remove unused
- use cpu_{g,s}etmodel
 1.227 16-Aug-2013  tsutsui Make FPU_EMULATE work on NetBSD/hp300. Commented out by default in GENERIC.

Tested on HP9000/362 without optional MC68882 FPU in its socket.
 1.226 10-Aug-2012  tsutsui branches: 1.226.2; 1.226.4;
Appease gcc -fno-common:
- remove initialzation of physmem since it's properly initialized
before pmap_bootstrap() using a value passed from bootloader and
sanity possible maximum value is not necessary
Tested on HP382.
 1.225 27-Jul-2012  matt Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).
 1.224 12-Dec-2011  mrg branches: 1.224.2;
implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.
 1.223 12-Jun-2011  rmind branches: 1.223.2; 1.223.6;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.222 16-May-2011  tsutsui branches: 1.222.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.
 1.221 15-May-2011  tsutsui Misc KNF.
 1.220 10-May-2011  tsutsui Move intr_init() call from early hp300_init() to cpu_configure(9)
since interrupt functions would want evcnt(9).
 1.219 04-Mar-2011  joerg Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.218 09-Feb-2011  tsutsui NHIL is no more.
 1.217 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.216 06-Feb-2011  tsutsui Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.215 17-Jan-2011  tsutsui branches: 1.215.2;
Explicitly include <machine/pcb.h> for struct pcb.
 1.214 06-Jan-2011  tsutsui branches: 1.214.2;
Move pmap_aliasmask initialization from pmap_bootstrap.c
to machdep.c:hp300_init() before the first pmap(9) use.
 1.213 06-Jan-2011  tsutsui Move bootinfo address initialization to locore.s and machdep.c
to reduce MD quirks in pmap_bootstrap.c.
Also print bootinfo_pa in consinit() so that we can see
at least MMU is properly enabled after boot.

Tested on HP382.
 1.212 16-Oct-2010  tsutsui Prepare empty module_init_md() for options MODULAR.

XXX: Should we get rid of cpu_exec_aout_makecmds() for COMPAT_NOMID and
XXX: COMPAT_44? Who still keeps such rare ancient commands?
 1.211 08-Feb-2010  joerg branches: 1.211.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
 1.210 10-Dec-2009  matt branches: 1.210.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.
 1.209 21-Nov-2009  rmind Use lwp_getpcb() on hppa and ia64, clean from struct user usage.
 1.208 07-Nov-2009  cegger Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
 1.207 15-Aug-2009  matt Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for us.
 1.206 13-Feb-2009  apb Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
 1.205 21-Jan-2009  he branches: 1.205.2;
Re-adapt to the changed return types for major() and minor().
 1.204 11-Jan-2009  tsutsui Use PRIu64 to print 64 bit dev_t.
 1.203 30-Nov-2008  martin As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
 1.202 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.201 11-Nov-2008  dyoung It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks(). Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown(). No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown(). I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that. Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
 1.200 14-Sep-2008  tsutsui branches: 1.200.2;
Remove ancient workaround hacks for gcc 2.7.2.
 1.199 02-Jul-2008  ad branches: 1.199.2;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.198 31-Dec-2007  ad branches: 1.198.6; 1.198.10; 1.198.12; 1.198.14;
Remove COMPAT_HPUX.
 1.197 17-Oct-2007  garbled branches: 1.197.2; 1.197.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.196 09-Jul-2007  ad branches: 1.196.10;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.195 18-May-2007  tsutsui Adapt hp300 to yamt-idlelwp. Tested on 9000/382.
 1.194 05-Mar-2007  tsutsui branches: 1.194.2; 1.194.4; 1.194.10;
Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
 1.193 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.192 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.191 09-Feb-2007  ad branches: 1.191.2;
Merge newlock2 to head.
 1.190 24-Jan-2007  hubertf Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
 1.189 21-Oct-2006  mrg in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.
 1.188 21-Jul-2006  tsutsui branches: 1.188.4; 1.188.6;
Some KNF.
 1.187 20-Jul-2006  tsutsui Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.186 26-Mar-2006  tsutsui Make this compile with options PANICBUTTON.
 1.185 11-Dec-2005  christos branches: 1.185.4; 1.185.6; 1.185.8; 1.185.10; 1.185.12;
merge ktrace-lwp.
 1.184 30-Oct-2005  chs fix crash dumps on m68k platforms, cpu_kcore_hdr_t is larger than
512 bytes now so we need a bigger buffer. PR 26958.
 1.183 25-Apr-2005  lukem branches: 1.183.2; 1.183.4;
Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.
 1.182 12-Feb-2005  yamt branches: 1.182.4;
hp300 part of the following change,
which was missed due to a sticky tag in my local tree.
pointed by Izumi Tsutsui.

> remove uvm_map_protect from cpu_startup of several ports.
> - they shouldn't be needed with the current fault handler.
> - they causes assertion failure with the recent vm_map implementation.
>
> discussed on tech-kern@. reviewed by Chuck Silvers.
> PR/29179 from Julio M. Merino Vidal.
 1.181 02-Jan-2005  tsutsui branches: 1.181.2; 1.181.4;
u_intNN_t -> uintNN_t
 1.180 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.179 24-Mar-2004  atatat Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
 1.178 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.177 30-Dec-2003  pk Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
 1.176 04-Dec-2003  atatat Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
 1.175 17-Nov-2003  tsutsui TAB/space cleanup.
 1.174 27-Sep-2003  cl Cast through (void *) to appease gcc3.
 1.173 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.172 29-Jun-2003  fvdl branches: 1.172.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.171 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.170 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.169 23-Jun-2003  martin Make sure to include opt_foo.h if a defflag option FOO is used.
 1.168 10-May-2003  thorpej Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
 1.167 08-May-2003  thorpej Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
 1.166 26-Apr-2003  ragge Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.165 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.164 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.163 25-Sep-2002  thorpej Set extio_ex_malloc_safe at the end of cpu_startup().
 1.162 25-Sep-2002  thorpej Replace resource map usage with extent maps.
 1.161 19-Sep-2002  ragge Do not include <sys/clist.h>, it's not used in NetBSD at all.
 1.160 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.159 25-Aug-2002  thorpej Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
 1.158 23-May-2002  gmcgarry Clarify comment: cpu_startup() doesn't do autoconfiguration.
 1.157 20-Mar-2002  christos branches: 1.157.4;
kill remaining PS_STRINGS instances.
 1.156 15-Mar-2002  gmcgarry Add RCSIDs.
 1.155 06-Mar-2002  tsutsui Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.
 1.154 10-Feb-2002  gmcgarry Also don't print \n without DIAGNOSTIC.
 1.153 02-Feb-2002  gmcgarry Use pmap_kenter_pa() for msgbuf
 1.152 14-Dec-2001  gmcgarry Update the console attach interface now that bus_space is available.
Basically means that hardware drivers with console attachments are
now largely machine independent.
 1.151 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.150 17-Nov-2001  gmcgarry Convert hil to standard device attachment.
 1.149 16-Sep-2001  wiz branches: 1.149.4;
Spell 'occurred' with two 'r's.
 1.148 10-Sep-2001  chris Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.147 02-Jun-2001  chs branches: 1.147.2; 1.147.4;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.146 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.145 15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.144 02-Jan-2001  simonb branches: 1.144.2;
Add ELF support.

Thanks to Steve Woodford for his help!
 1.143 13-Sep-2000  thorpej Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.
 1.142 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.141 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.140 05-Jun-2000  jhawk Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)
 1.139 26-May-2000  thorpej branches: 1.139.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

- Global state: sched_qs (run queues), sched_whichqs (bitmap
of non-empty run queues), sched_slpque (sleep queues).
NOTE: These may collectively move into a struct schedstate
at some point in the future.

- Per-CPU state, struct schedstate_percpu: spc_runtime
(time process on this CPU started running), spc_flags
(replaces struct proc's p_schedflags), and
spc_curpriority (usrpri of processes on this CPU).

- Every platform must now supply a struct cpu_info and
a curcpu() macro. Simplify existing cpu_info declarations
where appropriate.

- All references to per-CPU scheduler state now made through
curcpu(). NOTE: this will likely be adjusted in the future
after further changes to struct proc are made.

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
 1.138 28-Mar-2000  simonb Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
 1.137 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.136 19-Jan-2000  thorpej Move callout initialization to a single location; no need to duplicate
that code all over the place.
 1.135 14-Dec-1999  thorpej Add a bootinfo facility, as is used on i386 and pmax, ports. We expect
the bootinfo to be located in the first page of kernel text (which has
been zero-filled for a Very Long Time to allow us to unmap KVA 0); the
boot loader will place it there after loading the kernel image.
 1.134 04-Dec-1999  ragge CL* discarding.
 1.133 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.132 17-Sep-1999  thorpej branches: 1.132.2; 1.132.4; 1.132.8;
Centralize the declaration and clearing of `cold'.
 1.131 12-Sep-1999  chs eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
 1.130 01-Aug-1999  thorpej Ooops, add a missing break.
 1.129 31-Jul-1999  thorpej Oops, forgot the HP_385 case in identifycpu().
 1.128 31-Jul-1999  thorpej Identify the 385 and 425e. Partially from OpenBSD.
 1.127 26-May-1999  thorpej Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.
 1.126 20-May-1999  lukem * convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes
 1.125 26-Apr-1999  thorpej Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.
 1.124 25-Apr-1999  simonb g/c REAL_CLISTS.
 1.123 11-Apr-1999  chs add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.
 1.122 01-Apr-1999  thorpej branches: 1.122.2;
Don't call configure() from cpu_startup().
 1.121 26-Mar-1999  mycroft Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.120 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.119 27-Feb-1999  scottr defopt BUFCACHE and BUFPAGES.
 1.118 09-Jan-1999  thorpej Garbage-collect `mbutl'.
 1.117 24-Nov-1998  kleink Add support for the BUFCACHE config option.
 1.116 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.115 18-Oct-1998  thorpej Need <sys/device.h>
 1.114 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.113 08-Jul-1998  thorpej Define one page free list, and put all pages on it.
 1.112 05-Jul-1998  jonathan * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID (from unsaved buffers).
TODO: revisit interaction between native compat and emul compat usage.
 1.111 04-Jul-1998  jonathan defopt DDB.
 1.110 01-Jul-1998  thorpej Make use the `end' consistent.
 1.109 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.108 09-Jun-1998  tv Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.
 1.107 26-Apr-1998  scottr GC the old MACHINE_NONCONTIG code.
 1.106 19-Feb-1998  thorpej Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.
 1.105 16-Feb-1998  thorpej Add support for UVM.
 1.104 08-Feb-1998  thorpej Implement MACHINE_NEW_NONCONTIG and switch the hp300 port to use it.
 1.103 24-Jan-1998  mycroft When dumping, print out the device number as major,minor.
 1.102 04-Dec-1997  tv Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.
 1.101 16-Oct-1997  carrel include vm/vm.h
move include of sysctl.h after vm.h
 1.100 12-Oct-1997  thorpej - Consolidate some pre-main initialization into an hp300_init() function.
- Initialize the message buffer earlier, in hp300_init(), rather than in
cpu_startup(), so that it's initialized before main() is called.
 1.99 05-Oct-1997  carrel Recognize sunos binaries
 1.98 19-Sep-1997  leo Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
 1.97 12-Sep-1997  mycroft Set the status word as well, and remove a bogus comment.
 1.96 12-Sep-1997  mycroft Always initialize all registers in setregs().
 1.95 11-Sep-1997  mycroft Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)
 1.94 12-Jun-1997  mrg branches: 1.94.4;
bring mrg-vm-swap2 onto mainilne.
 1.93 10-Jun-1997  veego s/hp300_round_page/m68k_round_page/ s/hp300_trunc_page/m68k_trunc_page/
 1.92 08-Jun-1997  veego Initialize machine from MACHINE.
 1.91 05-May-1997  thorpej Update for USELEDS changes (including: garbage-collect LED frobbing
code; it has moved to leds.c)
 1.90 27-Apr-1997  thorpej branches: 1.90.2;
Rewrite identifycpu() to be partially table-driven, and to be more
sane in general. Since we can uniquely identify each SPU type
(except for 318/319/330, because there _are_ no differences, really),
require that the appropriate SPU option be configured into the kernel.
 1.89 09-Apr-1997  thorpej - Garbage-collect signal-related stuff; use m68k/m68k/sig_machdep.c
- Garbage-collect regdump() and friends
- Convert hp300 to new crash dump format
 1.88 06-Apr-1997  mycroft Fix some #ifdef lossage if HP340, HP360, or HP375 is defined, but HP370 is not.
 1.87 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.86 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.85 27-Mar-1997  thorpej Don't allocate mclrefcnt[]; it's dead and gone.
 1.84 26-Mar-1997  gwr Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/
 1.83 16-Mar-1997  thorpej Remove the COMPAT_HPUX stuff from setregs(); the HP-UX compatibility
code has its own implementation now.
 1.82 16-Mar-1997  thorpej Move all COMPAT_HPUX signal code into hpux_sendsig() and hpux_sys_sigreturn().
 1.81 15-Mar-1997  thorpej Use `fputype' at run-time rather than FPCOPROC at compile-time.
 1.80 02-Feb-1997  thorpej branches: 1.80.2;
Clean up the mappedcopy initialization code.
 1.79 02-Feb-1997  thorpej If the user has halted the system, allow them to press a key to reboot.
 1.78 31-Jan-1997  carrel Make "options HP340" actually work without having "option HP360".
 1.77 11-Dec-1996  thorpej Clean up cpu_startup() a bit:
- move data structure allocation into a new function, allocsys(), like
the i386 port.
- garbage-collect the BUFFERS_UNMANAGED code.
 1.76 20-Oct-1996  thorpej Back out last change, and add a comment about what should happen.
(*grumble* will teach me to do a `make clean' next time.)
 1.75 19-Oct-1996  thorpej Don't need to mark 0-NBPG as VM_PROT_NONE in kernel_map anymore; the
first entry is now properly setup in kmem_init().
 1.74 19-Oct-1996  thorpej Set up a kernel_map entry for the text segment with protection of
VM_PROT_READ|VM_PROT_EXECUTE. The previous default (VM_PROT_ALL)
would cause the following scenario:
- someone attempts to write kernel text (my test was writing
to an offset of /dev/kmem which was known to be in the text
segment, while in single-user mode).
- enter trap() with MMU fault (because of RO pte).
- trap() calls vm_fault(), which looks up vm_map_entry for
fauling address.
- vm_fault interprets write fault and VM_PROT_WRITE (in VM_PROT_ALL)
as COW; new page allocated, data copied to new page, new page
mapped in at trunc_page(<faulting va>).
- wow, look at the fireworks!
Fixes two potential symptoms:
- kernacc() returns TRUE when checking for permission to write
an offset in kernel text, which is bogus, since the text has
been mapped RO by pmap_bootstrap().
- Handling of a stray pointer that attempted to scribble into
kernel text would not be executed properly.
 1.73 18-Oct-1996  thorpej Tell the `upper half' of the VM system that page 0 isn't mapped. If we
don't do this, kernacc() will bogusly return TRUE for page 0, causing a
NULL pointer dereference in uiomove() when reading /dev/kmem.

Thanks to Scott Reynolds for noticing the problem.
 1.72 13-Oct-1996  christos backout previous kprintf changes
 1.71 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.70 06-Oct-1996  thorpej Fix kernel crash dumps. Still uses the old format for now.
 1.69 05-Oct-1996  thorpej General cleanup:
- make a prototyping sweep
- do some garbage collection
- always print the status of enabling memory parity checking
Still some more to do.
 1.68 04-Oct-1996  thorpej Clean up handling of non-maskable interrupts.
 1.67 09-Aug-1996  mrg Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.
 1.66 18-May-1996  thorpej Implement a real delay calibration routine, adapted from Chuck Cranor's
mvme68k delay calibration algorithm.
 1.65 18-May-1996  christos - remove cpu_exec_aout_prep_oldzmagic and use exec_aout_prep_oldzmagic
 1.64 17-May-1996  thorpej Add a new function, hp300_calibrate_delay(), which sets the delay constant
based on a model's known CPU speed. cpuspeed value is now in MHz
instead of (MHz / 8).
 1.63 27-Apr-1996  thorpej Add "void" return type to consinit().
 1.62 13-Mar-1996  scottr Back out previous change.
 1.61 13-Mar-1996  scottr Add second argument to longjmp() call.
 1.60 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.59 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.58 14-Feb-1996  thorpej New interrupt handling code. Highlights:
- Interrupt service routines now take a pointer to
the device's softc, rather than a unit number.
- Interrupt handling code in locore.s condensed. Only
remaining "special" handlers are lev0 (spurious),
lev1 (HIL; don't ask), lev6 (clock), and lev7 (NMI).
Only remaining hard-coded device driver reference in
locore is HIL. (clock doesn't count...)
- "dcafastservice" eliminated. DCA driver has new mechanism
to guarantee prompt interrupt service at any ipl (not
just level 5).
- Interrupt code pulled out of autoconf.c and machdep.c and
placed in new file, isr.c
 1.57 09-Feb-1996  scottr When we panic, be a little smarter about whether we need to wait
for the user to hit a key before we reboot.
 1.56 16-Jan-1996  thorpej Remove all the old STACKCHECK stuff; it hasn't been used for a long time.
 1.55 04-Jan-1996  jtc Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.
 1.54 20-Nov-1995  thorpej Put doshutdownhooks() in the right place. Pointed out by cgd.
 1.53 19-Nov-1995  thorpej Re-arrange boot() a bit; call doshutdownhooks(), if we're rebooting, say so,
etc. Modeled after the alpha port's boot().
 1.52 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.51 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.50 01-Sep-1995  mycroft SA_ONSTACK --> SS_ONSTACK
 1.49 04-Jul-1995  paulus Add call to pppintr from netintr.
 1.48 16-May-1995  mycroft Put the address of the ps_strings structure in A2.
 1.47 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.46 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.45 21-Apr-1995  mycroft Use vfs_shutdown().
 1.44 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.43 05-Mar-1995  mycroft Make the dump code more consistent with i386. Mostly cosmetic.
 1.42 08-Nov-1994  mycroft Fix type of `code' arg to sendsig().
 1.41 26-Oct-1994  cgd new RCS ID format.
 1.40 20-Oct-1994  cgd update for new syscall args description mechanism
 1.39 16-Jul-1994  cgd on COMPAT_44, allow execution of 4.4BSD binaries
 1.38 05-Jul-1994  mycroft branches: 1.38.2;
Fix a compiation problem.
 1.37 23-May-1994  mycroft Merge with 4.4-Lite.
 1.36 23-May-1994  cgd mark buffer_map as pageable, when it's created.
 1.35 18-May-1994  cgd need vnode.h
 1.34 17-May-1994  cgd fix strcat invocations, and cast lots of args
 1.33 07-May-1994  mycroft Update for signal changes.
 1.32 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.31 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.30 04-May-1994  mycroft Update to match proc.h.
 1.29 24-Apr-1994  mycroft Update to match queue changes.
 1.28 18-Apr-1994  mycroft Add NETISR_ARP.
 1.27 31-Jan-1994  mycroft Add appropriate DDB calls on startup.
 1.26 30-Jan-1994  mycroft Update for current exec code.
 1.25 13-Jan-1994  mycroft Allocate exec_map.
 1.24 09-Jan-1994  mycroft Turn panic button into a debugger trap if DDB.
 1.23 08-Jan-1994  mycroft Use NULLVP, just for Correctness (tm).
 1.22 08-Jan-1994  cgd oops; forgot the new first arg to NEW_VMCMD()
 1.21 08-Jan-1994  cgd code reorg, and killing of common files
 1.20 08-Jan-1994  cgd far reaching but relatively minor cleanup and slight reorg of exec code
 1.19 08-Jan-1994  mycroft Fix some compiler warnings.
 1.18 06-Jan-1994  mycroft Clean up formatting.
 1.17 06-Jan-1994  mycroft Okay, so it *really* works now, or at least compiles.
 1.16 06-Jan-1994  mycroft Make ptrace() actually work now.
 1.15 06-Jan-1994  mycroft Implement `struct reg'.
 1.14 08-Dec-1993  mycroft Implement ptrace(), copied from the Amiga port.
 1.13 06-Dec-1993  mycroft Fix a couple of compiler warnings.
 1.12 13-Oct-1993  cgd fix one warning, and add (very bogus) ptrace_* functions until
i (hopefully) get real ones from somewhere
 1.11 30-Sep-1993  cgd do the virtual space hoop-jumping for the new vfs_bio;
still need to adjust 'buffers'.
 1.10 05-Sep-1993  cgd update for new exec; this (hp300 change) hasn't been checked, but is
just naming changes and addition of comments...
a couple of XXX's:
* XXX what are the special cases for the hp300?
* XXX why is this COMPAT_NOMID? was something generating
* hp300 binaries with an a_mid of 0? i thought that was only
* done on little-endian machines... -- cgd
 1.9 19-Aug-1993  mycroft Add old ZMAGIC handling, as in i386 port.
 1.8 14-Aug-1993  mycroft Note new location of pte.h.
 1.7 08-Aug-1993  mycroft Trampoline code is now stored in a different place.
 1.6 07-Aug-1993  mycroft bufpages multiplier is CLBYTES, not NBPG.
 1.5 07-Aug-1993  cgd this lets it get through autoconfig
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 07-Jul-1993  cgd function definition changes...
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.38.2.1 16-Jul-1994  cgd update from trunk
 1.80.2.1 12-Feb-1997  mrg don't allocate swap map in allocsys.
 1.90.2.2 13-May-1997  mrg merge in trunk changes.
 1.90.2.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.94.4.3 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.94.4.2 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.94.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.122.2.1 16-Apr-1999  chs branches: 1.122.2.1.2;
pull up 1.122 -> 1.123:
add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.
 1.122.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.122.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.132.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.132.4.1 15-Nov-1999  fvdl Sync with -current
 1.132.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.132.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.132.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.139.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.144.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.144.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.147.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.147.2.7 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.147.2.6 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.147.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.147.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.147.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.147.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.147.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.149.4.15 18-Oct-2002  nathanw Catch up to -current.
 1.149.4.14 17-Sep-2002  nathanw Catch up to -current.
 1.149.4.13 27-Aug-2002  nathanw Catch up to -current.
 1.149.4.12 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.149.4.11 02-Jul-2002  nathanw Revert to original uses of curproc.
 1.149.4.10 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.149.4.9 21-Jun-2002  gmcgarry LWPify some more
 1.149.4.8 20-Jun-2002  nathanw Catch up to -current.
 1.149.4.7 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.149.4.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.149.4.5 28-Feb-2002  nathanw Catch up to -current.
 1.149.4.4 08-Jan-2002  nathanw Catch up to -current.
 1.149.4.3 02-Dec-2001  scw If an FPU is available, call m68k_make_fpu_idle_frame() to generate
a reference FPU idle frame.
 1.149.4.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.149.4.1 16-Sep-2001  scw file machdep.c was added on branch nathanw_sa on 2001-11-18 18:09:33 +0000
 1.157.4.3 30-Aug-2002  gehenna catch up with -current.
 1.157.4.2 30-May-2002  gehenna Catch up with -current.
 1.157.4.1 17-May-2002  gehenna Replace the access to devsw table and the hard-coded major with devsw API.
 1.172.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.172.2.8 15-Feb-2005  skrll Sync with HEAD.
 1.172.2.7 09-Feb-2005  skrll Adapt to branch.
 1.172.2.6 17-Jan-2005  skrll Sync with HEAD.
 1.172.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.172.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.172.2.3 03-Sep-2004  skrll Sync with HEAD
 1.172.2.2 03-Aug-2004  skrll Sync with HEAD
 1.172.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.181.4.1 12-Feb-2005  yamt sync with head.
 1.181.2.1 29-Apr-2005  kent sync with -current
 1.182.4.1 01-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #923):
sys/arch/next68k/next68k/machdep.c: revision 1.73
sys/arch/luna68k/luna68k/machdep.c: revision 1.42
sys/arch/hp300/hp300/machdep.c: revision 1.184
sys/arch/amiga/amiga/machdep.c: revision 1.193
sys/arch/x68k/x68k/machdep.c: revision 1.129
sys/arch/mac68k/mac68k/machdep.c: revision 1.306
sys/arch/news68k/news68k/machdep.c: revision 1.61
sys/arch/mvme68k/mvme68k/machdep.c: revision 1.113
sys/arch/atari/atari/atari_init.c: revision 1.63
fix crash dumps on m68k platforms, cpu_kcore_hdr_t is larger than
512 bytes now so we need a bigger buffer. PR 26958.
 1.183.4.1 02-Nov-2005  yamt sync with head.
 1.183.2.5 21-Jan-2008  yamt sync with head
 1.183.2.4 03-Sep-2007  yamt sync with head.
 1.183.2.3 26-Feb-2007  yamt sync with head.
 1.183.2.2 30-Dec-2006  yamt sync with head.
 1.183.2.1 21-Jun-2006  yamt sync with head.
 1.185.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.185.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.185.8.2 11-Aug-2006  yamt sync with head
 1.185.8.1 01-Apr-2006  yamt sync with head.
 1.185.6.1 22-Apr-2006  simonb Sync with head.
 1.185.4.1 09-Sep-2006  rpaulo sync with head
 1.188.6.1 22-Oct-2006  yamt sync with head
 1.188.4.3 01-Feb-2007  ad Sync with head.
 1.188.4.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.188.4.1 18-Nov-2006  ad Sync with head.
 1.191.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.191.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.194.10.2 03-Oct-2007  garbled Sync with HEAD
 1.194.10.1 22-May-2007  matt Update to HEAD.
 1.194.4.1 11-Jul-2007  mjf Sync with head.
 1.194.2.2 15-Jul-2007  ad Sync with head.
 1.194.2.1 27-May-2007  ad Sync with head.
 1.196.10.2 09-Jan-2008  matt sync with HEAD
 1.196.10.1 06-Nov-2007  matt sync with HEAD
 1.197.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.197.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.198.14.1 03-Jul-2008  simonb Sync with head.
 1.198.12.4 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.198.12.3 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.198.12.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.198.12.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.198.10.3 11-Mar-2010  yamt sync with head
 1.198.10.2 19-Aug-2009  yamt sync with head.
 1.198.10.1 04-May-2009  yamt sync with head.
 1.198.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.198.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.198.6.1 02-Jul-2008  mjf Sync with HEAD.
 1.199.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.199.2.1 19-Oct-2008  haad Sync with HEAD.
 1.200.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.200.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.205.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.210.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.210.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.211.2.5 31-May-2011  rmind sync with head
 1.211.2.4 05-Mar-2011  rmind sync with head
 1.211.2.3 25-Apr-2010  rmind Fix hp300, missed in previous.
 1.211.2.2 25-Apr-2010  rmind - Invent mm_md_getva() and mm_md_relva() routines, provided by MD and
indicated with __HAVE_MM_MD_PREFER_VA. It will be used to deal with
cache aliasing issues and thus fix little MIPS, ARM and friends.

- Convert dev_mem_readwrite() to use unmanaged mappings. Fix a missed
offset addition in a case of direct map. Sprinkle various comments in
the memory device driver.

- Add missing direct map handling on hp700 and vax. Make checks across
m68k ports more consistent, reduce the diffs. Fix kernacc check miss
on news68k. Minor off-by-one fix for alpha. Add MEMC_PHYS_BASE for
mmap() case check on acorn26. Misc clean-up.
 1.211.2.1 18-Mar-2010  rmind Unify /dev/{mem,kmem,zero,null} implementations in MI code. Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
 1.214.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.215.2.3 05-Mar-2011  bouyer Sync with HEAD
 1.215.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.215.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.222.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.223.6.1 18-Feb-2012  mrg merge to -current.
 1.223.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.223.2.2 30-Oct-2012  yamt sync with head
 1.223.2.1 17-Apr-2012  yamt sync with head
 1.224.2.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.226.4.2 18-May-2014  rmind sync with head
 1.226.4.1 28-Aug-2013  rmind sync with head
 1.226.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.228.2.1 10-Aug-2014  tls Rebase.
 1.229.28.3 21-Apr-2020  martin Sync with HEAD
 1.229.28.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.229.28.1 10-Jun-2019  christos Sync with HEAD
 1.229.20.1 24-Apr-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #1540):

sys/arch/hp300/hp300/machdep.c: revision 1.233

Fix garbages in dmesg caused by uninitialized variables slipped in r1.228.

Noticed in HP9000/362 dmesg:
https://dmesgd.nycbug.org/index.cgi?do=view&id=5459

Should be pulled up to netbsd-8 and netbsd-9.
 1.229.18.1 27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.229.8.1 20-Jul-2016  pgoyette Adapt the machine/arch dependent code to the new {b,c}devsw reference
counting.

XXX Most of these will require testing by someone other than myself, as
I have a limited selection of hardware!
 1.230.4.1 24-Apr-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #847):

sys/arch/hp300/hp300/machdep.c: revision 1.233

Fix garbages in dmesg caused by uninitialized variables slipped in r1.228.

Noticed in HP9000/362 dmesg:
https://dmesgd.nycbug.org/index.cgi?do=view&id=5459

Should be pulled up to netbsd-8 and netbsd-9.
 1.232.6.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.237.2.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.239.2.1 02-Aug-2025  perseant Sync with HEAD
 1.50 12-Jun-2011  rmind Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.49 08-Feb-2011  rmind branches: 1.49.2;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.48 17-Oct-2007  garbled branches: 1.48.16; 1.48.40; 1.48.42; 1.48.48; 1.48.50;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.47 30-Sep-2007  tsutsui Remove local extiobase declarations, which is in <machine/cpu.h>.
 1.46 04-Mar-2007  tsutsui branches: 1.46.2; 1.46.10; 1.46.18; 1.46.20; 1.46.22;
Use appropriate casts.
 1.45 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.44 21-Jul-2006  tsutsui branches: 1.44.10;
Some KNF.
 1.43 19-Mar-2006  tsutsui Replace MALLOC(9) with malloc(9) in non critical path.
 1.42 11-Dec-2005  christos branches: 1.42.4; 1.42.6; 1.42.8; 1.42.10; 1.42.12;
merge ktrace-lwp.
 1.41 28-Aug-2004  thorpej branches: 1.41.12;
Use ANSI function decls, static, and const.
 1.40 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.39 01-Apr-2003  thorpej branches: 1.39.2;
Use PAGE_SIZE rather than NBPG.
 1.38 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.37 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.36 15-Mar-2002  gmcgarry branches: 1.36.4;
malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.35 27-Feb-2002  christos - Use DEV_ constants, instead of documenting the numbers!
- Delete cdev_decl(mm); where appropriate, and other hand-crufting [hi powerpc!]
 1.34 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.33 10-Sep-2001  chris branches: 1.33.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.32 24-Apr-2001  thorpej branches: 1.32.2; 1.32.4;
Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.31 17-Jul-2000  scottr branches: 1.31.2;
Catch up with d_mmap parameter change. From Steve Peurifoy via PR #10603.
 1.30 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.29 29-Jun-2000  mhitch Add cdev_decl() to declare mm*() routines.
 1.28 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.27 04-Dec-1999  ragge branches: 1.27.4;
CL* discarding.
 1.26 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.25 27-Mar-1999  mycroft branches: 1.25.8; 1.25.10; 1.25.14;
Oops; vm_offset_t -> vaddr_t.
 1.24 26-Mar-1999  mycroft Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.23 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.22 10-Feb-1999  kleink Use of casts as lvalues is a GNU C extension; rearrange slightly.
 1.21 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


XXX XXX XXX
the d_mmap cdev routine should be changed to have a prototype like:
paddr_t (*d_mmap) __P((dev_t, off_t, int));

by someone!
 1.20 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.19 07-May-1998  kleink Fix some arithmetics lossage on typeless pointers.
 1.18 16-Feb-1998  thorpej Add support for UVM.
 1.17 10-Jun-1997  veego branches: 1.17.8;
s/hp300_btop/m68k_btop/
 1.16 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.15 15-Mar-1997  thorpej - /dev/mem: only allow access to physical RAM
- /dev/kmem: disallow access to devices

This is designed to protect device registers from being corrupted
accidentally by "innocent" mem/kmem grovellers.
 1.14 02-Feb-1997  thorpej zeropage -> devzeropage, and make it static.
 1.13 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.12 10-Apr-1995  mycroft Add mmopen(), mmclose(), and mmmmap() where appropriate. Lock vmmap when
needed. Make types consistent.
 1.11 10-Apr-1995  mycroft Declare all return types.
 1.10 10-Apr-1995  mycroft Add no-op open and close functions.
 1.9 10-Apr-1995  mycroft mmmap --> mmmmap
 1.8 09-Jan-1995  mycroft Make sure to unlock when aborting.
 1.7 09-Jan-1995  mycroft Copy physlock code from SPARC port, and some minor cleaning.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 23-May-1994  mycroft Merge with 4.4-Lite.
 1.4 24-Apr-1994  mycroft Clean up bogus VM #includes.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.17.8.1 23-Nov-1998  cgd Fix many real and potential security problems with character device
driver mmap routines that did not properly bounds check offsets.
See NetBSD security advisory NetBSD-SA1998-005 for details. Done
as a patch because it's large, and a fair number of bits are different
in -current. (mrg)
 1.25.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.25.10.1 15-Nov-1999  fvdl Sync with -current
 1.25.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.27.4.2 22-Jul-2000  simonb Pull up rev 1.31 from scottr:
Catch up with d_mmap parameter change. From Steve Peurifoy via PR #10603.
 1.27.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.31.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.32.4.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.32.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.32.2.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.32.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.32.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.32.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.32.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.33.4.6 11-Nov-2002  nathanw Catch up to -current
 1.33.4.5 17-Sep-2002  nathanw Catch up to -current.
 1.33.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.33.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.33.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.33.4.1 10-Sep-2001  nathanw file mem.c was added on branch nathanw_sa on 2002-01-08 00:24:42 +0000
 1.36.4.1 17-May-2002  gehenna Add the character device switch.
 1.39.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.39.2.2 03-Sep-2004  skrll Sync with HEAD
 1.39.2.1 03-Aug-2004  skrll Sync with HEAD
 1.41.12.4 27-Oct-2007  yamt sync with head.
 1.41.12.3 03-Sep-2007  yamt sync with head.
 1.41.12.2 30-Dec-2006  yamt sync with head.
 1.41.12.1 21-Jun-2006  yamt sync with head.
 1.42.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.42.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.42.8.2 11-Aug-2006  yamt sync with head
 1.42.8.1 01-Apr-2006  yamt sync with head.
 1.42.6.1 22-Apr-2006  simonb Sync with head.
 1.42.4.1 09-Sep-2006  rpaulo sync with head
 1.44.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.46.22.1 06-Oct-2007  yamt sync with head.
 1.46.20.1 06-Nov-2007  matt sync with HEAD
 1.46.18.1 02-Oct-2007  joerg Sync with HEAD.
 1.46.10.1 03-Oct-2007  garbled Sync with HEAD
 1.46.2.1 09-Oct-2007  ad Sync with head.
 1.48.50.1 17-Feb-2011  bouyer Sync with HEAD
 1.48.48.1 06-Jun-2011  jruoho Sync with HEAD.
 1.48.42.1 18-Mar-2010  rmind Unify /dev/{mem,kmem,zero,null} implementations in MI code. Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
 1.48.40.1 30-Oct-2010  uebayasi Implement pmap_physload_device(9) to replace xmd(4) MD backend.
Implement pmap_mmap(9) and use it from mem(4) and xmd(4).
 1.48.16.1 29-Mar-2008  mjf Add a mem_init() function for each architecture that requests a device
node for /dev/mem, /dev/null, /dev/zero, etc.

This will disappear when I move this code (and others) to be a
pseudo-device. When we have machine-independent mem code this will all be
unnecessary anyway.
 1.49.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.3 08-Jan-1994  mycroft Clean up deleted files.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd add from net2. was symlink to ../../tahoe/tahoe/ns_cksum.c
 1.3 08-Jan-1994  mycroft Clean up deleted files.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.111 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.110 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.109 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.108 14-Oct-2002  chs merge pte.h for m68k w/ motorola or compatible MMU
(only 4k-page platforms so far).
 1.107 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.106 22-May-2002  drochner Subtract vm_map_min(kernel_map) from kernel virtual addresses to get offsets
into kernel_object where this was missing.
This is a no-op on ports where VM_MIN_KERNEL_ADDRESS==0, ie all but
cesfic.
Confirmed and corrected by Chuck Silvers.
 1.105 15-Mar-2002  gmcgarry branches: 1.105.4;
Add RCSIDs.
 1.104 08-Mar-2002  thorpej Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map). Try to deal with this:

* Group all information about the backend allocator for a pool in a
separate structure. The pool references this structure, rather than
the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
to become available, but will still fail if it cannot callocate KVA
space for the pages. If this happens, carefully drain all pools using
the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
some pages, and use that information to make draining easier and more
efficient.
* Get rid of PR_URGENT. There was only one use of it, and it could be
dealt with by the caller.

From art@openbsd.org.
 1.103 02-Jan-2002  chs pmap_page_protect(VM_PROT_NONE) must remove all mappings in the PV list,
even if they are wired. we need to be able to remove all mappings to
pages that are being freed due to (eg.) file truncation.
 1.102 16-Dec-2001  tsutsui Fix comments for ref-count of PT pages.
 1.101 13-Dec-2001  chs change the reference-counting of PT pages to start from zero instead of
one, so that we don't mess up the global count of wired pages by having
the page's wire_count be non-zero when we free the page.
pointed out by Michael Hitch.
 1.100 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.99 24-Nov-2001  isaki fix typo s/68551/68851/ in a comment.
 1.98 19-Nov-2001  chs allocate and free page table pages explicitly instead of abusing
uvm_fault_wire(). this allows us to make pt_map non-pageable,
but we need to be careful in pmap_remove() not to attempt to
reference PTEs after the PTP has been freed.
 1.97 29-Sep-2001  chs branches: 1.97.4;
fix typo in pmap_kremove() which was invalidating the wrong TLB entry.
from Hiroki Tanikawa in PR 14099.
 1.96 10-Sep-2001  chris Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.95 06-Jul-2001  chs branches: 1.95.2; 1.95.4;
implement pmap_k{enter_pa,remove}() correctly.
other misc cleanup.
 1.94 02-Jun-2001  chs replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.93 26-May-2001  chs replace vm_page_t with struct vm_page *.
 1.92 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.91 22-Apr-2001  thorpej Remove pmap_kenter_pgs(). It was never really adopted by
anything, and the interface itself wasn't as flexible as
callers would have probably liked.
 1.90 21-Apr-2001  thorpej #define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).
 1.89 21-Apr-2001  thorpej pmap_update() should not be equated with "flush entire TLB", it is
used to process deferred pmap operations. Since these pmaps don't
defer anything, pmap_update() is a noop.
 1.88 15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.87 14-Jan-2001  thorpej branches: 1.87.2;
splimp() -> splvm()
 1.86 13-Sep-2000  thorpej Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.
 1.85 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.84 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.83 26-Mar-2000  kleink Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
make them type-generic, which is necessary i.e. to operate on file offsets
without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
 1.82 14-Nov-1999  thorpej Fix typo in previous.
 1.81 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.80 16-Sep-1999  chs branches: 1.80.2; 1.80.4; 1.80.8;
make this compile again after PMAP_NEW cleanup.
 1.79 12-Sep-1999  chs eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
 1.78 08-Jul-1999  thorpej Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.77 17-Jun-1999  thorpej pmap_change_wiring() -> pmap_unwire().
 1.76 17-Jun-1999  thorpej Remove pmap_pageable(); no pmap implements it, and it is not really useful,
because pmap_enter()/pmap_change_wiring() (soon to be pmap_unwire())
communicate the information in greater detail.
 1.75 15-Jun-1999  thorpej Don't (ab)use uvm_map_pageable() to allocate PT pages. Instead, do
some internal reference counting on PT pages. We still allocate them
with the page fault routine (a wire-fault, now), but no longer free
PT pages from pmap_pageable().
 1.74 26-May-1999  thorpej Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.
 1.73 22-Apr-1999  chs in pmap_pageable(), rather than marking a PT page as not modified
to trick the pagedaemon into freeing it later, just unmap the page
and free it immediately. fixes PR 7337.
 1.72 01-Apr-1999  drochner branches: 1.72.2;
remove leftover #endif
 1.71 30-Mar-1999  thorpej In pmap_enter(), set the appropriate page attributes based on access_type.
The m68k maintains modified and referenced information for us, but seeding
the page attributes can save us a pv list traversal.
 1.70 27-Mar-1999  mycroft Fix a bug in pmap_collect_pv(), even though nobody currently uses it:
When we put a page on the collection list, we must subtract NPVPPG from the
total free count: one for each pv_entry that's free in that page, and one for
each free pv_entry in other pages that we're going to eat by moving the ones
in the page being collected.
 1.69 27-Mar-1999  mycroft Oops; forgot to change some pmap_enter() calls.
 1.68 26-Mar-1999  mycroft Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.67 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.66 01-Mar-1999  thorpej Style nits in last.
 1.65 25-Feb-1999  is hp300 part of the fix for pr 6152
 1.64 02-Feb-1999  thorpej Implement pmap_prefer() for systems w/ an HP MMU (which has a virtually-tagged
cache). This helps to avoid cache alias problems, and can improve performance
in the case where physical pages have multiple mappings (since the pages will
not have to be marked cache-inhibited).
 1.63 02-Feb-1999  thorpej Nuke the "pmapvacflush" debugging code.
 1.62 09-Jan-1999  thorpej In pmap_zero_page() and pmap_copy_page(), set copyback caching of the
pages on the 68040 and 68060, to avoid cache consistency problems (since
regular mappings are copyback cached as well), per Ignatios Souvatzis.
 1.61 08-Jan-1999  thorpej In pmap_zero_page() and pmap_copy_page(), don't bother invalidating the
mappings for CADDR1 and CADDR2, unless we're built w/ -DDEBUG. Since
these addresses are only used in these routines, we can "lazily invalidate"
them by just using them again. This makes these routines a teeny bit faster,
as it saves 1 or 2 TBIS's per call.

Suggested by Leo Weppelman <leo@netbsd.org>.
 1.60 21-Dec-1998  thorpej Make pmap_collect() actually do something useful. If called with a user
pmap, forget all of the mappings for the user address space for that pmap.
This causes the PT pages to be freed so that they can be reclaimed by the
VM system. [*]

[*] Actually, in the current implementation, it merely causes the wiring
count on the PT pages to drop to 0, which allows them to be reclaimed by
the pagedaemon. Handling of PT pages needs to be completely rewritten.
 1.59 21-Dec-1998  thorpej Use a memory pool for pmap structures.
 1.58 21-Dec-1998  thorpej Improve pmap_copy_page() and pmap_zero_page(). Don't use pmap_enter()/
pmap_remove() for the temporary addresses. This is completely unnecessary
as the temps are used ONLY for these routines, and we have better control
over the mapping by manipulating the PTE ourself. On VAC systems, cache-
inhibit the mapping to prevent wasting a cache load.

These routines are now significantly faster.

Add a DIAGNOSTIC check in pmap_enter() for kernel pmap and (CADDR1 or CADDR2);
nothing should be adding mappings there via that interface.
 1.57 20-Dec-1998  thorpej Clean up a whole load of comments, making many of them truthful, and
indicating which functions are INTERFACE vs. which aren't.
 1.56 19-Dec-1998  thorpej Unclutter a bit. Use a PMAP_DPRINTF() macro where possible, getting rid
of loads of #ifdef DEBUG ... stuff.
 1.55 19-Dec-1998  thorpej In pmap_testbit(), if we end up traversing the PV list, cache a hit on the
bit to speed future tests.
 1.54 19-Dec-1998  thorpej Make pmap_changebit() take bits to set and a PTE mask, rather than a bit
and a boolean.
 1.53 19-Dec-1998  thorpej G/c PMAPSTATS. It's unneeded clutter right now.
 1.52 11-Oct-1998  chuck remove unused share map code from UVM:
- update calls to uvm_unmap_remove/uvm_unmap (mainonly boolean arg
has been removed)
 1.51 03-Sep-1998  kleink Fix typo in previous (!UVM case, hence insignificant).
 1.50 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.49 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.48 27-May-1998  scottr Sync with mac68k: correct some errors if building a kernel with DEBUG.
 1.47 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.46 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.45 19-May-1998  thorpej It is no longer necessary for pmap_pinit() and pmap_release() to be
pmap interface functions, as NetBSD no longer uses statically allocated
pmaps (except for the kernel pmap, which is special-cased anyhow).
 1.44 26-Apr-1998  scottr GC the old MACHINE_NONCONTIG code.
 1.43 24-Feb-1998  thorpej Duh! Use uvm_km_valloc_wait(), NOT uvm_km_zalloc() to allocate user page
tables. (Thanks for pointing that out, Chuck!)
 1.42 16-Feb-1998  thorpej Add first-cut support for UVM. NOTE! User page table allocation does not
currently work with UVM in this pmap! This is due to a bug in the interaction
between kernel_object and submaps which will be addressed shortly.
 1.41 08-Feb-1998  thorpej Implement MACHINE_NEW_NONCONTIG and switch the hp300 port to use it.
 1.40 31-Jan-1998  ross In some hp300-derived pmaps, in pmap_page_protect(), don't walk off the
end of the list of physical->virtual entires into NULL space if the last
entry is (mysteriously) wired in the pmap. Add a DEBUG printf on alpha.
 1.39 06-Jan-1998  thorpej Garbage-collect pm_stchanged; it's not used by anything.
 1.38 06-Jan-1998  thorpej Garbage-collect use of the PCB's copy of the user segment table pointer.
 1.37 31-Dec-1997  thorpej Make pmap_activate() and pmap_deactivate() take a struct proc *.
 1.36 10-Jun-1997  veego branches: 1.36.8;
s/hp300_trunc_page/m68k_trunc_page/ s/hp300_ptob/m68k_ptob/
 1.35 03-May-1997  mycroft Oops; reverse sense of previous test.
 1.34 03-May-1997  mycroft Eliminate unused variable in '030-only kernels.
 1.33 27-Apr-1997  thorpej #include <machine/hp300spu.h>
 1.32 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.31 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.30 18-Mar-1997  mycroft Add an active_user_pmap() macro, and use it as appropriate.
 1.29 18-Mar-1997  mycroft Check for curproc being null before dereferencing it in more cases.
 1.28 02-Feb-1997  thorpej Use zeropage() in pmap_zero_page().
 1.27 13-Oct-1996  christos backout previous kprintf changes
 1.26 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.25 14-Sep-1996  thorpej Correct an old comment; the 318, 319, and 330 _are_ tested (68020 w/ 68851).
(Read: I have a 319 :-)
 1.24 11-Dec-1995  thorpej Rather than using individual HP300 model names, map those model names to
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.

In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.

Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
 1.23 05-Dec-1995  thorpej Fix the integer overflow problem in pmap_init() when the user PT map is
allocated, as noticed by Chuck Cranor. In addition to re-arranging
the assignment as suggested by Niklas Hallqvist, check to see if maxproc
is higher than the number of available user PTs. If it is, lower maxproc
to that value, the rationale being that it's much more desirable to have
fork() return EAGAIN than to have your system wedge.

XXX note that root can still raise maxproc with sysctl(2) later. It's
probably worth having further discussion about this issue, but until
everyone has time to think about it, this seems like an acceptable solution
for the time being.
 1.22 08-Oct-1995  thorpej branches: 1.22.2;
blkclr -> bzero
 1.21 05-Oct-1995  thorpej Fix segment table reference bug, from Micheal Hitch.
 1.20 29-May-1995  hpeyerl Check curproc != NULL before PMAP_ACTIVATE.
From Chuck Cranor <chuck@maria.wustl.edu>
 1.19 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.18 12-Apr-1995  mycroft Change some usages of UPAGES to USPACE.
 1.17 10-Apr-1995  mycroft Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.
 1.16 08-Nov-1994  mycroft Allocate pv_pages differently.
 1.15 26-Oct-1994  cgd new RCS ID format.
 1.14 09-Sep-1994  mycroft Nuke struct ste, struct ste40, struct pte, and HP_PAGE_SIZE. Use my
pv_entry allocator. Change pa_index() to pmap_page_index() for consistency
with other ports.
 1.13 27-May-1994  mycroft Bug fix from Mike Hibler.
 1.12 23-May-1994  mycroft Merge with 4.4-Lite.
 1.11 23-May-1994  cgd enable pmap_bootstrap_alloc
 1.10 20-May-1994  mycroft Avoid name clash.
 1.9 20-May-1994  mycroft #ifdef out pmap_bootstrap_alloc() for now.
 1.8 17-May-1994  cgd pmap_bootstrap_alloc
 1.7 24-Apr-1994  mycroft Fix typo.
 1.6 24-Apr-1994  mycroft Remove all vestiges of hppagesperpage and HP_PAGE_SIZE, and just use NBPG.
 1.5 24-Apr-1994  mycroft Clean up bogus VM #includes.
 1.4 04-Jan-1994  mycroft Change ptpage to flag, for new VM code.
 1.3 14-Aug-1993  mycroft Note new location of pte.h.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.22.2.1 16-Feb-1996  thorpej Bring in page table map allocation fix (integer overflow) from -current.
 1.36.8.1 07-Feb-1998  mellon Pull up 1.40 (ross)
 1.72.2.1 26-Apr-1999  perry branches: 1.72.2.1.2;
pullup 1.72->1.73 (chuq)
 1.72.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.72.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.80.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.80.4.1 15-Nov-1999  fvdl Sync with -current
 1.80.2.4 23-Apr-2001  bouyer Sync with HEAD.
 1.80.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.80.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.80.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.87.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.87.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.95.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.95.2.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.95.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.95.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.95.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.95.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.97.4.10 11-Nov-2002  nathanw Catch up to -current
 1.97.4.9 18-Oct-2002  nathanw Catch up to -current.
 1.97.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.97.4.7 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.97.4.6 20-Jun-2002  nathanw Catch up to -current.
 1.97.4.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.97.4.4 08-Jan-2002  nathanw Catch up to -current.
 1.97.4.3 03-Dec-2001  gmcgarry Last proc->lwp conversion.
 1.97.4.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.97.4.1 29-Sep-2001  scw file pmap.c was added on branch nathanw_sa on 2001-11-18 18:09:33 +0000
 1.105.4.1 30-May-2002  gehenna Catch up with -current.
 1.60 24-Jul-2021  andvar Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
 1.59 23-Dec-2016  maya branches: 1.59.32;
remove conflicting declarations of physmem. we want it to be psize_t
 1.58 21-Sep-2013  tsutsui branches: 1.58.6; 1.58.10;
Fix a build error on a kernel config without 68040 machines.

Reported by Andrew Gillham on port-hp300@:
http://mail-index.NetBSD.org/port-hp300/2013/09/09/msg000077.html
(I removed defined(68060) since hp300 doesn't have it)

Should be pulled up to netbsd-6.
 1.57 10-Feb-2012  mhitch branches: 1.57.2; 1.57.6; 1.57.10;
Sigh, it's been too long since I've done some of this. Fix the RELOC().
 1.56 10-Feb-2012  mhitch Oops - have to RELOC(physmem) here.
 1.55 10-Feb-2012  mhitch The recent kmem changes allocate a large kernel address space before
pmap_init() is called, and the initial kernel PT pages aren't enough
for the allocations pmap_init(). This fails because pmap_kenter_pa()
tries to allocate a new kernel PT page and traps because the pmap has
not been initialized. When computing the number if initial kernel PT
pages, include enough to allow kmem to map the physical memory. This
should fix PR/45915. OK by releng@. One mac68k system has been verified
to boot. Volunteers to test the others welcome. Amigas with at least
up to 128MB of memory were OK, but larger memory will need some adjusting.
 1.54 06-Jan-2011  tsutsui branches: 1.54.8; 1.54.12;
Move pmap_aliasmask initialization from pmap_bootstrap.c
to machdep.c:hp300_init() before the first pmap(9) use.
 1.53 06-Jan-2011  tsutsui Move VA allocation of ledbase to leds.c just before pmap_enter(9)
to reduce MD quirk in pmap_bootstrap.c.
 1.52 06-Jan-2011  tsutsui Move bootinfo address initialization to locore.s and machdep.c
to reduce MD quirks in pmap_bootstrap.c.
Also print bootinfo_pa in consinit() so that we can see
at least MMU is properly enabled after boot.

Tested on HP382.
 1.51 02-Jan-2011  tsutsui Tidy up common comments. (Yes, too many dup code...)
 1.50 02-Jan-2011  tsutsui Misc cosmetics to reduce diffs among these ports.
 1.49 02-Jan-2011  tsutsui Make pmap_aliasmask unsigned and declare it in <m68k/pmap_motorola.h>.

XXX: does anyone still have working HP320 or HP350 with 020+HP_MMU+VAC?
 1.48 02-Jan-2011  tsutsui Pull code that maps the kernel segment table cache invalidated for 040/060,
to reduce diffs from other m68k ports.

Tested on HP362 (030) and HP382 (040), and no visible performance difference.
(what should we do per "for the 68040 not strictly necessary but
recommended by Motorola" comment?)
 1.47 25-Dec-2010  tsutsui Fix fatal typo and pasted lines slipped in the last December
that prevent 68030 machines boot on these ports.
(only hp300 and mvme68k have supported 030 models)

Sorry for so long breakage.
 1.46 11-Dec-2009  tsutsui branches: 1.46.4;
Use appropriate macro during pmap initialization:
- use SYSMAP_VA, SEGSHIFT for Sysmap address and table entries
- use TIA_SIZE, TIB_SIZE for sizes of table entries

Now page size dependent numbers are almost replaced with proper macro.

Tested on atari, hp300, and news68k.
 1.45 06-Dec-2009  tsutsui Move initialization of protection_codes[] and kernel_pmap()
from MD pmap bootstrap sources to common pmap_bootstrap_finalize().

Tested on atari, hp300, mac68k, and news68k.

XXX: Why is protection_codes[] array initialized at run time?
 1.44 06-Dec-2009  tsutsui Sync MMU table initialization with amiga and atari a bit:

- for 040/060, move L2 descs for Sysptmap from the last L2 block in segment
table pages to the contiguous block with ones for segment table mappings

- for 020/030, invalidate ste and pte entries separately since
ste size (TIA_SIZE) and pte size (TIB_SIZE) could be different
on 8KB/page systems

Tested on hp300 (040), mac68k (LC040), and news68k (030)
(and untested on others).

XXX: some more stuff in pmap_bootstrap.c could be moved into
XXX: common pmap_bootstrap_finalize()?
 1.43 05-Dec-2009  tsutsui Use proper macro, variable names, types, and assignments for readability.
 1.42 04-Dec-2009  tsutsui Allocate lwp0upa (PA of lwp0 uarea) right after kernel rather than
between other page tables to use different mappings for ste/pte pages
as well as amiga and atari. Should resolve XXX comments in next68k and x68k.

Tested on hp300 and mac68k.
 1.41 04-Dec-2009  tsutsui No need to initialize lwp0 u-area in pmap_bootstrap()
since it will be done in pmap_bootstrap_finalize().
 1.40 02-Dec-2009  tsutsui Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on HP9000/382.
 1.39 27-Nov-2009  rmind - Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.
- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places. Reduce sys/user.h inclusions.
 1.38 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.37 17-Jan-2009  tsutsui Move extern decls for Sysseg, Sysptmap, Sysptsize, mem_size, virtual_avail,
virtual_end, and protection_codes[] to common <m68k/pmap_motorola.h>,
and also make protection_codes[] unsigned.

XXX: avail_start and avail_end should also be moved, but it causes
XXX: -Wshadow warnings in uvm/uvm_page.c:uvm_page_physload() and
XXX: I don't have a good idea of alternative names for now.
 1.36 28-Dec-2008  tsutsui Use the global kernel_pmap_ptr pointer in each MD pmap_bootstrap.c
(where MMU is not enabled yet) and make kernel_pmap_store static again.
Also consistently use uintptr_t on address conversion in RELOC() macro.

Tested on hp300 (PA != VA) and news68k (PA == VA).
 1.35 20-Dec-2008  tsutsui Sync comments about the last segment of KVA space with current implementation.
XXX other m68k ports should be updated as well.
 1.34 29-Dec-2007  tsutsui branches: 1.34.6; 1.34.10; 1.34.18;
Remove __P().
 1.33 17-Oct-2007  garbled branches: 1.33.2; 1.33.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.32 30-Sep-2007  tsutsui Remove local extiobase declarations, which is in <machine/cpu.h>.
 1.31 18-May-2007  tsutsui branches: 1.31.8; 1.31.10; 1.31.12;
Update comments to sync yamt-km merge (Sysmap has been moved).

See also:
http://mail-index.netbsd.org/source-changes/2005/02/23/0004.html
 1.30 05-Mar-2007  tsutsui branches: 1.30.2; 1.30.4; 1.30.10;
Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
 1.29 04-Mar-2007  tsutsui - add missed '*'
- vmmap is declared as (char *) in <m68k/pmap_motorola.h>
 1.28 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.27 11-Dec-2005  christos branches: 1.27.26;
merge ktrace-lwp.
 1.26 01-Apr-2005  yamt branches: 1.26.2;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.25 28-Aug-2004  thorpej branches: 1.25.4; 1.25.6;
Use ANSI function decls, static, and const.
 1.24 17-Nov-2003  tsutsui TAB/space cleanup.
 1.23 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.22 01-Apr-2003  thorpej branches: 1.22.2;
Use PAGE_SIZE rather than NBPG.
 1.21 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.20 15-Mar-2002  gmcgarry Add RCSIDs.
 1.19 29-Jun-2000  mrg branches: 1.19.4; 1.19.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.18 27-Jun-2000  mrg remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h>
 1.17 14-Dec-1999  thorpej Add a bootinfo facility, as is used on i386 and pmax, ports. We expect
the bootinfo to be located in the first page of kernel text (which has
been zero-filled for a Very Long Time to allow us to unmap KVA 0); the
boot loader will place it there after loading the kernel image.
 1.16 11-Dec-1998  thorpej branches: 1.16.8; 1.16.14;
Add some brackes to make EGCS happy.
 1.15 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.14 19-Sep-1997  leo Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
 1.13 10-Jun-1997  veego branches: 1.13.4;
s/hp300_round_page/m68k_round_page/ s/hp300_trunc_page/m68k_trunc_page/
s/hp300_btop/m68k_btop/ s/hp300_ptob/m68k_ptob/
 1.12 27-Apr-1997  thorpej #include <machine/hp300spu.h>
 1.11 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.10 14-Oct-1996  thorpej Couple of small changes to how kernel is mapped:
- kernel text is now always read-only.
- page 0 is invalid.
 1.9 11-Dec-1995  thorpej Rather than using individual HP300 model names, map those model names to
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.

In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.

Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
 1.8 09-Dec-1995  thorpej Prevent the msgbuf from getting trashed across reboots by moving avail_end
back one page.
 1.7 05-Oct-1995  thorpej Initialize the kernel PT map as thoroughly in the 68040 case as the
non-68040 case. Fix up a comment there, too.
 1.6 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.5 12-Apr-1995  mycroft More UPAGES --> USPACE.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 09-Sep-1994  mycroft Nuke struct ste, struct ste40, struct pte, and HP_PAGE_SIZE. Use my
pv_entry allocator. Change pa_index() to pmap_page_index() for consistency
with other ports.
 1.2 23-May-1994  mycroft Make the kernel text writable for DDB.
 1.1 23-May-1994  mycroft Merge with 4.4-Lite.
 1.13.4.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.16.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.16.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.19.8.2 11-Nov-2002  nathanw Catch up to -current
 1.19.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.19.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.22.2.5 01-Apr-2005  skrll Sync with HEAD.
 1.22.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.22.2.2 03-Sep-2004  skrll Sync with HEAD
 1.22.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.6.4 28-Feb-2005  yamt sync some whitespace and comments among m68k pmap_bootstrap variants.
no functional changes.
 1.25.6.3 27-Feb-2005  yamt remove old code to assign virtual_avail.
 1.25.6.2 26-Feb-2005  yamt fix a mistake in the previous. correct Sysmap.
 1.25.6.1 24-Feb-2005  yamt change kernel va layout, following mac68k.
 1.25.4.1 29-Apr-2005  kent sync with -current
 1.26.2.3 21-Jan-2008  yamt sync with head
 1.26.2.2 27-Oct-2007  yamt sync with head.
 1.26.2.1 03-Sep-2007  yamt sync with head.
 1.27.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.10.2 03-Oct-2007  garbled Sync with HEAD
 1.30.10.1 22-May-2007  matt Update to HEAD.
 1.30.4.1 11-Jul-2007  mjf Sync with head.
 1.30.2.2 09-Oct-2007  ad Sync with head.
 1.30.2.1 27-May-2007  ad Sync with head.
 1.31.12.1 06-Oct-2007  yamt sync with head.
 1.31.10.2 09-Jan-2008  matt sync with HEAD
 1.31.10.1 06-Nov-2007  matt sync with HEAD
 1.31.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.33.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.33.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.34.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.34.10.2 11-Mar-2010  yamt sync with head
 1.34.10.1 04-May-2009  yamt sync with head.
 1.34.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.46.4.1 05-Mar-2011  rmind sync with head
 1.54.12.1 18-Feb-2012  mrg merge to -current.
 1.54.8.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.54.8.1 17-Apr-2012  yamt sync with head
 1.57.10.1 18-May-2014  rmind sync with head
 1.57.6.2 03-Dec-2017  jdolecek update from HEAD
 1.57.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.57.2.1 20-Oct-2013  bouyer Pull up following revision(s) (requested by tsutsui in ticket #958):
sys/arch/hp300/hp300/pmap_bootstrap.c: revision 1.58
Fix a build error on a kernel config without 68040 machines.
Reported by Andrew Gillham on port-hp300@:
http://mail-index.NetBSD.org/port-hp300/2013/09/09/msg000077.html
(I removed defined(68060) since hp300 doesn't have it)
Should be pulled up to netbsd-6.
 1.58.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.58.6.1 05-Feb-2017  skrll Sync with HEAD
 1.59.32.1 01-Aug-2021  thorpej Sync with HEAD.
 1.7 07-Dec-2004  chs use the m68k-common procfs_machdep.c on all m68k platforms.
 1.6 17-Nov-2003  tsutsui TAB/space cleanup.
 1.5 15-Mar-2002  gmcgarry branches: 1.5.12;
Add RCSIDs.
 1.4 18-Jan-2001  tv branches: 1.4.4; 1.4.8;
No-op commit to force update to a non-"-kk" revision.
 1.3 17-Jan-2001  fvdl Add machdep file for procfs. Currently only used for linux-style
/proc/cpuinfo (only active when procfs is mounted with -o linux).
For ports other than the i386 this currently produces an empty
string.
 1.2 08-Jan-1994  mycroft branches: 1.2.4;
Clean up deleted files.
 1.1 06-Jan-1994  mycroft Implement procfs stubs.
 1.2.4.1 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.4.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.12.4 18-Dec-2004  skrll Sync with HEAD.
 1.5.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.12.1 03-Aug-2004  skrll Sync with HEAD
 1.4 09-Aug-1993  mycroft Clean up deleted files.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.13 04-Mar-2007  tsutsui Make hp300 use common m68k/softintr.c.
 1.12 15-Feb-2007  tsutsui branches: 1.12.2;
IPL_NSOFT -> SI_NQUEUES (missed in the previous. Umm)
 1.11 10-Feb-2007  tsutsui Rename _IPL_SOFT* macro to SI_SOFT* to sync with other m68k ports.
 1.10 21-Dec-2006  yamt merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.9 21-Jul-2006  tsutsui branches: 1.9.4; 1.9.6;
Some KNF.
 1.8 19-Mar-2006  tsutsui Replace MALLOC(9) with malloc(9) in non critical path.
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
merge ktrace-lwp.
 1.6 02-Jan-2005  tsutsui branches: 1.6.10;
u_intNN_t -> uintNN_t
 1.5 28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.4 17-Nov-2003  tsutsui TAB/space cleanup.
 1.3 19-Jul-2003  tsutsui In softintr_dispatch(), clear ssir bit before calling softintr handlers
with a single_inst op, otherwise sometimes softintr might be lost.
 1.2 15-Mar-2002  gmcgarry branches: 1.2.12;
malloc cleanups:
- malloc+memset -> malloc with M_ZERO
- malloc -> MALLOC for fixed-sized structures
Add RCSIDs while here
 1.1 08-Dec-2001  gmcgarry branches: 1.1.2; 1.1.4;
softintr(9) interface for hp300
 1.1.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 08-Dec-2001  thorpej file softintr.c was added on branch kqueue on 2002-01-10 19:43:08 +0000
 1.1.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 08-Dec-2001  nathanw file softintr.c was added on branch nathanw_sa on 2002-01-08 00:24:43 +0000
 1.2.12.5 17-Jan-2005  skrll Sync with HEAD.
 1.2.12.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.12.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.12.2 03-Sep-2004  skrll Sync with HEAD
 1.2.12.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.4 03-Sep-2007  yamt sync with head.
 1.6.10.3 26-Feb-2007  yamt sync with head.
 1.6.10.2 30-Dec-2006  yamt sync with head.
 1.6.10.1 21-Jun-2006  yamt sync with head.
 1.7.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.7.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.8.2 11-Aug-2006  yamt sync with head
 1.7.8.1 01-Apr-2006  yamt sync with head.
 1.7.6.1 22-Apr-2006  simonb Sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.9.6.1 06-Oct-2006  tsutsui Reorganize IPL macros for proper splraiseipl() implementation:
- merge HP300_IPL_* and IPL_* macros
- prepare independent _IPL_SOFT_* macro to determine softintr(9) handlers
- rename hp300_ipls[] array to hp300_ipl2psl[]
- then use these macro for makeiplcookie() and splraiseipl()
Tested on HP382.
 1.9.4.1 12-Jan-2007  ad Sync with head.
 1.12.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.16 31-Jan-1997  thorpej This file is obsolete; this information is now generated by config(8).
 1.15 14-Oct-1996  thorpej branches: 1.15.2;
New root device detect/set code, lifted mostly from NetBSD/alpha.
The "options GENERIC" entry in kernel config files is not longer necessary
for "swap generic" kernels. Uses new config constructs which work with
some glue in an old config environment. This code will support new config
with minimal changes.
 1.14 13-Oct-1996  christos backout previous kprintf changes
 1.13 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.12 24-Sep-1995  thorpej Assume primary swap is `b' partition, not `root partition + 1'.
 1.11 03-Sep-1995  thorpej Really batting 1.000 today...
 1.10 02-Sep-1995  thorpej Fix thinko in netboot-related changes.
 1.9 02-Sep-1995  thorpej Grok booting from the network.
 1.8 20-Dec-1994  hpeyerl so machines with only an rd or sd will compile. from Thorpej. PR#610.
 1.7 06-Nov-1994  cgd fix for bug 559, as reported by Jason Thorpe. (fix by me)
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 24-Jun-1994  hpeyerl branches: 1.5.2;
ufs->ffs. From Jason Thorpe (thorpej@cs.orst.edu)
 1.4 20-Jan-1994  brezak Fix uninitialized variable.
 1.3 07-Aug-1993  cgd add definition of mountroot()
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.2.1 07-Nov-1994  cgd from trunk, for patch #1
 1.15.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.4 16-Apr-1994  mycroft Clean up deleted files.
 1.3 15-Apr-1994  cgd convert vm system to use new queues. I'll never write code w/queues again.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.33 03-Nov-2002  chs use a merged sys_machdep.c for all the motorola-MMU m68k platforms.
 1.32 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.31 15-Mar-2002  gmcgarry Add RCSIDs.
 1.30 13-Dec-2000  jdolecek branches: 1.30.4; 1.30.8;
g/c obsolete vtrace(2) stuff
 1.29 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.28 28-Nov-1999  is Fix typo (&& -> &).
 1.27 25-Nov-1999  is From the 68040 User Manual, page 4-10:

"To fully support self-modifying code in any situation, it is imperative that
a CPUSHA intrcution is executed before the execution of the first self-modified
instruction. The CPUSHA instruction has the effect of ensuring that there is
no stale data iin memory, the pipeline is flushed, and instruction prefetches
are repeated and taken from external memory."

I verified that this is the only way (I can think of) to make the sigtramp
regression test work on 68040. doing cpushl dc; cinvl ic; over the affected
address range, then nop (to synchronize the pipeline) is not enough; apparently
the nop does not FLUSH the pipeline and prefetch...

Note that the 68060 UM has copied the above cited passage, but in fact this is
not true. This might be connected to the fact that the 68060 does ensure
memory access order under most conditions.
 1.26 08-Jul-1999  thorpej branches: 1.26.2; 1.26.8;
Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.25 26-Feb-1999  is branches: 1.25.2; 1.25.4;
synchronize types, and s/curproc/p/ in one forgotten place
 1.24 25-Feb-1999  is hp300 part of the fix for pr 6152
 1.23 19-Jan-1999  thorpej No need for <sys/mtio.h>
 1.22 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.21 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.20 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.19 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.18 25-Feb-1998  perry note second parm of sysarch() is now void *, + trivial KNF, etc.
 1.17 19-May-1997  veego Fix lossage from the latest vm_pmap changes.
 1.16 27-Apr-1997  thorpej Use <machine/hp300spu.h> to determine if we might have a physical address
cache.
 1.15 06-Apr-1997  mycroft Fix some #ifdef lossage if HP340, HP360, or HP375 is defined, but HP370 is not.
 1.14 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.13 11-Dec-1995  thorpej Rather than using individual HP300 model names, map those model names to
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.

In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.

Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
 1.12 08-Oct-1995  thorpej Finish up the system call function renaming; sysarch -> sys_sysarch and
vtrace -> sys_vtrace.
 1.11 22-Sep-1995  thorpej "Oops." Get the declaration of sys_arch() correct.
 1.10 21-Sep-1995  thorpej Need <sys/mount.h> now.
 1.9 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.8 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 20-Oct-1994  cgd update for new syscall args description mechanism
 1.5 23-May-1994  mycroft Merge with 4.4-Lite.
 1.4 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.3 13-Oct-1993  cgd add "sysarch()", as a fn returning ENOSYS, here, where it belongs
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.25.4.1 02-Aug-1999  thorpej Update from trunk.
 1.25.2.2 29-Nov-1999  he Pull up revision 1.28 (requested by is):
Fix a typo which caused excessive cache flushes.
 1.25.2.1 27-Nov-1999  he Pull up revision 1.27 (requested by is):
Fix i-cache/d-cache synchronization for M68040 cpus (see M68040
UM p.4-10). Makes regress/sys/kern/sigtramp work even on M68040.
 1.26.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.26.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.26.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.30.8.5 11-Nov-2002  nathanw Catch up to -current
 1.30.8.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.30.8.3 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.30.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.30.8.1 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.30.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.159 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.158 05-Oct-2023  ad Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).
 1.157 21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.156 15-Jan-2023  tsutsui TAB/space cleanup.
 1.155 25-Sep-2021  tsutsui branches: 1.155.4;
Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Affects only inside #ifdef DEBUG part on "trap during panic" in trap.c
derived from hp300.
 1.154 21-Nov-2019  ad mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.
 1.153 06-Apr-2019  thorpej Overhaul the API used to fetch and store individual memory cells in
userspace. The old fetch(9) and store(9) APIs (fubyte(), fuword(),
subyte(), suword(), etc.) are retired and replaced with new ufetch(9)
and ustore(9) APIs that can return proper error codes, etc. and are
implemented consistently across all platforms. The interrupt-safe
variants are no longer supported (and several of the existing attempts
at fuswintr(), etc. were buggy and not actually interrupt-safe).

Also augmement the ucas(9) API, making it consistently available on
all plaforms, supporting uniprocessor and multiprocessor systems, even
those that do not have CAS or LL/SC primitives.

Welcome to NetBSD 8.99.37.
 1.152 18-Feb-2019  thorpej Refactor the 68040 writeback() from each m68k port's trap handler into a
shared copy: m68040_writeback(). It is essentially a copy of the Atari
version, with some minor cosmetic tweaks and one small performance optimization
from the mvme68k port.

Tested by rjs@ on a Quadra 950. (Thanks!)
 1.151 04-Mar-2015  martin branches: 1.151.18;
Handle EINVAL in the fault path and send SIGBUS on mmap'd access past EOF
 1.150 16-Aug-2013  tsutsui branches: 1.150.6;
Make FPU_EMULATE work on NetBSD/hp300. Commented out by default in GENERIC.

Tested on HP9000/362 without optional MC68882 FPU in its socket.
 1.149 19-Feb-2012  rmind branches: 1.149.2; 1.149.4;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.148 08-Feb-2011  rmind branches: 1.148.4; 1.148.8;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.147 06-Feb-2011  tsutsui Remove trailing TABs.
 1.146 17-Jan-2011  tsutsui branches: 1.146.2;
Explicitly include <machine/pcb.h> for struct pcb.
 1.145 20-Dec-2010  matt branches: 1.145.2;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.144 07-Jul-2010  chs implement ucas_* for m68k.
 1.143 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.142 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.141 21-Nov-2009  rmind branches: 1.141.2; 1.141.4;
Use lwp_getpcb() on hppa and ia64, clean from struct user usage.
 1.140 27-Jan-2009  martin Centralize fpu exception to siginfo code encoding for all m68k archs,
fixes a failure in the lib/libc/ieeefp/except regression test.
 1.139 15-Oct-2008  wrstuden branches: 1.139.2; 1.139.4;
Merge wrstuden-revivesa into HEAD.
 1.138 24-Apr-2008  ad branches: 1.138.2; 1.138.4; 1.138.8;
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
 1.137 31-Dec-2007  ad branches: 1.137.6; 1.137.8;
Remove COMPAT_HPUX.
 1.136 03-Dec-2007  ad branches: 1.136.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.135 05-Nov-2007  ad branches: 1.135.2;
Don't set l_usrpri / spc_curpriority here. mi_userret() does it.
 1.134 24-Oct-2007  ad Make ras_lookup() lockless.
 1.133 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.132 01-Sep-2007  mhitch branches: 1.132.4;
68030 and 68040 processors consider the read portion of a read-modify-write
transfer as a write to ensure the memory is writable before starting any
transfer. The fault status information does not reflect this in the 'read'
status bit (i.e. it shows up as a read access), so faults with a RMW access
to non-writable memory was not getting the correct protection. The page would
be read-only and the instruction would fault over and over.

A specific example is when a process forks, and the child process attempts
to execute a RMW access to a data page, which is read-only because it's CoP
Copy-On-Write.

When checking if the page needs to be writablek, also check the locked transfer
and treat any locked transfer as a write.

68060 already handled this correctly, since it has separate read and write
fault bits, and both are set on a RMW access and the trap code was checking
the write status bit.

Fixes PR#36848.
 1.131 12-Jun-2007  mhitch branches: 1.131.4; 1.131.8; 1.131.10;
Pass a frame pointer to trap() rather than the 'entire frame' trick. Gcc4
was optimizing away modifications to the frame contents (it's not nice to
trick gcc). Pass the pointer as the first argument to reduce the number
of places that would be changed otherwise. Fixes the getcwd regression
test on most m68k ports.
 1.130 18-May-2007  tsutsui Adapt hp300 to yamt-idlelwp. Tested on 9000/382.
 1.129 04-Mar-2007  christos branches: 1.129.2; 1.129.4; 1.129.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.128 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.127 10-Feb-2007  tsutsui branches: 1.127.2;
Apply changes for newslock2, taken from other m68k ports.
 1.126 09-Feb-2007  ad Merge newlock2 to head.
 1.125 23-Jul-2006  ad branches: 1.125.4; 1.125.8; 1.125.10;
Use the LWP cached credentials where sane.
 1.124 19-Jul-2006  ad - Hold a reference to the process credentials in each struct lwp.
- Update the reference on syscall and user trap if p_cred has changed.
- Collect accounting flags in the LWP, and collate on LWP exit.
 1.123 15-May-2006  yamt include kauth.h for kauth_cred_geteuid.
 1.122 14-May-2006  elad integrate kauth.
 1.121 26-Mar-2006  tsutsui Hmm, apply a missed fix for hp300 in the folloing commit:
http://mail-index.netbsd.org/source-changes/2002/02/14/0023.html

> allow writing to write-only mappings. fixes PR 3493.
 1.120 26-Mar-2006  tsutsui Remove/sort some #include headers.
 1.119 26-Mar-2006  tsutsui Fix a typo in previous.
 1.118 26-Mar-2006  tsutsui - fix botch in comment on register prefix removal
- use m68k_page_offset() macro
- some KNF
 1.117 26-Mar-2006  tsutsui Include header files rather than local declaration.
 1.116 15-Mar-2006  drochner branches: 1.116.2;
adapt to uvm_fault() interface cleanup: kill the useless 3rd argument
 1.115 25-Feb-2006  wiz branches: 1.115.2; 1.115.4;
Fix some typos.
 1.114 24-Dec-2005  perry branches: 1.114.2; 1.114.4; 1.114.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.113 11-Dec-2005  christos merge ktrace-lwp.
 1.112 28-Aug-2004  thorpej branches: 1.112.12;
Use ANSI function decls, static, and const.
 1.111 28-Aug-2004  jdolecek use uvm_grow() to update stack segment size on stack page fault instead
of MD code
 1.110 14-Mar-2004  cl add kernel part of concurrency support for SA on MP systems
- move per VP data into struct sadata_vp referenced from l->l_savp
* VP id
* lock on VP data
* LWP on VP
* recently blocked LWP on VP
* queue of LWPs woken which ran on this VP before sleep
* faultaddr
* LWP cache for upcalls
* upcall queue
- add current concurrency and requested concurrency variables
- make process exit run LWP on all VPs
- make signal delivery consider all VPs
- make timer events consider all VPs
- add sa_newsavp to allocate new sadata_vp structure
- add sa_increaseconcurrency to prepare new VP
- make sys_sa_setconcurrency request new VP or wakeup idle VP
- make sa_yield lower current concurrency
- set sa_cpu = VP id in upcalls
- maintain cached LWPs per VP
 1.109 17-Nov-2003  tsutsui TAB/space cleanup.
 1.108 08-Nov-2003  tsutsui Remove obsolete comments about curproc.
 1.107 04-Nov-2003  dsl Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
 1.106 02-Nov-2003  cl Extend the #ifdef M68040 so that the `sig' variable declaration is moved
in as well, as it's otherwise not used. (from atari/atari/trap.c and
x68k/x68k/trap.c)
 1.105 31-Oct-2003  cl Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
 1.104 08-Oct-2003  thorpej * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
result of a trap. Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap. Expands to 0 if the ksiginfo_t was
not the result of a trap. This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern. Reviewed and OK's by Christos.
 1.103 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.102 17-Sep-2003  cl add MD part of SA/pthread pagefault handling on all m68k ports
 1.101 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.100 01-Apr-2003  thorpej branches: 1.100.2;
Use PAGE_SIZE rather than NBPG.
 1.99 28-Jan-2003  wiz success, not sucess. Noted by mjl.
 1.98 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.97 20-Oct-2002  chs branches: 1.97.2;
merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.96 28-Aug-2002  gmcgarry RAS support for m68k.
 1.95 15-Mar-2002  gmcgarry branches: 1.95.4;
Add RCSIDs.
 1.94 26-Dec-2001  thorpej Remove (incorrect) extern decl of emul_hpux.
 1.93 08-Dec-2001  gmcgarry softintr(9) interface for hp300
 1.92 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.91 10-Sep-2001  chris branches: 1.91.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.90 02-Jun-2001  chs branches: 1.90.2; 1.90.4;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.89 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.88 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.87 15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.86 15-Jan-2001  thorpej branches: 1.86.2;
Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.85 23-Dec-2000  jdolecek split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.

XXX I wish m68k ports would share trap.c
 1.84 19-Dec-2000  scw Unification of the m68k syscall() function.
 1.83 21-Nov-2000  tsutsui s/struct const sysent/const struct sysent/

(BTW, luna68k was missed in emul/execsw changes?)
 1.82 21-Nov-2000  jdolecek restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
provide single struct emul per emulation
* elf:
- kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
per emulation and contains pointer to respective probe function
- interp is allocated via MALLOC() rather than on stack
- elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
part of appropriate execsw[] entry
* constify couple of structures
 1.81 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.80 27-Jun-2000  mrg remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h>
 1.79 06-Jun-2000  soren defopt SYSCALL_DEBUG.
 1.78 27-May-2000  sommerfeld branches: 1.78.2;
Reduce use of curproc in several places:

- Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

- Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

- Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

- ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

- move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

- simplify interface to ktrwrite()
 1.77 26-May-2000  thorpej First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

- Global state: sched_qs (run queues), sched_whichqs (bitmap
of non-empty run queues), sched_slpque (sleep queues).
NOTE: These may collectively move into a struct schedstate
at some point in the future.

- Per-CPU state, struct schedstate_percpu: spc_runtime
(time process on this CPU started running), spc_flags
(replaces struct proc's p_schedflags), and
spc_curpriority (usrpri of processes on this CPU).

- Every platform must now supply a struct cpu_info and
a curcpu() macro. Simplify existing cpu_info declarations
where appropriate.

- All references to per-CPU scheduler state now made through
curcpu(). NOTE: this will likely be adjusted in the future
after further changes to struct proc are made.

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
 1.76 24-May-2000  thorpej Use preempt(), not an open-coded equivalent (which won't be
equivalent for long).
 1.75 05-Dec-1999  ragge clrnd()/clbase() discarding.
 1.74 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.73 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.72 08-Jul-1999  thorpej branches: 1.72.2; 1.72.4; 1.72.6;
Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.71 26-Mar-1999  mycroft branches: 1.71.4;
Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.70 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.69 18-Mar-1999  chs if uvm_fault() fails with KERN_RESOURCE_SHORTAGE, send a SIGKILL
and print a message about it. this will be used to recover from
out-of-swap conditions.
 1.68 15-Dec-1998  itohy Added COMPAT_LINUX support.
 1.67 11-Nov-1998  thorpej Changes to support fork_kthread():
- cpu_set_kpc() now takes void *arg third argument, passed to the
entry point.
- cpu_fork() allows parent to be non-curproc iff parent is proc0.
When forking non-curproc, assume its state has already been saved.
- Adjust various pieces of machine-dependent code to account of all of this.
 1.66 01-Oct-1998  thorpej Adapt to signal changes.
 1.65 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.64 04-Jul-1998  jonathan defopt DDB.
 1.63 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.62 25-Jun-1998  thorpej defopt COMPAT_SUNOS
 1.61 25-Jun-1998  thorpej defopt KTRACE
 1.60 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.59 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.58 27-Feb-1998  thorpej Fix a typo.
 1.57 16-Feb-1998  thorpej Add support for UVM.
 1.56 13-Feb-1998  scottr Avoid declaring the "astpending" and "want_resched" globals in cpu.h,
as this breaks C++ code that happens to indirectly include this header.
Both Matthias Scheler and I noticed this, independently.

This problem notably does not affect the atari and sun3/sun3x ports,
which have already implemented a similar solution.
 1.55 08-Jul-1997  kleink branches: 1.55.4;
From sun3:
Correct handling for Trap #2 in SunOS executables,
now that we know it is supposed to flush the cache.
(Was thought to be "some obscure FPU operation".)
 1.54 19-May-1997  veego Fix lossage from the latest vm_pmap changes.
 1.53 27-Apr-1997  thorpej #include <machine/hp300spu.h>
 1.52 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.51 09-Apr-1997  thorpej regdump() takes a struct trapframe *
 1.50 02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.49 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.48 15-Mar-1997  thorpej Garbage-collect use of FPCOPROC.
 1.47 14-Oct-1996  thorpej Couple of small changes:
- Fix up usage of MBD_ISPID().
- Ensure that we never deal with a NULL proc, and if our proc has
no pcb, punt. Suggested by Gordon Ross.
- Eliminate some redundant NULL pointer checks in the T_MMUFLT cases;
proc0.p_addr is now initialized early, and we make a single test
for sanity at the top of trap() now.
 1.46 14-Oct-1996  thorpej Be careful not to deref bad pointers in the MMU fault handler! (yow!)
 1.45 13-Oct-1996  christos backout previous kprintf changes
 1.44 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.43 05-Oct-1996  thorpej Handle kernel trace traps and breakpoints like the Sun3 port:
- Only pass user trace traps and breakpoints on to trap().
Gets rid of some hair in the trace/breakpoint trap cases.
- Before entering the debugger, switch to a temporary
stack so that the debugger can alter the stack pointer.
- Add glue for KGDB (still not complete).
Some other minor cleanup:
- Protect against some bad pointer derefs.
- Be more a little more verbose when a fatal trap
occurs to aid debugging.
 1.42 11-Sep-1996  thorpej - Pull in some interesting changes from the Amiga trap.c:

* SunOS glue

* 68060 exception frame size definitions

* 68060 fault detection macros

- Use `cputype' rather than `mmutype' where appropriate.

- Play the prototype game.

This file is much closer to being sharable by all m68k ports.
 1.41 07-Sep-1996  mycroft Use SIGBUS iff we get a legitimate bus fault. Use SIGSEGV for page protection
violations (per Solaris, SVR4, AIX, Linux, Irix, and SunOS).
 1.40 11-Dec-1995  thorpej Rather than using individual HP300 model names, map those model names to
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.

In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.

Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
 1.39 28-Nov-1995  thorpej Update a #include for the "new" location of HP-UX emulation code.
 1.38 03-Sep-1995  thorpej Fix missing clock-ticks in child after fork as suggested by cgd & Allan Briggs.
 1.37 04-Aug-1995  thorpej Zap compiler warnings in the check for a trace trap.
 1.36 12-May-1995  mycroft Add a child_return() function to clean up the child's state correctly, and
use this in cpu_fork(). Generalize proc_trampoline() so it can also be used in
this case.
 1.35 22-Apr-1995  christos Fixed comparison in SYS__syscall to be against sysent instead of
p->p_emul->e_sysent [Thanks Charles for pointing this out].
I think that this code needs to be fixed anyway for emulations where
SYS_syscall is not the same number as the NetBSD one (0)... (Only the
alpha port so far?)
 1.34 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.33 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.32 26-Mar-1995  cgd invoke ktrsyscall with (vp, code, argsize, args) as args.
 1.31 09-Mar-1995  mycroft Fix last arg to scdebug_ret().
 1.30 08-Mar-1995  mycroft Panic if the emulation type is invalid.
 1.29 08-Mar-1995  mycroft Fix some types:
* code, args, and rval should use register_t.
* argsize should be a size_t.
Remove old notimp() kluge; replaced by a better mechanism.
Add some of the SunOS compat hooks.
 1.28 08-Feb-1995  mycroft Update for split fu/su functions.
 1.27 18-Jan-1995  mycroft Display the correct diagnostic on a coprocessor exception. From Masaru Oki.
 1.26 26-Oct-1994  cgd new RCS ID format.
 1.25 25-Oct-1994  mycroft Attempt to deal with trace exceptions from single-stepping a trap instruction.
 1.24 20-Oct-1994  cgd update for new syscall args description mechanism
 1.23 23-May-1994  mycroft Oops. Missed one.
 1.22 23-May-1994  mycroft Small changes to match our tree.
 1.21 23-May-1994  mycroft Merge with 4.4-Lite.
 1.20 21-May-1994  cgd vmmeter
 1.19 20-May-1994  mycroft More swtch() changes.
 1.18 17-May-1994  cgd profiling stuff
 1.17 13-May-1994  mycroft Keeping up with the Chrises...
 1.16 07-May-1994  mycroft Nuke arg to softclock().
 1.15 07-May-1994  mycroft Update for signal changes.
 1.14 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.13 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.12 04-May-1994  mycroft Update to match proc.h.
 1.11 10-Apr-1994  mycroft Fix a couple of oversights in the last change.
 1.10 05-Apr-1994  mycroft Fix bogon in last change.
 1.9 02-Apr-1994  mycroft Implement __syscall(). Do the userret() thing. Some stylistic cleanup.
 1.8 04-Feb-1994  mycroft Hack to get softclock() arg correct. The arg should go away eventually.
 1.7 09-Jan-1994  mycroft Make trap_types a variable, so it can be imported by DDB.
 1.6 09-Jan-1994  mycroft Add DDB hook.
 1.5 07-Jan-1994  mycroft hpuxsysent -> hpux_sysent, hpuxnssysent -> nhpux_sysent
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 07-Jul-1993  cgd get rid of extraneous inclusion of seg.h
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.55.4.1 08-Sep-1997  thorpej Significantly restructure the way signal state for a process is stored.
Rather than using bitmasks to redundantly store the information kept
in the process's sigacts (because the sigacts was kept in the u-area),
hang sigacts directly off the process, and access it directly.

Simplify signal setup code tremendously by storing information in
the sigacts as an array of struct sigactions, rather than in a different
format, since userspace uses sigactions.

Make sigacts sharable by adding reference counting.
 1.71.4.1 02-Aug-1999  thorpej Update from trunk.
 1.72.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.72.4.1 15-Nov-1999  fvdl Sync with -current
 1.72.2.6 27-Mar-2001  bouyer Sync with HEAD.
 1.72.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.72.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.72.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.72.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.72.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.78.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.86.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.86.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.90.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.90.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.90.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.90.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.90.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.91.4.12 07-Jan-2003  thorpej In the SA universe, the switch-to-this-LWP decision is made at a
different level than where preempt() calls are made, which renders
the "newlwp" argument useless. Replace it with a "more work to do"
boolean argument. Returning to userspace preempt() calls pass 0.
"Voluntary" preemptions in e.g. uiomove() pass 1. This will be used
to indicate to the SA subsystem that the LWP is not yet finished in
the kernel.

Collapse the SA vs. non-SA cases of preempt() together, making the
conditional code block much smaller, and don't call sa_preempt() if
more work is to come.

NOTE: THIS IS NOT A COMPLETE FIX TO THE preempt()-in-uiomove() PROBLEM
THAT CURRENTLY EXISTS FOR SA PROCESSES.
 1.91.4.11 11-Nov-2002  nathanw Catch up to -current
 1.91.4.10 26-Sep-2002  nathanw Change "if (l->l_flag & L_SA_UPCALL)" to "while (l->l_flag & L_SA_UPCALL)"
in userret() functions or equivalent, to permit delivery of multiple upcalls
in a single kernel entry.

XXX It's getting crowded in here. Collapsing posting signals, upcalls, and
XXX kernel-exit handling into one mechanism would be nice.
 1.91.4.9 17-Sep-2002  nathanw Catch up to -current.
 1.91.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.91.4.7 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.91.4.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.91.4.5 08-Jan-2002  nathanw Catch up to -current.
 1.91.4.4 17-Dec-2001  nathanw cpu_upcall() -> sa_upcall_userret().
 1.91.4.3 25-Nov-2001  scw Deal with `want_resched' with trap()'s T_ASTFLT case where it belongs
instead of in userret().
 1.91.4.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.91.4.1 10-Sep-2001  scw file trap.c was added on branch nathanw_sa on 2001-11-18 18:09:34 +0000
 1.95.4.1 30-Aug-2002  gehenna catch up with -current.
 1.97.2.2 19-Dec-2002  gmcgarry Whitespace
 1.97.2.1 18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.100.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.100.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.100.2.2 03-Sep-2004  skrll Sync with HEAD
 1.100.2.1 03-Aug-2004  skrll Sync with HEAD
 1.112.12.8 21-Jan-2008  yamt sync with head
 1.112.12.7 07-Dec-2007  yamt sync with head
 1.112.12.6 15-Nov-2007  yamt sync with head.
 1.112.12.5 27-Oct-2007  yamt sync with head.
 1.112.12.4 03-Sep-2007  yamt sync with head.
 1.112.12.3 26-Feb-2007  yamt sync with head.
 1.112.12.2 30-Dec-2006  yamt sync with head.
 1.112.12.1 21-Jun-2006  yamt sync with head.
 1.114.6.2 01-Jun-2006  kardel Sync with head.
 1.114.6.1 22-Apr-2006  simonb Sync with head.
 1.114.4.1 09-Sep-2006  rpaulo sync with head
 1.114.2.1 01-Mar-2006  yamt sync with head.
 1.115.4.2 19-Apr-2006  elad sync with head - hopefully this will work
 1.115.4.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.115.2.3 11-Aug-2006  yamt sync with head
 1.115.2.2 24-May-2006  yamt sync with head.
 1.115.2.1 01-Apr-2006  yamt sync with head.
 1.116.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.116.2.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.125.10.2 23-Sep-2007  wrstuden Sync with somewhat-recent netbsd-4.
 1.125.10.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.125.8.2 11-Sep-2007  msaitoh Pull up following revision(s) (requested by mhitch in ticket #866):
sys/arch/atari/atari/trap.c: 1.92
sys/arch/mac68k/mac68k/trap.c: 1.129
sys/arch/amiga/amiga/trap.c: 1.116
sys/arch/mvme68k/mvme68k/trap.c: 1.91
sys/arch/news68k/news68k/trap.c: 1.54
sys/arch/sun3/sun3/trap.c: 1.131
sys/arch/next68k/next68k/trap.c: 1.68
sys/arch/luna68k/luna68k/trap.c: 1.47
sys/arch/cesfic/cesfic/trap.c: 1.36
sys/arch/x68k/x68k/trap.c: 1.90
sys/arch/hp300/hp300/trap.c: 1.132
68030 and 68040 processors consider the read portion of a read-modify-write
transfer as a write to ensure the memory is writable before starting any
transfer. The fault status information does not reflect this in the 'read'
status bit (i.e. it shows up as a read access), so faults with a RMW access
to non-writable memory was not getting the correct protection. The page would
be read-only and the instruction would fault over and over.
A specific example is when a process forks, and the child process attempts
to execute a RMW access to a data page, which is read-only because it's CoP
Copy-On-Write.
When checking if the page needs to be writablek, also check the locked transfer
and treat any locked transfer as a write.
68060 already handled this correctly, since it has separate read and write
fault bits, and both are set on a RMW access and the trap code was checking
the write status bit.
Fixes PR#36848.
 1.125.8.1 26-Jul-2007  pavel Pull up following revision(s) (requested by mhitch in ticket #729):
sys/arch/atari/atari/trap.c: revision 1.91
sys/arch/amiga/amiga/trap.c: revision 1.115
sys/arch/hp300/hp300/trap.c: revision 1.131
Pass a frame pointer to trap() rather than the 'entire frame' trick. Gcc4
was optimizing away modifications to the frame contents (it's not nice to
trick gcc). Pass the pointer as the first argument to reduce the number
of places that would be changed otherwise. Fixes the getcwd regression
test on most m68k ports.
 1.125.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.127.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.127.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.129.10.3 03-Oct-2007  garbled Sync with HEAD
 1.129.10.2 26-Jun-2007  garbled Sync with HEAD.
 1.129.10.1 22-May-2007  matt Update to HEAD.
 1.129.4.1 11-Jul-2007  mjf Sync with head.
 1.129.2.4 03-Dec-2007  ad Sync with HEAD.
 1.129.2.3 09-Oct-2007  ad Sync with head.
 1.129.2.2 15-Jul-2007  ad Sync with head.
 1.129.2.1 27-May-2007  ad Sync with head.
 1.131.10.2 09-Jan-2008  matt sync with HEAD
 1.131.10.1 06-Nov-2007  matt sync with HEAD
 1.131.8.4 09-Dec-2007  jmcneill Sync with HEAD.
 1.131.8.3 06-Nov-2007  joerg Sync with HEAD.
 1.131.8.2 28-Oct-2007  joerg Sync with HEAD.
 1.131.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.131.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.132.4.1 13-Nov-2007  bouyer Sync with HEAD
 1.135.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.135.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.136.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.137.8.1 18-May-2008  yamt sync with head.
 1.137.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.137.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.138.8.1 19-Oct-2008  haad Sync with HEAD.
 1.138.4.4 30-Jun-2008  wrstuden Change how we make SA threads not generate upcalls. Instead of clearing
LW_SA, use a private flag, LP_SA_NOBLOCK, that we set when we want
to not generate upcalls. This means we do NOT need to lock (l)
(ourselves) to set it.

Adjust tests that look at LW_SA. Now, we are an upcall-generating
lwp if ((l->l_flag & LW_SA) && (~l->l_pflag & LP_SA_NOBLOCK)).

Introduce code pattern to set & remember this:

f = ~l->l_pflag & LP_SA_NOBLOCK;
l->l_pflag |= LP_SA_NOBLOCK;

...

/* f is now LP_SA_NOBLOCK if it wasn't set in l_pflag before */

l->l_pflag ^= f;

I updated a lot of the trap handlers to do trap handling iff LP_SA_NOBLOCK
is not set. I tried to figure out if the trap handler could be triggered
for user-based faults as opposed to kernel faults to user addresses, and
only look at LP_SA_NOBLOCK for the latter.

Above is a result of discussions with rmind at to reduce lock twiddling.

Also, per same discussions, add locking to sys_sa_preempt(). p_lock is
the lock we want.

Also, per same discussions, remove use of LSSUSPENDED as a thread state.
We needed to use it when we were emulating the 4.X and previous behavior
of hiding cached threads. For the moment, we now have them instead
remain visible to all and have them sleeping on the "lwpcache" wait
channel.

sa_newcachelwp(): sa_putcachelwp() wants savp_mutex held, not p_lock.

Tweak some comments.
 1.138.4.3 22-Jun-2008  wrstuden Re-add cpu_upcall() and page fault code. i386 kernels now compile.
They don't boot, but that seems to be a consequence of current from the
day this branch was started.
 1.138.4.2 14-May-2008  wrstuden Per discussion with ad at n dot o, revert signal mask handling
changes.

The l_sigstk changes are most likely totally un-needed as SA will
never use a signal stack - we send an upcall (or will as other
diffs are brought in).

The l_sigmask changes were too controvertial. In all honesty, I
think it's probably best to revert them. The main reason they were
there is the fact that in an SA process, we don't mask signals per
kernel thread, we mask them per user thread. In the kernel, we want
them all to get turned into upcalls. Thus the normal state of
l_sigmask in an SA process is for it to always be empty.

While we are in the process of delivering a signal, we want to
temporarily mask a signal (so we don't recursively exhaust our
upcall stacks). However signal delivery is rare (important, but
rare), and delivering back-to-back signals is even rarer. So rather
than cause every user of a signal mask to be prepared for this very
rare case, we will just add a second check later in the signal
delivery code. Said change is not in this diff.

This also un-compensates all of our compatability code for dealing
with SA. SA is a NetBSD-specific thing, so there's no need for
Irix, Linux, Solaris, SVR4 and so on to cope with it.

As previously, everything other than kern_sa.c compiles in i386
GENERIC as of this checkin. I will switch to ALL soon for compile
testing.
 1.138.4.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.138.2.3 11-Aug-2010  yamt sync with head.
 1.138.2.2 11-Mar-2010  yamt sync with head
 1.138.2.1 04-May-2009  yamt sync with head.
 1.139.4.1 02-Feb-2009  snj Pull up following revision(s) (requested by martin in ticket #332):
sys/arch/amiga/amiga/trap.c: revision 1.122
sys/arch/atari/atari/trap.c: revision 1.99
sys/arch/cesfic/cesfic/trap.c: revision 1.43
sys/arch/hp300/hp300/trap.c: revision 1.140
sys/arch/luna68k/luna68k/trap.c: revision 1.55
sys/arch/m68k/include/signal.h: revision 1.25
sys/arch/m68k/m68k/sig_machdep.c: revision 1.41
sys/arch/mac68k/mac68k/trap.c: revision 1.136 via patch
sys/arch/mvme68k/mvme68k/trap.c: revision 1.98
sys/arch/news68k/news68k/trap.c: revision 1.60
sys/arch/next68k/next68k/trap.c: revision 1.75
sys/arch/sun2/sun2/trap.c: revision 1.37
sys/arch/sun3/sun3/trap.c: revision 1.136
sys/arch/x68k/x68k/trap.c: revision 1.97
Centralize fpu exception to siginfo code encoding for all m68k archs,
fixes a failure in the lib/libc/ieeefp/except regression test.
 1.139.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.141.4.3 05-Mar-2011  rmind sync with head
 1.141.4.2 03-Jul-2010  rmind sync with head
 1.141.4.1 30-May-2010  rmind sync with head
 1.141.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.141.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.145.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.146.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.146.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.148.8.1 24-Feb-2012  mrg sync to -current.
 1.148.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.148.4.1 17-Apr-2012  yamt sync with head
 1.149.4.1 28-Aug-2013  rmind sync with head
 1.149.2.2 03-Dec-2017  jdolecek update from HEAD
 1.149.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.150.6.1 06-Apr-2015  skrll Sync with HEAD
 1.151.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.151.18.1 10-Jun-2019  christos Sync with HEAD
 1.155.4.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.20 13-Jan-2024  thorpej Switch hp300 over to the common m68k vector table.
 1.19 11-Dec-2005  christos merge ktrace-lwp.
 1.18 17-Nov-2003  tsutsui TAB/space cleanup.
 1.17 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.16 17-Nov-2001  gmcgarry branches: 1.16.16;
Make hil interrupts come through the standard dispatch mechanism rather
than its custom handler.
 1.15 04-Oct-1998  thorpej branches: 1.15.26; 1.15.30;
Sigh, we are going to have to burn a vector for Just Sigreturn again,
for now, until we have a more generic {get,set}context(). Update the
comment for trap #3 accordingly.
 1.14 30-Sep-1998  thorpej If !COMPAT_13, make trap #1 produce an illegal instruction. Fix the comment
for trap #2 to reflect that it's the trace trap.
 1.13 30-Sep-1998  thorpej Note that trap #1 is compat_13_sigreturn, and give trap #3 to syscalls
which require special handling, e.g. sigreturn on m68k.

This differs from the old sigreturn trap in that we require the syscall
number to be in register d0, just like the regular syscall entry point.
This will allow sigreturn to be versioned in the future without the need
to allocate another trap vector.
 1.12 14-Jul-1997  thorpej New bus error/address error trap handlers, code lifted from mac68k
port, which is lifted from amiga port, plus some changes from me:
- Add support for the HP MMU to the 020/030 bus/address error handler
(mostly lifted wholesale from the old code).
- Rename addrerr and buserr to busaddrerr2030. The new name reflects that
these functions are specific to the 68020 and 68030, and that the same
handler function is used for both vectors.

The vector table is patched once we know our CPU type, before the MMU
is enabled. In the event that we're running on a CPU that we're not
configured for, simply invoke the PROM's "reboot request"; we have no
hope of running in the event of a config botch, since we need working
a working bus error handler for console initialization.

These new functions optimze for common-case page faults, eliminate
many run-time checks, and are sharable.
 1.11 25-Apr-1997  thorpej Don't make assumptions about how C labels are handled, use macros
provided by <machine/asm.h> instead.
 1.10 14-Oct-1996  thorpej Garbage collect the "kernel jump to zero" stuff. VA 0 is now invalid,
so the kernel will fault if the PC gets trashed like that.
 1.9 18-May-1996  thorpej Put the vector table back in the text segment; putting it in the data
segment breaks doboot() on my 319 (but worked on my 380...bleh!)
 1.8 17-May-1996  thorpej Move the vector table to the data segment.
 1.7 14-Feb-1996  thorpej New interrupt handling code. Highlights:
- Interrupt service routines now take a pointer to
the device's softc, rather than a unit number.
- Interrupt handling code in locore.s condensed. Only
remaining "special" handlers are lev0 (spurious),
lev1 (HIL; don't ask), lev6 (clock), and lev7 (NMI).
Only remaining hard-coded device driver reference in
locore is HIL. (clock doesn't count...)
- "dcafastservice" eliminated. DCA driver has new mechanism
to guarantee prompt interrupt service at any ipl (not
just level 5).
- Interrupt code pulled out of autoconf.c and machdep.c and
placed in new file, isr.c
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 05-Jul-1994  mycroft Redo the interface to FPSP, using the supplied glue code.
 1.4 03-Jul-1994  mycroft Switch to Motorola emulator.
 1.3 23-May-1994  mycroft Merge with 4.4-Lite.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.15.30.1 08-Jan-2002  nathanw Catch up to -current.
 1.15.26.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.16.1 03-Aug-2004  skrll Sync with HEAD
 1.66 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.65 15-Mar-2002  gmcgarry Add RCSIDs.
 1.64 04-Mar-2002  simonb Don't need to declare phys_map - it is declared in <uvm/uvm_extern.h>.
 1.63 26-Feb-2002  simonb Purge CLSIZE, CLSIZELOG2 and MCLOFSET.
Be consistant in the way that MSIZE, MCLSHIFT, MCLBYTES and NMBCLUSTERS
are defined.
Remove old VM constants from cesfic port.
Bump MSIZE to 256 on mipsco (the only one that wasn't already 256).
 1.62 08-Dec-2001  gmcgarry bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
 1.61 10-Sep-2001  chris branches: 1.61.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.60 06-Jul-2001  chs branches: 1.60.2; 1.60.4;
use pmap_k* for pagemove().
call pmap_remove() explicitly in vunmapbuf() in preparation for
upcoming UVM changes.
 1.59 02-Jun-2001  chs replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.58 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.57 29-Jun-2000  mrg branches: 1.57.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.56 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.55 28-May-2000  thorpej Rather than starting init and creating kthreads by forking and then
doing a cpu_set_kpc(), just pass the entry point and argument all
the way down the fork path starting with fork1(). In order to
avoid special-casing the normal fork in every cpu_fork(), MI code
passes down child_return() and the child process pointer explicitly.

This fixes a race condition on multiprocessor systems; a CPU could
grab the newly created processes (which has been placed on a run queue)
before cpu_set_kpc() would be performed.
 1.54 20-Jan-2000  sommerfeld branches: 1.54.2;
Fix PR9240: comment above cpu_fork() out of synch with reality on most ports.
(comment change only, but was wrong for more than just i386).
 1.53 04-Dec-1999  ragge CL* discarding.
 1.52 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.51 08-Jul-1999  thorpej branches: 1.51.2; 1.51.4; 1.51.8;
Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.50 26-May-1999  thorpej Generally update the comment above vunmapbuf().
 1.49 26-May-1999  thorpej Generally update the comment above the vmapbuf() implementations.
 1.48 13-May-1999  thorpej Allow the caller to specify a stack for the child process. If NULL,
the child inherits the stack pointer from the parent (traditional
behavior). Like the signal stack, the stack area is secified as
a low address and a size; machine-dependent code accounts for stack
direction.

This is required for clone(2).
 1.47 26-Mar-1999  mycroft branches: 1.47.4;
Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.46 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.45 11-Nov-1998  thorpej Changes to support fork_kthread():
- cpu_set_kpc() now takes void *arg third argument, passed to the
entry point.
- cpu_fork() allows parent to be non-curproc iff parent is proc0.
When forking non-curproc, assume its state has already been saved.
- Adjust various pieces of machine-dependent code to account of all of this.
 1.44 09-Sep-1998  thorpej In cpu_coredump(), use MID_MACHINE rather than MID_* (whatever it expands
to).
 1.43 09-Sep-1998  thorpej Adjust for the new "reaper" kernel thread: do not free the vmspace and
u-area in machine-dependent code. Instead, call exit2() to schedule
the reaper to free them for us, once it is safe to do so (i.e. we are
no longer running on the dead proc's vmspace and stack).
 1.42 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.41 28-Jul-1998  thorpej Don't cast the null residual pointer passed to vn_rdwr().
 1.40 16-Feb-1998  thorpej Add support for UVM.
 1.39 06-Jan-1998  thorpej Garbage-collect PMAP_ACTIVATE() call here; it's no longer necessary.
 1.38 11-Oct-1997  scottr Address PR 4120 by synchronizing v{,un}mapbuf() with the i386 vm_machdep.c,
v 1.27, pulling in changes made there by Charles Hannum. Also, incorporate
a few tweaks made by Gordon W. Ross in the sun3 version of this change.
 1.37 26-May-1997  thorpej branches: 1.37.4;
Garbage-collected long-unused setredzone().
 1.36 19-May-1997  veego Fix lossage from the latest vm_pmap changes.
 1.35 01-Apr-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.34 16-Mar-1997  thorpej In cpu_coredump(), don't bother dumping an HP-UX style u-area. What it
produced was useful once, but isn't worth the clutter now.
 1.33 16-Mar-1997  thorpej Nuke MDP_HPUXTRACE.
 1.32 15-Mar-1997  thorpej In cpu_coredump(), use `fputype' to decide if we dump FP regs.
 1.31 02-Feb-1997  thorpej Garbage-collect extra copy of mappedcopy.
 1.30 09-May-1996  scottr Prototyping-related changes I missed the last time, from Thorsten
Frueauf. Closes PR 2378.
 1.29 02-May-1996  scottr Fix prototypes of cpu_set_kpc() and pagemove(); closes PR 2367.
 1.28 09-Feb-1996  scottr Specify return type for vunmapbuf()
 1.27 05-Feb-1996  christos vm prototype changes
 1.26 09-Dec-1995  mycroft cpu_fork() now returns void.
 1.25 07-Aug-1995  mycroft Make new-style core dumps.
 1.24 25-May-1995  mycroft Update curpcb before possibly copying it.
 1.23 12-May-1995  mycroft Add a child_return() function to clean up the child's state correctly, and
use this in cpu_fork(). Generalize proc_trampoline() so it can also be used in
this case.
 1.22 12-May-1995  mycroft Stylistic change.
 1.21 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.20 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.19 12-Apr-1995  mycroft Change some usages of UPAGES to USPACE.
 1.18 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.17 26-Oct-1994  cgd new RCS ID format.
 1.16 20-Oct-1994  mycroft Add a cpu_cleanup() function, to support some experimental code.
 1.15 09-Sep-1994  mycroft Nuke struct ste, struct ste40, struct pte, and HP_PAGE_SIZE. Use my
pv_entry allocator. Change pa_index() to pmap_page_index() for consistency
with other ports.
 1.14 19-Jul-1994  mycroft MDP_AST is deprecated.
 1.13 23-May-1994  mycroft branches: 1.13.2;
Small changes to match our tree.
 1.12 23-May-1994  mycroft Merge with 4.4-Lite.
 1.11 20-May-1994  mycroft More swtch() changes.
 1.10 20-May-1994  mycroft Fix cpu_coredump().
 1.9 19-May-1994  mycroft Gah. Need vnode.h.
 1.8 19-May-1994  mycroft Add cpu_coredump().
 1.7 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.6 05-Apr-1994  mycroft p_regs fix from amiga.
 1.5 14-Aug-1993  mycroft Note new location of pte.h.
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 07-Jul-1993  cgd cpu_exit() returns void
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.13.2.1 14-Aug-1994  mycroft update from trunk (nuke MDP_AST)
 1.37.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.47.4.2 02-Aug-1999  thorpej Update from trunk.
 1.47.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.51.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.51.4.1 15-Nov-1999  fvdl Sync with -current
 1.51.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.54.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.57.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.60.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.60.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.60.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.60.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.60.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.61.4.11 11-Nov-2002  nathanw Catch up to -current
 1.61.4.10 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.61.4.9 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.61.4.8 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.61.4.7 28-Feb-2002  nathanw Catch up to -current.
 1.61.4.6 08-Jan-2002  nathanw Catch up to -current.
 1.61.4.5 15-Dec-2001  gmcgarry md_flags -> mdp_flags
 1.61.4.4 08-Dec-2001  thorpej Add a cpu_proc_fork(), called from uvm_proc_fork(), which takes care
of machine-dependent handling a fork() time (this is different from
forking the actual context in an LWP world). #define it away on
platforms which do not need it.

Problem noted by Gregory McGarry.
 1.61.4.3 08-Dec-2001  thorpej cpu_fork() -> cpu_lwp_fork(). This logically forks an LWP, not a
complete process. As noted by Gregory McGarry on tech-kern.
 1.61.4.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.61.4.1 10-Sep-2001  scw file vm_machdep.c was added on branch nathanw_sa on 2001-11-18 18:09:34 +0000
 1.29 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.28 12-Jul-2018  maxv branches: 1.28.36;
Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.27 24-Dec-2015  christos branches: 1.27.16; 1.27.18;
fenv for m68k
 1.26 17-Jul-2011  joerg branches: 1.26.12; 1.26.30;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.25 04-Mar-2007  tsutsui Stop installing <machine/intr.h> on hp300. Suggested by simonb.
 1.24 09-Feb-2007  ad branches: 1.24.2;
Merge newlock2 to head.
 1.23 26-Jul-2006  drochner branches: 1.23.4;
don't install <machine/db_machdep.h>, this is kernel only
 1.22 01-Jul-2006  tsutsui No need to install autoconf.h.
 1.21 11-Dec-2005  christos branches: 1.21.4; 1.21.8; 1.21.16;
merge ktrace-lwp.
 1.20 08-May-2004  kleink branches: 1.20.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.19 17-Jan-2003  thorpej branches: 1.19.2;
Merge the nathanw_sa branch.
 1.18 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.17 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.16 28-Nov-2001  kleink branches: 1.16.8;
No point in installing svr4_machdep.h.
 1.15 15-Apr-2001  kleink branches: 1.15.2; 1.15.8;
Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.14 15-Apr-2001  kleink Add definitions of C99 specified-width integer type limits.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.13 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
 1.12 14-Apr-2001  kleink Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.11 26-Jun-2000  kleink branches: 1.11.2;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.10 29-Apr-2000  thorpej Require that each each MACHINE/MACHINE_ARCH supply a lock.h. This file
contains the values __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED, which
replace the old SIMPLELOCK_LOCKED and SIMPLELOCK_UNLOCKED. These files
are also required to supply inline functions __cpu_simple_lock(),
__cpu_simple_lock_try(), and __cpu_simple_unlock() if locking is to be
supported on that platform (i.e. if MULTIPROCESSOR is defined in the
_KERNEL case). Change these functions to take an int * (&alp->lock_data)
rather than the struct simplelock * itself.

These changes make it possible for userland to use the locking primitives
by including <machine/lock.h>.
 1.9 17-Mar-2000  tron Install "machineendian_machdep.h".
 1.8 23-Dec-1999  kleink C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
 1.7 21-Dec-1999  frueauf As per Chris G. Demetriou <cgd@netbsd.org> don't install
loadfile_machdep.h into /usr/include/hp300/, instead create a
link for machine and hp300 in ${.OBJDIR} like
sys/arch/alpha/stand/Makefile.buildboot does for alpha.
 1.6 20-Dec-1999  frueauf Add loadfile_machdep.h to includes to be installed - this makes
sys/arch/hp300/stand/* compile again.
 1.5 19-Apr-1999  kleink branches: 1.5.2; 1.5.8;
Add COMPAT_SVR4 for m68k.
 1.4 15-Mar-1999  minoura branches: 1.4.4;
Pullin m68k/ieee.h.
 1.3 15-Jan-1999  bouyer Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
 1.2 12-Jul-1998  veego Add elf_machdep.h to the INCS list.
 1.1 12-Jun-1998  cgd Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.15.8.5 11-Dec-2002  thorpej Sync with HEAD.
 1.15.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.15.8.3 08-Jan-2002  nathanw Catch up to -current.
 1.15.8.2 10-Nov-2001  scw Kernel mcontext glue for Scheduler Activations on m68k from
Klaus Klein <kleink@netbsd.org>.
 1.15.8.1 15-Apr-2001  scw file Makefile was added on branch nathanw_sa on 2001-11-10 21:22:49 +0000
 1.15.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.8.1 30-Aug-2002  gehenna catch up with -current.
 1.19.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.19.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.12.3 03-Sep-2007  yamt sync with head.
 1.20.12.2 26-Feb-2007  yamt sync with head.
 1.20.12.1 30-Dec-2006  yamt sync with head.
 1.21.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.21.8.1 11-Aug-2006  yamt sync with head
 1.21.4.1 09-Sep-2006  rpaulo sync with head
 1.23.4.1 01-Feb-2007  ad Header file cleanup.
 1.24.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.30.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.26.12.1 03-Dec-2017  jdolecek update from HEAD
 1.27.18.1 10-Jun-2019  christos Sync with HEAD
 1.27.16.1 28-Jul-2018  pgoyette Sync with HEAD
 1.28.36.1 02-Aug-2025  perseant Sync with HEAD
 1.5 07-May-2019  kamil Switch all users (except ia64) of custom machine/ansi.h to common_ansi.h

Deduplicate the code among ports and poll definitions of types
directly from a compiler.

This fixes miscompilation of certain programs that instruct compilers
to generate code for different types. This bug has been detected with
-fshort-wchar in EFI firmware.

Proposed and discussed on a mailing list (twice).

Itanium uses custom !ELF fallback switch, temporarily leave it as it is.
 1.4 26-Oct-1994  cgd branches: 1.4.256;
new RCS ID format.
 1.3 08-Jan-1994  cgd stubs which pint to m68k include
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd add from net2. were symlinks to ../../vax/include/*
 1.4.256.1 10-Jun-2019  christos Sync with HEAD
 1.14 06-Dec-2005  tsutsui Remove multiple inclusion protection from files which just include
MI m68k headers and don't have any own declarations.
 1.13 15-Mar-1997  thorpej branches: 1.13.56; 1.13.72;
Don't set __LDPGSZ to 4096; we use 8192 like the rest of m68k-land, now.
 1.12 08-Oct-1996  cgd repoint at shared aout_machdep.h, not exec.h
 1.11 08-Sep-1996  thorpej Use <m68k/exec.h>.
 1.10 20-Nov-1995  thorpej Garbage collect some stuff that isn't used. Rename the relocation info
structure to be consistent with the other m68k ports. XXX that struct needs
to move to an m68k common file.
 1.9 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.8 26-Oct-1994  cgd new RCS ID format.
 1.7 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.6 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.5 18-Oct-1993  pk Put definition of __LDPGSZ and `struct relocation_info' where they belong:
in <machine/exec.h>.
 1.4 19-Aug-1993  mycroft Remove cpu_exec_makecmds() macro and declare it as a function. Also, wrap
everything in `#ifdef KERNEL'.
 1.3 04-Jun-1993  cgd fix stupid missing ||
 1.2 03-Jun-1993  cgd add support for a macro to be called from execve to check a_mid type
 1.1 02-Jun-1993  cgd machine-dependent exec stuff
 1.13.72.1 21-Jun-2006  yamt sync with head.
 1.13.56.1 11-Dec-2005  christos Sync with head.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 23-Jan-1994  cgd stub
 1.13 20-Apr-2014  tsutsui Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.

The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.

Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.

Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).

XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
 1.12 06-Feb-2011  tsutsui branches: 1.12.4; 1.12.10; 1.12.14; 1.12.18; 1.12.28;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.11 28-Apr-2008  martin branches: 1.11.22; 1.11.28; 1.11.30;
Remove clause 3 and 4 from TNF licenses
 1.10 04-Mar-2007  christos branches: 1.10.40; 1.10.42; 1.10.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 06-Dec-2005  tsutsui branches: 1.9.26;
Protect against multiple inclusion.
 1.8 25-Sep-2002  thorpej branches: 1.8.6; 1.8.22;
Replace resource map usage with extent maps.
 1.7 14-Dec-2001  gmcgarry Update the console attach interface now that bus_space is available.
Basically means that hardware drivers with console attachments are
now largely machine independent.
 1.6 06-Oct-1998  thorpej branches: 1.6.26; 1.6.30;
configure() prototype is in <sys/device.h>
 1.5 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.4 01-Apr-1997  scottr branches: 1.4.4;
Add prototypes as appropriate.
 1.3 03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.2 28-Feb-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.4.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.30.2 18-Oct-2002  nathanw Catch up to -current.
 1.6.30.1 08-Jan-2002  nathanw Catch up to -current.
 1.6.26.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.26.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.22.2 03-Sep-2007  yamt sync with head.
 1.8.22.1 21-Jun-2006  yamt sync with head.
 1.8.6.1 11-Dec-2005  christos Sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.44.1 16-May-2008  yamt sync with head.
 1.10.42.1 18-May-2008  yamt sync with head.
 1.10.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.22.1 05-Mar-2011  rmind sync with head
 1.12.28.1 10-Aug-2014  tls Rebase.
 1.12.18.1 18-May-2014  rmind sync with head
 1.12.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.12.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 28-Aug-2004  thorpej De-__P
 1.5 24-Mar-2004  drochner remove license clauses 3 and 4 from my cpoyright notices
 1.4 14-Dec-1999  thorpej branches: 1.4.2; 1.4.8; 1.4.32;
Nuke unused btinfo_symtab field.
 1.3 14-Dec-1999  thorpej Add console type for APCI.
 1.2 14-Dec-1999  thorpej Add a type field to btinfo_bootpath.
 1.1 14-Dec-1999  thorpej Add a bootinfo facility, as is used on i386 and pmax, ports. We expect
the bootinfo to be located in the first page of kernel text (which has
been zero-filled for a Very Long Time to allow us to unmap KVA 0); the
boot loader will place it there after loading the kernel image.
 1.4.32.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.32.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.32.2 03-Sep-2004  skrll Sync with HEAD
 1.4.32.1 03-Aug-2004  skrll Sync with HEAD
 1.4.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.8.1 14-Dec-1999  bouyer file bootinfo.h was added on branch thorpej_scsipi on 2000-11-20 20:08:08 +0000
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2 21-Aug-1999  simonb Include <sys/bswap.h> for function prototypes. i386, pc532 and vax
still include <machine/byte_swap.h> and define macros for some of
the bswap*() functions.
 1.1 15-Jan-1999  bouyer Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
 1.24 27-Jan-2023  tsutsui hp300: Specify proper constraints for bus_space_read region and multi ops.

Synk with next68k.
Also use consistent register name constrains, i.e. no '%' prefix.
 1.23 15-Jan-2023  tsutsui TAB/space cleanup.
 1.22 07-Mar-2021  skrll branches: 1.22.18;
Provide a bus_space_mmap that always fails. Nothing uses it yet, but it
will be very soon.

OK tsutsui@
 1.21 23-Jan-2021  christos Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.
 1.20 02-Apr-2020  msaitoh branches: 1.20.4;
s/impliment/implement/ in comment.
 1.19 23-Sep-2019  skrll Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
 1.18 07-May-2012  tsutsui branches: 1.18.40;
Add dummy bus_dma(9) typedefs (enabled by __HAVE_NO_BUS_DMA) in <sys/bus.h>
for ports which don't bother to have unnecessary bus_dma(9) implementation
to appease MI driver modules that require bus_dma_tag_t.

For amiga, move <m68k/bus_dma.h> inclusion from <machine/pci_machdep.h>
to <machine/bus.h> since amiga will want actual bus_dma(9) in future
for PCI devices.

Fixes builds on sys/modules/if_axe etc on ancient ports.

"Sounds good" from martin@ on port-m68k@.
 1.17 18-Feb-2011  tsutsui branches: 1.17.4; 1.17.8;
Add definitions for stream methods.
 1.16 12-Feb-2011  tsutsui Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.
 1.15 28-Apr-2008  martin branches: 1.15.22; 1.15.28; 1.15.30;
Remove clause 3 and 4 from TNF licenses
 1.14 16-Nov-2006  christos branches: 1.14.52; 1.14.54; 1.14.56;
__unused removal on arguments; approved by core.
 1.13 16-Feb-2006  perry branches: 1.13.14; 1.13.16;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.12 24-Dec-2005  perry branches: 1.12.2; 1.12.4; 1.12.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 02-Jan-2005  tsutsui branches: 1.10.10;
u_intNN_t -> uintNN_t
 1.9 28-Aug-2004  thorpej De-__P
 1.8 17-Nov-2003  tsutsui TAB/space cleanup.
 1.7 01-Aug-2003  tsutsui Modify hp300 bus_space(9) structures/functions to add hooks to override
access functions. This is required by some DIO devices to use MI drivers.
 1.6 02-Dec-2001  gmcgarry branches: 1.6.16;
Type cast for bus_space_vaddr()
 1.5 08-Nov-2001  gmcgarry branches: 1.5.2;
Implement bus_space_vaddr()
 1.4 25-Jan-2000  drochner branches: 1.4.8; 1.4.10;
define a "BUS_SPACE_MAP_PREFETCHABLE" flag which basically means that
device accesses are idempotent (but should not be cached by the CPU)
 1.3 26-Oct-1999  thorpej Add register prefixes.
 1.2 23-Mar-1999  drochner branches: 1.2.8; 1.2.10; 1.2.12;
Add a macro to check for sufficient pointer alignment in bus.h context,
"BUS_SPACE_ALIGNED_POINTER()".
Equal to the param.h "ALIGNED_POINTER()" normally, but obeys additional
requirements of the bus_space_xxx_n() macros. (BUS_SPACE_DEBUG)
 1.1 11-Jan-1998  thorpej bus.h for the hp300 port. Only supports bus_space for now.
 1.2.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.10.1 15-Nov-1999  fvdl Sync with -current
 1.2.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.10.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.4.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.2.1 08-Nov-2001  nathanw file bus.h was added on branch nathanw_sa on 2002-01-08 00:24:44 +0000
 1.6.16.5 17-Jan-2005  skrll Sync with HEAD.
 1.6.16.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.16.3 18-Sep-2004  skrll Sync with HEAD.
 1.6.16.2 03-Sep-2004  skrll Sync with HEAD
 1.6.16.1 03-Aug-2004  skrll Sync with HEAD
 1.10.10.2 30-Dec-2006  yamt sync with head.
 1.10.10.1 21-Jun-2006  yamt sync with head.
 1.12.6.1 22-Apr-2006  simonb Sync with head.
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.12.2.1 18-Feb-2006  yamt sync with head.
 1.13.16.1 10-Dec-2006  yamt sync with head.
 1.13.14.1 18-Nov-2006  ad Sync with head.
 1.14.56.1 16-May-2008  yamt sync with head.
 1.14.54.1 18-May-2008  yamt sync with head.
 1.14.52.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.30.2 05-Mar-2011  bouyer Sync with HEAD
 1.15.30.1 17-Feb-2011  bouyer Sync with HEAD
 1.15.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.15.22.1 05-Mar-2011  rmind sync with head
 1.17.8.1 02-Jun-2012  mrg sync to latest -current.
 1.17.4.1 23-May-2012  yamt sync with head.
 1.18.40.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.18.40.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.20.4.1 03-Apr-2021  thorpej Sync with HEAD.
 1.22.18.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.8 27-Dec-2023  thorpej Re-factor the 680x0 Function Code definitions into their own
separate file (as was done on the sun2/sun3 ports ages ago)
and switch everyone to the common header.
 1.7 16-Feb-2006  perry Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.6 24-Dec-2005  perry branches: 1.6.2; 1.6.4; 1.6.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 28-Sep-2003  cl branches: 1.4.16;
add register storage class for gcc3
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 03-Nov-2002  chs branches: 1.2.2; 1.2.8;
use "static __inline" instead of "extern __inline" so that we can
build without optimization.
 1.1 02-Nov-2002  chs finish conversion to the common m68k cacheops:
add support for machine-specific flavors of the ops for off-chip caches.
many thanks to Izumi Tsutsui for his help with this.
 1.2.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.8.1 03-Aug-2004  skrll Sync with HEAD
 1.2.2.2 11-Nov-2002  nathanw Catch up to -current
 1.2.2.1 03-Nov-2002  nathanw file cacheops_machdep.h was added on branch nathanw_sa on 2002-11-11 21:58:31 +0000
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.6.2.1 18-Feb-2006  yamt sync with head.
 1.2 06-Dec-2005  tsutsui Remove multiple inclusion protection from files which just include
MI m68k headers and don't have any own declarations.
 1.1 19-Jan-1995  jtc branches: 1.1.66; 1.1.82;
This file, which will be included by <sys/cdefs.h>, will contain macros
such as __warn_references() and __weak_reference() which are actually
machine dependant. This will make it easier for ports that are being
bootstraped with ELF and ECOFF based toolchains.

This change also introduces a new macro, _C_LABEL(x). _C_LABEL expands
its argument, an identifier, to a character string of the identifier
name as it is represented in an object file.

For most ports, _C_LABEL(x) will expand to "_x", for ELF based ports
_C_LABEL(x) will expand to "x".
 1.1.82.1 21-Jun-2006  yamt sync with head.
 1.1.66.1 11-Dec-2005  christos Sync with head.
 1.78 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.77 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.76 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.75 13-Jan-2024  thorpej Switch hp300 over to the common m68k vector table.
 1.74 09-Jan-2024  thorpej Remove duplicated / slightly-tweaked loadustp() (load user segment table)
routines from all of the m68k ports using the shared pmap. Instead, in
pmap_init(), set up a function pointer to the appropriate mmu_load_urp*()
function in mmu_subr.s.
 1.73 15-Jan-2023  tsutsui TAB/space cleanup.
 1.72 23-Nov-2019  ad branches: 1.72.26;
cpu_need_resched():

- Remove all code that should be MI, leaving the bare minimum under arch/.
- Make the required actions very explicit.
- Pass in LWP pointer for convenience.
- When a trap is required on another CPU, have the IPI set it locally.
- Expunge cpu_did_resched().
 1.71 18-Feb-2019  thorpej Refactor the 68040 writeback() from each m68k port's trap handler into a
shared copy: m68040_writeback(). It is essentially a copy of the Atari
version, with some minor cosmetic tweaks and one small performance optimization
from the mvme68k port.

Tested by rjs@ on a Quadra 950. (Thanks!)
 1.70 22-Aug-2018  msaitoh - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
- Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
use them on all m68k machines.
 1.69 17-Dec-2016  flxd branches: 1.69.14; 1.69.16;
Fix typo "one the" and architecture where appropriate.
 1.68 19-Oct-2013  christos branches: 1.68.6; 1.68.10;
make cpu_need_resched() macros consistent; __USE flags
 1.67 02-Feb-2012  tsutsui branches: 1.67.6; 1.67.10;
Always include <m68k/cpu.h> (i.e. outside #if defined(_KERNEL))
for crash(8) as amiga and sun3. There are _KERNEL protections in it.

Briefly tested by "build.sh -m news68k -U build".
Further possible botch will be fixed later.
 1.66 16-May-2011  tsutsui branches: 1.66.4; 1.66.8;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.
 1.65 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.64 25-Dec-2010  tsutsui branches: 1.64.2; 1.64.4;
Make sure MAXADDR is unsigned otherwise it could be mangled in shift ops
and causes silent hang on bootstrap. Analyzed on HP9000/362 I get today,
but I'm not sure how 040 lkptpa code has worked on my HP382...
 1.63 22-Dec-2010  matt Collect cpu_info and friends and move to m68k/include/cpu.h
Add a define __HAVE_CPU_DATA_FIRST which means that cpu_data is the first
member in struct cpu_info.
 1.62 11-Dec-2009  tsutsui branches: 1.62.4;
MAXADDR used for PA == VA mapping should be page size dependent.
 1.61 21-Oct-2009  rmind Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.60 29-Jul-2009  rmind Fix few more l_pflag and LP_OWEUPC confusions.
 1.59 27-Feb-2008  xtraeme branches: 1.59.4; 1.59.14; 1.59.20; 1.59.22;
Remove CTL_MACHDEP_NAMES, it's not used anywhere.

Ok by martin@.
 1.58 28-Jan-2008  tsutsui branches: 1.58.2; 1.58.6;
- account idepth in a clock interrupt handler too
- use idepth for CLKF_INTR()
 1.57 17-Oct-2007  garbled branches: 1.57.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.56 30-Sep-2007  tsutsui Use unsigned values for device addresses.
 1.55 04-Aug-2007  ad branches: 1.55.2; 1.55.4;
Add ci_cpuid where it's missing.
 1.54 21-May-2007  tsutsui branches: 1.54.2; 1.54.4; 1.54.8;
Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
 1.53 20-May-2007  mhitch Add missing call to lwp_startup() in lwp_trampoline() (which was renamed
from proc_trampoline to match the other ports).

A DIAGNOSTIC kernel will now boot and run. LOCKDEBUG still doesn't work yet.
Also, my amiga no longer loses time.
 1.52 18-May-2007  tsutsui Adapt hp300 to yamt-idlelwp. Tested on 9000/382.
 1.51 04-Mar-2007  tsutsui branches: 1.51.2; 1.51.4; 1.51.10;
- add missed '*'
- move extiobase decl into <machine/cpu.h>
 1.50 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.49 16-Feb-2007  ad branches: 1.49.2;
Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
 1.48 10-Feb-2007  tsutsui Apply changes for newslock2, taken from other m68k ports.
 1.47 11-Dec-2005  christos merge ktrace-lwp.
 1.46 26-Sep-2004  yamt branches: 1.46.12;
don't expose cpu_info to userland.
 1.45 22-Sep-2004  yamt move some per-cpu data definitions to MI place so that they can be modified
without touching all ports. discussed on tech-kern@.
 1.44 28-Aug-2004  thorpej De-__P
 1.43 04-Jan-2004  jdolecek Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
as FPU state), and is the last potentially blocking operation;
all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
 1.42 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.41 17-Jan-2003  thorpej branches: 1.41.2;
Merge the nathanw_sa branch.
 1.40 02-Nov-2002  chs finish conversion to the common m68k cacheops:
add support for machine-specific flavors of the ops for off-chip caches.
many thanks to Izumi Tsutsui for his help with this.
 1.39 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.38 30-May-2001  mrg branches: 1.38.8;
use _KERNEL_OPT
 1.37 19-Dec-2000  scw branches: 1.37.2;
Unification of the m68k syscall() function.
 1.36 25-Aug-2000  thorpej Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity. Its use in
roundrobin() still needs some work.
 1.35 27-May-2000  he Add missing semicolon.
 1.34 26-May-2000  thorpej branches: 1.34.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

- Global state: sched_qs (run queues), sched_whichqs (bitmap
of non-empty run queues), sched_slpque (sleep queues).
NOTE: These may collectively move into a struct schedstate
at some point in the future.

- Per-CPU state, struct schedstate_percpu: spc_runtime
(time process on this CPU started running), spc_flags
(replaces struct proc's p_schedflags), and
spc_curpriority (usrpri of processes on this CPU).

- Every platform must now supply a struct cpu_info and
a curcpu() macro. Simplify existing cpu_info declarations
where appropriate.

- All references to per-CPU scheduler state now made through
curcpu(). NOTE: this will likely be adjusted in the future
after further changes to struct proc are made.

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
 1.33 10-Aug-1999  thorpej branches: 1.33.2;
Define cpu_number() as discussed on tech-smp.
 1.32 26-Feb-1999  is synchronize types, and s/curproc/p/ in one forgotten place
 1.31 25-Feb-1999  is mac68k part of pr 6152 fix, and missing bits for the others
 1.30 11-Nov-1998  thorpej Changes to support fork_kthread():
- cpu_set_kpc() now takes void *arg third argument, passed to the
entry point.
- cpu_fork() allows parent to be non-curproc iff parent is proc0.
When forking non-curproc, assume its state has already been saved.
- Adjust various pieces of machine-dependent code to account of all of this.
 1.29 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.28 13-Feb-1998  scottr Avoid declaring the "astpending" and "want_resched" globals in cpu.h,
as this breaks C++ code that happens to indirectly include this header.
Both Matthias Scheler and I noticed this, independently.

This problem notably does not affect the atari and sun3/sun3x ports,
which have already implemented a similar solution.
 1.27 26-Oct-1997  is Make these compile after m68k/m68k.h 1.4->1.5.
 1.26 12-Oct-1997  thorpej Move the prototype of hp300_calibrate_delay() to cpu.h
 1.25 27-Apr-1997  thorpej branches: 1.25.4;
- Move a bunch of hp300 SPU-specific stuff out of cpu.h, and place it
in new hp300spu.h file. This includes the code that associates
model number with cpu/mmu/cache combinations.
- Define "mmuid" constants for several models, derived from code
provided by Mike Smith.
 1.24 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.23 09-Apr-1997  thorpej regdump() is prototyped in m68k/cpu.h now.
 1.22 01-Apr-1997  scottr Add prototypes as appropriate.
 1.21 07-Oct-1996  thorpej Prototypes for functions in locore.s and machdep.c (oops, forgot to
check this in the other day...)
 1.20 11-Sep-1996  thorpej Use <m68k/cpu.h>.
 1.19 17-May-1996  thorpej remove the now unused MHz constants, add a declaration for vectab[],
and document some globals.
 1.18 09-May-1996  scottr doboot() takes no arguments (from Thorsten Frueauf)
 1.17 27-Apr-1996  thorpej Prototype doboot() and give it the __noreturn__ attribute, so that
machdep.c will compile.
 1.16 21-Dec-1995  mycroft Remove deprecated cpu_setstack().
 1.15 11-Dec-1995  thorpej Rather than using individual HP300 model names, map those model names to
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.

In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.

Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
 1.14 28-Jun-1995  cgd remove unused cpu_exec() definitions. moved "broken swap" markers, for
ports that still need it, to types.h.
 1.13 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.12 05-May-1995  cgd define BROKEN_SWAP and/or cpu_swapout as appropriate.
 1.11 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.10 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.9 26-Oct-1994  cgd new RCS ID format.
 1.8 23-May-1994  mycroft Merge with 4.4-Lite.
 1.7 17-May-1994  cgd cpu_swapin and need_proftick
 1.6 07-May-1994  mycroft Add sysctl() stuff.
 1.5 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.4 04-Feb-1994  mycroft Reorder clockframe.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.25.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.33.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.33.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.34.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.37.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.38.8.4 11-Nov-2002  nathanw Catch up to -current
 1.38.8.3 08-Dec-2001  thorpej Add a cpu_proc_fork(), called from uvm_proc_fork(), which takes care
of machine-dependent handling a fork() time (this is different from
forking the actual context in an LWP world). #define it away on
platforms which do not need it.

Problem noted by Gregory McGarry.
 1.38.8.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.38.8.1 30-May-2001  scw file cpu.h was added on branch nathanw_sa on 2001-11-18 18:09:34 +0000
 1.41.2.6 19-Oct-2004  skrll Sync with HEAD
 1.41.2.5 24-Sep-2004  skrll Sync with HEAD.
 1.41.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.41.2.2 03-Sep-2004  skrll Sync with HEAD
 1.41.2.1 03-Aug-2004  skrll Sync with HEAD
 1.46.12.5 17-Mar-2008  yamt sync with head.
 1.46.12.4 04-Feb-2008  yamt sync with head.
 1.46.12.3 27-Oct-2007  yamt sync with head.
 1.46.12.2 03-Sep-2007  yamt sync with head.
 1.46.12.1 26-Feb-2007  yamt sync with head.
 1.49.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.51.10.2 03-Oct-2007  garbled Sync with HEAD
 1.51.10.1 22-May-2007  matt Update to HEAD.
 1.51.4.1 11-Jul-2007  mjf Sync with head.
 1.51.2.3 09-Oct-2007  ad Sync with head.
 1.51.2.2 20-Aug-2007  ad Sync with HEAD.
 1.51.2.1 27-May-2007  ad Sync with head.
 1.54.8.2 02-Oct-2007  joerg Sync with HEAD.
 1.54.8.1 04-Aug-2007  jmcneill Sync with HEAD.
 1.54.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.54.2.1 07-Aug-2007  matt Sync with HEAD.
 1.55.4.1 06-Oct-2007  yamt sync with head.
 1.55.2.2 23-Mar-2008  matt sync with HEAD
 1.55.2.1 06-Nov-2007  matt sync with HEAD
 1.57.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.58.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.58.2.1 24-Mar-2008  keiichi sync with head.
 1.59.22.1 21-Apr-2010  matt sync to netbsd-5
 1.59.20.1 14-Aug-2009  snj Pull up following revision(s) (requested by rmind in ticket #897):
sys/arch/hp300/include/cpu.h: revision 1.60
sys/arch/news68k/include/cpu.h: revision 1.34
sys/arch/powerpc/powerpc/trap.c: revision 1.130 via patch
Fix few more l_pflag and LP_OWEUPC confusions.
 1.59.14.1 14-Aug-2009  snj Pull up following revision(s) (requested by rmind in ticket #897):
sys/arch/hp300/include/cpu.h: revision 1.60
sys/arch/news68k/include/cpu.h: revision 1.34
sys/arch/powerpc/powerpc/trap.c: revision 1.130 via patch
Fix few more l_pflag and LP_OWEUPC confusions.
 1.59.4.2 11-Mar-2010  yamt sync with head
 1.59.4.1 19-Aug-2009  yamt sync with head.
 1.62.4.2 31-May-2011  rmind sync with head
 1.62.4.1 05-Mar-2011  rmind sync with head
 1.64.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.64.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.66.8.1 18-Feb-2012  mrg merge to -current.
 1.66.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.66.4.1 17-Apr-2012  yamt sync with head
 1.67.10.1 18-May-2014  rmind sync with head
 1.67.6.2 03-Dec-2017  jdolecek update from HEAD
 1.67.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.68.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.68.6.1 05-Feb-2017  skrll Sync with HEAD
 1.69.16.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.69.16.1 10-Jun-2019  christos Sync with HEAD
 1.69.14.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.72.26.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.5 11-Apr-2011  mrg obsolete DB_AOUT_SYMBOLS. however, we need to leave most of the code
in db_sym.[ch] as it is used by the elf version of crash(8).

i will be cleaning up the db_sym.c code in a follow up commit to avoid
having dead code compiled.
 1.4 06-Dec-2005  tsutsui branches: 1.4.100; 1.4.106;
Remove defines DB_ELF_SYMBOLS and DB_ELFSIZE, which are defined
in <m68k/db_machdep.h>.

XXX: should we remove DB_AOUT_SYMBOLS from <m68k/db_machdep.h>, or
XXX: should all m68k ports still have DB_AOUT_SYMBOLS?
 1.3 02-Jan-2001  simonb branches: 1.3.24; 1.3.40;
Add ELF support.

Thanks to Steve Woodford for his help!
 1.2 26-Oct-1994  cgd branches: 1.2.32;
new RCS ID format.
 1.1 09-Jan-1994  cgd stub
 1.2.32.1 05-Jan-2001  bouyer Sync with HEAD
 1.3.40.1 21-Jun-2006  yamt sync with head.
 1.3.24.1 11-Dec-2005  christos Sync with head.
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 21-Apr-2011  rmind sync with head
 1.4 30-Aug-2011  bouyer Add getlabelusesmbr(), as proposed in
http://mail-index.netbsd.org/tech-userlevel/2011/08/25/msg005404.html
This is used by disk tools such as disklabel(8) to dynamically decide is
the undelyling platform uses a disklabel-in-mbr-partition or not
(instead of using a compile-time list of ports).
getlabelusesmbr() reads the sysctl kern.labelusesmbr, takes its value from the
machdep #define LABELUSESMBR.
For evbmips, make LABELUSESMBR 1 if the platform uses pmon
as bootloader, and 0 (the previous value) otherwise.
 1.3 31-Dec-2009  tsutsui Don't use DEV_BSIZE for LABELSECTOR.
We have never supported 256byte/sector media, and
current definition won't work on >512byte/sector media.
 1.2 06-Dec-2005  tsutsui branches: 1.2.78;
Use _HP300_FOO_H_ instead of _MACHINE_FOO_H_.
 1.1 14-Oct-1994  cgd branches: 1.1.66; 1.1.82;
move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS.
 1.1.82.1 21-Jun-2006  yamt sync with head.
 1.1.66.1 11-Dec-2005  christos Sync with head.
 1.2.78.1 11-Mar-2010  yamt sync with head
 1.2 06-Dec-2005  tsutsui Remove multiple inclusion protection from files which just include
MI m68k headers and don't have any own declarations.
 1.1 12-Jul-1998  thorpej branches: 1.1.48; 1.1.64;
Basic elf_machdep.h for m68k; doesn't include relocations, yet.
 1.1.64.1 21-Jun-2006  yamt sync with head.
 1.1.48.1 11-Dec-2005  christos Sync with head.
 1.8 17-Mar-2000  mycroft In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.7 24-Jan-1999  mycroft branches: 1.7.8;
Format consistency.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 08-Jan-1994  cgd stubs which pint to m68k include
 1.4 06-Dec-1993  mycroft Add quad stuff, etc.
 1.3 13-Oct-1993  cgd get rid of #ifndef KERNEL around inclusion of cdefs.h
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd add from net/2 sources. was symlink to ../../tahoe/include/endian.h
 1.7.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1 17-Mar-2000  mycroft branches: 1.1.6;
In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 17-Mar-2000  bouyer file endian_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:08:08 +0000
 1.12 08-Oct-1996  cgd moved to aout_machdep.h (via repository copy)
 1.11 08-Sep-1996  thorpej Use <m68k/exec.h>.
 1.10 20-Nov-1995  thorpej Garbage collect some stuff that isn't used. Rename the relocation info
structure to be consistent with the other m68k ports. XXX that struct needs
to move to an m68k common file.
 1.9 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.8 26-Oct-1994  cgd new RCS ID format.
 1.7 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.6 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.5 18-Oct-1993  pk Put definition of __LDPGSZ and `struct relocation_info' where they belong:
in <machine/exec.h>.
 1.4 19-Aug-1993  mycroft Remove cpu_exec_makecmds() macro and declare it as a function. Also, wrap
everything in `#ifdef KERNEL'.
 1.3 04-Jun-1993  cgd fix stupid missing ||
 1.2 03-Jun-1993  cgd add support for a macro to be called from execve to check a_mid type
 1.1 02-Jun-1993  cgd machine-dependent exec stuff
 1.1 27-Dec-2023  thorpej Re-factor the 680x0 Function Code definitions into their own
separate file (as was done on the sun2/sun3 ports ages ago)
and switch everyone to the common header.
 1.1 24-Dec-2015  christos branches: 1.1.2; 1.1.18;
fenv for m68k
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 24-Dec-2015  jdolecek file fenv.h was added on branch tls-maxphys on 2017-12-03 11:36:13 +0000
 1.1.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.1.2.1 24-Dec-2015  skrll file fenv.h was added on branch nick-nhusb on 2015-12-27 12:09:35 +0000
 1.8 03-Feb-1998  mycroft Prototype __flt_rounds() consistently.
 1.7 20-Jun-1995  jtc branches: 1.7.18;
Wrap with #ifndef _XXX_FLOAT_H_/#define _XXX_FLOAT_H_/ ... /#endif.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 08-Jan-1994  cgd stubs which pint to m68k include
 1.4 15-Aug-1993  mycroft Adjust DBL_MIN so it doesn't underflow.
 1.3 15-Aug-1993  mycroft Adjust DBL_MAX so it doesn't overflow.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.7.18.1 08-May-1998  mycroft Sync with trunk, per request of mycroft.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 23-May-1994  mycroft Merge with 4.4-Lite.
 1.4 08-Jan-1994  cgd stubs which pint to m68k include
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.2 08-Feb-2011  rmind branches: 1.2.2; 1.2.6;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 06-Feb-2011  tsutsui branches: 1.1.2;
Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.

- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
and I can't confirm that 362 and 382 actually have SGC bus.
(I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
once after keycode with NoSymbol problem is addressed.
(We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 06-Feb-2011  bouyer file hil_machdep.h was added on branch bouyer-quota2 on 2011-02-08 16:19:22 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 08-Feb-2011  jruoho file hil_machdep.h was added on branch jruoho-x86intr on 2011-06-06 09:05:37 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 08-Feb-2011  rmind file hil_machdep.h was added on branch rmind-uvmplock on 2011-03-05 20:50:24 +0000
 1.17 13-May-2024  msaitoh s/combindations/combinations/ in comment.
 1.16 18-Jan-2024  thorpej Make the M68K_MMU_* defines real kernel options, available in opt_m68k_arch.h.
For 68030, 68040, and 68060, infer M68K_MMU_MOTOROLA. For 68010 and 68020, it
must be an explicit option (set in std.${MACHINE} or, in the case of hp300,
inferred from the specific model option).
 1.15 18-Jan-2024  thorpej Rather than testing for and defining the M680x0 CPU option in
hp300spu.h, make the individual model options (e.g. HP320, HP425,
etc.) declare a dependency on the correponding M680x0 options.
This makes them appear correctly in opt_m68k_arch.h rather than
having to pull in all of <machine/cpu.h>.
 1.14 06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.13 28-Apr-2008  martin branches: 1.13.20; 1.13.22;
Remove clause 3 and 4 from TNF licenses
 1.12 20-Jul-2006  tsutsui branches: 1.12.58; 1.12.60; 1.12.62;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.8;
merge ktrace-lwp.
 1.10 28-Aug-2004  thorpej branches: 1.10.12;
fix typo.
 1.9 03-Nov-2002  tsutsui branches: 1.9.6;
HP360 does not have L2 cache, so no need to define CACHE_HAVE_PAC for it.
 1.8 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.7 30-May-2001  mrg branches: 1.7.8;
use _KERNEL_OPT
 1.6 29-Nov-2000  jdolecek branches: 1.6.2;
LKMify
 1.5 31-Jul-1999  thorpej branches: 1.5.2;
Add MMUIDs for the 385 and 425e, and a machine ID for the 385. From OpenBSD.
 1.4 12-Jan-1998  thorpej branches: 1.4.10;
Update for changes to config.
 1.3 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.2 01-May-1997  thorpej branches: 1.2.4;
Oops, the numbers for "t" and "s" got swapped around. No functional
difference, just correct now.
 1.1 27-Apr-1997  thorpej - Move a bunch of hp300 SPU-specific stuff out of cpu.h, and place it
in new hp300spu.h file. This includes the code that associates
model number with cpu/mmu/cache combinations.
- Define "mmuid" constants for several models, derived from code
provided by Mike Smith.
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.10.1 02-Aug-1999  thorpej Update from trunk.
 1.5.2.1 08-Dec-2000  bouyer Sync with HEAD.
 1.6.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.8.2 11-Nov-2002  nathanw Catch up to -current
 1.7.8.1 30-May-2001  nathanw file hp300spu.h was added on branch nathanw_sa on 2002-11-11 21:58:33 +0000
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 03-Sep-2004  skrll Sync with HEAD
 1.10.12.1 30-Dec-2006  yamt sync with head.
 1.11.8.1 11-Aug-2006  yamt sync with head
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.62.2 11-Aug-2010  yamt sync with head.
 1.12.62.1 16-May-2008  yamt sync with head.
 1.12.60.1 18-May-2008  yamt sync with head.
 1.12.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.22.1 03-Jul-2010  rmind sync with head
 1.13.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.24 10-Dec-2009  matt Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.
 1.23 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.22 11-Dec-2005  christos branches: 1.22.74; 1.22.76; 1.22.78;
merge ktrace-lwp.
 1.21 06-Dec-2005  tsutsui Use _HP300_FOO_H_ instead of _MACHINE_FOO_H_.
 1.20 28-Aug-2004  thorpej branches: 1.20.12;
De-__P
 1.19 17-Nov-2003  tsutsui TAB/space cleanup.
 1.18 28-Sep-2003  cl catch up with const ksiginfo_t and const sigset_t
 1.17 22-Sep-2003  cl SA_SIGINFO support for m68k (compat hpux)
 1.16 29-Jun-2003  fvdl branches: 1.16.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.15 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.14 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.13 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.12 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
sigaction and the trampoline/version. Version 0 means "legacy kernel
provided trampoline". Other versions are coordinated with machine-
dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions. Instead,
sendsig() looks up the handler by peeking in the sigacts for the
process getting the signal (since it has to look in there for the
trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.11 01-Oct-1998  thorpej branches: 1.11.26; 1.11.30; 1.11.38;
Update for signal changes.
 1.10 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.9 12-Sep-1997  mycroft Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)
 1.8 27-Apr-1997  thorpej branches: 1.8.4;
Garbage-collect a bunch of _very_ hp300-specific code, most of which
doesn't work anyhow (due to current and future fundamental differences
between NetBSD and HP-UX device semantics). This can probably be shared
with other m68k ports now.
 1.7 01-Apr-1997  scottr Add forward declarations for struct exec_package and struct exec_vmcmd,
to minimize the number of unnecessary #includes.
 1.6 16-Mar-1997  thorpej Garbage-collect hpux_dumpu().
 1.5 16-Mar-1997  thorpej Prototype hpux_setregs().
 1.4 16-Mar-1997  thorpej Define the HP-UX sigcontext structure here, and prototype hpux_sendsig().
 1.3 28-Feb-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.2 24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.1 06-Jan-1996  thorpej Move the obviously machine-dependent HP-UX compat code to hpux_machdep.{c,h}.
A fair bit of this, the m68k core dump and exec goo, can probably be
made into a generic m68k hpux module, eventually.

More to be placed in hpux_machdep.c - keep your eyes peeled...
 1.8.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.38.1 16-Jul-2002  gehenna catch up with -current.
 1.11.30.2 01-Aug-2002  nathanw Catch up to -current.
 1.11.30.1 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.11.26.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.16.2.6 11-Dec-2005  christos Sync with head.
 1.16.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.16.2.3 03-Sep-2004  skrll Sync with HEAD
 1.16.2.2 03-Aug-2004  skrll Sync with HEAD
 1.16.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.20.12.1 21-Jun-2006  yamt sync with head.
 1.22.78.2 11-Mar-2010  yamt sync with head
 1.22.78.1 16-May-2008  yamt sync with head.
 1.22.76.1 18-May-2008  yamt sync with head.
 1.22.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 30-Aug-1999  mycroft A foolish consistency.
 1.1 15-Mar-1999  minoura Pullin m68k/ieee.h.
 1.2 16-Apr-1995  jtc Fix typo: ieefp.h -> ieeefp.h.
 1.1 09-Apr-1995  mycroft Move fp_except and fp_rnd definitions to machine/include.
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 integer constant macros.
 1.1.12.2 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
 1.1.12.1 14-Apr-2001  kleink file int_const.h was added on branch nathanw_sa on 2001-04-14 22:38:38 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 14-Apr-2001  bouyer file int_const.h was added on branch thorpej_scsipi on 2001-04-21 17:53:31 +0000
 1.1 15-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.2 15-Apr-2001  kleink Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.1 15-Apr-2001  kleink file int_fmtio.h was added on branch nathanw_sa on 2001-04-15 17:13:10 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_fmtio.h was added on branch thorpej_scsipi on 2001-04-21 17:53:31 +0000
 1.1 15-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 specified-width integer type limits.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.2 15-Apr-2001  kleink Add definitions of C99 specified-width integer type limits.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.1 15-Apr-2001  kleink file int_limits.h was added on branch nathanw_sa on 2001-04-15 15:29:06 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_limits.h was added on branch thorpej_scsipi on 2001-04-21 17:53:31 +0000
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.2 14-Apr-2001  kleink Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.1 14-Apr-2001  kleink file int_mwgwtypes.h was added on branch nathanw_sa on 2001-04-14 12:19:54 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 14-Apr-2001  bouyer file int_mwgwtypes.h was added on branch thorpej_scsipi on 2001-04-21 17:53:31 +0000
 1.1 26-Jun-2000  kleink branches: 1.1.2;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 26-Jun-2000  bouyer file int_types.h was added on branch thorpej_scsipi on 2000-11-20 20:08:08 +0000
 1.39 19-Jan-2024  thorpej Add _KERNEL guards around most of the definitions in these files.
 1.38 16-Jan-2024  thorpej Fix computation of the appropriate auto-vector interrupt level to use
for the DMA controller by tracking all of the DIO devices that have
"ISRPRI_BIO" interrupt handlers, and finding the highest auto-vector
level among them and informing the DMA controller.

Previously, in a post-flattening world, the DMA controller was always
told to interrupt at lev5, which is fine I guess although definitely not
ideal, but would not work on aaaancient HP320 Rev A DMA boards. To that
effect, print a warning if a Rev B DMA board ends up at ipl != 3 (we can't
differentiate between a Rev A and a Rev B board).
 1.37 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.36 11-Jul-2023  riastradh hp300/intr.h: Put most of this under #ifdef _KERNEL.

Only ipl_cookie_t really needs to be exposed now, for crash(8).
 1.35 11-Jul-2023  riastradh hp300/intr.h: Fix missing includes.
 1.34 06-Mar-2011  tsutsui branches: 1.34.86;
Remove trailing spaces.
 1.33 09-Apr-2009  tsutsui branches: 1.33.4; 1.33.6;
Include <sys/evcnt.h> instead of <sys/device.h> for struct evcnt.

<sys/device.h> now requires <sys/mutex.h> for struct device_lock, and
<machine/mutex.h> requires <machine/intr.h> for ipl_cookie_t, so
including <sys/device.h> from <machine/intr.h> causes recursive dependency.
 1.32 21-Dec-2008  tsutsui branches: 1.32.2;
Remove obsolete code for old software interrupt emulation.
The MI softint(9) handles it in the kernel threads nowadays.

Note "Emulation of VAX REI instruction" is still there to handle ASTs.
 1.31 22-Jun-2008  tsutsui branches: 1.31.4; 1.31.6;
Make cpu_intr_p() inline.
 1.30 22-Jun-2008  tsutsui Don't recompute an ipl level for IPL_VM during or after cpu_configure(9)
and use a static and possible highest ipl value (ipl 5) for IPL_VM
so that we can put ipl2psl_table[] conversion into makeiplcookie(9),
which could be called before cpu_configure(9).

Fixes "panic: sbappendaddr" on NFS load.
 1.29 15-Jun-2008  tsutsui Unify splraiseipl(9) implementation among m68k ports as per
suggestion from isaki@ on port-m68k.

For hp300:
- use ipl2psl_table[] for makeiplcookie() conversion
- use uint16_t for ipl2psl_table[]
 1.28 28-Apr-2008  martin branches: 1.28.2; 1.28.4;
Remove clause 3 and 4 from TNF licenses
 1.27 28-Jan-2008  tsutsui branches: 1.27.6; 1.27.8; 1.27.10;
- account idepth in a clock interrupt handler too
- use idepth for CLKF_INTR()
 1.26 03-Dec-2007  ad Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.25 17-Oct-2007  garbled branches: 1.25.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.24 15-Oct-2007  tsutsui Add IPL_SERIAL definition since MI com(4) now requires it for mutex(9).
 1.23 11-Mar-2007  thorpej branches: 1.23.8; 1.23.16; 1.23.18; 1.23.20;
- Shrink ipl_cookie_t from 32-bits to 16-bits (large enough to hold
an SR value or an IPL_* constant).
- Take advange of the smaller ipl_cookie_t to shrink kmutex_t from
16 bytes to 8 bytes by overlapping storage where possible.
- Implement a RAS-based _lock_cas() for mc68010 systems (Sun2). See
sun68k/sun68k/isr.c.

Tested on various m68k platforms, but NOT Sun2. In any case, at least
Sun2 compiles now.
 1.22 04-Mar-2007  tsutsui branches: 1.22.2;
Remove #ifdef _KERNEL since this file is no longer exported.
 1.21 04-Mar-2007  tsutsui Hide #include <m68k/softintr.h> inside #ifdef _KERNEL in <machine/intr.h>
to avoid exporting unnecessary files to userland.
Should fix build.sh failure, which was pointed out by isaki@.

XXX: which userland program would require contents of <machine/intr.h>?
 1.20 04-Mar-2007  tsutsui Make hp300 use common m68k/softintr.c.
 1.19 16-Feb-2007  ad branches: 1.19.2;
Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
 1.18 15-Feb-2007  tsutsui Fix an indent in the previous.
 1.17 10-Feb-2007  tsutsui Rename _IPL_SOFT* macro to SI_SOFT* to sync with other m68k ports.
 1.16 21-Dec-2006  yamt merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.15 11-Dec-2005  christos branches: 1.15.20; 1.15.22;
merge ktrace-lwp.
 1.14 02-Jan-2005  tsutsui branches: 1.14.10;
u_intNN_t -> uintNN_t
 1.13 08-Nov-2003  tsutsui Switch DCA and APCI serial devices to use MI com(4) driver.

DCA is tested on HP362 and HP382 with serial console,
but APCI on HP4xx is not tested yet.
 1.12 08-Dec-2001  gmcgarry branches: 1.12.16;
softintr(9) interface for hp300
 1.11 13-Apr-2001  thorpej branches: 1.11.2; 1.11.8;
Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.10 14-Jan-2001  thorpej branches: 1.10.2;
Make sure everybody has an splvm() and equate it with splimp() (splimp()
is the historical name for this interrupt level, and the historical name
is going to go away in the near future).
 1.9 22-Aug-2000  thorpej Add spllock(). See spl(9) for details.
 1.8 21-Aug-2000  thorpej Make sure we provide splsched() as described in spl(9).
 1.7 05-Aug-1999  thorpej branches: 1.7.2;
Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied. Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

This fixes a problem with using the "rnd" pseudo-device from within
interrupt context to extract random data (e.g. from within the softnet
interrupt) where doing so would incorrectly unblock interrupts (causing
all sorts of lossage).

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX. This platforms still have this bug until their
XXX spl*() functions are fixed.
 1.6 01-Aug-1999  thorpej Store computed PSL values in an array indexed by abstract interrupt
level, rather than individual shortwords.
 1.5 15-Jun-1999  kleink Slightly rearrange the SSIR inline assembly implementation in order to avoid
making assumptions on C symbol name prefixes.
 1.4 18-May-1998  kleink branches: 1.4.10;
Spell `interrupt' correctly.
 1.3 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.2 24-Jul-1997  scottr branches: 1.2.2;
Use optimized _splraise() implementation, from mac68k/intr.h
 1.1 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.2.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.10.2 02-Aug-1999  thorpej Update from trunk.
 1.4.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.7.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.7.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.7.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.11.8.1 13-Apr-2001  nathanw file intr.h was added on branch nathanw_sa on 2002-01-08 00:24:45 +0000
 1.11.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.16.4 17-Jan-2005  skrll Sync with HEAD.
 1.12.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.16.1 03-Aug-2004  skrll Sync with HEAD
 1.14.10.6 04-Feb-2008  yamt sync with head.
 1.14.10.5 07-Dec-2007  yamt sync with head
 1.14.10.4 27-Oct-2007  yamt sync with head.
 1.14.10.3 03-Sep-2007  yamt sync with head.
 1.14.10.2 26-Feb-2007  yamt sync with head.
 1.14.10.1 30-Dec-2006  yamt sync with head.
 1.15.22.2 04-Nov-2006  tsutsui Add missing parentheses to splsoftserial macro.
(which is used only inside #ifdef __NO_SOFT_SERIAL_INTERRUPT in com.c?)

Now init_main.c compiles though GENERIC still doesn't build due to
"initialization discards qualifiers from pointer target type" warnings
by newer gcc4.
 1.15.22.1 06-Oct-2006  tsutsui Reorganize IPL macros for proper splraiseipl() implementation:
- merge HP300_IPL_* and IPL_* macros
- prepare independent _IPL_SOFT_* macro to determine softintr(9) handlers
- rename hp300_ipls[] array to hp300_ipl2psl[]
- then use these macro for makeiplcookie() and splraiseipl()
Tested on HP382.
 1.15.20.1 12-Jan-2007  ad Sync with head.
 1.19.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.22.2.3 03-Dec-2007  ad Sync with HEAD.
 1.22.2.2 23-Oct-2007  ad Sync with head.
 1.22.2.1 13-Mar-2007  ad Sync with head.
 1.23.20.1 18-Oct-2007  yamt sync with head.
 1.23.18.3 23-Mar-2008  matt sync with HEAD
 1.23.18.2 09-Jan-2008  matt sync with HEAD
 1.23.18.1 06-Nov-2007  matt sync with HEAD
 1.23.16.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.23.16.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.23.8.1 16-Oct-2007  garbled Sync with HEAD
 1.25.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.25.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.27.10.2 04-May-2009  yamt sync with head.
 1.27.10.1 16-May-2008  yamt sync with head.
 1.27.8.2 17-Jun-2008  yamt sync with head.
 1.27.8.1 18-May-2008  yamt sync with head.
 1.27.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.27.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.27.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.28.4.2 27-Jun-2008  simonb Sync with head.
 1.28.4.1 18-Jun-2008  simonb Sync with head.
 1.28.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.31.6.1 27-Dec-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #207):
sys/arch/hp300/include/intr.h: revision 1.32
sys/arch/hp300/hp300/locore.s: revision 1.145
sys/arch/hp300/hp300/intr.c: revision 1.39
Remove obsolete code for old software interrupt emulation.
The MI softint(9) handles it in the kernel threads nowadays.
Note "Emulation of VAX REI instruction" is still there to handle ASTs.
 1.31.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.31.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.32.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.33.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.33.4.1 21-Apr-2011  rmind sync with head
 1.34.86.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.
 1.2 06-Dec-2005  tsutsui Remove multiple inclusion protection from files which just include
MI m68k headers and don't have any own declarations.
 1.1 09-Apr-1997  thorpej branches: 1.1.56; 1.1.72;
kcore.h for hp300 - just pulls in the common m68k kcore.h
 1.1.72.1 21-Jun-2006  yamt sync with head.
 1.1.56.1 11-Dec-2005  christos Sync with head.
 1.10 28-Mar-2012  christos - Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
 1.9 06-Dec-2005  tsutsui branches: 1.9.112; 1.9.116;
Remove multiple inclusion protection from files which just include
MI m68k headers and don't have any own declarations.
 1.8 09-Jan-1998  perry branches: 1.8.48; 1.8.64;
multiple include protect machine/limits.h, fixes pr 4473 (from Mika Nystrom)
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 08-Jan-1994  cgd stubs which pint to m68k include
 1.5 07-Dec-1993  mycroft Make sure min values are correct when used at a larger size.
 1.4 06-Dec-1993  mycroft Add quad support.
 1.3 18-Aug-1993  jtc Removed CLK_TCK, it's value is not machine dependant.
It's supposed to be defined in <time.h>, not <limits.h> anyway.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd add from net2. were symlinks to ../../vax/include/*
 1.8.64.1 21-Jun-2006  yamt sync with head.
 1.8.48.1 11-Dec-2005  christos Sync with head.
 1.9.116.1 05-Apr-2012  mrg sync to latest -current.
 1.9.112.1 17-Apr-2012  yamt sync with head
 1.8 06-Aug-2014  joerg Consistently define WARN in a way that passes format string checks, i.e.
always uses the same number of arguments as given in the format string.
 1.7 28-Apr-2008  martin branches: 1.7.44; 1.7.60;
Remove clause 3 and 4 from TNF licenses
 1.6 25-Jan-2006  christos branches: 1.6.72; 1.6.74; 1.6.76;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.5 11-Dec-2005  christos branches: 1.5.2;
merge ktrace-lwp.
 1.4 28-Aug-2004  thorpej branches: 1.4.12;
De-__P
 1.3 31-Oct-2001  thorpej branches: 1.3.2; 1.3.18;
Split elf32 vs. elf64 handling in loadfile(), including support for
each separately and explicitly. BOOT_ELF is now BOOT_ELF32 and
BOOT_ELF64, and ELFSIZE should no longer be defined in loadfile_machdep.h.
 1.2 02-Jan-2001  simonb branches: 1.2.4; 1.2.6;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.1 14-Dec-1999  thorpej branches: 1.1.2; 1.1.8;
First cut at loadfile() support for the hp300 boot program. Doesn't
work yet (kernel fails before MMU can be enabled).
 1.1.8.3 05-Jan-2001  bouyer Sync with HEAD
 1.1.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1 14-Dec-1999  bouyer file loadfile_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:08:09 +0000
 1.1.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.18.1 03-Sep-2004  skrll Sync with HEAD
 1.3.2.2 31-Oct-2001  thorpej Split elf32 vs. elf64 handling in loadfile(), including support for
each separately and explicitly. BOOT_ELF is now BOOT_ELF32 and
BOOT_ELF64, and ELFSIZE should no longer be defined in loadfile_machdep.h.
 1.3.2.1 31-Oct-2001  thorpej file loadfile_machdep.h was added on branch nathanw_sa on 2001-10-31 17:20:47 +0000
 1.4.12.1 21-Jun-2006  yamt sync with head.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.76.1 16-May-2008  yamt sync with head.
 1.6.74.1 18-May-2008  yamt sync with head.
 1.6.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.60.1 10-Aug-2014  tls Rebase.
 1.7.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1 29-Apr-2000  thorpej branches: 1.1.6;
Require that each each MACHINE/MACHINE_ARCH supply a lock.h. This file
contains the values __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED, which
replace the old SIMPLELOCK_LOCKED and SIMPLELOCK_UNLOCKED. These files
are also required to supply inline functions __cpu_simple_lock(),
__cpu_simple_lock_try(), and __cpu_simple_unlock() if locking is to be
supported on that platform (i.e. if MULTIPROCESSOR is defined in the
_KERNEL case). Change these functions to take an int * (&alp->lock_data)
rather than the struct simplelock * itself.

These changes make it possible for userland to use the locking primitives
by including <machine/lock.h>.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 29-Apr-2000  bouyer file lock.h was added on branch thorpej_scsipi on 2000-11-20 20:08:09 +0000
 1.1 30-Nov-2024  christos branches: 1.1.4;
Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 30-Nov-2024  perseant file lwp_private.h was added on branch perseant-exfatfs on 2025-08-02 05:55:38 +0000
 1.1 23-Dec-1999  kleink branches: 1.1.6;
C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 23-Dec-1999  bouyer file math.h was added on branch thorpej_scsipi on 2000-11-20 20:08:09 +0000
 1.2 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 10-Nov-2001  scw branches: 1.1.2;
file mcontext.h was initially added on branch nathanw_sa.
 1.1.2.1 10-Nov-2001  scw Kernel mcontext glue for Scheduler Activations on m68k from
Klaus Klein <kleink@netbsd.org>.
 1.5 11-Jun-1997  kleink GC this file. It has been unused for quite a while.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.2 09-Feb-2007  ad branches: 1.2.4;
Merge newlock2 to head.
 1.1 22-Dec-2006  ad branches: 1.1.2;
file mutex.h was initially added on branch newlock2.
 1.1.2.1 22-Dec-2006  ad Pull in CPU specific stubs.
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file mutex.h was added on branch yamt-lazymbuf on 2007-02-26 09:06:34 +0000
 1.53 10-Feb-2012  para proper sizing of kmem_arena on different ports

PR port-i386/45946: Kernel locks up in VMEM system
 1.52 08-Feb-2011  rmind branches: 1.52.4; 1.52.8;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.51 11-Dec-2009  tsutsui branches: 1.51.4; 1.51.6; 1.51.8;
Refactoring MD segment related definitions on m68k ports:
- move macro SEGSHIFT, NBSEG, and SEGOFSET from <machine/param.h>
to <m68k/pmap_motorola.h> where they should belong
- also simplify NBSEG macro for both 020/030 and 040/060 cases
- also move m68k_trunc_seg(), m68k_round_seg(), and m68k_seg_offset()
(that use SEGOFSET) from <m68k/param.h> to <m68k/pmap_motorola.h>
- add comments about each segment size value used on pmap_motorola
implementation
- add TIA_SIZE, TIA_SHIFT, TIB_SIZE, and TIB_SHIFT macro which can be
used for ste/pte index sizes
- use proper vaddr_t cast instead of unsigned for SEGOFSET/PGOFSET macro

Tested on atari, hp300, and news68k.
 1.50 09-Dec-2009  tsutsui Fix wrong NBSEG values for all hp300 pmap derived m68k ports.
They were incorrect since 1997 on amiga and atari, and since 2002
on other ports, but fortunately they don't look so fatal.

Anyway, these values will be moved into <m68k/pmap_motorola.h> soon
since they are quite pmap implementation dependent.
 1.49 31-Dec-2007  ad branches: 1.49.10;
Remove COMPAT_HPUX.
 1.48 04-Mar-2007  tsutsui branches: 1.48.20; 1.48.26; 1.48.32;
Merge #ifdef _KERNEL stuff into one place.
 1.47 06-Dec-2005  tsutsui branches: 1.47.26;
Use _HP300_FOO_H_ instead of _MACHINE_FOO_H_.
 1.46 11-Sep-2005  he Patterned after next68k, omit inclusion of <sys/device.h> if we
are not in _KERNEL. This should work around our lint problems
related to "unspecified-size array at end of struct" constructs.
 1.45 28-Aug-2004  thorpej branches: 1.45.10; 1.45.12; 1.45.14;
De-__P
 1.44 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.43 17-Jan-2003  thorpej branches: 1.43.2;
Merge the nathanw_sa branch.
 1.42 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.41 30-May-2001  mrg branches: 1.41.8;
use _KERNEL_OPT
 1.40 11-Feb-2000  thorpej branches: 1.40.6;
Update for the NKMEMPAGES changes.
 1.39 04-Dec-1999  ragge CL* discarding.
 1.38 25-Jun-1998  thorpej branches: 1.38.14; 1.38.20;
defopt COMPAT_HPUX
 1.37 20-Sep-1997  leo Move the definition of MSGBUFSIZE up to the machine-arch level if
possible. Pointed out by Bernd Ernesti.
 1.36 19-Sep-1997  leo Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
 1.35 10-Jul-1997  veego branches: 1.35.2;
Restore the defines of UPAGES and NPTEPG.
 1.34 10-Jun-1997  veego The 'Mach derived conversion macros' are now in <m68k/param.h>
 1.33 10-Jun-1997  veego Use the MI <m68k/param.h> include.
 1.32 14-Apr-1997  thorpej Rearrange the interrupt code slightly:
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
 1.31 01-Apr-1997  scottr Add prototypes as appropriate.
 1.30 15-Mar-1997  thorpej Change MID_MACHINE to MID_M68K; we now use the same executable format as
the rest of the m68k ports.
 1.29 24-Feb-1997  fvdl Define ALIGNED_POINTER
 1.28 02-Feb-1997  thorpej branches: 1.28.4;
- Implement _splraise(), like _spl(), but only modifies the SR if the
new ipl is higher than the ipl currently set in SR. (Thanks to
scottr@netbsd.org for implementing it while I was busy with other stuff!)
- Define spl{bio,net,tty,imp} in terms of _splraise().
- Move definition of splhil() here, and define splkbd() as an alias for it.
 1.27 09-Dec-1996  thorpej Dynamically compute the PSL value for spl{bio,net,tty,imp}() calls.
 1.26 17-May-1996  thorpej Changes for the new delay() function.
 1.25 04-Mar-1996  cgd add _MACHINE and _MACHINE_ARCH, which are like MACHINE and MACHINE_ARCH,
execpt without quotes. meant to be __CONCAT()ted for easy #includes
of machine-dependent headers for MI code (e.g. for the MI ISA/EISA/PCI/TC
bus code).
 1.24 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.23 13-Aug-1995  mycroft Replace splnet() with splsoftnet(). Add splnet().
 1.22 28-Jun-1995  cgd kill user-land DELAY macro, as suggested by gwr.
 1.21 26-Jun-1995  cgd clean up definitions of ctod(), dtoc(), ctob(), btoc(), btodb(), and
dbtob(). remove unused definitions of ctos(), stoc(), and dtob().
 1.20 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.19 18-Mar-1995  cgd don't be so quick to cast macro arguments to unsigned; if the
arguments are really off_t's (e.g. to btodb), then you can lose
information. This was the "> 4G file systems don't work" bug; physio
uses btodb, which was broken.
 1.18 05-Mar-1995  mycroft Make these consisteny with i386. Mostly cosmetic.
 1.17 26-Oct-1994  cgd new RCS ID format.
 1.16 14-Oct-1994  cgd move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS.
 1.15 16-Sep-1994  jtc asm -> __asm (PR #463).
 1.14 09-Sep-1994  mycroft Nuke struct ste, struct ste40, struct pte, and HP_PAGE_SIZE. Use my
pv_entry allocator. Change pa_index() to pmap_page_index() for consistency
with other ports.
 1.13 24-Aug-1994  mycroft Add USPACE.
 1.12 23-May-1994  mycroft Merge with 4.4-Lite.
 1.11 20-May-1994  mycroft Kill stupid #ifndef.
 1.10 17-May-1994  cgd splstatclock
 1.9 04-May-1994  mycroft HPUXCOMPAT -> COMPAT_HPUX
 1.8 22-Feb-1994  hpeyerl define disklabel location.
 1.7 04-Dec-1993  cgd add MACHINE_ARCH
 1.6 14-Aug-1993  mycroft Set MID_MACHINE to MID_M68K4K.
 1.5 09-Aug-1993  mycroft Add ALIGNBYTES.
 1.4 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.3 04-Jul-1993  cgd add MID_MACHINE #defined to be MID_HP300
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.28.4.1 11-Mar-1997  is merge in changes from Trunk.
 1.35.2.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.38.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.38.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.40.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.41.8.4 11-Nov-2002  nathanw Catch up to -current
 1.41.8.3 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.41.8.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.41.8.1 30-May-2001  scw file param.h was added on branch nathanw_sa on 2001-11-18 18:09:34 +0000
 1.43.2.6 11-Dec-2005  christos Sync with head.
 1.43.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.43.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.43.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.43.2.2 03-Sep-2004  skrll Sync with HEAD
 1.43.2.1 03-Aug-2004  skrll Sync with HEAD
 1.45.14.1 21-Apr-2006  tron Pull up following revision(s) (requested by oster in ticket #1284):
sys/arch/mvme68k/include/param.h: revision 1.27
sys/arch/hp300/include/param.h: revision 1.46
Patterned after next68k, omit inclusion of <sys/device.h> if we
are not in _KERNEL. This should work around our lint problems
related to "unspecified-size array at end of struct" constructs.
 1.45.12.3 21-Jan-2008  yamt sync with head
 1.45.12.2 03-Sep-2007  yamt sync with head.
 1.45.12.1 21-Jun-2006  yamt sync with head.
 1.45.10.1 21-Apr-2006  tron Pull up following revision(s) (requested by oster in ticket #1284):
sys/arch/mvme68k/include/param.h: revision 1.27
sys/arch/hp300/include/param.h: revision 1.46
Patterned after next68k, omit inclusion of <sys/device.h> if we
are not in _KERNEL. This should work around our lint problems
related to "unspecified-size array at end of struct" constructs.
 1.47.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.48.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.48.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.48.20.1 09-Jan-2008  matt sync with HEAD
 1.49.10.1 11-Mar-2010  yamt sync with head
 1.51.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.51.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.51.4.1 05-Mar-2011  rmind sync with head
 1.52.8.1 18-Feb-2012  mrg merge to -current.
 1.52.4.1 17-Apr-2012  yamt sync with head
 1.9 31-Mar-1997  gwr Need a common <m68k/pcb.h> for gdb.
 1.8 12-May-1995  mycroft Eliminate the double mapping of the kernel stack. Enable swapping.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 23-May-1994  mycroft Merge with 4.4-Lite.
 1.5 21-May-1994  cgd struct md_coredump
 1.4 04-May-1994  mycroft Update to match proc.h.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.35 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.34 22-Sep-2002  chs it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.
 1.33 22-Sep-2002  chs add pmap_remove_all() hook (empty on most platforms so far).
 1.32 10-Sep-2001  chris branches: 1.32.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.31 26-May-2001  chs branches: 1.31.2; 1.31.4;
replace vm_page_t with struct vm_page *.
 1.30 26-May-2001  chs replace {simple_,}lock{_data,}_t with struct {simple,}lock {,*}.
 1.29 25-Apr-2001  thorpej Garbage-collect pmap_page_index().
 1.28 22-Apr-2001  thorpej Undo a misguided previous change to the pmap_update() API.
 1.27 22-Apr-2001  thorpej Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.
 1.26 21-Apr-2001  thorpej #define away pmap_update() in <machine/pmap.h> so that no function
call overhead is incurred as we start sprinkling pmap_update() calls
throughout the source tree (no pmaps currently defer operations, but
we are adding the infrastructure to allow them to do so).
 1.25 25-Feb-1999  is branches: 1.25.8; 1.25.20;
hp300 part of the fix for pr 6152
 1.24 02-Feb-1999  thorpej Implement pmap_prefer() for systems w/ an HP MMU (which has a virtually-tagged
cache). This helps to avoid cache alias problems, and can improve performance
in the case where physical pages have multiple mappings (since the pages will
not have to be marked cache-inhibited).
 1.23 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.22 26-Apr-1998  scottr GC the old MACHINE_NONCONTIG code.
 1.21 18-Feb-1998  cgd Move pmap_map() function definition to MD headers, as appropriate. It's
an internal function, and the VM system shouldn't try to prototype it.
(Note that some ports _don't_ prototype it.)
 1.20 08-Feb-1998  thorpej pmap_page_index() is not used in the MACHINE_NEW_NONCONTIG case.
 1.19 08-Feb-1998  thorpej Implement MACHINE_NEW_NONCONTIG and switch the hp300 port to use it.
 1.18 06-Jan-1998  thorpej Garbage-collect pm_stchanged; it's not used by anything.
 1.17 06-Jan-1998  thorpej Garbage-collect use of the PCB's copy of the user segment table pointer.
 1.16 03-Jan-1998  thorpej Now that all ports have pmap_activate(), and it has an identical interface,
prototype it in <vm/pmap.h>
 1.15 01-Jan-1998  thorpej Change an argument name to PMAP_ACTIVATE() to more accurately describe the
semantics of the argument.
 1.14 31-Dec-1997  thorpej Make pmap_activate() and pmap_deactivate() take a struct proc *.
 1.13 10-Jun-1997  veego s/hp300_btop/m68k_btop/
 1.12 18-Mar-1997  mycroft Make active_user_pmap() DTRT while a process is exiting.
 1.11 18-Mar-1997  mycroft Add an active_user_pmap() macro, and use it as appropriate.
 1.10 11-Dec-1995  thorpej Rather than using individual HP300 model names, map those model names to
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.

In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.

Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
 1.9 11-May-1995  jtc KERNEL -> _KERNEL
 1.8 10-Apr-1995  mycroft Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.
 1.7 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 09-Sep-1994  mycroft Nuke struct ste, struct ste40, struct pte, and HP_PAGE_SIZE. Use my
pv_entry allocator. Change pa_index() to pmap_page_index() for consistency
with other ports.
 1.4 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3 17-May-1994  cgd cast
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.25.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.25.8.1 23-Apr-2001  bouyer Sync with HEAD.
 1.31.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.31.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.31.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.32.4.6 11-Nov-2002  nathanw Catch up to -current
 1.32.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.32.4.4 02-Jul-2002  nathanw Adjust whitespace so that this matches the trunk.
 1.32.4.3 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.32.4.2 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.32.4.1 10-Sep-2001  scw file pmap.h was added on branch nathanw_sa on 2001-11-18 18:09:34 +0000
 1.2 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.1 07-Aug-2002  briggs branches: 1.1.2; 1.1.4; 1.1.6; 1.1.202; 1.1.204;
Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.1.204.1 10-Jun-2019  christos Sync with HEAD
 1.1.202.1 28-Jul-2018  pgoyette Sync with HEAD
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 07-Aug-2002  jdolecek file pmc.h was added on branch kqueue on 2002-09-06 08:35:09 +0000
 1.1.4.2 30-Aug-2002  gehenna catch up with -current.
 1.1.4.1 07-Aug-2002  gehenna file pmc.h was added on branch gehenna-devsw on 2002-08-30 00:19:45 +0000
 1.1.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 07-Aug-2002  nathanw file pmc.h was added on branch nathanw_sa on 2002-08-13 02:18:12 +0000
 1.9 13-Jul-2002  scw m68k syscall rototill:

- Switch all m68k-based ports over to __HAVE_SYSCALL_INTERN.
- Add systrace glue.
- Define struct mdproc in <m68k/proc.h> instead of <machine/proc.h>.
(They were all defined exactly the same anyway, other than a couple
of the MDP_* flags.)
 1.8 05-Oct-1997  carrel branches: 1.8.30; 1.8.34; 1.8.42;
Add missing definition needed for COMPAT_SUNOS
 1.7 16-Mar-1997  thorpej branches: 1.7.4;
Nuke MDP_HPUXTRACE.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 19-Jul-1994  mycroft MDP_AST is deprecated.
 1.4 23-May-1994  mycroft branches: 1.4.2;
Merge with 4.4-Lite.
 1.3 05-May-1994  mycroft Most of the changes needed to make this continue to run.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.2.1 14-Aug-1994  mycroft update from trunk (nuke MDP_AST)
 1.7.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.42.1 16-Jul-2002  gehenna catch up with -current.
 1.8.34.2 01-Aug-2002  nathanw Catch up to -current.
 1.8.34.1 18-Nov-2001  scw MD Scheduler Activation bits for HP300.
Compile-tested only.
Note: COMPAT_HPUX is not yet fully lwp'ified.
 1.8.30.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 28-May-1994  mycroft For 4.4 profiling stuff.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 23-May-1994  mycroft Merge with 4.4-Lite.
 1.3 08-Jan-1994  cgd stubs which pint to m68k include
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5 14-Oct-2002  chs merge pte.h for m68k w/ motorola or compatible MMU
(only 4k-page platforms so far).
 1.4 26-Oct-1994  cgd branches: 1.4.50;
new RCS ID format.
 1.3 09-Sep-1994  mycroft Nuke struct ste, struct ste40, struct pte, and HP_PAGE_SIZE. Use my
pv_entry allocator. Change pa_index() to pmap_page_index() for consistency
with other ports.
 1.2 23-May-1994  mycroft Merge with 4.4-Lite.
 1.1 09-Aug-1993  mycroft Move pte.h to /usr/include/machine, like it is in other ports.
 1.4.50.1 18-Oct-2002  nathanw Catch up to -current.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 08-Jan-1994  cgd stubs which pint to m68k include
 1.10 06-Dec-2005  tsutsui Remove multiple inclusion protection from files which just include
MI m68k headers and don't have any own declarations.
 1.9 26-Oct-1994  cgd branches: 1.9.66; 1.9.82;
new RCS ID format.
 1.8 27-Jan-1994  cgd HP300 -> MACHINE
 1.7 08-Jan-1994  cgd stubs which pint to m68k include
 1.6 06-Jan-1994  mycroft Still need old #defines for now.
 1.5 06-Jan-1994  mycroft Implement `struct reg'.
 1.4 08-Dec-1993  mycroft Move #define of NIPCREG outside #fidef.
 1.3 02-Sep-1993  mycroft Ditto.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9.82.1 21-Jun-2006  yamt sync with head.
 1.9.66.1 11-Dec-2005  christos Sync with head.
 1.2 09-Feb-2007  ad branches: 1.2.4;
Merge newlock2 to head.
 1.1 22-Dec-2006  ad branches: 1.1.2;
file rwlock.h was initially added on branch newlock2.
 1.1.2.1 22-Dec-2006  ad Pull in CPU specific stubs.
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file rwlock.h was added on branch yamt-lazymbuf on 2007-02-26 09:06:34 +0000
 1.1 20-Dec-1994  cgd make the definition of _JBLEN mach. dep. header-dependent.
 1.4 13-Sep-1998  mycroft Minor change.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Jan-1994  cgd stubs which pint to m68k include
 1.1 13-Oct-1993  cgd md signal context.
 1.6 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.5 22-Jan-1999  mycroft Standardize format.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Jan-1994  cgd stubs which pint to m68k include
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd add from net2. were symlinks to ../../vax/include/*
 1.2 11-Dec-2005  christos branches: 1.2.18;
merge ktrace-lwp.
 1.1 11-Jul-2005  christos branches: 1.1.6;
new file
 1.1.6.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.6.1 11-Jul-2005  skrll file sunos_machdep.h was added on branch ktrace-lwp on 2005-11-10 13:56:09 +0000
 1.2.18.2 21-Jun-2006  yamt sync with head.
 1.2.18.1 11-Dec-2005  yamt file sunos_machdep.h was added on branch yamt-lazymbuf on 2006-06-21 14:51:28 +0000
 1.4 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.3 09-Nov-1999  kleink branches: 1.3.40; 1.3.218;
Rip protection against multiple inclusion from wrapper headers.
 1.2 29-Apr-1999  kleink branches: 1.2.2; 1.2.4; 1.2.6; 1.2.10;
Pull in the right generic m68k header. (Where was my mind?)
 1.1 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.2.10.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.6.1 15-Nov-1999  fvdl Sync with -current
 1.2.4.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.218.1 10-Jun-2019  christos Sync with HEAD
 1.3.40.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 23-May-1994  mycroft Merge with 4.4-Lite.
 1.4 08-Jan-1994  cgd stubs which pint to m68k include
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.22 23-Jan-2021  christos Document via __HAVE_BUS_SPACE_8 platforms that implement bus_space_*_8
 1.21 12-Jun-2011  rmind branches: 1.21.66;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.20 20-Jan-2008  joerg branches: 1.20.32; 1.20.42;
Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
 1.19 17-Oct-2007  garbled branches: 1.19.2; 1.19.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.18 14-Jul-2007  ad branches: 1.18.10;
Generic soft interrupts are mandatory.
 1.17 09-Sep-2006  tsutsui branches: 1.17.10; 1.17.18;
Switch hp300 to timecounter with MC6840 interval timer, which is
used for hardclcok(9). Old code is still left for reference.

XXX: possibly problematic if hardclock(9) is blocked more than 1/HZ,
XXX: but old microtime(9) implementation also had the similar problem.
 1.16 04-Sep-2006  tsutsui branches: 1.16.2;
Switch hp300 to MI todr.
 1.15 06-Dec-2005  tsutsui branches: 1.15.4; 1.15.8;
Use _HP300_FOO_H_ instead of _MACHINE_FOO_H_.
 1.14 18-Jan-2004  martin branches: 1.14.16;
Do not export __HAVE_RAS to userland. Applications are supposed to try
rasctl() and detect failure with EOPNOTSUPP.
 1.13 22-Sep-2002  simonb branches: 1.13.6;
Use "#define\t" instead of "#define ".
 1.12 28-Aug-2002  gmcgarry RAS support for m68k.
 1.11 28-Feb-2002  simonb branches: 1.11.8;
Use "#define<tab>".
 1.10 08-Dec-2001  gmcgarry softintr(9) interface for hp300
 1.9 01-Feb-2000  danw branches: 1.9.8; 1.9.12;
#define __HAVE_DEVICE_REGISTER on ports that have it, and check for
that, rather than a list of architecture defines, in config_attach
 1.8 17-Dec-1996  thorpej branches: 1.8.28;
Kill __BROKEN_INDIRECT_CONFIG
 1.7 05-Dec-1996  cgd First step inn removing config_scan() and the hacks that gave devices
on indirect-config busses a (permanent) softc that they could share
between 'match' and 'attach' routines:

Define __BROKEN_INDIRECT_CONFIG so that old autoconfiguration
interfaces are used, until drivers are converted to use the new
interfaces (actually, converted back to use the _older_ interfaces)
which prohibit indirect configuration devices from receiving a softc
in their match routine that they can share with their attach routine.
 1.6 06-Oct-1996  thorpej Nuke __BDEVSW_DUMP_OLD_TYPE.
 1.5 26-Jun-1995  cgd define __BDEVSW_DUMP_OLD_TYPE for ports where it's true. clean up
some m68k ports inclusion of common header.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 08-Jan-1994  cgd stubs which pint to m68k include
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.8.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.12.5 18-Oct-2002  nathanw Catch up to -current.
 1.9.12.4 07-Oct-2002  gmcgarry All m68k ports now support RAS in the common cpu_switch().
 1.9.12.3 17-Sep-2002  nathanw Catch up to -current.
 1.9.12.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.9.8.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.9.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.8.1 30-Aug-2002  gehenna catch up with -current.
 1.13.6.4 11-Dec-2005  christos Sync with head.
 1.13.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14.16.4 21-Jan-2008  yamt sync with head
 1.14.16.3 03-Sep-2007  yamt sync with head.
 1.14.16.2 30-Dec-2006  yamt sync with head.
 1.14.16.1 21-Jun-2006  yamt sync with head.
 1.15.8.1 14-Sep-2006  yamt sync with head.
 1.15.4.1 09-Sep-2006  rpaulo sync with head
 1.16.2.1 18-Nov-2006  ad Sync with head.
 1.17.18.1 03-Oct-2007  garbled Sync with HEAD
 1.17.10.1 15-Jul-2007  ad Sync with head.
 1.18.10.2 23-Mar-2008  matt sync with HEAD
 1.18.10.1 06-Nov-2007  matt sync with HEAD
 1.19.8.1 23-Jan-2008  bouyer Sync with HEAD.
 1.19.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.20.42.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.20.32.1 18-Mar-2010  rmind Unify /dev/{mem,kmem,zero,null} implementations in MI code. Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
 1.21.66.1 03-Apr-2021  thorpej Sync with HEAD.
 1.3 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 27-Jan-1994  mycroft .
 1.2 16-Jan-2024  thorpej Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).
 1.1 13-Jan-2024  thorpej Switch hp300 over to the common m68k vector table.
 1.41 01-Feb-2020  tsutsui Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).

Background:
- All m68k ports have fixed PAGE_SIZE value in their kernels,
but each port uses different PAGE_SIZE value (4096 or 8192)
due to historical reasons.
- Currently module(7) binaries are built per each port so
all m68k kernel sources don't support run-time variable PAGE_SIZE.
- MI <uvm/uvm_param.h> assumes that the port supports a variable
PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE
are defined and they have different values.
- On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
for internal optimization.
- m68k ports share userland binaries (especially pkgsrc binaries)
among all ports, so we need to define MAX_PAGE_SHIFT as 13 to
support m68k ports where PAGE_SIZE==8192.
(though this would affect only if static binaries built on
4k page hosts are executed on 8k page hosts)

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.
For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case.

Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@:
https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035
https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954

Should be pulled up to netbsd-9.
 1.40 28-Jun-2019  tsutsui branches: 1.40.2; 1.40.4;
Fix lingering page size comments.

Pointed out by christos@ on port-m68k@:
http://mail-index.netbsd.org/port-m68k/2019/06/06/msg000726.html

XXX: we also need MAX_PAGE_SIZE in somewhere for newer jemalloc?
 1.39 02-Feb-2017  rin branches: 1.39.14;
PR port-mac68k/51923
Bump default MAXTSIZ to 32MB for m68k ports, which allos us to use GCC 5.4 on
GENERIC kernels.
Ok jklos
 1.38 02-Feb-2017  rin PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos
 1.37 08-Feb-2011  rmind branches: 1.37.14; 1.37.32; 1.37.36; 1.37.40;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.36 06-Nov-2010  uebayasi branches: 1.36.2; 1.36.4;
Remove incomplete, never worked dynamic run-time memory registration
(uvm_page_physload(9)). This functionality will be re-added later.
 1.35 08-Dec-2009  tsutsui branches: 1.35.2; 1.35.4;
Use PGSHIFT from <machine/param.h> for PAGE_SHIFT.
We can assume PGSHIFT is always constant on current
m68k pmap_motorola implementation.
Also fix some leftover HP300 comments on some ports.
 1.34 26-Aug-2009  thorpej Minor tweak to the pv_table management in the Hibler-derived m68k pmaps:
The head of the list is now a pv_header, which contains the first pv_entry
as well as a 16-bit attributes field (replaces the pmap_attributes array
plus the pv_entry::pv_flags field) as a 16-bit count of caller-specified
cache-inhibited mappings.

Tested on hp300 (shared pmap_motorola.c), changes to atari and amiga copies
are purely mechanical.
 1.33 06-Mar-2009  joerg Remove SHMMAXPGS from all kernel configs. Dynamically compute the
initial limit as 1/4 of the physical memory. Ensure the limit is at
least 1024 pages, the old default on most platforms.
 1.32 11-Dec-2005  christos branches: 1.32.78; 1.32.86; 1.32.92;
merge ktrace-lwp.
 1.31 01-Apr-2005  yamt merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.30 07-Aug-2003  agc branches: 1.30.8; 1.30.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.29 02-Apr-2003  thorpej branches: 1.29.2;
Use PAGE_SIZE rather than NBPG.
 1.28 10-Dec-2002  thorpej Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
 1.27 15-Nov-2001  soren MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
 1.26 01-May-2001  thorpej branches: 1.26.2; 1.26.8;
Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.
 1.25 29-Apr-2001  thorpej Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure. Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM. These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg. As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now). Changes to other pmap
modules will follow.
 1.24 12-Dec-2000  simonb branches: 1.24.2;
Bump the initial data size limit to 32MB - large enough to compile a
kernel with an ELF toolchain.
 1.23 01-Dec-2000  tsutsui Remove unused pcbb() macro.
 1.22 14-Nov-2000  thorpej We use 4K pages on the hp300. Make PAGE_SIZE and friends
compile-time constants.
 1.21 11-Feb-2000  thorpej Update for the NKMEMPAGES changes.
 1.20 26-Jan-2000  tsutsui Remove obsoleted macros.
 1.19 04-Dec-1999  ragge CL* discarding.
 1.18 26-Apr-1999  thorpej branches: 1.18.2; 1.18.8;
Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.
 1.17 16-Jan-1999  chuck branches: 1.17.4;
MNN is now the default
 1.16 20-Aug-1998  kleink vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.15 08-Jul-1998  thorpej Define one page free list, and put all pages on it.
 1.14 26-Apr-1998  scottr GC the old MACHINE_NONCONTIG code.
 1.13 08-Feb-1998  thorpej Implement MACHINE_NEW_NONCONTIG and switch the hp300 port to use it.
 1.12 12-Jul-1997  perry update comment from 1981 on memory and disk prices -- pr-2754 from Curt Sampson
 1.11 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainilne.
 1.10 15-Mar-1997  thorpej branches: 1.10.2;
User text segment begins at 8k, now, to match the other m68k ports.
 1.9 20-Oct-1996  thorpej branches: 1.9.4;
Back out last change, and add a comment about what should happen.
(*grumble* will teach me to do a `make clean' next time.)
 1.8 19-Oct-1996  thorpej Set VM_MIN_KERNEL_ADDRESS to NBPG. This is a better way of getting
the kernel_map to treat page 0 properly.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 23-May-1994  mycroft Merge with 4.4-Lite.
 1.5 24-Aug-1993  mycroft Double data size limits to make GCC happier.
 1.4 19-Aug-1993  mycroft Set USRTEXT to NBPG.
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9.4.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.10.2.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.17.4.2 06-Aug-1999  chs take an initial guess at UBC parameters.
 1.17.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.18.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.18.2.5 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.18.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes)
 1.18.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.18.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.18.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.24.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.26.8.3 11-Dec-2002  thorpej Sync with HEAD.
 1.26.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.26.8.1 01-May-2001  nathanw file vmparam.h was added on branch nathanw_sa on 2002-01-08 00:24:45 +0000
 1.26.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.29.2.4 01-Apr-2005  skrll Sync with HEAD.
 1.29.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.29.2.1 03-Aug-2004  skrll Sync with HEAD
 1.30.10.1 24-Feb-2005  yamt change kernel va layout, following mac68k.
 1.30.8.1 29-Apr-2005  kent sync with -current
 1.32.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.32.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.32.78.3 11-Mar-2010  yamt sync with head
 1.32.78.2 16-Sep-2009  yamt sync with head
 1.32.78.1 04-May-2009  yamt sync with head.
 1.35.4.1 05-Mar-2011  rmind sync with head
 1.35.2.1 26-Apr-2010  uebayasi Remove the unfinished code to add a memory segment after uvm_page_init().
It doesn't even compile.

(In the future, we should allocate struct vm_page [] on the added memory
segment for NUMA's sake.)
 1.36.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.36.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.37.40.1 21-Apr-2017  bouyer Sync with HEAD
 1.37.36.1 20-Mar-2017  pgoyette Sync with HEAD
 1.37.32.1 05-Feb-2017  skrll Sync with HEAD
 1.37.14.1 03-Dec-2017  jdolecek update from HEAD
 1.39.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.40.4.1 29-Feb-2020  ad Sync with head.
 1.40.2.1 10-Feb-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #682):

sys/arch/next68k/include/vmparam.h: revision 1.27
sys/arch/mac68k/include/vmparam.h: revision 1.46
sys/arch/sun3/include/vmparam.h: revision 1.38
sys/arch/m68k/include/vmparam.h: revision 1.1
sys/arch/hp300/include/vmparam.h: revision 1.41
sys/arch/m68k/include/Makefile: revision 1.32
sys/arch/amiga/include/vmparam.h: revision 1.48
distrib/sets/lists/comp/ad.m68k: revision 1.63
sys/arch/x68k/include/vmparam.h: revision 1.40
sys/arch/mvme68k/include/vmparam.h: revision 1.38
sys/arch/luna68k/include/vmparam.h: revision 1.23
sys/arch/news68k/include/vmparam.h: revision 1.23
sys/arch/atari/include/vmparam.h: revision 1.34
sys/arch/cesfic/include/vmparam.h: revision 1.19

Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).

Background:
- All m68k ports have fixed PAGE_SIZE value in their kernels,
but each port uses different PAGE_SIZE value (4096 or 8192)
due to historical reasons.
- Currently module(7) binaries are built per each port so
all m68k kernel sources don't support run-time variable PAGE_SIZE.
- MI <uvm/uvm_param.h> assumes that the port supports a variable
PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE
are defined and they have different values.
- On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
for internal optimization.
- m68k ports share userland binaries (especially pkgsrc binaries)
among all ports, so we need to define MAX_PAGE_SHIFT as 13 to
support m68k ports where PAGE_SIZE==8192.
(though this would affect only if static binaries built on
4k page hosts are executed on 8k page hosts)

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.

For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case.

Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@:
https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035
https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954

Should be pulled up to netbsd-9.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-May-2004  kleink branches: 1.1.2;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 08-May-2004  skrll file wchar_limits.h was added on branch ktrace-lwp on 2004-08-03 10:34:37 +0000
 1.24 31-May-2000  he Add handling of "make release".
 1.23 04-Feb-1997  thorpej branches: 1.23.20; 1.23.26; 1.23.34;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.22 18-Oct-1996  thorpej Use ${INSTALL}.
 1.21 07-Oct-1996  thorpej Sanity sweep.
 1.20 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.19 15-Jan-1996  thorpej Use ${BINOWN} and ${BINGRP} per Arne H. Juul <arnej@ikke.idt.unit.no>
in PR #705. Also, clean up some stuff left over from HP-BSD.
 1.18 23-Sep-1995  thorpej Compile the system installation program and install it in /usr/mdec/rbootd
as SYS_INST.
 1.17 02-Sep-1995  thorpej Add support for network booting; uses the following procedure:
rbootd->rarp->bootparam->nfs
Add "reset" option to disk and network boot prompts to reload boot code.
 1.16 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.15 21-Feb-1995  mycroft Remove `nboot' completely.
 1.14 19-Feb-1995  mycroft Add unfinished netboot code, and reorganize the Makefile somewhat.
 1.13 26-Oct-1994  cgd new RCS ID format.
 1.12 19-Sep-1994  mycroft Fix misguided attempt to reorganize bootdev, and fix a few
other miscellaneous bugs and nits.
 1.11 15-Aug-1994  mycroft branches: 1.11.2;
Fix `make depend' error.
 1.10 04-Aug-1994  brezak Use installboot.sh from 4.4 instead of installboot.c
 1.9 18-Jul-1994  mycroft Dorothy, I don't think we're in Utah any more...
 1.8 27-Jun-1994  hpeyerl branches: 1.8.2;
Why was DESTDIR= here? From Dave Carrel <carrel@cisco.com
 1.7 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.6 30-Jan-1994  mycroft Add a missing ${.CURDIR}.
 1.5 26-Jan-1994  cgd .PATH in ${S}/stand
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 31-Jul-1993  mycroft Add RCS indentifiers.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.8.2.3 15-Aug-1994  mycroft update from trunk
 1.8.2.2 05-Aug-1994  mycroft update from trunk, per Brezak
 1.8.2.1 18-Jul-1994  cgd updates from trunk
 1.11.2.2 20-Sep-1994  cgd from trunk, per mycroft
 1.11.2.1 15-Aug-1994  cgd file Makefile was added on branch netbsd-1-0 on 1994-09-20 05:07:33 +0000
 1.23.34.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.23.26.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.23.20.1 13-Jul-2000  he Pull up revision 1.24 (requested by he):
Enhance the ``make release'' process:
o Build and install the distrib and boot bits
 1.42 26-May-2025  tsutsui Remove obsolete COMPAT_NOLABEL. It was removed >20 years ago.
 1.41 26-May-2025  tsutsui Also use sti(4) ROM functions for 362/382 framebuffers on bootloader.

Mostly taken on OpenBSD/hp300.
Tested on 382 with VGA-res EVRX, and no visible regression on
425e (sti EVRX), 425t (sti CRX), and 380 (topcat).
 1.40 17-May-2025  tsutsui Speed up hp300 netboot by reducing RTC access during timeout checks.

The read_bbc() function against HIL seems extremely slow.
It was being called on every timeout check via getsecs()
so it significantly slowed down loading a kernel via NFS.

In most cases (e.g., in common/if_le.c and libsa/net.c),
timeout checks are performed using getsecs() in busy loops
without any actual waiting. In such cases, it's not necessary
to read the precise time from the RTC on every call.

This change reduces the time to load the NetBSD/hp300 10.1 GENERIC kernel
via NFS from 260 seconds to 64 seconds on HP9000/382.
 1.39 07-May-2024  tsutsui branches: 1.39.2;
Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
 1.38 08-Feb-2024  christos PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
 1.37 09-Jul-2021  tsutsui branches: 1.37.10;
Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot
After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot
 1.36 08-Apr-2017  christos branches: 1.36.18; 1.36.30;
centralize vers.c building for standalone programs.
 1.35 17-Jan-2016  tsutsui branches: 1.35.2; 1.35.4;
Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
Tested on HP9000/382.
 1.34 13-Apr-2014  tsutsui branches: 1.34.4;
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.

Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
 1.33 12-Jan-2014  tsutsui branches: 1.33.2;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.32 12-Feb-2011  tsutsui branches: 1.32.4; 1.32.10; 1.32.14; 1.32.18;
Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.31 10-Feb-2011  tsutsui Pull support for Tigershark monochrome framebuffer from OpenBSD.
Untested (no hardware), but doesn't break existing HP425t topcat.
 1.30 22-Jan-2011  joerg Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
 1.29 03-Apr-2009  tsutsui branches: 1.29.4; 1.29.6; 1.29.8;
Remove obsolete LIBSA_USE_MEMCPY and LIBSA_USE_MEMSET.
They were removed from <lib/libsa/stand.h> on December 2007.
 1.28 15-Mar-2009  tsutsui Use <bsd.klinks.mk> to create symlinks to MD system header directories.
 1.27 16-Jul-2008  tsutsui branches: 1.27.2; 1.27.8;
Change boot messages to replace build date and maker with kernrev.
 1.26 11-Dec-2005  christos branches: 1.26.74; 1.26.78; 1.26.80; 1.26.82; 1.26.84;
merge ktrace-lwp.
 1.25 28-Nov-2004  jmc Convert mkboot into a full cross tool. Last hurdle for hp300 to building on
non NetBSD/bsd hosts.
 1.24 14-Nov-2003  tsutsui branches: 1.24.4;
- define LIBSA_USE_MEMCPY and LIBSA_USE_MEMSET
- set WARNS?=1
 1.23 13-Nov-2003  tsutsui Use 32bit daddr_t for now so that uboot.lif works again.

XXX The real fix is adding prototype declarations for all functions.
 1.22 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.21 02-Oct-2003  simonb Don't depend in libc, et al.
 1.20 30-May-2002  thorpej branches: 1.20.6;
Add -ffreestanding to CFLAGS.
 1.19 16-Mar-2002  gmcgarry branches: 1.19.4; 1.19.6;
Move exec_hp300() out of uboot.c into its own file so that it can
be used by SYS_INST. SYS_INST can now boot ELF kernels inside the
miniroot.
 1.18 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.17 03-Dec-2001  gmcgarry Use BOOTP by default.
 1.16 14-Nov-2001  tv ${MAKE} print-objdir -> ${PRINTOBJDIR}
 1.15 27-May-2001  gmcgarry branches: 1.15.2; 1.15.8;
- remove dependency on libsa by mkboot since it is a host tool.
- adjust for endianness of host.

Cross-compiling of ELF bootblocks now works.
 1.14 12-May-2001  gmcgarry size -> ${SIZE}
 1.13 02-Jan-2001  simonb branches: 1.13.2;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.12 16-Dec-2000  simonb Use sys/conf/newvers_stand.sh instead of local script.
 1.11 23-Jan-2000  mycroft Clean up the machine symlink stuff ever so slightly. Needs to be
standardized between files.
 1.10 21-Dec-1999  frueauf As per Chris G. Demetriou <cgd@netbsd.org> don't install
loadfile_machdep.h into /usr/include/hp300/, instead create a
link for machine and hp300 in ${.OBJDIR} like
sys/arch/alpha/stand/Makefile.buildboot does for alpha.
 1.9 14-Dec-1999  thorpej Optimize for space.
 1.8 14-Dec-1999  thorpej Include loadfile() (and a.out support for loadfile()) in libsa.
 1.7 13-Nov-1999  thorpej Backout my libsa changes.
 1.6 11-Nov-1999  thorpej No longer need to build libkern.
 1.5 13-Feb-1999  lukem branches: 1.5.8; 1.5.10; 1.5.14;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.4 09-May-1997  mycroft Eliminate bogus redefinitions of standard targets.
 1.3 17-Apr-1997  thorpej STRIP -> STRIPFLAG
 1.2 04-Feb-1997  thorpej Add support for transparent handling of decompressing read, useful
for gzip'd kernels and miniroot images.
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.5.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.10.1 15-Nov-1999  fvdl Sync with -current
 1.5.8.2 05-Jan-2001  bouyer Sync with HEAD
 1.5.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.15.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.15.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.15.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.15.8.1 27-May-2001  nathanw file Makefile.buildboot was added on branch nathanw_sa on 2002-01-08 00:24:46 +0000
 1.15.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.19.6.1 30-May-2002  tv Pull up revision 1.20 (requested by thorpej in ticket #90):
Add -ffreestanding to CFLAGS.
 1.19.4.1 14-Jul-2002  gehenna catch up with -current.
 1.20.6.4 29-Nov-2004  skrll Sync with HEAD.
 1.20.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.6.1 03-Aug-2004  skrll Sync with HEAD
 1.24.4.1 02-Apr-2005  he Pull up revision 1.25 (requested by jmc in ticket #1025):
Convert mkboot into a full cross tool. Last hurdle for hp300 to
building on non NetBSD/bsd hosts.
 1.26.84.1 19-Oct-2008  haad Sync with HEAD.
 1.26.82.1 18-Jul-2008  simonb Sync with head.
 1.26.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.26.78.1 04-May-2009  yamt sync with head.
 1.26.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.27.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.29.8.2 17-Feb-2011  bouyer Sync with HEAD
 1.29.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.29.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.4.1 05-Mar-2011  rmind sync with head
 1.32.18.1 18-May-2014  rmind sync with head
 1.32.14.2 03-Dec-2017  jdolecek update from HEAD
 1.32.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.32.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.32.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.33.2.1 10-Aug-2014  tls Rebase.
 1.34.4.2 28-Aug-2017  skrll Sync with HEAD
 1.34.4.1 19-Mar-2016  skrll Sync with HEAD
 1.35.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.35.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.36.30.1 01-Aug-2021  thorpej Sync with HEAD.
 1.36.18.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.37.10.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.39.2.1 02-Aug-2025  perseant Sync with HEAD
 1.17 15-Apr-2021  mrg more -fcommon for boot programs.
 1.16 15-Mar-2009  tsutsui branches: 1.16.78;
Use <bsd.klinks.mk> to create symlinks to MD system header directories.
 1.15 24-Jun-2008  matt branches: 1.15.4; 1.15.10;
Need for machine-links to finish before building ${PROG}
 1.14 11-Dec-2005  christos branches: 1.14.74; 1.14.78; 1.14.80; 1.14.82;
merge ktrace-lwp.
 1.13 20-Jul-2003  tsutsui Create ${MACHINE_ARCH} symlink as well for stand progs.
 1.12 02-Jan-2001  simonb branches: 1.12.24;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.11 06-Dec-2000  simonb Use 'make print-objdir' to get obj directory instead of guessing.
 1.10 30-Aug-2000  jhawk Use
${MAKE}
instead of
make
 1.9 31-May-2000  he branches: 1.9.2;
Add handling of "make release".
 1.8 06-Feb-1999  thorpej branches: 1.8.2; 1.8.8; 1.8.16;
STANDALONE -> _STANDALONE.
 1.7 12-May-1997  thorpej Build the standalone APCI driver.
 1.6 27-Apr-1997  thorpej srt0.s renamed to srt0.S via repository copy Magick - we want this
file to be preprocessed before it is assembled.
 1.5 24-Apr-1997  thorpej Add Domain keyboard support source files (oops, forgot to commit this
file when I integrated the rest of it!). Fixes PR #3523, from
Thorsten Frueauf <frueauf@ira.uka.de>.
 1.4 14-Apr-1997  thorpej Build HIL and Domain keyboard support. Include UK HIL keymap.
 1.3 04-Feb-1997  thorpej Set the heap limit to the last byte of the 3rd page from the
end of RAM, i.e.:

[ heap limit page][msgbuf page][ROM scratch page]
| |
heap limit end of RAM
 1.2 04-Feb-1997  thorpej Thou shalt not taunt the HP BOOTROM with silliness such as incorrect
link order.
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.8.16.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.8.8.3 05-Jan-2001  bouyer Sync with HEAD
 1.8.8.2 08-Dec-2000  bouyer Sync with HEAD.
 1.8.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.2.1 13-Jul-2000  he Pull up revision 1.9 (requested by he):
Enhance the ``make release'' process:
o Build and install the distrib and boot bits
 1.9.2.1 13-Dec-2000  he Pull up revision 1.11 (requested by simonb):
Use 'make print-objdir' to get obj directory correctly.
 1.12.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.24.1 03-Aug-2004  skrll Sync with HEAD
 1.14.82.1 27-Jun-2008  simonb Sync with head.
 1.14.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.14.78.1 04-May-2009  yamt sync with head.
 1.14.74.1 29-Jun-2008  mjf Sync with HEAD.
 1.15.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.16.78.1 17-Apr-2021  thorpej Sync with HEAD.
 1.13 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.12 30-Jan-1997  thorpej Clean up #includes.
 1.11 14-Oct-1996  thorpej Clean up the code that sets `bootdev' based on information provided
by the BOOTROM. Also, give network devices the attention they deserve.
 1.10 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.9 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.8 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Sep-1994  mycroft Fix misguided attempt to reorganize bootdev, and fix a few
other miscellaneous bugs and nits.
 1.5 19-Jun-1994  hpeyerl branches: 1.5.2;
hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.2.1 20-Sep-1994  cgd from trunk, per mycroft
 1.7 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.6 21-Feb-1995  mycroft Use the libsa exec().
 1.5 21-Feb-1995  mycroft Tweak to make the twiddler look better.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.3 20-Feb-1995  mycroft Update to the new RCS id convention.
 1.2 19-Feb-1995  mycroft Don't panic if the battery is dead.
 1.1 19-Feb-1995  mycroft Add unfinished netboot code, and reorganize the Makefile somewhat.
 1.13 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.12 14-Oct-1996  thorpej Add a standalone driver entry point that sets the physical unit (HP-IB's
equivalent of a LUN) in `bootdev'. This is needed to properly detect the
boot device if booted from the tape unit of an HP-IB disk/tape combo.
 1.11 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.10 23-Sep-1995  thorpej Re-arrange a mite; for the system installation program. Catch up with libsa
changes.
 1.9 02-Sep-1995  thorpej Add support for network booting; uses the following procedure:
rbootd->rarp->bootparam->nfs
Add "reset" option to disk and network boot prompts to reload boot code.
 1.8 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.7 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.6 19-Feb-1995  mycroft Add unfinished netboot code, and reorganize the Makefile somewhat.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.10 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.9 04-Oct-1995  thorpej Determine the select code of the console device, or -1 for internal grf.
Pass this value to the kernel in register d5. This value isn't currently
used by the kernel, but will be in the future.
 1.8 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.7 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 19-Feb-1994  hpeyerl fix up some #include's.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.3 04-Oct-1995  thorpej Determine the select code of the console device, or -1 for internal grf.
Pass this value to the kernel in register d5. This value isn't currently
used by the kernel, but will be in the future.
 1.2 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.1 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.10 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.9 14-Oct-1996  thorpej Implement ctpunit(), a "set physical unit" entry point.
 1.8 06-Oct-1996  thorpej Fixup ctstrategy() calling convention. The standalone ct driver
works again.
 1.7 23-Sep-1995  thorpej Catch up with libsa changes.
 1.6 26-Oct-1994  cgd new RCS ID format.
 1.5 19-Sep-1994  mycroft Fix misguided attempt to reorganize bootdev, and fix a few
other miscellaneous bugs and nits.
 1.4 09-Mar-1994  brezak branches: 1.4.2;
Fix for disk (and tape) units > 0
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.2.1 20-Sep-1994  cgd from trunk, per mycroft
 1.11 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.10 06-Oct-1996  mycroft Serial console changes:
* Enable FIFO with trigger level 1.
* Set DTR and RTS so terminals are happy.
* Do not set IEN.
 1.9 26-Feb-1996  thorpej branches: 1.9.4;
Adjust for the new console code; CONSCODE is now a kernel option, not
a dca-specific constant. For now, hardwire standalone DCA console
at select code 9 (which is what the old constant expanded to). Really
should make the way the bootblock console is probed look just like how
the kernel console is probed.
 1.8 04-Oct-1995  thorpej Determine the select code of the console device, or -1 for internal grf.
Pass this value to the kernel in register d5. This value isn't currently
used by the kernel, but will be in the future.
 1.7 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.6 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 19-Feb-1994  hpeyerl fix up some #include's.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9.4.1 10-Dec-1996  mycroft From trunk:
Set serial port parameters sanely for a serial console.
 1.11 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.10 30-Jan-1997  thorpej Clean up #includes.
 1.9 27-Feb-1996  scottr make this compile again, since CONUNIT is no longer defined for us.
per Jason.
 1.8 04-Oct-1995  thorpej Determine the select code of the console device, or -1 for internal grf.
Pass this value to the kernel in register d5. This value isn't currently
used by the kernel, but will be in the future.
 1.7 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.6 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 19-Feb-1994  hpeyerl fix up some #include's.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.2 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1 30-Jan-1997  thorpej Commit this to the right place, this time.

The boot blocks do a primitive form of autoconfiguration. Duplicate some
of the old config strcutures for the benefit of the boot blocks; they
don't need something as flexible as the kernel does.
 1.8 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.7 14-Oct-1996  thorpej Garbage collect some hackish code that was needed when we had a lame
kernel setroot(). The device type for network boot is set like any
other device now. Also, call the punit entry point for device drivers
to properly set `bootdev'.
 1.6 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.5 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.4 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 19-Sep-1994  mycroft Fix misguided attempt to reorganize bootdev, and fix a few
other miscellaneous bugs and nits.
 1.1 26-Jan-1994  brezak branches: 1.1.2;
hp300 stanealone bootstrap program ported to use CMU libsa
 1.1.2.1 20-Sep-1994  cgd from trunk, per mycroft
 1.6 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.5 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.7 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.6 30-Jan-1997  thorpej Clean up #includes.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 02-Sep-1993  mycroft Ditto.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.5 30-Jan-1997  thorpej Clean up #includes.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.10 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.9 30-Jan-1997  thorpej Clean up #includes.
 1.8 01-Jan-1996  thorpej Add the last revision previous to the switch to the MI LANCE code of
hp300/dev/if_lereg.h to the standalone code; the standalone LANCE driver
for the hp300 needs it.
 1.7 19-Oct-1995  thorpej Truncate the incoming packet if it doesn't fit into the buffer.
 1.6 02-Sep-1995  thorpej branches: 1.6.2;
Add support for network booting; uses the following procedure:
rbootd->rarp->bootparam->nfs
Add "reset" option to disk and network boot prompts to reload boot code.
 1.5 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.4 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.3 20-Feb-1995  mycroft Update to the new RCS id convention.
 1.2 19-Feb-1995  mycroft Don't stall if we get packets back-to-back.
 1.1 19-Feb-1995  mycroft Add unfinished netboot code, and reorganize the Makefile somewhat.
 1.6.2.1 19-Oct-1995  thorpej Update from trunk; truncate the incoming packet if it doesn't fit into
the buffer.
 1.2 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1 01-Jan-1996  thorpej Add the last revision previous to the switch to the MI LANCE code of
hp300/dev/if_lereg.h to the standalone code; the standalone LANCE driver
for the hp300 needs it.
 1.7 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.6 21-Dec-1996  thorpej This wasn't just a spelling error... I invented a whole new word!
 1.5 14-Oct-1996  thorpej Move the machdep_start() code into machdep.c. No need for different
versions of this function anymore, now that we have a sane kernel setroot().
 1.4 07-Oct-1996  thorpej Add support for copying the miniroot from HP-IB cartridge tape.
 1.3 11-Sep-1996  thorpej When opening a disk for non-filesystem i/o, make sure we only return
an error condition when an error occurs.

Bug noticed by Terry Lambert <terry@lambert.org>.
 1.2 26-Jun-1996  thorpej Oops, forgot this required change in previous commit.
 1.1 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.4 05-Aug-1994  mycroft Clean up deleted files.
 1.3 22-Jun-1994  mycroft Update an #include.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.3 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 04-Aug-1994  brezak branches: 1.1.2;
Use installboot.sh from 4.4 instead of installboot.c
 1.1.2.2 04-Aug-1994  brezak Use installboot.sh from 4.4 instead of installboot.c
 1.1.2.1 04-Aug-1994  brezak file installboot.sh was added on branch netbsd-1-0 on 1994-08-04 19:42:19 +0000
 1.13 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.12 30-Jan-1997  thorpej Clean up #includes.
 1.11 03-Mar-1996  thorpej Catch up with ITE data structure changes.
 1.10 04-Oct-1995  thorpej Determine the select code of the console device, or -1 for internal grf.
Pass this value to the kernel in register d5. This value isn't currently
used by the kernel, but will be in the future.
 1.9 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.8 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.5 19-Feb-1994  hpeyerl fix up some #include's.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.8 03-Mar-1996  thorpej Catch up with ITE data structure changes.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.5 19-Feb-1994  hpeyerl fix up some #include's.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.8 03-Mar-1996  thorpej Catch up with ITE data structure changes.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.5 19-Feb-1994  hpeyerl fix up some #include's.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 02-Sep-1993  mycroft Ditto.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.3 03-Mar-1996  thorpej Catch up with ITE data structure changes.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.9 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.8 03-Mar-1996  thorpej Catch up with ITE data structure changes.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.5 19-Feb-1994  hpeyerl fix up some #include's.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.8 03-Mar-1996  thorpej Catch up with ITE data structure changes.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.5 19-Feb-1994  hpeyerl fix up some #include's.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.9 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.8 03-Mar-1996  thorpej Catch up with ITE data structure changes.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.5 19-Feb-1994  hpeyerl fix up some #include's.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.2 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1 03-Mar-1996  thorpej Catch up with ITE data structure changes.
 1.7 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.6 14-Oct-1996  thorpej Move the machdep_start() code into machdep.c. No need for different
versions of this function anymore, now that we have a sane kernel setroot().
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.6 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 19-Jun-1994  hpeyerl hp300/stand stuff from Lite. We can boot hp4xx series nodes now!
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.11 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.10 04-Oct-1995  thorpej Put new-style RCS ids in the startup banner. Makes bootblock revisions
much easier to recognize; old method could have revision corrupted by
local RCS control.
 1.9 04-Oct-1995  thorpej Determine the select code of the console device, or -1 for internal grf.
Pass this value to the kernel in register d5. This value isn't currently
used by the kernel, but will be in the future.
 1.8 13-Sep-1995  thorpej Fix cosmetic typo in kernel name prompt.
 1.7 02-Sep-1995  thorpej Fix thinko in netboot-related changes.
 1.6 02-Sep-1995  thorpej Add support for network booting; uses the following procedure:
rbootd->rarp->bootparam->nfs
Add "reset" option to disk and network boot prompts to reload boot code.
 1.5 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.4 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.3 20-Feb-1995  mycroft Don't define netif_debug here.
 1.2 20-Feb-1995  mycroft Slight rearrangement.
 1.1 19-Feb-1995  mycroft Add unfinished netboot code, and reorganize the Makefile somewhat.
 1.6 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.5 30-Jan-1997  thorpej Clean up #includes.
 1.4 06-Oct-1996  thorpej Fixup (unused) netstrategy() routine's calling convention (just returns
EIO). Garbage collect unused netioctl() - conf.c redirects netioctl()
to noioctl().
 1.3 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.2 23-Sep-1995  thorpej If compiled for the system installation program, prompt for myip, gateip,
netmask, serverip, and path rather than using rarp/bootparam.

Catch up with libsa changes.
 1.1 02-Sep-1995  thorpej Add support for network booting; uses the following procedure:
rbootd->rarp->bootparam->nfs
Add "reset" option to disk and network boot prompts to reload boot code.
 1.6 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.5 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.11 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.10 04-Oct-1995  thorpej Put new-style RCS ids in the startup banner. Makes bootblock revisions
much easier to recognize; old method could have revision corrupted by
local RCS control.
 1.9 04-Oct-1995  thorpej Determine the select code of the console device, or -1 for internal grf.
Pass this value to the kernel in register d5. This value isn't currently
used by the kernel, but will be in the future.
 1.8 02-Sep-1995  thorpej Add support for network booting; uses the following procedure:
rbootd->rarp->bootparam->nfs
Add "reset" option to disk and network boot prompts to reload boot code.
 1.7 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.6 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.5 21-Feb-1995  mycroft Use the libsa exec().
 1.4 21-Feb-1995  mycroft Tweak to make the twiddler look better.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 19-Sep-1994  mycroft Fix misguided attempt to reorganize bootdev, and fix a few
other miscellaneous bugs and nits.
 1.1 26-Jan-1994  brezak branches: 1.1.2;
hp300 stanealone bootstrap program ported to use CMU libsa
 1.1.2.1 20-Sep-1994  cgd from trunk, per mycroft
 1.6 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 22-Aug-1994  brezak branches: 1.4.2;
Don't echo here
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4.2.2 22-Aug-1994  brezak Don't echo here
 1.4.2.1 22-Aug-1994  brezak file prf.c was added on branch netbsd-1-0 on 1994-08-22 21:41:24 +0000
 1.3 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2 06-Oct-1996  thorpej Garbage-collect some sun3-specific stuff, add some debugging code,
and KNF.
 1.1 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.2 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.12 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.11 21-Dec-1996  thorpej Fix several semantic bugs:
- Always allow RAW_PART to be opened, regardless of the partition table.
- Never do partition translation on RAW_PART; it's always offset 0.
- Always make sure the disklabel is read from RAW_PART.
- Make *strategy() return values consistent.

This fixes a condition where a bogus partition table could be written
to the disk from SYS_INST, and the user had no way to rewrite with
a correct partition table, since RAW_PART would be invalid.
 1.10 23-Sep-1995  thorpej Add *close() routines. Basically, zaps softc structure so that partition
information will be re-loaded upon next open.

Catch up with libsa changes.
 1.9 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.8 04-Aug-1995  thorpej Make the boot blocks compile (and work!) again.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Sep-1994  mycroft Fix misguided attempt to reorganize bootdev, and fix a few
other miscellaneous bugs and nits.
 1.5 09-Mar-1994  brezak branches: 1.5.2;
Fix for disk (and tape) units > 0
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.2.1 20-Sep-1994  cgd from trunk, per mycroft
 1.6 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.8 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.7 14-Oct-1996  thorpej Garbage collect some now unneeded code, and declare the punit device
driver entry point switch.
 1.6 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.5 05-Aug-1995  thorpej Catch up with an include file change I missed before.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.8 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.7 30-Jan-1997  thorpej Clean up #includes.
 1.6 17-Dec-1996  thorpej Always use `SLOWSCSI'. Some devices need a long delay between phase
changes, apparently. This is reported to work around some odd failures
people were seeing during first-time installation onto a SCSI disk.
 1.5 26-Oct-1994  cgd new RCS ID format.
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.10 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.9 21-Dec-1996  thorpej Fix several semantic bugs:
- Always allow RAW_PART to be opened, regardless of the partition table.
- Never do partition translation on RAW_PART; it's always offset 0.
- Always make sure the disklabel is read from RAW_PART.
- Make *strategy() return values consistent.

This fixes a condition where a bogus partition table could be written
to the disk from SYS_INST, and the user had no way to rewrite with
a correct partition table, since RAW_PART would be invalid.
 1.8 23-Sep-1995  thorpej Add *close() routines. Basically, zaps softc structure so that partition
information will be re-loaded upon next open.

Catch up with libsa changes.
 1.7 26-Oct-1994  cgd new RCS ID format.
 1.6 19-Sep-1994  mycroft Fix misguided attempt to reorganize bootdev, and fix a few
other miscellaneous bugs and nits.
 1.5 09-Mar-1994  brezak branches: 1.5.2;
Fix for disk (and tape) units > 0
 1.4 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.3 01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.5.2.1 20-Sep-1994  cgd from trunk, per mycroft
 1.4 26-Jan-1994  mycroft Clean up deleted files.
 1.3 02-Sep-1993  mycroft Ditto.
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.4 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.3 02-Sep-1995  thorpej Add support for network booting; uses the following procedure:
rbootd->rarp->bootparam->nfs
Add "reset" option to disk and network boot prompts to reload boot code.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.4 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.3 04-Oct-1995  thorpej branches: 1.3.6;
Put new-style RCS ids in the startup banner. Makes bootblock revisions
much easier to recognize; old method could have revision corrupted by
local RCS control.
 1.2 04-Oct-1995  thorpej Determine the select code of the console device, or -1 for internal grf.
Pass this value to the kernel in register d5. This value isn't currently
used by the kernel, but will be in the future.
 1.1 23-Sep-1995  thorpej Add a standalone system installation program. Currently implements:
* Prompt user for disklabel information and label disk.
* Copy miniroot image from NFS server to `b' partition.
* Boot kernel in miniroot image into single-user mode.
Hooks for tape support are there, but the meat for that isn't implemented yet.
 1.3.6.1 11-Sep-1996  thorpej When opening a disk for non-filesystem i/o, make sure we only return
an error condition when an error occurs.

Bug noticed by Terry Lambert <terry@lambert.org>.
 1.5 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 19-Sep-1994  mycroft Fix misguided attempt to reorganize bootdev, and fix a few
other miscellaneous bugs and nits.
 1.2 22-Aug-1994  brezak branches: 1.2.2;
Do echo here just like libsa::gets()
 1.1 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2.2.2 20-Sep-1994  cgd from trunk, per mycroft
 1.2.2.1 22-Aug-1994  cgd file tgets.c was added on branch netbsd-1-0 on 1994-09-20 05:07:46 +0000
 1.3 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2 14-Oct-1996  thorpej Move the machdep_start() code into machdep.c. No need for different
versions of this function anymore, now that we have a sane kernel setroot().
 1.1 26-Jun-1996  thorpej Major revamp of the boot code.

- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.

- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).

- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).

- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.

- General cleanup.
 1.5 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.4 26-Oct-1994  cgd new RCS ID format.
 1.3 26-Jan-1994  brezak hp300 stanealone bootstrap program ported to use CMU libsa
 1.2 22-May-1993  cgd add rcsids to everything and clean up headers
 1.1 13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.14 21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.13 17-Apr-2014  tsutsui Check the service switch on 425e to select apci serial console.

Taken from OpenBSD/hp300. See the following comment for details:
>> * Check the service switch. On the 425e, this is a physical
>> * switch, unlike other frodo-based machines, so we can use it
>> * as a serial vs internal video selector, since the PROM can not
>> * be configured for serial console.
 1.12 10-Apr-2014  tsutsui Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.

I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).

Thanks to miod@openbsd for providing his 425e.
 1.11 08-Feb-2011  rmind branches: 1.11.4; 1.11.10; 1.11.14; 1.11.18; 1.11.28;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.10 28-Apr-2008  martin branches: 1.10.22; 1.10.28; 1.10.30;
Remove clause 3 and 4 from TNF licenses
 1.9 19-Jul-2006  tsutsui branches: 1.9.58; 1.9.60; 1.9.62;
Adapt stand sources to changes of intio device offset macro.
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.8;
merge ktrace-lwp.
 1.7 20-Feb-2005  tsutsui branches: 1.7.4;
Use ANSI function decls.
 1.6 14-Nov-2003  tsutsui branches: 1.6.8; 1.6.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.5 08-Nov-2003  tsutsui Adapt to replacement of apcireg.h and dcareg.h.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 31-Jul-1999  thorpej branches: 1.3.36;
Nuke the DCA check. ACPI can only be console on a 425e.
 1.2 04-Oct-1997  thorpej branches: 1.2.12;
Copyright assigned to The NetBSD Foundation.
 1.1 12-May-1997  thorpej branches: 1.1.4;
Add a standalone APCI driver, adapted from the standalone DCA driver
by me. This driver should only be invoked when there are no other
suitable console devices present in the system. This situation currently
exists on the 425e, for which we do not have a frame buffer driver,
and who's PROM does not map the second APCI UART to select code 9,
like is done on the 4{00,25,33}{t,s}.
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.12.1 02-Aug-1999  thorpej Update from trunk.
 1.3.36.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.36.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.7.4.1 30-Dec-2006  yamt sync with head.
 1.8.8.1 11-Aug-2006  yamt sync with head
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.62.1 16-May-2008  yamt sync with head.
 1.9.60.1 18-May-2008  yamt sync with head.
 1.9.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.30.1 17-Feb-2011  bouyer Sync with HEAD
 1.10.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.22.1 05-Mar-2011  rmind sync with head
 1.11.28.1 10-Aug-2014  tls Rebase.
 1.11.18.1 18-May-2014  rmind sync with head
 1.11.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.11.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-Nov-2003  tsutsui branches: 1.1.4;
Move apcireg.h and dcareg.h to stand/common since they are no longer used
by kernel.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 08-Nov-2003  skrll file apcireg.h was added on branch ktrace-lwp on 2004-08-03 10:34:37 +0000
 1.14 05-Jul-2021  tsutsui Get rid of obsolete grfreg.h. From OpenBSD.
 1.13 08-Feb-2011  rmind branches: 1.13.72;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.12 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.11 04-Mar-2007  christos branches: 1.11.66; 1.11.72; 1.11.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 21-Jul-2006  tsutsui branches: 1.10.10;
Use macro defined in dioreg.h.
 1.9 20-Jul-2006  tsutsui Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.8 19-Jul-2006  tsutsui Set cpuspeed for HP_400 and HP_425 explicitly.
 1.7 19-Jul-2006  tsutsui Adapt stand sources to changes of intio device offset macro.
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8;
merge ktrace-lwp.
 1.5 20-Feb-2005  tsutsui branches: 1.5.4;
Use ANSI function decls.
 1.4 14-Nov-2003  tsutsui branches: 1.4.8; 1.4.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 31-Jul-1999  thorpej branches: 1.2.36;
Add 385 and 425e SPU detection. From OpenBSD.
 1.1 04-Feb-1997  thorpej branches: 1.1.22;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.22.1 02-Aug-1999  thorpej Update from trunk.
 1.2.36.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.36.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.4.2 03-Sep-2007  yamt sync with head.
 1.5.4.1 30-Dec-2006  yamt sync with head.
 1.6.8.1 11-Aug-2006  yamt sync with head
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.10.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.74.2 17-Feb-2011  bouyer Sync with HEAD
 1.11.74.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.66.1 05-Mar-2011  rmind sync with head
 1.13.72.1 01-Aug-2021  thorpej Sync with HEAD.
 1.15 17-May-2025  tsutsui Speed up hp300 netboot by reducing RTC access during timeout checks.

The read_bbc() function against HIL seems extremely slow.
It was being called on every timeout check via getsecs()
so it significantly slowed down loading a kernel via NFS.

In most cases (e.g., in common/if_le.c and libsa/net.c),
timeout checks are performed using getsecs() in busy loops
without any actual waiting. In such cases, it's not necessary
to read the precise time from the RTC on every call.

This change reduces the time to load the NetBSD/hp300 10.1 GENERIC kernel
via NFS from 260 seconds to 64 seconds on HP9000/382.
 1.14 15-Jan-2023  tsutsui branches: 1.14.6;
TAB/space cleanup.
 1.13 17-Nov-2014  christos branches: 1.13.50;
PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.
 1.12 19-Apr-2014  tsutsui Add RTC support for HP9000/425e to bootloader too.

Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF

Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
 1.11 08-Feb-2011  rmind branches: 1.11.4; 1.11.10; 1.11.14; 1.11.18; 1.11.28;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.10 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.9 12-Jan-2009  tsutsui branches: 1.9.6; 1.9.8; 1.9.10;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.8 25-Jun-2006  tsutsui branches: 1.8.58; 1.8.62; 1.8.70;
Fix unsigned/signed mismatch.
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.8; 1.7.16;
merge ktrace-lwp.
 1.6 20-Feb-2005  tsutsui branches: 1.6.4;
Use ANSI function decls.
 1.5 07-Apr-2004  tsutsui branches: 1.5.4; 1.5.6;
Fix yet another y2k+1 bug.
 1.4 14-Nov-2003  tsutsui branches: 1.4.2;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 08-Nov-2001  gmcgarry branches: 1.2.2; 1.2.12; 1.2.18;
Use crufty old clock-handling code for now.
 1.1 04-Feb-1997  thorpej branches: 1.1.40; 1.1.42;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.42.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.40.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.18.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.18.1 03-Aug-2004  skrll Sync with HEAD
 1.2.12.1 12-Apr-2004  jmc Pullup rev 1.5 (requested by tsutsui in ticket #1665)

Fix yet another y2k+1 bug.
 1.2.2.2 08-Nov-2001  gmcgarry Use crufty old clock-handling code for now.
 1.2.2.1 08-Nov-2001  gmcgarry file clock.c was added on branch nathanw_sa on 2001-11-08 07:01:34 +0000
 1.4.2.1 11-Apr-2004  jmc Pullup rev 1.5 (requested by tsutsui in ticket #115)

Fix yet another y2k+1 bug.
 1.5.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.4.1 29-Apr-2005  kent sync with -current
 1.6.4.1 30-Dec-2006  yamt sync with head.
 1.7.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.7.8.1 26-Jun-2006  yamt sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.70.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.62.1 04-May-2009  yamt sync with head.
 1.8.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.10.2 17-Feb-2011  bouyer Sync with HEAD
 1.9.10.1 08-Feb-2011  bouyer Sync with HEAD
 1.9.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.6.1 05-Mar-2011  rmind sync with head
 1.11.28.1 10-Aug-2014  tls Rebase.
 1.11.18.1 18-May-2014  rmind sync with head
 1.11.14.2 03-Dec-2017  jdolecek update from HEAD
 1.11.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.11.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.50.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.14.6.1 02-Aug-2025  perseant Sync with HEAD
 1.15 09-May-2024  tsutsui Add a preliminary CD boot support to uboot for preparation of PR/54455.

Briefly tested on mame, but not enalbed yet.
 1.14 11-Dec-2022  tsutsui branches: 1.14.2;
Make hp300 bootloaders UFS2 ready.
 1.13 11-Dec-2022  tsutsui Remove a #if 0'ed out unused function.
 1.12 23-Dec-2007  tsutsui Use __arraycount().
 1.11 11-Dec-2005  christos branches: 1.11.50; 1.11.60; 1.11.64;
merge ktrace-lwp.
 1.10 23-Jun-2005  junyoung branches: 1.10.2;
Use FS_OPS() macro.
 1.9 23-Jun-2005  junyoung Drop trailing spaces.
 1.8 20-Feb-2005  tsutsui Use ANSI function decls.
 1.7 14-Nov-2003  tsutsui branches: 1.7.8; 1.7.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 02-Jan-2001  simonb branches: 1.5.24;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.4 14-Dec-1999  thorpej Make it possible to strip this down a little more.
 1.3 22-Jul-1997  drochner branches: 1.3.20; 1.3.26;
Don't use <lib/libsa/if_ether.h> anymore. This was a copy of the
old (before ARP changes) <netinet/if_ether.h>, intended for
temporary use.
 1.2 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.1 04-Feb-1997  thorpej branches: 1.1.4;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.4.1 07-Mar-1997  is Use libsa copy of oldstyle if_ether.h for now
 1.3.26.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.20.2 05-Jan-2001  bouyer Sync with HEAD
 1.3.20.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.24.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.24.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.10.2.1 21-Jan-2008  yamt sync with head
 1.11.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.11.60.1 26-Dec-2007  ad Sync with head.
 1.11.50.1 09-Jan-2008  matt sync with HEAD
 1.14.2.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.4 09-May-2024  tsutsui Add a preliminary CD boot support to uboot for preparation of PR/54455.

Briefly tested on mame, but not enalbed yet.
 1.3 11-Dec-2022  tsutsui branches: 1.3.2;
Make hp300 bootloaders UFS2 ready.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 14-Nov-2003  tsutsui branches: 1.1.4;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 14-Nov-2003  skrll file conf.h was added on branch ktrace-lwp on 2004-08-03 10:34:37 +0000
 1.3.2.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.7 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.6 11-Dec-2005  christos branches: 1.6.100; 1.6.106; 1.6.108;
merge ktrace-lwp.
 1.5 20-Feb-2005  tsutsui Use ANSI function decls.
 1.4 14-Nov-2003  tsutsui branches: 1.4.8; 1.4.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 12-May-1997  thorpej branches: 1.2.56;
- Add glue for standalone APCI console driver.
- Make the romputchar() useage conditional only on "userom".
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2.56.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.56.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.6.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.6.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.100.1 05-Mar-2011  rmind sync with head
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 14-Nov-2003  tsutsui Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 12-May-1997  thorpej branches: 1.2.56;
Add prototypes for standalone APCI driver.
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.56.1 03-Aug-2004  skrll Sync with HEAD
 1.8 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.7 17-Jul-2011  joerg branches: 1.7.58; 1.7.70;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.6 25-Jun-2006  tsutsui Use (uint8_t *) to specify buffers for hpib xfers.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8; 1.5.16;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.4;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.1 30-Dec-2006  yamt sync with head.
 1.5.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.5.8.1 26-Jun-2006  yamt sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.7.70.1 01-Aug-2021  thorpej Sync with HEAD.
 1.7.58.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.8 21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.7 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.6 11-Dec-2005  christos branches: 1.6.100; 1.6.106; 1.6.108;
merge ktrace-lwp.
 1.5 20-Feb-2005  tsutsui Use ANSI function decls.
 1.4 14-Nov-2003  tsutsui branches: 1.4.8; 1.4.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 08-Nov-2003  tsutsui Adapt to replacement of apcireg.h and dcareg.h.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.6.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.6.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.100.1 05-Mar-2011  rmind sync with head
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-Nov-2003  tsutsui branches: 1.1.4;
Move apcireg.h and dcareg.h to stand/common since they are no longer used
by kernel.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 08-Nov-2003  skrll file dcareg.h was added on branch ktrace-lwp on 2004-08-03 10:34:37 +0000
 1.10 21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.9 21-Jun-2014  tsutsui Appease gcc48 -Wunused-but-set-variable warnings.
 1.8 08-Feb-2011  rmind branches: 1.8.14; 1.8.28;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.7 04-Mar-2007  christos branches: 1.7.66; 1.7.72; 1.7.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 11-Dec-2005  christos branches: 1.6.26;
merge ktrace-lwp.
 1.5 20-Feb-2005  tsutsui branches: 1.5.4;
Use ANSI function decls.
 1.4 14-Nov-2003  tsutsui branches: 1.4.8; 1.4.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 14-Apr-1997  scottr branches: 1.2.56;
Allowing forcing console on dcm with FORCEDCMCONSOLE (c.f. dca.c).
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2.56.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.56.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.4.1 03-Sep-2007  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.74.1 17-Feb-2011  bouyer Sync with HEAD
 1.7.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.66.1 05-Mar-2011  rmind sync with head
 1.8.28.1 10-Aug-2014  tls Rebase.
 1.8.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 25-Jun-2006  tsutsui branches: 1.4.10;
- move declaration for sc_table from samachdep.h to device.h
- include <lib/libsa/stand.h> from samachdep.h for struct fs_ops
- remove unneeded declarations from samachdep.h
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.8; 1.3.16;
merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.2 03-Sep-2007  yamt sync with head.
 1.2.16.1 30-Dec-2006  yamt sync with head.
 1.3.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.3.8.1 26-Jun-2006  yamt sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.15 09-May-2024  tsutsui Add a preliminary CD boot support to uboot for preparation of PR/54455.

Briefly tested on mame, but not enalbed yet.
 1.14 15-Jan-2023  tsutsui TAB/space cleanup.
 1.13 11-Dec-2022  tsutsui branches: 1.13.2;
Make hp300 bootloaders UFS2 ready.
 1.12 08-Mar-2018  mrg fix various gcc6 m68k issues:
- bad indentation. next68k en.c and mvme68k le_poll.c fixes real issues
in error handling, the rest are NFCI.
- pass 68030 flags as appropriate for mvme68k.
- next68k nextrom.c has -Warray-bounds ignored for an odd expression
that appears to run before relocation, and needs manual offsets
added which trips bounds array checking.

with this all m68k ports build with GCC 6.
 1.11 10-Aug-2014  isaki branches: 1.11.26;
Unify all arch/*/stand's atoi() to MI libsa.
lib/libsa/atoi.c was separated from lib/libsa/bootcfg.c.
PR/49084
 1.10 28-Apr-2008  martin branches: 1.10.44;
Remove clause 3 and 4 from TNF licenses
 1.9 11-Dec-2005  christos branches: 1.9.74; 1.9.76; 1.9.78;
merge ktrace-lwp.
 1.8 17-Apr-2005  christos PR/21170: Christian Biere: ctype function misuse.
 1.7 20-Feb-2005  tsutsui Use ANSI function decls.
 1.6 14-Nov-2003  tsutsui branches: 1.6.8; 1.6.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.5 13-Nov-2003  tsutsui Backout part of rev 1.4 which caused uninitialized pointer dereference.
(How does it works!?)
 1.4 04-Aug-2002  gmcgarry branches: 1.4.6;
Boot loader is now case sensitive. Fixes PR-17711.
 1.3 13-May-2001  gmcgarry branches: 1.3.2; 1.3.8; 1.3.16;
pull in lib/libkern/libkern.h to resolve inline tolower()
 1.2 04-Oct-1997  thorpej branches: 1.2.28;
Copyright assigned to The NetBSD Foundation.
 1.1 04-Feb-1997  thorpej branches: 1.1.8;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.28.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.16.1 30-Aug-2002  gehenna catch up with -current.
 1.3.8.2 13-Aug-2002  nathanw Catch up to -current.
 1.3.8.1 13-May-2001  nathanw file devopen.c was added on branch nathanw_sa on 2002-08-13 02:18:12 +0000
 1.3.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.9.78.1 16-May-2008  yamt sync with head.
 1.9.76.1 18-May-2008  yamt sync with head.
 1.9.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.26.1 15-Mar-2018  pgoyette Synch with HEAD
 1.13.2.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.13 22-Apr-2014  tsutsui Also fix the apci device address in dnkbd.c as apci.c rev 1.12:

http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html

Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
 1.12 28-Apr-2008  martin branches: 1.12.34; 1.12.40; 1.12.44; 1.12.50; 1.12.60;
Remove clause 3 and 4 from TNF licenses
 1.11 04-Mar-2007  christos branches: 1.11.40; 1.11.42; 1.11.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 19-Jul-2006  tsutsui branches: 1.10.10;
Adapt stand sources to changes of intio device offset macro.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.8;
merge ktrace-lwp.
 1.8 20-Feb-2005  tsutsui branches: 1.8.4;
Use ANSI function decls.
 1.7 14-Nov-2003  tsutsui branches: 1.7.8; 1.7.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.6 08-Nov-2003  tsutsui Adapt to replacement of apcireg.h and dcareg.h.
 1.5 29-Sep-2002  wiz branches: 1.5.6;
"definitions" has lots of 'i's, but that's not reason to leave one out.
 1.4 09-Oct-1997  jtc branches: 1.4.30; 1.4.34;
Fix tipo inherited from old version of TNF copyright template.
 1.3 12-May-1997  thorpej branches: 1.3.4;
Don't use a hard-coded hex address for the 0'th APCI port; use definitions
from <hp300/dev/frodoreg.h>
 1.2 27-Apr-1997  thorpej Don't even look for a Domain keyboard if we're not a 400, 425, or 433.
 1.1 14-Apr-1997  thorpej Add support for the Apollo Domain keyboard, from mike smith
<miff@spam.frisbee.net.au> with some changes for integration by me.
 1.3.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.34.1 18-Oct-2002  nathanw Catch up to -current.
 1.4.30.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.4.2 03-Sep-2007  yamt sync with head.
 1.8.4.1 30-Dec-2006  yamt sync with head.
 1.9.8.1 11-Aug-2006  yamt sync with head
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.44.1 16-May-2008  yamt sync with head.
 1.11.42.1 18-May-2008  yamt sync with head.
 1.11.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.60.1 10-Aug-2014  tls Rebase.
 1.12.50.1 18-May-2014  rmind sync with head
 1.12.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.40.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.12.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 16-Mar-2002  gmcgarry branches: 1.1.4; 1.1.10; 1.1.16;
Move exec_hp300() out of uboot.c into its own file so that it can
be used by SYS_INST. SYS_INST can now boot ELF kernels inside the
miniroot.
 1.1.16.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.16.1 03-Aug-2004  skrll Sync with HEAD
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 16-Mar-2002  jdolecek file exec.c was added on branch kqueue on 2002-06-23 17:36:15 +0000
 1.1.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.1 16-Mar-2002  nathanw file exec.c was added on branch nathanw_sa on 2002-04-01 07:39:59 +0000
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.6 25-Jun-2006  tsutsui Use (uint8_t *) to specify buffers for hpib xfers.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8; 1.5.16;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.4;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.1 30-Dec-2006  yamt sync with head.
 1.5.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.5.8.1 26-Jun-2006  yamt sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.2 08-Feb-2011  rmind branches: 1.2.2; 1.2.6;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file grf_dvreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:22 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 08-Feb-2011  jruoho file grf_dvreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 08-Feb-2011  rmind file grf_dvreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.2 08-Feb-2011  rmind branches: 1.2.2; 1.2.6;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file grf_gbreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:22 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 08-Feb-2011  jruoho file grf_gbreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 08-Feb-2011  rmind file grf_gbreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.2 08-Feb-2011  rmind branches: 1.2.2; 1.2.6;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file grf_hyreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:22 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 08-Feb-2011  jruoho file grf_hyreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 08-Feb-2011  rmind file grf_hyreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.2 08-Feb-2011  rmind branches: 1.2.2; 1.2.6;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file grf_rbreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:22 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 08-Feb-2011  jruoho file grf_rbreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 08-Feb-2011  rmind file grf_rbreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.3 02-Feb-2024  andvar s/Staus/Status/ in comments.
 1.2 08-Feb-2011  rmind branches: 1.2.2; 1.2.6;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file grf_tcreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:22 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 08-Feb-2011  jruoho file grf_tcreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 08-Feb-2011  rmind file grf_tcreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.4 05-Jul-2021  tsutsui Get rid of obsolete grfreg.h. From OpenBSD.
 1.3 12-Feb-2011  tsutsui branches: 1.3.2; 1.3.6; 1.3.76;
Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.2 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file grfreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:22 +0000
 1.3.76.1 01-Aug-2021  thorpej Sync with HEAD.
 1.3.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.3.6.1 12-Feb-2011  jruoho file grfreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 12-Feb-2011  rmind file grfreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.15 15-Jan-2023  tsutsui TAB/space cleanup.
 1.14 08-Feb-2011  rmind branches: 1.14.86;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.13 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.12 28-Apr-2008  martin branches: 1.12.22; 1.12.28; 1.12.30;
Remove clause 3 and 4 from TNF licenses
 1.11 28-Aug-2006  tsutsui branches: 1.11.56; 1.11.58; 1.11.60;
Remove unneeded #include <sys/device.h> which also requires <prop/proplib.h>.
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.8;
merge ktrace-lwp.
 1.9 20-Feb-2005  tsutsui branches: 1.9.4;
Use ANSI function decls.
 1.8 14-Nov-2003  tsutsui branches: 1.8.8; 1.8.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.7 14-Nov-2003  tsutsui Use "" rather than '\0' for null string.
 1.6 14-Nov-2003  tsutsui Revert part of previous NULL -> '\0' changes, where actually NULL is required.
 1.5 28-Oct-2003  tsutsui NULL -> '\0'
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 04-Oct-1997  thorpej branches: 1.3.50;
Copyright assigned to The NetBSD Foundation.
 1.2 14-Apr-1997  thorpej branches: 1.2.4;
Implement an autoconfiguring indirect keyboard driver, removing explcit
dependencies on the HIL keyboard.
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.50.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.50.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.50.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.50.1 03-Aug-2004  skrll Sync with HEAD
 1.8.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.8.1 29-Apr-2005  kent sync with -current
 1.9.4.1 30-Dec-2006  yamt sync with head.
 1.10.8.1 03-Sep-2006  yamt sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.11.60.1 16-May-2008  yamt sync with head.
 1.11.58.1 18-May-2008  yamt sync with head.
 1.11.56.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.30.2 17-Feb-2011  bouyer Sync with HEAD
 1.12.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.12.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.22.1 05-Mar-2011  rmind sync with head
 1.14.86.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.2 08-Feb-2011  rmind branches: 1.2.2; 1.2.6;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file hilreg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:22 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 08-Feb-2011  jruoho file hilreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 08-Feb-2011  rmind file hilreg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.9 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 02-Jul-2006  tsutsui branches: 1.8.10;
Remove sc_table[] decl, which is in device.h.
 1.7 25-Jun-2006  tsutsui Use (uint8_t *) to specify buffers for hpib xfers.
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8; 1.6.16;
merge ktrace-lwp.
 1.5 20-Feb-2005  tsutsui branches: 1.5.4;
Use ANSI function decls.
 1.4 14-Nov-2003  tsutsui branches: 1.4.8; 1.4.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 12-May-1997  thorpej branches: 1.2.56;
Don't use hardcoded hex for the address of the internal HP-IB interface.
Instead, use definitions from <hp300/dev/dioreg.h>
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2.56.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.56.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.4.2 03-Sep-2007  yamt sync with head.
 1.5.4.1 30-Dec-2006  yamt sync with head.
 1.6.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.6.8.2 11-Aug-2006  yamt sync with head
 1.6.8.1 26-Jun-2006  yamt sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.8.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.6 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.5 25-Jun-2006  tsutsui branches: 1.5.154; 1.5.166;
Use (uint8_t *) to specify buffers for hpib xfers.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8; 1.4.16;
merge ktrace-lwp.
 1.3 14-Nov-2003  tsutsui branches: 1.3.16;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 30-Dec-2006  yamt sync with head.
 1.4.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.4.8.1 26-Jun-2006  yamt sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.166.1 01-Aug-2021  thorpej Sync with HEAD.
 1.5.154.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.16 29-Apr-2024  tsutsui Don't panic as a fatal error on receiving packets with invalid length.

Such errors could happen on aged and fragile 10BASE-2 hub etc.
 1.15 21-Apr-2023  tsutsui Avoid an extern declaration in .c file. Just declare it as static.

Suggested on tech-userlevel@.
 1.14 21-Nov-2022  tsutsui branches: 1.14.2;
Make local functions and variables static.
 1.13 21-Jun-2014  tsutsui Appease gcc48 -Wunused-but-set-variable warnings.
 1.12 01-May-2014  tsutsui Reduce a number of getsecs() calls in le_get() to make netboot a bit faster.
 1.11 12-Jan-2009  tsutsui branches: 1.11.14; 1.11.24; 1.11.28; 1.11.38;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.10 04-Mar-2007  christos branches: 1.10.40; 1.10.44; 1.10.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 11-Dec-2005  christos branches: 1.9.26;
merge ktrace-lwp.
 1.8 20-Feb-2005  tsutsui branches: 1.8.4;
Use ANSI function decls.
 1.7 14-Nov-2003  tsutsui branches: 1.7.8; 1.7.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.6 13-Mar-2003  drochner branches: 1.6.2;
cope with removal of this sick NENTS macro from libsa/netif.h
 1.5 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.4 09-Apr-1999  drochner branches: 1.4.16; 1.4.20;
actually include <net/if_ether.h> to get these constants
 1.3 25-Mar-1999  thorpej branches: 1.3.2;
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.2 26-Dec-1997  scottr Do better reporting of transmit errors.
 1.1 04-Feb-1997  thorpej branches: 1.1.12;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.12.1 26-Dec-1997  scottr Do better reporting of transmit errors.
 1.3.2.1 05-May-1999  perry branches: 1.3.2.1.2;
pullup 1.3->1.4 (he)
 1.3.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.20.1 18-Oct-2002  nathanw Catch up to -current.
 1.4.16.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.4.1 03-Sep-2007  yamt sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.44.1 04-May-2009  yamt sync with head.
 1.10.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.11.38.1 10-Aug-2014  tls Rebase.
 1.11.28.1 18-May-2014  rmind sync with head
 1.11.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.14.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.2.1 11-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #685):

sys/arch/hp300/stand/common/if_le.c: revision 1.15
sys/arch/hp300/stand/common/if_le.c: revision 1.16

Avoid an extern declaration in .c file. Just declare it as static.
Suggested on tech-userlevel@.

Don't panic as a fatal error on receiving packets with invalid length.

Such errors could happen on aged and fragile 10BASE-2 hub etc.
 1.6 26-Jul-2012  tsutsui Remove '__attribute__((__packed__))' from structure definisions
for Am7990 LANCE registers where no implicit padding is expected.

gcc 4.5.3 seems to generate strange and wrong instructions
(four moveb insns against u_short members) if packed attribute
is specified in this case, then netboot fails immediately.

Should be pulled up to netbsd-6.
 1.5 11-Dec-2005  christos branches: 1.5.112; 1.5.118;
merge ktrace-lwp.
 1.4 14-Nov-2003  tsutsui Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 27-May-2001  gmcgarry branches: 1.2.8; 1.2.24;
Protect against possible alignment problems.
 1.1 04-Feb-1997  thorpej branches: 1.1.38;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.38.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.2 27-May-2001  gmcgarry Protect against possible alignment problems.
 1.2.8.1 27-May-2001  gmcgarry file if_lereg.h was added on branch nathanw_sa on 2001-05-27 05:31:59 +0000
 1.5.118.1 08-Aug-2012  martin Pull up following revision(s) (requested by tsutsui in ticket #468):
sys/arch/hp300/stand/common/if_lereg.h: revision 1.6
Remove '__attribute__((__packed__))' from structure definisions
for Am7990 LANCE registers where no implicit padding is expected.
gcc 4.5.3 seems to generate strange and wrong instructions
(four moveb insns against u_short members) if packed attribute
is specified in this case, then netboot fails immediately.
Should be pulled up to netbsd-6.
 1.5.112.1 30-Oct-2012  yamt sync with head
 1.23 30-May-2025  tsutsui Misc cleanup.

- make local variables static
- make read only variable const
- remove a redundant arg
- use uint8_t rather than u_char
- use consistent style
- some KNF
 1.22 29-May-2025  tsutsui Consolidate scroll and cursor drawing ops into common ITE layer.

No functional change, just for readability.
Tested on 380 (topcat) and 382 (sti).
 1.21 26-May-2025  tsutsui Also use sti(4) ROM functions for 362/382 framebuffers on bootloader.

Mostly taken on OpenBSD/hp300.
Tested on 382 with VGA-res EVRX, and no visible regression on
425e (sti EVRX), 425t (sti CRX), and 380 (topcat).
 1.20 21-Apr-2023  tsutsui branches: 1.20.6;
Remove ancient /* ARGSUSED */ lint comments.
 1.19 05-Jul-2021  tsutsui Get rid of obsolete grfreg.h. From OpenBSD.
 1.18 26-Feb-2016  christos branches: 1.18.34;
PR/50852: David Binderman: make code more readable (although it was correct
anyway)
 1.17 13-Apr-2014  tsutsui branches: 1.17.4;
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.

Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
 1.16 12-Feb-2011  tsutsui branches: 1.16.4; 1.16.10; 1.16.14; 1.16.18; 1.16.28;
Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.15 10-Feb-2011  tsutsui Pull support for Tigershark monochrome framebuffer from OpenBSD.
Untested (no hardware), but doesn't break existing HP425t topcat.
 1.14 10-Feb-2011  tsutsui Pull OpenBSD's standalone ITE driver reorganization:
- merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
- rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
to use it among all dumb monochrome framebuffers
- ditto hyper_putc() to ite_dio_putc1bpp()
- remove unnecessary flags, macro, function args, and structure members
- remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.
 1.13 10-Feb-2011  tsutsui Remove unused deinit functions. From OpenBSD.
 1.12 10-Feb-2011  tsutsui All framebuffer drivers use common readbyte and writeglyph functions
so no need to put them into per driver function pointers. From OpenBSD.

Tested on HP382 (serial) and HP425t (topcat).
 1.11 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.10 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.9 07-Mar-2007  he branches: 1.9.66; 1.9.72; 1.9.74;
Fix an instance of "void *v, x;" and cast to char* before doing
pointer arithmetic.
 1.8 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 19-Jul-2006  tsutsui branches: 1.7.10;
Adapt stand sources to changes of intio device offset macro.
 1.6 02-Jul-2006  tsutsui Remove sc_table[] decl, which is in device.h.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8; 1.5.16;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.4;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.2 03-Sep-2007  yamt sync with head.
 1.4.4.1 30-Dec-2006  yamt sync with head.
 1.5.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.5.8.1 11-Aug-2006  yamt sync with head
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.7.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.74.2 17-Feb-2011  bouyer Sync with HEAD
 1.9.74.1 08-Feb-2011  bouyer Sync with HEAD
 1.9.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.66.1 05-Mar-2011  rmind sync with head
 1.16.28.1 10-Aug-2014  tls Rebase.
 1.16.18.1 18-May-2014  rmind sync with head
 1.16.14.2 03-Dec-2017  jdolecek update from HEAD
 1.16.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.16.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.4.1 19-Mar-2016  skrll Sync with HEAD
 1.18.34.1 01-Aug-2021  thorpej Sync with HEAD.
 1.20.6.1 02-Aug-2025  perseant Sync with HEAD
 1.3 26-May-2025  tsutsui Also use sti(4) ROM functions for 362/382 framebuffers on bootloader.

Mostly taken on OpenBSD/hp300.
Tested on 382 with VGA-res EVRX, and no visible regression on
425e (sti EVRX), 425t (sti CRX), and 380 (topcat).
 1.2 15-Jan-2023  tsutsui branches: 1.2.6;
TAB/space cleanup.
 1.1 12-Feb-2011  tsutsui branches: 1.1.2; 1.1.4; 1.1.8; 1.1.92;
Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.1.92.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.1.8.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.8.1 12-Feb-2011  jruoho file ite_dumb.c was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.1.4.2 05-Mar-2011  rmind sync with head
 1.1.4.1 12-Feb-2011  rmind file ite_dumb.c was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.1.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 12-Feb-2011  bouyer file ite_dumb.c was added on branch bouyer-quota2 on 2011-02-17 11:59:41 +0000
 1.2.6.1 02-Aug-2025  perseant Sync with HEAD
 1.11 27-May-2025  tsutsui Make local functions static.
 1.10 10-Feb-2011  tsutsui branches: 1.10.92;
Pull OpenBSD's standalone ITE driver reorganization:
- merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
- rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
to use it among all dumb monochrome framebuffers
- ditto hyper_putc() to ite_dio_putc1bpp()
- remove unnecessary flags, macro, function args, and structure members
- remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.
 1.9 10-Feb-2011  tsutsui Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers. Also rename ite_fontinit() to
ite_fontinit8bpp(). From OpenBSD.
 1.8 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.7 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.6 28-Jan-2006  tsutsui branches: 1.6.98; 1.6.104; 1.6.106;
Fix botch on ANSIfy.
 1.5 11-Dec-2005  christos branches: 1.5.2;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.2; 1.4.4; 1.4.12;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.12.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.4.2.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.106.2 17-Feb-2011  bouyer Sync with HEAD
 1.6.106.1 08-Feb-2011  bouyer Sync with HEAD
 1.6.104.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.98.1 05-Mar-2011  rmind sync with head
 1.10.92.1 02-Aug-2025  perseant Sync with HEAD
 1.11 27-May-2025  tsutsui Make local functions static.
 1.10 10-Feb-2011  tsutsui branches: 1.10.92;
Pull OpenBSD's standalone ITE driver reorganization:
- merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
- rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
to use it among all dumb monochrome framebuffers
- ditto hyper_putc() to ite_dio_putc1bpp()
- remove unnecessary flags, macro, function args, and structure members
- remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.
 1.9 10-Feb-2011  tsutsui Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers. Also rename ite_fontinit() to
ite_fontinit8bpp(). From OpenBSD.
 1.8 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.7 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.6 28-Jan-2006  tsutsui branches: 1.6.98; 1.6.104; 1.6.106;
Fix botch on ANSIfy.
 1.5 11-Dec-2005  christos branches: 1.5.2;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.2; 1.4.4; 1.4.12;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.12.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.4.2.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.106.2 17-Feb-2011  bouyer Sync with HEAD
 1.6.106.1 08-Feb-2011  bouyer Sync with HEAD
 1.6.104.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.98.1 05-Mar-2011  rmind sync with head
 1.10.92.1 02-Aug-2025  perseant Sync with HEAD
 1.12 10-Feb-2011  tsutsui Pull OpenBSD's standalone ITE driver reorganization:
- merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
- rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
to use it among all dumb monochrome framebuffers
- ditto hyper_putc() to ite_dio_putc1bpp()
- remove unnecessary flags, macro, function args, and structure members
- remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.
 1.11 10-Feb-2011  tsutsui Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers. Also rename ite_fontinit() to
ite_fontinit8bpp(). From OpenBSD.
 1.10 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.9 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.8 07-Mar-2007  he branches: 1.8.66; 1.8.72; 1.8.74;
Fix an instance of "void *v, x;" and cast to char* before doing
pointer arithmetic.
 1.7 19-Mar-2006  tsutsui branches: 1.7.14;
Add trailing semicolons to some macroes which have been changed
using do{}while(/*CONSTCOND*/0) statements.
 1.6 28-Jan-2006  tsutsui branches: 1.6.2; 1.6.4; 1.6.6; 1.6.8; 1.6.10;
Fix botch on ANSIfy.
 1.5 11-Dec-2005  christos branches: 1.5.2;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.2; 1.4.4; 1.4.12;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.12.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.4.4.2 03-Sep-2007  yamt sync with head.
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.4.2.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.10.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.6.8.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.6.6.1 01-Apr-2006  yamt sync with head.
 1.6.4.1 22-Apr-2006  simonb Sync with head.
 1.6.2.1 09-Sep-2006  rpaulo sync with head
 1.7.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.74.2 17-Feb-2011  bouyer Sync with HEAD
 1.8.74.1 08-Feb-2011  bouyer Sync with HEAD
 1.8.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.66.1 05-Mar-2011  rmind sync with head
 1.12 27-May-2025  tsutsui Make local functions static.
 1.11 10-Feb-2011  tsutsui branches: 1.11.92;
Pull OpenBSD's standalone ITE driver reorganization:
- merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
- rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
to use it among all dumb monochrome framebuffers
- ditto hyper_putc() to ite_dio_putc1bpp()
- remove unnecessary flags, macro, function args, and structure members
- remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.
 1.10 10-Feb-2011  tsutsui Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers. Also rename ite_fontinit() to
ite_fontinit8bpp(). From OpenBSD.
 1.9 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.8 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.7 07-Mar-2007  he branches: 1.7.66; 1.7.72; 1.7.74;
Fix an instance of "void *v, x;" and cast to char* before doing
pointer arithmetic.
 1.6 28-Jan-2006  tsutsui branches: 1.6.24;
Fix botch on ANSIfy.
 1.5 11-Dec-2005  christos branches: 1.5.2;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.2; 1.4.4; 1.4.12;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.12.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.4.4.2 03-Sep-2007  yamt sync with head.
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.4.2.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.24.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.74.2 17-Feb-2011  bouyer Sync with HEAD
 1.7.74.1 08-Feb-2011  bouyer Sync with HEAD
 1.7.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.66.1 05-Mar-2011  rmind sync with head
 1.11.92.1 02-Aug-2025  perseant Sync with HEAD
 1.6 29-May-2025  tsutsui Consolidate scroll and cursor drawing ops into common ITE layer.

No functional change, just for readability.
Tested on 380 (topcat) and 382 (sti).
 1.5 27-May-2025  tsutsui Make local functions static.
 1.4 27-May-2025  tsutsui Make sure to erase cursor before scrolling as ite_dio_scroll() does.

Fixes garbages on scrolling on sti bootloader console.
 1.3 26-May-2025  tsutsui Also use sti(4) ROM functions for 362/382 framebuffers on bootloader.

Mostly taken on OpenBSD/hp300.
Tested on 382 with VGA-res EVRX, and no visible regression on
425e (sti EVRX), 425t (sti CRX), and 380 (topcat).
 1.2 15-Jan-2023  tsutsui branches: 1.2.6;
TAB/space cleanup.
 1.1 13-Apr-2014  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.12; 1.1.68;
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.

Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
 1.1.68.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.1.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.12.1 13-Apr-2014  tls file ite_sti.c was added on branch tls-maxphys on 2014-08-20 00:03:01 +0000
 1.1.8.2 10-Aug-2014  tls Rebase.
 1.1.8.1 13-Apr-2014  tls file ite_sti.c was added on branch tls-earlyentropy on 2014-08-10 06:53:58 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 13-Apr-2014  yamt file ite_sti.c was added on branch yamt-pagecache on 2014-05-22 11:39:47 +0000
 1.1.4.2 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.1.4.1 13-Apr-2014  bouyer file ite_sti.c was added on branch netbsd-6 on 2014-05-21 20:56:36 +0000
 1.1.2.2 18-May-2014  rmind sync with head
 1.1.2.1 13-Apr-2014  rmind file ite_sti.c was added on branch rmind-smpnet on 2014-05-18 17:45:08 +0000
 1.2.6.1 02-Aug-2025  perseant Sync with HEAD
 1.13 31-May-2025  tsutsui More cleanup and cosmetics in bootloader 1bpp ite sources.

- use C99 exact width integer types where appropriate
- make local variables static and read only variables const
- misc KNF

No visible regression on HP9000/380 with 1bpp DIO-II Hyperion.
 1.12 29-May-2025  tsutsui Consolidate scroll and cursor drawing ops into common ITE layer.

No functional change, just for readability.
Tested on 380 (topcat) and 382 (sti).
 1.11 12-Feb-2011  tsutsui branches: 1.11.92;
Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.10 10-Feb-2011  tsutsui Pull OpenBSD's standalone ITE driver reorganization:
- merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
- rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
to use it among all dumb monochrome framebuffers
- ditto hyper_putc() to ite_dio_putc1bpp()
- remove unnecessary flags, macro, function args, and structure members
- remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.
 1.9 10-Feb-2011  tsutsui Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers. Also rename ite_fontinit() to
ite_fontinit8bpp(). From OpenBSD.
 1.8 10-Feb-2011  tsutsui All framebuffer drivers use common readbyte and writeglyph functions
so no need to put them into per driver function pointers. From OpenBSD.

Tested on HP382 (serial) and HP425t (topcat).
 1.7 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.6 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.5 11-Dec-2005  christos branches: 1.5.100; 1.5.106; 1.5.108;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.5.108.2 17-Feb-2011  bouyer Sync with HEAD
 1.5.108.1 08-Feb-2011  bouyer Sync with HEAD
 1.5.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.100.1 05-Mar-2011  rmind sync with head
 1.11.92.1 02-Aug-2025  perseant Sync with HEAD
 1.12 27-May-2025  tsutsui Make local functions static.
 1.11 05-Jul-2021  tsutsui branches: 1.11.16;
Get rid of obsolete grfreg.h. From OpenBSD.
 1.10 10-Feb-2011  tsutsui branches: 1.10.72;
Pull OpenBSD's standalone ITE driver reorganization:
- merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
- rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
to use it among all dumb monochrome framebuffers
- ditto hyper_putc() to ite_dio_putc1bpp()
- remove unnecessary flags, macro, function args, and structure members
- remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.
 1.9 10-Feb-2011  tsutsui Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers. Also rename ite_fontinit() to
ite_fontinit8bpp(). From OpenBSD.
 1.8 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.7 07-Feb-2011  tsutsui Resurrect and move retired ITE files that are still used by bootloaders.
 1.6 28-Jan-2006  tsutsui branches: 1.6.98; 1.6.104; 1.6.106;
Fix botch on ANSIfy.
 1.5 11-Dec-2005  christos branches: 1.5.2;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.2; 1.4.4; 1.4.12;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.12.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.4.2.1 30-Jan-2006  tron Pull up following revision(s) (requested by tsutsui in ticket #1145):
sys/arch/hp300/stand/common/ite_tc.c: revision 1.6
sys/arch/hp300/stand/common/ite_gb.c: revision 1.6
sys/arch/hp300/stand/common/ite_rb.c: revision 1.6
sys/arch/hp300/stand/common/ite_hy.c: revision 1.6
sys/arch/hp300/stand/common/ite_dv.c: revision 1.6
Fix botch on ANSIfy.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.106.2 17-Feb-2011  bouyer Sync with HEAD
 1.6.106.1 08-Feb-2011  bouyer Sync with HEAD
 1.6.104.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.98.1 05-Mar-2011  rmind sync with head
 1.10.72.1 01-Aug-2021  thorpej Sync with HEAD.
 1.11.16.1 02-Aug-2025  perseant Sync with HEAD
 1.1 10-Feb-2011  tsutsui branches: 1.1.2; 1.1.4; 1.1.8;
Pull support for Tigershark monochrome framebuffer from OpenBSD.
Untested (no hardware), but doesn't break existing HP425t topcat.
 1.1.8.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.8.1 10-Feb-2011  jruoho file ite_tvrx.c was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.1.4.2 05-Mar-2011  rmind sync with head
 1.1.4.1 10-Feb-2011  rmind file ite_tvrx.c was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.1.2.2 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 10-Feb-2011  bouyer file ite_tvrx.c was added on branch bouyer-quota2 on 2011-02-17 11:59:41 +0000
 1.2 08-Feb-2011  rmind branches: 1.2.2; 1.2.6;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.2.3 17-Feb-2011  bouyer Sync with HEAD
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file itereg.h was added on branch bouyer-quota2 on 2011-02-08 16:19:23 +0000
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 08-Feb-2011  jruoho file itereg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 08-Feb-2011  rmind file itereg.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.18 30-May-2025  tsutsui Misc cleanup.

- make local variables static
- make read only variable const
- remove a redundant arg
- use uint8_t rather than u_char
- use consistent style
- some KNF
 1.17 26-May-2025  tsutsui Also use sti(4) ROM functions for 362/382 framebuffers on bootloader.

Mostly taken on OpenBSD/hp300.
Tested on 382 with VGA-res EVRX, and no visible regression on
425e (sti EVRX), 425t (sti CRX), and 380 (topcat).
 1.16 13-Apr-2014  tsutsui branches: 1.16.64;
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.

Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
 1.15 12-Feb-2011  tsutsui branches: 1.15.4; 1.15.10; 1.15.14; 1.15.18; 1.15.28;
Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).
 1.14 10-Feb-2011  tsutsui Pull support for Tigershark monochrome framebuffer from OpenBSD.
Untested (no hardware), but doesn't break existing HP425t topcat.
 1.13 10-Feb-2011  tsutsui Pull OpenBSD's standalone ITE driver reorganization:
- merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
- rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
to use it among all dumb monochrome framebuffers
- ditto hyper_putc() to ite_dio_putc1bpp()
- remove unnecessary flags, macro, function args, and structure members
- remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.
 1.12 10-Feb-2011  tsutsui Remove unused deinit functions. From OpenBSD.
 1.11 10-Feb-2011  tsutsui Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers. Also rename ite_fontinit() to
ite_fontinit8bpp(). From OpenBSD.
 1.10 10-Feb-2011  tsutsui bcopy() -> memmove()

How did this one survive several sweeps?
 1.9 10-Feb-2011  tsutsui All framebuffer drivers use common readbyte and writeglyph functions
so no need to put them into per driver function pointers. From OpenBSD.

Tested on HP382 (serial) and HP425t (topcat).
 1.8 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.7 18-Mar-2009  cegger branches: 1.7.4; 1.7.6; 1.7.8;
bzero -> memset
 1.6 07-Mar-2007  he branches: 1.6.44; 1.6.52; 1.6.58;
Fix an instance of "void *v, x;" and cast to char* before doing
pointer arithmetic.
 1.5 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 11-Dec-2005  christos branches: 1.4.26;
merge ktrace-lwp.
 1.3 14-Nov-2003  tsutsui branches: 1.3.16;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 03-Sep-2007  yamt sync with head.
 1.4.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.6.44.1 04-May-2009  yamt sync with head.
 1.7.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.7.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.4.1 05-Mar-2011  rmind sync with head
 1.15.28.1 10-Aug-2014  tls Rebase.
 1.15.18.1 18-May-2014  rmind sync with head
 1.15.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.15.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.64.1 02-Aug-2025  perseant Sync with HEAD
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.74; 1.6.76; 1.6.78;
merge ktrace-lwp.
 1.5 20-Feb-2005  tsutsui Use ANSI function decls.
 1.4 14-Nov-2003  tsutsui branches: 1.4.8; 1.4.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 09-Oct-1997  jtc branches: 1.3.50;
Fix tipo inherited from old version of TNF copyright template.
 1.2 12-May-1997  thorpej branches: 1.2.4;
In kbdnmi(), after we have cleared the interrupt condition, reset
the machine, rather than simply returning to the assembly NMI handler.
Previously, the assembly handler would simply jump back to begin:, which
would frob the stack, and re-clear the BSS. However, this is not sufficient,
as there may be state in initialized data that must be restored. Thus,
the only reasonable solution is to re-load the boot block.
 1.1 14-Apr-1997  thorpej Implement an autoconfiguring indirect keyboard driver, removing explcit
dependencies on the HIL keyboard.
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.50.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.50.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.50.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.50.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.6.78.1 16-May-2008  yamt sync with head.
 1.6.76.1 18-May-2008  yamt sync with head.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 09-Oct-1997  jtc branches: 1.2.152; 1.2.154; 1.2.156;
Fix tipo inherited from old version of TNF copyright template.
 1.1 14-Apr-1997  thorpej branches: 1.1.4;
Implement an autoconfiguring indirect keyboard driver, removing explcit
dependencies on the HIL keyboard.
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.156.1 16-May-2008  yamt sync with head.
 1.2.154.1 18-May-2008  yamt sync with head.
 1.2.152.1 02-Jun-2008  mjf Sync with HEAD.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2; 1.1.4; 1.1.8;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.8.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.8.1 07-Feb-2011  jruoho file kbdmap.h was added on branch jruoho-x86intr on 2011-06-06 09:05:38 +0000
 1.1.4.2 05-Mar-2011  rmind sync with head
 1.1.4.1 07-Feb-2011  rmind file kbdmap.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file kbdmap.h was added on branch bouyer-quota2 on 2011-02-08 16:19:23 +0000
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.76; 1.4.78;
merge ktrace-lwp.
 1.3 14-Nov-2003  tsutsui Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 09-Oct-1997  jtc branches: 1.2.50;
Fix tipo inherited from old version of TNF copyright template.
 1.1 14-Apr-1997  thorpej branches: 1.1.4;
Implement an autoconfiguring indirect keyboard driver, removing explcit
dependencies on the HIL keyboard.
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.50.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.50.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.50.1 03-Aug-2004  skrll Sync with HEAD
 1.4.78.1 16-May-2008  yamt sync with head.
 1.4.76.1 18-May-2008  yamt sync with head.
 1.4.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.16 15-Jan-2023  tsutsui TAB/space cleanup.
 1.15 08-Feb-2011  rmind branches: 1.15.86;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.14 20-Jul-2006  tsutsui branches: 1.14.84; 1.14.90; 1.14.92;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.13 11-Dec-2005  christos branches: 1.13.4; 1.13.8;
merge ktrace-lwp.
 1.12 20-Feb-2005  tsutsui branches: 1.12.4;
Use ANSI function decls.
 1.11 14-Nov-2003  tsutsui branches: 1.11.8; 1.11.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.10 02-Oct-2003  simonb Use common m68k struct trapframe instead of rolling our own.
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 02-Jan-2001  simonb branches: 1.8.24;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.7 14-Dec-1999  thorpej Recode the kernel transfer point entirely in assembly to completely
avoid compiler surprises.
 1.6 14-Dec-1999  thorpej Make sure the compiler doens't reuse the registers we use to convey
information to the kernel.
 1.5 31-Jul-1999  thorpej branches: 1.5.2; 1.5.8;
Add 385 and 425e SPU detection. From OpenBSD.
 1.4 28-Jun-1997  thorpej branches: 1.4.18;
Adjust start address here, now that exec() no longer does it for us.
 1.3 12-May-1997  thorpej - Always build the romputchar() glue.
- Don't set "userom" in the trap handler (we didn't before, but we've
removed the previous CPP conditional that was used to enable it.)
 1.2 27-Apr-1997  thorpej Update getmachineid() for new machineid values.
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.4.18.1 02-Aug-1999  thorpej Update from trunk.
 1.5.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.24.1 03-Aug-2004  skrll Sync with HEAD
 1.11.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.11.8.1 29-Apr-2005  kent sync with -current
 1.12.4.1 30-Dec-2006  yamt sync with head.
 1.13.8.1 11-Aug-2006  yamt sync with head
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.14.92.1 17-Feb-2011  bouyer Sync with HEAD
 1.14.90.1 06-Jun-2011  jruoho Sync with HEAD.
 1.14.84.1 05-Mar-2011  rmind sync with head
 1.15.86.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.2 31-May-2025  tsutsui More cleanup and cosmetics in bootloader 1bpp ite sources.

- use C99 exact width integer types where appropriate
- make local variables static and read only variables const
- misc KNF

No visible regression on HP9000/380 with 1bpp DIO-II Hyperion.
 1.1 07-Feb-2011  tsutsui branches: 1.1.2; 1.1.4; 1.1.8; 1.1.98;
Resurrect and move retired ITE files that are still used by bootloaders.
 1.1.98.1 02-Aug-2025  perseant Sync with HEAD
 1.1.8.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.8.1 07-Feb-2011  jruoho file maskbits.h was added on branch jruoho-x86intr on 2011-06-06 09:05:39 +0000
 1.1.4.2 05-Mar-2011  rmind sync with head
 1.1.4.1 07-Feb-2011  rmind file maskbits.h was added on branch rmind-uvmplock on 2011-03-05 20:50:25 +0000
 1.1.2.2 08-Feb-2011  bouyer Sync with HEAD
 1.1.2.1 07-Feb-2011  bouyer file maskbits.h was added on branch bouyer-quota2 on 2011-02-08 16:19:23 +0000
 1.19 15-Jan-2023  tsutsui TAB/space cleanup.
 1.18 12-Apr-2021  mrg branches: 1.18.16;
remove shadowed (common) declarations of various libsa variables
from various boot programs. for macppc and zaurus, avoid building
with -fcommon any more.
 1.17 28-Apr-2020  tsutsui branches: 1.17.4;
Fix inappropriate error messages when nfs_mount() fails.

Noticed by Chris Hanson and his HP330 and confirmed on my HP425e.
Also bump revisions to denote visible changes.
Worth to pull up to netbsd-9.
 1.16 11-Jun-2016  dholland branches: 1.16.22;
gets_s -> kgets.

The exact name isn't that important; but it is important not to use
"gets_s" and thereby allow anyone to falsely get the impression we're
implementing Annex K. We aren't.

ok core.
 1.15 05-Jun-2016  christos get rid of gets/tgets
 1.14 17-Jul-2011  joerg branches: 1.14.12; 1.14.30;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.13 21-Oct-2009  snj Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder).
 1.12 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.11 11-Dec-2005  christos branches: 1.11.74; 1.11.76; 1.11.78;
merge ktrace-lwp.
 1.10 20-Feb-2005  tsutsui Use ANSI function decls.
 1.9 14-Nov-2003  tsutsui branches: 1.9.8; 1.9.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.8 03-Dec-2001  gmcgarry branches: 1.8.16;
Use BOOTP by default.
 1.7 13-Nov-1999  thorpej branches: 1.7.8; 1.7.12;
Backout my libsa changes.
 1.6 11-Nov-1999  thorpej Don't reference libkern.h.
 1.5 07-May-1999  drochner branches: 1.5.2; 1.5.4; 1.5.8;
include <lib/libkern/libkern.h> for intoa()/inet_ntoa()
 1.4 04-Oct-1997  thorpej branches: 1.4.12;
Copyright assigned to The NetBSD Foundation.
 1.3 22-Jul-1997  drochner branches: 1.3.2;
Don't use <lib/libsa/if_ether.h> anymore. This was a copy of the
old (before ARP changes) <netinet/if_ether.h>, intended for
temporary use.
 1.2 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.1 04-Feb-1997  thorpej branches: 1.1.4;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.4.1 07-Mar-1997  is Use libsa copy of oldstyle if_ether.h for now
 1.3.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.12.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.4.1 15-Nov-1999  fvdl Sync with -current
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.7.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.16.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.16.1 03-Aug-2004  skrll Sync with HEAD
 1.9.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.11.78.2 11-Mar-2010  yamt sync with head
 1.11.78.1 16-May-2008  yamt sync with head.
 1.11.76.1 18-May-2008  yamt sync with head.
 1.11.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.30.1 09-Jul-2016  skrll Sync with HEAD
 1.14.12.1 03-Dec-2017  jdolecek update from HEAD
 1.16.22.1 01-May-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #880):

sys/arch/hp300/stand/uboot/version: revision 1.21
sys/arch/hp300/stand/inst/version: revision 1.14
sys/arch/hp300/stand/common/netio.c: revision 1.17

Fix inappropriate error messages when nfs_mount() fails.

Noticed by Chris Hanson and his HP332 and confirmed on my HP425e.

Also bump revisions to denote visible changes.
Worth to pull up to netbsd-9.
 1.17.4.1 17-Apr-2021  thorpej Sync with HEAD.
 1.18.16.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.2 16-Dec-2000  simonb Use sys/conf/newvers_stand.sh instead of local script.
 1.1 04-Feb-1997  thorpej branches: 1.1.26;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.26.1 05-Jan-2001  bouyer Sync with HEAD
 1.6 25-Jun-2006  tsutsui Use (uint8_t *) to specify buffers for hpib xfers.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8; 1.5.16;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.4;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.1 30-Dec-2006  yamt sync with head.
 1.5.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.5.8.1 26-Jun-2006  yamt sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6 15-Jan-2023  tsutsui TAB/space cleanup.
 1.5 11-Dec-2005  christos branches: 1.5.196;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.5.196.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.8 21-Oct-2009  snj Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder).
 1.7 25-Jun-2006  tsutsui branches: 1.7.62;
Fix unsigned/signed mismatch.
 1.6 25-Jan-2006  christos branches: 1.6.2; 1.6.6; 1.6.14;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.5 11-Dec-2005  christos branches: 1.5.2;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui branches: 1.4.4;
Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 21-Aug-2003  he Adapt to const-ification of first arg of open function in fs_ops.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.4.2 30-Dec-2006  yamt sync with head.
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.14.1 13-Jul-2006  gdamore Merge from HEAD.
 1.6.6.1 26-Jun-2006  yamt sync with head.
 1.6.2.1 09-Sep-2006  rpaulo sync with head
 1.7.62.1 11-Mar-2010  yamt sync with head
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 14-Nov-2003  tsutsui Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 21-Aug-2003  he Adapt to const-ification of first arg of open function in fs_ops.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.17 12-Feb-2023  andvar fix various typos in comments.
 1.16 15-Jan-2023  tsutsui TAB/space cleanup.
 1.15 25-Nov-2022  tsutsui branches: 1.15.2;
Sync with rdreg.h integer type changes.
 1.14 21-Nov-2022  tsutsui Use common macro for numbers of cylinders and blocks for HP-IB disks.

No binary changes.
 1.13 21-Nov-2022  tsutsui Make local variables static and read only ones const.
 1.12 21-Nov-2022  tsutsui Sync a list of HP-IB disk IDs with kernel's one.

Now bootloader can boot from 2202A, 7908A, 7911A, and 7941A.
Tested on 425t and HPDisk.
 1.11 05-Jul-2021  tsutsui Cleanup duplicated CS/80 indentify structures. From OpenBSD.

https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2
> Pick HP-IB describe structures changes from main kernel code here as well.
 1.10 17-Jul-2011  joerg branches: 1.10.58; 1.10.70;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.9 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.8 04-Mar-2007  christos branches: 1.8.66; 1.8.72; 1.8.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 25-Jun-2006  tsutsui branches: 1.7.10;
Use (uint8_t *) to specify buffers for hpib xfers.
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8; 1.6.16;
merge ktrace-lwp.
 1.5 20-Feb-2005  tsutsui branches: 1.5.4;
Use ANSI function decls.
 1.4 28-Aug-2004  thorpej branches: 1.4.4; 1.4.6;
Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
 1.3 14-Nov-2003  tsutsui Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.2 03-Sep-2004  skrll Sync with HEAD
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.4.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.4.1 29-Apr-2005  kent sync with -current
 1.5.4.2 03-Sep-2007  yamt sync with head.
 1.5.4.1 30-Dec-2006  yamt sync with head.
 1.6.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.6.8.1 26-Jun-2006  yamt sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.74.1 17-Feb-2011  bouyer Sync with HEAD
 1.8.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.66.1 05-Mar-2011  rmind sync with head
 1.10.70.1 01-Aug-2021  thorpej Sync with HEAD.
 1.10.58.2 06-Dec-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1552):

sys/arch/hp300/dev/rd.c: revision 1.120
sys/arch/hp300/dev/rd.c: revision 1.121
sys/arch/hp300/dev/rd.c: revision 1.122
sys/arch/hp300/dev/rd.c: revision 1.123
sys/arch/hp300/dev/rd.c: revision 1.124
sys/arch/hp300/dev/rdreg.h: revision 1.19
sys/arch/hp300/dev/rd.c: revision 1.111
sys/arch/hp300/dev/rd.c: revision 1.112
sys/arch/hp300/dev/rd.c: revision 1.113
sys/arch/hp300/stand/common/rd.c: revision 1.12
sys/arch/hp300/dev/rd.c: revision 1.114
sys/arch/hp300/stand/common/rd.c: revision 1.13
sys/arch/hp300/dev/rd.c: revision 1.115
sys/arch/hp300/stand/common/rd.c: revision 1.14
sys/arch/hp300/dev/rd.c: revision 1.116
sys/arch/hp300/stand/common/rd.c: revision 1.15
sys/arch/hp300/dev/rd.c: revision 1.117
sys/arch/hp300/dev/rd.c: revision 1.118
sys/arch/hp300/dev/rd.c: revision 1.119
sys/arch/hp300/dev/rdvar.h: revision 1.27
sys/arch/hp300/dev/rdreg.h: revision 1.20

Sync a list of HP-IB disk IDs with kernel's one.
Now bootloader can boot from 2202A, 7908A, 7911A, and 7941A.
Tested on 425t and HPDisk.

Make local variables static and read only ones const.

Use common macro for numbers of cylinders and blocks for HP-IB disks.
No binary changes.

Fix "rd(4) at punits not configured on HPDisk are misprobed" problem.
- check not only stat value returned by C_QSTAT command against
each punit but also desc.d_name returned by C_DESC command
because it looks HPDisk responds to commands against punits supported
but not-configured punits at 1-3
- prepare rdreset_unit() function to manage reset punit ops during
probe without valid softc

The stragety is taken from OpenBSD with several modification.
Tested on 425t with real 9122D and HPDisk emulating two 7937H drives.
Should be pulled up to netbsd-9.

Remove now unused buffer members from softc prepared only for rdreset().

Use proper integer types for HP-IB xfer parameters.
No visible regression on 425t and HPDisk.

Sync with rdreg.h integer type changes.

Remove unnecessary declarations.

Check bounds of RAW_PART by bounds_check_with_mediasize() as other drivers.
With this check, dd(1) without a count value against a raw partition
is terminated properly at the end of media. Tested on 425t and HPDisk.
Should be pulled up to netbsd-9.

Check bounds of each partition by MI bounds_check_with_label(9).
The previous implementation was committed in rev 1.26 about 26 years ago
and it looks there is no quirk to use the old MD one.

Pass a correct dev_t arg to disk_ioctl().
Probably harmless.

Remove a duplicated static function declaration.

Set disk_geom parameters required by DIOCGPARTINFO in disk_ioctl().
With this change raid(4) no longer complains before mountroot:
RAIDframe: can't get disk size for dev rd0 (22)
Should be pulled up to netbsd-9.

Use proper RAW_PART macro rather than a magic number.

Remove more duplicated static function declarations.

Misc KNF and cosmetics.

Add empty DIOCCACHESYNC ioctl(2) for rd(4).
Without this raid(4) always complains on various raidctl(8) ops:
raid0: cache flush[0] to component 0 failed (22)
RAID1 configured by raid(4) just works HP-IB disks on hp300.

Explicitly include <sys/kernel.h> for hz(9) as man pages says.
XXX: it looks sys/param.h r1.615 and later also has extern int hz
 1.10.58.1 14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
 1.15.2.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.5 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106; 1.4.108;
merge ktrace-lwp.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 27-May-2001  gmcgarry branches: 1.2.8; 1.2.24;
Alignment for on ELF systems. ELF bootblocks now work.
 1.1 04-Feb-1997  thorpej branches: 1.1.38;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.38.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.2.8.2 27-May-2001  gmcgarry Alignment for on ELF systems. ELF bootblocks now work.
 1.2.8.1 27-May-2001  gmcgarry file rominfo.h was added on branch nathanw_sa on 2001-05-27 05:30:42 +0000
 1.4.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 05-Mar-2011  rmind sync with head
 1.22 11-Dec-2022  tsutsui Make hp300 bootloaders UFS2 ready.
 1.21 11-Dec-2022  tsutsui Cleanup extern declarations.
 1.20 11-Jun-2016  dholland Change "tgets_s" back to "tgets". We obviously want to keep the bounds
argument, but there's no need to mess with the function name.
 1.19 05-Jun-2016  christos get rid of gets/tgets
 1.18 10-Aug-2014  isaki branches: 1.18.4;
Unify all arch/*/stand's atoi() to MI libsa.
lib/libsa/atoi.c was separated from lib/libsa/bootcfg.c.
PR/49084
 1.17 19-Apr-2014  tsutsui Add RTC support for HP9000/425e to bootloader too.

Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF

Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
 1.16 16-Jul-2008  tsutsui branches: 1.16.28; 1.16.34; 1.16.38; 1.16.44; 1.16.54;
Change boot messages to replace build date and maker with kernrev.
 1.15 04-Mar-2007  christos branches: 1.15.40; 1.15.44; 1.15.46; 1.15.48; 1.15.50;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 02-Jul-2006  tsutsui branches: 1.14.10;
Rearrange DELAY() macro to use an asm statement so that we'll get more
proper delay.
 1.13 02-Jul-2006  tsutsui Use a volatile variable in DELAY() macro so that gcc4 won't omit it.
Fixes output corruption on DCA console boot.

XXX some mips ports have the similar macro in <machine/param.h>.
 1.12 25-Jun-2006  tsutsui - move declaration for sc_table from samachdep.h to device.h
- include <lib/libsa/stand.h> from samachdep.h for struct fs_ops
- remove unneeded declarations from samachdep.h
 1.11 01-Apr-2006  oster branches: 1.11.4;
Explicitly include <m68k/frame.h> here, rather than relying on it getting
pulled in via signal.h by accident.
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10; 1.10.12;
merge ktrace-lwp.
 1.9 14-Nov-2003  tsutsui branches: 1.9.14; 1.9.16; 1.9.26;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.8 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.7 16-Mar-2002  gmcgarry branches: 1.7.12;
Move exec_hp300() out of uboot.c into its own file so that it can
be used by SYS_INST. SYS_INST can now boot ELF kernels inside the
miniroot.
 1.6 02-Jan-2001  simonb branches: 1.6.4; 1.6.8;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.5 14-Dec-1999  thorpej Recode the kernel transfer point entirely in assembly to completely
avoid compiler surprises.
 1.4 31-Jul-1999  thorpej branches: 1.4.2; 1.4.8;
Fix oversight in last.
 1.3 12-May-1997  thorpej branches: 1.3.18;
- Define INTIOBASE here for use by the standalone programs.
- Add some extern's for "userom" and romputchar()
 1.2 27-Apr-1997  thorpej Don't define our own machineid values - pull in <machine/hp300spu.h>
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.3.18.1 02-Aug-1999  thorpej Update from trunk.
 1.4.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.12.1 03-Aug-2004  skrll Sync with HEAD
 1.9.26.1 06-Apr-2006  tron Pull up following revision(s) (requested by oster in ticket #1242):
sys/arch/hp300/stand/common/samachdep.h: revision 1.11
Explicitly include <m68k/frame.h> here, rather than relying on it getting
pulled in via signal.h by accident.
 1.9.16.3 03-Sep-2007  yamt sync with head.
 1.9.16.2 30-Dec-2006  yamt sync with head.
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.9.14.1 06-Apr-2006  tron Pull up following revision(s) (requested by oster in ticket #1242):
sys/arch/hp300/stand/common/samachdep.h: revision 1.11
Explicitly include <m68k/frame.h> here, rather than relying on it getting
pulled in via signal.h by accident.
 1.10.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.10.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.10.8.3 11-Aug-2006  yamt sync with head
 1.10.8.2 26-Jun-2006  yamt sync with head.
 1.10.8.1 11-Apr-2006  yamt sync with head
 1.10.6.1 22-Apr-2006  simonb Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.11.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.14.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.50.1 19-Oct-2008  haad Sync with HEAD.
 1.15.48.1 18-Jul-2008  simonb Sync with head.
 1.15.46.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.15.44.1 04-May-2009  yamt sync with head.
 1.15.40.1 28-Sep-2008  mjf Sync with HEAD.
 1.16.54.1 10-Aug-2014  tls Rebase.
 1.16.44.1 18-May-2014  rmind sync with head
 1.16.38.2 03-Dec-2017  jdolecek update from HEAD
 1.16.38.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.34.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.16.28.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.4.1 09-Jul-2016  skrll Sync with HEAD
 1.13 09-May-2024  tsutsui Add a preliminary CD boot support to uboot for preparation of PR/54455.

Briefly tested on mame, but not enalbed yet.
 1.12 15-Jan-2023  tsutsui TAB/space cleanup.
 1.11 02-Jan-2014  tsutsui branches: 1.11.60;
Change the SCSI select timeout from 2ms to 250ms as kernel spc(4) driver does.

Noticed by miod@openbsd.
 1.10 08-Feb-2011  rmind branches: 1.10.4; 1.10.14; 1.10.18;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.9 04-Mar-2007  christos branches: 1.9.66; 1.9.72; 1.9.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 25-Jun-2006  tsutsui branches: 1.8.10;
- use (uint8_t *) for scsi buffers
- u_char -> uint8_t for byte data
- use proper type variable
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.8; 1.7.16;
merge ktrace-lwp.
 1.6 20-Feb-2005  tsutsui branches: 1.6.4;
Use ANSI function decls.
 1.5 14-Nov-2003  tsutsui branches: 1.5.8; 1.5.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 01-Aug-2003  tsutsui Move dev/scsireg.h into stand/common since it is no longer used by kernel.
 1.2 20-Aug-2001  wiz branches: 1.2.6; 1.2.22;
"wierd" is weird.
 1.1 04-Feb-1997  thorpej branches: 1.1.40;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.40.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.2.22.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.6.2 20-Aug-2001  wiz "wierd" is weird.
 1.2.6.1 20-Aug-2001  wiz file scsi.c was added on branch nathanw_sa on 2001-08-20 12:20:06 +0000
 1.5.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.6.4.2 03-Sep-2007  yamt sync with head.
 1.6.4.1 30-Dec-2006  yamt sync with head.
 1.7.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.7.8.1 26-Jun-2006  yamt sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.74.1 17-Feb-2011  bouyer Sync with HEAD
 1.9.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.66.1 05-Mar-2011  rmind sync with head
 1.10.18.1 18-May-2014  rmind sync with head
 1.10.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11.60.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.6 09-May-2024  tsutsui Add a preliminary CD boot support to uboot for preparation of PR/54455.

Briefly tested on mame, but not enalbed yet.
 1.5 15-Jan-2023  tsutsui TAB/space cleanup.
 1.4 07-Sep-2015  dholland branches: 1.4.48;
Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.3 08-Feb-2011  rmind branches: 1.3.14; 1.3.32;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.2 11-Dec-2005  christos branches: 1.2.100; 1.2.106; 1.2.108;
merge ktrace-lwp.
 1.1 01-Aug-2003  tsutsui branches: 1.1.4;
Move dev/scsireg.h into stand/common since it is no longer used by kernel.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 01-Aug-2003  skrll file scsireg.h was added on branch ktrace-lwp on 2004-08-03 10:34:38 +0000
 1.2.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.2.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.100.1 05-Mar-2011  rmind sync with head
 1.3.32.1 22-Sep-2015  skrll Sync with HEAD
 1.3.14.1 03-Dec-2017  jdolecek update from HEAD
 1.4.48.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.5 09-May-2024  tsutsui Add a preliminary CD boot support to uboot for preparation of PR/54455.

Briefly tested on mame, but not enalbed yet.
 1.4 11-Dec-2005  christos branches: 1.4.196;
merge ktrace-lwp.
 1.3 14-Nov-2003  tsutsui Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.4.196.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.13 09-May-2024  tsutsui Add a preliminary CD boot support to uboot for preparation of PR/54455.

Briefly tested on mame, but not enalbed yet.
 1.12 15-Jan-2023  tsutsui TAB/space cleanup.
 1.11 17-Jul-2011  joerg branches: 1.11.84;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.10 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.9 04-Mar-2007  christos branches: 1.9.66; 1.9.72; 1.9.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 25-Jun-2006  tsutsui branches: 1.8.10;
- use (uint8_t *) for scsi buffers
- u_char -> uint8_t for byte data
- use proper type variable
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.8; 1.7.16;
merge ktrace-lwp.
 1.6 20-Feb-2005  tsutsui branches: 1.6.4;
Use ANSI function decls.
 1.5 28-Aug-2004  thorpej branches: 1.5.4; 1.5.6;
Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
 1.4 14-Nov-2003  tsutsui Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 01-Aug-2003  tsutsui Move dev/scsireg.h into stand/common since it is no longer used by kernel.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.2 03-Sep-2004  skrll Sync with HEAD
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.5.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.4.1 29-Apr-2005  kent sync with -current
 1.6.4.2 03-Sep-2007  yamt sync with head.
 1.6.4.1 30-Dec-2006  yamt sync with head.
 1.7.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.7.8.1 26-Jun-2006  yamt sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.74.1 17-Feb-2011  bouyer Sync with HEAD
 1.9.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.66.1 05-Mar-2011  rmind sync with head
 1.11.84.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.17 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.16 27-Dec-2010  tsutsui branches: 1.16.2; 1.16.4;
With a quick test, HP9000/362 doesn't seem to have frodo utility chip,
so probe code to identify HP362 taken from OpenBSD has never worked.

Identify HP362 by probing device IDs of the on-board framebuffer instead.

---

>> NetBSD/hp300 Primary Boot, Revision 1.16 (from NetBSD 5.99.41)
>> HP 9000/362 SPU
>> Enter "reset" to reset system.
Boot: [[[sd0a:]netbsd][-a][-c][-d][-s][-v][-q]] :-
2836828+148212 [343504+216292]=0x361b24
Start @ 0xff003400 [1=0xff2dac50-0x361b24]...
Entry point: 0xff003400
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 5.99.41 (GENERIC) #135: Mon Dec 27 23:30:21 JST 2010
tsutsui@mirage:/usr/src/sys/arch/hp300/compile/GENERIC
HP 9000/362 (25MHz MC68030 CPU+MMU, 25MHz MC68882 FPU)
total memory = 16372 KB
avail memory = 11480 KB
:
 1.15 20-Jul-2006  tsutsui branches: 1.15.84;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.14 19-Jul-2006  tsutsui Adjust comments.
 1.13 11-Dec-2005  christos branches: 1.13.4; 1.13.8;
merge ktrace-lwp.
 1.12 07-Aug-2003  agc branches: 1.12.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 14-Dec-1999  thorpej branches: 1.11.28;
Recode the kernel transfer point entirely in assembly to completely
avoid compiler surprises.
 1.10 11-Nov-1999  thorpej Add register prefixes.
 1.9 12-Aug-1999  thorpej branches: 1.9.2; 1.9.4; 1.9.8;
Use C-style comments.
 1.8 31-Jul-1999  thorpej If building without ITECONSOLE, don't install our own NMI handler. Just
leave the ROM's NMI handler in place.
 1.7 31-Jul-1999  thorpej Fix oversight in last.
 1.6 31-Jul-1999  thorpej Add 385 and 425e SPU detection. From OpenBSD.
 1.5 08-Feb-1999  he branches: 1.5.4;
Avoid "unterminated character constant" error from mkdep (really cc).
I guess in some sense it's stupid to use cc to depend .S files.
 1.4 12-May-1997  thorpej - Always build a romout() stub.
- If kbdnmi() returns, stop cold, since it shouldn't.
 1.3 27-Apr-1997  thorpej Uniquely identify 345 vs. 375 vs. 400 and 380 vs. 425. Adapted by me from
code provided by Mike Smith. While I'm here, convert this file to use
macros from <machine/asm.h> rather than making assumptions about how
C labels are handled.
 1.2 10-Mar-1997  thorpej Fix rounding of lowram value; ensure the kernel load address is on
an 8k boundary.
 1.1 04-Feb-1997  thorpej branches: 1.1.4;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.4.1 11-Mar-1997  is merge in changes from Trunk.
 1.5.4.1 02-Aug-1999  thorpej Update from trunk.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.4.1 15-Nov-1999  fvdl Sync with -current
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.28.1 03-Aug-2004  skrll Sync with HEAD
 1.12.16.1 30-Dec-2006  yamt sync with head.
 1.13.8.1 11-Aug-2006  yamt sync with head
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.15.84.1 05-Mar-2011  rmind sync with head
 1.16.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.16.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3 27-Apr-1997  thorpej srt0.s renamed to srt0.S via repository copy Magick - we want this
file to be preprocessed before it is assembled.
 1.2 10-Mar-1997  thorpej Fix rounding of lowram value; ensure the kernel load address is on
an 8k boundary.
 1.1 04-Feb-1997  thorpej branches: 1.1.4;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.4.1 11-Mar-1997  is merge in changes from Trunk.
 1.8 11-Jun-2016  dholland Change "tgets_s" back to "tgets". We obviously want to keep the bounds
argument, but there's no need to mess with the function name.
 1.7 09-Jun-2016  christos return something
 1.6 05-Jun-2016  christos get rid of gets/tgets
 1.5 11-Dec-2005  christos branches: 1.5.122; 1.5.142;
merge ktrace-lwp.
 1.4 20-Feb-2005  tsutsui Use ANSI function decls.
 1.3 14-Nov-2003  tsutsui branches: 1.3.8; 1.3.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.5.142.1 09-Jul-2016  skrll Sync with HEAD
 1.5.122.1 03-Dec-2017  jdolecek update from HEAD
 1.12 07-May-2024  tsutsui Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
 1.11 29-Apr-2024  tsutsui Use LINKS to create hard links to generate proper METALOG files.

Also use the default ${PROG} variable and "install" target.

Fixes PR port-hp300/58211.
Should be pulled up to netbsd-10 and netbsd-9.
 1.10 23-Sep-2019  christos branches: 1.10.26;
Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)
 1.9 11-Dec-2005  christos branches: 1.9.166; 1.9.170;
merge ktrace-lwp.
 1.8 02-Oct-2003  simonb White-space nit.
 1.7 03-Jan-2003  lukem branches: 1.7.2;
Install release files under "${RELEASEDIR}/${MACHINE}/..." instead of
"${RELEASEDIR}/...".

${RELEASEDIR} is never cleaned , and ${RELEASEDIR}/${MACHINE} is only
cleaned if UPDATE is not defined.
 1.6 14-Dec-2001  gmcgarry include Makefile.buildboot before testing for RELEASEDIR
 1.5 08-Nov-2001  gmcgarry branches: 1.5.2;
Make install observe ${INSTPRIV}
 1.4 23-Sep-2000  simonb branches: 1.4.4; 1.4.6;
Use ${COPY} instead of -c for ${INSTALL} commands.
 1.3 31-May-2000  he Add handling of "make release".
 1.2 14-Dec-1999  thorpej branches: 1.2.2;
Make it possible to strip this down a little more.
 1.1 04-Feb-1997  thorpej branches: 1.1.20; 1.1.26; 1.1.32;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.32.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.26.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.20.1 13-Jul-2000  he Pull up revision 1.3 (requested by he):
Enhance the ``make release'' process:
o Build and install the distrib and boot bits
 1.2.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.3 07-Jan-2003  thorpej Sync with HEAD.
 1.5.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.2.1 08-Nov-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:24:47 +0000
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.170.1 11-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1838):

sys/arch/hp300/stand/uboot/Makefile: revision 1.11
sys/arch/hp300/stand/inst/Makefile: revision 1.11

Use LINKS to create hard links to generate proper METALOG files.

Also use the default ${PROG} variable and "install" target.

Fixes PR port-hp300/58211.
 1.9.166.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.10.26.2 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.10.26.1 11-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #684):

sys/arch/hp300/stand/uboot/Makefile: revision 1.11
sys/arch/hp300/stand/inst/Makefile: revision 1.11

Use LINKS to create hard links to generate proper METALOG files.

Also use the default ${PROG} variable and "install" target.

Fixes PR port-hp300/58211.
 1.25 15-Jan-2023  tsutsui TAB/space cleanup.
 1.24 11-Dec-2022  tsutsui branches: 1.24.2;
Cleanup extern declarations.
 1.23 04-Sep-2018  riastradh Fix some min/max -> uimin/uimax stragglers.

Confirmed by the 2018-09-04T04:40Z autobuild.
 1.22 11-Jun-2016  dholland branches: 1.22.16; 1.22.18;
gets_s -> kgets.

The exact name isn't that important; but it is important not to use
"gets_s" and thereby allow anyone to falsely get the impression we're
implementing Annex K. We aren't.

ok core.
 1.21 05-Jun-2016  christos get rid of gets
 1.20 10-Aug-2014  isaki branches: 1.20.4;
Unify all arch/*/stand's atoi() to MI libsa.
lib/libsa/atoi.c was separated from lib/libsa/bootcfg.c.
PR/49084
 1.19 21-Jun-2014  tsutsui Properly use an unused-but-set-variable. Also replace a magic number.
 1.18 16-Jul-2008  tsutsui branches: 1.18.38; 1.18.54;
Change boot messages to replace build date and maker with kernrev.
 1.17 28-Apr-2008  martin branches: 1.17.2; 1.17.4; 1.17.6;
Remove clause 3 and 4 from TNF licenses
 1.16 29-Dec-2007  tsutsui branches: 1.16.6; 1.16.8; 1.16.10;
Remove __P().
 1.15 24-Dec-2005  perry branches: 1.15.50; 1.15.56; 1.15.64;
bare asm -> __asm
 1.14 11-Dec-2005  christos merge ktrace-lwp.
 1.13 20-Feb-2005  tsutsui branches: 1.13.4;
Use ANSI function decls.
 1.12 02-Jan-2005  tsutsui branches: 1.12.2; 1.12.4;
u_intNN_t -> uintNN_t
 1.11 14-Nov-2003  tsutsui Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.10 28-Jan-2003  wiz branches: 1.10.2;
success, not sucess. Noted by mjl.
 1.9 28-Jan-2003  wiz unknown, not unkown. Noted by mjl.
 1.8 30-May-2002  thorpej Don't use multi-line string literals.
 1.7 16-Mar-2002  gmcgarry branches: 1.7.4; 1.7.6;
Move exec_hp300() out of uboot.c into its own file so that it can
be used by SYS_INST. SYS_INST can now boot ELF kernels inside the
miniroot.
 1.6 29-Dec-1997  scottr branches: 1.6.28; 1.6.32;
Prompt for total sectors, and calculate sane defaults for sectors per
cylinder and total sectors.
 1.5 15-Dec-1997  thorpej Fill out more file system information, from Havard Eidnes, and hacked a bit
by me.
 1.4 04-Oct-1997  thorpej branches: 1.4.2;
Copyright assigned to The NetBSD Foundation.
 1.3 27-Apr-1997  thorpej branches: 1.3.4;
CPU -> SPU
 1.2 04-Feb-1997  thorpej - If copying the miniroot from an NFS server, don't attempt to
compute the number of iterations through the copy loop based
on file size; the miniroot image may be compressed. Instead,
ignore short reads in the NFS case, and handle them like EOF.
- Fix typo in a printf format.
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.3.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.2.2 29-Dec-1997  perry pull up from trunk (scottr)
 1.4.2.1 15-Dec-1997  thorpej Sync w/ trunk: fill out more file system fields.
 1.6.32.2 20-Jun-2002  nathanw Catch up to -current.
 1.6.32.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.28.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.6.1 30-May-2002  tv Pull up revision 1.8 (requested by thorpej in ticket #89):
Don't use multi-line string literals.
 1.7.4.1 14-Jul-2002  gehenna catch up with -current.
 1.10.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.2.4 17-Jan-2005  skrll Sync with HEAD.
 1.10.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.2.1 29-Apr-2005  kent sync with -current
 1.13.4.2 21-Jan-2008  yamt sync with head
 1.13.4.1 21-Jun-2006  yamt sync with head.
 1.15.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.15.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.15.50.1 09-Jan-2008  matt sync with HEAD
 1.16.10.2 04-May-2009  yamt sync with head.
 1.16.10.1 16-May-2008  yamt sync with head.
 1.16.8.1 18-May-2008  yamt sync with head.
 1.16.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.16.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.6.1 19-Oct-2008  haad Sync with HEAD.
 1.17.4.1 18-Jul-2008  simonb Sync with head.
 1.17.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.18.54.1 10-Aug-2014  tls Rebase.
 1.18.38.2 03-Dec-2017  jdolecek update from HEAD
 1.18.38.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.4.1 09-Jul-2016  skrll Sync with HEAD
 1.22.18.1 10-Jun-2019  christos Sync with HEAD
 1.22.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.24.2.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.15 28-May-2025  tsutsui Bump bootloader versions to denote recent netboot and 362/382 sti changes.
 1.14 28-Apr-2020  tsutsui branches: 1.14.26;
Fix inappropriate error messages when nfs_mount() fails.

Noticed by Chris Hanson and his HP330 and confirmed on my HP425e.
Also bump revisions to denote visible changes.
Worth to pull up to netbsd-9.
 1.13 17-Jan-2016  tsutsui branches: 1.13.22;
Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
Tested on HP9000/382.
 1.12 26-Apr-2014  tsutsui branches: 1.12.4;
Bump versions to denote recent 425e related changes.
 1.11 12-Feb-2011  tsutsui branches: 1.11.4; 1.11.10; 1.11.14; 1.11.18; 1.11.28;
Bump version for 362 and 382 framebuffer support.
 1.10 10-Feb-2011  tsutsui Bump version to denote standalone ITE driver reorganization
pulled from OpenBSD.
 1.9 16-Jul-2008  tsutsui branches: 1.9.16; 1.9.22; 1.9.24;
Change boot messages to replace build date and maker with kernrev.
 1.8 20-Jul-2006  tsutsui branches: 1.8.58; 1.8.62; 1.8.64; 1.8.66; 1.8.68;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.7 12-May-1997  thorpej branches: 1.7.72; 1.7.86; 1.7.90;
Bump version: Added APCI console support
 1.6 27-Apr-1997  thorpej Bump version: Better SPU detection code
 1.5 10-Mar-1997  thorpej Bump version - we compute the kernel load address differently.
 1.4 04-Feb-1997  thorpej branches: 1.4.4;
Bump version: Add support for reading gzip'd miniroot images
 1.3 04-Feb-1997  thorpej Bump version: Reorganization of boot block code
 1.2 04-Feb-1997  thorpej Replay history: Added support for HP-IB cartridge tapes
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.4.4.1 11-Mar-1997  is merge in changes from Trunk.
 1.7.90.1 11-Aug-2006  yamt sync with head
 1.7.86.1 09-Sep-2006  rpaulo sync with head
 1.7.72.1 30-Dec-2006  yamt sync with head.
 1.8.68.1 19-Oct-2008  haad Sync with HEAD.
 1.8.66.1 18-Jul-2008  simonb Sync with head.
 1.8.64.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.8.62.1 04-May-2009  yamt sync with head.
 1.8.58.1 28-Sep-2008  mjf Sync with HEAD.
 1.9.24.1 17-Feb-2011  bouyer Sync with HEAD
 1.9.22.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.16.1 05-Mar-2011  rmind sync with head
 1.11.28.1 10-Aug-2014  tls Rebase.
 1.11.18.1 18-May-2014  rmind sync with head
 1.11.14.2 03-Dec-2017  jdolecek update from HEAD
 1.11.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.11.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.4.1 19-Mar-2016  skrll Sync with HEAD
 1.13.22.1 01-May-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #880):

sys/arch/hp300/stand/uboot/version: revision 1.21
sys/arch/hp300/stand/inst/version: revision 1.14
sys/arch/hp300/stand/common/netio.c: revision 1.17

Fix inappropriate error messages when nfs_mount() fails.

Noticed by Chris Hanson and his HP332 and confirmed on my HP425e.

Also bump revisions to denote visible changes.
Worth to pull up to netbsd-9.
 1.14.26.1 02-Aug-2025  perseant Sync with HEAD
 1.6 09-Feb-2002  lukem use ${INSTALL_FILE} as appropriate
 1.5 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.4 08-Nov-2001  gmcgarry branches: 1.4.2;
Make install observe ${INSTPRIV}
 1.3 23-Sep-2000  simonb branches: 1.3.4; 1.3.6;
Use ${COPY} instead of -c for ${INSTALL} commands.
 1.2 13-Feb-1999  lukem branches: 1.2.8;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.2.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.3.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.4.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.2.1 08-Nov-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:24:47 +0000
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 14-Jun-2005  dsl Change to use installboot - now it is being built for hp300.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13 24-Feb-2024  christos avoid stringop truncation, fix copyright string to prevent assembler warnings.
 1.12 20-Feb-2024  christos add missing chunk for repro-build. fix gcc warnings.
 1.11 11-Dec-2005  christos branches: 1.11.196;
merge ktrace-lwp.
 1.10 28-Nov-2004  jmc Convert mkboot into a full cross tool. Last hurdle for hp300 to building on
non NetBSD/bsd hosts.
 1.9 23-Oct-2002  lukem branches: 1.9.6; 1.9.10;
this is a HOSTPROG; no need to set LDSTATIC=-static
 1.8 27-Aug-2002  lukem arch/*/stand stuff should be LDSTATIC=-static and not LDSTATIC?=-static.
It doesn't make sense to have standalone stuff dynamically linked just
because an end-user uses LDSTATIC="".
 1.7 12-Dec-2001  tv branches: 1.7.8;
MKfoo=no -> NOfoo
 1.6 27-May-2001  gmcgarry branches: 1.6.2; 1.6.8;
- remove dependency on libsa by mkboot since it is a host tool.
- adjust for endianness of host.

Cross-compiling of ELF bootblocks now works.
 1.5 02-Jan-2001  simonb branches: 1.5.2;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.4 13-Feb-1999  lukem branches: 1.4.2; 1.4.8;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 02-Mar-1998  cgd allow LDSTATIC definition to be overridden by bsd.own.mk/mk.conf
 1.2 14-May-1997  thorpej Link this program statically.
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.4.8.1 05-Jan-2001  bouyer Sync with HEAD
 1.4.2.1 25-Sep-2000  he Apply patch (requested by he):
Fix build problem during ``make release'', caused by missing
just-cleaned executable in the release phase.
 1.5.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.8.4 11-Nov-2002  nathanw Catch up to -current
 1.6.8.3 27-Aug-2002  nathanw Catch up to -current.
 1.6.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.8.1 27-May-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:24:48 +0000
 1.6.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.6.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.8.1 30-Aug-2002  gehenna catch up with -current.
 1.9.10.1 02-Apr-2005  he Pull up revision 1.10 (requested by jmc in ticket #1025):
Convert mkboot into a full cross tool. Last hurdle for hp300 to
building on non NetBSD/bsd hosts.
 1.9.6.1 29-Nov-2004  skrll Sync with HEAD.
 1.11.196.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.21 05-Apr-2025  tsutsui Cleanup hp300 LIF bootblock definitions.

- move LIF value definitions from MD mkboot to MI <sys/bootblock.h>
to share them between mkboot and MI installboot(8)
- rename variables and use proper macros for readability
- misc KNF
 1.20 11-May-2024  tsutsui branches: 1.20.2;
Use MI <sys/bootblock.h> to refer LIF filesystem structures.

This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).
 1.19 07-May-2024  tsutsui Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.
Also rename several variables and add comments for readability.

The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/

The same uboot.lif binaries are generated.
 1.18 06-May-2024  tsutsui Misc cosmetic changes for mostly readability.

- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.
 1.17 05-May-2024  tsutsui Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.
 1.16 03-May-2024  christos Fix build as a tool (Jan-Benedict Glaw)
 1.15 24-Feb-2024  christos avoid stringop truncation, fix copyright string to prevent assembler warnings.
 1.14 20-Feb-2024  christos add missing chunk for repro-build. fix gcc warnings.
 1.13 09-Feb-2024  christos fix usage string, improve error handling.
 1.12 08-Feb-2024  christos PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
 1.11 11-Oct-2014  dholland branches: 1.11.50;
PR 49245: Fix broken RCSID (Kamil Rytarowski)
 1.10 18-Jun-2006  gdamore branches: 1.10.106;
Fix to make this cross compile on Solaris. (Don't include sys/endian.h
if HAVE_NBTOOL_CONFIG_H is defined.)
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.8; 1.9.14; 1.9.16;
merge ktrace-lwp.
 1.8 20-Feb-2005  tsutsui branches: 1.8.4;
Use ANSI function decls.
 1.7 28-Nov-2004  jmc branches: 1.7.4; 1.7.6;
Convert mkboot into a full cross tool. Last hurdle for hp300 to building on
non NetBSD/bsd hosts.
 1.6 13-Nov-2003  tsutsui branches: 1.6.4;
Don't use htobe32() for int16_t values.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 05-Mar-2002  simonb branches: 1.4.14;
Indent by tab and not two spaces.
 1.3 27-May-2001  gmcgarry branches: 1.3.2; 1.3.8;
- remove dependency on libsa by mkboot since it is a host tool.
- adjust for endianness of host.

Cross-compiling of ELF bootblocks now works.
 1.2 02-Jan-2001  simonb branches: 1.2.2;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.1 04-Feb-1997  thorpej branches: 1.1.26;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.26.1 05-Jan-2001  bouyer Sync with HEAD
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.8.1 27-May-2001  nathanw file mkboot.c was added on branch nathanw_sa on 2002-04-01 07:40:00 +0000
 1.3.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.4.14.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.14.4 29-Nov-2004  skrll Sync with HEAD.
 1.4.14.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.14.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.14.1 03-Aug-2004  skrll Sync with HEAD
 1.6.4.1 02-Apr-2005  he Pull up revision 1.7 (requested by jmc in ticket #1025):
Convert mkboot into a full cross tool. Last hurdle for hp300 to
building on non NetBSD/bsd hosts.
 1.7.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.8.4.1 21-Jun-2006  yamt sync with head.
 1.9.16.1 18-Jun-2006  gdamore Fix to make this cross compile on Solaris. (Don't include sys/endian.h
if HAVE_NBTOOL_CONFIG_H is defined.)
 1.9.14.1 19-Jun-2006  chap Sync with head.
 1.9.8.1 26-Jun-2006  yamt sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.106.1 03-Dec-2017  jdolecek update from HEAD
 1.11.50.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.20.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 11-May-2024  tsutsui Use MI <sys/bootblock.h> to refer LIF filesystem structures.

This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).
 1.6 07-May-2024  tsutsui Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.
Also rename several variables and add comments for readability.

The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/

The same uboot.lif binaries are generated.
 1.5 08-Feb-2011  rmind branches: 1.5.86;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106; 1.4.108;
merge ktrace-lwp.
 1.3 13-Nov-2003  tsutsui Use int16_t and int32_t rather than short and int.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 04-Feb-1997  thorpej branches: 1.1.60;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.60.1 03-Aug-2004  skrll Sync with HEAD
 1.4.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 05-Mar-2011  rmind sync with head
 1.5.86.1 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.13 19-May-2024  tsutsui Enable SUPPORT_CD on uboot.
 1.12 07-May-2024  tsutsui Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
 1.11 29-Apr-2024  tsutsui Use LINKS to create hard links to generate proper METALOG files.

Also use the default ${PROG} variable and "install" target.

Fixes PR port-hp300/58211.
Should be pulled up to netbsd-10 and netbsd-9.
 1.10 11-Dec-2022  tsutsui branches: 1.10.2;
Enable UFS2 support.

Tested on 425t with HPDisk emulating 7958B using NetBSD 9.3 UFS2 image.
 1.9 23-Sep-2019  christos Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)
 1.8 03-Jan-2003  lukem branches: 1.8.194; 1.8.198;
Install release files under "${RELEASEDIR}/${MACHINE}/..." instead of
"${RELEASEDIR}/...".

${RELEASEDIR} is never cleaned , and ${RELEASEDIR}/${MACHINE} is only
cleaned if UPDATE is not defined.
 1.7 09-Feb-2002  lukem use ${INSTALL_FILE} as appropriate
 1.6 14-Dec-2001  gmcgarry include Makefile.buildboot before testing for RELEASEDIR
 1.5 08-Nov-2001  gmcgarry branches: 1.5.2;
Make install observe ${INSTPRIV}
 1.4 23-Sep-2000  simonb branches: 1.4.4; 1.4.6;
Use ${COPY} instead of -c for ${INSTALL} commands.
 1.3 31-May-2000  he Add handling of "make release".
 1.2 14-Dec-1999  thorpej branches: 1.2.2;
Make it possible to strip this down a little more.
 1.1 04-Feb-1997  thorpej branches: 1.1.20; 1.1.26; 1.1.32;
Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.1.32.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.26.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.20.1 13-Jul-2000  he Pull up revision 1.3 (requested by he):
Enhance the ``make release'' process:
o Build and install the distrib and boot bits
 1.2.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.4.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.4 07-Jan-2003  thorpej Sync with HEAD.
 1.5.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.5.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.2.1 08-Nov-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:24:48 +0000
 1.8.198.1 11-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #1838):

sys/arch/hp300/stand/uboot/Makefile: revision 1.11
sys/arch/hp300/stand/inst/Makefile: revision 1.11

Use LINKS to create hard links to generate proper METALOG files.

Also use the default ${PROG} variable and "install" target.

Fixes PR port-hp300/58211.
 1.8.194.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.10.2.2 22-Jun-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #722):

sys/fs/cd9660/cd9660_util.c: revision 1.16
sys/arch/hp300/stand/common/clock.c: revision 1.14
sys/arch/hp300/stand/common/scsireg.h: revision 1.5
sys/arch/hp300/stand/common/scsireg.h: revision 1.6
sys/arch/hp300/stand/Makefile.buildboot: revision 1.38
sys/arch/hp300/include/bus.h: revision 1.23
sys/arch/hp300/stand/Makefile.buildboot: revision 1.39
sys/arch/hp300/stand/common/sd.c: revision 1.12
sys/arch/hp300/stand/common/prf.c: revision 1.6
sys/arch/hp300/stand/common/sd.c: revision 1.13
usr.sbin/installboot/installboot.8: revision 1.106
usr.sbin/installboot/Makefile: revision 1.59
sys/arch/hp300/stand/common/devopen.c: revision 1.14
usr.sbin/installboot/installboot.8: revision 1.107
sys/arch/hp300/stand/common/ite_dumb.c: revision 1.2
sys/arch/hp300/stand/common/devopen.c: revision 1.15
usr.sbin/installboot/installboot.8: revision 1.108
sys/fs/cd9660/cd9660_extern.h: revision 1.29
usr.sbin/installboot/installboot.8: revision 1.109
tools/Makefile.nbincludes: revision 1.11 (patch)
sys/arch/hp300/dev/rboxreg.h: revision 1.3
sys/arch/hp300/stand/common/scsivar.h: revision 1.5
sys/arch/hp300/dev/dnkbd.c: revision 1.14
sys/arch/hp300/hp300/trap.c: revision 1.156
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.12
sys/arch/hp300/dev/frodoreg.h: revision 1.6
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.13
sys/arch/hp300/stand/common/ite_sti.c: revision 1.2
sys/arch/hp300/stand/common/hil.c: revision 1.15
usr.sbin/installboot/arch/hp300.c: revision 1.18
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.14
sys/arch/hp300/dev/rbox.c: revision 1.4
usr.sbin/installboot/arch/hp300.c: revision 1.19
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.15
sys/sys/bootblock.h: revision 1.59
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.16
usr.sbin/installboot/installboot.h: revision 1.44
sys/arch/hp300/stand/mkboot/volhdr.h: file removal
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.17
sys/arch/hp300/dev/hpib.c: revision 1.45
usr.sbin/installboot/installboot.h: revision 1.45
usr.sbin/installboot/cd9660.c: revision 1.1
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.18
sys/arch/hp300/dev/topcatreg.h: revision 1.3
usr.sbin/installboot/cd9660.c: revision 1.2
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.19
sys/arch/hp300/stand/inst/inst.c: revision 1.25
sys/arch/hp300/stand/uboot/Makefile: revision 1.12
sys/arch/hp300/dev/dvbox.c: revision 1.4
sys/arch/hp300/dev/dma.c: revision 1.45
sys/arch/hp300/stand/uboot/Makefile: revision 1.13
sys/arch/hp300/stand/common/rd.c: revision 1.16
sys/arch/hp300/stand/inst/Makefile: revision 1.12
distrib/hp300/cdroms/installcd/Makefile: revision 1.4
sys/arch/hp300/stand/mkboot/volhdr.h: revision 1.6
sys/arch/hp300/stand/common/machdep.c: revision 1.16
usr.sbin/installboot/fstypes.c: revision 1.14
sys/arch/hp300/hp300/machdep.c: revision 1.238
sys/arch/hp300/include/cpu.h: revision 1.73
sys/arch/hp300/dev/diofbreg.h: revision 1.4
sys/arch/hp300/stand/common/scsi.c: revision 1.12
sys/arch/hp300/stand/common/netio.c: revision 1.19
sys/arch/hp300/stand/common/scsi.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.22
sys/arch/hp300/stand/mkboot/mkboot.c: revision 1.20
sys/arch/hp300/stand/common/conf.h: revision 1.4
sys/arch/hp300/hp300/autoconf.c: revision 1.111
sys/arch/hp300/stand/common/conf.c: revision 1.15
sys/arch/hp300/stand/mkboot/Makefile: revision 1.12
sys/arch/hp300/stand/mkboot/Makefile: revision 1.13
sys/arch/hp300/hp300/autoconf.c: revision 1.114
sys/arch/hp300/dev/dcmreg.h: revision 1.11
sys/arch/hp300/dev/diofbvar.h: revision 1.4
sys/arch/hp300/dev/dcm.c: revision 1.91
sys/fs/cd9660/cd9660_util.c: revision 1.15
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.2

TAB/space cleanup.

installboot(8): formatting improvements

Use Ar foo instead of <foo>; this is mdoc.

Other formatting tweaks.
installboot(8): fix up markup

Don't overuse .Sy - when everything is highlighted, nothing is. Use
.Ic for options &c to get correct PostScript output (both are bold in
plain text).

Use Aq Ar inside .Pa, as both Pa and Ar are rendered as underscored
text in plain text output, and the distinction is lost.

Don't set examples in bold, but give them .Pp space around - they are
much easier to read this way.

Use consistent -width in FILES.
document how to use installboot on netbsd/vax.

PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build
fix usage string, improve error handling.
add missing chunk for repro-build. fix gcc warnings.
avoid stringop truncation, fix copyright string to prevent assembler warnings.

Fix build as a tool (Jan-Benedict Glaw)

Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.

This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.

Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.

Rename ${PROGAOUT} -> ${PROGELF} to reflect reality.
Use proper signedness for the LIF file system data structures.

Ancient 4.3BSD used short and int for location, file size, file type,
and addresses etc. but all of them should be unsigned.

Also rename several variables and add comments for readability.
The LIF file system info can be found in "The HPDir Project" page:
https://www.hp9845.net/9845/projects/hpdir/
The same uboot.lif binaries are generated.

Add a preliminary CD boot support to uboot for preparation of PR/54455.
Briefly tested on mame, but not enalbed yet.

Recognize SCSI CD-ROM devices as a booted device properly.

Necessary for PR port-hp300/54455, to boot an md root root RAMDISK

kernel from CD-ROM without "WARNING: can't find match for bootdev:"
prompt.

Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html

Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.

Use MI <sys/bootblock.h> to refer LIF filesystem structures.
This should have been done when LIF definitions were initially added
to <sys/bootblock.h> for MI installboot(8).

Enable SUPPORT_CD on uboot.

Make cd9660_util.c usable in userland tools like installboot(8).

This was partially done for src/distrib/cdrom/macppc_installboot,
but more strict prototypes are necessary for native binary builds.

Install cd9660 related system headers for tools installboot(8) builds.

Reorder function prototypes per source files.

Add cd9660 support to search a bootloader file in the target file system.

Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.

Put a RAMDISK kernel and SYS_UBOOT into hp300 installcd to make it bootable.

This should finally close PR/54455.

Fix tools build errors on Cygwin.

Appease warnings on building tools/installboot on Cygwin.
 1.10.2.1 11-May-2024  martin Pull up following revision(s) (requested by tsutsui in ticket #684):

sys/arch/hp300/stand/uboot/Makefile: revision 1.11
sys/arch/hp300/stand/inst/Makefile: revision 1.11

Use LINKS to create hard links to generate proper METALOG files.

Also use the default ${PROG} variable and "install" target.

Fixes PR port-hp300/58211.
 1.18 11-Dec-2022  tsutsui Cleanup extern declarations.
 1.17 11-Jun-2016  dholland Change "tgets_s" back to "tgets". We obviously want to keep the bounds
argument, but there's no need to mess with the function name.
 1.16 05-Jun-2016  christos get rid of gets/tgets
 1.15 16-Jul-2008  tsutsui branches: 1.15.38; 1.15.58;
Change boot messages to replace build date and maker with kernrev.
 1.14 24-Dec-2005  perry branches: 1.14.74; 1.14.78; 1.14.80; 1.14.82; 1.14.84;
bare asm -> __asm
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 20-Feb-2005  tsutsui branches: 1.12.4;
Use ANSI function decls.
 1.11 14-Nov-2003  tsutsui branches: 1.11.8; 1.11.10;
Misc cleanup:
- KNF
- WARNSfy
- remove __P()
- remove register declarations
- const'ify some variables
- make some local functions/variables static
- bcopy -> memcpy
- bcmp -> memcmp
- bzero -> memset
- space/TAB fix
etc.
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 16-Mar-2002  gmcgarry branches: 1.9.12;
Move exec_hp300() out of uboot.c into its own file so that it can
be used by SYS_INST. SYS_INST can now boot ELF kernels inside the
miniroot.
 1.8 09-Oct-2001  tsutsui branches: 1.8.4;
Include <machine/bootinfo.h>
 1.7 01-Jul-2001  gmcgarry branches: 1.7.2; 1.7.4;
Sort boot options. Add -c for userconf.
 1.6 01-Jul-2001  gmcgarry Create an empty bootinfo structure.
 1.5 02-Jan-2001  simonb Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.4 24-Sep-2000  jdolecek add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.3 27-Apr-1997  thorpej branches: 1.3.22;
CPU -> SPU
 1.2 04-Feb-1997  thorpej Add the ".gz" names of the kernels to the kernel names list. New
boot order is:

netbsd -> netbsd.gz -> netbsd.bak -> netbsd.bak.gz ->
netbsd.old -> netbsd.old.gz -> onetbsd -> onetbsd.gz
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.3.22.2 05-Jan-2001  bouyer Sync with HEAD
 1.3.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.4.1 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.7.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.4.1 09-Oct-2001  nathanw file uboot.c was added on branch nathanw_sa on 2002-04-01 07:40:01 +0000
 1.9.12.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.12.1 03-Aug-2004  skrll Sync with HEAD
 1.11.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.11.8.1 29-Apr-2005  kent sync with -current
 1.12.4.1 21-Jun-2006  yamt sync with head.
 1.14.84.1 19-Oct-2008  haad Sync with HEAD.
 1.14.82.1 18-Jul-2008  simonb Sync with head.
 1.14.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.14.78.1 04-May-2009  yamt sync with head.
 1.14.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.15.58.1 09-Jul-2016  skrll Sync with HEAD
 1.15.38.1 03-Dec-2017  jdolecek update from HEAD
 1.22 28-May-2025  tsutsui Bump bootloader versions to denote recent netboot and 362/382 sti changes.
 1.21 28-Apr-2020  tsutsui branches: 1.21.26;
Fix inappropriate error messages when nfs_mount() fails.

Noticed by Chris Hanson and his HP330 and confirmed on my HP425e.
Also bump revisions to denote visible changes.
Worth to pull up to netbsd-9.
 1.20 17-Jan-2016  tsutsui branches: 1.20.22;
Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
Tested on HP9000/382.
 1.19 26-Apr-2014  tsutsui branches: 1.19.4;
Bump versions to denote recent 425e related changes.
 1.18 12-Feb-2011  tsutsui branches: 1.18.4; 1.18.10; 1.18.14; 1.18.18; 1.18.28;
Bump version for 362 and 382 framebuffer support.
 1.17 10-Feb-2011  tsutsui Bump version to denote standalone ITE driver reorganization
pulled from OpenBSD.
 1.16 16-Jul-2008  tsutsui branches: 1.16.16; 1.16.22; 1.16.24;
Change boot messages to replace build date and maker with kernrev.
 1.15 20-Jul-2006  tsutsui branches: 1.15.58; 1.15.62; 1.15.64; 1.15.66; 1.15.68;
Identify models HP362 and HP382. From OpenBSD, tested on my HP382.

Note now options HP362 and options HP382 are required for these models
in your kernel config file.
 1.14 14-Dec-2001  gmcgarry branches: 1.14.32; 1.14.46; 1.14.50;
Bump version: Default to BOOTP network boot
 1.13 09-Nov-2001  scw branches: 1.13.2;
Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.12 02-Aug-2001  bjh21 branches: 1.12.4;
Bump version numbers of all bootloaders that use loadfile/ELF, to account for
my changes to symbol loading. I should probably have done this at the time,
but it's better late than never.
 1.11 02-Jan-2001  simonb branches: 1.11.4;
Convert both bootblocks and mkboot to use libsa's loadfile(), and make
both ELF aware.
 1.10 24-Sep-2000  jdolecek add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.9 12-May-1997  thorpej branches: 1.9.22;
Bump version: Added APCI console support
 1.8 27-Apr-1997  thorpej Bump version: Better SPU detection code
 1.7 10-Mar-1997  thorpej Bump version - we compute the kernel load address differently.
 1.6 04-Feb-1997  thorpej branches: 1.6.4;
Bump version: Add support for booting gzip'd kernels
 1.5 04-Feb-1997  thorpej Bump version: Reorganization of boot block code
 1.4 04-Feb-1997  thorpej Replay history: Added support for HP-IB cartridge tapes
 1.3 04-Feb-1997  thorpej Reply history: Merged network and disk boot programs
 1.2 04-Feb-1997  thorpej Replay history: Added support for network booting
 1.1 04-Feb-1997  thorpej Complete and total reorganization of the hp300 boot code, modeled
closely after the build process used by NetBSD/alpha's boot code.
 1.6.4.1 11-Mar-1997  is merge in changes from Trunk.
 1.9.22.2 05-Jan-2001  bouyer Sync with HEAD
 1.9.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.4.1 03-Aug-2001  lukem update to -current
 1.12.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.13.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.13.2.1 09-Nov-2001  nathanw file version was added on branch nathanw_sa on 2002-01-08 00:24:48 +0000
 1.14.50.1 11-Aug-2006  yamt sync with head
 1.14.46.1 09-Sep-2006  rpaulo sync with head
 1.14.32.1 30-Dec-2006  yamt sync with head.
 1.15.68.1 19-Oct-2008  haad Sync with HEAD.
 1.15.66.1 18-Jul-2008  simonb Sync with head.
 1.15.64.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.15.62.1 04-May-2009  yamt sync with head.
 1.15.58.1 28-Sep-2008  mjf Sync with HEAD.
 1.16.24.1 17-Feb-2011  bouyer Sync with HEAD
 1.16.22.1 06-Jun-2011  jruoho Sync with HEAD.
 1.16.16.1 05-Mar-2011  rmind sync with head
 1.18.28.1 10-Aug-2014  tls Rebase.
 1.18.18.1 18-May-2014  rmind sync with head
 1.18.14.2 03-Dec-2017  jdolecek update from HEAD
 1.18.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.10.1 21-May-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/hp300/conf/files.hp300: revision 1.88
sys/arch/hp300/include/autoconf.h: revision 1.13
sys/dev/ic/sti.c: revision 1.17
sys/arch/hp300/dev/frodo.c: revision 1.31
sys/arch/hp300/conf/GENERIC: revision 1.173
sys/arch/hp300/hp300/machdep.c: revision 1.229
sys/arch/hp300/dev/frodo.c: revision 1.32
sys/arch/hp300/hp300/autoconf.c: revision 1.102
sys/arch/hp300/dev/frodoreg.h: revision 1.5
sys/arch/hp300/stand/common/ite_sti.c: revision 1.1
sys/arch/hp300/stand/common/itevar.h: revision 1.16
sys/arch/hp300/hp300/autoconf.c: revision 1.105
sys/arch/hp300/dev/sti_sgcvar.h: revision 1.1
sys/arch/hp300/stand/common/apci.c: revision 1.12
sys/arch/hp300/stand/common/apci.c: revision 1.13
sys/arch/hp300/dev/dnkbd.c: revision 1.6
sys/arch/hp300/dev/dnkbd.c: revision 1.7
sys/arch/hp300/stand/inst/version: revision 1.12
sys/arch/hp300/dev/com_frodo.c: revision 1.9
sys/arch/hp300/stand/common/ite.c: revision 1.17
sys/arch/hp300/conf/GENERIC: revision 1.181
sys/arch/hp300/dev/sti_sgc.c: revision 1.1
sys/arch/hp300/stand/common/dnkbd.c: revision 1.13
sys/arch/hp300/dev/sti_sgc.c: revision 1.2
sys/dev/ic/stivar.h: revision 1.8
sys/arch/hp300/dev/rtc.c: revision 1.21
sys/arch/hp300/conf/INSTALL: revision 1.56
sys/arch/hp300/conf/INSTALL: revision 1.58
sys/arch/hp300/stand/uboot/version: revision 1.19
sys/arch/hp300/stand/common/samachdep.h: revision 1.17
sys/arch/hp300/stand/common/clock.c: revision 1.12
sys/arch/hp300/dev/mcclock_frodo.c: revision 1.1
sys/arch/hp300/stand/Makefile.buildboot: revision 1.34
sys/arch/hp300/conf/files.hp300: revision 1.87
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.
I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2. Now bootloader works with serial console
on HP425e (which has only com at frodo).
Thanks to miod@openbsd for providing his 425e.
Add sti(4) at sgc screen console support. From (the late) OpenBSD/hp300.
Tested on HP9000/425e, which was sent from Miod Vallat and
demonstrated at Open Source unConference 2014 Kagawa.
Check the service switch on 425e to select apci serial console.
Taken from OpenBSD/hp300. See the following comment for details:
> * Check the service switch. On the 425e, this is a physical
> * switch, unlike other frodo-based machines, so we can use it
> * as a serial vs internal video selector, since the PROM can not
> * be configured for serial console.
Add proper RealTime Clock support for HP9000/425e.
As the OpenBSD/hp300 page says 425e doesn't have the traditional
RTC at intio (as it also lacks DCA 16550 serial at intio?),
but after a few hour investigation it turns out that
425e uses mc146818 compatible calendar clock in
the Apollo "frodo" utility chip and the frodo chip on
425e actually has the 32kHz OSC and is actually backed up
by the onboard lithium battery.
Tested on HP425e (with mcclock) and HP362 (with old rtc).
Add RTC support for HP9000/425e to bootloader too.
Also put several cleanup:
- make local functions and variables static
- use proper variable types
- some KNF
Note it turns out that extreme slowness of netboot on hp300 is
caused by the too slow access of the traditional RTC chip at intio
(i.e. netboot on 425e is so much faster than others). Oh well.
Add proper consinit(9) support for sti(4) at sgc framebuffer on hp300.
The cnattach functions for sti(4) and service switch check method
for 425e in com_frodo.c are taken from OpenBSD.
The strategy how to choose the console device in hp300_cninit() is
quite diverged from 4.4BSD and OpenBSD so it's tweaked by me.
Also put several changes in sti_sgc.c to reduce diffs from OpenBSD/hp300.
Tested on 425e and 362 (which still uses gendiofb(4), not sti(4)).
XXX: sti(4) requires uvm_km_alloc(9) and uvm_map_protect(9)
to copy and call ROM functions on the executable memory region, so
it can be called before UVM and related initializations are complete.
Probably it's time to consider about MI "deferred consinit()" API
in init_main.c (or elsewhere) for modern complicated VM system...
Also fix the apci device address in dnkbd.c as apci.c rev 1.12:
http://mail-index.netbsd.org/source-changes/2014/04/10/msg053940.html
Finally dnkbd(4) is confirmed working at least on bootloader.
Thanks again to Miod Vallat.
Make the Apollo Domain keyboard actually work.
Tested on HP9000/425e and the keyboard model A1630-82001 R2 (RX-60857-HW)
provided by Miod Vallat. Mouse support needs more work.
Pull random notes on the Apollo Domain keyboard from ancient PR/3528.
Bump versions to denote recent 425e related changes.
Probe mcclock only on 425e to avoid an extra "not configured" message.
Add and enable sti(4) at sgc in install kernels for 425e.
Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)
 1.18.4.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.4.1 19-Mar-2016  skrll Sync with HEAD
 1.20.22.1 01-May-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #880):

sys/arch/hp300/stand/uboot/version: revision 1.21
sys/arch/hp300/stand/inst/version: revision 1.14
sys/arch/hp300/stand/common/netio.c: revision 1.17

Fix inappropriate error messages when nfs_mount() fails.

Noticed by Chris Hanson and his HP332 and confirmed on my HP425e.

Also bump revisions to denote visible changes.
Worth to pull up to netbsd-9.
 1.21.26.1 02-Aug-2025  perseant Sync with HEAD

RSS XML Feed