Home | History | Annotate | only in /src/sys/arch/x68k
History log of /src/sys/arch/x68k
RevisionDateAuthorComments
 1.10 20-Dec-2008  isaki x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
 1.9 25-Oct-2008  apb branches: 1.9.2;
Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.8 06-Jan-2003  lukem branches: 1.8.104; 1.8.108; 1.8.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.7 12-Jun-1998  cgd branches: 1.7.34;
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.6 19-Oct-1997  oki Make this compile new bootblock code.
 1.5 11-Oct-1997  mycroft Use m68k/Makefile.inc.
 1.4 11-Oct-1997  mycroft Nuke NOOBJ.
 1.3 11-Oct-1997  mycroft Update all the tags goo, and use bsd.subdir.mk.
 1.2 07-May-1997  mycroft branches: 1.2.4;
Don't use _SUBDIRUSE outside of bsd.subdir.mk.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.34.1 07-Jan-2003  thorpej Sync with HEAD.
 1.8.114.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.8.108.1 04-May-2009  yamt sync with head.
 1.8.104.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.2 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.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.50;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.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:23:50 +0000
 1.58 27-Oct-2002  isaki Retire it. Maintaining it (= syncing with GENERIC) is worthless
anymore. OK'ed by nsmrtsk.
 1.57 14-Oct-2002  elric Add cgd(4).
 1.56 25-Sep-2002  martti Add one space between "#option" and "<tab>IPFILTER_DEFAULT_BLOCK"
 1.55 20-Sep-2002  martti Added (commented out) IPFILTER_DEFAULT_BLOCK.
 1.54 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.53 11-Aug-2002  isaki Add ScanLogic SL811HS/T USB Host Controller and USB stuff.
 1.52 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.51 25-Apr-2002  atatat branches: 1.51.2; 1.51.4;
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.50 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.49 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.48 14-Jan-2002  isaki Add another address, vector configuration of Nereid ethernet.
 1.47 24-Dec-2001  minoura ELF!!
 1.46 06-Dec-2001  minoura Add ELF support.
 1.45 25-Nov-2001  minoura Sync. with GENERIC plus others.
 1.44 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.43 20-Nov-2001  lukem - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
 1.42 08-Jul-2001  abs branches: 1.42.2; 1.42.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.41 07-Jul-2001  minoura Sync with GENERIC.
 1.40 06-May-2001  hubertf vlan does not belong to group of IPv6 pseudo-devices
 1.39 02-May-2001  minoura Add/enable vs.
 1.38 29-Dec-2000  minoura branches: 1.38.2;
CMACHFLAGS defaults to -m68020-60.
Can be overridden in config files; add examples.
 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 branches: 1.36.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.35 16-Apr-2000  minoura branches: 1.35.2;
Sync w/ GENERIC.
 1.34 05-Feb-2000  minoura Sync.
 1.33 18-Nov-1999  minoura Sync w/ GENERIC (options SOFTDEP).
Add IPv6 options to ALL.
 1.32 29-Jul-1999  augustss branches: 1.32.2; 1.32.8;
It's time to be COMPAT_14.
 1.31 21-May-1999  minoura Sync GENERIC.
 1.30 18-Apr-1999  minoura Add missing par0.
 1.29 24-Mar-1999  mrg branches: 1.29.2;
clean up kernel/config files files for machVM lossage.
 1.28 17-Mar-1999  minoura MACHINE_NONCONTIG -> EXTENDED_MEMORY.
G/c and comment changes.
 1.27 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.26 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.25 23-Dec-1998  itohy Switch x68k port to UVM by default.
Mach VM and even old contig and non-contig codes are still alive.
 1.24 16-Dec-1998  minoura branches: 1.24.2;
Synced with GENERIC.
 1.23 07-Sep-1998  minoura Reorganized the config files based on NetBSD/sparc ones.
Removed unmaintained files.
 1.22 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.21 05-Aug-1998  minoura Switched to MI zs driver.
 1.20 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.19 01-Dec-1997  kleink Add COMPAT_13.
 1.18 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.17 19-Oct-1997  oki branches: 1.17.2;
Support of MK-HA1 Mach-2 SCSI adaptor.
 1.16 15-Oct-1997  thorpej Pulldown from marc-pcmcia branch: minimal changes to change x68k port's
"com" (now "xcom") driver to avoid name collision with the more
heaviliy-used "com" driver.
 1.15 12-Jun-1997  mrg branches: 1.15.4;
remove now obsolete "swap on..." lines.
 1.14 08-May-1997  oki cleanup use of whitespace
 1.13 25-Feb-1997  oki fixed typo
 1.12 18-Feb-1997  mrg comment PFIL_HOOKS as it is redundant (as an option) when used with ipfilter.
 1.11 04-Feb-1997  oki branches: 1.11.4;
Added ipfilter device
 1.10 31-Jan-1997  thorpej Update for new file system and root spec grammar.
 1.9 15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.8 13-Jan-1997  oki branches: 1.8.2;
first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.7 28-Dec-1996  pk rename: ramdisk => md
 1.6 27-Oct-1996  oki add EXEC_SCRIPT and EXEC_AOUT
 1.5 16-Sep-1996  oki added ccd(blk)/ch/uk device
 1.4 10-Sep-1996  thorpej Add COMPAT_M68K4K.
 1.3 26-Aug-1996  mrg add COMPAT_12.
 1.2 20-May-1996  oki Add 'rd' ram-disk pseudo-device.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.8.2.2 18-Jan-1997  thorpej Update from trunk.
 1.8.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.11.4.1 12-Mar-1997  is Merge in changes from Trunk
 1.15.4.1 15-Oct-1997  thorpej Minimal changes to rename the x68k port's "com" driver to "xcom", to
avoid a namespace collision with the more heavily-used "com" driver,
which needs to be declared in sys/conf/files.
 1.17.2.1 13-Oct-1998  cgd work around broken extended memory detection, via patch. (minoura)
 1.24.2.8 14-Mar-1999  minoura Customize kernel message attributes.
(The code was commited in the last commit...)
 1.24.2.7 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.24.2.6 13-Feb-1999  minoura spc at intio.
 1.24.2.5 02-Feb-1999  minoura Add opm.
fdc at intio.
 1.24.2.4 31-Jan-1999  minoura Sync.
 1.24.2.3 30-Jan-1999  minoura Added DMAC driver.
 1.24.2.2 27-Dec-1998  minoura Xellent30 driver.
 1.24.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.29.2.3 21-Jun-1999  perry revert; 1.29.2.2->1.29.2.1 (minoura): FPU_EMULATE now works
 1.29.2.2 19-Apr-1999  cjs branches: 1.29.2.2.2; 1.29.2.2.4;
FPU_EMULATE is unsupported in 1.4, because it's broken and there's no
time to test fixes. Per MINOURA Makoto <minoura@netbsd.org>.
 1.29.2.1 19-Apr-1999  cjs Pull up to HEAD v1.30 per MINOURA Makoto <minoura@netbsd.org>.
 1.29.2.2.4.1 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.29.2.2.2.2 02-Aug-1999  thorpej Update from trunk.
 1.29.2.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.32.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.32.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.32.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.36.2.2 06-Jan-2002  he Pull up revision 1.45 (via patch, requested by isaki):
Support the Ethernet part of Nereid (ether/USB/memory board).
 1.36.2.1 25-Jan-2001  jhawk Pull up revision 1.38 (requested by minoura):
CMACHFLAGS now defaults to -m68020-60.
 1.38.2.1 21-Jun-2001  nathanw Catch up to -current.
 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 13-Aug-2002  nathanw Catch up to -current.
 1.42.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.42.8.4 17-Apr-2002  nathanw Catch up to -current.
 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 08-Jul-2001  nathanw file ALL was added on branch nathanw_sa on 2002-01-08 00:28:35 +0000
 1.42.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.42.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.42.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.42.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.42.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.51.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.51.4.1 01-Aug-2002  lukem Pull up revision 1.52 (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.51.2.2 31-Aug-2002  gehenna catch up with -current.
 1.51.2.1 15-Jul-2002  gehenna catch up with -current.
 1.10 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.9 05-Aug-1998  minoura Switched to MI zs driver.
 1.8 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.7 01-Dec-1997  kleink Add COMPAT_13.
 1.6 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.5 08-May-1997  oki cleanup use of whitespace
 1.4 31-Jan-1997  thorpej Update for new file system and root spec grammar.
 1.3 15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.2 26-Aug-1996  mrg branches: 1.2.2;
add COMPAT_12.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.2 18-Jan-1997  thorpej Update from trunk.
 1.2.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.210 05-Oct-2024  isaki x68k: Add SIXEL graphics sequence support.
- The palette definition is fixed to the same color as the text (currently,
it's RGB 8 colors). Any palette definition sent will be ignored.
- Aspect ratio and bg color mode is not supported (yet).
- An OR mode is supported. This is proposed by Y.Sugahara in this
implementation and then the mlterm also supports it. It's an advantageous
way for the multi plane color VRAM.
- ITE_SIXEL kernel option is added and is disabled by default for now.

It was first written by me in 2014 and has been demonstrated in Open Source
Conference Hiroshima every year since then. In this year, it's also
demonstrated on real X68030 at Japan NetBSD Users Group booth in OSC 2024
Hiroshima, last week.
https://x.com/OSC_official/status/1841381234804498608
It's useful for showing and explaining about the possibility of NetBSD and
old machines for younger (than X68030) engineers or students.
 1.209 07-Jan-2024  isaki branches: 1.209.2;
TAB/space/indent cleanup.
 1.208 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.207 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.206 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.205 11-Jun-2022  tsutsui Specify -fno-unwind-tables to shrink binaries.
 1.204 29-Jun-2021  nia Remove uscanner(4) driver

This exists for compatibility with a Linux interface which was apparently
deprecated in Linux 2.6. There are various mailing list threads going
back to 2004 where the usefulness of this driver is discussed, but
the conclusion is that scanner software has all moved to using ugen(4)
instead, and enabling this driver will not help you scan things.
 1.203 21-Jan-2021  nia branches: 1.203.4;
add a commented out compat_ossaudio wherever there's compat_linux

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

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.201 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.200 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.199 16-May-2020  maya Remove uyap, USB YAP phone firmware loader.

And the associated ezload EZ-USB code, which is only used by uyap.
It could theoretically be used by other drivers, but none of them are
in tree.

I suspect that this device isn't in use, as phone technology has improved
a lot since 2001 when uyap(4) was added to the tree.

Proposed with no objections on netbsd-users on 13 April 2020
 1.198 13-Apr-2020  jdolecek drop note about wd not being supported for umass
 1.197 29-Jan-2020  maya branches: 1.197.4;
remove urio(4), a driver for the Rio500 MP3 player.

At this point it is highly unlikely this 1999 device still has users,
but it still comes up in the context of maxv's USB-fuzzing (and any device
could pretend to be a urio(4)), so it's best to get rid of it.

Renamed all major entries to obsolete, as was done in previous removals.

This still requires an update to sanitizers, but they're located in
"external", perhaps it should be first committed upstream?

Proposed on tech-kern a month ago.
 1.196 26-Apr-2019  sevan branches: 1.196.4;
Use veriexec.config to reduce duplication
 1.195 13-Apr-2019  isaki Add drvctl to kernel which has audio device.
audiocfg(1) requires drvctl(4).
 1.194 14-Mar-2019  thorpej G/C "MAPPECOPY". It is the deadest of wood, and never actually worked in
NetBSD.
 1.193 06-Feb-2019  rin Add ure(4) to kernel config files. Also add PHY drivers where necessary.
 1.192 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.191 23-Oct-2018  jdolecek remove the 'wd* at umass?' for the non-standardized and rare (extinct?)
In-System Design ATA protocol over Bulk-Only devices from most kernels,
leave only in i386/amd64 ALL; it's unmaintained and likely currently broken,
lack of test hardware makes it impossible to support
 1.190 25-Aug-2018  rin Add (commented out) mue(4) to where appropriate.
Also add MII/PHY drivers for USB NICs if missing.
 1.189 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.188 05-Feb-2018  maxv branches: 1.188.2; 1.188.4;
Nuke DIRECTED_BROADCAST, it is not documented and not enabled anywhere. It
probably wouldn't have built correctly anyway, since there is no associated
defflag.

These ten lines of code in ip_input.c already look a lot better.
 1.187 23-Jan-2018  sevan 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.186 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.185 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.184 29-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 3.
 1.183 13-Dec-2016  christos branches: 1.183.8;
wildcard speaker attachments, now that we can handle many of them.
 1.182 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.181 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.180 08-Aug-2015  maxv branches: 1.180.2;
Remove KMEMSTATS.
 1.179 16-Nov-2014  manu branches: 1.179.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.178 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.177 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.176 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.175 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.174 18-Jul-2014  tsutsui branches: 1.174.2;
Enable NULLFS and MODULAR, and disable UMAPFS, accf_data and accf_http.

No particular comments on port-x68k@.
 1.173 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
2898020 54292 122728 3075040 2eebe0 netbsd

with "-O2 -fno-reorder-blocks":
text data bss dec hex filename
2589888 54292 122728 2766908 2a383c netbsd
 1.172 24-Mar-2014  szptvlfn branches: 1.172.2;
fix manual section numbering of sysctl.
thanks wiz@
 1.171 05-Mar-2014  isaki Delete the word "buggy" in the comment of NULLFS.
This has been added in 1999, but it's not a buggy now.
Adviced from tsutsui@, msaitoh@.
 1.170 30-Jun-2013  rmind G/C PFIL_HOOKS from the kernel configs.
 1.169 05-Jun-2013  christos branches: 1.169.2;
remove obsolete networking options
 1.168 27-Apr-2013  christos the bogus number police
 1.167 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.166 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.165 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.164 03-Nov-2012  tsutsui Comment out pseudo-device fss. We already has options FFS_NO_SNAPSHOT.
 1.163 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.162 12-Oct-2012  tsutsui Now we get working netboot loader, so enable options NFS_BOOT_DHCP by default.
 1.161 29-Apr-2012  tsutsui branches: 1.161.2;
Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.160 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.159 18-Dec-2011  dholland branches: 1.159.2;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.158 27-Nov-2011  isaki branches: 1.158.2;
Add powsw(4) for x68k power switch. It substitutes for a part about
power switch handler of pow(4) deleted before.
Benefits than pow(4):
- separate a front switch (= powsw0) and an EXPWON line (= powsw1)
completely. Only powsw0 is enabled in GENERIC by default.
- prevent chattering in some hardware individuals.
thank you for a report and a test: Yasushi Oshima and Y.Sugahara.
 1.157 22-Nov-2011  tls 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.156 19-Nov-2011  isaki Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.155 17-Mar-2011  tsutsui branches: 1.155.4;
umass doesn't take channel.
 1.154 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.153 03-Jan-2011  tsutsui branches: 1.153.2; 1.153.4;
Add (commented out) options MODULAR. Confirmed working on XM6i.
 1.152 03-Jan-2011  tsutsui Enable options DDB. Ok from isaki@
 1.151 23-Nov-2010  hannken Remove unused count from pseudo-device md.
 1.150 29-Apr-2010  chs enable TMPFS in all GENERICs that have MFS enabled.
 1.149 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.148 07-Mar-2010  plunky branches: 1.148.2;
add uhso(4) device where appropriate
- follow the lead of other USB driver declarations wrt commented out
- (cross-)build tested all these kernels
 1.147 05-Dec-2009  pooka branches: 1.147.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.146 24-Jan-2009  mrg add COMPAT_50 to all the configs with COMPAT_40.
 1.145 21-Dec-2008  isaki Make sram(4) a hardware device.
# I wrote this in 2001 :-)
 1.144 20-Dec-2008  isaki Make pow(4) a hardware device.
Now pow(4) uses intio_intr_establish() which is a common interrupt
routine, but not powtrap which is a device specific routine.
 1.143 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

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

Proposed on tech-kern@.
 1.141 10-Aug-2008  tls branches: 1.141.2;
Add accept filters to GENERIC kernels where they exist.
 1.140 31-Jul-2008  simonb Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.139 30-May-2008  tsutsui branches: 1.139.4;
Add options COMPAT_40 to files which have options COMPAT_30.
 1.138 24-Feb-2008  isaki branches: 1.138.2; 1.138.4; 1.138.6;
options<space><tab>
 1.137 31-Dec-2007  ad branches: 1.137.2; 1.137.6;
Remove systrace. Ok core@.
 1.136 04-Nov-2007  xtraeme branches: 1.136.2; 1.136.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.135 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.134 04-Jun-2007  martin branches: 1.134.8; 1.134.10; 1.134.14;
Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.133 14-Mar-2007  drochner branches: 1.133.6;
It doesn't make sense to specify "configuration" and "interface"
locators for uhub because a hub can't have sub-devices.
This might be sanity-checked eventually.
Same for ubt now after the change to device attachment.
 1.132 11-Nov-2006  jmmv branches: 1.132.2; 1.132.4; 1.132.8; 1.132.10; 1.132.12;
Remove tmpfs's experimental status. OK'ed by core@.
 1.131 26-Aug-2006  christos branches: 1.131.2; 1.131.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.130 26-Aug-2006  tsutsui Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.129 14-Aug-2006  skrll s/adpater/adapter/

Prompted by PR/34195
 1.128 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.127 28-Jun-2006  liamjfoy branches: 1.127.2;
Add CARP to GENERIC kernel configs. CARP is not enabled by default.

ok: christos
 1.126 28-Mar-2006  pavel branches: 1.126.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.125 05-Feb-2006  cube branches: 1.125.2; 1.125.4; 1.125.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.124 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.123 02-Feb-2006  reinoud branches: 1.123.2;
Add commented out UDF file-system entry in all GENERIC configurations.
 1.122 09-Dec-2005  elad branches: 1.122.2; 1.122.4;
Add (commented out) Veriexec options and pseudo-device to GENERIC kernels,
and remove the i386 GENERIC_VERIEXEC config.
 1.121 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.120 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.119 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.118 19-Aug-2005  christos 64 bit inode changes.
 1.117 05-Aug-2005  skrll Add (commented out) ucycom to various kernel configs.
 1.116 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.115 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.114 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.113 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.112 25-Jun-2005  rpaulo branches: 1.112.2;
Add file-system PTYFS (commented out) so that people know its existence.

Ok'ed by Christos Zoulas and Hubert Feyrer.
 1.111 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.110 15-Apr-2005  itohy Add ukyopon(4).
 1.109 25-Feb-2005  simonb branches: 1.109.2;
Add COMPAT_20 (and COMPAT_16 in some cases) to kernel config files
that didn't have those options but had other earlier compat options.
 1.108 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.107 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.106 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.105 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.104 18-Jan-2005  chs branches: 1.104.2;
use a new "addr" locator for grf instead of the unit to match the instance
to the hardware. use a new "grfaddr" locator to match ites to their grfs,
instead of requiring that their unit numbers be the same.
 1.103 17-Jan-2005  cube 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.102 10-Nov-2004  christos branches: 1.102.4;
Add COMPAT_BSDPTY to the rest of the config files.
 1.101 23-Oct-2004  augustss s/uax/axe/
 1.100 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.99 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.98 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.97 26-Jun-2004  abs Add (commented out) ALTQ options to all GENERIC-like files
 1.96 22-Jun-2004  itojun have pf and pflog pseudo-device (commented out).
reviewed by matt, perry, christos
 1.95 18-Jun-2004  christos ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM
 1.94 16-Jun-2004  christos Add pseudo-device ptm on all the generic flavored kernels.
 1.93 04-Jan-2004  wiz branches: 1.93.2;
Spell controller with two ls. Inspired by miod@openbsd.
 1.92 22-Sep-2003  cl add COMPAT_15/COMPAT_16
 1.91 22-Aug-2003  itojun add udav*
 1.90 26-Apr-2003  ragge branches: 1.90.2;
Add pseudo-device ksyms.
 1.89 10-Apr-2003  christos Bye Bye UCONSOLE
 1.88 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.87 16-Feb-2003  augustss Add uax(4) (and url(4) in some cases).
 1.86 01-Dec-2002  isaki Add bmd, memory disk driver for Nereid bank memory.
 1.85 22-Nov-2002  wiz Fix typo (responsiness -> responsiveness).
 1.84 18-Oct-2002  junyoung Add NEW_BUFQ_STRATEGY (disabled by default).
 1.83 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.82 06-Oct-2002  provos add SYSTRACE; approved perry.
 1.81 25-Sep-2002  martti Add one space between "#option" and "<tab>IPFILTER_DEFAULT_BLOCK"
 1.80 20-Sep-2002  martti Added (commented out) IPFILTER_DEFAULT_BLOCK.
 1.79 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.78 11-Aug-2002  isaki Add (commented) ScanLogic SL811HS/T USB Host Controller
and USB stuff.
 1.77 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.76 25-Apr-2002  atatat branches: 1.76.2; 1.76.4;
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.75 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.74 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.73 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.72 14-Jan-2002  isaki Add another address, vector configuration of Nereid ethernet.
 1.71 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.70 24-Dec-2001  minoura ELF!!
 1.69 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.68 06-Dec-2001  minoura Add ELF support.
 1.67 25-Nov-2001  minoura se0 is dead.
 1.66 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.65 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.64 20-Nov-2001  lukem - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
 1.63 11-Nov-2001  isaki add Nereid. ne* at intio0
 1.62 01-Sep-2001  atatat branches: 1.62.4; 1.62.6;
Comment out bridge pseudo devices from ports that don't
__HAVE_GENERIC_SOFT_INTERRUPTS. bridge(4) doesn't compile there.
 1.61 01-Sep-2001  atatat Add bridge pseudo devices to GENERIC configs
 1.60 08-Jul-2001  abs branches: 1.60.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.59 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.58 06-May-2001  hubertf vlan does not belong to group of IPv6 pseudo-devices
 1.57 02-May-2001  minoura Add/enable vs.
 1.56 10-Mar-2001  minoura Turn off options JUPITER temporarily.
This may cause problems on some newer accelerators.
We might have to write a more accurate detect code.
 1.55 29-Dec-2000  minoura branches: 1.55.2;
CMACHFLAGS defaults to -m68020-60.
Can be overridden in config files; add examples.
 1.54 19-Dec-2000  bouyer Add pseudo-device vlan
 1.53 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.52 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.51 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.50 27-Jul-2000  mason Moving to a default of 64 PTYs.
 1.49 30-Jun-2000  itojun add PULLDOWN_TEST for all the platforms.
XXX should be moved to somewhere else when stabilized
 1.48 28-Jun-2000  minoura GENERIC should run on any environment.
It required 6MB of memory; disable some options/devices so that
it can run on 4MB machines.
 1.47 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.46 14-Jun-2000  veego branches: 1.46.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.45 19-Apr-2000  itojun branches: 1.45.2;
add stf pseudo interface (commented out due to possible security risks)
 1.44 27-Mar-2000  minoura Move par under intio.
 1.43 29-Feb-2000  simonb Do the "<space><tab>" thing with the RAID_AUTOCONFIG option.
 1.42 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.41 23-Jan-2000  hubertf Add commented out "ident"-command
 1.40 20-Jan-2000  wrstuden Add overlay to kernel configs.
 1.39 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.38 18-Nov-1999  minoura Remove MAPPEDCOPY (somewhat buggy?).
 1.37 15-Nov-1999  fvdl Add commented out option SOFTDEP to all GENERIC kernels.
 1.36 29-Jul-1999  augustss branches: 1.36.2; 1.36.8;
It's time to be COMPAT_14.
 1.35 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.34 21-May-1999  minoura Remove experimental/buggy options.
 1.33 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.32 18-Apr-1999  minoura Add missing par0.
 1.31 31-Mar-1999  minoura branches: 1.31.2;
Enable rnd.
 1.30 24-Mar-1999  mrg clean up kernel/config files files for machVM lossage.
 1.29 17-Mar-1999  minoura MACHINE_NONCONTIG -> EXTENDED_MEMORY.
G/c and comment changes.
 1.28 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.27 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.26 23-Dec-1998  itohy Switch x68k port to UVM by default.
Mach VM and even old contig and non-contig codes are still alive.
 1.25 15-Dec-1998  itohy branches: 1.25.2;
Added options COMPAT_LINUX and EXEC_ELF32 as comments
to GENERIC configuration files.
 1.24 25-Nov-1998  hwr Add (commented out) 'gre' pseudo device line. Feedback is welcome.
Inspired by Klaus Klein.
 1.23 16-Nov-1998  oster Added a (commented out) configuration line for the RAIDframe device driver.
 1.22 07-Sep-1998  minoura Reorganized the config files based on NetBSD/sparc ones.
Removed unmaintained files.
 1.21 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.20 05-Aug-1998  minoura Switched to MI zs driver.
 1.19 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.18 18-Mar-1998  bouyer Add commented out "options FFS_EI"
 1.17 01-Dec-1997  kleink Add COMPAT_13.
 1.16 20-Nov-1997  fair add pseudo-device rnd, commented out
 1.15 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.14 19-Oct-1997  oki branches: 1.14.2;
Add options M68060, mha driver.
 1.13 23-Aug-1997  mjacob add a before tab to SCSIVERBOSE
 1.12 20-Aug-1997  mjacob add commented out reference SCSIVERBOSE option
 1.11 12-Jun-1997  mrg branches: 1.11.4;
remove now obsolete "swap on..." lines.
 1.10 08-May-1997  oki cleanup use of whitespace
 1.9 31-Jan-1997  thorpej Oops! NFSCLIENT -> NFS
 1.8 31-Jan-1997  thorpej Update for new file system and root spec grammar.
 1.7 15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.6 27-Oct-1996  oki branches: 1.6.2;
add EXEC_SCRIPT and EXEC_AOUT
 1.5 10-Sep-1996  thorpej Document COMPAT_M68K4K, but leave it disabled by default.
 1.4 26-Aug-1996  mrg add COMPAT_12.
 1.3 11-Aug-1996  oki fixed kernel couldn't boot from most machines. more generic for x68k.
 1.2 17-Jun-1996  oki fd* is need to boot from floppy
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.4;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.4.3 16-Aug-1996  jtc Pulled up from rev 1.3 by request from oki
 1.1.1.1.4.2 18-Jun-1996  oki Oops, correct edit error in previous commit
 1.1.1.1.4.1 17-Jun-1996  oki from trunk: fd* is need to boot from floppy
 1.6.2.2 18-Jan-1997  thorpej Update from trunk.
 1.6.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.11.4.2 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.2.2 13-Oct-1998  cgd work around broken extended memory detection, via patch. (minoura)
 1.14.2.1 20-Nov-1997  mellon Pull rev 1.16 up from trunk (fair)
 1.25.2.9 14-Mar-1999  minoura Customize kernel message attributes.
(The code was commited in the last commit...)
 1.25.2.8 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.25.2.7 13-Feb-1999  minoura spc at intio.
 1.25.2.6 02-Feb-1999  minoura fdc at intio.
 1.25.2.5 31-Jan-1999  minoura opm at intio.
 1.25.2.4 31-Jan-1999  minoura Sync.
 1.25.2.3 30-Jan-1999  minoura Added DMAC driver.
 1.25.2.2 27-Dec-1998  minoura Xellent30 driver.
 1.25.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.31.2.4 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.31.2.3 21-Jun-1999  perry revert; 1.31.2.2->1.31.2.1 (minoura): FPU_EMULATE now works
 1.31.2.2 19-Apr-1999  cjs branches: 1.31.2.2.2; 1.31.2.2.4;
FPU_EMULATE is unsupported in 1.4, because it's broken and there's no
time to test fixes. Per MINOURA Makoto <minoura@netbsd.org>.
 1.31.2.1 19-Apr-1999  cjs Pull up to HEAD v1.32 per MINOURA Makoto <minoura@netbsd.org>.
 1.31.2.2.4.1 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.31.2.2.2.2 02-Aug-1999  thorpej Update from trunk.
 1.31.2.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.36.8.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.36.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.36.2.3 12-Mar-2001  bouyer Sync with HEAD.
 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.45.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.46.2.9 06-Jan-2002  he Pull up revisions 1.63,1.67 (via patch, requested by isaki):
Support the Ethernet part of Nereid (ether/USB/memory board).
 1.46.2.8 06-May-2001  he Pull up revision 1.58 (requested by hubertf):
Visually separate the vlan(4) device from the IPv6 devices.
 1.46.2.7 01-May-2001  he Pull up revision 1.54 (requested by he):
Add pseudo-device vlan.
Make sure "rnd is EXPERIMENTAL" comment is removed.
 1.46.2.6 13-Mar-2001  he Pull up revision 1.56 (requested by minoura):
Turn off options JUPITER, as it may cause problems on some newer
accelerators.
 1.46.2.5 25-Jan-2001  jhawk Pull up revision 1.55 (requested by minoura):
CMACHFLAGS now defaults to -m68020-60.
 1.46.2.4 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.46.2.3 11-Aug-2000  mason Move to default of 64 PTYs in GENERIC kernel config.
Requested by mason, approved by jhawk.
 1.46.2.2 14-Jul-2000  minoura Pullup rev. 1.48 from the trunk.
Make GENERIC kernel run with 4MB memory.
 1.46.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.55.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.55.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.60.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.60.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.60.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.60.2.3 11-Feb-2002  jdolecek Sync w/ -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.62.6.9 11-Dec-2002  thorpej Sync with HEAD.
 1.62.6.8 11-Nov-2002  nathanw Catch up to -current
 1.62.6.7 18-Oct-2002  nathanw Catch up to -current.
 1.62.6.6 13-Aug-2002  nathanw Catch up to -current.
 1.62.6.5 20-Jun-2002  nathanw Catch up to -current.
 1.62.6.4 17-Apr-2002  nathanw Catch up to -current.
 1.62.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.62.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.62.6.1 01-Sep-2001  nathanw file GENERIC was added on branch nathanw_sa on 2002-01-08 00:28:35 +0000
 1.62.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.76.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.76.4.1 01-Aug-2002  lukem Pull up revision 1.77 (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.76.2.2 31-Aug-2002  gehenna catch up with -current.
 1.76.2.1 15-Jul-2002  gehenna catch up with -current.
 1.90.2.11 11-Dec-2005  christos Sync with head.
 1.90.2.10 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.90.2.9 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.90.2.8 15-Feb-2005  skrll Sync with HEAD.
 1.90.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.90.2.6 24-Jan-2005  skrll Sync with HEAD.
 1.90.2.5 14-Nov-2004  skrll Sync with HEAD.
 1.90.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.90.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.90.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.90.2.1 03-Aug-2004  skrll Sync with HEAD
 1.93.2.3 15-Jul-2004  he branches: 1.93.2.3.2;
Pull up revision 1.99 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.93.2.2 02-Jul-2004  he Pull up revision 1.98 (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.93.2.1 30-Jun-2004  jdc Pull up revision 1.97 (requested by abs in ticket #567).

Add (commented out) ALTQ options to all GENERIC-like files
 1.93.2.3.2.1 21-Jul-2005  riz Pull up revision 1.110 (requested by itohy in ticket #1430):
Add ukyopon(4).
 1.102.4.1 29-Apr-2005  kent sync with -current
 1.104.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.104.2.1 12-Feb-2005  yamt sync with head.
 1.109.2.3 14-Aug-2005  riz Pull up revision 1.114 (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.109.2.2 18-Jul-2005  riz Pull up revision 1.113 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.109.2.1 17-Apr-2005  tron Pull up revision 1.110 (requested by itohy in ticket #160):
Add ukyopon(4).
 1.112.2.6 27-Feb-2008  yamt sync with head.
 1.112.2.5 21-Jan-2008  yamt sync with head
 1.112.2.4 15-Nov-2007  yamt sync with head.
 1.112.2.3 03-Sep-2007  yamt sync with head.
 1.112.2.2 30-Dec-2006  yamt sync with head.
 1.112.2.1 21-Jun-2006  yamt sync with head.
 1.122.4.1 09-Sep-2006  rpaulo sync with head
 1.122.2.1 18-Feb-2006  yamt sync with head.
 1.123.2.1 22-Apr-2006  simonb Sync with head.
 1.125.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.125.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.125.2.3 03-Sep-2006  yamt sync with head.
 1.125.2.2 11-Aug-2006  yamt sync with head
 1.125.2.1 01-Apr-2006  yamt sync with head.
 1.126.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.127.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.127.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.131.4.1 10-Dec-2006  yamt sync with head.
 1.131.2.1 18-Nov-2006  ad Sync with head.
 1.132.12.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.132.10.1 11-Jul-2007  mjf Sync with head.
 1.132.8.3 03-Dec-2007  ad Sync with HEAD.
 1.132.8.2 09-Jun-2007  ad Sync with head.
 1.132.8.1 10-Apr-2007  ad Sync with head.
 1.132.4.1 24-Mar-2007  yamt sync with head.
 1.132.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.133.6.1 26-Jun-2007  garbled Sync with HEAD.
 1.134.14.1 13-Nov-2007  bouyer Sync with HEAD
 1.134.10.3 23-Mar-2008  matt sync with HEAD
 1.134.10.2 09-Jan-2008  matt sync with HEAD
 1.134.10.1 06-Nov-2007  matt sync with HEAD
 1.134.8.1 04-Nov-2007  jmcneill Sync with HEAD.
 1.136.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.136.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.137.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.137.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.137.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.137.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.137.2.1 24-Mar-2008  keiichi sync with head.
 1.138.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.138.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.138.4.3 11-Aug-2010  yamt sync with head.
 1.138.4.2 11-Mar-2010  yamt sync with head
 1.138.4.1 04-May-2009  yamt sync with head.
 1.138.2.1 04-Jun-2008  yamt sync with head
 1.139.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.139.4.1 19-Oct-2008  haad Sync with HEAD.
 1.141.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.141.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.147.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.147.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.148.2.3 21-Apr-2011  rmind sync with head
 1.148.2.2 05-Mar-2011  rmind sync with head
 1.148.2.1 30-May-2010  rmind sync with head
 1.153.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.153.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.155.4.5 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.155.4.4 16-Jan-2013  yamt sync with (a bit old) head
 1.155.4.3 30-Oct-2012  yamt sync with head
 1.155.4.2 23-May-2012  yamt sync with head.
 1.155.4.1 17-Apr-2012  yamt sync with head
 1.158.2.3 29-Apr-2012  mrg sync to latest -current.
 1.158.2.2 11-Mar-2012  mrg sync to latest -current
 1.158.2.1 18-Feb-2012  mrg merge to -current.
 1.159.2.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #647):
sys/arch/x68k/conf/GENERIC: revision 1.162
Now we get working netboot loader, so enable options NFS_BOOT_DHCP by default.
 1.161.2.4 03-Dec-2017  jdolecek update from HEAD
 1.161.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.161.2.2 23-Jun-2013  tls resync from head
 1.161.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.169.2.2 18-May-2014  rmind sync with head
 1.169.2.1 28-Aug-2013  rmind sync with head
 1.172.2.1 10-Aug-2014  tls Rebase.
 1.174.2.3 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.174.2.2 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.174.2.1 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.179.2.3 28-Aug-2017  skrll Sync with HEAD
 1.179.2.2 05-Feb-2017  skrll Sync with HEAD
 1.179.2.1 22-Sep-2015  skrll Sync with HEAD
 1.180.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.183.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.188.4.3 21-Apr-2020  martin Sync with HEAD
 1.188.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.188.4.1 10-Jun-2019  christos Sync with HEAD
 1.188.2.3 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.188.2.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.188.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.196.4.1 29-Feb-2020  ad Sync with head.
 1.197.4.1 20-Apr-2020  bouyer Sync with HEAD
 1.202.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.203.4.1 01-Aug-2021  thorpej Sync with HEAD.
 1.209.2.1 02-Aug-2025  perseant Sync with HEAD
 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:29:57 +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.122 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.121 11-Jun-2022  tsutsui Specify -fno-unwind-tables to shrink binaries.
 1.120 21-Jan-2021  nia add a commented out compat_ossaudio wherever there's compat_linux

requested by mrg
 1.119 19-May-2020  rin branches: 1.119.2;
Fix outdated or misleading comments for MEMORY_DISK_ROOT_SIZE.
No functional changes.
 1.118 14-Mar-2019  thorpej G/C "MAPPECOPY". It is the deadest of wood, and never actually worked in
NetBSD.
 1.117 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.116 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.115 05-Feb-2018  maxv branches: 1.115.2; 1.115.4;
Nuke DIRECTED_BROADCAST, it is not documented and not enabled anywhere. It
probably wouldn't have built correctly anyway, since there is no associated
defflag.

These ten lines of code in ip_input.c already look a lot better.
 1.114 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.113 29-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 3.
 1.112 13-Dec-2016  christos wildcard speaker attachments, now that we can handle many of them.
 1.111 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.110 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.109 18-Sep-2016  christos bump
 1.108 12-Aug-2015  maxv branches: 1.108.2;
Remove KMEMSTATS.
 1.107 23-Aug-2014  dholland branches: 1.107.2;
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.106 10-Aug-2014  isaki Increase the image size to 1700KB.
At this point, the build succeeds if the build path is short,
but may fail if long. Thanks for martin@ and tsutsui@.
 1.105 24-Mar-2014  szptvlfn fix manual section numbering of sysctl.
thanks wiz@
 1.104 05-Mar-2014  isaki Delete the word "buggy" in the comment of NULLFS.
This has been added in 1999, but it's not a buggy now.
Adviced from tsutsui@, msaitoh@.
 1.103 27-Feb-2014  isaki Increase the image size to 1600KB.
 1.102 30-Jun-2013  rmind G/C PFIL_HOOKS from the kernel configs.
 1.101 05-Jun-2013  christos branches: 1.101.2;
remove obsolete networking options
 1.100 26-May-2013  isaki Increase the image size to 1500KB.
 1.99 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.98 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.97 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.96 10-Nov-2012  tsutsui - add dhcpcd support to x68k install ramdisk
- enable bpf(4) in INSTALL kernel for dhcpcd
- bump ramdisk size from 1400k to 1440k
No objection on port-x68k.
 1.95 29-Apr-2012  tsutsui branches: 1.95.2;
Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.94 18-Dec-2011  dholland branches: 1.94.2;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.93 22-Nov-2011  tls branches: 1.93.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.92 19-Nov-2011  isaki Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.91 06-Mar-2011  bouyer branches: 1.91.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.90 23-Nov-2010  hannken branches: 1.90.2; 1.90.4;
Remove unused count from pseudo-device md.
 1.89 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.88 05-Dec-2009  pooka branches: 1.88.2; 1.88.4;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.87 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.86 06-Feb-2009  jym branches: 1.86.2;
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.85 17-Jan-2009  isaki Increase the image size from 1300KB to 1400KB.
 1.84 21-Dec-2008  isaki Make sram(4) a hardware device.
# I wrote this in 2001 :-)
 1.83 20-Dec-2008  isaki Make pow(4) a hardware device.
Now pow(4) uses intio_intr_establish() which is a common interrupt
routine, but not powtrap which is a device specific routine.
 1.82 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

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

Proposed on tech-kern@.
 1.80 31-Jul-2008  simonb branches: 1.80.2; 1.80.4; 1.80.10;
Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.79 30-May-2008  tsutsui branches: 1.79.4;
Add options COMPAT_40 to files which have options COMPAT_30.
 1.78 11-May-2008  isaki Increase ramdisk size.
 1.77 24-Feb-2008  isaki branches: 1.77.2; 1.77.4; 1.77.6;
options<space><tab>
 1.76 29-Dec-2006  yamt branches: 1.76.24; 1.76.40; 1.76.44;
update comments on NFS_V2_ONLY after nqnfs removal. no functional changes.
from Arnaud Lacombe.
 1.75 02-Oct-2006  chs remove MALLOC_NOINLINE, it doesn't do anything anymore.
 1.74 26-Aug-2006  christos branches: 1.74.2; 1.74.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.73 05-Feb-2006  cube branches: 1.73.2;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.72 07-Dec-2005  tsutsui branches: 1.72.2; 1.72.4; 1.72.6;
Remove obsolete options VNODE_OP_NOINLINE.
 1.71 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.70 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.69 19-Aug-2005  christos 64 bit inode changes.
 1.68 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.67 03-Jul-2005  isaki branches: 1.67.2;
Simplify pseudo-devices.
 1.66 25-Feb-2005  simonb branches: 1.66.2;
Add COMPAT_20 (and COMPAT_16 in some cases) to kernel config files
that didn't have those options but had other earlier compat options.
 1.65 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.64 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.63 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.62 18-Jan-2005  chs branches: 1.62.2;
use a new "addr" locator for grf instead of the unit to match the instance
to the hardware. use a new "grfaddr" locator to match ites to their grfs,
instead of requiring that their unit numbers be the same.
 1.61 17-Jan-2005  cube 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.60 10-Nov-2004  christos branches: 1.60.4;
Add COMPAT_BSDPTY to the rest of the config files.
 1.59 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.58 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.57 04-Jan-2004  wiz branches: 1.57.2;
Spell controller with two ls. Inspired by miod@openbsd.
 1.56 22-Sep-2003  cl add COMPAT_15/COMPAT_16
 1.55 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.54 10-Apr-2003  christos branches: 1.54.2;
Bye Bye UCONSOLE
 1.53 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.52 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.51 25-Apr-2002  atatat branches: 1.51.2;
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.50 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.49 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.48 10-Mar-2002  lukem * 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.47 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.46 14-Jan-2002  isaki Add another address, vector configuration of Nereid ethernet.
 1.45 06-Dec-2001  minoura Add ELF support.
 1.44 25-Nov-2001  isaki Sync with GENERIC 1.67
 1.43 25-Nov-2001  isaki Add an ethernet part of Nereid.
 1.42 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.41 20-Nov-2001  lukem - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
 1.40 08-Jul-2001  abs branches: 1.40.2; 1.40.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.39 02-May-2001  minoura Add/enable vs.
 1.38 10-Mar-2001  minoura Turn off options JUPITER temporarily.
This may cause problems on some newer accelerators.
We might have to write a more accurate detect code.
 1.37 29-Dec-2000  minoura branches: 1.37.2;
CMACHFLAGS defaults to -m68020-60.
Can be overridden in config files; add examples.
 1.36 29-Nov-2000  minoura Adjust the ramdisk size.
 1.35 02-Oct-2000  abs Ensure all INSTALL* kernels have two ptys, and a note explaining why:
pseudo-device pty 2 # pseudo-terminals (Sysinst needs two)
(Some installers may not be using sysinst, in which case this just reduces
the number of ptys from 16 that are not used to 2 that are not used)
For i386 conf files, no change other than comments.
 1.34 25-Sep-2000  abs Use "options<SPACE><TAB>" not "options<TAB>" - noted by simonb.
Move VNODE_OP_NOINLINE and NFS_V2_ONLY into '# Filesystem options' section.
Consistently label '# Filesystem options' and '#File systems' sections.
 1.33 25-Sep-2000  abs Ensure all INSTALL config files have (at least) COPTS="-Os", cincluding bebox
based on it working already for macppc.
Also add commented out:
#options VNODE_OP_NOINLINE # Don't inline vnode op calls
#options NFS_V2_ONLY # Exclude NFS3 and NQNFS code
as suggestions for additional savings
 1.32 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.31 12-Sep-2000  minoura Adjust ramdisk sizes.
 1.30 12-Sep-2000  minoura Enable sram device, which is used by memswitch(8).
 1.29 06-Sep-2000  minoura Adjust ramdisk size.
 1.28 05-Jul-2000  minoura More reduce size.
 1.27 22-Jun-2000  minoura Reduce ramdisk size.
 1.26 18-Jun-2000  minoura branches: 1.26.2;
Enable INET6.
 1.25 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.24 16-Apr-2000  minoura branches: 1.24.2;
Sync w/ GENERIC.
 1.23 05-Feb-2000  minoura Sync.
 1.22 24-Dec-1999  minoura Give up support of 4MB RAM machines for standard sysinst-based installer.
Restricted small installer must be used on those machines.
 1.21 05-Dec-1999  minoura Add pseudo-device pty. sysinst does use ptys.
 1.20 18-Nov-1999  minoura Sync w/ GENERIC (options SOFTDEP).
Add IPv6 options to ALL.
 1.19 13-Nov-1999  minoura Increase ramdisk size.
 1.18 05-Aug-1999  minoura branches: 1.18.2; 1.18.4; 1.18.8;
Install kernel should not require COMPAT_14.
 1.17 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.16 21-May-1999  minoura Sync GENERIC.
 1.15 18-Apr-1999  minoura Add missing par0.
 1.14 14-Apr-1999  minoura More size hacks. We can now run the installer on 4MB machines.
 1.13 12-Apr-1999  minoura Reduce the kernel size.
- Disable many options and devices which is not required to install.
- Decrease the MINIROOTSIZE to fit with the actual embedded image.
 1.12 31-Mar-1999  minoura branches: 1.12.2;
Some trivial size reductions.
 1.11 24-Mar-1999  mrg clean up kernel/config files files for machVM lossage.
 1.10 17-Mar-1999  minoura MACHINE_NONCONTIG -> EXTENDED_MEMORY.
G/c and comment changes.
 1.9 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.8 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.7 07-Sep-1998  minoura branches: 1.7.6;
Reorganized the config files based on NetBSD/sparc ones.
Removed unmaintained files.
 1.6 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.5 05-Aug-1998  minoura Switched to MI zs driver.
 1.4 30-Jun-1998  msaitoh sync with -current after a long silence
 1.3 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.2 01-Dec-1997  kleink Add COMPAT_13.
 1.1 19-Oct-1997  oki branches: 1.1.2;
new bootfloppy kernel configuration file.
 1.1.2.1 13-Oct-1998  cgd work around broken extended memory detection, and enabled MSDOSFS.
(via patch, from minoura)
 1.7.6.7 14-Mar-1999  minoura Customize kernel message attributes.
(The code was commited in the last commit...)
 1.7.6.6 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.7.6.5 13-Feb-1999  minoura spc at intio.
 1.7.6.4 02-Feb-1999  minoura Add opm.
fdc at intio.
 1.7.6.3 31-Jan-1999  minoura Sync.
 1.7.6.2 27-Dec-1998  minoura Xellent30 driver.
 1.7.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.12.2.4 21-Jun-1999  perry revert; 1.12.2.3->1.12.2.2 (minoura): FPU_EMULATE now works
 1.12.2.3 19-Apr-1999  cjs branches: 1.12.2.3.2; 1.12.2.3.4;
FPU_EMULATE is unsupported in 1.4, because it's broken and there's no
time to test fixes. Per MINOURA Makoto <minoura@netbsd.org>.
 1.12.2.2 19-Apr-1999  cjs Pull up to HEAD 1.15 per MINOURA Makoto <minoura@netbsd.org>
 1.12.2.1 15-Apr-1999  minoura Pullup rev.1.13 and 1.14.
 1.12.2.3.4.1 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.2.3.2.2 02-Aug-1999  thorpej Update from trunk.
 1.12.2.3.2.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.4.1 15-Nov-1999  fvdl Sync with -current
 1.18.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.18.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.18.2.2 08-Dec-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 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.26.2.5 06-Jan-2002  he Pull up revision 1.43 (requested by isaki):
Support the Ethernet part of Nereid (ether/USB/memory board).
 1.26.2.4 13-Mar-2001  he Pull up revision 1.38 (requested by minoura):
Turn off options JUPITER, as it may cause problems on some newer
accelerators.
 1.26.2.3 25-Jan-2001  jhawk Pull up revision 1.37 (requested by minoura):
CMACHFLAGS now defaults to -m68020-60.
 1.26.2.2 15-Dec-2000  he Pull up revision 1.36 (via patch, requested by minoura):
Adjust the ramdisk size.
 1.26.2.1 14-Sep-2000  minoura Pullup from the trunk; approved by thorpej.

> From: Minoura Makoto <minoura@netbsd.org>
> Subject: CVS commit: syssrc
> To: source-changes@netbsd.org
> Date: Tue, 12 Sep 2000 18:00:07 +0300 (EEST)
> Reply-To: minoura@netbsd.org
>
>
> Module Name: syssrc
> Committed By: minoura
> Date: Tue Sep 12 15:00:07 UTC 2000
>
> Modified Files:
> basesrc/etc/etc.x68k: MAKEDEV
> syssrc/sys/arch/x68k/conf: INSTALL INSTALL_SMALL
>
> Log Message:
> Enable sram device, which is used by memswitch(8).
>
>
> To generate a diff of this commit:
> cvs rdiff -r1.28 -r1.29 basesrc/etc/etc.x68k/MAKEDEV
> cvs rdiff -r1.29 -r1.30 syssrc/sys/arch/x68k/conf/INSTALL
> cvs rdiff -r1.4 -r1.5 syssrc/sys/arch/x68k/conf/INSTALL_SMALL
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
 1.37.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.37.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.40.8.8 18-Oct-2002  nathanw Catch up to -current.
 1.40.8.7 01-Aug-2002  nathanw Catch up to -current.
 1.40.8.6 20-Jun-2002  nathanw Catch up to -current.
 1.40.8.5 17-Apr-2002  nathanw Catch up to -current.
 1.40.8.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.40.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.40.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.40.8.1 08-Jul-2001  nathanw file INSTALL was added on branch nathanw_sa on 2002-01-08 00:28:35 +0000
 1.40.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.40.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.40.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.40.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.40.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.40.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.51.2.1 17-Jul-2002  gehenna catch up with -current.
 1.54.2.10 11-Dec-2005  christos Sync with head.
 1.54.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.54.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.54.2.7 15-Feb-2005  skrll Sync with HEAD.
 1.54.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.54.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.54.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.54.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.54.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.54.2.1 03-Aug-2004  skrll Sync with HEAD
 1.57.2.1 15-Jul-2004  he Pull up revision 1.58 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.60.4.1 29-Apr-2005  kent sync with -current
 1.62.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.62.2.1 12-Feb-2005  yamt sync with head.
 1.66.2.1 18-Jul-2005  riz Pull up revision 1.68 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.67.2.3 27-Feb-2008  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.72.6.1 22-Apr-2006  simonb Sync with head.
 1.72.4.1 09-Sep-2006  rpaulo sync with head
 1.72.2.1 18-Feb-2006  yamt sync with head.
 1.73.2.1 03-Sep-2006  yamt sync with head.
 1.74.4.1 22-Oct-2006  yamt sync with head
 1.74.2.2 12-Jan-2007  ad Sync with head.
 1.74.2.1 18-Nov-2006  ad Sync with head.
 1.76.44.4 17-Jan-2009  mjf Sync with HEAD.
 1.76.44.3 28-Sep-2008  mjf Sync with HEAD.
 1.76.44.2 02-Jun-2008  mjf Sync with HEAD.
 1.76.44.1 03-Apr-2008  mjf Sync with HEAD.
 1.76.40.1 24-Mar-2008  keiichi sync with head.
 1.76.24.1 23-Mar-2008  matt sync with HEAD
 1.77.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.77.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.77.4.4 11-Aug-2010  yamt sync with head.
 1.77.4.3 11-Mar-2010  yamt sync with head
 1.77.4.2 04-May-2009  yamt sync with head.
 1.77.4.1 16-May-2008  yamt sync with head.
 1.77.2.2 04-Jun-2008  yamt sync with head
 1.77.2.1 18-May-2008  yamt sync with head.
 1.79.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.79.4.1 19-Oct-2008  haad Sync with HEAD.
 1.80.10.1 16-Jan-2011  bouyer Pull up following revision(s) (requested by isaki in ticket #1531):
sys/arch/x68k/conf/INSTALL: revision 1.85
distrib/x68k/floppies/ramdisk/Makefile: revision 1.30
Increase the image size from 1300KB to 1400KB.
 1.80.4.1 16-Jan-2011  bouyer Pull up following revision(s) (requested by isaki in ticket #1531):
sys/arch/x68k/conf/INSTALL: revision 1.85
distrib/x68k/floppies/ramdisk/Makefile: revision 1.30
Increase the image size from 1300KB to 1400KB.
 1.80.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.80.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.80.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.86.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.88.4.3 21-Apr-2011  rmind sync with head
 1.88.4.2 05-Mar-2011  rmind sync with head
 1.88.4.1 30-May-2010  rmind sync with head
 1.88.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.90.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.90.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.91.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.91.4.3 16-Jan-2013  yamt sync with (a bit old) head
 1.91.4.2 23-May-2012  yamt sync with head.
 1.91.4.1 17-Apr-2012  yamt sync with head
 1.93.2.2 29-Apr-2012  mrg sync to latest -current.
 1.93.2.1 18-Feb-2012  mrg merge to -current.
 1.94.2.1 24-Nov-2012  jdc Pull up revisions:
src/distrib/x68k/floppies/ramdisk/Makefile revision 1.41
src/sys/arch/x68k/conf/INSTALL revision 1.96
(requested by tsutsui in ticket #705).

- add dhcpcd support to x68k install ramdisk
- enable bpf(4) in INSTALL kernel for dhcpcd
- bump ramdisk size from 1400k to 1440k
No objection on port-x68k.
 1.95.2.4 03-Dec-2017  jdolecek update from HEAD
 1.95.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.95.2.2 23-Jun-2013  tls resync from head
 1.95.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.101.2.2 18-May-2014  rmind sync with head
 1.101.2.1 28-Aug-2013  rmind sync with head
 1.107.2.4 28-Aug-2017  skrll Sync with HEAD
 1.107.2.3 05-Feb-2017  skrll Sync with HEAD
 1.107.2.2 05-Oct-2016  skrll Sync with HEAD
 1.107.2.1 22-Sep-2015  skrll Sync with HEAD
 1.108.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.108.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.115.4.1 10-Jun-2019  christos Sync with HEAD
 1.115.2.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.115.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.119.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.13 28-Nov-2000  minoura We do not use INSTALL_SMALL any more.
 1.12 27-Nov-2000  soren Removed increased BUFCACHE/BUFPAGES.
 1.11 02-Oct-2000  abs branches: 1.11.2;
Ensure all INSTALL* kernels have two ptys, and a note explaining why:
pseudo-device pty 2 # pseudo-terminals (Sysinst needs two)
(Some installers may not be using sysinst, in which case this just reduces
the number of ptys from 16 that are not used to 2 that are not used)
For i386 conf files, no change other than comments.
 1.10 25-Sep-2000  abs Use "options<SPACE><TAB>" not "options<TAB>" - noted by simonb.
Move VNODE_OP_NOINLINE and NFS_V2_ONLY into '# Filesystem options' section.
Consistently label '# Filesystem options' and '#File systems' sections.
 1.9 25-Sep-2000  abs Ensure all INSTALL config files have (at least) COPTS="-Os", cincluding bebox
based on it working already for macppc.
Also add commented out:
#options VNODE_OP_NOINLINE # Don't inline vnode op calls
#options NFS_V2_ONLY # Exclude NFS3 and NQNFS code
as suggestions for additional savings
 1.8 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.7 12-Sep-2000  minoura Adjust ramdisk sizes.
 1.6 12-Sep-2000  minoura Reduce ramdisk size by using hacked commands in distrib/utils.
 1.5 12-Sep-2000  minoura Enable sram device, which is used by memswitch(8).
 1.4 14-Jun-2000  veego branches: 1.4.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.3 16-Apr-2000  minoura branches: 1.3.2;
Sync w/ GENERIC.
 1.2 05-Feb-2000  minoura Sync.
 1.1 24-Dec-1999  minoura Give up support of 4MB RAM machines for standard sysinst-based installer.
Restricted small installer must be used on those machines.
 1.3.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.2.3 15-Dec-2000  he Pull up removal (requested by minoura):
We do not use INSTALL_SMALL anymore.
 1.4.2.2 14-Sep-2000  minoura Pullup from the trunk; approved by thorpej.

> From: Minoura Makoto <minoura@netbsd.org>
> Subject: CVS commit: syssrc
> To: source-changes@netbsd.org
> Date: Tue, 12 Sep 2000 18:40:02 +0300 (EEST)
> Reply-To: minoura@netbsd.org
>
>
> Module Name: syssrc
> Committed By: minoura
> Date: Tue Sep 12 15:40:01 UTC 2000
>
> Modified Files:
> basesrc/distrib/x68k/floppies/ramdisk: Makefile dot.hdprofile
> dot.profile install.tmpl list ramdiskbin.conf upgrade.tmpl
> syssrc/sys/arch/x68k/conf: INSTALL_SMALL
>
> Log Message:
> Reduce ramdisk size by using hacked commands in distrib/utils.
>
>
> To generate a diff of this commit:
> cvs rdiff -r1.16 -r1.17 basesrc/distrib/x68k/floppies/ramdisk/Makefile
> cvs rdiff -r1.7 -r1.8 basesrc/distrib/x68k/floppies/ramdisk/dot.hdprofile
> cvs rdiff -r1.10 -r1.11 basesrc/distrib/x68k/floppies/ramdisk/dot.profile \
> basesrc/distrib/x68k/floppies/ramdisk/install.tmpl \
> basesrc/distrib/x68k/floppies/ramdisk/upgrade.tmpl
> cvs rdiff -r1.11 -r1.12 basesrc/distrib/x68k/floppies/ramdisk/list
> cvs rdiff -r1.8 -r1.9 basesrc/distrib/x68k/floppies/ramdisk/ramdiskbin.conf
> cvs rdiff -r1.5 -r1.6 syssrc/sys/arch/x68k/conf/INSTALL_SMALL
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
 1.4.2.1 14-Sep-2000  minoura Pullup from the trunk; approved by thorpej.

> From: Minoura Makoto <minoura@netbsd.org>
> Subject: CVS commit: syssrc
> To: source-changes@netbsd.org
> Date: Tue, 12 Sep 2000 18:00:07 +0300 (EEST)
> Reply-To: minoura@netbsd.org
>
>
> Module Name: syssrc
> Committed By: minoura
> Date: Tue Sep 12 15:00:07 UTC 2000
>
> Modified Files:
> basesrc/etc/etc.x68k: MAKEDEV
> syssrc/sys/arch/x68k/conf: INSTALL INSTALL_SMALL
>
> Log Message:
> Enable sram device, which is used by memswitch(8).
>
>
> To generate a diff of this commit:
> cvs rdiff -r1.28 -r1.29 basesrc/etc/etc.x68k/MAKEDEV
> cvs rdiff -r1.29 -r1.30 syssrc/sys/arch/x68k/conf/INSTALL
> cvs rdiff -r1.4 -r1.5 syssrc/sys/arch/x68k/conf/INSTALL_SMALL
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
 1.11.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.11.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.11.2.1 02-Oct-2000  bouyer file INSTALL_SMALL was added on branch thorpej_scsipi on 2000-11-20 20:29:55 +0000
 1.12 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.11 05-Aug-1998  minoura Switched to MI zs driver.
 1.10 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.9 01-Dec-1997  kleink Add COMPAT_13.
 1.8 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.7 12-Jun-1997  mrg remove now obsolete "swap on..." lines.
 1.6 08-May-1997  oki cleanup use of whitespace
 1.5 31-Jan-1997  thorpej Update for new file system and root spec grammar.
 1.4 15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.3 27-Oct-1996  oki branches: 1.3.2;
add EXEC_SCRIPT and EXEC_AOUT
 1.2 26-Aug-1996  mrg add COMPAT_12.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.2.2 18-Jan-1997  thorpej Update from trunk.
 1.3.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.13 07-Sep-1998  minoura Reorganized the config files based on NetBSD/sparc ones.
Removed unmaintained files.
 1.12 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.11 05-Aug-1998  minoura Switched to MI zs driver.
 1.10 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.9 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.8 12-Jun-1997  mrg remove now obsolete "swap on..." lines.
 1.7 08-May-1997  oki cleanup use of whitespace
 1.6 03-Feb-1997  oki Removed options GENERIC
 1.5 31-Jan-1997  thorpej Update for new file system and root spec grammar.
 1.4 15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.3 27-Oct-1996  oki branches: 1.3.2;
add options EXEC_SCRIPT and EXEC_AOUT
Sync with ALL, config again.
 1.2 26-Aug-1996  mrg add COMPAT_12.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.2.2 18-Jan-1997  thorpej Update from trunk.
 1.3.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.66 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.65 25-Feb-2018  mrg branches: 1.65.2; 1.65.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.64 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.63 04-Oct-2011  chs branches: 1.63.12; 1.63.30;
build machdep.c with -O1 to work around a gcc 4.5 issue.
 1.62 21-Jan-2011  joerg Switch remaining platforms to modern CPP for assembler.
 1.61 12-Feb-2008  joerg branches: 1.61.32; 1.61.38; 1.61.40;
Add a bunch of missing assym.h dependencies.
 1.60 11-Dec-2005  christos branches: 1.60.50; 1.60.56;
merge ktrace-lwp.
 1.59 31-May-2005  christos branches: 1.59.2;
s/GENASSYM/GENASSYM_CONF/ so we can use "GENASSYM" as the program name.
 1.58 04-Jun-2004  thorpej Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
 1.57 26-Nov-2002  thorpej branches: 1.57.6; 1.57.10;
The traditional C preprocessor is fixed in GCC 3.3 now, so no need
to skip -traditional-cpp for HAVE_GCC3.
 1.56 04-Jun-2002  thorpej Don't use -traditional-cpp if HAVE_GCC3.
 1.55 04-Dec-2001  minoura branches: 1.55.8;
Use sys/conf/Makefile.kern.inc.
 1.54 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.53 26-Oct-2001  jmc branches: 1.53.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.52 23-Oct-2001  thorpej branches: 1.52.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.51 29-Sep-2001  minoura Minor changes from news68k.
 1.50 29-May-2001  mrg branches: 1.50.2; 1.50.4;
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.49 29-Dec-2000  minoura branches: 1.49.2;
CMACHFLAGS defaults to -m68020-60.
Can be overridden in config files; add examples.
 1.48 17-Dec-2000  jdolecek delete obsolete comment
 1.47 15-Dec-2000  itohy Remove empty lines from cpp output since make doesn't seem to like them.
 1.46 13-Nov-2000  minoura Look at opt_m680x0.h to determine whether to use -m68060 compiler option,
since options M68060 (etc.) is now defopt'ed.
Pointed out by NISHIMURA Takeshi <nsmrtks@comd.nara.sharp.co.jp>.
Use -m68020-60 instead of -m68060 to ensure not to use new instructions.
 1.45 09-May-2000  hubertf branches: 1.45.4;
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.44 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.43 23-Apr-2000  minoura M680x0 are now defopt'ed.
 1.42 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.41 24-Jan-2000  tron Add "dependall" target for comfort.
 1.40 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.39 19-Jan-2000  tsutsui Change STRIPFLAGS=-g for cross-toolchains.
 1.38 24-Sep-1999  minoura branches: 1.38.2;
Could not compile w/ options M68060.
Supply -m68030 and -m68851 to the assembler.
 1.37 26-Jul-1999  cgd be more efficient when doing the SYSTEM_LD_TAIL for -g kernels: don't
copy them just to strip them, use strip -o.
 1.36 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.35 01-Apr-1999  minoura branches: 1.35.4;
Typo.
 1.34 30-Mar-1999  minoura Update dependency.
 1.33 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.32 15-Jan-1999  thorpej Some minor, mostly costmetic, changes to CPPFLAGS/CFLAGS.
 1.31 15-Jan-1999  thorpej Don't define "mc68020". Nothing uses it.
 1.30 08-Jan-1999  augustss Add -Wpointer-arith warning since `void *' arithmetic is not ANSI C.
 1.29 15-Oct-1998  drochner branches: 1.29.6;
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.28 05-Sep-1998  lukem distclean is a synonym for cleandir
 1.27 31-May-1998  thorpej Specify a non-profiling C rule.
 1.26 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.25 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.24 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.23 12-Nov-1997  thorpej Make sure CPP, AR, AS, and RANLIB are defined.
 1.22 12-Nov-1997  thorpej Define LORDER, NM, and TSORT here, like we do the rest of the tools.
 1.21 09-Oct-1997  is branches: 1.21.2;
Help crosscompiling, by as -> $(AS). Define AS?= as in the calling
Makefile.$(ARCH)es. Will hopefully fix the (remaining) part or pr4010.
 1.20 07-Oct-1997  is Oops, forgot to commit this when doing the recent 060SP Makefile change.
 1.19 03-Oct-1997  lukem define SIZE?=size, and use ${SIZE} instead of size. makes cross
compilation easier
 1.18 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.17 12-Sep-1997  mycroft FPCOPROC is no longer used here.
 1.16 12-Sep-1997  mycroft Nuke Locore.c. It's way too out of date to be useful at this point.
 1.15 14-Jul-1997  oki branches: 1.15.2;
Use genassym.cf to make assym.h
 1.14 14-Mar-1997  mycroft Define the `cleankernel' target consistently with other ports.
 1.13 04-Feb-1997  perry Nuke some GENERIC residue.
 1.12 03-Feb-1997  oki Remove swapgeneric.c from target lint
 1.11 30-Jan-1997  oki :: --> :
 1.10 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.9 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.8 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.7 31-Aug-1996  mycroft Wrap the default definition of `S' in `.ifndef'.
 1.6 12-Aug-1996  mycroft Put into . Remove hooks for `config-dependent' and
`device-driver' flags.
 1.5 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.4 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.3 19-May-1996  oki include $S/arch/m68k/060sp/Makefile.inc, similar to amiga.
 1.2 11-May-1996  mycroft Make `make depend' work for libraries.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.15.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.21.2.1 12-Nov-1997  thorpej Pull up "make sure tools are defined" changes from trunk.
 1.29.6.1 31-Jan-1999  minoura Sync.
 1.35.4.1 02-Aug-1999  thorpej Update from trunk.
 1.38.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.38.2.2 22-Nov-2000  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.45.4.1 25-Jan-2001  jhawk Pull up revision 1.49 via patch (requested by minoura):
CMACHFLAGS now defaults to -m68020-60.
 1.49.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.50.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.50.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.50.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.52.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.53.2.5 11-Dec-2002  thorpej Sync with HEAD.
 1.53.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.53.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.53.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.53.2.1 26-Oct-2001  nathanw file Makefile.x68k was added on branch nathanw_sa on 2002-01-08 00:28:36 +0000
 1.55.8.1 15-Jul-2002  gehenna catch up with -current.
 1.57.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.57.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.57.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.57.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.57.6.1 03-Aug-2004  skrll Sync with HEAD
 1.59.2.1 27-Feb-2008  yamt sync with head.
 1.60.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.60.50.1 23-Mar-2008  matt sync with HEAD
 1.61.40.1 08-Feb-2011  bouyer Sync with HEAD
 1.61.38.1 06-Jun-2011  jruoho Sync with HEAD.
 1.61.32.1 05-Mar-2011  rmind sync with head
 1.63.30.1 22-Sep-2015  skrll Sync with HEAD
 1.63.12.1 03-Dec-2017  jdolecek update from HEAD
 1.65.4.1 10-Jun-2019  christos Sync with HEAD
 1.65.2.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.14 07-Sep-1998  minoura Reorganized the config files based on NetBSD/sparc ones.
Removed unmaintained files.
 1.13 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.12 05-Aug-1998  minoura Switched to MI zs driver.
 1.11 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.10 01-Dec-1997  kleink Add COMPAT_13.
 1.9 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.8 15-Oct-1997  thorpej Pulldown from marc-pcmcia branch: minimal changes to change x68k port's
"com" (now "xcom") driver to avoid name collision with the more
heaviliy-used "com" driver.
 1.7 12-Jun-1997  mrg branches: 1.7.4;
remove now obsolete "swap on..." lines.
 1.6 08-May-1997  oki cleanup use of whitespace
 1.5 31-Jan-1997  thorpej Update for new file system and root spec grammar.
 1.4 15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.3 08-Jan-1997  oki branches: 1.3.2;
Add EXEC_AOUT and EXEC_SCRIPT.
 1.2 26-Aug-1996  mrg add COMPAT_12.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.2.2 18-Jan-1997  thorpej Update from trunk.
 1.3.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.7.4.1 15-Oct-1997  thorpej Minimal changes to rename the x68k port's "com" driver to "xcom", to
avoid a namespace collision with the more heavily-used "com" driver,
which needs to be declared in sys/conf/files.
 1.2 03-Jan-1999  minoura UVM is now default for GENERIC.
 1.1 30-Jun-1998  msaitoh branches: 1.1.8;
add RCSID
 1.1.8.1 31-Jan-1999  minoura Sync.
 1.25 28-Jun-2000  minoura GENERIC should run on any environment.
It required 6MB of memory; disable some options/devices so that
it can run on 4MB machines.
 1.24 14-Jun-2000  veego branches: 1.24.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.23 16-Apr-2000  minoura branches: 1.23.2;
Sync w/ GENERIC.
 1.22 05-Feb-2000  minoura Sync.
 1.21 18-Nov-1999  minoura Sync w/ GENERIC (options SOFTDEP).
Add IPv6 options to ALL.
 1.20 29-Jul-1999  augustss branches: 1.20.2; 1.20.8;
It's time to be COMPAT_14.
 1.19 21-May-1999  minoura Sync GENERIC.
 1.18 18-Apr-1999  minoura Add missing par0.
 1.17 31-Mar-1999  minoura branches: 1.17.2;
Enable rnd.
 1.16 24-Mar-1999  mrg clean up kernel/config files files for machVM lossage.
 1.15 17-Mar-1999  minoura MACHINE_NONCONTIG -> EXTENDED_MEMORY.
G/c and comment changes.
 1.14 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.13 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.12 16-Dec-1998  minoura branches: 1.12.2;
Synced with GENERIC.
 1.11 29-Nov-1998  minoura Re-enabled SMALL.
This kernel can run on small memory machines.
 1.10 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.9 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.8 01-Dec-1997  kleink Add COMPAT_13.
 1.7 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.6 12-Jun-1997  mrg remove now obsolete "swap on..." lines.
 1.5 08-May-1997  oki cleanup use of whitespace
 1.4 31-Jan-1997  thorpej Update for new file system and root spec grammar.
 1.3 15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.2 26-Aug-1996  mrg branches: 1.2.2;
add COMPAT_12.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.2 18-Jan-1997  thorpej Update from trunk.
 1.2.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.12.2.8 14-Mar-1999  minoura Customize kernel message attributes.
(The code was commited in the last commit...)
 1.12.2.7 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.12.2.6 13-Feb-1999  minoura spc at intio.
 1.12.2.5 02-Feb-1999  minoura Add opm.
fdc at intio.
 1.12.2.4 31-Jan-1999  minoura Sync.
 1.12.2.3 30-Jan-1999  minoura Added DMAC driver.
 1.12.2.2 27-Dec-1998  minoura Xellent30 driver.
 1.12.2.1 27-Dec-1998  minoura Synced.
 1.17.2.3 21-Jun-1999  perry revert; 1.17.2.2->1.17.2.1 (minoura): FPU_EMULATE now works
 1.17.2.2 19-Apr-1999  cjs branches: 1.17.2.2.2; 1.17.2.2.4;
FPU_EMULATE is unsupported in 1.4, because it's broken and there's no
time to test fixes. Per MINOURA Makoto <minoura@netbsd.org>.
 1.17.2.1 19-Apr-1999  cjs Pull up to HEAD 1.18 per MINOURA Makoto <minoura@netbsd.org>
 1.17.2.2.4.1 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.17.2.2.2.2 02-Aug-1999  thorpej Update from trunk.
 1.17.2.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.20.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.20.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.23.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.24.2.1 14-Jul-2000  minoura Pullup rev. 1.25 from the trunk.
Now that GENERIC can run with 4MB meomry, SMALL is unnecessary.
 1.11 03-Sep-1998  minoura Deleted unused options EIOMAPSIZE and ITEKANJI.
Removed unmaintained configs.
 1.10 05-Aug-1998  minoura Switched to MI zs driver.
 1.9 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.8 01-Dec-1997  kleink Add COMPAT_13.
 1.7 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.6 12-Jun-1997  mrg remove now obsolete "swap on..." lines.
 1.5 08-May-1997  oki cleanup use of whitespace
 1.4 03-Feb-1997  oki - RCSid police
- Correct header comment
- Sync with ALL
 1.3 31-Jan-1997  thorpej Update for new file system and root spec grammar.
 1.2 15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.2;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.2.2 18-Jan-1997  thorpej Update from trunk.
 1.1.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.31 23-Sep-2002  isaki It was a sample config file, so there is no need to maintain anymore.
Requested by minoura@netbsd.org
 1.30 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.29 11-Aug-2002  isaki Add (commented) ScanLogic SL811HS/T USB Host Controller
and USB stuff.
 1.28 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.27 25-Apr-2002  atatat branches: 1.27.2; 1.27.4;
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.26 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.25 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.24 24-Dec-2001  minoura ELF!!
Plus adopt my environment (TOKOCHAN is my development config as well
as an example).
 1.23 06-Dec-2001  minoura Add ELF support.
 1.22 25-Nov-2001  minoura Sync. with GENERIC plus others.
 1.21 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.20 20-Nov-2001  lukem - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
 1.19 08-Jul-2001  abs branches: 1.19.2; 1.19.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.18 06-May-2001  hubertf vlan does not belong to group of IPv6 pseudo-devices
 1.17 02-May-2001  minoura Add/enable vs.
 1.16 29-Dec-2000  minoura branches: 1.16.2;
CMACHFLAGS defaults to -m68020-60.
Can be overridden in config files; add examples.
 1.15 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.14 14-Jun-2000  veego branches: 1.14.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.13 16-Apr-2000  minoura branches: 1.13.2;
Sync w/ GENERIC.
 1.12 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.11 05-Feb-2000  minoura Sync.
 1.10 18-Nov-1999  minoura Sync w/ GENERIC (options SOFTDEP).
Add IPv6 options to ALL.
 1.9 05-Aug-1999  minoura branches: 1.9.2; 1.9.8;
IPv6 options from GENERIC.v6.
 1.8 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.7 21-May-1999  minoura Sync GENERIC.
 1.6 18-Apr-1999  minoura Add missing par0.
 1.5 31-Mar-1999  minoura branches: 1.5.2;
Enable rnd.
 1.4 24-Mar-1999  mrg clean up kernel/config files files for machVM lossage.
 1.3 17-Mar-1999  minoura MACHINE_NONCONTIG -> EXTENDED_MEMORY.
G/c and comment changes.
 1.2 16-Mar-1999  minoura Typo.
 1.1 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.5.2.1 19-Apr-1999  cjs branches: 1.5.2.1.2;
Pull up to HEAD 1.6 per MINOURA Makoto <minoura@netbsd.org>.
 1.5.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.5.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.2.2 05-Jan-2001  bouyer Sync with HEAD
 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.13.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.14.2.1 25-Jan-2001  jhawk Pull up revision 1.16 (requested by minoura):
CMACHFLAGS now defaults to -m68020-60.
 1.16.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.19.8.7 18-Oct-2002  nathanw Catch up to -current.
 1.19.8.6 13-Aug-2002  nathanw Catch up to -current.
 1.19.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.19.8.4 17-Apr-2002  nathanw Catch up to -current.
 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 08-Jul-2001  nathanw file TOKOCHAN was added on branch nathanw_sa on 2002-01-08 00:28:36 +0000
 1.19.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.19.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.19.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.19.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.27.4.1 01-Aug-2002  lukem Pull up revision 1.28 (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.27.2.2 31-Aug-2002  gehenna catch up with -current.
 1.27.2.1 15-Jul-2002  gehenna catch up with -current.
 1.3 03-Jan-1999  minoura UVM is now default for GENERIC.
 1.2 07-Sep-1998  minoura branches: 1.2.6;
Reorganized the config files based on NetBSD/sparc ones.
Removed unmaintained files.
 1.1 30-Jun-1998  msaitoh add RCSID
 1.2.6.1 31-Jan-1999  minoura Sync.
 1.14 05-Jul-2000  minoura include GENERIC, instead of defining all the options and devices.
 1.13 14-Jun-2000  veego branches: 1.13.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.12 16-Apr-2000  minoura branches: 1.12.2;
Sync w/ GENERIC.
 1.11 05-Feb-2000  minoura Sync.
 1.10 18-Nov-1999  minoura Sync w/ GENERIC (options SOFTDEP).
Add IPv6 options to ALL.
 1.9 05-Aug-1999  minoura branches: 1.9.2; 1.9.8;
Sync.
 1.8 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.7 21-May-1999  minoura Sync GENERIC.
 1.6 18-Apr-1999  minoura Add missing par0.
 1.5 31-Mar-1999  minoura branches: 1.5.2;
Enable rnd.
 1.4 24-Mar-1999  mrg clean up kernel/config files files for machVM lossage.
 1.3 17-Mar-1999  minoura MACHINE_NONCONTIG -> EXTENDED_MEMORY.
G/c and comment changes.
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file ZSCONS was initially added on branch minoura_x68k_bus_h.
 1.1.2.6 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.1.2.5 13-Feb-1999  minoura spc at intio.
 1.1.2.4 02-Feb-1999  minoura Add opm.
fdc at intio.
 1.1.2.3 30-Jan-1999  minoura Added DMAC driver.
 1.1.2.2 27-Dec-1998  minoura Xellent30 driver.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.5.2.3 21-Jun-1999  perry revert; 1.5.2.2->1.5.2.1 (minoura): FPU_EMULATE now works
 1.5.2.2 19-Apr-1999  cjs branches: 1.5.2.2.2; 1.5.2.2.4;
FPU_EMULATE is unsupported in 1.4, because it's broken and there's no
time to test fixes. Per MINOURA Makoto <minoura@netbsd.org>.
 1.5.2.1 19-Apr-1999  cjs Pull up to HEAD 1.6 per MINOURA Makoto <minoura@netbsd.org>.
 1.5.2.2.4.1 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.5.2.2.2.2 02-Aug-1999  thorpej Update from trunk.
 1.5.2.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -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.12.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.13.2.1 15-Jul-2000  minoura Pull up revision 1.14 from the trunk.
Include GENERIC, instead of defining all the options and devices.
 1.85 05-Oct-2024  isaki x68k: Add SIXEL graphics sequence support.
- The palette definition is fixed to the same color as the text (currently,
it's RGB 8 colors). Any palette definition sent will be ignored.
- Aspect ratio and bg color mode is not supported (yet).
- An OR mode is supported. This is proposed by Y.Sugahara in this
implementation and then the mlterm also supports it. It's an advantageous
way for the multi plane color VRAM.
- ITE_SIXEL kernel option is added and is disabled by default for now.

It was first written by me in 2014 and has been demonstrated in Open Source
Conference Hiroshima every year since then. In this year, it's also
demonstrated on real X68030 at Japan NetBSD Users Group booth in OSC 2024
Hiroshima, last week.
https://x.com/OSC_official/status/1841381234804498608
It's useful for showing and explaining about the possibility of NetBSD and
old machines for younger (than X68030) engineers or students.
 1.84 09-Jan-2024  thorpej branches: 1.84.2;
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.83 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.82 18-Feb-2019  thorpej branches: 1.82.2;
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.81 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.80 25-Feb-2018  mrg branches: 1.80.2; 1.80.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.79 02-Oct-2012  christos move common/bus_dma/ -> dev/bus_dma/
 1.78 29-Apr-2012  tsutsui branches: 1.78.2;
Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.77 27-Nov-2011  isaki branches: 1.77.2;
Add powsw(4) for x68k power switch. It substitutes for a part about
power switch handler of pow(4) deleted before.
Benefits than pow(4):
- separate a front switch (= powsw0) and an EXPWON line (= powsw1)
completely. Only powsw0 is enabled in GENERIC by default.
- prevent chattering in some hardware individuals.
thank you for a report and a test: Yasushi Oshima and Y.Sugahara.
 1.76 19-Nov-2011  isaki Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.75 15-Nov-2011  tsutsui Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
 1.74 12-Jun-2011  rmind branches: 1.74.2;
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.73 14-May-2011  tsutsui branches: 1.73.2;
IODEVbase is the same address as intiobase, so make it an alias macro
and remove now almost empty x68k_init.c.
 1.72 17-Mar-2011  tsutsui Include files.ata for atapibus at umass.
 1.71 06-Jun-2010  mrg branches: 1.71.2;
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.70 21-Aug-2009  thorpej branches: 1.70.2; 1.70.4;
Use bus_dmamem_common.
 1.69 21-Dec-2008  isaki Take out mainbus(4)-related code from autoconf.c and make it mainbus.c.
 1.68 21-Dec-2008  isaki Make sram(4) a hardware device.
# I wrote this in 2001 :-)
 1.67 20-Dec-2008  isaki x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
 1.66 20-Dec-2008  isaki Make pow(4) a hardware device.
Now pow(4) uses intio_intr_establish() which is a common interrupt
routine, but not powtrap which is a device specific routine.
 1.65 20-Feb-2008  drochner branches: 1.65.6; 1.65.10; 1.65.18;
Since files.wscons et al. are included by ~all ports anyway, include
them in the mi "files" file, and remove include statements from md files.
These shouldn't pull in additional kernel code when not in use, so it
shouldn't do any harm except a risk of namespace collisions which
should be easy to fix.
 1.64 31-Dec-2007  ad Remove COMPAT_HPUX.
 1.63 03-Dec-2007  ad branches: 1.63.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.62 04-Mar-2007  tsutsui branches: 1.62.2; 1.62.18; 1.62.20; 1.62.26;
Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.61 11-Dec-2005  christos branches: 1.61.26;
merge ktrace-lwp.
 1.60 18-Jan-2005  chs branches: 1.60.8;
use a new "addr" locator for grf instead of the unit to match the instance
to the hardware. use a new "grfaddr" locator to match ites to their grfs,
instead of requiring that their unit numbers be the same.
 1.59 17-Nov-2004  he branches: 1.59.4;
Refer to the common m68k procfs_machdep.c instead of the x68k one,
which has now been removed.
 1.58 01-Aug-2004  isaki files.usb (rev 1.54) needs files.wscons for uep.
 1.57 07-Jul-2004  mycroft Move spc into the MI area.
 1.56 08-Jan-2004  minoura Include compat/hpux/files.hpux.
Untested.
 1.55 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.54 24-Jun-2003  martin branches: 1.54.2;
FPU_EMULATE moved to arch/m68k/conf/files.m68k
 1.53 01-Dec-2002  isaki Add bmd, memory disk driver for Nereid bank memory.
 1.52 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.51 03-Nov-2002  chs use a merged sys_machdep.c for all the motorola-MMU m68k platforms.
 1.50 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.49 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.48 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.47 11-Aug-2002  isaki Add driver for ScanLogic SL811HS/T USB Host Controller.
XXX It's experimental code yet.

For x68k: USB part of Nereid USB/Ethernet/memory board
For ISA: ISA USB Host board from Morphy planning
 1.46 22-Apr-2002  augustss branches: 1.46.2;
Rename the audio "bus" attribute audiobus to avoid confusion with audio
device.
 1.45 26-Dec-2001  minoura Backout previous.
It was a garbage; atatat already commited the fix in another way.
 1.44 24-Dec-2001  minoura ELF!!
 1.43 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.42 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.41 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.40 11-Nov-2001  isaki Support an ethernet part of Nereid.
Nereid is the board of ethernet/USB/memory for X68k
developed by X-PowerStation, a japanese X68k circle.
See http://xps.jp/ but only written in japanese.
 1.39 18-Jun-2001  christos branches: 1.39.2; 1.39.6; 1.39.8;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.38 02-May-2001  minoura X68k built-in voice synthesizer.
 1.37 22-Mar-2001  minoura A bit of ELF support. From scw.
 1.36 17-Jan-2001  fvdl branches: 1.36.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.35 11-Jan-2001  minoura Use MI clock_subr.c.
 1.34 24-Nov-2000  minoura Use MI md_root.c.
 1.33 14-May-2000  minoura branches: 1.33.4;
defopt FPSP.
 1.32 18-Apr-2000  minoura defopt M680[2346]0.
 1.31 27-Mar-2000  minoura Move par under intio.
 1.30 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.29 23-Nov-1999  minoura Add missing `major' entries: md and fd.
 1.28 23-Sep-1999  minoura branches: 1.28.2; 1.28.8;
Use m68k common cacheops.c.
 1.27 07-Jul-1999  thorpej pseudo-device -> defpseudo, per grammar change in config(8).
 1.26 07-Jun-1999  thorpej Only declare block major numbers for devices which can be the root device.
 1.25 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.24 30-Mar-1999  minoura branches: 1.24.4;
defopt EXTENDED_MEMORY and ITE_KERNEL_ATTR.
 1.23 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.22 15-Dec-1998  itohy branches: 1.22.2;
Added COMPAT_LINUX support.
 1.21 05-Aug-1998  minoura Switched to MI zs driver.
 1.20 31-May-1998  thorpej Build pmap_boostrap.o without profiling; we can't call mcount before the
mmu is enabled!
 1.19 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.18 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.17 12-Jan-1998  thorpej Update for changes to config.
 1.16 19-Oct-1997  oki branches: 1.16.2;
Use common m68k/sig_machdep.c.
 1.15 19-Oct-1997  oki Support of MK-HA1 Mach-2 SCSI adaptor.
 1.14 15-Oct-1997  thorpej Pulldown from marc-pcmcia branch: minimal changes to change x68k port's
"com" (now "xcom") driver to avoid name collision with the more
heaviliy-used "com" driver.
 1.13 12-Oct-1997  oki Added 'arp' to Neptune-X ethernet interface.
Removed local if_se entry (no longer works.)
 1.12 28-Sep-1997  is Build the 68060 support package in the kernel build dir.
XXX PCB_ONFAULT is still hardwired to 64 in netbsd060sp.S.
 1.11 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.10 09-Apr-1997  thorpej branches: 1.10.2; 1.10.4;
Remove redundant file directives
 1.9 17-Mar-1997  gwr Separate bcopy and copypage stuff from copy.s
 1.8 26-Jan-1997  oki branches: 1.8.4;
- Use New ite_tv.c
- Remove unused ite_in.c and kernel_font.c line
 1.7 21-Jan-1997  thorpej "md" is declared in sys/conf/files, now.
 1.6 08-Jan-1997  oki Add fpu.c, delete unneeded fpe_emulate.c line.
 1.5 28-Dec-1996  pk rename: ramdisk => md
 1.4 27-Nov-1996  oki edit include path, config again.
 1.3 11-Aug-1996  oki fixed major number of vnd and cd. (PR#2635)
 1.2 20-May-1996  oki branches: 1.2.2;
Add 'rd' ram-disk pseudo-device.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.1 16-Aug-1996  jtc Pulled up from rev 1.3 by request from oki
 1.8.4.1 10-Mar-1997  is make ether devices depend on arp
 1.10.4.3 15-Oct-1997  thorpej Minimal changes to rename the x68k port's "com" driver to "xcom", to
avoid a namespace collision with the more heavily-used "com" driver,
which needs to be declared in sys/conf/files.
 1.10.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.16.2.1 05-Feb-1999  cgd pull up patch to make mouse optional. Previously it was mandatory
because some mouse-related functions were referenced from other files.
Never committed to trunk because -current uses MI zs driver. (minoura)
 1.22.2.8 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.22.2.7 13-Feb-1999  minoura spc at intio.
 1.22.2.6 02-Feb-1999  minoura fdc at intio.
 1.22.2.5 31-Jan-1999  minoura opm at intio.
 1.22.2.4 31-Jan-1999  minoura Attach arg dmaintr.
 1.22.2.3 30-Jan-1999  minoura Added DMAC driver.
 1.22.2.2 27-Dec-1998  minoura Xellent30 driver.
 1.22.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.24.4.2 02-Aug-1999  thorpej Update from trunk.
 1.24.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.28.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.28.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.28.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.28.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.28.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.33.4.1 06-Jan-2002  he Pull up revision 1.40 (requested by isaki):
Support the Ethernet part of Nereid (ether/USB/memory board).
 1.36.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.36.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.39.8.7 11-Dec-2002  thorpej Sync with HEAD.
 1.39.8.6 11-Nov-2002  nathanw Catch up to -current
 1.39.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.39.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.39.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.39.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.39.8.1 18-Jun-2001  nathanw file files.x68k was added on branch nathanw_sa on 2002-01-08 00:28:36 +0000
 1.39.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 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 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.39.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.39.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.46.2.3 31-Aug-2002  gehenna catch up with -current.
 1.46.2.2 17-May-2002  gehenna Remove old block majors list.
 1.46.2.1 16-May-2002  gehenna Include the list of block/character major numbers.
 1.54.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.54.2.4 29-Nov-2004  skrll Sync with HEAD.
 1.54.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.54.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.54.2.1 03-Aug-2004  skrll Sync with HEAD
 1.59.4.1 29-Apr-2005  kent sync with -current
 1.60.8.4 27-Feb-2008  yamt sync with head.
 1.60.8.3 21-Jan-2008  yamt sync with head
 1.60.8.2 07-Dec-2007  yamt sync with head
 1.60.8.1 03-Sep-2007  yamt sync with head.
 1.61.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.62.26.2 18-Feb-2008  mjf Sync with HEAD.
 1.62.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.62.20.2 23-Mar-2008  matt sync with HEAD
 1.62.20.1 09-Jan-2008  matt sync with HEAD
 1.62.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.62.2.1 03-Dec-2007  ad Sync with HEAD.
 1.63.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.65.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.65.10.3 11-Aug-2010  yamt sync with head.
 1.65.10.2 16-Sep-2009  yamt sync with head
 1.65.10.1 04-May-2009  yamt sync with head.
 1.65.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.70.4.4 31-May-2011  rmind sync with head
 1.70.4.3 21-Apr-2011  rmind sync with head
 1.70.4.2 03-Jul-2010  rmind sync with head
 1.70.4.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.70.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.71.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.73.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.74.2.3 30-Oct-2012  yamt sync with head
 1.74.2.2 23-May-2012  yamt sync with head.
 1.74.2.1 17-Apr-2012  yamt sync with head
 1.77.2.1 29-Apr-2012  mrg sync to latest -current.
 1.78.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.80.4.1 10-Jun-2019  christos Sync with HEAD
 1.80.2.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.82.2.1 05-May-2019  isaki Remove obsoleted au{,rate,vol}conv and mulaw attributes.
audio provides the equivalent of them inseparably.
 1.84.2.1 02-Aug-2025  perseant Sync with HEAD
 1.34 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.33 29-Jun-2021  nia Remove uscanner(4) driver

This exists for compatibility with a Linux interface which was apparently
deprecated in Linux 2.6. There are various mailing list threads going
back to 2004 where the usefulness of this driver is discussed, but
the conclusion is that scanner software has all moved to using ugen(4)
instead, and enabling this driver will not help you scan things.
 1.32 04-Apr-2020  jdolecek branches: 1.32.8;
mark nsmb major obsolete
 1.31 29-Jan-2020  maya remove urio(4), a driver for the Rio500 MP3 player.

At this point it is highly unlikely this 1999 device still has users,
but it still comes up in the context of maxv's USB-fuzzing (and any device
could pretend to be a urio(4)), so it's best to get rid of it.

Renamed all major entries to obsolete, as was done in previous removals.

This still requires an update to sanitizers, but they're located in
"external", perhaps it should be first committed upstream?

Proposed on tech-kern a month ago.
 1.30 28-Jan-2019  dholland branches: 1.30.6;
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.29 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.28 23-Sep-2018  maxv Remove ISDN from the kernel. It has remained unmaintained for a long time,
is of poor quality, and is now an obstacle to MP-ification. It was removed
ten years ago from FreeBSD for the same reason.

This retires a big user of the mbuf API, and will ease maintenance of the
kernel.
 1.27 23-Apr-2015  pgoyette branches: 1.27.16; 1.27.18;
Update device dependency information - the sysmon major device now depends on the sysmon module itself, not on the individual components.
 1.26 29-Apr-2012  tsutsui branches: 1.26.2; 1.26.16;
Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.25 19-Nov-2011  isaki branches: 1.25.4;
Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.24 30-Jun-2011  wiz branches: 1.24.2;
dependant -> dependent
 1.23 06-Mar-2010  plunky use a MI major number for uhso(4) driver
(requested by mrg)
 1.22 06-Mar-2010  plunky add major device for usho(4) driver
 1.21 20-Dec-2008  isaki x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
 1.20 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.19 31-Dec-2007  ad branches: 1.19.6; 1.19.10; 1.19.16; 1.19.18;
Remove systrace. Ok core@.
 1.18 24-Nov-2006  wiz branches: 1.18.28; 1.18.34; 1.18.42;
s/independant/independent/, from Zafer.
 1.17 11-Dec-2005  christos branches: 1.17.20; 1.17.22;
merge ktrace-lwp.
 1.16 17-Sep-2005  yamt make VMSWAP optional again.
 1.15 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.14 30-Jul-2005  yamt defflag VMSWAP.
 1.13 10-May-2005  jdolecek branches: 1.13.2;
assign major for nsmb(4)
 1.12 10-Dec-2003  jmc Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
 1.11 24-Oct-2003  jdolecek add necessary majors for miscellaneous devices, such as missing
wscons/scsi/isdn devices
 1.10 10-Oct-2003  jdolecek reassing majors for crypto and pf to use the newly defined MI major
range
 1.9 10-Oct-2003  jdolecek update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
 1.8 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.7 22-Aug-2003  itojun create /dev/crypto
 1.6 27-Jul-2003  itojun reserve cdev major # for PF. ok'ed by technical-exec
 1.5 25-Apr-2003  ragge branches: 1.5.2;
Add ksyms device major.
 1.4 01-Dec-2002  isaki Add bmd, memory disk driver for Nereid bank memory.
 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.x68k was initially added on branch gehenna-devsw.
 1.1.2.4 31-Aug-2002  gehenna catch up with -current.
 1.1.2.3 15-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.4 11-Dec-2002  thorpej Sync with HEAD.
 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.x68k was added on branch nathanw_sa on 2002-09-17 21:18:43 +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.x68k was added on branch kqueue on 2002-10-10 18:37:32 +0000
 1.5.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.2.3 21-Jan-2008  yamt sync with head
 1.13.2.2 30-Dec-2006  yamt sync with head.
 1.13.2.1 21-Jun-2006  yamt sync with head.
 1.17.22.1 10-Dec-2006  yamt sync with head.
 1.17.20.1 12-Jan-2007  ad Sync with head.
 1.18.42.1 02-Jan-2008  bouyer Sync with HEAD
 1.18.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.18.28.1 09-Jan-2008  matt sync with HEAD
 1.19.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.19.10.1 04-May-2009  yamt sync with head.
 1.19.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.24.2.2 23-May-2012  yamt sync with head.
 1.24.2.1 17-Apr-2012  yamt sync with head
 1.25.4.1 29-Apr-2012  mrg sync to latest -current.
 1.26.16.1 06-Jun-2015  skrll Sync with HEAD
 1.26.2.1 03-Dec-2017  jdolecek update from HEAD
 1.27.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.27.18.1 10-Jun-2019  christos Sync with HEAD
 1.27.16.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.27.16.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.30.6.1 29-Feb-2020  ad Sync with head.
 1.32.8.1 01-Aug-2021  thorpej Sync with HEAD.
 1.13 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.12 11-Dec-2005  christos branches: 1.12.78; 1.12.98; 1.12.100;
merge ktrace-lwp.
 1.11 17-Sep-2005  yamt include "conf/std".
 1.10 06-Dec-2001  minoura branches: 1.10.16; 1.10.32;
Add ELF support.
 1.9 22-Jun-2000  fvdl branches: 1.9.4; 1.9.8;
Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.8 15-Nov-1999  fvdl branches: 1.8.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.7 30-Mar-1999  minoura branches: 1.7.8; 1.7.14;
Remove options (SWDEV|SWAP|VNODE)PAGE
 1.6 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.5 08-Sep-1998  minoura branches: 1.5.6;
Activated options *_PAGER.
That was a careless mistake.
 1.4 07-Sep-1998  minoura Make it usable.
 1.3 08-May-1997  oki cleanup use of whitespace
 1.2 27-Oct-1996  oki Add options EXEC_SCRIPT and EXEC_AOUT.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.7.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 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.8.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.9.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.9.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.32.1 21-Jun-2006  yamt sync with head.
 1.10.16.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.100.1 05-Mar-2011  rmind sync with head
 1.12.98.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.12.78.1 09-Oct-2010  yamt sync with head
 1.3 02-May-2001  minoura Remove old obsolete audio driver.
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.28 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.27 17-Dec-2023  andvar Fix format specifiers and use BMD_UNIT(dev) macro to fix BMD_DEBUG build.
 1.26 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.25 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.24 26-Apr-2015  mlelstv Use C99-style initializers for struct dkdriver.
 1.23 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.22 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.21 25-Jul-2014  dholland branches: 1.21.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.20 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.19 16-Mar-2014  dholland branches: 1.19.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.18 16-Oct-2011  isaki branches: 1.18.2; 1.18.12; 1.18.16;
Switch to 2-clause license.
 1.17 08-Aug-2010  isaki Probe not only ctrl address but also bank window address.
This prevents the wrong matching when other boards like
Neptune-X exist. Reported by Yasushi Oshima.
 1.16 18-Dec-2008  isaki branches: 1.16.4; 1.16.6;
Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.15 25-Jun-2008  isaki branches: 1.15.4;
Split device_t/softc. Use aprint*() and device_xname().
 1.14 14-Jun-2008  isaki Fix compile errors.
 1.13 13-Jun-2008  cegger use device_lookup_private to get softc
 1.12 15-Dec-2007  perry branches: 1.12.6; 1.12.8; 1.12.10; 1.12.12; 1.12.14;
__FUNCTION__ -> __func__
 1.11 17-Oct-2007  garbled branches: 1.11.4; 1.11.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.10 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.9 29-Jul-2007  ad branches: 1.9.4; 1.9.6; 1.9.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.8 11-Mar-2007  isaki branches: 1.8.8; 1.8.10; 1.8.12;
white space, indent and KNF.
 1.7 05-Mar-2007  he branches: 1.7.2;
Cast to char* before doing pointer arithmetic.
 1.6 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5 11-Dec-2005  christos branches: 1.5.26;
merge ktrace-lwp.
 1.4 13-Jun-2005  he branches: 1.4.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.3 07-Sep-2003  isaki Remove an advertising clause.
 1.2 15-Jul-2003  lukem rcsid
 1.1 01-Dec-2002  isaki branches: 1.1.2; 1.1.8;
Add bmd, memory disk driver for Nereid bank memory.
 1.1.8.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.4 04-Feb-2005  skrll Adapt to branch.
 1.1.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.8.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 01-Dec-2002  thorpej file bmd.c was added on branch nathanw_sa on 2002-12-11 06:12:47 +0000
 1.4.2.4 21-Jan-2008  yamt sync with head
 1.4.2.3 27-Oct-2007  yamt sync with head.
 1.4.2.2 03-Sep-2007  yamt sync with head.
 1.4.2.1 21-Jun-2006  yamt sync with head.
 1.5.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.2.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.7.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.7.2.1 13-Mar-2007  ad Sync with head.
 1.8.12.1 15-Aug-2007  skrll Sync with HEAD.
 1.8.10.1 07-Aug-2007  matt Sync with HEAD.
 1.8.8.2 16-Oct-2007  garbled Sync with HEAD
 1.8.8.1 03-Oct-2007  garbled Sync with HEAD
 1.9.8.1 14-Oct-2007  yamt sync with head.
 1.9.6.2 09-Jan-2008  matt sync with HEAD
 1.9.6.1 06-Nov-2007  matt sync with HEAD
 1.9.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.11.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.11.4.1 26-Dec-2007  ad Sync with head.
 1.12.14.2 27-Jun-2008  simonb Sync with head.
 1.12.14.1 18-Jun-2008  simonb Sync with head.
 1.12.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.12.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.12.10.2 11-Aug-2010  yamt sync with head.
 1.12.10.1 04-May-2009  yamt sync with head.
 1.12.8.1 17-Jun-2008  yamt sync with head.
 1.12.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.12.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.15.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.16.6.1 05-Mar-2011  rmind sync with head
 1.16.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.18.16.1 18-May-2014  rmind sync with head
 1.18.12.2 03-Dec-2017  jdolecek update from HEAD
 1.18.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.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.19.2.1 10-Aug-2014  tls Rebase.
 1.21.4.2 06-Jun-2015  skrll Sync with HEAD
 1.21.4.1 06-Apr-2015  skrll Sync with HEAD
 1.7 02-May-2001  minoura Remove old obsolete audio driver.
 1.6 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.5 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.4 12-Jan-1998  thorpej Update for changes to config.
 1.3 13-Oct-1996  christos backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3 02-May-2001  minoura Remove old obsolete audio driver.
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3 02-May-2001  minoura Remove old obsolete audio driver.
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.58 29-Apr-2012  tsutsui Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.57 24-Apr-2011  rmind branches: 1.57.4; 1.57.8;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.56 23-Nov-2009  rmind branches: 1.56.4; 1.56.6;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.55 18-Jan-2009  isaki Clean up header files.
 1.54 29-Nov-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
Not tested. I don't have its hardware and no response in port-x68k.
 1.53 13-Jun-2008  cegger branches: 1.53.2; 1.53.4;
use device_lookup_private to get softc
 1.52 27-May-2008  ad branches: 1.52.2;
PR kern/38763 "hanging in tty" bugfix breaks the build for vax (and
probably others)
 1.51 28-Apr-2008  martin branches: 1.51.2;
Remove clause 3 and 4 from TNF licenses
 1.50 19-Nov-2007  ad branches: 1.50.14; 1.50.16; 1.50.18;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.49 17-Oct-2007  garbled branches: 1.49.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.48 14-Jul-2007  isaki branches: 1.48.8; 1.48.10; 1.48.14;
Make it compilable after the merge of some vmlocking branch.
OK'ed by ad@.
 1.47 14-Jul-2007  ad - Restore com.c 1.45, par.c 1.31. They were trashed due to file system
corruption on my machine.
- Adjust to match callout_init signature change.
 1.46 09-Jul-2007  ad Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.45 12-May-2007  isaki Clean up white spaces and tabs.
 1.44 11-Mar-2007  isaki branches: 1.44.2; 1.44.8;
white space, indent and KNF.
 1.43 04-Mar-2007  christos branches: 1.43.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.42 01-Oct-2006  elad branches: 1.42.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.41 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!

Also, add forgotten splx() calls in some places.
 1.40 23-Jul-2006  ad branches: 1.40.4; 1.40.6;
Use the LWP cached credentials where sane.
 1.39 14-May-2006  elad integrate kauth.
 1.38 07-Mar-2006  he branches: 1.38.2; 1.38.4;
Remove another instance of the macro triplet SET/CLR/ISSET, now
found in <sys/types.h>.
 1.37 11-Dec-2005  christos branches: 1.37.4; 1.37.6; 1.37.8;
merge ktrace-lwp.
 1.36 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.35 13-Jun-2005  he branches: 1.35.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.34 18-Jan-2005  chs use a global variable to ensure that only one instance is configured
rather than requiring that its unit number be zero.
simplify by not pretending that x68ks can have more than 1 com
(which they might actually have, but the driver doesn't currently allow it).
determine which instance is the console by comparing the iobase rather than
the unit number (which is silly given the above, but whatever).
 1.33 18-Jan-2005  chs de-__P, remove register, ansify.
 1.32 07-Aug-2003  agc branches: 1.32.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.31 15-Jul-2003  lukem rcsid
 1.30 23-Oct-2002  jdolecek branches: 1.30.6;
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.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 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.25 30-May-2002  thorpej Don't include macro params when #undef'ing it.
 1.24 17-Mar-2002  atatat branches: 1.24.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.23 25-Nov-2001  minoura Previous commit was incomplete.
 1.22 25-Nov-2001  minoura Make this file compile again.
 1.21 30-May-2001  lukem branches: 1.21.2; 1.21.4; 1.21.8;
add missing #include "opt_kgdb.h"
 1.20 05-May-2001  minoura Use cdev_decl for prototype declarations (port-x68k/12829, thanks to scw
for suggestion).
Add static to some non-external functions.
 1.19 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.18 02-Nov-2000  eeh branches: 1.18.2;
Adapt to new line discipline scheme.
 1.17 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.16 22-Nov-1999  sommerfeld defopt COM_DEBUG, COM_HAYESP, and COM16650
 1.15 24-Mar-1999  minoura branches: 1.15.8; 1.15.14;
Shut up gcc -Wall.
 1.14 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.13 04-Aug-1998  minoura __BROKEN_INDIRECT_CONFIG fixes.
 1.12 04-Jul-1998  jonathan defopt DDB.
 1.11 30-Jun-1998  msaitoh sync with -current after a long silence
 1.10 12-Jan-1998  thorpej Update for changes to config.
 1.9 17-Oct-1997  oki Make this compile again.
 1.8 15-Oct-1997  thorpej Pulldown from marc-pcmcia branch: minimal changes to change x68k port's
"com" (now "xcom") driver to avoid name collision with the more
heaviliy-used "com" driver.
 1.7 12-Oct-1997  oki Added prototypes.
 1.6 13-Oct-1996  christos branches: 1.6.10;
backout previous kprintf change
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 16-Jul-1996  oki call Debugger() with options DDB, added #ifdef.
 1.3 05-Jun-1996  oki add tty_attach(tp);
 1.2 21-May-1996  oki branches: 1.2.2;
Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.2 16-Jul-1996  jtc Pulled up from rev 1.4 by request from Masaru Oki
 1.2.2.1 05-Jun-1996  oki pull up tty_attach() changes from trunk
 1.6.10.2 15-Oct-1997  thorpej Minimal changes to rename the x68k port's "com" driver to "xcom", to
avoid a namespace collision with the more heavily-used "com" driver,
which needs to be declared in sys/conf/files.
 1.6.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.15.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.18.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.21.8.7 11-Nov-2002  nathanw Catch up to -current
 1.21.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.21.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.21.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.21.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.21.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.21.8.1 30-May-2001  nathanw file com.c was added on branch nathanw_sa on 2002-01-08 00:28:37 +0000
 1.21.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.21.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.21.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.21.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.21.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.24.4.2 15-Jul-2002  gehenna catch up with -current.
 1.24.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.30.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.30.6.5 04-Feb-2005  skrll Adapt to branch.
 1.30.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.30.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.30.6.1 03-Aug-2004  skrll Sync with HEAD
 1.32.8.1 29-Apr-2005  kent sync with -current
 1.35.2.4 07-Dec-2007  yamt sync with head
 1.35.2.3 03-Sep-2007  yamt sync with head.
 1.35.2.2 30-Dec-2006  yamt sync with head.
 1.35.2.1 21-Jun-2006  yamt sync with head.
 1.37.8.3 11-Aug-2006  yamt sync with head
 1.37.8.2 24-May-2006  yamt sync with head.
 1.37.8.1 13-Mar-2006  yamt sync with head.
 1.37.6.2 01-Jun-2006  kardel Sync with head.
 1.37.6.1 22-Apr-2006  simonb Sync with head.
 1.37.4.1 09-Sep-2006  rpaulo sync with head
 1.38.4.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.38.2.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.38.2.3 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.38.2.2 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.38.2.1 07-Mar-2006  elad file com.c was added on branch elad-kernelauth on 2006-03-08 00:43:19 +0000
 1.40.6.1 22-Oct-2006  yamt sync with head
 1.40.4.1 18-Nov-2006  ad Sync with head.
 1.42.4.2 17-May-2007  yamt sync with head.
 1.42.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.43.2.4 03-Dec-2007  ad Sync with HEAD.
 1.43.2.3 15-Jul-2007  ad Sync with head.
 1.43.2.2 27-May-2007  ad Sync with head.
 1.43.2.1 13-Mar-2007  ad Sync with head.
 1.44.8.2 03-Oct-2007  garbled Sync with HEAD
 1.44.8.1 22-May-2007  matt Update to HEAD.
 1.44.2.1 11-Jul-2007  mjf Sync with head.
 1.48.14.1 21-Nov-2007  bouyer Sync with HEAD
 1.48.10.2 09-Jan-2008  matt sync with HEAD
 1.48.10.1 06-Nov-2007  matt sync with HEAD
 1.48.8.1 21-Nov-2007  joerg Sync with HEAD.
 1.49.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.50.18.3 11-Mar-2010  yamt sync with head
 1.50.18.2 04-May-2009  yamt sync with head.
 1.50.18.1 16-May-2008  yamt sync with head.
 1.50.16.3 17-Jun-2008  yamt sync with head.
 1.50.16.2 04-Jun-2008  yamt sync with head
 1.50.16.1 18-May-2008  yamt sync with head.
 1.50.14.3 17-Jan-2009  mjf Sync with HEAD.
 1.50.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.50.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.51.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.52.2.1 18-Jun-2008  simonb Sync with head.
 1.53.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.53.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.56.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.56.4.1 31-May-2011  rmind sync with head
 1.57.8.1 29-Apr-2012  mrg sync to latest -current.
 1.57.4.1 23-May-2012  yamt sync with head.
 1.2 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.1 29-Apr-2012  tsutsui branches: 1.1.2; 1.1.4; 1.1.42; 1.1.44;
Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.1.44.1 10-Jun-2019  christos Sync with HEAD
 1.1.42.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.1.4.2 23-May-2012  yamt sync with head.
 1.1.4.1 29-Apr-2012  yamt file com_intio.c was added on branch yamt-pagecache on 2012-05-23 10:07:50 +0000
 1.1.2.2 29-Apr-2012  mrg sync to latest -current.
 1.1.2.1 29-Apr-2012  mrg file com_intio.c was added on branch jmcneill-usbmp on 2012-04-29 23:04:42 +0000
 1.5 29-Apr-2012  tsutsui Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.4 11-Dec-2005  christos branches: 1.4.112; 1.4.116;
merge ktrace-lwp.
 1.3 13-Dec-2004  chs rather than duplicate the contents of the MI version of this file,
just include it and redefine the one thing that we want to be different.
 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 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.4 18-Dec-2004  skrll Sync with HEAD.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.4.116.1 29-Apr-2012  mrg sync to latest -current.
 1.4.112.1 23-May-2012  yamt sync with head.
 1.7 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.6 22-Aug-1998  minoura branches: 1.6.6;
Eliminated vm_offset_t and vm_size_t.
 1.5 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.4 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.3 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.2 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.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.6.6.1 13-Feb-1999  minoura Now we have bus_dma implementation, this file is unnecessary.
 1.12 11-Aug-2017  isaki Fix a Continue Operation.
Patch from Y.Sugahara.
 1.11 11-Aug-2017  isaki Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
 1.10 25-Jun-2008  isaki branches: 1.10.40; 1.10.60; 1.10.76;
Split device_t/softc for dmac_*_xfer().
Rename some variables to avoid confusing.
 1.9 25-Jun-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
 1.8 28-Apr-2008  martin branches: 1.8.2; 1.8.4;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.74; 1.7.76; 1.7.78;
merge ktrace-lwp.
 1.6 12-Jun-2005  he Change the `name' argument of dmac_alloc_channel to const char*, so that
a string constant can be used without generating a warning.
 1.5 18-Jan-2005  chs de-__P, remove register, ansify.
 1.4 02-May-2001  minoura branches: 1.4.8; 1.4.24; 1.4.32;
Disable array chain mode by default, since it is unused by any of
the current devices.
Add more flexibility in the API.
 1.3 30-Apr-2001  minoura Correct memory leak.
Use single block transfer when appropriate.
 1.2 16-Mar-1999  minoura branches: 1.2.20;
Merged minoura_x68k_bus_h branch.
 1.1 30-Jan-1999  minoura branches: 1.1.2;
file dmacvar.h was initially added on branch minoura_x68k_bus_h.
 1.1.2.2 02-Feb-1999  minoura Arg for Interrupt handlers.
 1.1.2.1 30-Jan-1999  minoura Added DMAC driver.
 1.2.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.32.1 29-Apr-2005  kent sync with -current
 1.4.24.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.24.1 24-Jan-2005  skrll Sync with HEAD.
 1.4.8.2 02-May-2001  minoura Disable array chain mode by default, since it is unused by any of
the current devices.
Add more flexibility in the API.
 1.4.8.1 02-May-2001  minoura file dmacvar.h was added on branch nathanw_sa on 2001-05-02 12:48:25 +0000
 1.7.78.2 04-May-2009  yamt sync with head.
 1.7.78.1 16-May-2008  yamt sync with head.
 1.7.76.1 18-May-2008  yamt sync with head.
 1.7.74.2 29-Jun-2008  mjf Sync with HEAD.
 1.7.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.4.1 27-Jun-2008  simonb Sync with head.
 1.8.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.10.76.1 23-Sep-2017  snj Pull up following revision(s) (requested by isaki in ticket #290):
sys/arch/x68k/dev/dmacvar.h: revision 1.11-1.12 via patch
sys/arch/x68k/dev/intio_dmac.c: revision 1.36-1.37 via patch
sys/arch/x68k/dev/fd.c: revision 1.120 via patch
sys/arch/x68k/dev/vs.c: revision 1.45-1.46 via patch
Use dmac_prepare_xfer().
From Y.Sugahara.
--
Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
--
Fix a Continue Operation.
Patch from Y.Sugahara.
 1.10.60.1 28-Aug-2017  skrll Sync with HEAD
 1.10.40.1 03-Dec-2017  jdolecek update from HEAD
 1.4 19-Oct-2002  isaki Not used anywhere.
 1.3 22-Aug-1998  minoura branches: 1.3.32;
Eliminated vm_offset_t and vm_size_t.
 1.2 12-Oct-1997  oki Added prototypes.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.32.1 11-Nov-2002  nathanw Catch up to -current
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.24;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.24.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.20 26-May-2022  tsutsui KNF a bit.
 1.19 26-Sep-2021  thorpej Driver "kqfilter" entry points return an error code, so if an invalid
filter is requested, return EINVAL rather than 1.
 1.18 26-Sep-2021  thorpej Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89
 1.17 19-Dec-2020  thorpej Use sel{record,remove}_knote().
 1.16 23-May-2020  ad branches: 1.16.2;
Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.15 25-Oct-2017  maya Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- { a, b, c, d
+ {
+ .f_isfd = a,
+ .f_attach = b,
+ .f_detach = c,
+ .f_event = d,
};
 1.14 21-Mar-2014  tsutsui Replace tsleep(9)/wakeup(9) with condvar(9) as practice.

Also replace malloc(9) with kmem_alloc(9).
Pevent more possible races.

Tested on both console and Xserver on X68030.
 1.13 01-Mar-2008  rmind branches: 1.13.38; 1.13.48; 1.13.54;
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.12 04-Mar-2007  christos branches: 1.12.20; 1.12.36; 1.12.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 11-Dec-2005  christos branches: 1.11.26;
merge ktrace-lwp.
 1.10 18-Jan-2005  chs branches: 1.10.8;
de-__P, remove register, ansify.
 1.9 07-Aug-2003  agc branches: 1.9.8;
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-Jul-2003  lukem rcsid
 1.7 26-Nov-2002  christos branches: 1.7.6;
si_ -> sel_
 1.6 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.5 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.4 27-Nov-1996  oki branches: 1.4.44; 1.4.48;
renamed variable in ev_poll(), compile again.
 1.3 23-Nov-1996  oki Implement poll(2).
 1.2 29-May-1996  oki added missing splx(s). pointed out by thorpej.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.4;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.4.1 29-May-1996  oki pull up version 1.2 from the main branch.
 1.4.48.3 11-Dec-2002  thorpej Sync with HEAD.
 1.4.48.2 11-Nov-2002  nathanw Catch up to -current
 1.4.48.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.44.4 02-Oct-2002  jdolecek do not need the (void *) cast for kn_hook anymore
 1.4.44.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.44.2 12-Sep-2001  thorpej Fix a past'o.
 1.4.44.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.7.6.5 04-Feb-2005  skrll Adapt to branch.
 1.7.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.8.3 17-Mar-2008  yamt sync with head.
 1.10.8.2 03-Sep-2007  yamt sync with head.
 1.10.8.1 21-Jun-2006  yamt sync with head.
 1.11.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.12.36.1 24-Mar-2008  keiichi sync with head.
 1.12.20.1 23-Mar-2008  matt sync with HEAD
 1.13.54.1 18-May-2014  rmind sync with head
 1.13.48.2 03-Dec-2017  jdolecek update from HEAD
 1.13.48.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.38.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.2.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.10 21-Mar-2014  tsutsui Replace tsleep(9)/wakeup(9) with condvar(9) as practice.

Also replace malloc(9) with kmem_alloc(9).
Pevent more possible races.

Tested on both console and Xserver on X68030.
 1.9 15-Aug-2012  tsutsui branches: 1.9.2; 1.9.4;
Make sure to take proc_lock mutex on calling psignal(9) in EV_WAKEUP() macro
as sys/dev/sun/event_var.h does.
Fixes immediate KASSERT(mutex_owned(proc_lock)) panic during running Xserver
on DIAGNOSTIC kernel.

Should be pulled up to netbsd-6.
 1.8 01-Mar-2008  rmind branches: 1.8.38; 1.8.44;
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.7 04-Mar-2007  christos branches: 1.7.20; 1.7.36; 1.7.40;
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 18-Jan-2005  chs branches: 1.5.8;
de-__P, remove register, ansify.
 1.4 07-Aug-2003  agc branches: 1.4.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 23-Oct-2002  jdolecek branches: 1.3.6;
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.2 10-Oct-1997  oki branches: 1.2.32; 1.2.36;
Add missing prototype.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.36.1 11-Nov-2002  nathanw Catch up to -current
 1.2.32.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.3.6.5 04-Feb-2005  skrll Adapt to branch.
 1.3.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.8.3 17-Mar-2008  yamt sync with head.
 1.5.8.2 03-Sep-2007  yamt sync with head.
 1.5.8.1 21-Jun-2006  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.7.36.1 24-Mar-2008  keiichi sync with head.
 1.7.20.1 23-Mar-2008  matt sync with HEAD
 1.8.44.1 16-Aug-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #504):
sys/arch/x68k/dev/event_var.h: revision 1.9
Make sure to take proc_lock mutex on calling psignal(9) in EV_WAKEUP() macro
as sys/dev/sun/event_var.h does.
Fixes immediate KASSERT(mutex_owned(proc_lock)) panic during running Xserver
on DIAGNOSTIC kernel.
Should be pulled up to netbsd-6.
 1.8.38.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.8.38.1 30-Oct-2012  yamt sync with head
 1.9.4.1 18-May-2014  rmind sync with head
 1.9.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.129 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.128 17-Dec-2023  andvar s/FD_DEBUG/FDDEBUG/ for consistency.
 1.127 26-May-2022  tsutsui Make local functions and variable static.
 1.126 23-May-2022  tsutsui Remove unused variables.
 1.125 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.124 24-Apr-2021  thorpej branches: 1.124.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.123 10-Nov-2019  chs branches: 1.123.10;
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.122 08-Feb-2019  mrg make *fd*.c's fd_dev_to_type() always a static inline. some
have it as a const, and have code to copy the defaults to
modify them before using them, but that probably requires a
real test to feel confident in changing.
 1.121 03-Sep-2018  riastradh 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.120 11-Aug-2017  isaki branches: 1.120.2; 1.120.4;
Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
 1.119 12-Jan-2017  isaki branches: 1.119.8;
Fix the possibility of off-by-one on the grammer. Reported by coypu.
Currently it never happens because type is (minor number % 7) and
the arraycount of fd_types[] is 8. I.e., it is a dead code...
However, when the capacity of the FDTYPE() changes or the arraycount
of fd_types[] changes, this correction will be effective.
 1.118 11-Jul-2015  kamil branches: 1.118.2;
Improve spelling: regsiter -> register

This change is non-functional.

Approved by <riastradh>, <pgoyette>
 1.117 26-Apr-2015  mlelstv Use C99-style initializers for struct dkdriver.
 1.116 13-Apr-2015  riastradh MD rnd.h cleanups. Please let me know if I broke anything!
 1.115 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.114 02-Jan-2015  christos restore part decl.
 1.113 01-Jan-2015  christos declare error
 1.112 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.111 10-Aug-2014  tls branches: 1.111.4;
Merge tls-earlyentropy branch into HEAD.
 1.110 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.109 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.108 26-Mar-2014  christos branches: 1.108.2;
kill sprintf, fix unused.
 1.107 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.106 24-May-2013  christos branches: 1.106.2;
kill bogus inline
 1.105 14-Oct-2012  tsutsui KNF and space nits
 1.104 14-Oct-2012  tsutsui Add floppy format support. Mostly taken from sys/dev/isa/fd.c.

Tested both fdNa (1232KB, 1024bytes/sector, 8sectors/track) and
fdNc (1200KB, 512bytes/sector, 15sectors/track) format on X68030
using fdformat(1).

Finally we can prepare NetBSD/x68k install floppies without Human68k
(except actual initial bootstrap).
 1.103 14-Oct-2012  tsutsui Terminate DMAC and call bus_dmamap_unload(9) properly in all FDC xfer
error paths, as sys/dev/isa/fd.c does. Fixes unexpected DMAC errors
(and possible VM panic due to un-unloaded dmamap) on the first floppy
access after read/write errors.
 1.102 14-Oct-2012  tsutsui Before probing floppy drives, call NE7CMD_SENSEI and fdcresult()
to drain possible pending FDC interrupts. Taken from sys/dev/isa/fd.c.
Hopefully might fix occasional fd drive probe failure (but not confirmed).
 1.101 15-May-2012  tsutsui branches: 1.101.2;
- check bus_space_map(9) return value
- use BUS_SPACE_MAP_SHIFTED_ODD for clarify
- define and use proper macro instead of magic
 1.100 13-May-2012  tsutsui KNF and cosmetics. No binary change.
 1.99 13-May-2012  tsutsui - use <sys/bus.h> rather than <machine/bus.h>
- no need to include uvm_extern.h
- include "ioconf.h" for struct cfdriver foo_cd
 1.98 12-May-2012  tsutsui Explicitly specify a proper FDC data register address for HD63450 DMAC
to avoid confusion.

Previous one (fdc->sc_addr + fddata) wasn't a right address for
the FDC's data register but one for the command register by accident,
but FDC ignores A0 address input (connected to A1 of x68k address bus)
during DMA xfer (i.e. when DACK is asserted) so it happened to work
as expected on the real X680x0 hardware, but caused trouble on emulators.

The inconsistency was found by Y.Sugahara during debugging XM6i emulator
(and it will be fixed in the next release).
FDC behavior during DMA is confirmed by uPD72068 hardware application note.

XXX: There is no proper MI API to specify DMA address for DMA controller
(like MC68450) to access devices mapped to memory space by bus_space(9).
 1.97 06-May-2012  tsutsui Make x68k's floppy driver actually work with proper bounce buffer xfer ops
on machines with extended high memories:

- dev/fd.c:
- add missing bus_dmamap_sync(9) POSTREAD/POSTWRITE ops

- x68k/machdep.c:
- update avail_end variable (which is used to check DMA'able memory range
in intio.c) properly per probed extended memory regions

The problem was found during debugging XM6i's FDC emulation by
Y.Sugahara, isaki@, and me.

Should be pulled up to netbsd-6.
 1.96 02-Feb-2012  tls branches: 1.96.2;
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.95 19-Nov-2011  tls branches: 1.95.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.94 10-Apr-2011  tsutsui branches: 1.94.4;
Fix hangup on the first floppy access since 2008.
Problem was reported by isaki@.

On X680x0 (and most other machines other than ISA FDC),
the ready line from FDD is connected to FDC and fdc driver can
be notified of the ready state after fd_set_motor() by interrupts.
In this case no need to use callout(9) to wait the FDD motor stabilized,
and the callout(9) method used in ISA fdc(4) driver rather caused
infinite unhandled interrupts since callout(9) was no longer invoked
during interrupt storm after vmlocking2 merge, I guess.

Should be pulled up to netbsd-5.
 1.93 06-Jun-2010  mrg branches: 1.93.2;
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.92 18-Jan-2009  isaki branches: 1.92.4; 1.92.6;
Clean up header files.
 1.91 13-Jan-2009  yamt g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.90 10-Jan-2009  isaki Clean up messages.
- fdcintr: remove duplicated status message.
- fdioctl: make it easy to track ioctl.
 1.89 10-Jan-2009  isaki fdc->sc_dev is not necessary.
 1.88 18-Dec-2008  isaki Make it compilable again.
 1.87 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.86 05-Dec-2008  isaki Use TAILQ_* macros.
 1.85 29-Jun-2008  isaki branches: 1.85.2; 1.85.4; 1.85.6;
Make it compilable even if FDDEBUG was defined.
 1.84 25-Jun-2008  isaki Link to device_t. I had forgotten it in previous commit.
 1.83 25-Jun-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
 1.82 14-Jun-2008  isaki Fix compile errors.
 1.81 13-Jun-2008  cegger 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 17-Oct-2007  garbled branches: 1.79.16; 1.79.18; 1.79.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.78 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.77 29-Jul-2007  ad branches: 1.77.4; 1.77.6; 1.77.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.76 09-Jul-2007  ad branches: 1.76.2; 1.76.4;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.75 20-May-2007  isaki Make it compilable with FDDEBUG.
 1.74 12-May-2007  isaki Clean up white spaces and tabs.
 1.73 11-Mar-2007  isaki branches: 1.73.2; 1.73.8;
white space, indent and KNF.
 1.72 05-Mar-2007  he branches: 1.72.2;
Cast to char* before doing pointer arithmetic.
 1.71 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.70 14-Apr-2006  blymn branches: 1.70.14;
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.69 28-Mar-2006  thorpej Use device_unit().
 1.68 23-Feb-2006  thorpej branches: 1.68.2; 1.68.4; 1.68.6;
Use device_parent().
 1.67 24-Dec-2005  perry branches: 1.67.2; 1.67.4; 1.67.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.66 11-Dec-2005  christos merge ktrace-lwp.
 1.65 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.64 12-Jun-2005  he branches: 1.64.2;
Sprinkle some consts to allow this to compile with -Wcast-qual.
 1.63 18-Jan-2005  chs de-__P, remove register, ansify.
 1.62 28-Oct-2004  yamt branches: 1.62.4;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.61 08-May-2004  minoura An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.60 15-Nov-2003  isaki make it compilable even if FDDEBUG was defined.
 1.59 01-Nov-2003  jdolecek fix several places where variables might be used uninitialized
 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 15-Jul-2003  lukem rcsid
 1.56 18-Jun-2003  drochner branches: 1.56.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.55 03-May-2003  wiz DMA, not dma nor Dma.
 1.54 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.53 02-Feb-2003  isaki Fix printf format for DIAGNOSTIC, in the wake of daddr_t having changed.
Use PRId64, instead of %lld.
 1.52 25-Jan-2003  isaki Make it compilable with 64bit daddr_t.
 1.51 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.50 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.49 20-Oct-2002  isaki Remove unbalanced parenthesis in debug message.
 1.48 13-Oct-2002  isaki Style fixes.
 1.47 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.46 01-Oct-2002  thorpej Missed one use of CFATTACH_DECL().
 1.45 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.44 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.43 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.42 01-Aug-2002  hannken Convert to new device buffer queue interface.

Approved by: NISHIMURA Takeshi <nsmrtks@netbsd.org>
 1.41 31-Jul-2002  isaki Fix compile warnings in debug code.
 1.40 27-Dec-2001  wiz branches: 1.40.8;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.39 19-Dec-2001  minoura Implement bus_dmamap_sync properly.
dma_cachectl is now used only for DMAC array chain.
 1.38 25-Nov-2001  minoura Avoid using array chaining mode of DMAC.
 1.37 08-Jul-2001  wiz branches: 1.37.2; 1.37.4; 1.37.8;
Correct various misspellings of 'transfer' and inflected forms.
 1.36 02-May-2001  minoura Do not use constants, but macros.
 1.35 29-Jun-2000  mrg branches: 1.35.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.34 18-Apr-2000  minoura Explicitly include opt_m680x0.h.
 1.33 07-Apr-2000  thorpej Use separate callouts for motor-on and motor-off. Fixes a condition
where the floppy driver would wedge because a motor-on timeout would
be cancelled by another I/O operation cancelling a motor-off timeout.

From enami tsugutomo <enami@sm.sony.co.jp>.
 1.32 27-Mar-2000  minoura Make this compile (typo in callout change).
 1.31 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.30 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.29 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.28 24-Mar-1999  minoura branches: 1.28.8; 1.28.14;
Shut up gcc -Wall.
 1.27 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.26 18-Mar-1999  minoura Correct rnd_attach_source args.
 1.25 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.24 08-Feb-1999  bouyer Change DIOCEJECT to do what's needed to eject a device before the eject
command (unlock for sd and cd) if no other partitions are open, return
EBUSY otherwise. DIOCEJECT will have the old semantic if its argument is not
0. The old ioctl has been renamed to ODIOCEJECT for binary compatibility.
 1.23 22-Aug-1998  minoura branches: 1.23.6;
Eliminated vm_offset_t and vm_size_t.
 1.22 15-Aug-1998  mycroft Assign copyrights to TNF.
 1.21 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.20 04-Aug-1998  minoura __BROKEN_INDIRECT_CONFIG fixes.
 1.19 04-Jul-1998  jonathan defopt DDB.
 1.18 30-Jun-1998  msaitoh sync with -current after a long silence
 1.17 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.16 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.15 12-Jan-1998  thorpej Update for changes to config.
 1.14 12-Oct-1997  oki Added prototype.
 1.13 10-Oct-1997  oki Fdopen --> fdopen
 1.12 17-Jul-1997  jtk branches: 1.12.2;
use locator defines in "locators.h" to index cf_loc[]
 1.11 02-Apr-1997  oki Add bits[64] declaration
 1.10 05-Feb-1997  oki Use bitmask_snprintf (from i386)
 1.9 31-Jan-1997  thorpej Use new machine-independent mountroothook code.
 1.8 13-Oct-1996  christos backout previous kprintf change
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.6 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.5 11-Aug-1996  oki drive 2 (or 3) couldn't access with drive 0 (or 1). fixed this.
 1.4 08-Jul-1996  oki move wait for insert system floppy to mountroot_hook stuff
 1.3 05-Jun-1996  oki fixed compiler error at kvtop().
 1.2 21-May-1996  oki branches: 1.2.2;
Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.3 16-Aug-1996  jtc Pulled up from rev 1.5 by request from oki
 1.2.2.2 08-Jul-1996  jtc Pulled up from rev 1.4 by request from Masaru Oki
 1.2.2.1 05-Jun-1996  oki pull up from the trunk:
>fixed compiler error at kvtop().
 1.12.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.6.5 14-Mar-1999  minoura Mis-sync.
 1.23.6.4 14-Mar-1999  minoura Sync.
 1.23.6.3 13-Feb-1999  minoura Use BUS_SPACE_MAP_SHIFTED.
Flush the data cache for the transfer buffer.
Handle INTIOCF_{INTR,DMA,DMAINTR}_DEFAULT cases.
 1.23.6.2 10-Feb-1999  minoura Sync with other ports'(i386,sparc) fd.c.
Use dma_cachectl.
note: still unstable especially on soft err.
 1.23.6.1 02-Feb-1999  minoura fdc at intio.
 1.28.14.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.28.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.35.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.37.8.8 03-Jan-2003  thorpej Sync with HEAD.
 1.37.8.7 11-Nov-2002  nathanw Catch up to -current
 1.37.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.37.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.37.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.37.8.3 01-Aug-2002  nathanw Catch up to -current.
 1.37.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.37.8.1 08-Jul-2001  nathanw file fd.c was added on branch nathanw_sa on 2002-01-08 00:28:38 +0000
 1.37.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.37.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.37.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.37.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.40.8.2 31-Aug-2002  gehenna catch up with -current.
 1.40.8.1 17-May-2002  gehenna Add device switch.
 1.56.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.56.2.6 04-Feb-2005  skrll Adapt to branch.
 1.56.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.56.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.56.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.56.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.56.2.1 03-Aug-2004  skrll Sync with HEAD
 1.62.4.1 29-Apr-2005  kent sync with -current
 1.64.2.3 27-Oct-2007  yamt sync with head.
 1.64.2.2 03-Sep-2007  yamt sync with head.
 1.64.2.1 21-Jun-2006  yamt sync with head.
 1.67.6.1 22-Apr-2006  simonb Sync with head.
 1.67.4.1 09-Sep-2006  rpaulo sync with head
 1.67.2.1 01-Mar-2006  yamt sync with head.
 1.68.6.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.68.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.68.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.68.2.2 24-May-2006  yamt sync with head.
 1.68.2.1 01-Apr-2006  yamt sync with head.
 1.70.14.2 17-May-2007  yamt sync with head.
 1.70.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.72.2.5 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.72.2.4 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.72.2.3 15-Jul-2007  ad Sync with head.
 1.72.2.2 27-May-2007  ad Sync with head.
 1.72.2.1 13-Mar-2007  ad Sync with head.
 1.73.8.3 16-Oct-2007  garbled Sync with HEAD
 1.73.8.2 03-Oct-2007  garbled Sync with HEAD
 1.73.8.1 22-May-2007  matt Update to HEAD.
 1.73.2.1 11-Jul-2007  mjf Sync with head.
 1.76.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.76.2.1 07-Aug-2007  matt Sync with HEAD.
 1.77.8.1 14-Oct-2007  yamt sync with head.
 1.77.6.1 06-Nov-2007  matt sync with HEAD
 1.77.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.79.20.3 11-Aug-2010  yamt sync with head.
 1.79.20.2 04-May-2009  yamt sync with head.
 1.79.20.1 16-May-2008  yamt sync with head.
 1.79.18.2 17-Jun-2008  yamt sync with head.
 1.79.18.1 18-May-2008  yamt sync with head.
 1.79.16.4 17-Jan-2009  mjf Sync with HEAD.
 1.79.16.3 02-Jul-2008  mjf Sync with HEAD.
 1.79.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.79.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.80.4.3 03-Jul-2008  simonb Sync with head.
 1.80.4.2 27-Jun-2008  simonb Sync with head.
 1.80.4.1 18-Jun-2008  simonb Sync with head.
 1.80.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.80.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.85.6.1 20-May-2011  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1617):
sys/arch/x68k/dev/fd.c: revision 1.94 via patch
Fix hangup on the first floppy access since 2008.
Problem was reported by isaki@.
On X680x0 (and most other machines other than ISA FDC),
the ready line from FDD is connected to FDC and fdc driver can
be notified of the ready state after fd_set_motor() by interrupts.
In this case no need to use callout(9) to wait the FDD motor stabilized,
and the callout(9) method used in ISA fdc(4) driver rather caused
infinite unhandled interrupts since callout(9) was no longer invoked
during interrupt storm after vmlocking2 merge, I guess.
Should be pulled up to netbsd-5.
 1.85.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.85.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.92.6.2 21-Apr-2011  rmind sync with head
 1.92.6.1 03-Jul-2010  rmind sync with head
 1.92.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.93.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.94.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.94.4.3 30-Oct-2012  yamt sync with head
 1.94.4.2 23-May-2012  yamt sync with head.
 1.94.4.1 17-Apr-2012  yamt sync with head
 1.95.2.2 02-Jun-2012  mrg sync to latest -current.
 1.95.2.1 18-Feb-2012  mrg merge to -current.
 1.96.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #646):
sys/arch/x68k/dev/intio_dmac.c: revision 1.34
sys/arch/x68k/dev/fd.c: revision 1.100
sys/arch/x68k/dev/fd.c: revision 1.101
sys/arch/x68k/dev/fd.c: revision 1.102
sys/arch/x68k/dev/fd.c: revision 1.103
sys/arch/x68k/dev/fd.c: revision 1.104
sys/arch/x68k/dev/fd.c: revision 1.105
sys/arch/x68k/dev/fd.c: revision 1.98
sys/arch/x68k/dev/fd.c: revision 1.99
sys/arch/x68k/dev/fdreg.h: revision 1.5
sys/arch/x68k/dev/fdreg.h: revision 1.6
Explicitly specify a proper FDC data register address for HD63450 DMAC
to avoid confusion.
Previous one (fdc->sc_addr + fddata) wasn't a right address for
the FDC's data register but one for the command register by accident,
but FDC ignores A0 address input (connected to A1 of x68k address bus)
during DMA xfer (i.e. when DACK is asserted) so it happened to work
as expected on the real X680x0 hardware, but caused trouble on emulators.
The inconsistency was found by Y.Sugahara during debugging XM6i emulator
(and it will be fixed in the next release).
FDC behavior during DMA is confirmed by uPD72068 hardware application note.
XXX: There is no proper MI API to specify DMA address for DMA controller
(like MC68450) to access devices mapped to memory space by bus_space(9).
- use <sys/bus.h> rather than <machine/bus.h>
- no need to include uvm_extern.h
- include "ioconf.h" for struct cfdriver foo_cd
KNF and cosmetics. No binary change.
- check bus_space_map(9) return value
- use BUS_SPACE_MAP_SHIFTED_ODD for clarify
- define and use proper macro instead of magic
To abort DMA in dmac_abort_xfer(), set DMAC_CCR_SAB (software abort)
rather than DMAC_CCR_HLT (halt operation).
DMAC_CCR_HLT doesn't abort DMA xfers but only suspends DMA ops
(i.e. clearing HLT bit will resume DMA xfers), so previously
DMAC error always occurs on the next DMA xfer ops after
dmac_abort_xfer() is called.
Also suppress DMAC error messages in dmac_error() if it's caused
by software abort command because it can happen during normal
audio play/record DMA ops in vs(4) driver.
Before probing floppy drives, call NE7CMD_SENSEI and fdcresult()
to drain possible pending FDC interrupts. Taken from sys/dev/isa/fd.c.
Hopefully might fix occasional fd drive probe failure (but not confirmed).
Terminate DMAC and call bus_dmamap_unload(9) properly in all FDC xfer
error paths, as sys/dev/isa/fd.c does. Fixes unexpected DMAC errors
(and possible VM panic due to un-unloaded dmamap) on the first floppy
access after read/write errors.
Add floppy format support. Mostly taken from sys/dev/isa/fd.c.
Tested both fdNa (1232KB, 1024bytes/sector, 8sectors/track) and
fdNc (1200KB, 512bytes/sector, 15sectors/track) format on X68030
using fdformat(1).
Finally we can prepare NetBSD/x68k install floppies without Human68k
(except actual initial bootstrap).
KNF and space nits
 1.96.2.1 09-May-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #236):
sys/arch/x68k/x68k/machdep.c: revision 1.182
sys/arch/x68k/dev/fd.c: revision 1.97
Make x68k's floppy driver actually work with proper bounce buffer xfer ops
on machines with extended high memories:
- dev/fd.c:
- add missing bus_dmamap_sync(9) POSTREAD/POSTWRITE ops
- x68k/machdep.c:
- update avail_end variable (which is used to check DMA'able memory range
in intio.c) properly per probed extended memory regions
The problem was found during debugging XM6i's FDC emulation by
Y.Sugahara, isaki@, and me.
Should be pulled up to netbsd-6.
 1.101.2.4 03-Dec-2017  jdolecek update from HEAD
 1.101.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.101.2.2 23-Jun-2013  tls resync from head
 1.101.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.106.2.1 18-May-2014  rmind sync with head
 1.108.2.2 10-Aug-2014  tls Rebase.
 1.108.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.111.4.5 28-Aug-2017  skrll Sync with HEAD
 1.111.4.4 05-Feb-2017  skrll Sync with HEAD
 1.111.4.3 22-Sep-2015  skrll Sync with HEAD
 1.111.4.2 06-Jun-2015  skrll Sync with HEAD
 1.111.4.1 06-Apr-2015  skrll Sync with HEAD
 1.118.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.119.8.1 23-Sep-2017  snj Pull up following revision(s) (requested by isaki in ticket #290):
sys/arch/x68k/dev/dmacvar.h: revision 1.11-1.12 via patch
sys/arch/x68k/dev/intio_dmac.c: revision 1.36-1.37 via patch
sys/arch/x68k/dev/fd.c: revision 1.120 via patch
sys/arch/x68k/dev/vs.c: revision 1.45-1.46 via patch
Use dmac_prepare_xfer().
From Y.Sugahara.
--
Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
--
Fix a Continue Operation.
Patch from Y.Sugahara.
 1.120.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.120.4.1 10-Jun-2019  christos Sync with HEAD
 1.120.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.123.10.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.124.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 14-Oct-2012  tsutsui Add floppy format support. Mostly taken from sys/dev/isa/fd.c.

Tested both fdNa (1232KB, 1024bytes/sector, 8sectors/track) and
fdNc (1200KB, 512bytes/sector, 15sectors/track) format on X68030
using fdformat(1).

Finally we can prepare NetBSD/x68k install floppies without Human68k
(except actual initial bootstrap).
 1.5 15-May-2012  tsutsui branches: 1.5.2;
- check bus_space_map(9) return value
- use BUS_SPACE_MAP_SHIFTED_ODD for clarify
- define and use proper macro instead of magic
 1.4 11-Dec-2005  christos branches: 1.4.112; 1.4.116; 1.4.118;
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 16-Mar-1999  minoura branches: 1.2.42;
Merged minoura_x68k_bus_h branch.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.24;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.24.3 13-Feb-1999  minoura Use BUS_SPACE_MAP_SHIFTED.
Flush the data cache for the transfer buffer.
Handle INTIOCF_{INTR,DMA,DMAINTR}_DEFAULT cases.
 1.1.1.1.24.2 10-Feb-1999  minoura Sync with other ports'(i386,sparc) fd.c.
Use dma_cachectl.
note: still unstable especially on soft err.
 1.1.1.1.24.1 02-Feb-1999  minoura fdc at intio.
 1.2.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.42.1 03-Aug-2004  skrll Sync with HEAD
 1.4.118.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #646):
sys/arch/x68k/dev/intio_dmac.c: revision 1.34
sys/arch/x68k/dev/fd.c: revision 1.100
sys/arch/x68k/dev/fd.c: revision 1.101
sys/arch/x68k/dev/fd.c: revision 1.102
sys/arch/x68k/dev/fd.c: revision 1.103
sys/arch/x68k/dev/fd.c: revision 1.104
sys/arch/x68k/dev/fd.c: revision 1.105
sys/arch/x68k/dev/fd.c: revision 1.98
sys/arch/x68k/dev/fd.c: revision 1.99
sys/arch/x68k/dev/fdreg.h: revision 1.5
sys/arch/x68k/dev/fdreg.h: revision 1.6
Explicitly specify a proper FDC data register address for HD63450 DMAC
to avoid confusion.
Previous one (fdc->sc_addr + fddata) wasn't a right address for
the FDC's data register but one for the command register by accident,
but FDC ignores A0 address input (connected to A1 of x68k address bus)
during DMA xfer (i.e. when DACK is asserted) so it happened to work
as expected on the real X680x0 hardware, but caused trouble on emulators.
The inconsistency was found by Y.Sugahara during debugging XM6i emulator
(and it will be fixed in the next release).
FDC behavior during DMA is confirmed by uPD72068 hardware application note.
XXX: There is no proper MI API to specify DMA address for DMA controller
(like MC68450) to access devices mapped to memory space by bus_space(9).
- use <sys/bus.h> rather than <machine/bus.h>
- no need to include uvm_extern.h
- include "ioconf.h" for struct cfdriver foo_cd
KNF and cosmetics. No binary change.
- check bus_space_map(9) return value
- use BUS_SPACE_MAP_SHIFTED_ODD for clarify
- define and use proper macro instead of magic
To abort DMA in dmac_abort_xfer(), set DMAC_CCR_SAB (software abort)
rather than DMAC_CCR_HLT (halt operation).
DMAC_CCR_HLT doesn't abort DMA xfers but only suspends DMA ops
(i.e. clearing HLT bit will resume DMA xfers), so previously
DMAC error always occurs on the next DMA xfer ops after
dmac_abort_xfer() is called.
Also suppress DMAC error messages in dmac_error() if it's caused
by software abort command because it can happen during normal
audio play/record DMA ops in vs(4) driver.
Before probing floppy drives, call NE7CMD_SENSEI and fdcresult()
to drain possible pending FDC interrupts. Taken from sys/dev/isa/fd.c.
Hopefully might fix occasional fd drive probe failure (but not confirmed).
Terminate DMAC and call bus_dmamap_unload(9) properly in all FDC xfer
error paths, as sys/dev/isa/fd.c does. Fixes unexpected DMAC errors
(and possible VM panic due to un-unloaded dmamap) on the first floppy
access after read/write errors.
Add floppy format support. Mostly taken from sys/dev/isa/fd.c.
Tested both fdNa (1232KB, 1024bytes/sector, 8sectors/track) and
fdNc (1200KB, 512bytes/sector, 15sectors/track) format on X68030
using fdformat(1).
Finally we can prepare NetBSD/x68k install floppies without Human68k
(except actual initial bootstrap).
KNF and space nits
 1.4.116.1 02-Jun-2012  mrg sync to latest -current.
 1.4.112.2 30-Oct-2012  yamt sync with head
 1.4.112.1 23-May-2012  yamt sync with head.
 1.5.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.47 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.46 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.45 14-Dec-2014  chs add a new "fo_mmap" fileops method to allow use of arbitrary uvm_objects for
mappings of file objects. move vnode-specific details of mmap()ing a vnode
from uvm_mmap() to the new vnode-specific vn_mmap(). add new uvm_mmap_dev()
and uvm_mmap_anon() convenience functions for mapping character devices
and anonymous memory, and replace all other calls to uvm_mmap() with those.
use the new fileop in drm2 so that libdrm can use mmap() to map things
like on other platforms (instead of the ioctl that we have used so far).
 1.44 25-Jul-2014  dholland branches: 1.44.2; 1.44.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.43 16-Mar-2014  dholland branches: 1.43.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.42 31-Jan-2014  tsutsui Fix build botched in previous.

Christos, please at least compile before commit per the guideline.
 1.41 26-Jan-2014  christos kill VM_DEFAULT_ADDRESS use.
 1.40 08-Feb-2011  rmind branches: 1.40.4; 1.40.14; 1.40.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.39 09-Jan-2010  isaki branches: 1.39.4; 1.39.6; 1.39.8;
Make compile with DEBUG.
 1.38 18-Jan-2009  isaki Clean up header files.
 1.37 17-Jan-2009  isaki Split device_t/softc, use aprint*().
 1.36 14-Jun-2008  isaki branches: 1.36.4;
Fix compile errors.
 1.35 13-Jun-2008  cegger use device_lookup_private to get softc
 1.34 30-Jan-2008  tsutsui branches: 1.34.6; 1.34.8; 1.34.10; 1.34.12; 1.34.14;
Fix for v_specinfo removal.
 1.33 04-Mar-2007  christos branches: 1.33.20; 1.33.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.32 28-Mar-2006  thorpej branches: 1.32.14;
Use device_unit().
 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 18-Jan-2005  chs branches: 1.30.8;
de-__P, remove register, ansify.
 1.29 25-Jan-2004  minoura branches: 1.29.8;
Remove COMPAT_HPUX support. It did not work for a long time,
and I do not think emulating frame buffer devices is useful.
KNF.
 1.28 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.27 15-Jul-2003  lukem rcsid
 1.26 24-Feb-2003  atatat branches: 1.26.2;
Cast VM_DEFAULT_ADDRESS() to a caddr_t.
 1.25 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.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 10-Oct-2002  jdolecek replace the somewhat strange poll routine with standard nopoll() (a.k.a
seltrue())
 1.22 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.21 27-Dec-2001  wiz branches: 1.21.8;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.20 15-Mar-2001  chs branches: 1.20.2; 1.20.4; 1.20.8;
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.19 29-Jun-2000  mrg branches: 1.19.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.18 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.17 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.16 27-Jun-1999  minoura branches: 1.16.2; 1.16.12;
include sys/resourcevar.h to be compiled.
 1.15 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.14 05-May-1999  minoura Shut up gcc -Wall.
 1.13 24-Mar-1999  mrg branches: 1.13.4;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.12 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.11 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.10 06-Aug-1998  minoura Moved grfioctl.h and iteioctl.h to the public include directory.
 1.9 30-Jun-1998  msaitoh sync with -current after a long silence
 1.8 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.7 12-Jan-1998  thorpej Update for changes to config.
 1.6 12-Oct-1997  oki branches: 1.6.2;
Added prototypes.
 1.5 23-Nov-1996  oki branches: 1.5.10;
Implement poll(2).
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.2.1 13-Oct-1998  cgd pull up something resembling the changes in rev 1.9, via patch. (minoura)
 1.13.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.13.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.16.12.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.16.2.2 27-Mar-2001  bouyer Sync with HEAD.
 1.16.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.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.20.8.7 11-Nov-2002  nathanw Catch up to -current
 1.20.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.20.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.20.8.4 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.20.8.3 08-Jan-2002  nathanw Catch up to -current.
 1.20.8.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.20.8.1 15-Mar-2001  scw file grf.c was added on branch nathanw_sa on 2001-11-18 18:44:17 +0000
 1.20.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.20.2.4 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.20.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.20.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.2.1 12-Sep-2001  thorpej Add noop kqueue entry point.
 1.21.8.1 17-May-2002  gehenna Add device switch.
 1.26.2.5 04-Feb-2005  skrll Adapt to branch.
 1.26.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.26.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.26.2.1 03-Aug-2004  skrll Sync with HEAD
 1.29.8.1 29-Apr-2005  kent sync with -current
 1.30.8.3 04-Feb-2008  yamt sync with head.
 1.30.8.2 03-Sep-2007  yamt sync with head.
 1.30.8.1 21-Jun-2006  yamt sync with head.
 1.31.12.1 31-Mar-2006  tron Merge 2006-03-31 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.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.32.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.33.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.33.20.1 23-Mar-2008  matt sync with HEAD
 1.34.14.1 18-Jun-2008  simonb Sync with head.
 1.34.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.34.10.2 11-Mar-2010  yamt sync with head
 1.34.10.1 04-May-2009  yamt sync with head.
 1.34.8.1 17-Jun-2008  yamt sync with head.
 1.34.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.36.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.39.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.39.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.39.4.1 05-Mar-2011  rmind sync with head
 1.40.18.1 18-May-2014  rmind sync with head
 1.40.14.2 03-Dec-2017  jdolecek update from HEAD
 1.40.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.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.43.2.1 10-Aug-2014  tls Rebase.
 1.44.4.1 06-Apr-2015  skrll Sync with HEAD
 1.44.2.1 31-Dec-2014  snj Pull up following revision(s) (requested by chs in ticket #363):
common/lib/libprop/prop_kern.c: revision 1.18
sys/arch/mac68k/dev/grf_compat.c: revision 1.27
sys/arch/x68k/dev/grf.c: revision 1.45
sys/external/bsd/drm/dist/bsd-core/drm_bufs.c: revision 1.12
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.12
sys/external/bsd/drm2/drm/drm_vm.c: revision 1.6
sys/external/bsd/drm2/include/linux/mm.h: revision 1.4
sys/kern/vfs_vnops.c: revision 1.192 via patch
sys/rump/librump/rumpkern/vm.c: revision 1.160
sys/sys/file.h: revision 1.78 via patch
sys/uvm/uvm_device.c: revision 1.64
sys/uvm/uvm_device.h: revision 1.13
sys/uvm/uvm_extern.h: revision 1.192
sys/uvm/uvm_mmap.c: revision 1.150 via patch
add a new "fo_mmap" fileops method to allow use of arbitrary uvm_objects for
mappings of file objects. move vnode-specific details of mmap()ing a vnode
from uvm_mmap() to the new vnode-specific vn_mmap(). add new uvm_mmap_dev()
and uvm_mmap_anon() convenience functions for mapping character devices
and anonymous memory, and replace all other calls to uvm_mmap() with those.
use the new fileop in drm2 so that libdrm can use mmap() to map things
like on other platforms (instead of the ioctl that we have used so far).
 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 18-Jan-2009  isaki branches: 1.10.6; 1.10.8; 1.10.10;
Clean up header files.
 1.9 04-Mar-2007  christos branches: 1.9.44; 1.9.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 11-Dec-2005  christos branches: 1.8.26;
merge ktrace-lwp.
 1.7 25-Jan-2004  minoura branches: 1.7.16;
Remove COMPAT_HPUX support. It did not work for a long time,
and I do not think emulating frame buffer devices is useful.
KNF.
 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 15-Jul-2003  lukem rcsid
 1.4 24-Mar-1999  minoura branches: 1.4.42;
Shut up gcc -Wall.
 1.3 06-Aug-1998  minoura Moved grfioctl.h and iteioctl.h to the public include directory.
 1.2 12-Oct-1997  oki Added prototype.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.42.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 03-Sep-2007  yamt sync with head.
 1.8.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.44.1 04-May-2009  yamt sync with head.
 1.10.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.10.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.6.1 05-Mar-2011  rmind sync with head
 1.15 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.14 18-Jan-2009  isaki branches: 1.14.6; 1.14.8; 1.14.10;
Clean up header files.
 1.13 31-Dec-2007  ad branches: 1.13.10; 1.13.18;
Remove COMPAT_HPUX.
 1.12 04-Mar-2007  christos branches: 1.12.20; 1.12.26; 1.12.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 11-Dec-2005  christos branches: 1.11.26;
merge ktrace-lwp.
 1.10 18-Jan-2005  chs branches: 1.10.8;
de-__P, remove register, ansify.
 1.9 25-Jan-2004  minoura branches: 1.9.8;
Remove COMPAT_HPUX support. It did not work for a long time,
and I do not think emulating frame buffer devices is useful.
KNF.
 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 15-Jul-2003  lukem rcsid
 1.6 27-Dec-2001  wiz branches: 1.6.16;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.5 06-Aug-1998  minoura branches: 1.5.28; 1.5.32;
Moved grfioctl.h and iteioctl.h to the public include directory.
 1.4 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.3 12-Oct-1997  oki Added prototypes.
 1.2 20-May-1996  oki branches: 1.2.12;
fixed gcc -Wall warnings.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.32.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.16.4 24-Jan-2005  skrll Sync with HEAD.
 1.6.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.16.1 03-Aug-2004  skrll Sync with HEAD
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.8.2 21-Jan-2008  yamt sync with head
 1.10.8.1 03-Sep-2007  yamt sync with head.
 1.11.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.12.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.12.20.1 09-Jan-2008  matt sync with HEAD
 1.13.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.13.10.1 04-May-2009  yamt sync with head.
 1.14.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.14.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.14.6.1 05-Mar-2011  rmind sync with head
 1.35 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 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 27-Oct-2012  chs branches: 1.32.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.31 13-Oct-2012  tsutsui Normalize autoconf(9) function arg names (parent, self, and aux)
for clarification. from chs@.
 1.30 08-Feb-2011  rmind branches: 1.30.4; 1.30.14;
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.29 17-Jan-2009  isaki branches: 1.29.6; 1.29.8; 1.29.10;
Split device_t/softc, use aprint*().
 1.28 17-Jan-2009  isaki Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.27 04-Mar-2007  christos branches: 1.27.40; 1.27.44; 1.27.52;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 29-Mar-2006  thorpej branches: 1.26.14;
Use device_cfdata().
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.6; 1.25.8; 1.25.10; 1.25.12;
merge ktrace-lwp.
 1.24 26-Aug-2005  drochner s/locdesc_t/int/g
 1.23 30-Jun-2005  drochner branches: 1.23.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.22 13-Jun-2005  he Add __UNVOLATILE() to an assignment with a cast before passing pointer
to a function.
 1.21 18-Jan-2005  chs use a new "addr" locator for grf instead of the unit to match the instance
to the hardware. use a new "grfaddr" locator to match ites to their grfs,
instead of requiring that their unit numbers be the same.
 1.20 18-Jan-2005  chs de-__P, remove register, ansify.
 1.19 25-Jan-2004  minoura branches: 1.19.8;
Remove COMPAT_HPUX support. It did not work for a long time,
and I do not think emulating frame buffer devices is useful.
KNF.
 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 15-Jul-2003  lukem rcsid
 1.16 01-Jan-2003  thorpej branches: 1.16.2;
Use aprint_normal() for cfprint routines.
 1.15 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.14 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 16-Mar-1999  minoura branches: 1.12.22; 1.12.26;
Merged minoura_x68k_bus_h branch.
 1.11 06-Aug-1998  minoura branches: 1.11.6;
Moved grfioctl.h and iteioctl.h to the public include directory.
 1.10 04-Aug-1998  minoura __BROKEN_INDIRECT_CONFIG fixes.
 1.9 12-Jan-1998  thorpej Update for changes to config.
 1.8 12-Oct-1997  oki Added prototype.
 1.7 19-Jan-1997  oki branches: 1.7.8;
Fixed compile error with last commit of iodevice.h
 1.6 09-Dec-1996  oki Use config_search() instead of config_scan(),
by Chris G Demetriou, tested by me.
 1.5 13-Oct-1996  christos backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.7.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.12.26.2 03-Jan-2003  thorpej Sync with HEAD.
 1.12.26.1 18-Oct-2002  nathanw Catch up to -current.
 1.12.22.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.16.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.16.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.16.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.8.1 29-Apr-2005  kent sync with -current
 1.23.2.2 03-Sep-2007  yamt sync with head.
 1.23.2.1 21-Jun-2006  yamt sync with head.
 1.25.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.25.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.25.8.1 01-Apr-2006  yamt sync with head.
 1.25.6.1 22-Apr-2006  simonb Sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.26.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.27.44.1 04-May-2009  yamt sync with head.
 1.27.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.29.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.29.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.6.1 05-Mar-2011  rmind sync with head
 1.30.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.30.4.1 30-Oct-2012  yamt sync with head
 1.32.52.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.32.52.3 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.32.52.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.32.52.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.33.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.15 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.14 18-Jan-2009  isaki branches: 1.14.6; 1.14.8; 1.14.10;
Clean up header files.
 1.13 31-Dec-2007  ad branches: 1.13.10; 1.13.18;
Remove COMPAT_HPUX.
 1.12 04-Mar-2007  christos branches: 1.12.20; 1.12.26; 1.12.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 11-Dec-2005  christos branches: 1.11.26;
merge ktrace-lwp.
 1.10 18-Jan-2005  chs branches: 1.10.8;
de-__P, remove register, ansify.
 1.9 25-Jan-2004  minoura branches: 1.9.8;
Remove COMPAT_HPUX support. It did not work for a long time,
and I do not think emulating frame buffer devices is useful.
KNF.
 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 15-Jul-2003  lukem rcsid
 1.6 27-Dec-2001  wiz branches: 1.6.16;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.5 06-Aug-1998  minoura branches: 1.5.28; 1.5.32;
Moved grfioctl.h and iteioctl.h to the public include directory.
 1.4 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.3 12-Oct-1997  oki Added prototypes.
 1.2 20-May-1996  oki branches: 1.2.12;
fixed gcc -Wall warnings.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.32.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.16.4 24-Jan-2005  skrll Sync with HEAD.
 1.6.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.16.1 03-Aug-2004  skrll Sync with HEAD
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.8.2 21-Jan-2008  yamt sync with head
 1.10.8.1 03-Sep-2007  yamt sync with head.
 1.11.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.12.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.12.20.1 09-Jan-2008  matt sync with HEAD
 1.13.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.13.10.1 04-May-2009  yamt sync with head.
 1.14.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.14.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.14.6.1 05-Mar-2011  rmind sync with head
 1.2 06-Aug-1998  minoura Moved grfioctl.h and iteioctl.h to the public include directory.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.12 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.11 17-Jan-2009  isaki branches: 1.11.6; 1.11.8; 1.11.10;
Split device_t/softc, use aprint*().
 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 13-Jun-2005  he branches: 1.8.2;
Make this build with -Wcast-qual by adding a few consts.
 1.7 18-Jan-2005  chs use a new "addr" locator for grf instead of the unit to match the instance
to the hardware. use a new "grfaddr" locator to match ites to their grfs,
instead of requiring that their unit numbers be the same.
 1.6 18-Jan-2005  chs de-__P, remove register, ansify.
 1.5 25-Jan-2004  minoura branches: 1.5.8;
Remove COMPAT_HPUX support. It did not work for a long time,
and I do not think emulating frame buffer devices is useful.
KNF.
 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 09-Oct-1997  oki branches: 1.3.52;
Oops, fixed error in previous commit.
 1.2 09-Oct-1997  oki Added prototype.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.52.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.52.4 24-Jan-2005  skrll Sync with HEAD.
 1.3.52.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.52.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.52.1 03-Aug-2004  skrll Sync with HEAD
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.8.2.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.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.11.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.6.1 05-Mar-2011  rmind sync with head
 1.11 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.10 28-Feb-1999  explorer Update to slightly altered rnd_attach_source() api
 1.9 04-Aug-1998  minoura branches: 1.9.4; 1.9.6;
__BROKEN_INDIRECT_CONFIG fixes.
 1.8 05-Jul-1998  jonathan defopt NS, NSIP.
 1.7 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.6 12-Jan-1998  thorpej Update for changes to config.
 1.5 17-Oct-1997  oki Use rnd.h and #if NRND > 0.
 1.4 13-Oct-1996  christos branches: 1.4.6;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 07-May-1996  thorpej 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_reset)()
to take a struct ifnet *, rather than a unit number.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.4.6.1 04-Mar-1997  is Convert to new ARP code.
 1.9.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.9.4.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.24;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.24.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.20 06-Jan-2024  isaki White space cleanup.
 1.19 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.18 20-May-2015  ozaki-r branches: 1.18.10; 1.18.16;
Remove leftover use of AF_NS and NS option

Unnecessary NETISR_NS is also removed.
 1.17 16-Oct-2011  isaki branches: 1.17.12; 1.17.30;
Switch to 2-clause license.
 1.16 03-Mar-2010  tsutsui Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.

* move RTL8019 probe and attach code from each bus attachment
to MI ne2000_detect() and ne2000_attach()
* change a method for backend and attachment to specify 8 bit mode
to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
* handle more NE2000 8 bit mode specific settings, including
bus_space(9) access width and available size of buffer memory
* add a function to detect NE2000 8 bit mode
(disabled by default, but enalbed by options NE2000_DETECT_8BIT
to avoid possible regression on various ISA clones)
* fix ipkdb attachment accordingly (untested)

Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.

See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
 1.15 19-Jan-2010  pooka branches: 1.15.2;
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.14 28-Nov-2009  isaki Correct return value of ne_*_match().
It's attach priority, not ne2000 model.
 1.13 18-Jan-2009  isaki Delete 10 years old #if 0'd comments in intio.c, locore.s.
According to the old comment, the interrupt handler via intiotrap
should set his interrupt level again, but it's not right. And
don't set it again by interrupt hander.
 1.12 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.11 12-Mar-2008  tsutsui branches: 1.11.4; 1.11.12; 1.11.14;
Sync with MI NE2000 changes:
> Split device_t and softc for the NE2000 Ethernet chip and all its variants
> and attachments. Use device_t accessors, correct types, and ANSIfy when
> appropriate.
 1.10 11-Dec-2005  christos branches: 1.10.50; 1.10.70; 1.10.74;
merge ktrace-lwp.
 1.9 13-Jun-2005  he branches: 1.9.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.8 13-Feb-2004  wiz RealTek -> Realtek.
 1.7 07-Sep-2003  isaki Remove an advertising clause.
 1.6 15-Jul-2003  lukem rcsid
 1.5 02-Oct-2002  thorpej branches: 1.5.6;
Add trailing ; to CFATTACH_DECL.
 1.4 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 14-Jan-2002  isaki Add another address, vector configuration of Nereid ethernet.
 1.1 11-Nov-2001  isaki branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Support an ethernet part of Nereid.
Nereid is the board of ethernet/USB/memory for X68k
developed by X-PowerStation, a japanese X68k circle.
See http://xps.jp/ but only written in japanese.
 1.1.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.1.8.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 11-Nov-2001  thorpej file if_ne_intio.c was added on branch kqueue on 2002-01-10 19:50:19 +0000
 1.1.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.6.1 11-Nov-2001  nathanw file if_ne_intio.c was added on branch nathanw_sa on 2002-01-08 00:28:39 +0000
 1.1.4.2 06-Jan-2002  he Pull up revision 1.1 (new, via patch, requested by isaki):
Support the Ethernet part of Nereid (ether/USB/memory board).
 1.1.4.1 11-Nov-2001  he file if_ne_intio.c was added on branch netbsd-1-5 on 2002-01-06 20:12:53 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 11-Nov-2001  thorpej file if_ne_intio.c was added on branch thorpej-mips-cache on 2001-11-12 21:17:43 +0000
 1.5.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.9.2.1 17-Mar-2008  yamt sync with head.
 1.10.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.10.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.70.1 24-Mar-2008  keiichi sync with head.
 1.10.50.1 23-Mar-2008  matt sync with HEAD
 1.11.14.1 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1367):
sys/dev/ic/ne2000var.h: revision 1.25
sys/arch/atari/conf/MILAN.in: revision 1.24
sys/arch/atari/conf/MILAN.in: revision 1.25
sys/dev/ic/ne2000.c: revision 1.71
sys/dev/ic/ne2000.c: revision 1.72
sys/arch/atari/dev/if_ne_mb.c: revision 1.1
sys/arch/atari/dev/if_ne_mb.c: revision 1.2
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.69
sys/arch/atari/conf/HADES.in: revision 1.10
sys/arch/atari/conf/HADES.in: revision 1.11
sys/arch/x68k/dev/if_ne_neptune.c: revision 1.20
sys/dev/isa/if_ne_isa.c: revision 1.27
sys/arch/atari/atari/autoconf.c: revision 1.57
sys/dev/ic/ne2000.c: revision 1.62
sys/dev/isapnp/if_ne_isapnp.c: revision 1.27
sys/arch/atari/conf/files.atari: revision 1.117
sys/arch/atari/conf/HADES: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.85
sys/dev/ic/ne2000.c: revision 1.65
sys/dev/ic/ne2000.c: revision 1.66
sys/dev/ic/ne2000.c: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.65
distrib/notes/atari/hardware: revision 1.24
sys/conf/files: revision 1.980
sys/dev/ic/ne2000var.h: revision 1.21
sys/arch/x68k/dev/if_ne_intio.c: revision 1.16
sys/dev/ic/dp8390.c: revision 1.74
sys/dev/ic/dp8390.c: revision 1.75
Added NE2000 with 8bit bus width support.
reviewd by tsutsui@ at tech-kern ML.
Fix a wrong calculation bug around RX ring buffer memory address
slipped in about sixteen years ago. Fortunately, it had been working
for ages because some devices used address zero and other devices
ignored wrong higher bits.
Tested on we(4) (SMC Elite Ultra) and ne(4) (NE2000 compatible
named UL0001) on ISA.
Note FreeBSD also uses the same correct value in their ed(4) driver.
Now dp8390_config() calculates mem_ring correctly so
no longer need to override it in ne2000_attach().
Use roundup2() in <sys/param.h> rather than a conditional.
Also fix a wrong mem_ring calculation in dp8390_ipkdb_attach().
Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.
* move RTL8019 probe and attach code from each bus attachment
to MI ne2000_detect() and ne2000_attach()
* change a method for backend and attachment to specify 8 bit mode
to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
* handle more NE2000 8 bit mode specific settings, including
bus_space(9) access width and available size of buffer memory
* add a function to detect NE2000 8 bit mode
(disabled by default, but enalbed by options NE2000_DETECT_8BIT
to avoid possible regression on various ISA clones)
* fix ipkdb attachment accordingly (untested)
Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.
See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
No need to override mem_ring value in ne2000_ipkdb_attach()
since a wrong calculation in dp8390_ipkdb_attach() was fixed.
Don't warn about DMA timeout during probe.
Add support for the EtherNEC.
The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.
See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
Also note EtherNEC.
Use callout_schedule(9) rather than callout_reset(9) on polling
as callout(9) man says.
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.11.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.11.4.2 11-Mar-2010  yamt sync with head
 1.11.4.1 04-May-2009  yamt sync with head.
 1.15.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.17.30.1 06-Jun-2015  skrll Sync with HEAD
 1.17.12.1 03-Dec-2017  jdolecek update from HEAD
 1.18.16.1 25-Jun-2018  pgoyette Sync with HEAD
 1.18.10.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.21 20-May-2015  ozaki-r Remove leftover use of AF_NS and NS option

Unnecessary NETISR_NS is also removed.
 1.20 03-Mar-2010  tsutsui branches: 1.20.20; 1.20.38;
Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.

* move RTL8019 probe and attach code from each bus attachment
to MI ne2000_detect() and ne2000_attach()
* change a method for backend and attachment to specify 8 bit mode
to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
* handle more NE2000 8 bit mode specific settings, including
bus_space(9) access width and available size of buffer memory
* add a function to detect NE2000 8 bit mode
(disabled by default, but enalbed by options NE2000_DETECT_8BIT
to avoid possible regression on various ISA clones)
* fix ipkdb attachment accordingly (untested)

Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.

See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
 1.19 19-Jan-2010  pooka branches: 1.19.2;
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.18 28-Nov-2009  isaki Correct return value of ne_*_match().
It's attach priority, not ne2000 model.
 1.17 18-Jan-2009  isaki Delete 10 years old #if 0'd comments in intio.c, locore.s.
According to the old comment, the interrupt handler via intiotrap
should set his interrupt level again, but it's not right. And
don't set it again by interrupt hander.
 1.16 09-May-2008  tsutsui branches: 1.16.6; 1.16.8;
CFATTACH_DECL() -> CFATTACH_DECL_NEW(), botched in rev 1.14.
 1.15 28-Apr-2008  martin branches: 1.15.2;
Remove clause 3 and 4 from TNF licenses
 1.14 12-Mar-2008  tsutsui branches: 1.14.2; 1.14.4;
Sync with MI NE2000 changes:
> Split device_t and softc for the NE2000 Ethernet chip and all its variants
> and attachments. Use device_t accessors, correct types, and ANSIfy when
> appropriate.
 1.13 17-Oct-2007  garbled branches: 1.13.12; 1.13.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.12 12-May-2007  isaki branches: 1.12.10;
Clean up white spaces and tabs.
 1.11 11-Dec-2005  christos branches: 1.11.26; 1.11.30; 1.11.32; 1.11.38;
merge ktrace-lwp.
 1.10 18-Jan-2005  chs branches: 1.10.8;
de-__P, remove register, ansify.
 1.9 13-Feb-2004  wiz branches: 1.9.8;
RealTek -> Realtek.
 1.8 15-Jul-2003  lukem rcsid
 1.7 02-Oct-2002  thorpej branches: 1.7.6;
Add trailing ; to CFATTACH_DECL.
 1.6 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 21-Feb-2001  minoura branches: 1.4.4; 1.4.8;
Make this compile again.
 1.3 12-Feb-2001  thorpej Adjust the way that media is initialized on DP8390-compatible
chips. The dp8390_softc now has media_init and media_fini
function pointers that do the work.
 1.2 16-Mar-1999  minoura branches: 1.2.8;
Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file if_ne_neptune.c was initially added on branch minoura_x68k_bus_h.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.2.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.4.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.4.4.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.7.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.8.2 17-Mar-2008  yamt sync with head.
 1.10.8.1 03-Sep-2007  yamt sync with head.
 1.11.38.1 22-May-2007  matt Update to HEAD.
 1.11.32.1 11-Jul-2007  mjf Sync with head.
 1.11.30.1 27-May-2007  ad Sync with head.
 1.11.26.1 17-May-2007  yamt sync with head.
 1.12.10.2 23-Mar-2008  matt sync with HEAD
 1.12.10.1 06-Nov-2007  matt sync with HEAD
 1.13.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.13.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.13.12.1 24-Mar-2008  keiichi sync with head.
 1.14.4.3 11-Mar-2010  yamt sync with head
 1.14.4.2 04-May-2009  yamt sync with head.
 1.14.4.1 16-May-2008  yamt sync with head.
 1.14.2.1 18-May-2008  yamt sync with head.
 1.15.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.16.8.1 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1367):
sys/dev/ic/ne2000var.h: revision 1.25
sys/arch/atari/conf/MILAN.in: revision 1.24
sys/arch/atari/conf/MILAN.in: revision 1.25
sys/dev/ic/ne2000.c: revision 1.71
sys/dev/ic/ne2000.c: revision 1.72
sys/arch/atari/dev/if_ne_mb.c: revision 1.1
sys/arch/atari/dev/if_ne_mb.c: revision 1.2
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.69
sys/arch/atari/conf/HADES.in: revision 1.10
sys/arch/atari/conf/HADES.in: revision 1.11
sys/arch/x68k/dev/if_ne_neptune.c: revision 1.20
sys/dev/isa/if_ne_isa.c: revision 1.27
sys/arch/atari/atari/autoconf.c: revision 1.57
sys/dev/ic/ne2000.c: revision 1.62
sys/dev/isapnp/if_ne_isapnp.c: revision 1.27
sys/arch/atari/conf/files.atari: revision 1.117
sys/arch/atari/conf/HADES: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.85
sys/dev/ic/ne2000.c: revision 1.65
sys/dev/ic/ne2000.c: revision 1.66
sys/dev/ic/ne2000.c: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.65
distrib/notes/atari/hardware: revision 1.24
sys/conf/files: revision 1.980
sys/dev/ic/ne2000var.h: revision 1.21
sys/arch/x68k/dev/if_ne_intio.c: revision 1.16
sys/dev/ic/dp8390.c: revision 1.74
sys/dev/ic/dp8390.c: revision 1.75
Added NE2000 with 8bit bus width support.
reviewd by tsutsui@ at tech-kern ML.
Fix a wrong calculation bug around RX ring buffer memory address
slipped in about sixteen years ago. Fortunately, it had been working
for ages because some devices used address zero and other devices
ignored wrong higher bits.
Tested on we(4) (SMC Elite Ultra) and ne(4) (NE2000 compatible
named UL0001) on ISA.
Note FreeBSD also uses the same correct value in their ed(4) driver.
Now dp8390_config() calculates mem_ring correctly so
no longer need to override it in ne2000_attach().
Use roundup2() in <sys/param.h> rather than a conditional.
Also fix a wrong mem_ring calculation in dp8390_ipkdb_attach().
Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.
* move RTL8019 probe and attach code from each bus attachment
to MI ne2000_detect() and ne2000_attach()
* change a method for backend and attachment to specify 8 bit mode
to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
* handle more NE2000 8 bit mode specific settings, including
bus_space(9) access width and available size of buffer memory
* add a function to detect NE2000 8 bit mode
(disabled by default, but enalbed by options NE2000_DETECT_8BIT
to avoid possible regression on various ISA clones)
* fix ipkdb attachment accordingly (untested)
Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.
See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
No need to override mem_ring value in ne2000_ipkdb_attach()
since a wrong calculation in dp8390_ipkdb_attach() was fixed.
Don't warn about DMA timeout during probe.
Add support for the EtherNEC.
The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.
See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
Also note EtherNEC.
Use callout_schedule(9) rather than callout_reset(9) on polling
as callout(9) man says.
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.16.6.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.20.38.1 06-Jun-2015  skrll Sync with HEAD
 1.20.20.1 03-Dec-2017  jdolecek update from HEAD
 1.9 27-Nov-1999  minoura Remove ether+ driver. Requested by msaitoh.
 1.8 18-May-1999  thorpej branches: 1.8.2; 1.8.8;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.7 25-Mar-1999  thorpej branches: 1.7.4;
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.6 05-Jul-1998  jonathan branches: 1.6.6;
defopt NS, NSIP.
 1.5 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.4 13-Oct-1996  christos branches: 1.4.6;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 07-May-1996  thorpej 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_reset)()
to take a struct ifnet *, rather than a unit number.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4.6.2 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.4.6.1 04-Mar-1997  is Convert to new ARP code.
 1.6.6.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.7.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.3 27-Nov-1999  minoura Remove ether+ driver. Requested by msaitoh.
 1.2 13-Oct-1997  lukem branches: 1.2.18; 1.2.24;
rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.24.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.18.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.52 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.51 17-Dec-2021  skrll Correct copypaste comment grammar.
 1.50 17-Dec-2021  skrll Trailing whitespace
 1.49 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.48 24-Apr-2021  thorpej branches: 1.48.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.47 14-Jun-2020  chs branches: 1.47.4;
replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.46 10-Nov-2019  chs 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.45 31-May-2016  dholland branches: 1.45.18;
fix flagrantly wrong indent
 1.44 26-Feb-2016  christos PR/50859: David Binderman: Remove redundant code.
 1.43 27-Jan-2012  para branches: 1.43.6; 1.43.24;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.42 18-Jan-2009  isaki branches: 1.42.14; 1.42.18;
- malloc() + memset(0) -> malloc(M_ZERO).
- remove temporary variable.
 1.41 18-Jan-2009  isaki Delete 10 years old #if 0'd comments in intio.c, locore.s.
According to the old comment, the interrupt handler via intiotrap
should set his interrupt level again, but it's not right. And
don't set it again by interrupt hander.
 1.40 18-Jan-2009  isaki Clean up header files.
 1.39 17-Jan-2009  isaki Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.38 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.37 25-Jun-2008  isaki branches: 1.37.4;
Split device_t/softc. Use aprint*() and device_xname().
 1.36 23-Jun-2008  isaki Make intio_intr_establish() use evcnt(9),
instead of dynamic allocation of intrnames/intrcnt.
 1.35 10-May-2008  martin branches: 1.35.2;
Minor typo in license
 1.34 28-Apr-2008  martin branches: 1.34.2;
Remove clause 3 and 4 from TNF licenses
 1.33 17-Oct-2007  garbled branches: 1.33.16; 1.33.18; 1.33.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.32 12-May-2007  isaki branches: 1.32.10;
Clean up white spaces and tabs.
 1.31 11-Mar-2007  isaki branches: 1.31.2; 1.31.8;
white space, indent and KNF.
 1.30 05-Mar-2007  he branches: 1.30.2;
Cast to char* before doing pointer arithmetic.
 1.29 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.28 11-Dec-2005  christos branches: 1.28.26;
merge ktrace-lwp.
 1.27 26-Aug-2005  drochner s/locdesc_t/int/g
 1.26 30-Jun-2005  drochner branches: 1.26.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.25 18-Jan-2005  chs de-__P, remove register, ansify.
 1.24 13-Dec-2004  chs branches: 1.24.2;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.23 04-Jan-2004  wiz Spell controller with two ls. Inspired by miod@openbsd.
 1.22 01-Nov-2003  jdolecek the storagesize parameter of extent_create() is a size_t, not a pointer
 1.21 05-Oct-2003  nsmrtks print PC in stray interrupt
 1.20 15-Jul-2003  lukem rcsid
 1.19 03-May-2003  wiz branches: 1.19.2;
DMA, not dma nor Dma.
 1.18 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.17 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.16 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.15 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 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.12 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.11 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.10 11-Nov-2001  isaki Support BUS_SPACE_MAP_SHIFTED_EVEN for bus_space_map().
Now BUS_SPACE_MAP_SHIFTED means BUS_SPACE_MAP_SHIFTED_ODD.
It is needed for Nereid Ethernet.
 1.9 26-Aug-2001  mrg branches: 1.9.4; 1.9.6;
remove bogus comment. noted by Tetsuya Isaki <isaki@par.odn.ne.jp> in private email.
 1.8 29-Jun-2000  mrg branches: 1.8.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.7 16-Jan-2000  minoura branches: 1.7.4;
Minor cleanups & corrections.
 1.6 05-May-1999  minoura branches: 1.6.2;
Add missing ia_size argument.
 1.5 24-Mar-1999  minoura branches: 1.5.2; 1.5.4; 1.5.6;
Shut up gcc -Wall.
 1.4 22-Mar-1999  minoura Use intio_debug flag variable.
 1.3 18-Mar-1999  minoura Shut up gcc -Wall
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file intio.c was initially added on branch minoura_x68k_bus_h.
 1.1.2.8 14-Mar-1999  minoura Use a single (inline) function instead of refering the bus_space switch.
 1.1.2.7 12-Mar-1999  minoura Gather interrupt statics.
 1.1.2.6 13-Feb-1999  minoura Implemented BUS_SPACE_MAP_SHIFTED.
Some of the devices are mapped only on the odd addresses for hardware
simplicity. To share drivers with other platforms, this should be
made transparent through the bus_space layer.
 1.1.2.5 02-Feb-1999  minoura I/O controler support.
 1.1.2.4 31-Jan-1999  minoura Attach arg dmaintr.
 1.1.2.3 30-Jan-1999  minoura Added DMAC driver.
 1.1.2.2 27-Dec-1998  minoura Match device names.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.5.6.1 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.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.2.1 21-Jun-1999  perry pullup 1.5->1.6 (minoura)
 1.6.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.4.1 06-Jan-2002  he Pull up revision 1.10 (requested by isaki):
Support mapping devices with BUS_SPACE_MAP_SHIFTED_EVEN.
 1.8.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.8.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.9.6.4 03-Jan-2003  thorpej Sync with HEAD.
 1.9.6.3 18-Oct-2002  nathanw Catch up to -current.
 1.9.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.9.6.1 26-Aug-2001  nathanw file intio.c was added on branch nathanw_sa on 2002-01-08 00:28:39 +0000
 1.9.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.19.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.19.2.4 18-Dec-2004  skrll Sync with HEAD.
 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.24.2.1 29-Apr-2005  kent sync with -current
 1.26.2.2 03-Sep-2007  yamt sync with head.
 1.26.2.1 21-Jun-2006  yamt sync with head.
 1.28.26.2 17-May-2007  yamt sync with head.
 1.28.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.2.2 27-May-2007  ad Sync with head.
 1.30.2.1 13-Mar-2007  ad Sync with head.
 1.31.8.1 22-May-2007  matt Update to HEAD.
 1.31.2.1 11-Jul-2007  mjf Sync with head.
 1.32.10.1 06-Nov-2007  matt sync with HEAD
 1.33.20.2 04-May-2009  yamt sync with head.
 1.33.20.1 16-May-2008  yamt sync with head.
 1.33.18.1 18-May-2008  yamt sync with head.
 1.33.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.33.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.33.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.34.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.34.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.35.2.1 27-Jun-2008  simonb Sync with head.
 1.37.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.42.18.1 18-Feb-2012  mrg merge to -current.
 1.42.14.1 17-Apr-2012  yamt sync with head
 1.43.24.2 09-Jul-2016  skrll Sync with HEAD
 1.43.24.1 19-Mar-2016  skrll Sync with HEAD
 1.43.6.1 03-Dec-2017  jdolecek update from HEAD
 1.45.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.47.4.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.47.4.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.47.4.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.47.4.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.47.4.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.47.4.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.48.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.40 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.39 17-Dec-2023  andvar Remove accidentally added i in previous commit..
 1.38 17-Dec-2023  andvar Fix DMAC_ARRAYCHAIN enabled build:
pass dmac->sc_dev instead of undefined self in dmac_start_xfer_offset().
remove unused chan/ch variables in dmac_program_arraychain().
initialize c to zero in dmac_start_xfer_offset() and add check that is bigger
than 0 before calling dma_cachectl() to fix potentially uninitialized error
(seems to be false positive though).
 1.37 11-Aug-2017  isaki Fix a Continue Operation.
Patch from Y.Sugahara.
 1.36 11-Aug-2017  isaki Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
 1.35 26-Mar-2014  christos branches: 1.35.6; 1.35.22;
kill sprintf, fix unused.
 1.34 14-Oct-2012  tsutsui branches: 1.34.2;
To abort DMA in dmac_abort_xfer(), set DMAC_CCR_SAB (software abort)
rather than DMAC_CCR_HLT (halt operation).

DMAC_CCR_HLT doesn't abort DMA xfers but only suspends DMA ops
(i.e. clearing HLT bit will resume DMA xfers), so previously
DMAC error always occurs on the next DMA xfer ops after
dmac_abort_xfer() is called.

Also suppress DMAC error messages in dmac_error() if it's caused
by software abort command because it can happen during normal
audio play/record DMA ops in vs(4) driver.
 1.33 06-Jun-2010  mrg branches: 1.33.8; 1.33.14; 1.33.18;
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.32 29-Nov-2008  isaki branches: 1.32.6; 1.32.8;
Rename variables to avoid confusing. forgotten in previous commit.
 1.31 25-Jun-2008  isaki branches: 1.31.2; 1.31.4;
Split device_t/softc for dmac_*_xfer().
Rename some variables to avoid confusing.
 1.30 25-Jun-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
 1.29 23-Jun-2008  isaki Make intio_intr_establish() use evcnt(9),
instead of dynamic allocation of intrnames/intrcnt.
 1.28 28-Apr-2008  martin branches: 1.28.2; 1.28.4;
Remove clause 3 and 4 from TNF licenses
 1.27 17-Oct-2007  garbled branches: 1.27.16; 1.27.18; 1.27.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.26 12-May-2007  isaki branches: 1.26.10;
Clean up white spaces and tabs.
 1.25 11-Mar-2007  isaki branches: 1.25.2; 1.25.8;
white space, indent and KNF.
 1.24 04-Mar-2007  christos branches: 1.24.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.23 11-Dec-2005  christos branches: 1.23.26;
merge ktrace-lwp.
 1.22 12-Jun-2005  he branches: 1.22.2;
Change the `name' argument of dmac_alloc_channel to const char*, so that
a string constant can be used without generating a warning.
 1.21 18-Jan-2005  chs de-__P, remove register, ansify.
 1.20 13-Dec-2004  chs branches: 1.20.2;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.19 15-Jul-2003  lukem rcsid
 1.18 13-Oct-2002  isaki branches: 1.18.6;
Clean up debug code.
 1.17 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.16 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.15 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.14 04-Aug-2002  isaki Fix printf format in DIAGNOSTIC.
 1.13 03-Aug-2002  isaki Fix compile warnings in debug code.
 1.12 25-Nov-2001  minoura branches: 1.12.8;
Remove unused variables.
Correct printf format strings.
 1.11 27-May-2001  minoura branches: 1.11.2; 1.11.8;
Reset dx_nextoff and dx_nextsize before transfer.
 1.10 22-May-2001  minoura Reset the status register after abort.
 1.9 02-May-2001  minoura Disable array chain mode by default, since it is unused by any of
the current devices.
Add more flexibility in the API.
 1.8 30-Apr-2001  minoura Correct memory leak.
Use single block transfer when appropriate.
 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 18-Apr-2000  minoura Explicitly include opt_m680x0.h.
 1.5 08-Jul-1999  thorpej branches: 1.5.2;
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.4 24-Mar-1999  minoura branches: 1.4.4;
Shut up gcc -Wall.
 1.3 18-Mar-1999  minoura G/C.
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 30-Jan-1999  minoura branches: 1.1.2;
file intio_dmac.c was initially added on branch minoura_x68k_bus_h.
 1.1.2.4 13-Feb-1999  minoura Use the cycle steal with hold mode instead of the cycle steal without hold mode.
Handle INTIOCF_ADDR_DEFAULT case.
 1.1.2.3 10-Feb-1999  minoura Use dma_cachectl.
Add some debugging code.
 1.1.2.2 02-Feb-1999  minoura Arg for Interrupt handlers.
Specify device physical address instead of virtual for dmac_start_xfer.
 1.1.2.1 30-Jan-1999  minoura Added DMAC driver.
 1.4.4.1 02-Aug-1999  thorpej Update from trunk.
 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.11.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.11.8.3 13-Aug-2002  nathanw Catch up to -current.
 1.11.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.11.8.1 27-May-2001  nathanw file intio_dmac.c was added on branch nathanw_sa on 2002-01-08 00:28:39 +0000
 1.11.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.11.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.11.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.8.1 31-Aug-2002  gehenna catch up with -current.
 1.18.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.18.6.4 18-Dec-2004  skrll Sync with HEAD.
 1.18.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.6.1 03-Aug-2004  skrll Sync with HEAD
 1.20.2.1 29-Apr-2005  kent sync with -current
 1.22.2.1 03-Sep-2007  yamt sync with head.
 1.23.26.2 17-May-2007  yamt sync with head.
 1.23.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.2.2 27-May-2007  ad Sync with head.
 1.24.2.1 13-Mar-2007  ad Sync with head.
 1.25.8.1 22-May-2007  matt Update to HEAD.
 1.25.2.1 11-Jul-2007  mjf Sync with head.
 1.26.10.1 06-Nov-2007  matt sync with HEAD
 1.27.20.3 11-Aug-2010  yamt sync with head.
 1.27.20.2 04-May-2009  yamt sync with head.
 1.27.20.1 16-May-2008  yamt sync with head.
 1.27.18.1 18-May-2008  yamt sync with head.
 1.27.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.27.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.27.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.28.4.1 27-Jun-2008  simonb Sync with head.
 1.28.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.31.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.31.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.32.8.1 03-Jul-2010  rmind sync with head
 1.32.6.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.33.18.3 03-Dec-2017  jdolecek update from HEAD
 1.33.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.33.14.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #646):
sys/arch/x68k/dev/intio_dmac.c: revision 1.34
sys/arch/x68k/dev/fd.c: revision 1.100
sys/arch/x68k/dev/fd.c: revision 1.101
sys/arch/x68k/dev/fd.c: revision 1.102
sys/arch/x68k/dev/fd.c: revision 1.103
sys/arch/x68k/dev/fd.c: revision 1.104
sys/arch/x68k/dev/fd.c: revision 1.105
sys/arch/x68k/dev/fd.c: revision 1.98
sys/arch/x68k/dev/fd.c: revision 1.99
sys/arch/x68k/dev/fdreg.h: revision 1.5
sys/arch/x68k/dev/fdreg.h: revision 1.6
Explicitly specify a proper FDC data register address for HD63450 DMAC
to avoid confusion.
Previous one (fdc->sc_addr + fddata) wasn't a right address for
the FDC's data register but one for the command register by accident,
but FDC ignores A0 address input (connected to A1 of x68k address bus)
during DMA xfer (i.e. when DACK is asserted) so it happened to work
as expected on the real X680x0 hardware, but caused trouble on emulators.
The inconsistency was found by Y.Sugahara during debugging XM6i emulator
(and it will be fixed in the next release).
FDC behavior during DMA is confirmed by uPD72068 hardware application note.
XXX: There is no proper MI API to specify DMA address for DMA controller
(like MC68450) to access devices mapped to memory space by bus_space(9).
- use <sys/bus.h> rather than <machine/bus.h>
- no need to include uvm_extern.h
- include "ioconf.h" for struct cfdriver foo_cd
KNF and cosmetics. No binary change.
- check bus_space_map(9) return value
- use BUS_SPACE_MAP_SHIFTED_ODD for clarify
- define and use proper macro instead of magic
To abort DMA in dmac_abort_xfer(), set DMAC_CCR_SAB (software abort)
rather than DMAC_CCR_HLT (halt operation).
DMAC_CCR_HLT doesn't abort DMA xfers but only suspends DMA ops
(i.e. clearing HLT bit will resume DMA xfers), so previously
DMAC error always occurs on the next DMA xfer ops after
dmac_abort_xfer() is called.
Also suppress DMAC error messages in dmac_error() if it's caused
by software abort command because it can happen during normal
audio play/record DMA ops in vs(4) driver.
Before probing floppy drives, call NE7CMD_SENSEI and fdcresult()
to drain possible pending FDC interrupts. Taken from sys/dev/isa/fd.c.
Hopefully might fix occasional fd drive probe failure (but not confirmed).
Terminate DMAC and call bus_dmamap_unload(9) properly in all FDC xfer
error paths, as sys/dev/isa/fd.c does. Fixes unexpected DMAC errors
(and possible VM panic due to un-unloaded dmamap) on the first floppy
access after read/write errors.
Add floppy format support. Mostly taken from sys/dev/isa/fd.c.
Tested both fdNa (1232KB, 1024bytes/sector, 8sectors/track) and
fdNc (1200KB, 512bytes/sector, 15sectors/track) format on X68030
using fdformat(1).
Finally we can prepare NetBSD/x68k install floppies without Human68k
(except actual initial bootstrap).
KNF and space nits
 1.33.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.33.8.1 30-Oct-2012  yamt sync with head
 1.34.2.1 18-May-2014  rmind sync with head
 1.35.22.1 23-Sep-2017  snj Pull up following revision(s) (requested by isaki in ticket #290):
sys/arch/x68k/dev/dmacvar.h: revision 1.11-1.12 via patch
sys/arch/x68k/dev/intio_dmac.c: revision 1.36-1.37 via patch
sys/arch/x68k/dev/fd.c: revision 1.120 via patch
sys/arch/x68k/dev/vs.c: revision 1.45-1.46 via patch
Use dmac_prepare_xfer().
From Y.Sugahara.
--
Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
--
Fix a Continue Operation.
Patch from Y.Sugahara.
 1.35.6.1 28-Aug-2017  skrll Sync with HEAD
 1.15 15-Dec-2019  tsutsui Remove clause 3 and 4 leftovers from TNF licenses in more sources.

Confirmed by martin@ in PR/54760.
 1.14 22-Jan-2013  isaki branches: 1.14.38; 1.14.42;
Detect emulators (and display it on dmesg).
 1.13 18-Dec-2008  isaki branches: 1.13.14; 1.13.24;
Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.12 18-Dec-2008  isaki Move external decl. of intiobase: dev/intiovar.h -> include/cpu.h
Move definition of intiobase: x68k/pmap_bootstrap.c -> x68k/locore.s
These synchronize code with other m68k ports.
 1.11 25-Jun-2008  isaki branches: 1.11.4;
Split device_t/softc. Use aprint*() and device_xname().
 1.10 23-Jun-2008  isaki Make intio_intr_establish() use evcnt(9),
instead of dynamic allocation of intrnames/intrcnt.
 1.9 17-Oct-2007  garbled branches: 1.9.16; 1.9.20; 1.9.22; 1.9.24;
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.8 12-May-2007  isaki branches: 1.8.10;
Clean up white spaces and tabs.
 1.7 11-Dec-2005  christos branches: 1.7.26; 1.7.30; 1.7.32; 1.7.38;
merge ktrace-lwp.
 1.6 18-Jan-2005  chs branches: 1.6.8;
de-__P, remove register, ansify.
 1.5 04-Jan-2004  wiz branches: 1.5.8;
Spell controller with two ls. Inspired by miod@openbsd.
 1.4 29-Sep-2002  isaki branches: 1.4.6;
const-ify ia_name. It makes intio.c compilable.
 1.3 16-Jan-2000  minoura branches: 1.3.8; 1.3.12;
Minor cleanups & corrections.
 1.2 16-Mar-1999  minoura branches: 1.2.8;
Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file intiovar.h was initially added on branch minoura_x68k_bus_h.
 1.1.2.5 02-Feb-1999  minoura I/O controler support.
 1.1.2.4 31-Jan-1999  minoura Attach arg dmaintr.
 1.1.2.3 30-Jan-1999  minoura Added DMAC driver.
 1.1.2.2 27-Dec-1998  minoura Match device names.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 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.12.1 18-Oct-2002  nathanw Catch up to -current.
 1.3.8.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.4.6.4 24-Jan-2005  skrll Sync with HEAD.
 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.5.8.1 29-Apr-2005  kent sync with -current
 1.6.8.1 03-Sep-2007  yamt sync with head.
 1.7.38.1 22-May-2007  matt Update to HEAD.
 1.7.32.1 11-Jul-2007  mjf Sync with head.
 1.7.30.1 27-May-2007  ad Sync with head.
 1.7.26.1 17-May-2007  yamt sync with head.
 1.8.10.1 06-Nov-2007  matt sync with HEAD
 1.9.24.1 27-Jun-2008  simonb Sync with head.
 1.9.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.9.20.1 04-May-2009  yamt sync with head.
 1.9.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.9.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.11.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.13.24.1 25-Feb-2013  tls resync with head
 1.13.14.1 23-Jan-2013  yamt sync with head
 1.14.42.1 18-Dec-2019  martin Pull up following revision(s) (requested by tsutsui in ticket #570):

sys/compat/netbsd32/netbsd32_compat_50_sysv.c: revision 1.3
sys/dev/raidframe/rf_compat50.h: revision 1.6
sys/arch/emips/emips/bus_space.c: revision 1.3
sys/compat/net/if.h: revision 1.5
sys/arch/emips/stand/common/bootinfo.c: revision 1.2
sys/compat/common/sysv_msg_50.c: revision 1.5
sys/compat/common/kern_time_30.c: revision 1.8
sys/arch/emips/stand/common/bootinfo.h: revision 1.2
sys/arch/ia64/include/bus.h: revision 1.4
sys/arch/ia64/ia64/bus_space.c: revision 1.2
sys/compat/common/sysv_shm_50.c: revision 1.5
sys/dev/ic/adw.h: revision 1.15
sys/compat/common/uipc_syscalls_50.c: revision 1.10
sys/arch/emips/ebus/flash_ebus.c: revision 1.22
sys/dev/ic/adv.h: revision 1.15
sys/dev/ic/adwmcode.c: revision 1.18
sys/dev/ic/advlib.c: revision 1.29
sys/arch/hpcarm/include/kloader.h: revision 1.3
sys/dev/usb/uberry.c: revision 1.16
sys/compat/common/sysv_sem_50.c: revision 1.5
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.43
sys/dev/ic/advlib.h: revision 1.21
sys/dev/ic/adv.c: revision 1.50
sys/compat/netinet6/in6_var.h: revision 1.5
sys/arch/hpc/stand/hpcboot/arm/arm_sa1100_asm.asm: revision 1.2
sys/arch/emips/include/loadfile_machdep.h: revision 1.3
sys/arch/emips/stand/common/prom_iface.c: revision 1.7
sys/dev/ic/adw.c: revision 1.56
sys/dev/ic/adwmcode.h: revision 1.12
sys/dev/ic/advmcode.c: revision 1.10
sys/arch/emips/ebus/ace_ebus.c: revision 1.22
sys/compat/netbsd32/netbsd32_compat_60.c: revision 1.5
sys/dev/raidframe/rf_compat50.c: revision 1.13
sys/arch/x68k/dev/intiovar.h: revision 1.15
sys/dev/usb/uipad.c: revision 1.8
sys/arch/zaurus/include/kloader.h: revision 1.3
sys/arch/emips/stand/common/bootxx.c: revision 1.2
sys/dev/ic/adwlib.h: revision 1.23
sys/dev/ic/adwlib.c: revision 1.44
sys/compat/netbsd32/netbsd32_compat_16.c: revision 1.3
sys/arch/amigappc/include/intr.h: revision 1.27
sys/arch/x68k/dev/mfp.c: revision 1.27
sys/arch/arm/at91/at91dbgu.c: revision 1.17
sys/dev/ic/advmcode.h: revision 1.7
sys/compat/ultrix/ultrix_exec.h: revision 1.7
sys/compat/common/vfs_syscalls_50.c: revision 1.24
sys/arch/mips/cavium/octeon_dma.c: revision 1.3
sys/arch/hpc/stand/hpcboot/arm/arm_pxa2x0_asm.asm: revision 1.2

Remove clause 3 and 4 from TNF licenses.
Ok'ed by martin@ in PR/54760.

Remove clause 3 and 4 leftovers from TNF licenses in more sources.
Confirmed by martin@ in PR/54760.
 1.14.38.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.72 05-Oct-2024  isaki x68k: Add SIXEL graphics sequence support.
- The palette definition is fixed to the same color as the text (currently,
it's RGB 8 colors). Any palette definition sent will be ignored.
- Aspect ratio and bg color mode is not supported (yet).
- An OR mode is supported. This is proposed by Y.Sugahara in this
implementation and then the mlterm also supports it. It's an advantageous
way for the multi plane color VRAM.
- ITE_SIXEL kernel option is added and is disabled by default for now.

It was first written by me in 2014 and has been demonstrated in Open Source
Conference Hiroshima every year since then. In this year, it's also
demonstrated on real X68030 at Japan NetBSD Users Group booth in OSC 2024
Hiroshima, last week.
https://x.com/OSC_official/status/1841381234804498608
It's useful for showing and explaining about the possibility of NetBSD and
old machines for younger (than X68030) engineers or students.
 1.71 07-Jan-2024  isaki branches: 1.71.2;
TAB/space/indent cleanup.
 1.70 25-Jun-2022  tsutsui Fix more unintended diffs from a wrong branch.
 1.69 25-Jun-2022  tsutsui Add a minimum box drawing character support for x68k ite(4).

This is for proper appearance of menus in sysinst(8) with TERM=vt220.
Discussed on port-x68k@ etc.

There was "why not all G0/G1/G2/G3" comment, but terminfo and curses
with TERM=vt220 only require "ESC ( <F>" against G0 for DEC special
graphics (including box drawing characters) by smacs/rmacs/acsc.
I hope other various unimplemented ISO/IEC 2022 specifications will
be motivated per further visible demends.
 1.68 28-May-2022  andvar fix various typos, mainly in comments.
 1.67 26-May-2022  tsutsui Remove duplicated function declarations.
 1.66 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.65 29-Mar-2022  riastradh x68k/ite(4): Include <sys/device_impl.h> to abuse autoconf internals.
 1.64 03-Sep-2018  riastradh 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.63 25-Jul-2014  dholland branches: 1.63.26; 1.63.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.62 26-Mar-2014  christos branches: 1.62.2;
kill sprintf, fix unused.
 1.61 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.60 10-Oct-2012  tsutsui branches: 1.60.2;
Fix device_t/softc split bothces. From Chuck Silvers' patch posted on
current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html
and several more fixes by me.

Not sure if these are fatal (at least 6.0_RC2 works without thise fixes),
but needs more investigation.
 1.59 24-Apr-2011  rmind branches: 1.59.4; 1.59.14;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.58 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.57 17-Jan-2009  isaki branches: 1.57.6; 1.57.8; 1.57.10;
Split device_t/softc, use aprint*().
 1.56 17-Jan-2009  isaki Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.55 13-Jun-2008  cegger branches: 1.55.4;
use device_lookup_private to get softc
 1.54 24-Feb-2008  isaki branches: 1.54.2; 1.54.4; 1.54.6; 1.54.8;
G/C unused variables and macros.
 1.53 19-Nov-2007  ad branches: 1.53.10; 1.53.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.52 18-Oct-2007  joerg branches: 1.52.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.51 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.50 12-May-2007  isaki branches: 1.50.8; 1.50.10; 1.50.14;
Clean up white spaces and tabs.
 1.49 11-Mar-2007  isaki branches: 1.49.2; 1.49.8;
white space, indent and KNF.
 1.48 04-Mar-2007  christos branches: 1.48.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.47 01-Oct-2006  elad branches: 1.47.4;
Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!

Also, add forgotten splx() calls in some places.
 1.46 23-Jul-2006  ad branches: 1.46.4; 1.46.6;
Use the LWP cached credentials where sane.
 1.45 14-May-2006  elad integrate kauth.
 1.44 28-Mar-2006  thorpej Use device_unit().
 1.43 24-Dec-2005  perry branches: 1.43.4; 1.43.6; 1.43.8; 1.43.10; 1.43.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.42 11-Dec-2005  christos merge ktrace-lwp.
 1.41 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.40 12-Jun-2005  he branches: 1.40.2;
Change the last arg of ite_sendstr() to const char*, so that this builds
under -Wcast-qual. Also rename a local variable to build with -Wshadow.
 1.39 18-Jan-2005  chs use a new "addr" locator for grf instead of the unit to match the instance
to the hardware. use a new "grfaddr" locator to match ites to their grfs,
instead of requiring that their unit numbers be the same.
 1.38 18-Jan-2005  chs de-__P, remove register, ansify.
 1.37 23-Apr-2004  simonb branches: 1.37.4;
s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
 1.36 01-Nov-2003  jdolecek g/c local index() routine and switch to (libkern's) strchr()
 1.35 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.34 15-Jul-2003  lukem rcsid
 1.33 23-Oct-2002  jdolecek branches: 1.33.6;
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 Add trailing ; to CFATTACH_DECL.
 1.31 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 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.28 17-Mar-2002  atatat branches: 1.28.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.27 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.26 21-Oct-2001  isaki branches: 1.26.4;
Change 3 glyphs according to SRAM flags (0xed0059),
when ITELOADFONT ioctl is issued.
 1.25 02-May-2001  scw branches: 1.25.2; 1.25.4;
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.24 13-Nov-2000  minoura branches: 1.24.2;
New line discipline.
 1.23 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.22 25-May-2000  itohy Fix the problem where pressing a key at
scsibus0: waiting 2 seconds for devices to settle...
message during boot crashes the system.
This is because ite_filter() is called before init(8) opens the console.
 1.21 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.20 27-Jun-1999  minoura branches: 1.20.2;
Restore scroll registers after X server exits.
 1.19 05-May-1999  minoura Shut up gcc -Wall.
 1.18 05-May-1999  minoura Move config_console to ensure that it is always called.
 1.17 30-Mar-1999  minoura branches: 1.17.2; 1.17.4; 1.17.6;
defopt EXTENDED_MEMORY and ITE_KERNEL_ATTR.
 1.16 24-Mar-1999  minoura G/c amiga's key repeat handler.
 1.15 22-Mar-1999  minoura Check unit.
This bug seems to be introduced on merging the bus.h patches.
 1.14 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.13 06-Aug-1998  minoura branches: 1.13.6;
Moved grfioctl.h and iteioctl.h to the public include directory.
 1.12 05-Aug-1998  minoura Fixed stray pointer access reported by Yasufumi Itoh.
 1.11 04-Aug-1998  minoura __BROKEN_INDIRECT_CONFIG fixes.
 1.10 30-Jun-1998  msaitoh sync with -current after a long silence
 1.9 12-Jan-1998  thorpej Update for changes to config.
 1.8 12-Oct-1997  oki branches: 1.8.2;
Added prototypes.
 1.7 26-Jan-1997  oki branches: 1.7.8;
Rename in_xxxx to tv_xxxx (Use new ite_tv.c)
 1.6 13-Oct-1996  christos backout previous kprintf change
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 17-Jul-1996  oki XXX grf has some routines call ite function directly.
XXX check whether grf has no associated ite. fixed PR/2626.
 1.3 05-Jun-1996  oki add tty_attach(tp);
 1.2 21-May-1996  oki branches: 1.2.2;
Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.2 17-Jul-1996  jtc Pulled up from rev 1.4 by request from Masaru Oki
 1.2.2.1 05-Jun-1996  oki pull up tty_attach() changes from trunk
 1.7.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.2.1 13-Oct-1998  cgd pull up some (but not all) changes from 1.10 and 1.12, via patch. (minoura)
 1.13.6.2 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.13.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.17.6.1 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.17.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.17.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.2.2 02-Jul-1999  perry pullup 1.19->1.20 (minoura): Restore scroll registers after X server exits
 1.17.2.1 22-Jun-1999  perry pullup 1.17->1.18 (minoura)
 1.20.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.20.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.25.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.25.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.25.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.25.2.3 24-Jun-2002  jdolecek add dummy itestop(), so that we can use cdev_tty_init() in conf.c
 1.25.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.25.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.26.4.6 11-Nov-2002  nathanw Catch up to -current
 1.26.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.26.4.4 17-Sep-2002  nathanw Catch up to -current.
 1.26.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.26.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.26.4.1 21-Oct-2001  nathanw file ite.c was added on branch nathanw_sa on 2002-01-08 00:28:40 +0000
 1.28.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.33.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.6.5 04-Feb-2005  skrll Adapt to branch.
 1.33.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.33.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.33.6.1 03-Aug-2004  skrll Sync with HEAD
 1.37.4.1 29-Apr-2005  kent sync with -current
 1.40.2.6 27-Feb-2008  yamt sync with head.
 1.40.2.5 07-Dec-2007  yamt sync with head
 1.40.2.4 27-Oct-2007  yamt sync with head.
 1.40.2.3 03-Sep-2007  yamt sync with head.
 1.40.2.2 30-Dec-2006  yamt sync with head.
 1.40.2.1 21-Jun-2006  yamt sync with head.
 1.43.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.43.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.43.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.43.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.43.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.43.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.43.8.3 11-Aug-2006  yamt sync with head
 1.43.8.2 24-May-2006  yamt sync with head.
 1.43.8.1 01-Apr-2006  yamt sync with head.
 1.43.6.2 01-Jun-2006  kardel Sync with head.
 1.43.6.1 22-Apr-2006  simonb Sync with head.
 1.43.4.1 09-Sep-2006  rpaulo sync with head
 1.46.6.1 22-Oct-2006  yamt sync with head
 1.46.4.1 18-Nov-2006  ad Sync with head.
 1.47.4.2 17-May-2007  yamt sync with head.
 1.47.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.48.2.4 03-Dec-2007  ad Sync with HEAD.
 1.48.2.3 23-Oct-2007  ad Sync with head.
 1.48.2.2 27-May-2007  ad Sync with head.
 1.48.2.1 13-Mar-2007  ad Sync with head.
 1.49.8.1 22-May-2007  matt Update to HEAD.
 1.49.2.1 11-Jul-2007  mjf Sync with head.
 1.50.14.2 21-Nov-2007  bouyer Sync with HEAD
 1.50.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.50.10.3 23-Mar-2008  matt sync with HEAD
 1.50.10.2 09-Jan-2008  matt sync with HEAD
 1.50.10.1 06-Nov-2007  matt sync with HEAD
 1.50.8.2 21-Nov-2007  joerg Sync with HEAD.
 1.50.8.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.52.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.53.14.3 17-Jan-2009  mjf Sync with HEAD.
 1.53.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.53.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.53.10.1 24-Mar-2008  keiichi sync with head.
 1.54.8.1 18-Jun-2008  simonb Sync with head.
 1.54.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.54.4.1 04-May-2009  yamt sync with head.
 1.54.2.1 17-Jun-2008  yamt sync with head.
 1.55.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.57.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.57.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.57.6.2 31-May-2011  rmind sync with head
 1.57.6.1 05-Mar-2011  rmind sync with head
 1.59.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.59.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.59.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.59.4.1 30-Oct-2012  yamt sync with head
 1.60.2.1 18-May-2014  rmind sync with head
 1.62.2.1 10-Aug-2014  tls Rebase.
 1.63.28.1 10-Jun-2019  christos Sync with HEAD
 1.63.26.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.71.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 26-Jan-1997  oki Use new ite_tv scheme, this file no longer used.
 1.4 18-Jan-1997  oki Use ip->isw intead of itesw. Remove unused extern itesw[].
 1.3 13-Oct-1996  christos backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.21 05-Oct-2024  isaki x68k: Add SIXEL graphics sequence support.
- The palette definition is fixed to the same color as the text (currently,
it's RGB 8 colors). Any palette definition sent will be ignored.
- Aspect ratio and bg color mode is not supported (yet).
- An OR mode is supported. This is proposed by Y.Sugahara in this
implementation and then the mlterm also supports it. It's an advantageous
way for the multi plane color VRAM.
- ITE_SIXEL kernel option is added and is disabled by default for now.

It was first written by me in 2014 and has been demonstrated in Open Source
Conference Hiroshima every year since then. In this year, it's also
demonstrated on real X68030 at Japan NetBSD Users Group booth in OSC 2024
Hiroshima, last week.
https://x.com/OSC_official/status/1841381234804498608
It's useful for showing and explaining about the possibility of NetBSD and
old machines for younger (than X68030) engineers or students.
 1.20 07-Jan-2024  isaki branches: 1.20.2;
TAB/space/indent cleanup.
 1.19 25-Jun-2022  tsutsui Restore EUC-JP support broken since rev 1.16.

I committed a wrong branch in the previous and it included wip version:
https://mail-index.netbsd.org/source-changes-d/2022/06/25/msg013708.html
This version is based on a fix from isaki@ and also confirmed me.
 1.18 25-Jun-2022  tsutsui Add a minimum box drawing character support for x68k ite(4).

This is for proper appearance of menus in sysinst(8) with TERM=vt220.
Discussed on port-x68k@ etc.

There was "why not all G0/G1/G2/G3" comment, but terminfo and curses
with TERM=vt220 only require "ESC ( <F>" against G0 for DEC special
graphics (including box drawing characters) by smacs/rmacs/acsc.
I hope other various unimplemented ISO/IEC 2022 specifications will
be motivated per further visible demends.
 1.17 08-Feb-2018  dholland Typos.
 1.16 28-Apr-2013  isaki Fix a kernel panic by printf(1).
The 2nd byte of ISO-2022-JP must be 0x21-0x7e. Especially,
the character code less than 0x2121 causes SEGV, because a
font address points outside of the CGROM.
Reported by tsutsui@. Should be pulled up to netbsd-6.
 1.15 11-Mar-2007  isaki branches: 1.15.76; 1.15.82; 1.15.86; 1.15.88;
Remove an extra white space.
 1.14 24-Dec-2005  perry branches: 1.14.26; 1.14.30;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 13-Jun-2005  he branches: 1.12.2;
Make this build with -Wcast-qual and -Wshadow by adding one
__UNVOLATILE() and adding a number of volatile to variable declarations
and renaming a local variable.
 1.11 18-Jan-2005  chs de-__P, remove register, ansify.
 1.10 15-Jul-2003  lukem branches: 1.10.8;
rcsid
 1.9 27-Dec-2001  wiz branches: 1.9.16;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.8 21-Oct-2001  isaki branches: 1.8.4;
Change 3 glyphs according to SRAM flags (0xed0059),
when ITELOADFONT ioctl is issued.
 1.7 27-Jun-1999  minoura branches: 1.7.16;
Restore scroll registers after X server exits.
 1.6 16-Mar-1999  minoura branches: 1.6.2; 1.6.4; 1.6.6;
Merged minoura_x68k_bus_h branch.
 1.5 06-Aug-1998  minoura branches: 1.5.6;
Moved grfioctl.h and iteioctl.h to the public include directory.
 1.4 12-Oct-1997  oki Added prototype.
 1.3 03-Feb-1997  oki branches: 1.3.8;
Oops, correct value in previous commit
 1.2 03-Feb-1997  oki - tv_kfont[] size fix.
- silly speed hack.
 1.1 26-Jan-1997  oki rewriteten ITE lower routine for x68k Text-Vram frame buffer.
 1.3.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.6.6.1 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.6.4.1 01-Jul-1999  thorpej Sync w/ -current.
 1.6.2.1 02-Jul-1999  perry pullup 1.6->1.7 (minoura): Restore scroll registers after X server exits
 1.7.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.4.1 21-Oct-2001  nathanw file ite_tv.c was added on branch nathanw_sa on 2002-01-08 00:28:40 +0000
 1.9.16.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.16.4 24-Jan-2005  skrll Sync with HEAD.
 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.10.8.1 29-Apr-2005  kent sync with -current
 1.12.2.2 03-Sep-2007  yamt sync with head.
 1.12.2.1 21-Jun-2006  yamt sync with head.
 1.14.30.1 13-Mar-2007  ad Sync with head.
 1.14.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.88.1 29-Apr-2013  riz Pull up following revision(s) (requested by isaki in ticket #881):
sys/arch/x68k/dev/ite_tv.c: revision 1.16
Fix a kernel panic by printf(1).
The 2nd byte of ISO-2022-JP must be 0x21-0x7e. Especially,
the character code less than 0x2121 causes SEGV, because a
font address points outside of the CGROM.
Reported by tsutsui@. Should be pulled up to netbsd-6.
 1.15.86.1 23-Jun-2013  tls resync from head
 1.15.82.1 29-Apr-2013  riz Pull up following revision(s) (requested by isaki in ticket #881):
sys/arch/x68k/dev/ite_tv.c: revision 1.16
Fix a kernel panic by printf(1).
The 2nd byte of ISO-2022-JP must be 0x21-0x7e. Especially,
the character code less than 0x2121 causes SEGV, because a
font address points outside of the CGROM.
Reported by tsutsui@. Should be pulled up to netbsd-6.
 1.15.76.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.20.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 06-Aug-1998  minoura Moved grfioctl.h and iteioctl.h to the public include directory.
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.18 05-Oct-2024  isaki x68k: Add SIXEL graphics sequence support.
- The palette definition is fixed to the same color as the text (currently,
it's RGB 8 colors). Any palette definition sent will be ignored.
- Aspect ratio and bg color mode is not supported (yet).
- An OR mode is supported. This is proposed by Y.Sugahara in this
implementation and then the mlterm also supports it. It's an advantageous
way for the multi plane color VRAM.
- ITE_SIXEL kernel option is added and is disabled by default for now.

It was first written by me in 2014 and has been demonstrated in Open Source
Conference Hiroshima every year since then. In this year, it's also
demonstrated on real X68030 at Japan NetBSD Users Group booth in OSC 2024
Hiroshima, last week.
https://x.com/OSC_official/status/1841381234804498608
It's useful for showing and explaining about the possibility of NetBSD and
old machines for younger (than X68030) engineers or students.
 1.17 07-Jan-2024  isaki branches: 1.17.2;
TAB/space/indent cleanup.
 1.16 25-Jun-2022  tsutsui Add a minimum box drawing character support for x68k ite(4).

This is for proper appearance of menus in sysinst(8) with TERM=vt220.
Discussed on port-x68k@ etc.

There was "why not all G0/G1/G2/G3" comment, but terminfo and curses
with TERM=vt220 only require "ESC ( <F>" against G0 for DEC special
graphics (including box drawing characters) by smacs/rmacs/acsc.
I hope other various unimplemented ISO/IEC 2022 specifications will
be motivated per further visible demends.
 1.15 10-Oct-2012  tsutsui Fix device_t/softc split bothces. From Chuck Silvers' patch posted on
current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html
and several more fixes by me.

Not sure if these are fatal (at least 6.0_RC2 works without thise fixes),
but needs more investigation.
 1.14 08-Feb-2011  rmind branches: 1.14.4; 1.14.14;
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 17-Oct-2007  garbled branches: 1.13.42; 1.13.48; 1.13.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.12 12-May-2007  isaki branches: 1.12.10;
Clean up white spaces and tabs.
 1.11 11-Dec-2005  christos branches: 1.11.26; 1.11.30; 1.11.32; 1.11.38;
merge ktrace-lwp.
 1.10 18-Jan-2005  chs branches: 1.10.8;
de-__P, remove register, ansify.
 1.9 07-Aug-2003  agc branches: 1.9.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 06-Sep-2002  gehenna branches: 1.8.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.7 27-Dec-2001  wiz branches: 1.7.8;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.6 21-Oct-2001  isaki branches: 1.6.4;
Change 3 glyphs according to SRAM flags (0xed0059),
when ITELOADFONT ioctl is issued.
 1.5 24-Mar-1999  minoura branches: 1.5.20; 1.5.22;
G/c amiga's key repeat handler.
 1.4 03-Sep-1998  minoura Eliminated meaningless ITEKANJI.
 1.3 03-Feb-1997  oki Correct prototype
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5.22.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.5.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.20.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.6.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.6.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.4.1 21-Oct-2001  nathanw file itevar.h was added on branch nathanw_sa on 2002-01-08 00:28:40 +0000
 1.7.8.1 19-May-2002  gehenna Remove unnecessary prototype.
 1.8.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.8.1 03-Sep-2007  yamt sync with head.
 1.11.38.1 22-May-2007  matt Update to HEAD.
 1.11.32.1 11-Jul-2007  mjf Sync with head.
 1.11.30.1 27-May-2007  ad Sync with head.
 1.11.26.1 17-May-2007  yamt sync with head.
 1.12.10.1 06-Nov-2007  matt sync with HEAD
 1.13.50.1 17-Feb-2011  bouyer Sync with HEAD
 1.13.48.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.42.1 05-Mar-2011  rmind sync with head
 1.14.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.4.1 30-Oct-2012  yamt sync with head
 1.17.2.1 02-Aug-2025  perseant Sync with HEAD
 1.43 25-Jun-2022  tsutsui Add rnd(9) entropy source from keyboard.
 1.42 24-Jun-2022  tsutsui Make local functions static.
 1.41 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.40 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.39 21-Mar-2014  tsutsui branches: 1.39.2;
Replace tsleep(9)/wakeup(9) with condvar(9) as practice.

Also replace malloc(9) with kmem_alloc(9).
Pevent more possible races.

Tested on both console and Xserver on X68030.
 1.38 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.37 23-Oct-2011  tsutsui branches: 1.37.2; 1.37.12; 1.37.16;
Calling psignal(9) (via EV_WAKEUP()) in interrupt handlers
could cause mutex error panic, so defer it via softint(9).
This should fix panic on heavy key strokes during running Xserver.

Should be pulled up to netbsd-5.

XXX: amiga and atari might have the similar problem?
 1.36 17-Jan-2009  isaki Use firm_gettime() (in dev/sun/vuid_event.h) to adapt
changes in chiristos-time_t.
 1.35 25-Jun-2008  isaki branches: 1.35.4; 1.35.6;
Split device_t/softc. Use aprint*() and device_xname().
 1.34 13-Jun-2008  cegger use device_lookup_private to get softc
 1.33 03-Dec-2007  ad branches: 1.33.14; 1.33.16; 1.33.18; 1.33.20; 1.33.22;
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.32 17-Oct-2007  garbled branches: 1.32.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.31 12-May-2007  isaki branches: 1.31.8; 1.31.10;
Clean up white spaces and tabs.
 1.30 29-Apr-2007  msaitoh branches: 1.30.2;
fix typos
 1.29 11-Mar-2007  isaki branches: 1.29.2;
white space, indent and KNF.
 1.28 04-Mar-2007  christos branches: 1.28.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.27 04-Mar-2007  tsutsui Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.26 24-Jan-2007  hubertf branches: 1.26.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.25 08-Jan-2007  isaki Bring back the comment which was lost at rev1.22 .
 1.24 18-Sep-2006  gdamore Convert references to "time" to calls to "getmicrotime()", needed for
conversion to timecounters.
 1.23 11-Dec-2005  christos branches: 1.23.20; 1.23.22;
merge ktrace-lwp.
 1.22 18-Jan-2005  chs branches: 1.22.8;
de-__P, remove register, ansify.
 1.21 13-Dec-2004  chs branches: 1.21.2;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.20 28-Sep-2003  cl x68k has sc_events and not k_events in struct kbd_softc
 1.19 21-Sep-2003  jdolecek cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
the owner of descriptor, according to appropriate sematics
of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
 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 15-Jul-2003  lukem rcsid
 1.16 23-Oct-2002  jdolecek branches: 1.16.6;
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.15 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.14 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 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.11 12-Jun-2001  wiz branches: 1.11.2; 1.11.4; 1.11.8; 1.11.16;
receive, not recieve
 1.10 25-May-2000  itohy branches: 1.10.6;
Treat receiver overrun of MFP (clear the error).
Although the keyboard hardware seems to be designed to avoid
overrun, the errors sometimes occur.
 1.9 03-Dec-1999  itohy Add a dummy read just after enabling receiver interrupt.
If the receiver already has datum, no further arrival of
data is possible and no interrupts will occur.
This change fixes problem that pressing key during boot
may sometimes disable the keyboard.

Remove unreferenced variable "in" in kbdcngetc().
 1.8 24-Mar-1999  minoura branches: 1.8.8; 1.8.14;
Shut up gcc -Wall.
 1.7 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.6 09-Oct-1997  oki branches: 1.6.10;
Added missing prototype.
 1.5 23-Nov-1996  oki branches: 1.5.10;
Implement poll(2).
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.10.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.8.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 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.10.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.16.1 17-May-2002  gehenna Add device switch.
 1.11.8.4 11-Nov-2002  nathanw Catch up to -current
 1.11.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.11.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.11.8.1 12-Jun-2001  nathanw file kbd.c was added on branch nathanw_sa on 2002-09-17 21:18:47 +0000
 1.11.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.11.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.11.2.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.16.6.6 04-Feb-2005  skrll Adapt to branch.
 1.16.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.16.6.4 18-Dec-2004  skrll Sync with HEAD.
 1.16.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.6.1 03-Aug-2004  skrll Sync with HEAD
 1.21.2.1 29-Apr-2005  kent sync with -current
 1.22.8.5 07-Dec-2007  yamt sync with head
 1.22.8.4 03-Sep-2007  yamt sync with head.
 1.22.8.3 26-Feb-2007  yamt sync with head.
 1.22.8.2 30-Dec-2006  yamt sync with head.
 1.22.8.1 21-Jun-2006  yamt sync with head.
 1.23.22.1 22-Oct-2006  yamt sync with head
 1.23.20.3 01-Feb-2007  ad Sync with head.
 1.23.20.2 12-Jan-2007  ad Sync with head.
 1.23.20.1 18-Nov-2006  ad Sync with head.
 1.26.2.3 17-May-2007  yamt sync with head.
 1.26.2.2 07-May-2007  yamt sync with head.
 1.26.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.28.2.3 03-Dec-2007  ad Sync with HEAD.
 1.28.2.2 27-May-2007  ad Sync with head.
 1.28.2.1 13-Mar-2007  ad Sync with head.
 1.29.2.1 11-Jul-2007  mjf Sync with head.
 1.30.2.1 22-May-2007  matt Update to 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 09-Dec-2007  jmcneill Sync with HEAD.
 1.32.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.33.22.2 27-Jun-2008  simonb Sync with head.
 1.33.22.1 18-Jun-2008  simonb Sync with head.
 1.33.20.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.33.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.33.18.1 04-May-2009  yamt sync with head.
 1.33.16.1 17-Jun-2008  yamt sync with head.
 1.33.14.2 17-Jan-2009  mjf Sync with HEAD.
 1.33.14.1 29-Jun-2008  mjf Sync with HEAD.
 1.35.6.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1732):
sys/arch/x68k/dev/kbd.c: revision 1.37
Calling psignal(9) (via EV_WAKEUP()) in interrupt handlers
could cause mutex error panic, so defer it via softint(9).
This should fix panic on heavy key strokes during running Xserver.
Should be pulled up to netbsd-5.
XXX: amiga and atari might have the similar problem?
 1.35.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.37.16.1 18-May-2014  rmind sync with head
 1.37.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.37.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.39.2.1 10-Aug-2014  tls Rebase.
 1.9 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.8 26-May-2022  tsutsui Make readonly keymap data const.
 1.7 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.6 12-May-2007  isaki branches: 1.6.10;
Clean up white spaces and tabs.
 1.5 11-Dec-2005  christos branches: 1.5.26; 1.5.30; 1.5.32; 1.5.38;
merge ktrace-lwp.
 1.4 15-Jul-2003  lukem branches: 1.4.16;
rcsid
 1.3 24-Mar-1999  minoura branches: 1.3.42;
Add function keys mapping.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.42.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 03-Sep-2007  yamt sync with head.
 1.5.38.1 22-May-2007  matt Update to HEAD.
 1.5.32.1 11-Jul-2007  mjf Sync with head.
 1.5.30.1 27-May-2007  ad Sync with head.
 1.5.26.1 17-May-2007  yamt sync with head.
 1.6.10.1 06-Nov-2007  matt sync with HEAD
 1.6 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.5 26-May-2022  tsutsui Make readonly keymap data const.
 1.4 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.3 12-May-2007  isaki branches: 1.3.10;
Clean up white spaces and tabs.
 1.2 05-Jan-1998  perry branches: 1.2.66; 1.2.104; 1.2.108; 1.2.110; 1.2.116;
RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.116.1 22-May-2007  matt Update to HEAD.
 1.2.110.1 11-Jul-2007  mjf Sync with head.
 1.2.108.1 27-May-2007  ad Sync with head.
 1.2.104.1 17-May-2007  yamt sync with head.
 1.2.66.1 03-Sep-2007  yamt sync with head.
 1.3.10.1 06-Nov-2007  matt sync with HEAD
 1.5 26-May-2022  tsutsui Make readonly keymap data const.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 12-May-2004  minoura Populate kbdmap-related definitions to the userland.
Also g/c unused ioctls.
Pointed out by he.
 1.2 05-Jan-1998  perry branches: 1.2.50;
RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 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.2 26-Jan-1997  oki Use new ite_tv scheme, this file no longer used.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 04-Jan-2004  wiz Spell controller with two ls. Inspired by miod@openbsd.
 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 16-Mar-1999  minoura branches: 1.2.42;
Merged minoura_x68k_bus_h branch.
 1.1 19-Oct-1997  oki branches: 1.1.10;
Support of MK-HA1 Mach-2 SCSI adaptor.
 1.1.10.1 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.2.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.42.1 03-Aug-2004  skrll Sync with HEAD
 1.5 10-May-2008  isaki Make it retire, because no one refers.
arch/x68k/dev/spc.c includes <dev/ic/mb89352reg.h> instead of
this, since 1999.
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.76; 1.4.78; 1.4.80;
merge ktrace-lwp.
 1.3 04-Jan-2004  wiz Spell controller with two ls. Inspired by miod@openbsd.
 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 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.4.80.2 23-Jun-2008  wrstuden Remove files removed on branch. Updating using patch has its
drawbacks. :-)
 1.4.80.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.4.78.1 16-May-2008  yamt sync with head.
 1.4.76.1 17-Jun-2008  yamt fix merge botches
 1.4.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.4 24-Nov-2000  minoura Use MI md_root.c.
 1.3 09-Apr-1999  minoura branches: 1.3.2;
Fix the startup message.
attach_hook is now called without "mdX: " prefix.
 1.2 17-Mar-1999  sommerfe branches: 1.2.2;
defopt MINIROOTSIZE
 1.1 19-Oct-1997  oki for ramdisk kernel
 1.2.2.1 10-Apr-1999  minoura branches: 1.2.2.1.2;
Pull-up 1.3 from trunk.
 1.2.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.1 08-Dec-2000  bouyer Sync with HEAD.
 1.32 06-Jan-2024  isaki x68k: Make _delay() argument to microseconds.
'<< 8' is just a magnification factor and should not be visible
from the outside.
 1.31 06-Jan-2024  isaki Remove a duplicated extern declaration.
 1.30 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.29 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.28 24-Apr-2021  thorpej branches: 1.28.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.27 15-Dec-2019  tsutsui branches: 1.27.10;
Remove clause 3 and 4 leftovers from TNF licenses in more sources.

Confirmed by martin@ in PR/54760.
 1.26 26-Mar-2014  christos branches: 1.26.30; 1.26.34;
kill sprintf, fix unused.
 1.25 05-May-2011  tsutsui branches: 1.25.4; 1.25.14; 1.25.18;
Add a comment for the previous change.
 1.24 04-May-2011  tsutsui Don't call mfp_init() in mfp_attach().
It's already called from early mfp_config_console() via config_console()
and reinitializing MFP could sometimes cause silent hang.
 1.23 17-Jan-2009  isaki branches: 1.23.6; 1.23.8;
Split device_t/softc, use aprint*().
 1.22 17-Jan-2009  isaki Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.21 31-Dec-2008  isaki Search all of mfp(4)'s children automatically, instead of
attaching hard-coded children. mfp(4) was trying to attach
pow(4) though pow(4) was a pseudo-device for a long time.
 1.20 18-Dec-2008  isaki Remove intr_reset(), which has disabled device interrupt just
after start in locore.s. Initializing interrupt should be done
by each device driver.
 1.19 11-Mar-2007  isaki branches: 1.19.38; 1.19.42; 1.19.50;
white space, indent and KNF.
 1.18 11-Mar-2007  isaki Remove an extra white space.
 1.17 24-Dec-2005  perry branches: 1.17.26; 1.17.30;
bare asm -> __asm
 1.16 11-Dec-2005  christos merge ktrace-lwp.
 1.15 13-Jun-2005  he branches: 1.15.2;
Make this compile by adding __UNCONST() when calling config_found() or
similar functions with a text constant as the second argument.
 1.14 18-Jan-2005  chs de-__P, remove register, ansify.
 1.13 17-Jan-2005  minoura mfp_attach() is called twice (console init & real config).
 1.12 13-Dec-2004  chs branches: 1.12.2;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.11 04-Jan-2004  wiz Spell controller with two ls. Inspired by miod@openbsd.
 1.10 15-Jul-2003  lukem rcsid
 1.9 02-Oct-2002  thorpej branches: 1.9.6;
Add trailing ; to CFATTACH_DECL.
 1.8 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.7 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.6 12-Jun-2001  wiz branches: 1.6.2; 1.6.8;
receive, not recieve
 1.5 16-Jan-2000  minoura branches: 1.5.6;
Minor cleanups & corrections.
 1.4 05-May-1999  minoura branches: 1.4.2;
Use mvme68k-derived delay routine.
Now that we support various models, the old constant-loop delay routine
may cause problems.
 1.3 18-Mar-1999  minoura branches: 1.3.2; 1.3.4; 1.3.6;
G/C.
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file mfp.c was initially added on branch minoura_x68k_bus_h.
 1.1.2.4 13-Feb-1999  minoura Handle INTIOCF_ADDR_DEFAULT case.
 1.1.2.3 27-Dec-1998  minoura Better address map handling.
 1.1.2.2 27-Dec-1998  minoura Match device names.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.3.6.1 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.3.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.1 24-Jun-1999  perry pullup 1.3->1.4 (minoura): Use mvme68k-derived delay() routine
 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.5.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.1 12-Jun-2001  nathanw file mfp.c was added on branch nathanw_sa on 2002-10-18 02:40:46 +0000
 1.6.2.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.9.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.9.6.4 18-Dec-2004  skrll Sync with HEAD.
 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-Aug-2004  skrll Sync with HEAD
 1.12.2.1 29-Apr-2005  kent sync with -current
 1.15.2.2 03-Sep-2007  yamt sync with head.
 1.15.2.1 21-Jun-2006  yamt sync with head.
 1.17.30.1 13-Mar-2007  ad Sync with head.
 1.17.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.50.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.42.1 04-May-2009  yamt sync with head.
 1.19.38.1 17-Jan-2009  mjf Sync with HEAD.
 1.23.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.23.6.1 31-May-2011  rmind sync with head
 1.25.18.1 18-May-2014  rmind sync with head
 1.25.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.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.26.34.1 18-Dec-2019  martin Pull up following revision(s) (requested by tsutsui in ticket #570):

sys/compat/netbsd32/netbsd32_compat_50_sysv.c: revision 1.3
sys/dev/raidframe/rf_compat50.h: revision 1.6
sys/arch/emips/emips/bus_space.c: revision 1.3
sys/compat/net/if.h: revision 1.5
sys/arch/emips/stand/common/bootinfo.c: revision 1.2
sys/compat/common/sysv_msg_50.c: revision 1.5
sys/compat/common/kern_time_30.c: revision 1.8
sys/arch/emips/stand/common/bootinfo.h: revision 1.2
sys/arch/ia64/include/bus.h: revision 1.4
sys/arch/ia64/ia64/bus_space.c: revision 1.2
sys/compat/common/sysv_shm_50.c: revision 1.5
sys/dev/ic/adw.h: revision 1.15
sys/compat/common/uipc_syscalls_50.c: revision 1.10
sys/arch/emips/ebus/flash_ebus.c: revision 1.22
sys/dev/ic/adv.h: revision 1.15
sys/dev/ic/adwmcode.c: revision 1.18
sys/dev/ic/advlib.c: revision 1.29
sys/arch/hpcarm/include/kloader.h: revision 1.3
sys/dev/usb/uberry.c: revision 1.16
sys/compat/common/sysv_sem_50.c: revision 1.5
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.43
sys/dev/ic/advlib.h: revision 1.21
sys/dev/ic/adv.c: revision 1.50
sys/compat/netinet6/in6_var.h: revision 1.5
sys/arch/hpc/stand/hpcboot/arm/arm_sa1100_asm.asm: revision 1.2
sys/arch/emips/include/loadfile_machdep.h: revision 1.3
sys/arch/emips/stand/common/prom_iface.c: revision 1.7
sys/dev/ic/adw.c: revision 1.56
sys/dev/ic/adwmcode.h: revision 1.12
sys/dev/ic/advmcode.c: revision 1.10
sys/arch/emips/ebus/ace_ebus.c: revision 1.22
sys/compat/netbsd32/netbsd32_compat_60.c: revision 1.5
sys/dev/raidframe/rf_compat50.c: revision 1.13
sys/arch/x68k/dev/intiovar.h: revision 1.15
sys/dev/usb/uipad.c: revision 1.8
sys/arch/zaurus/include/kloader.h: revision 1.3
sys/arch/emips/stand/common/bootxx.c: revision 1.2
sys/dev/ic/adwlib.h: revision 1.23
sys/dev/ic/adwlib.c: revision 1.44
sys/compat/netbsd32/netbsd32_compat_16.c: revision 1.3
sys/arch/amigappc/include/intr.h: revision 1.27
sys/arch/x68k/dev/mfp.c: revision 1.27
sys/arch/arm/at91/at91dbgu.c: revision 1.17
sys/dev/ic/advmcode.h: revision 1.7
sys/compat/ultrix/ultrix_exec.h: revision 1.7
sys/compat/common/vfs_syscalls_50.c: revision 1.24
sys/arch/mips/cavium/octeon_dma.c: revision 1.3
sys/arch/hpc/stand/hpcboot/arm/arm_pxa2x0_asm.asm: revision 1.2

Remove clause 3 and 4 from TNF licenses.
Ok'ed by martin@ in PR/54760.

Remove clause 3 and 4 leftovers from TNF licenses in more sources.
Confirmed by martin@ in PR/54760.
 1.26.30.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.27.10.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.27.10.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.27.10.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.27.10.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.27.10.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.27.10.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.28.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.9 07-Nov-2009  snj Drop 3rd and 4th clauses on this TNF-copyrighted file.
 1.8 17-Jan-2009  isaki Split device_t/softc, use aprint*().
 1.7 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.6 14-Dec-2008  isaki Use mfp_{set,clear}_*() macros to purge macros by the name of 'mfp'.
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.78; 1.5.86;
merge ktrace-lwp.
 1.4 18-Jan-2005  chs de-__P, remove register, ansify.
 1.3 12-Jun-2001  wiz branches: 1.3.8; 1.3.24; 1.3.32;
receive, not recieve
 1.2 16-Mar-1999  minoura branches: 1.2.20;
Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file mfp.h was initially added on branch minoura_x68k_bus_h.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.2.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.32.1 29-Apr-2005  kent sync with -current
 1.3.24.1 24-Jan-2005  skrll Sync with HEAD.
 1.3.8.2 12-Jun-2001  wiz receive, not recieve
 1.3.8.1 12-Jun-2001  wiz file mfp.h was added on branch nathanw_sa on 2001-06-12 15:17:22 +0000
 1.5.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.78.2 11-Mar-2010  yamt sync with head
 1.5.78.1 04-May-2009  yamt sync with head.
 1.5.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.62 08-Sep-2024  rillig s/effect/affect/ in a few places
 1.61 07-Jan-2024  isaki branches: 1.61.2;
TAB/space/indent cleanup.
 1.60 17-Dec-2023  andvar Pass periph_target from xs->xs_periph, since periph is not defined.

Fixes SPC_DEBUG build option.
 1.59 05-Dec-2023  andvar s/pregress/progress/ in panic message.
 1.58 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.57 04-May-2022  andvar fix various typos in comments and log messages.
 1.56 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.55 24-Apr-2021  thorpej branches: 1.55.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.54 26-Mar-2014  christos branches: 1.54.44;
kill sprintf, fix unused.
 1.53 10-Oct-2012  tsutsui branches: 1.53.2;
Fix device_t/softc split botches that could be fatal. From
Chuck Silvers' patch posted current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html

Should be pulled up to netbsd-6.
 1.52 23-Nov-2009  rmind branches: 1.52.12; 1.52.18; 1.52.22;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.51 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.50 05-Dec-2008  isaki Use TAILQ_* macros.
 1.49 29-Nov-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
Not tested. I don't have its hardware and no response in port-x68k.
 1.48 13-Jun-2008  cegger branches: 1.48.2; 1.48.4;
use device_lookup_private to get softc
 1.47 28-Apr-2008  martin branches: 1.47.2; 1.47.4;
Remove clause 3 and 4 from TNF licenses
 1.46 17-Oct-2007  garbled branches: 1.46.16; 1.46.18; 1.46.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.45 12-May-2007  isaki branches: 1.45.10;
Clean up white spaces and tabs.
 1.44 11-Mar-2007  isaki branches: 1.44.2; 1.44.8;
white space, indent and KNF.
 1.43 04-Mar-2007  christos branches: 1.43.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.42 08-Jan-2007  isaki branches: 1.42.2;
Bring back the comment which was lost at rev1.35 .
 1.41 08-Mar-2006  lukem branches: 1.41.10;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.40 23-Feb-2006  thorpej branches: 1.40.2; 1.40.4;
Use device_parent().
 1.39 24-Dec-2005  perry branches: 1.39.2; 1.39.4; 1.39.6;
bare asm -> __asm
 1.38 26-Nov-2005  tsutsui Fix typo (FALLTHOUGH -> FALLTHROUGH). From Jeff Ito.
 1.37 13-Jun-2005  he branches: 1.37.2; 1.37.8;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.36 21-Feb-2005  thorpej Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding. Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes. Place items described
by the SCSI Primary Commands document into scsi_spc.h.
 1.35 18-Jan-2005  chs branches: 1.35.2;
de-__P, remove register, ansify.
 1.34 15-Jul-2003  lukem branches: 1.34.8;
rcsid
 1.33 03-May-2003  wiz branches: 1.33.2;
DMA, not dma nor Dma.
 1.32 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.31 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 30-May-2002  thorpej Statements must follow labels.
 1.28 05-Apr-2002  bouyer branches: 1.28.2;
Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.
 1.27 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.26 19-Dec-2001  minoura Implement bus_dmamap_sync properly.
dma_cachectl is now used only for DMAC array chain.
 1.25 04-Dec-2001  minoura Ooops, previous commit removed an important line unintentionally.
 1.24 25-Nov-2001  minoura Remove unused variables.
Correct printf format strings.
 1.23 04-Nov-2001  tsutsui branches: 1.23.2;
Use common macro to check message length.
 1.22 25-Apr-2001  bouyer branches: 1.22.2; 1.22.6;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.21 16-Jun-2000  minoura branches: 1.21.4;
Print newline while attach.
 1.20 30-Apr-2000  minoura branches: 1.20.2;
Revert 1.18 change.
Hopefully this is a temporary fix; something might be missing in
the SCSI negotiation.
 1.19 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.18 18-Nov-1999  minoura Do not reset SCSI bus.
 1.17 30-Sep-1999  thorpej branches: 1.17.2; 1.17.8;
Update for SCSIPI changes.
 1.16 18-Apr-1999  minoura Do not memcpy to the bouncebuffer in datain.
 1.15 24-Mar-1999  minoura branches: 1.15.2;
Shut up gcc -Wall.
 1.14 22-Mar-1999  minoura Use bus_dma(9) for DMA bouncing.
The code is dirty. It should be rewritten in the future.
 1.13 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.12 07-Feb-1999  minoura Issue SCSI reset on initialize.
Clean unused mha_reset.
 1.11 05-Dec-1998  mjacob branches: 1.11.4;
Update HBAs to incorporate the new max_lun property.
 1.10 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.9 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.8 09-Sep-1998  minoura Make device probe/attach sessions to be executed at splhigh.
mha driver used interrupt driven I/O.
 1.7 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.6 04-Aug-1998  minoura __BROKEN_INDIRECT_CONFIG fixes.
 1.5 04-Jul-1998  jonathan defopt DDB.
 1.4 30-Jun-1998  msaitoh sync with -current after a long silence
 1.3 12-Jan-1998  thorpej Update for changes to config.
 1.2 19-Oct-1997  oki branches: 1.2.2;
Test device is configured in interrput handler.
 1.1 19-Oct-1997  oki Support of MK-HA1 Mach-2 SCSI adaptor.
 1.2.2.1 13-Oct-1998  cgd pull up rev 1.4 from trunk (via patch). (minoura)
 1.11.4.4 14-Mar-1999  minoura Sync.
 1.11.4.3 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.11.4.2 30-Jan-1999  minoura Added DMAC driver.
 1.11.4.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.15.2.1 19-Apr-1999  cjs branches: 1.15.2.1.2;
Pull up to HEAD 1.16, per MINOURA Makoto <minoura@netbsd.org>.
 1.15.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.2.3 29-Mar-2001  bouyer Test-compile on i386
 1.17.2.2 27-Mar-2001  bouyer Convert to thorpej_scsipi (untested).
 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.20.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.21.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.22.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.22.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.22.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.22.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.23.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.23.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.23.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.23.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.23.2.1 04-Nov-2001  nathanw file mha.c was added on branch nathanw_sa on 2002-01-08 00:28:40 +0000
 1.28.2.1 15-Jul-2002  gehenna catch up with -current.
 1.33.2.7 11-Dec-2005  christos Sync with head.
 1.33.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.33.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.33.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.33.2.1 03-Aug-2004  skrll Sync with HEAD
 1.34.8.1 29-Apr-2005  kent sync with -current
 1.35.2.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.37.8.1 29-Nov-2005  yamt sync with head.
 1.37.2.3 03-Sep-2007  yamt sync with head.
 1.37.2.2 26-Feb-2007  yamt sync with head.
 1.37.2.1 21-Jun-2006  yamt sync with head.
 1.39.6.1 22-Apr-2006  simonb Sync with head.
 1.39.4.1 09-Sep-2006  rpaulo sync with head
 1.39.2.1 01-Mar-2006  yamt sync with head.
 1.40.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.40.2.1 13-Mar-2006  yamt sync with head.
 1.41.10.1 12-Jan-2007  ad Sync with head.
 1.42.2.2 17-May-2007  yamt sync with head.
 1.42.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.43.2.2 27-May-2007  ad Sync with head.
 1.43.2.1 13-Mar-2007  ad Sync with head.
 1.44.8.1 22-May-2007  matt Update to HEAD.
 1.44.2.1 11-Jul-2007  mjf Sync with head.
 1.45.10.1 06-Nov-2007  matt sync with HEAD
 1.46.20.3 11-Mar-2010  yamt sync with head
 1.46.20.2 04-May-2009  yamt sync with head.
 1.46.20.1 16-May-2008  yamt sync with head.
 1.46.18.2 17-Jun-2008  yamt sync with head.
 1.46.18.1 18-May-2008  yamt sync with head.
 1.46.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.46.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.46.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.47.4.1 18-Jun-2008  simonb Sync with head.
 1.47.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.48.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.48.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.52.22.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.52.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.52.18.1 17-Oct-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #601):
sys/arch/x68k/dev/mha.c: revision 1.53
Fix device_t/softc split botches that could be fatal. From
Chuck Silvers' patch posted current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html
Should be pulled up to netbsd-6.
 1.52.12.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.52.12.1 30-Oct-2012  yamt sync with head
 1.53.2.1 18-May-2014  rmind sync with head
 1.54.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.55.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.61.2.1 02-Aug-2025  perseant Sync with HEAD
 1.12 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.11 01-Jan-2022  andvar fix typos in comments, mainly basicly -> basically.
 1.10 29-Jul-2012  matt Another failed typedef fixed.
 1.9 29-Nov-2008  isaki branches: 1.9.16;
Split device_t/softc. Use aprint*() and device_xname().
Not tested. I don't have its hardware and no response in port-x68k.
 1.8 04-Mar-2007  christos branches: 1.8.40; 1.8.44; 1.8.50; 1.8.52;
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-Dec-2004  thorpej branches: 1.6.10;
Use "struct scsipi_command" in internal command structures so that
we have enough space for 16-byte CDBs.
 1.5 25-Apr-2001  bouyer branches: 1.5.8; 1.5.24;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.4 22-Mar-1999  minoura branches: 1.4.8; 1.4.20;
Use bus_dma(9) for DMA bouncing.
The code is dirty. It should be rewritten in the future.
 1.3 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.2 19-Nov-1998  thorpej branches: 1.2.4;
Adapt to the new scsipi_adapter interface.
 1.1 19-Oct-1997  oki Support of MK-HA1 Mach-2 SCSI adaptor.
 1.2.4.1 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.4.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.8.1 27-Mar-2001  bouyer Convert to thorpej_scsipi (untested).
 1.5.24.1 18-Dec-2004  skrll Sync with HEAD.
 1.5.8.2 25-Apr-2001  bouyer Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.5.8.1 25-Apr-2001  bouyer file mhavar.h was added on branch nathanw_sa on 2001-04-25 17:53:27 +0000
 1.6.10.1 03-Sep-2007  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.50.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.8.44.1 04-May-2009  yamt sync with head.
 1.8.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.16.1 30-Oct-2012  yamt sync with head
 1.42 24-May-2024  andvar s/borad/board/ in comments.
 1.41 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.40 23-May-2022  tsutsui Remove unused variables.
 1.39 23-May-2022  tsutsui Make local functions and variable static.
 1.38 23-May-2022  tsutsui Fix a wrong comment about mouse buttons, probably derived from Inside X68000.
 1.37 23-May-2022  tsutsui Add comments why delta Y of mouse input is inverted.
 1.36 24-Apr-2021  tsutsui Tidy up callout(9) implementation to handle mouse packets.

- define and use proper macro to specify ticks
- use callout_schedule(9) rather than callout_reset(9) to restart timer

No functional changes.
 1.35 07-Feb-2021  tsutsui Remove dumb middle button emulation code from the ms(4) driver.

Also fix leftover comments (derived from the original Sun's "firm_event"
implementation as seen in sys/dev/sun/ms.c) to sync with reality on x68k.

The current implementation the ms(4) driver just checks whether
two (left/right) buttons are changed in the same packet.
This means it cannot handle a release event correctly if two
buttons pressed simultaneously are released in the different timing.

The middle button emulation should be handled in application layer
as other Xservers do, and I'll import Emulate3Buttons support for the
X68k Xorg based monolithic server.

See my post on port-x68k@ for details:
https://mail-index.netbsd.org/port-x68k/2021/02/05/msg000074.html
 1.34 25-Jul-2014  dholland branches: 1.34.40;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.33 26-Mar-2014  christos branches: 1.33.2;
kill sprintf, fix unused.
 1.32 21-Mar-2014  tsutsui Replace tsleep(9)/wakeup(9) with condvar(9) as practice.

Also replace malloc(9) with kmem_alloc(9).
Pevent more possible races.

Tested on both console and Xserver on X68030.
 1.31 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.30 17-Jan-2009  isaki branches: 1.30.14; 1.30.24; 1.30.28;
Use firm_gettime() (in dev/sun/vuid_event.h) to adapt
changes in chiristos-time_t.
 1.29 25-Jun-2008  isaki branches: 1.29.4;
struct cfdata -> cfdata_t.
 1.28 20-Apr-2008  tsutsui branches: 1.28.2; 1.28.4; 1.28.6;
Split device_t/softc, as following its parents zsc(4). Spotted by isaki@.
 1.27 17-Oct-2007  garbled branches: 1.27.16; 1.27.18;
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.26 09-Jul-2007  ad branches: 1.26.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.25 11-Mar-2007  isaki branches: 1.25.2; 1.25.8;
white space, indent and KNF.
 1.24 04-Mar-2007  christos branches: 1.24.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.23 18-Sep-2006  gdamore branches: 1.23.4;
Convert references to "time" to calls to "getmicrotime()", needed for
conversion to timecounters.
 1.22 29-Mar-2006  thorpej branches: 1.22.8; 1.22.10;
Use device_cfdata().
 1.21 11-Dec-2005  christos branches: 1.21.4; 1.21.6; 1.21.8; 1.21.10; 1.21.12;
merge ktrace-lwp.
 1.20 18-Jan-2005  chs branches: 1.20.8;
de-__P, remove register, ansify.
 1.19 21-Sep-2003  jdolecek branches: 1.19.8;
cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
the owner of descriptor, according to appropriate sematics
of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
 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 15-Jul-2003  lukem rcsid
 1.16 23-Oct-2002  jdolecek branches: 1.16.6;
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.15 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.14 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 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.11 25-Nov-2001  minoura branches: 1.11.8;
Remove unused variables.
Correct printf format strings.
 1.10 23-Mar-2000  thorpej branches: 1.10.6; 1.10.8; 1.10.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.9 14-Jan-2000  itohy Change the implementation of ms(4) polling to use timeout(9) software
interrupt in order to eliminate glitches on MPU interrupt levels.
I don't know whether this is a good solution, but it does work.
 1.8 24-Mar-1999  minoura branches: 1.8.2; 1.8.8;
Shut up gcc -Wall.
 1.7 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.6 03-Feb-1999  mycroft Catch up with a change to the stint interface.
 1.5 05-Aug-1998  minoura branches: 1.5.6;
Switched to MI zs driver.
 1.4 12-Oct-1997  oki branches: 1.4.2;
Add prototype.
 1.3 23-Nov-1996  oki branches: 1.3.10;
Implement poll(2).
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.2.1 05-Feb-1999  cgd pull up patch to make mouse optional. Previously it was mandatory
because some mouse-related functions were referenced from other files.
Never committed to trunk because -current uses MI zs driver. (minoura)
 1.5.6.2 14-Mar-1999  minoura Sync.
 1.5.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 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 15-Jan-2000  he Pull up revision 1.9 (requested by itohy):
Change the implementation of ms(4) polling to use timeout(9)
software timer, and change the clock interrupt handler not to
lower interrupt level, in order to eliminate glitches on MPU
interrupt levels.
 1.10.12.4 11-Nov-2002  nathanw Catch up to -current
 1.10.12.3 18-Oct-2002  nathanw Catch up to -current.
 1.10.12.2 17-Sep-2002  nathanw Catch up to -current.
 1.10.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.10.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.10.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.8.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.10.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.11.8.1 17-May-2002  gehenna Add device switch.
 1.16.6.5 04-Feb-2005  skrll Adapt to branch.
 1.16.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.16.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.16.6.1 03-Aug-2004  skrll Sync with HEAD
 1.19.8.1 29-Apr-2005  kent sync with -current
 1.20.8.3 03-Sep-2007  yamt sync with head.
 1.20.8.2 30-Dec-2006  yamt sync with head.
 1.20.8.1 21-Jun-2006  yamt sync with head.
 1.21.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.21.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.21.8.1 01-Apr-2006  yamt sync with head.
 1.21.6.1 22-Apr-2006  simonb Sync with head.
 1.21.4.1 09-Sep-2006  rpaulo sync with head
 1.22.10.1 22-Oct-2006  yamt sync with head
 1.22.8.1 18-Nov-2006  ad Sync with head.
 1.23.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.2.2 15-Jul-2007  ad Sync with head.
 1.24.2.1 13-Mar-2007  ad Sync with head.
 1.25.8.1 03-Oct-2007  garbled Sync with HEAD
 1.25.2.1 11-Jul-2007  mjf Sync with head.
 1.26.10.1 06-Nov-2007  matt sync with HEAD
 1.27.18.1 18-May-2008  yamt sync with head.
 1.27.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.27.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.27.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.28.6.1 27-Jun-2008  simonb Sync with head.
 1.28.4.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.28.2.1 04-May-2009  yamt sync with head.
 1.29.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.30.28.1 18-May-2014  rmind sync with head
 1.30.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.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.33.2.1 10-Aug-2014  tls Rebase.
 1.34.40.1 03-Apr-2021  thorpej Sync with HEAD.
 1.23 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.22 24-Apr-2021  thorpej branches: 1.22.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.21 10-Nov-2019  chs branches: 1.21.10;
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.20 26-Mar-2014  christos branches: 1.20.30;
kill sprintf, fix unused.
 1.19 18-Dec-2008  isaki branches: 1.19.14; 1.19.24; 1.19.28;
Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.18 25-Jun-2008  isaki branches: 1.18.4;
Split device_t/softc. Use aprint*() and device_xname().
 1.17 04-May-2008  martin branches: 1.17.2; 1.17.4;
Move to standard TNF 2 clause license
 1.16 11-Mar-2007  isaki branches: 1.16.38; 1.16.40; 1.16.42;
white space, indent and KNF.
 1.15 11-Dec-2005  christos branches: 1.15.26; 1.15.30;
merge ktrace-lwp.
 1.14 26-Aug-2005  drochner s/locdesc_t/int/g
 1.13 30-Jun-2005  drochner branches: 1.13.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.12 13-Jun-2005  he Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.11 18-Jan-2005  chs de-__P, remove register, ansify.
 1.10 15-Jul-2003  lukem branches: 1.10.8;
rcsid
 1.9 01-Jan-2003  thorpej branches: 1.9.2;
Use aprint_normal() for cfprint routines.
 1.8 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.7 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 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.4 16-Jan-2000  minoura branches: 1.4.8; 1.4.12;
Minor cleanups & corrections.
 1.3 24-Mar-1999  minoura branches: 1.3.8;
Shut up gcc -Wall.
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file neptune.c was initially added on branch minoura_x68k_bus_h.
 1.1.2.6 14-Mar-1999  minoura Use a single (inline) function instead of refering the bus_space switch.
 1.1.2.5 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.1.2.4 13-Feb-1999  minoura Use BUS_SPACE_MAP_SHIFTED.
 1.1.2.3 28-Dec-1998  minoura Free i/o map when the NIC is not found.
 1.1.2.2 27-Dec-1998  minoura Match device names.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.3.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.12.2 03-Jan-2003  thorpej Sync with HEAD.
 1.4.12.1 18-Oct-2002  nathanw Catch up to -current.
 1.4.8.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.9.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.4 24-Jan-2005  skrll Sync with HEAD.
 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.10.8.1 29-Apr-2005  kent sync with -current
 1.13.2.2 03-Sep-2007  yamt sync with head.
 1.13.2.1 21-Jun-2006  yamt sync with head.
 1.15.30.1 13-Mar-2007  ad Sync with head.
 1.15.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.42.2 04-May-2009  yamt sync with head.
 1.16.42.1 16-May-2008  yamt sync with head.
 1.16.40.1 18-May-2008  yamt sync with head.
 1.16.38.3 17-Jan-2009  mjf Sync with HEAD.
 1.16.38.2 29-Jun-2008  mjf Sync with HEAD.
 1.16.38.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.4.1 27-Jun-2008  simonb Sync with head.
 1.17.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.18.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.28.1 18-May-2014  rmind sync with head
 1.19.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.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.20.30.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.21.10.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.21.10.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.21.10.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.22.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 25-Jun-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
 1.4 04-May-2008  martin branches: 1.4.2; 1.4.4;
Move to standard TNF 2 clause license
 1.3 24-Mar-1999  minoura branches: 1.3.144; 1.3.146; 1.3.148;
Shut up gcc -Wall.
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file neptunevar.h was initially added on branch minoura_x68k_bus_h.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.3.148.2 04-May-2009  yamt sync with head.
 1.3.148.1 16-May-2008  yamt sync with head.
 1.3.146.1 18-May-2008  yamt sync with head.
 1.3.144.2 29-Jun-2008  mjf Sync with HEAD.
 1.3.144.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.4.1 27-Jun-2008  simonb Sync with head.
 1.4.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.20 26-Mar-2014  christos kill sprintf, fix unused.
 1.19 25-Jun-2008  isaki branches: 1.19.30; 1.19.40; 1.19.46;
Split device_t/softc. Use aprint*() and device_xname().
 1.18 11-Mar-2007  isaki branches: 1.18.38; 1.18.42; 1.18.44; 1.18.46;
white space, indent and KNF.
 1.17 11-Mar-2007  isaki Remove an extra white space.
 1.16 28-Mar-2006  thorpej branches: 1.16.14; 1.16.18;
Use device_unit().
 1.15 24-Dec-2005  perry branches: 1.15.4; 1.15.6; 1.15.8; 1.15.10; 1.15.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.14 11-Dec-2005  christos merge ktrace-lwp.
 1.13 18-Jan-2005  chs branches: 1.13.8;
de-__P, remove register, ansify.
 1.12 08-May-2004  minoura branches: 1.12.4;
An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.11 15-Jul-2003  lukem rcsid
 1.10 02-Oct-2002  thorpej branches: 1.10.6;
Add trailing ; to CFATTACH_DECL.
 1.9 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.8 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.7 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.6 02-May-2001  minoura branches: 1.6.2; 1.6.4; 1.6.8;
X68k built-in voice synthesizer.
 1.5 24-Mar-1999  minoura branches: 1.5.20;
Shut up gcc -Wall.
 1.4 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.3 12-Oct-1997  oki branches: 1.3.10;
Added prototypes.
 1.2 21-May-1996  oki branches: 1.2.12;
Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.10.3 13-Feb-1999  minoura Use BUS_SPACE_MAP_SHIFTED.
 1.3.10.2 02-Feb-1999  minoura Message change.
 1.3.10.1 31-Jan-1999  minoura opm at intio.
 1.5.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.8.1 02-May-2001  nathanw file opm.c was added on branch nathanw_sa on 2002-01-08 00:28:41 +0000
 1.6.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.6.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.6.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.12.4.1 29-Apr-2005  kent sync with -current
 1.13.8.2 03-Sep-2007  yamt sync with head.
 1.13.8.1 21-Jun-2006  yamt sync with head.
 1.15.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.15.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.15.8.1 01-Apr-2006  yamt sync with head.
 1.15.6.1 22-Apr-2006  simonb Sync with head.
 1.15.4.1 09-Sep-2006  rpaulo sync with head
 1.16.18.1 13-Mar-2007  ad Sync with head.
 1.16.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.18.46.1 27-Jun-2008  simonb Sync with head.
 1.18.44.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.18.42.1 04-May-2009  yamt sync with head.
 1.18.38.1 29-Jun-2008  mjf Sync with HEAD.
 1.19.46.1 18-May-2014  rmind sync with head
 1.19.40.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.30.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.28 10-Nov-2019  chs 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.27 22-Aug-2015  christos branches: 1.27.18;
fix include filename.
 1.26 20-Aug-2015  christos include "ioconf.h" to get the 'void <driver>attach(int count);' prototype.
 1.25 25-Jul-2014  dholland branches: 1.25.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.24 16-Mar-2014  dholland branches: 1.24.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.23 18-Jan-2009  isaki branches: 1.23.14; 1.23.24; 1.23.28;
- malloc() + memset(0) -> malloc(M_ZERO).
- remove temporary variable.
 1.22 18-Jan-2009  isaki Clean up header files.
 1.21 17-Oct-2007  garbled branches: 1.21.20; 1.21.28;
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.20 09-Jul-2007  ad branches: 1.20.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.19 12-May-2007  isaki Clean up white spaces and tabs.
 1.18 11-Mar-2007  isaki branches: 1.18.2; 1.18.8;
Include appropriate header file.
 1.17 11-Mar-2007  isaki white space, indent and KNF.
 1.16 11-Mar-2007  isaki Remove an extra white space.
 1.15 04-Mar-2007  christos branches: 1.15.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 11-Dec-2005  christos branches: 1.14.26;
merge ktrace-lwp.
 1.13 18-Jan-2005  chs branches: 1.13.8;
de-__P, remove register, ansify.
 1.12 08-May-2004  minoura branches: 1.12.4;
An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.11 15-Jul-2003  lukem rcsid
 1.10 23-Oct-2002  jdolecek branches: 1.10.6;
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.9 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.8 27-Dec-2001  wiz branches: 1.8.8;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.7 23-Mar-2000  thorpej branches: 1.7.6; 1.7.8; 1.7.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.6 24-Mar-1999  minoura branches: 1.6.8;
Shut up gcc -Wall.
 1.5 12-Oct-1997  oki Added prototype.
 1.4 13-Oct-1996  christos branches: 1.4.10;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.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.7.12.3 11-Nov-2002  nathanw Catch up to -current
 1.7.12.2 17-Sep-2002  nathanw Catch up to -current.
 1.7.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.7.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.7.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.8.8.1 17-May-2002  gehenna Add device switch.
 1.10.6.5 04-Feb-2005  skrll Adapt to branch.
 1.10.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.12.4.1 29-Apr-2005  kent sync with -current
 1.13.8.2 03-Sep-2007  yamt sync with head.
 1.13.8.1 21-Jun-2006  yamt sync with head.
 1.14.26.2 17-May-2007  yamt sync with head.
 1.14.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.2.3 15-Jul-2007  ad Sync with head.
 1.15.2.2 27-May-2007  ad Sync with head.
 1.15.2.1 13-Mar-2007  ad Sync with head.
 1.18.8.2 03-Oct-2007  garbled Sync with HEAD
 1.18.8.1 22-May-2007  matt Update to HEAD.
 1.18.2.1 11-Jul-2007  mjf Sync with head.
 1.20.10.1 06-Nov-2007  matt sync with HEAD
 1.21.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.21.20.1 04-May-2009  yamt sync with head.
 1.23.28.1 18-May-2014  rmind sync with head
 1.23.24.2 03-Dec-2017  jdolecek update from HEAD
 1.23.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.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.24.2.1 10-Aug-2014  tls Rebase.
 1.25.4.1 22-Sep-2015  skrll Sync with HEAD
 1.27.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 08-May-2004  minoura An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 08-May-2004  minoura An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.3 02-May-2001  minoura branches: 1.3.8; 1.3.24;
X68k built-in voice synthesizer.
 1.2 16-Mar-1999  minoura branches: 1.2.20;
Merged minoura_x68k_bus_h branch.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.24;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.24.2 13-Feb-1999  minoura Use BUS_SPACE_MAP_SHIFTED.
 1.1.1.1.24.1 31-Jan-1999  minoura opm at intio.
 1.2.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.24.1 03-Aug-2004  skrll Sync with HEAD
 1.3.8.2 02-May-2001  minoura X68k built-in voice synthesizer.
 1.3.8.1 02-May-2001  minoura file opmreg.h was added on branch nathanw_sa on 2001-05-02 13:00:21 +0000
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 18-Jan-2005  chs de-__P, remove register, ansify.
 1.1 08-May-2004  minoura branches: 1.1.2; 1.1.6;
An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.1.6.1 29-Apr-2005  kent sync with -current
 1.1.2.5 24-Jan-2005  skrll Sync with HEAD.
 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 opmvar.h was added on branch ktrace-lwp on 2004-08-03 10:42:47 +0000
 1.45 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.44 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.43 03-Sep-2018  riastradh 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.42 25-Jul-2014  dholland branches: 1.42.26; 1.42.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.41 26-Mar-2014  christos branches: 1.41.2;
kill sprintf, fix unused.
 1.40 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.39 13-Oct-2012  tsutsui branches: 1.39.2;
Normalize autoconf(9) function arg names (parent, self, and aux)
for clarification. from chs@.
 1.38 09-Jan-2010  isaki branches: 1.38.12; 1.38.22;
Make compile with DEBUG.
 1.37 25-Jun-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
 1.36 08-Jun-2008  tsutsui branches: 1.36.2;
Use device_private() and device_lookup_private() to get softc.
 1.35 17-Oct-2007  garbled branches: 1.35.16; 1.35.18; 1.35.20; 1.35.22;
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 14-Jul-2007  isaki branches: 1.34.10;
Make it compilable after the merge of some vmlocking branch.
OK'ed by ad@.
 1.33 14-Jul-2007  ad - Restore com.c 1.45, par.c 1.31. They were trashed due to file system
corruption on my machine.
- Adjust to match callout_init signature change.
 1.32 09-Jul-2007  ad Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.31 12-May-2007  isaki Clean up white spaces and tabs.
 1.30 11-Mar-2007  isaki branches: 1.30.2; 1.30.8;
Include appropriate header file.
 1.29 11-Mar-2007  isaki white space, indent and KNF.
 1.28 11-Mar-2007  isaki Remove an extra white space.
 1.27 04-Mar-2007  christos branches: 1.27.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 16-Feb-2007  ad branches: 1.26.2;
More spllowersoftclock() fallout.
 1.25 28-Mar-2006  thorpej Use device_unit().
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10; 1.24.12;
merge ktrace-lwp.
 1.23 18-Jan-2005  chs branches: 1.23.8;
de-__P, remove register, ansify.
 1.22 13-Dec-2004  chs branches: 1.22.2;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.21 01-Nov-2003  jdolecek shutup one bogus -Wunitialized warning, and fix one correct

XXX parrw() routine looks like not actually correct for transfers
XXX larger than sc_burst - someone with the hardware should check & fix this
 1.20 01-Nov-2003  jdolecek drop register qualifiers
 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 15-Jul-2003  lukem rcsid
 1.17 23-Oct-2002  jdolecek branches: 1.17.6;
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.16 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.15 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 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.12 11-Jun-2000  minoura branches: 1.12.4; 1.12.6; 1.12.10; 1.12.18;
G/C of unused interrupt stubs, and other cleanups.
 1.11 27-Mar-2000  minoura branches: 1.11.2;
Move par under intio.
 1.10 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.9 05-Aug-1999  thorpej branches: 1.9.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.8 05-May-1999  minoura Shut up gcc -Wall.
 1.7 07-Aug-1998  minoura branches: 1.7.10;
Moved parioctl.h to the system header directory.
 1.6 12-Jan-1998  thorpej Update for changes to config.
 1.5 12-Oct-1997  oki Added prototype.
 1.4 13-Oct-1996  christos branches: 1.4.10;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.10.1 21-Jun-1999  thorpej Sync w/ -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.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.12.18.1 17-May-2002  gehenna Add device switch.
 1.12.10.3 11-Nov-2002  nathanw Catch up to -current
 1.12.10.2 18-Oct-2002  nathanw Catch up to -current.
 1.12.10.1 17-Sep-2002  nathanw Catch up to -current.
 1.12.6.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.12.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.17.6.6 04-Feb-2005  skrll Adapt to branch.
 1.17.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.17.6.4 18-Dec-2004  skrll Sync with HEAD.
 1.17.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.6.1 03-Aug-2004  skrll Sync with HEAD
 1.22.2.1 29-Apr-2005  kent sync with -current
 1.23.8.3 03-Sep-2007  yamt sync with head.
 1.23.8.2 26-Feb-2007  yamt sync with head.
 1.23.8.1 21-Jun-2006  yamt sync with head.
 1.24.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.24.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.24.8.1 01-Apr-2006  yamt sync with head.
 1.24.6.1 22-Apr-2006  simonb Sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.26.2.2 17-May-2007  yamt sync with head.
 1.26.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.2.3 15-Jul-2007  ad Sync with head.
 1.27.2.2 27-May-2007  ad Sync with head.
 1.27.2.1 13-Mar-2007  ad Sync with head.
 1.30.8.2 03-Oct-2007  garbled Sync with HEAD
 1.30.8.1 22-May-2007  matt Update to HEAD.
 1.30.2.1 11-Jul-2007  mjf Sync with head.
 1.34.10.1 06-Nov-2007  matt sync with HEAD
 1.35.22.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.35.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.35.20.2 11-Mar-2010  yamt sync with head
 1.35.20.1 04-May-2009  yamt sync with head.
 1.35.18.1 17-Jun-2008  yamt sync with head.
 1.35.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.36.2.1 27-Jun-2008  simonb Sync with head.
 1.38.22.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.38.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.38.12.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.38.12.1 30-Oct-2012  yamt sync with head
 1.39.2.1 18-May-2014  rmind sync with head
 1.41.2.1 10-Aug-2014  tls Rebase.
 1.42.28.1 10-Jun-2019  christos Sync with HEAD
 1.42.26.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3 07-Aug-1998  minoura Moved parioctl.h to the system header directory.
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.24 19-Nov-2011  isaki Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.23 18-Jan-2009  isaki branches: 1.23.14;
Delete 10 years old #if 0'd comments in intio.c, locore.s.
According to the old comment, the interrupt handler via intiotrap
should set his interrupt level again, but it's not right. And
don't set it again by interrupt hander.
 1.22 20-Dec-2008  isaki x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
 1.21 20-Dec-2008  isaki Make pow(4) a hardware device.
Now pow(4) uses intio_intr_establish() which is a common interrupt
routine, but not powtrap which is a device specific routine.
 1.20 14-Dec-2008  isaki Use intio_set_*() macros to purge macros by the name of sysport, ioctlr.
 1.19 14-Dec-2008  isaki Use mfp_{set,clear}_*() macros to purge macros by the name of 'mfp'.
 1.18 13-Dec-2008  isaki Fix a broken 'Front power switch' signal.
Use softint(9), instead of using psignal(9) in
hardware interrupt. Thanks to soda-san.
 1.17 11-Mar-2007  isaki branches: 1.17.38; 1.17.42; 1.17.50;
white space, indent and KNF.
 1.16 11-Mar-2007  isaki Remove an extra white space.
 1.15 04-Mar-2007  christos branches: 1.15.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 11-Dec-2005  christos branches: 1.14.26;
merge ktrace-lwp.
 1.13 13-Jun-2005  he branches: 1.13.2;
Add volatile to a cast to make this build with -Wcast-qual.
 1.12 18-Jan-2005  chs de-__P, remove register, ansify.
 1.11 15-Jul-2003  lukem branches: 1.11.8;
rcsid
 1.10 23-Oct-2002  jdolecek branches: 1.10.6;
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.9 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.8 20-Feb-2000  minoura branches: 1.8.6; 1.8.8; 1.8.12; 1.8.20;
According to Takeshi Nakayama <tn@catvmics.ne.jp>,
POW_ALARMSW seems always 1 on some models (at least XVI).
 1.7 04-Aug-1998  minoura branches: 1.7.14;
RB_POWERDOWN is now supported.
Check if the power switch is open (off) in the shutdown_hook,
and try removing the power in cpu_reboot.
poffd default action is now shutdown -p.
 1.6 12-Oct-1997  oki Added prototype.
 1.5 03-Feb-1997  oki branches: 1.5.8;
Remove #include <string.h>
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 15-May-1996  oki fixed gcc -Wall warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.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.8.20.1 17-May-2002  gehenna Add device switch.
 1.8.12.2 11-Nov-2002  nathanw Catch up to -current
 1.8.12.1 17-Sep-2002  nathanw Catch up to -current.
 1.8.8.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.8.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.10.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.6.5 04-Feb-2005  skrll Adapt to branch.
 1.10.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11.8.1 29-Apr-2005  kent sync with -current
 1.13.2.2 03-Sep-2007  yamt sync with head.
 1.13.2.1 21-Jun-2006  yamt sync with head.
 1.14.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.2.1 13-Mar-2007  ad Sync with head.
 1.17.50.1 19-Jan-2009  skrll Sync with HEAD.
 1.17.42.1 04-May-2009  yamt sync with head.
 1.17.38.1 17-Jan-2009  mjf Sync with HEAD.
 1.23.14.1 17-Apr-2012  yamt sync with head
 1.4 16-Jul-2022  isaki The system should halt if the powerdown fails.
On X680x0 hardware, front power button is an alternate switch.
If the power button is left on, the power will not turn off.
In addition, with this change, power_switch_is_off in powsw.c is
no longer necessary.
 1.3 16-Jul-2022  isaki Style fixes.
 1.2 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.1 27-Nov-2011  isaki branches: 1.1.6;
Add powsw(4) for x68k power switch. It substitutes for a part about
power switch handler of pow(4) deleted before.
Benefits than pow(4):
- separate a front switch (= powsw0) and an EXPWON line (= powsw1)
completely. Only powsw0 is enabled in GENERIC by default.
- prevent chattering in some hardware individuals.
thank you for a report and a test: Yasushi Oshima and Y.Sugahara.
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 27-Nov-2011  yamt file powsw.c was added on branch yamt-pagecache on 2012-04-17 00:07:02 +0000
 1.5 19-Nov-2011  isaki Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.4 20-Dec-2008  isaki branches: 1.4.14;
x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
 1.3 13-Dec-2008  isaki Fix a broken 'Front power switch' signal.
Use softint(9), instead of using psignal(9) in
hardware interrupt. Thanks to soda-san.
 1.2 05-Jan-1998  perry branches: 1.2.152; 1.2.156; 1.2.164;
RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.164.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.156.1 04-May-2009  yamt sync with head.
 1.2.152.1 17-Jan-2009  mjf Sync with HEAD.
 1.4.14.1 17-Apr-2012  yamt sync with head
 1.26 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.25 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.24 26-Mar-2014  christos kill sprintf, fix unused.
 1.23 03-Jan-2009  isaki branches: 1.23.14; 1.23.24; 1.23.28;
rtclockinit() and range_test*() were removed in rtclock.c,v 1.19.
 1.22 25-Jun-2008  isaki branches: 1.22.4;
Split device_t/softc. Use aprint*() and device_xname().
 1.21 11-Mar-2007  isaki branches: 1.21.38; 1.21.42; 1.21.44; 1.21.46;
white space, indent and KNF.
 1.20 11-Mar-2007  isaki Remove an extra white space.
 1.19 14-Sep-2006  gdamore branches: 1.19.6; 1.19.10;
Converted x68k to todr. Compile tested only, but it has a low probably
of breaking anything.
 1.18 11-Dec-2005  christos branches: 1.18.8; 1.18.20;
merge ktrace-lwp.
 1.17 18-Jan-2005  chs branches: 1.17.8;
de-__P, remove register, ansify.
 1.16 13-Dec-2004  chs branches: 1.16.2;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.15 15-Jul-2003  lukem rcsid
 1.14 02-Oct-2002  thorpej branches: 1.14.6;
Add trailing ; to CFATTACH_DECL.
 1.13 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.11 14-May-2002  matt Eliminate commons (including many used ones). Clean up variable references.
 1.10 26-May-2001  minoura branches: 1.10.2; 1.10.8;
Honor rtc_offset.
 1.9 15-Jan-2001  itohy branches: 1.9.2;
Make it compile with "options DIAGNOSTIC" (patch from minoura).
 1.8 11-Jan-2001  minoura Use MI clock_subr.c.
 1.7 09-Jan-2001  minoura Do not range_test() unless DIAGNOSTIC.
Suggested by Tetsuya Isaki <isaki@v6.ipc.hiroshima-u.ac.jp>.
 1.6 04-Jan-2001  minoura Correct `Year 2001 problem'.
Pointed out by Okamoto Kohichi <GHG03305@nifty.ne.jp> and
URA Hiroshi <ura@hiru.aoba.yokohama.jp>.
 1.5 24-Mar-1999  minoura branches: 1.5.2; 1.5.8; 1.5.18;
Shut up gcc -Wall.
 1.4 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.3 12-Oct-1997  oki branches: 1.3.10;
Added prototypes.
 1.2 15-Jan-1997  perry branches: 1.2.8;
Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.2;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.2.1 18-Jan-1997  thorpej Update from trunk.
 1.2.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.10.2 27-Dec-1998  minoura Match device names.
 1.3.10.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.5.18.1 25-Jan-2001  jhawk Pull up revision 1.6 (requested by minoura):
Correct errant year 2001 bounds check.
 1.5.8.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.5.8.1 05-Jan-2001  bouyer Sync with HEAD
 1.5.2.1 21-Jan-2001  he Pull up revision 1.6 (requested by minoura):
Correct ``Year 2001 problem''.
 1.9.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.10.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.10.8.1 26-May-2001  nathanw file rtclock.c was added on branch nathanw_sa on 2002-06-20 03:42:32 +0000
 1.10.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.10.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.14.6.4 18-Dec-2004  skrll Sync with HEAD.
 1.14.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.6.1 03-Aug-2004  skrll Sync with HEAD
 1.16.2.1 29-Apr-2005  kent sync with -current
 1.17.8.2 03-Sep-2007  yamt sync with head.
 1.17.8.1 30-Dec-2006  yamt sync with head.
 1.18.20.1 18-Nov-2006  ad Sync with head.
 1.18.8.1 14-Sep-2006  yamt sync with head.
 1.19.10.1 13-Mar-2007  ad Sync with head.
 1.19.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.46.1 27-Jun-2008  simonb Sync with head.
 1.21.44.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.21.42.1 04-May-2009  yamt sync with head.
 1.21.38.2 17-Jan-2009  mjf Sync with HEAD.
 1.21.38.1 29-Jun-2008  mjf Sync with HEAD.
 1.22.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.23.28.1 18-May-2014  rmind sync with head
 1.23.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.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.12 21-Aug-2021  andvar s/helt/held+s/eroneously/erroneously/+s/splitted/split/+s/recommented/recommended/
 1.11 03-Jan-2009  isaki rtclockinit() and range_test*() were removed in rtclock.c,v 1.19.
 1.10 25-Jun-2008  isaki branches: 1.10.4;
Split device_t/softc. Use aprint*() and device_xname().
 1.9 04-Mar-2007  isaki branches: 1.9.40; 1.9.44; 1.9.46; 1.9.48;
Delete old prototypes.
 1.8 14-Sep-2006  gdamore branches: 1.8.6;
Converted x68k to todr. Compile tested only, but it has a low probably
of breaking anything.
 1.7 11-Dec-2005  christos branches: 1.7.8; 1.7.20;
merge ktrace-lwp.
 1.6 18-Jan-2005  chs branches: 1.6.8;
de-__P, remove register, ansify.
 1.5 14-May-2002  matt branches: 1.5.10; 1.5.18;
Eliminate commons (including many used ones). Clean up variable references.
 1.4 15-Jan-2001  itohy branches: 1.4.4; 1.4.8;
Make it compile with "options DIAGNOSTIC" (patch from minoura).
 1.3 11-Jan-2001  minoura Use MI clock_subr.c.
 1.2 16-Mar-1999  minoura branches: 1.2.8;
Merged minoura_x68k_bus_h branch.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.24;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.24.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.2.8.1 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.4.8.1 20-Jun-2002  nathanw Catch up to -current.
 1.4.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.18.1 29-Apr-2005  kent sync with -current
 1.5.10.1 24-Jan-2005  skrll Sync with HEAD.
 1.6.8.2 03-Sep-2007  yamt sync with head.
 1.6.8.1 30-Dec-2006  yamt sync with head.
 1.7.20.1 18-Nov-2006  ad Sync with head.
 1.7.8.1 14-Sep-2006  yamt sync with head.
 1.8.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.48.1 27-Jun-2008  simonb Sync with head.
 1.9.46.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.9.44.1 04-May-2009  yamt sync with head.
 1.9.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.9.40.1 29-Jun-2008  mjf Sync with HEAD.
 1.10.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.22 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.21 24-Apr-2021  thorpej branches: 1.21.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.20 26-Mar-2014  christos branches: 1.20.44;
kill sprintf, fix unused.
 1.19 18-Dec-2008  isaki branches: 1.19.14; 1.19.24; 1.19.28;
Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.18 25-Jun-2008  isaki branches: 1.18.4;
Split device_t/softc. Use aprint*() and device_xname().
 1.17 04-May-2008  martin branches: 1.17.2; 1.17.4;
Move to standard TNF 2 clause license
 1.16 11-Mar-2007  isaki branches: 1.16.38; 1.16.40; 1.16.42;
white space, indent and KNF.
 1.15 11-Mar-2007  isaki Remove an extra white space.
 1.14 11-Dec-2005  christos branches: 1.14.26; 1.14.30;
merge ktrace-lwp.
 1.13 30-Jun-2005  drochner branches: 1.13.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.12 13-Jun-2005  he Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.11 18-Jan-2005  chs de-__P, remove register, ansify.
 1.10 15-Jul-2003  lukem branches: 1.10.8;
rcsid
 1.9 02-Oct-2002  thorpej branches: 1.9.6;
Add trailing ; to CFATTACH_DECL.
 1.8 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.7 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.6 16-Jan-2000  minoura branches: 1.6.8; 1.6.12;
Minor cleanups & corrections.
 1.5 22-Apr-1999  minoura branches: 1.5.2;
I deleted a necessary line by mistake.
 1.4 22-Apr-1999  minoura Bus error occurred on such machines without the SCSI ROM.
Insert badaddr() check before read the ROM.
 1.3 24-Mar-1999  minoura branches: 1.3.2;
Shut up gcc -Wall.
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 14-Mar-1999  minoura branches: 1.1.2;
file scsirom.c was initially added on branch minoura_x68k_bus_h.
 1.1.2.1 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.3.2.2 22-Apr-1999  perry branches: 1.3.2.2.2;
pullup 1.4->1.5 (minoura)
 1.3.2.1 22-Apr-1999  perry pullup 1.3->1.4 (minoura)
 1.3.2.2.2.1 21-Jun-1999  thorpej Sync w/ -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.6.12.1 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.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.9.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.6.4 24-Jan-2005  skrll Sync with HEAD.
 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-Aug-2004  skrll Sync with HEAD
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.13.2.1 03-Sep-2007  yamt sync with head.
 1.14.30.1 13-Mar-2007  ad Sync with head.
 1.14.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.42.2 04-May-2009  yamt sync with head.
 1.16.42.1 16-May-2008  yamt sync with head.
 1.16.40.1 18-May-2008  yamt sync with head.
 1.16.38.3 17-Jan-2009  mjf Sync with HEAD.
 1.16.38.2 29-Jun-2008  mjf Sync with HEAD.
 1.16.38.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.4.1 27-Jun-2008  simonb Sync with head.
 1.17.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.18.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.28.1 18-May-2014  rmind sync with head
 1.19.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.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.20.44.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.20.44.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.20.44.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.21.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.7 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.6 25-Jun-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.78; 1.5.80; 1.5.82;
merge ktrace-lwp.
 1.4 18-Jan-2005  chs de-__P, remove register, ansify.
 1.3 16-Jan-2000  minoura branches: 1.3.28; 1.3.36;
Minor cleanups & corrections.
 1.2 16-Mar-1999  minoura branches: 1.2.8;
Merged minoura_x68k_bus_h branch.
 1.1 14-Mar-1999  minoura branches: 1.1.2;
file scsiromvar.h was initially added on branch minoura_x68k_bus_h.
 1.1.2.1 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 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.36.1 29-Apr-2005  kent sync with -current
 1.3.28.1 24-Jan-2005  skrll Sync with HEAD.
 1.5.82.1 27-Jun-2008  simonb Sync with head.
 1.5.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.78.1 04-May-2009  yamt sync with head.
 1.5.74.1 29-Jun-2008  mjf Sync with HEAD.
 1.2 19-Oct-2002  isaki Not used anywhere.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.50;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.50.1 11-Nov-2002  nathanw Catch up to -current
 1.16 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.15 23-Apr-2016  skrll Merge nick-nhusb

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
 1.14 24-Jul-2010  isaki branches: 1.14.18; 1.14.34; 1.14.36; 1.14.40;
Probe not only Nereid Ctrl port but also SL811HS/T port.
 1.13 08-May-2010  isaki Correct rev1.11.
Fix panic reported by Yasushi Oshima.
 1.12 18-Dec-2008  isaki branches: 1.12.4; 1.12.6;
Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.11 23-May-2008  isaki branches: 1.11.6;
Catch up with device_t/device_xname changes on MI USB part.
 1.10 28-Apr-2008  martin branches: 1.10.2;
Remove clause 3 and 4 from TNF licenses
 1.9 17-Oct-2007  garbled branches: 1.9.16; 1.9.18; 1.9.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.8 15-Aug-2007  kiyohara branches: 1.8.2;
Replace to Matthew Orgass's slhci(4).
http://mail-index.netbsd.org/tech-kern/2007/06/26/0001.html
 1.7 11-Dec-2005  christos branches: 1.7.30; 1.7.38; 1.7.42; 1.7.46; 1.7.50;
merge ktrace-lwp.
 1.6 13-Jun-2005  he branches: 1.6.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.5 15-Jul-2003  lukem rcsid
 1.4 02-Oct-2002  thorpej branches: 1.4.6;
Add trailing ; to CFATTACH_DECL.
 1.3 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.2 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.1 11-Aug-2002  isaki branches: 1.1.2; 1.1.4; 1.1.6;
Add driver for ScanLogic SL811HS/T USB Host Controller.
XXX It's experimental code yet.

For x68k: USB part of Nereid USB/Ethernet/memory board
For ISA: ISA USB Host board from Morphy planning
 1.1.6.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.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 11-Aug-2002  jdolecek file slhci_intio.c was added on branch kqueue on 2002-09-06 08:42:41 +0000
 1.1.4.2 31-Aug-2002  gehenna catch up with -current.
 1.1.4.1 11-Aug-2002  gehenna file slhci_intio.c was added on branch gehenna-devsw on 2002-08-31 14:52:54 +0000
 1.1.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 11-Aug-2002  nathanw file slhci_intio.c was added on branch nathanw_sa on 2002-08-13 02:19:09 +0000
 1.4.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.2.1 03-Sep-2007  yamt sync with head.
 1.7.50.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.7.46.1 15-Aug-2007  skrll Sync with HEAD.
 1.7.42.1 22-May-2007  itohy Overhaul of USB stack, mostly DMA related

This applies to NetBSD 4.99.13 (March 1, 2007)

usbdi(9) interface is based on FreeBSD version, excluding
- removal of portability code

Patch most NetBSD changes, excluding
- DMA memory "reserve", since we don't need contiguous buffers any longer
- volatiles in DMA structure, since it should not be needed
with proper bus_dmamap_sync(9)s

DMA/non-DMA memory management overhaul
- Move all DMA related code to usb_mem.[ch]
(add usb_alloc_buffer_dma(), usb_free_buffer_dma(), etc.).
XXX Should usb_mem.[ch] be renamed as usb_mem_dma.[ch] ?
- Add corresponding non-DMA code to usb_mem_nodma.[ch] .
Currently just use malloc(9).
- Above files are conditionally used by config framework (added
attributes to conf/files and dev/usb/files.usb).
- Add diagnostic panics when resource allocation is requested
on interrupt context.
- Change memory allocations (that require context) from NOWAIT to WAITOK.

Allocate DMA/non-DMA buffer per host interface, not globally.
advantage: Buffers can be freed on detaching host interface.
Activity of a host interface does not affect others.
disadvantages: It possibly consumes more memory.

API changes
- usbd_alloc_xfer() is changed:
old: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev);
new: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev,
usbd_pipe_handle pipe);
- pipe argument of usbd_setup_*xfer() are now unused
XXX the pipe argument should be removed?
- add mapping APIs
- async request will be processed as a task (kernel thread context),
and delayed to some extent
- usbdivar.h: struct usbd_xfer: renamed a member "allocbuf" to "hcbuffer"
(mapped/allocated/refered buffer for HCI driver)
- usb_port.h: change usb_proc_ptr from struct ptoc * to struct lwp *
- usb_port.h: add usb_sigproc_ptr for psignal(9) (struct proc *)
- usb.h: add UE_MAXPKTSZ(ep) and UE_MAXPKTSZ_MASK macros for USB 2.0

changes to USB device drivers
- atu, aue, axe, cdce, cue, kue, rum, udav, upl, ural, url,
uaudio, ubt, ucom, ugen, uhidev, uirda, ulpt, umidi, urio,
uscanner, ustir, utoppy:
* catch up API change of usbd_alloc_xfer()
- umass, usscanner:
* catch up API change of usbd_alloc_xfer()
* eliminate memory copy for large transfer

ohci
- free resources on detach
- add lots of bus_dmamap_sync() operations
- simplify the code of loading std chain
- rewrite code of looking up TD/ITD from DMA addr by using allocation chunk
- add workaround for CMD Tech 670 and 673 chipsets
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf

slhci
- allocate xfer and slhci_xfer at once, and simplify relevant code
- add slhci_detach()
- remove second arg of slhci_attach() since it is the same as the first arg.
- add support for "mapping" (no, it doesn't map since it doesn't do DMA)
buffer and mbuf
- add pcmcia frontend
- NOT TESTED, missing hardware

ehci
- add lots of bus_dmamap_sync() operations, possibly too many
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf
- done only simple test

uhci
- add lots of bus_dmamap_sync() operations, possibly too many
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf

To do
- review, test, debug
- rewrite network drivers to utilize usbd_map_buffer_mbuf()
- rewrite uaudio(4) to eliminate memcpy
- "pipe" argument of usbd_setup_*xfer() should eventually be removed
 1.7.38.1 03-Oct-2007  garbled Sync with HEAD
 1.7.30.1 20-Aug-2007  ad Sync with HEAD.
 1.8.2.1 06-Nov-2007  matt sync with HEAD
 1.9.20.3 11-Aug-2010  yamt sync with head.
 1.9.20.2 04-May-2009  yamt sync with head.
 1.9.20.1 16-May-2008  yamt sync with head.
 1.9.18.2 04-Jun-2008  yamt sync with head
 1.9.18.1 18-May-2008  yamt sync with head.
 1.9.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.9.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.11.6.1 19-Jan-2009  skrll Sync with HEAD.
 1.12.6.2 05-Mar-2011  rmind sync with head
 1.12.6.1 30-May-2010  rmind sync with head
 1.12.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.14.40.1 06-Sep-2016  skrll First pass at netbsd-7 updated with USB code from HEAD
 1.14.36.1 03-Dec-2014  skrll The grand renaming of structure members.

No functional change.
 1.14.34.1 05-Apr-2017  snj Pull up following revision(s) (requested by skrll in ticket #1395):
share/man/man4/axe.4: netbsd-7-nhusb
share/man/man4/axen.4: netbsd-7-nhusb
share/man/man4/cdce.4: netbsd-7-nhusb
share/man/man4/uaudio.4: netbsd-7-nhusb
share/man/man4/ucom.4: netbsd-7-nhusb
share/man/man4/uep.4: netbsd-7-nhusb
share/man/man4/urtw.4: netbsd-7-nhusb
share/man/man4/usb.4: netbsd-7-nhusb
share/man/man4/uyap.4: netbsd-7-nhusb
share/man/man4/xhci.4: netbsd-7-nhusb
share/man/man9/usbdi.9: netbsd-7-nhusb
sys/arch/amd64/conf/ALL: netbsd-7-nhusb
sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
sys/arch/i386/conf/ALL: netbsd-7-nhusb
sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
sys/conf/files: netbsd-7-nhusb
sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
sys/dev/ic/sl811hs.c: netbsd-7-nhusb
sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
sys/dev/usb/TODO: netbsd-7-nhusb
sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
sys/dev/usb/auvitek.c: netbsd-7-nhusb
sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
sys/dev/usb/ehci.c: netbsd-7-nhusb
sys/dev/usb/ehcireg.h: netbsd-7-nhusb
sys/dev/usb/ehcivar.h: netbsd-7-nhusb
sys/dev/usb/emdtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
sys/dev/usb/ezload.c: netbsd-7-nhusb
sys/dev/usb/ezload.h: netbsd-7-nhusb
sys/dev/usb/files.usb: netbsd-7-nhusb
sys/dev/usb/hid.c: netbsd-7-nhusb
sys/dev/usb/hid.h: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
sys/dev/usb/if_atu.c: netbsd-7-nhusb
sys/dev/usb/if_atureg.h: netbsd-7-nhusb
sys/dev/usb/if_aue.c: netbsd-7-nhusb
sys/dev/usb/if_auereg.h: netbsd-7-nhusb
sys/dev/usb/if_axe.c: netbsd-7-nhusb
sys/dev/usb/if_axen.c: netbsd-7-nhusb
sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
sys/dev/usb/if_axereg.h: netbsd-7-nhusb
sys/dev/usb/if_cdce.c: netbsd-7-nhusb
sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
sys/dev/usb/if_cue.c: netbsd-7-nhusb
sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
sys/dev/usb/if_kue.c: netbsd-7-nhusb
sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
sys/dev/usb/if_otus.c: netbsd-7-nhusb
sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
sys/dev/usb/if_rum.c: netbsd-7-nhusb
sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
sys/dev/usb/if_run.c: netbsd-7-nhusb
sys/dev/usb/if_runvar.h: netbsd-7-nhusb
sys/dev/usb/if_smsc.c: netbsd-7-nhusb
sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
sys/dev/usb/if_udav.c: netbsd-7-nhusb
sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
sys/dev/usb/if_upgt.c: netbsd-7-nhusb
sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
sys/dev/usb/if_upl.c: netbsd-7-nhusb
sys/dev/usb/if_ural.c: netbsd-7-nhusb
sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
sys/dev/usb/if_url.c: netbsd-7-nhusb
sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
sys/dev/usb/if_urndis.c: netbsd-7-nhusb
sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtw.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
sys/dev/usb/if_zyd.c: netbsd-7-nhusb
sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
sys/dev/usb/irmce.c: netbsd-7-nhusb
sys/dev/usb/moscom.c: netbsd-7-nhusb
sys/dev/usb/motg.c: netbsd-7-nhusb
sys/dev/usb/motgvar.h: netbsd-7-nhusb
sys/dev/usb/ohci.c: netbsd-7-nhusb
sys/dev/usb/ohcireg.h: netbsd-7-nhusb
sys/dev/usb/ohcivar.h: netbsd-7-nhusb
sys/dev/usb/pseye.c: netbsd-7-nhusb
sys/dev/usb/slurm.c: netbsd-7-nhusb
sys/dev/usb/stuirda.c: netbsd-7-nhusb
sys/dev/usb/u3g.c: netbsd-7-nhusb
sys/dev/usb/uark.c: netbsd-7-nhusb
sys/dev/usb/uatp.c: netbsd-7-nhusb
sys/dev/usb/uaudio.c: netbsd-7-nhusb
sys/dev/usb/uberry.c: netbsd-7-nhusb
sys/dev/usb/ubsa.c: netbsd-7-nhusb
sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
sys/dev/usb/ubsavar.h: netbsd-7-nhusb
sys/dev/usb/ubt.c: netbsd-7-nhusb
sys/dev/usb/uchcom.c: netbsd-7-nhusb
sys/dev/usb/ucom.c: netbsd-7-nhusb
sys/dev/usb/ucomvar.h: netbsd-7-nhusb
sys/dev/usb/ucycom.c: netbsd-7-nhusb
sys/dev/usb/udl.c: netbsd-7-nhusb
sys/dev/usb/udl.h: netbsd-7-nhusb
sys/dev/usb/udsbr.c: netbsd-7-nhusb
sys/dev/usb/udsir.c: netbsd-7-nhusb
sys/dev/usb/uep.c: netbsd-7-nhusb
sys/dev/usb/uftdi.c: netbsd-7-nhusb
sys/dev/usb/uftdireg.h: netbsd-7-nhusb
sys/dev/usb/ugen.c: netbsd-7-nhusb
sys/dev/usb/ugensa.c: netbsd-7-nhusb
sys/dev/usb/uhci.c: netbsd-7-nhusb
sys/dev/usb/uhcireg.h: netbsd-7-nhusb
sys/dev/usb/uhcivar.h: netbsd-7-nhusb
sys/dev/usb/uhid.c: netbsd-7-nhusb
sys/dev/usb/uhidev.c: netbsd-7-nhusb
sys/dev/usb/uhidev.h: netbsd-7-nhusb
sys/dev/usb/uhmodem.c: netbsd-7-nhusb
sys/dev/usb/uhso.c: netbsd-7-nhusb
sys/dev/usb/uhub.c: netbsd-7-nhusb
sys/dev/usb/uipad.c: netbsd-7-nhusb
sys/dev/usb/uipaq.c: netbsd-7-nhusb
sys/dev/usb/uirda.c: netbsd-7-nhusb
sys/dev/usb/uirdavar.h: netbsd-7-nhusb
sys/dev/usb/ukbd.c: netbsd-7-nhusb
sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.h: netbsd-7-nhusb
sys/dev/usb/ulpt.c: netbsd-7-nhusb
sys/dev/usb/umass.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
sys/dev/usb/umassvar.h: netbsd-7-nhusb
sys/dev/usb/umcs.c: netbsd-7-nhusb
sys/dev/usb/umct.c: netbsd-7-nhusb
sys/dev/usb/umidi.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
sys/dev/usb/umodem.c: netbsd-7-nhusb
sys/dev/usb/umodem_common.c: netbsd-7-nhusb
sys/dev/usb/umodemvar.h: netbsd-7-nhusb
sys/dev/usb/ums.c: netbsd-7-nhusb
sys/dev/usb/uplcom.c: netbsd-7-nhusb
sys/dev/usb/urio.c: netbsd-7-nhusb
sys/dev/usb/urio.h: netbsd-7-nhusb
sys/dev/usb/usb.c: netbsd-7-nhusb
sys/dev/usb/usb.h: netbsd-7-nhusb
sys/dev/usb/usb_mem.c: netbsd-7-nhusb
sys/dev/usb/usb_mem.h: netbsd-7-nhusb
sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
sys/dev/usb/usb_subr.c: netbsd-7-nhusb
sys/dev/usb/usbdevices.config: netbsd-7-nhusb
sys/dev/usb/usbdevs: netbsd-7-nhusb
sys/dev/usb/usbdevs.h: netbsd-7-nhusb
sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
sys/dev/usb/usbdi.c: netbsd-7-nhusb
sys/dev/usb/usbdi.h: netbsd-7-nhusb
sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
sys/dev/usb/usbdivar.h: netbsd-7-nhusb
sys/dev/usb/usbhid.h: netbsd-7-nhusb
sys/dev/usb/usbhist.h: netbsd-7-nhusb
sys/dev/usb/usbroothub.c: netbsd-7-nhusb
sys/dev/usb/usbroothub.h: netbsd-7-nhusb
sys/dev/usb/usbroothub_subr.c: delete
sys/dev/usb/usbroothub_subr.h: delete
sys/dev/usb/uscanner.c: netbsd-7-nhusb
sys/dev/usb/uslsa.c: netbsd-7-nhusb
sys/dev/usb/usscanner.c: netbsd-7-nhusb
sys/dev/usb/ustir.c: netbsd-7-nhusb
sys/dev/usb/uthum.c: netbsd-7-nhusb
sys/dev/usb/utoppy.c: netbsd-7-nhusb
sys/dev/usb/uts.c: netbsd-7-nhusb
sys/dev/usb/uvideo.c: netbsd-7-nhusb
sys/dev/usb/uvisor.c: netbsd-7-nhusb
sys/dev/usb/uvscom.c: netbsd-7-nhusb
sys/dev/usb/uyap.c: netbsd-7-nhusb
sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
sys/dev/usb/uyurex.c: netbsd-7-nhusb
sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
sys/dev/usb/xhci.c: netbsd-7-nhusb
sys/dev/usb/xhcireg.h: netbsd-7-nhusb
sys/dev/usb/xhcivar.h: netbsd-7-nhusb
sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/include/linux/err.h: delete
sys/external/bsd/drm2/include/linux/workqueue.h: delete
sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
sys/external/bsd/drm2/linux/linux_work.c: delete
sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
sys/sys/mbuf.h: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler
at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
the network stack.
- kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
softnet_lock held across usb xfr
- kern/50491 - unkillable wait in usbd_transfer while using usmsc0
on raspberry pi 2
- kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)
 1.14.18.1 03-Dec-2017  jdolecek update from HEAD
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 11-Aug-2002  isaki branches: 1.1.2; 1.1.4; 1.1.6; 1.1.114; 1.1.116; 1.1.118;
Add driver for ScanLogic SL811HS/T USB Host Controller.
XXX It's experimental code yet.

For x68k: USB part of Nereid USB/Ethernet/memory board
For ISA: ISA USB Host board from Morphy planning
 1.1.118.1 16-May-2008  yamt sync with head.
 1.1.116.1 18-May-2008  yamt sync with head.
 1.1.114.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 11-Aug-2002  jdolecek file slhci_intio_var.h was added on branch kqueue on 2002-09-06 08:42:42 +0000
 1.1.4.2 31-Aug-2002  gehenna catch up with -current.
 1.1.4.1 11-Aug-2002  gehenna file slhci_intio_var.h was added on branch gehenna-devsw on 2002-08-31 14:52:54 +0000
 1.1.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 11-Aug-2002  nathanw file slhci_intio_var.h was added on branch nathanw_sa on 2002-08-13 02:19:10 +0000
 1.35 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.34 28-Apr-2008  martin branches: 1.34.8;
Remove clause 3 and 4 from TNF licenses
 1.33 31-Mar-2008  tsutsui branches: 1.33.2; 1.33.4;
Split softc/device_t for spc(4) and misc related cleanup.
 1.32 11-Mar-2007  isaki branches: 1.32.38;
white space, indent and KNF.
 1.31 11-Mar-2007  isaki Remove an extra white space.
 1.30 23-Feb-2006  thorpej branches: 1.30.20; 1.30.24;
Use device_parent().
 1.29 11-Dec-2005  christos branches: 1.29.2; 1.29.4; 1.29.6;
merge ktrace-lwp.
 1.28 13-Jun-2005  he branches: 1.28.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.27 18-Jan-2005  chs de-__P, remove register, ansify.
 1.26 15-Jul-2003  lukem branches: 1.26.8;
rcsid
 1.25 05-Jul-2003  tsutsui Rename some MI mb89352 functions for consistency:
spcintr() -> spc_intr()
spcattach() -> spc_attach()
 1.24 02-Oct-2002  thorpej branches: 1.24.6;
Add trailing ; to CFATTACH_DECL.
 1.23 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.21 24-Mar-1999  minoura branches: 1.21.22; 1.21.26;
Shut up gcc -Wall.
 1.20 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.19 05-Dec-1998  mjacob branches: 1.19.4;
Update HBAs to incorporate the new max_lun property.
 1.18 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.17 10-Oct-1998  thorpej Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
 1.16 04-Aug-1998  minoura __BROKEN_INDIRECT_CONFIG fixes.
 1.15 04-Jul-1998  jonathan defopt DDB.
 1.14 30-Jun-1998  msaitoh sync with -current after a long silence
 1.13 12-Jan-1998  thorpej Update for changes to config.
 1.12 19-Oct-1997  oki branches: 1.12.2;
Test device is configured in interrput handler.
 1.11 09-Oct-1997  oki Added missing prototype.
 1.10 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.9 10-Dec-1996  thorpej branches: 1.9.8; 1.9.10;
Fill in sc_link.max_target
 1.8 13-Oct-1996  christos backout previous kprintf change
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.6 08-Sep-1996  oki delete unused prototype.
 1.5 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.4 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.3 12-Jun-1996  oki fixed sometimes hang up bug at boot time.
 1.2 21-May-1996  oki branches: 1.2.2;
Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.1 12-Jun-1996  oki from trunk: fixed sometimes hang up bug at boot time.
 1.9.10.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.12.2.1 13-Oct-1998  cgd pull up rev 1.14 from trunk (via patch). (minoura)
 1.19.4.4 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.19.4.3 12-Mar-1999  minoura Call spc_find from attach routine.
 1.19.4.2 13-Feb-1999  minoura Use MI version of SPC driver.
 1.19.4.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.21.26.1 18-Oct-2002  nathanw Catch up to -current.
 1.21.22.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.24.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.24.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.6.1 03-Aug-2004  skrll Sync with HEAD
 1.26.8.1 29-Apr-2005  kent sync with -current
 1.28.2.2 03-Sep-2007  yamt sync with head.
 1.28.2.1 21-Jun-2006  yamt sync with head.
 1.29.6.1 22-Apr-2006  simonb Sync with head.
 1.29.4.1 09-Sep-2006  rpaulo sync with head
 1.29.2.1 01-Mar-2006  yamt sync with head.
 1.30.24.1 13-Mar-2007  ad Sync with head.
 1.30.20.1 12-Mar-2007  rmind Sync with HEAD.
 1.32.38.3 17-Jan-2009  mjf Sync with HEAD.
 1.32.38.2 02-Jun-2008  mjf Sync with HEAD.
 1.32.38.1 03-Apr-2008  mjf Sync with HEAD.
 1.33.4.2 04-May-2009  yamt sync with head.
 1.33.4.1 16-May-2008  yamt sync with head.
 1.33.2.1 18-May-2008  yamt sync with head.
 1.34.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.23 27-Jan-2025  andvar s/probeing/probing/ in comments.
 1.22 07-Jan-2024  isaki branches: 1.22.2;
TAB/space/indent cleanup.
 1.21 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.20 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.19 16-Mar-2014  dholland branches: 1.19.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.18 21-Dec-2008  isaki branches: 1.18.14; 1.18.24; 1.18.28;
Make sram(4) a hardware device.
# I wrote this in 2001 :-)
 1.17 14-Dec-2008  isaki Use intio_set_*() macros to purge macros by the name of sysport, ioctlr.
 1.16 11-Mar-2007  isaki branches: 1.16.38; 1.16.42; 1.16.50;
white space, indent and KNF.
 1.15 11-Mar-2007  isaki Remove an extra white space.
 1.14 04-Mar-2007  christos branches: 1.14.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 29-Oct-2006  he branches: 1.13.4;
Work around the propagation of volatile-ness from struct to struct members.

OK'ed by nsmrtks.
 1.12 11-Dec-2005  christos branches: 1.12.20; 1.12.22;
merge ktrace-lwp.
 1.11 18-Jan-2005  chs branches: 1.11.8;
de-__P, remove register, ansify.
 1.10 15-Jul-2003  lukem branches: 1.10.8;
rcsid
 1.9 23-Oct-2002  jdolecek branches: 1.9.6;
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.8 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.7 27-Dec-2001  wiz branches: 1.7.8;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.6 15-Jun-1999  minoura branches: 1.6.14; 1.6.16; 1.6.20;
Check file open mode at ioctl.
Add debug option SRAM_DEBUG_DONTDOIT.
 1.5 10-Oct-1997  oki branches: 1.5.12; 1.5.14; 1.5.16;
Add prototypes.
 1.4 13-Oct-1996  christos branches: 1.4.10;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 12-May-1996  oki fixed for gcc -Wall warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.16.1 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.5.14.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.12.1 24-Jun-1999  perry pullup 1.5->1.6 (minoura)
 1.6.20.3 11-Nov-2002  nathanw Catch up to -current
 1.6.20.2 17-Sep-2002  nathanw Catch up to -current.
 1.6.20.1 08-Jan-2002  nathanw Catch up to -current.
 1.6.16.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.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.14.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.7.8.2 08-Jun-2002  gehenna fix compiler warning.
 1.7.8.1 17-May-2002  gehenna Add device switch.
 1.9.6.5 04-Feb-2005  skrll Adapt to branch.
 1.9.6.4 24-Jan-2005  skrll Sync with HEAD.
 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-Aug-2004  skrll Sync with HEAD
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.11.8.3 03-Sep-2007  yamt sync with head.
 1.11.8.2 30-Dec-2006  yamt sync with head.
 1.11.8.1 21-Jun-2006  yamt sync with head.
 1.12.22.1 10-Dec-2006  yamt sync with head.
 1.12.20.1 18-Nov-2006  ad Sync with head.
 1.13.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.2.1 13-Mar-2007  ad Sync with head.
 1.16.50.1 19-Jan-2009  skrll Sync with HEAD.
 1.16.42.1 04-May-2009  yamt sync with head.
 1.16.38.1 17-Jan-2009  mjf Sync with HEAD.
 1.18.28.1 18-May-2014  rmind sync with head
 1.18.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.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.19.2.1 10-Aug-2014  tls Rebase.
 1.22.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 21-Dec-2008  isaki Make sram(4) a hardware device.
# I wrote this in 2001 :-)
 1.2 23-Jun-1999  minoura branches: 1.2.138; 1.2.142; 1.2.150;
I forgot to commit this.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.26; 1.1.1.1.28; 1.1.1.1.30;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.30.1 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.1.1.1.28.1 01-Jul-1999  thorpej Sync w/ -current.
 1.1.1.1.26.1 24-Jun-1999  perry pullup 1.1->1.2 (minoura)
 1.2.150.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.142.1 04-May-2009  yamt sync with head.
 1.2.138.1 17-Jan-2009  mjf Sync with HEAD.
 1.56 26-May-2022  tsutsui Explicitly include "ioconf.h" for struct cfdriver.
 1.55 21-Aug-2021  andvar s/recoding/recording/ in comments where it didn't actually mean recoding.
 1.54 06-Feb-2021  isaki Remove an unused variable.
 1.53 06-Feb-2021  isaki Remove sc_active flag. sc_[pr]intr can be used instead of it.
 1.52 08-Jun-2019  isaki branches: 1.52.10;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.
 1.51 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.50 16-Mar-2019  isaki branches: 1.50.2;
Use C99 style struct initializer to audio_hw_if.
 1.49 30-Sep-2017  isaki branches: 1.49.4;
Avoid magic numbers and give appropriate names.
 1.48 02-Sep-2017  isaki - Finally MI audio supports 4bit precision format without null_filter hack!
- Fix reusing play/rec argument as local variables. It is in/out parameter.
 1.47 02-Sep-2017  isaki - Revert temporary local conversion introduced at rev 1.43.
- But does not revert to trigger method. trigger method is not suitable for
x68k ADPCM+DMA mechanism.
- Don't (re)start ADPCM when DMA is running. This solves the noise.
From Y.Sugahara.
- Cache dmac xfer.
 1.46 11-Aug-2017  isaki Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
 1.45 11-Aug-2017  isaki Use dmac_prepare_xfer().
From Y.Sugahara.
 1.44 05-Aug-2017  isaki Merge prate and rrate. These can not be separated.
 1.43 05-Aug-2017  isaki vs(4) became to able to play audio again.
At the moment the encoding conversion using set_params() does
not seem to work for me. So vs(4) uses local conversion to/from
ADPCM instead of it. But this should be a temporary work.
XXX The playback quality is very poor compared to before...
XXX Recording is not tested.
 1.42 05-Aug-2017  isaki Remove temporary VS_USE_PREC8 option.
vs(4) now supports slinear16be and slinear8 (but now work yet).
 1.41 31-Jul-2017  isaki Update confused vs_set_params().
play and rec are identical but pfil and rfil are independent.
XXX I introduce VS_USE_PREC8 option for debugging purposes
temporarily. I'll remove it if the problem is solved.
 1.40 29-Jul-2017  nat Audio vchan auto config works again due to the use of a null_filter.

Tested and confirmed working by isaki@.
 1.39 09-Jul-2017  isaki Catch up vs_set_params() to recent MI audio (after in-kernel mixer).
Before that, MD part had to support all encodings I'd like to support,
but currently it's no longer necessary. The hardware is
4bit/1ch/15.6kHz ADPCM but it behaves as 16bit/1ch/16.0kHz PCM.

For audio.c < 1.362, the device attach succeeded and playback is
still working.
For audio.c >= 1.363, the device attach fails again.
It does not work yet but I commit it for milestone.
 1.38 25-Jun-2017  isaki Avoid panic when the device is closed when not playing.
 1.37 01-Jun-2017  chs branches: 1.37.2;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.36 26-Mar-2014  christos branches: 1.36.6;
kill sprintf, fix unused.
 1.35 23-Nov-2011  jmcneill branches: 1.35.8; 1.35.12;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.34 16-Oct-2011  isaki branches: 1.34.2; 1.34.4;
Switch to 2-clause license.
 1.33 25-Jun-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
 1.32 11-Mar-2007  isaki branches: 1.32.38; 1.32.42; 1.32.44; 1.32.46;
white space, indent and KNF.
 1.31 04-Mar-2007  christos branches: 1.31.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30 11-Dec-2005  christos branches: 1.30.26;
merge ktrace-lwp.
 1.29 13-Jun-2005  he branches: 1.29.2;
Make this build with -Wcast-qual by adding a few consts.
 1.28 15-Jan-2005  kent ansify and KNF
 1.27 10-Jan-2005  kent merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes
 1.26 13-Dec-2004  chs for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.25 29-Oct-2004  yamt branches: 1.25.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.24 08-May-2004  minoura An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.23 07-Sep-2003  isaki Remove an advertising clause.
 1.22 15-Jul-2003  lukem rcsid
 1.21 01-Feb-2003  thorpej branches: 1.21.2;
Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
 1.20 24-Nov-2002  isaki Fix typo. s/cfdata/cfdriver/
 1.19 13-Oct-2002  isaki Style fixes.
 1.18 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.17 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15 07-Apr-2002  isaki Support slinear8, slinear16_le, slinear16_be.
 1.14 02-Apr-2002  isaki initialize codec variables every open().
 1.13 26-Mar-2002  isaki set factor=1/2 even if recording.
 1.12 16-Mar-2002  isaki Fix mis-increment bug in converter msm6258_ulinear8_to_adpcm().
This fix needs factor_denom.
 1.11 25-Nov-2001  minoura Remove unused variables.
Correct printf format strings.
 1.10 13-Nov-2001  isaki Rewrite vs_query_encoding() using array.
 1.9 13-Nov-2001  isaki Clean up debug messages. Separate it two debug levels.
 1.8 03-Oct-2001  augustss branches: 1.8.4;
Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
 1.7 28-May-2001  minoura branches: 1.7.2; 1.7.4; 1.7.6;
Cleanup. Addresses port-x68k/13051.
 1.6 27-May-2001  minoura Add missing line in recording. Copy & paste error...
 1.5 22-May-2001  minoura Correct ring buffer handling in recording. From Isaki-san.
 1.4 15-May-2001  minoura Missings from the previous commit.
From Izaki-san.
 1.3 07-May-2001  minoura Encoding ulinear and mulaw are both software emulated.
From Isaki-san.
 1.2 03-May-2001  minoura Correct playing mu-law and linear.
 1.1 02-May-2001  minoura X68k built-in voice synthesizer.
 1.7.6.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.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.7.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.4.6 11-Dec-2002  thorpej Sync with HEAD.
 1.8.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.8.4.4 17-Apr-2002  nathanw Catch up to -current.
 1.8.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.4.1 03-Oct-2001  nathanw file vs.c was added on branch nathanw_sa on 2002-01-08 00:28:42 +0000
 1.21.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.2.6 17-Jan-2005  skrll Sync with HEAD.
 1.21.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.21.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.2.1 03-Jan-2005  kent adopt the filter pipeline framework
 1.29.2.1 03-Sep-2007  yamt sync with head.
 1.30.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.31.2.1 13-Mar-2007  ad Sync with head.
 1.32.46.1 27-Jun-2008  simonb Sync with head.
 1.32.44.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.32.42.1 04-May-2009  yamt sync with head.
 1.32.38.1 29-Jun-2008  mjf Sync with HEAD.
 1.34.4.2 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.34.4.1 20-Nov-2011  jmcneill adapt to audiomp api changes
 1.34.2.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.34.2.1 17-Apr-2012  yamt sync with head
 1.35.12.1 18-May-2014  rmind sync with head
 1.35.8.2 03-Dec-2017  jdolecek update from HEAD
 1.35.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.36.6.1 28-Aug-2017  skrll Sync with HEAD
 1.37.2.2 23-Sep-2017  snj Pull up following revision(s) (requested by isaki in ticket #172):
sys/arch/x68k/dev/vs.c: 1.38-1.39, 1.41-1.44, 1.47-1.48 via patch
sys/arch/x68k/dev/vsvar.h: 1.12-1.15 via patch
Avoid panic when the device is closed when not playing.
Catch up vs_set_params() to recent MI audio (after in-kernel mixer).
Before that, MD part had to support all encodings I'd like to support,
but currently it's no longer necessary. The hardware is
4bit/1ch/15.6kHz ADPCM but it behaves as 16bit/1ch/16.0kHz PCM.
For audio.c < 1.362, the device attach succeeded and playback is
still working.
For audio.c >= 1.363, the device attach fails again.
It does not work yet but I commit it for milestone.
Update confused vs_set_params().
play and rec are identical but pfil and rfil are independent.
XXX I introduce VS_USE_PREC8 option for debugging purposes
temporarily. I'll remove it if the problem is solved.
Remove temporary VS_USE_PREC8 option.
vs(4) now supports slinear16be and slinear8 (but now work yet).
vs(4) became to able to play audio again.
At the moment the encoding conversion using set_params() does
not seem to work for me. So vs(4) uses local conversion to/from
ADPCM instead of it. But this should be a temporary work.
XXX The playback quality is very poor compared to before...
XXX Recording is not tested.
Merge prate and rrate. These can not be separated.
- Revert temporary local conversion introduced at rev 1.43.
- But does not revert to trigger method. trigger method is not suitable for
x68k ADPCM+DMA mechanism.
- Don't (re)start ADPCM when DMA is running. This solves the noise.
From Y.Sugahara.
- Cache dmac xfer.
- Finally MI audio supports 4bit precision format without null_filter hack!
- Fix reusing play/rec argument as local variables. It is in/out parameter.
 1.37.2.1 23-Sep-2017  snj Pull up following revision(s) (requested by isaki in ticket #290):
sys/arch/x68k/dev/dmacvar.h: revision 1.11-1.12 via patch
sys/arch/x68k/dev/intio_dmac.c: revision 1.36-1.37 via patch
sys/arch/x68k/dev/fd.c: revision 1.120 via patch
sys/arch/x68k/dev/vs.c: revision 1.45-1.46 via patch
Use dmac_prepare_xfer().
From Y.Sugahara.
--
Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
From Y.Suhagara and it was found by XM6i.
--
Fix a Continue Operation.
Patch from Y.Sugahara.
 1.49.4.1 10-Jun-2019  christos Sync with HEAD
 1.50.2.2 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.50.2.1 21-Apr-2019  isaki Adapt to audio2.
 1.52.10.1 03-Apr-2021  thorpej Sync with HEAD.
 1.20 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.19 06-Feb-2021  isaki Remove an unused variable.
 1.18 06-Feb-2021  isaki Remove sc_active flag. sc_[pr]intr can be used instead of it.
 1.17 08-May-2019  isaki branches: 1.17.10;
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.16 30-Sep-2017  isaki branches: 1.16.4; 1.16.6;
Avoid magic numbers and give appropriate names.
 1.15 02-Sep-2017  isaki - Revert temporary local conversion introduced at rev 1.43.
- But does not revert to trigger method. trigger method is not suitable for
x68k ADPCM+DMA mechanism.
- Don't (re)start ADPCM when DMA is running. This solves the noise.
From Y.Sugahara.
- Cache dmac xfer.
 1.14 05-Aug-2017  isaki Merge prate and rrate. These can not be separated.
 1.13 05-Aug-2017  isaki vs(4) became to able to play audio again.
At the moment the encoding conversion using set_params() does
not seem to work for me. So vs(4) uses local conversion to/from
ADPCM instead of it. But this should be a temporary work.
XXX The playback quality is very poor compared to before...
XXX Recording is not tested.
 1.12 25-Jun-2017  isaki Avoid panic when the device is closed when not playing.
 1.11 23-Nov-2011  jmcneill branches: 1.11.8; 1.11.26; 1.11.42;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.10 16-Oct-2011  isaki branches: 1.10.2; 1.10.4;
Switch to 2-clause license.
 1.9 25-Jun-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
 1.8 04-Mar-2007  christos branches: 1.8.40; 1.8.44; 1.8.46; 1.8.48;
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; 1.7.28;
merge ktrace-lwp.
 1.6 15-Jan-2005  kent branches: 1.6.10;
ansify and KNF
 1.5 10-Jan-2005  kent merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes
 1.4 31-Oct-2004  he branches: 1.4.2;
Follow up on the constification of audio_hw_if, to fix build
problem for vs.c.
 1.3 07-Sep-2003  isaki Remove an advertising clause.
 1.2 03-May-2001  minoura branches: 1.2.2; 1.2.10; 1.2.26;
Correct playing mu-law and linear.
 1.1 02-May-2001  minoura X68k built-in voice synthesizer.
 1.2.26.5 17-Jan-2005  skrll Sync with HEAD.
 1.2.26.4 02-Nov-2004  skrll Sync with HEAD.
 1.2.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.26.1 03-Aug-2004  skrll Sync with HEAD
 1.2.10.2 03-May-2001  minoura Correct playing mu-law and linear.
 1.2.10.1 03-May-2001  minoura file vsvar.h was added on branch nathanw_sa on 2001-05-03 02:09:13 +0000
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.1 03-Jan-2005  kent adopt the filter pipeline framework
 1.6.10.1 03-Sep-2007  yamt sync with head.
 1.7.28.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.48.1 27-Jun-2008  simonb Sync with head.
 1.8.46.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.8.44.1 04-May-2009  yamt sync with head.
 1.8.40.1 29-Jun-2008  mjf Sync with HEAD.
 1.10.4.1 20-Nov-2011  jmcneill adapt to audiomp api changes
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.11.42.1 23-Sep-2017  snj Pull up following revision(s) (requested by isaki in ticket #172):
sys/arch/x68k/dev/vs.c: 1.38-1.39, 1.41-1.44, 1.47-1.48 via patch
sys/arch/x68k/dev/vsvar.h: 1.12-1.15 via patch
Avoid panic when the device is closed when not playing.
Catch up vs_set_params() to recent MI audio (after in-kernel mixer).
Before that, MD part had to support all encodings I'd like to support,
but currently it's no longer necessary. The hardware is
4bit/1ch/15.6kHz ADPCM but it behaves as 16bit/1ch/16.0kHz PCM.
For audio.c < 1.362, the device attach succeeded and playback is
still working.
For audio.c >= 1.363, the device attach fails again.
It does not work yet but I commit it for milestone.
Update confused vs_set_params().
play and rec are identical but pfil and rfil are independent.
XXX I introduce VS_USE_PREC8 option for debugging purposes
temporarily. I'll remove it if the problem is solved.
Remove temporary VS_USE_PREC8 option.
vs(4) now supports slinear16be and slinear8 (but now work yet).
vs(4) became to able to play audio again.
At the moment the encoding conversion using set_params() does
not seem to work for me. So vs(4) uses local conversion to/from
ADPCM instead of it. But this should be a temporary work.
XXX The playback quality is very poor compared to before...
XXX Recording is not tested.
Merge prate and rrate. These can not be separated.
- Revert temporary local conversion introduced at rev 1.43.
- But does not revert to trigger method. trigger method is not suitable for
x68k ADPCM+DMA mechanism.
- Don't (re)start ADPCM when DMA is running. This solves the noise.
From Y.Sugahara.
- Cache dmac xfer.
- Finally MI audio supports 4bit precision format without null_filter hack!
- Fix reusing play/rec argument as local variables. It is in/out parameter.
 1.11.26.1 28-Aug-2017  skrll Sync with HEAD
 1.11.8.1 03-Dec-2017  jdolecek update from HEAD
 1.16.6.1 21-Apr-2019  isaki Adapt to audio2.
 1.16.4.1 10-Jun-2019  christos Sync with HEAD
 1.17.10.1 03-Apr-2021  thorpej Sync with HEAD.
 1.18 26-Mar-2014  christos kill sprintf, fix unused.
 1.17 31-Dec-2008  isaki branches: 1.17.14; 1.17.24; 1.17.28;
struct device * -> device_t.
 1.16 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.15 29-Nov-2008  isaki Split device_t/softc. Use aprint*() and device_xname().
Not tested. I cannot test now...
 1.14 28-Apr-2008  martin branches: 1.14.6; 1.14.8;
Remove clause 3 and 4 from TNF licenses
 1.13 11-Mar-2007  isaki branches: 1.13.38; 1.13.40; 1.13.42;
white space, indent and KNF.
 1.12 11-Mar-2007  isaki Remove an extra white space.
 1.11 29-Mar-2006  thorpej branches: 1.11.14; 1.11.18;
Use device_cfdata().
 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 13-Jun-2005  he branches: 1.9.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.8 18-Jan-2005  chs de-__P, remove register, ansify.
 1.7 15-Jul-2003  lukem branches: 1.7.8;
rcsid
 1.6 02-Oct-2002  thorpej branches: 1.6.6;
Add trailing ; to CFATTACH_DECL.
 1.5 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 24-Mar-1999  minoura branches: 1.3.22; 1.3.26;
Shut up gcc -Wall.
 1.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 27-Dec-1998  minoura branches: 1.1.2;
file xel.c was initially added on branch minoura_x68k_bus_h.
 1.1.2.2 31-Jan-1999  minoura Improve xel probe.
 1.1.2.1 27-Dec-1998  minoura Xellent30 driver.
 1.3.26.1 18-Oct-2002  nathanw Catch up to -current.
 1.3.22.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.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.9.2.2 03-Sep-2007  yamt sync with head.
 1.9.2.1 21-Jun-2006  yamt sync with head.
 1.10.12.1 31-Mar-2006  tron Merge 2006-03-31 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.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.11.18.1 13-Mar-2007  ad Sync with head.
 1.11.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.13.42.2 04-May-2009  yamt sync with head.
 1.13.42.1 16-May-2008  yamt sync with head.
 1.13.40.1 18-May-2008  yamt sync with head.
 1.13.38.2 17-Jan-2009  mjf Sync with HEAD.
 1.13.38.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.17.28.1 18-May-2014  rmind sync with head
 1.17.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.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.48 26-May-2022  tsutsui Make a readonly array const.
 1.47 11-Sep-2021  andvar Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
 1.46 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.45 24-Apr-2021  thorpej branches: 1.45.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.44 05-Aug-2016  isaki branches: 1.44.30;
Revert a part of previous commit.
If addr is not specified as "zsc0 at intio0" in kernel config
(though it's not right of course), it will cause a panic.
intio_map_allocate_region() should be called after address check.
 1.43 31-May-2016  dholland branches: 1.43.2;
PR 50759 David Binderman: fix out of bounds array access.

If we don't find one of the expected device addresses, reject the
match, but do it by checking whether the loop matched something rather
than by testing an array entry that might be one past the end.

Note: I have also moved the test to be with the loop; since the call
to intio_map_allocate_region had gotten placed in between them, I've
moved it to go before rather than after them as (a) it doesn't
interact with the loop itself and (b) this seems like the best choice
given the history as it was deliberately added before the original
test.

I have not tried running this, not having an x68k, but as best I can
tell by reading the intio code it seems like it should be harmless
even if it's not really correct.
 1.42 26-Mar-2014  christos branches: 1.42.6;
fix unused, missing splx.
 1.41 01-May-2011  tsutsui branches: 1.41.4; 1.41.14; 1.41.18;
Reset ZS chip properly in zscninit() so that zscngetc() works
even before zsc is attached during configure.
(i.e. make userconf(4) work on serial console)
 1.40 31-Dec-2008  isaki branches: 1.40.6; 1.40.8;
struct device * -> device_t.
 1.39 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.38 28-Apr-2008  martin branches: 1.38.8;
Remove clause 3 and 4 from TNF licenses
 1.37 27-Apr-2008  isaki branches: 1.37.2;
Make it compile without zstty.
 1.36 29-Mar-2008  tsutsui branches: 1.36.2;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.35 03-Dec-2007  ad branches: 1.35.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.34 09-Nov-2007  ad Call zs_lock_init() to set up the chanstate's lock.
 1.33 17-Oct-2007  garbled branches: 1.33.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.32 12-May-2007  isaki branches: 1.32.8; 1.32.10; 1.32.14;
Clean up white spaces and tabs.
 1.31 11-Mar-2007  isaki branches: 1.31.2; 1.31.8;
white space, indent and KNF.
 1.30 04-Mar-2007  tsutsui branches: 1.30.2;
Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.29 28-Mar-2006  thorpej branches: 1.29.14;
Use device_unit().
 1.28 11-Dec-2005  christos branches: 1.28.4; 1.28.6; 1.28.8; 1.28.10; 1.28.12;
merge ktrace-lwp.
 1.27 13-Jun-2005  he branches: 1.27.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.26 18-Jan-2005  chs de-__P, remove register, ansify.
 1.25 15-Jul-2003  lukem branches: 1.25.8;
rcsid
 1.24 28-Jan-2003  pk branches: 1.24.2;
Provide locking required by the interrupt handlers running at IPL_SERIAL.
 1.23 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.22 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.21 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.20 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.19 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.18 27-Dec-2001  wiz branches: 1.18.8;
bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.17 27-Mar-1999  wrstuden branches: 1.17.20; 1.17.22; 1.17.26;
Add pps support. Only enable pps if CLOCAL & !MDMBUF.
 1.16 24-Mar-1999  minoura Shut up gcc -Wall.
 1.15 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.14 11-Feb-1999  mycroft Minor cleanup.
Make the initializer for BAUDLO depend on PCLK directly; it was incorrect on
some ports where PCLK is not 4.9152MHz.
XXX Is the default value actually used?
 1.13 03-Feb-1999  mycroft Don't set DCD_IE in the frontends. KGDB doesn't even use DCD, and the tty
frontends get it from zsparam() anyway.
 1.12 05-Aug-1998  minoura branches: 1.12.6;
Switched to MI zs driver.
 1.11 04-Aug-1998  minoura __BROKEN_INDIRECT_CONFIG fixes.
 1.10 04-Jul-1998  jonathan defopt DDB.
 1.9 30-Jun-1998  msaitoh sync with -current after a long silence
 1.8 12-Jan-1998  thorpej Update for changes to config.
 1.7 12-Oct-1997  oki branches: 1.7.2;
Added prototypes.
 1.6 13-Oct-1996  christos branches: 1.6.10;
backout previous kprintf change
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.3 05-Jun-1996  oki add tty_attach(tp);
 1.2 12-May-1996  oki branches: 1.2.4;
x68k mouse has no hardware flow control.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.4.1 05-Jun-1996  oki pull up tty_attach() changes from trunk
 1.6.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.2.1 05-Feb-1999  cgd pull up patch to make mouse optional. Previously it was mandatory
because some mouse-related functions were referenced from other files.
Never committed to trunk because -current uses MI zs driver. (minoura)
 1.12.6.4 14-Mar-1999  minoura Sync.
 1.12.6.3 27-Dec-1998  minoura Better address map handling.
 1.12.6.2 27-Dec-1998  minoura Match device names.
 1.12.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.17.26.4 03-Jan-2003  thorpej Sync with HEAD.
 1.17.26.3 18-Oct-2002  nathanw Catch up to -current.
 1.17.26.2 17-Sep-2002  nathanw Catch up to -current.
 1.17.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.17.22.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.17.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.17.20.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.18.8.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.24.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.24.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.8.1 29-Apr-2005  kent sync with -current
 1.27.2.4 07-Dec-2007  yamt sync with head
 1.27.2.3 15-Nov-2007  yamt sync with head.
 1.27.2.2 03-Sep-2007  yamt sync with head.
 1.27.2.1 21-Jun-2006  yamt sync with head.
 1.28.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.28.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.28.8.1 01-Apr-2006  yamt sync with head.
 1.28.6.1 22-Apr-2006  simonb Sync with head.
 1.28.4.1 09-Sep-2006  rpaulo sync with head
 1.29.14.2 17-May-2007  yamt sync with head.
 1.29.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.2.3 03-Dec-2007  ad Sync with HEAD.
 1.30.2.2 27-May-2007  ad Sync with head.
 1.30.2.1 13-Mar-2007  ad Sync with head.
 1.31.8.1 22-May-2007  matt Update to HEAD.
 1.31.2.1 11-Jul-2007  mjf Sync with head.
 1.32.14.1 13-Nov-2007  bouyer Sync with HEAD
 1.32.10.2 09-Jan-2008  matt sync with HEAD
 1.32.10.1 06-Nov-2007  matt sync with HEAD
 1.32.8.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.32.8.1 11-Nov-2007  joerg Sync with HEAD.
 1.33.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.33.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.35.14.3 17-Jan-2009  mjf Sync with HEAD.
 1.35.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.35.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.36.2.1 18-May-2008  yamt sync with head.
 1.37.2.2 04-May-2009  yamt sync with head.
 1.37.2.1 16-May-2008  yamt sync with head.
 1.38.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.40.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.40.6.1 31-May-2011  rmind sync with head
 1.41.18.1 18-May-2014  rmind sync with head
 1.41.14.2 03-Dec-2017  jdolecek update from HEAD
 1.41.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.41.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.42.6.2 05-Oct-2016  skrll Sync with HEAD
 1.42.6.1 09-Jul-2016  skrll Sync with HEAD
 1.43.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.44.30.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.45.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.3 05-Aug-1998  minoura Switched to MI zs driver.
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.39 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.38 12-Jul-2018  maxv branches: 1.38.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.37 24-Dec-2015  christos branches: 1.37.16; 1.37.18;
fenv for m68k
 1.36 19-Nov-2011  isaki branches: 1.36.10; 1.36.28;
Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.35 21-Jul-2011  joerg branches: 1.35.2;
machine/stdarg.h and machine/varargs.h are gone
 1.34 11-Jul-2011  joerg Sort
 1.33 01-Jun-2008  isaki Remove x68k/include/pci_machdep.h.
x68k does not have PCI-bus, and no one refers to it.
 1.32 11-Mar-2007  isaki branches: 1.32.38; 1.32.40; 1.32.42; 1.32.44;
Stop installing <machine/intr.h> on x68k.
Suggested by simonb@ and tsutsui@.
 1.31 09-Feb-2007  ad branches: 1.31.2; 1.31.6;
Merge newlock2 to head.
 1.30 26-Jul-2006  drochner branches: 1.30.4;
don't install <machine/db_machdep.h>, this is kernel only
 1.29 11-Dec-2005  christos branches: 1.29.4; 1.29.8;
merge ktrace-lwp.
 1.28 12-May-2004  minoura branches: 1.28.12;
Populate kbdmap-related definitions to the userland.
Also g/c unused ioctls.
Pointed out by he.
 1.27 08-May-2004  kleink Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.26 08-May-2004  minoura An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.25 18-Jan-2003  thorpej branches: 1.25.2;
Merge the nathanw_sa branch.
 1.24 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.23 14-Oct-2002  isaki Sort.
 1.22 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.21 24-Mar-2002  isaki branches: 1.21.2;
bsd_audioio.h was obsolated by vs0
 1.20 28-Nov-2001  kleink No point in installing svr4_machdep.h.
 1.19 12-Jun-2001  minoura branches: 1.19.2; 1.19.8;
Remove unneeded whitespace.
 1.18 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.17 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.16 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
 1.15 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.14 26-Jun-2000  kleink branches: 1.14.2;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.13 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.12 17-Mar-2000  tron Install "machineendian_machdep.h".
 1.11 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.10 19-Apr-1999  kleink branches: 1.10.2;
Add COMPAT_SVR4 for m68k.
 1.9 16-Mar-1999  minoura branches: 1.9.4;
Merged minoura_x68k_bus_h branch.
 1.8 15-Mar-1999  minoura Pullin m68k/ieee.h.
 1.7 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.6 14-Dec-1998  itohy branches: 1.6.2;
Added intr.h
 1.5 01-Sep-1998  itohy Added an include file on port dependent boot information.
 1.4 07-Aug-1998  minoura Moved parioctl.h to the system header directory.
 1.3 06-Aug-1998  minoura Moved grfioctl.h and iteioctl.h to the public include directory.
 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.6.2.2 14-Mar-1999  minoura Export bus.h.
 1.6.2.1 31-Jan-1999  minoura Sync.
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.10.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.10.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.14.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.19.8.7 11-Dec-2002  thorpej Sync with HEAD.
 1.19.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.19.8.5 13-Aug-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 08-Jan-2002  nathanw Catch up to -current.
 1.19.8.2 10-Nov-2001  scw Kernel mcontext glue for Scheduler Activations on m68k from
Klaus Klein <kleink@netbsd.org>.
 1.19.8.1 12-Jun-2001  scw file Makefile was added on branch nathanw_sa on 2001-11-10 21:22:53 +0000
 1.19.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.19.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.21.2.1 31-Aug-2002  gehenna catch up with -current.
 1.25.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.12.3 03-Sep-2007  yamt sync with head.
 1.28.12.2 26-Feb-2007  yamt sync with head.
 1.28.12.1 30-Dec-2006  yamt sync with head.
 1.29.8.1 11-Aug-2006  yamt sync with head
 1.29.4.1 09-Sep-2006  rpaulo sync with head
 1.30.4.1 01-Feb-2007  ad Header file cleanup.
 1.31.6.1 13-Mar-2007  ad Sync with head.
 1.31.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.32.44.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.32.42.1 04-May-2009  yamt sync with head.
 1.32.40.1 04-Jun-2008  yamt sync with head
 1.32.38.1 02-Jun-2008  mjf Sync with HEAD.
 1.35.2.1 17-Apr-2012  yamt sync with head
 1.36.28.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.36.10.1 03-Dec-2017  jdolecek update from HEAD
 1.37.18.1 10-Jun-2019  christos Sync with HEAD
 1.37.16.1 28-Jul-2018  pgoyette Sync with HEAD
 1.38.36.1 02-Aug-2025  perseant Sync with HEAD
 1.2 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.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.256;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.256.1 10-Jun-2019  christos Sync with HEAD
 1.3 08-Oct-1996  cgd repoint at shared aout_machdep.h, not exec.h
 1.2 08-Sep-1996  thorpej Use <m68k/exec.h>.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2 16-Oct-2011  isaki Switch to 2-clause license.
 1.1 17-Jan-2009  isaki branches: 1.1.2; 1.1.4; 1.1.8;
Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.1.8.2 04-May-2009  yamt sync with head.
 1.1.8.1 17-Jan-2009  yamt file autoconf.h was added on branch yamt-nfs-mp on 2009-05-04 08:12:06 +0000
 1.1.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.4.1 17-Jan-2009  skrll file autoconf.h was added on branch nick-hppapmap on 2009-01-19 13:17:07 +0000
 1.1.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 17-Jan-2009  mjf file autoconf.h was added on branch mjf-devfs2 on 2009-01-17 13:28:37 +0000
 1.4 27-Sep-2001  minoura branches: 1.4.4;
Embed the version number of the interface between the bootloader and
kernel. See amiga.
 1.3 23-Sep-1999  minoura branches: 1.3.14; 1.3.16;
First step toward network boot.
By Takeshi Nakayama <tn@catvmics.ne.jp>.
 1.2 14-Dec-1998  itohy Make egcs happy.
 1.1 01-Sep-1998  itohy Added an include file on port dependent boot information.
 1.3.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.14.1 01-Oct-2001  fvdl Catch up with -current.
 1.4.4.2 27-Sep-2001  minoura Embed the version number of the interface between the bootloader and
kernel. See amiga.
 1.4.4.1 27-Sep-2001  minoura file bootinfo.h was added on branch nathanw_sa on 2001-09-27 09:55:11 +0000
 1.3 24-Mar-2002  isaki bsd_audioio.h was obsolated by vs0
 1.2 05-Jan-1998  perry branches: 1.2.30; 1.2.34;
RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.34.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.30.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3 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.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 15-Jan-1999  bouyer branches: 1.1.2;
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.1.2.2 31-Jan-1999  minoura Sync.
 1.1.2.1 15-Jan-1999  minoura file bswap.h was added on branch minoura_x68k_bus_h on 1999-01-31 05:40:37 +0000
 1.26 23-Sep-2019  skrll Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
 1.25 13-Oct-2012  tsutsui branches: 1.25.38;
struct device * -> device_t (from chs@)
 1.24 24-Mar-2011  tsutsui branches: 1.24.4; 1.24.14;
Fix typo in comment.
 1.23 24-Mar-2011  tsutsui - make X68K_BUS_PERFORMANCE_HACK part default
- use volatile rather than dummy __asm() statements to avoid optimization

Tested on X68030.
 1.22 19-Mar-2010  tsutsui branches: 1.22.2;
ANSI'fy, misc KNF.
 1.21 19-Mar-2010  tsutsui u_intN_t -> uintN_t
 1.20 19-Mar-2010  tsutsui bus_space_write_region_N() should also take a const buffer.
 1.19 19-Mar-2010  he Constify the buffer pointer argument of the _bus_space_write_multi_<n>
inline functions, so that this builds again. (Otherwise, ne2000.c driver
would now fail to build.)
 1.18 28-Apr-2008  martin branches: 1.18.20; 1.18.22;
Remove clause 3 and 4 from TNF licenses
 1.17 04-Mar-2007  christos branches: 1.17.40; 1.17.42; 1.17.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.16 21-Feb-2007  mrg add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
bus_addr_t min_addr,
bus_addr_t max_addr,
bus_dma_tag_t *newtag,
int flags)
void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to. this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
 1.15 16-Feb-2006  perry branches: 1.15.20;
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.14 11-Dec-2005  christos branches: 1.14.2; 1.14.4; 1.14.6;
merge ktrace-lwp.
 1.13 09-Mar-2005  matt branches: 1.13.4;
Add a dm_maxsegsz public member to bus_dmamap_t. This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create). dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.
 1.12 18-Jan-2005  chs branches: 1.12.2;
de-__P, remove register, ansify.
 1.11 15-Jun-2003  fvdl branches: 1.11.2; 1.11.10;
Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
 1.10 28-Jan-2003  kent Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it.
 1.9 11-Nov-2001  isaki Support BUS_SPACE_MAP_SHIFTED_EVEN for bus_space_map().
Now BUS_SPACE_MAP_SHIFTED means BUS_SPACE_MAP_SHIFTED_ODD.
It is needed for Nereid Ethernet.
 1.8 19-Jul-2001  thorpej branches: 1.8.4; 1.8.6;
Add BUS_DMA_READ and BUS_DMA_WRITE flags, that hint the back-end
at dmamap load time that the mapping will be used for a unidirectional
transfer of the specified direction.
 1.7 07-Mar-2001  thorpej branches: 1.7.2;
Add the BUS_DMA_STREAMING flag.
 1.6 29-Jan-2001  itohy branches: 1.6.2;
Performance hack.
Mainly for the Neptune-X Ethernet adaptor,
and improves ftp(1) speed by ~10%.

get: 219 KB/s -> 246 KB/s
put: 226 KB/s -> 247 KB/s
(X68030, MC68030 25MHz)
 1.5 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.4 25-Jan-2000  drochner branches: 1.4.4;
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 23-Mar-1999  drochner branches: 1.3.8;
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.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file bus.h was initially added on branch minoura_x68k_bus_h.
 1.1.2.4 14-Mar-1999  minoura Use a single (inline) function instead of refering the bus_space switch.
 1.1.2.3 13-Feb-1999  minoura Implemented BUS_SPACE_MAP_SHIFTED.
Some of the devices are mapped only on the odd addresses for hardware
simplicity. To share drivers with other platforms, this should be
made transparent through the bus_space layer.
 1.1.2.2 30-Jan-1999  minoura Added DMAC driver.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.3.8.3 12-Mar-2001  bouyer Sync with HEAD.
 1.3.8.2 11-Feb-2001  bouyer Sync with HEAD.
 1.3.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.4.2 06-Jan-2002  he Pull up revision 1.9 (requested by isaki):
Support mapping devices with BUS_SPACE_MAP_SHIFTED_EVEN.
 1.4.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.6.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.7.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.2.1 03-Aug-2001  lukem update to -current
 1.8.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.6.1 19-Jul-2001  nathanw file bus.h was added on branch nathanw_sa on 2002-01-08 00:28:43 +0000
 1.8.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.11.10.1 29-Apr-2005  kent sync with -current
 1.11.2.2 01-Apr-2005  skrll Sync with HEAD.
 1.11.2.1 24-Jan-2005  skrll Sync with HEAD.
 1.12.2.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.13.4.3 03-Sep-2007  yamt sync with head.
 1.13.4.2 26-Feb-2007  yamt sync with head.
 1.13.4.1 21-Jun-2006  yamt sync with head.
 1.14.6.1 22-Apr-2006  simonb Sync with head.
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.14.2.1 18-Feb-2006  yamt sync with head.
 1.15.20.2 12-Mar-2007  rmind Sync with HEAD.
 1.15.20.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.17.44.2 11-Aug-2010  yamt sync with head.
 1.17.44.1 16-May-2008  yamt sync with head.
 1.17.42.1 18-May-2008  yamt sync with head.
 1.17.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.22.2 21-Apr-2011  rmind sync with head
 1.18.22.1 30-May-2010  rmind sync with head
 1.18.20.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.22.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.24.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.4.1 30-Oct-2012  yamt sync with head
 1.25.38.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.67 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.66 19-Jan-2024  thorpej Switch the x68k port to use the same clockframe layout as the other
m68k ports.
 1.65 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.64 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.63 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.62 23-Nov-2019  ad 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.61 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.60 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.59 17-Dec-2016  flxd branches: 1.59.14; 1.59.16;
Fix typo "one the" and architecture where appropriate.
 1.58 31-Jul-2014  isaki branches: 1.58.4; 1.58.8;
Remove the variable not used anymore.
sync with x68k/pmap_bootstrap.c,v 1.21 (in 2001).
 1.57 19-Oct-2013  christos branches: 1.57.2;
make cpu_need_resched() macros consistent; __USE flags
 1.56 02-Feb-2012  tsutsui branches: 1.56.6; 1.56.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.55 15-Nov-2011  tsutsui branches: 1.55.4;
Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
 1.54 16-May-2011  tsutsui branches: 1.54.4;
- 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.53 12-May-2011  tsutsui Make intiobase and intiolimit unsigned for consistency.
 1.52 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.51 22-Dec-2010  matt branches: 1.51.2; 1.51.4;
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.50 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.49 21-Oct-2009  rmind branches: 1.49.2; 1.49.4;
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.48 17-Jan-2009  isaki Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.47 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.46 18-Dec-2008  isaki Move external decl. of intiobase: dev/intiovar.h -> include/cpu.h
Move definition of intiobase: x68k/pmap_bootstrap.c -> x68k/locore.s
These synchronize code with other m68k ports.
 1.45 27-Feb-2008  xtraeme branches: 1.45.4; 1.45.12;
Remove CTL_MACHDEP_NAMES, it's not used anywhere.

Ok by martin@.
 1.44 17-Oct-2007  garbled branches: 1.44.12; 1.44.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.43 04-Aug-2007  ad branches: 1.43.2;
Add ci_cpuid where it's missing.
 1.42 21-May-2007  tsutsui branches: 1.42.2; 1.42.4; 1.42.8;
Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
 1.41 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.40 19-May-2007  isaki Use do { } while (0) to macro.
 1.39 19-May-2007  isaki Adapt to the merge of yamt-idlelwp branch.
tested on my X68030.
 1.38 04-Mar-2007  christos branches: 1.38.2; 1.38.4; 1.38.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 16-Feb-2007  ad branches: 1.37.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.36 09-Feb-2007  ad Merge newlock2 to head.
 1.35 11-Dec-2005  christos branches: 1.35.20;
merge ktrace-lwp.
 1.34 13-Jun-2005  he branches: 1.34.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.33 18-Jan-2005  chs de-__P, remove register, ansify.
 1.32 26-Sep-2004  yamt branches: 1.32.4;
don't expose cpu_info to userland.
 1.31 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.30 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.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 18-Jan-2003  thorpej branches: 1.28.2;
Merge the nathanw_sa branch.
 1.27 28-Oct-2002  chs untangle includes a bit:
don't include cpu.h in pmap.h, nor cacheops.h in cpu.h. instead,
include cpu.h and cacheops.h in just those .c files that need them.
 1.26 30-May-2001  mrg branches: 1.26.8;
use _KERNEL_OPT
 1.25 19-Dec-2000  scw branches: 1.25.2;
Unification of the m68k syscall() function.
 1.24 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.23 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.22 23-Apr-2000  minoura Do not include opt_m680x0 in LKM.
 1.21 18-Apr-2000  minoura defopt M680[2346]0.
 1.20 23-Sep-1999  minoura branches: 1.20.2;
Use m68k common cacheops.c.
 1.19 10-Aug-1999  thorpej Define cpu_number() as discussed on tech-smp.
 1.18 05-May-1999  minoura Use mvme68k-derived delay routine.
Now that we support various models, the old constant-loop delay routine
may cause problems.
 1.17 24-Mar-1999  minoura branches: 1.17.2; 1.17.4; 1.17.6;
Shut up gcc -Wall.
 1.16 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.15 26-Feb-1999  is synchronize types, and s/curproc/p/ in one forgotten place
 1.14 26-Feb-1999  is x68k specific part of fix for PR 6152
 1.13 13-Dec-1998  minoura branches: 1.13.2;
Splitted out the interrupt handling code to a separate file.
Disallow getting down the interrupt level by splXX.
 1.12 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.11 07-Oct-1998  thorpej Oops, back out a buglet I didn't intend to commit in the last change.
 1.10 06-Oct-1998  thorpej configure() prototype is in <sys/device.h>
 1.9 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.8 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.7 26-Oct-1997  is Make these compile after m68k/m68k.h 1.4->1.5.
 1.6 10-Oct-1997  oki Add prototypes.
 1.5 03-Feb-1997  oki branches: 1.5.8;
Remove #ifdef GENERIC ... #endif
 1.4 08-Jan-1997  oki Add fpu_probe prototype.
 1.3 11-Sep-1996  thorpej Use <m68k/cpu.h>.
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.2.1 14-Mar-1999  minoura Sync.
 1.17.6.1 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.17.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.2.1 24-Jun-1999  perry pullup 1.17->1.18 (minoura): Use mvme68k-derived delay() routine
 1.20.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.20.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.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.26.8.4 11-Nov-2002  nathanw Catch up to -current
 1.26.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.26.8.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.26.8.1 30-May-2001  scw file cpu.h was added on branch nathanw_sa on 2001-11-18 18:44:17 +0000
 1.28.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.28.2.6 24-Jan-2005  skrll Sync with HEAD.
 1.28.2.5 19-Oct-2004  skrll Sync with HEAD
 1.28.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.28.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.2.1 03-Aug-2004  skrll Sync with HEAD
 1.32.4.1 29-Apr-2005  kent sync with -current
 1.34.2.3 17-Mar-2008  yamt sync with head.
 1.34.2.2 03-Sep-2007  yamt sync with head.
 1.34.2.1 26-Feb-2007  yamt sync with head.
 1.35.20.1 06-Feb-2007  ad Update m68k pasteware.
 1.37.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.38.10.2 03-Oct-2007  garbled Sync with HEAD
 1.38.10.1 22-May-2007  matt Update to HEAD.
 1.38.4.1 11-Jul-2007  mjf Sync with head.
 1.38.2.2 20-Aug-2007  ad Sync with HEAD.
 1.38.2.1 27-May-2007  ad Sync with head.
 1.42.8.1 04-Aug-2007  jmcneill Sync with HEAD.
 1.42.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.42.2.1 07-Aug-2007  matt Sync with HEAD.
 1.43.2.2 23-Mar-2008  matt sync with HEAD
 1.43.2.1 06-Nov-2007  matt sync with HEAD
 1.44.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.44.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.44.12.1 24-Mar-2008  keiichi sync with head.
 1.45.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.45.4.3 11-Aug-2010  yamt sync with head.
 1.45.4.2 11-Mar-2010  yamt sync with head
 1.45.4.1 04-May-2009  yamt sync with head.
 1.49.4.3 31-May-2011  rmind sync with head
 1.49.4.2 05-Mar-2011  rmind sync with head
 1.49.4.1 03-Jul-2010  rmind sync with head
 1.49.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.51.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.51.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.54.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.54.4.1 17-Apr-2012  yamt sync with head
 1.55.4.1 18-Feb-2012  mrg merge to -current.
 1.56.10.1 18-May-2014  rmind sync with head
 1.56.6.2 03-Dec-2017  jdolecek update from HEAD
 1.56.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.57.2.1 10-Aug-2014  tls Rebase.
 1.58.8.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.58.4.1 05-Feb-2017  skrll Sync with HEAD
 1.59.16.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.59.16.1 10-Jun-2019  christos Sync with HEAD
 1.59.14.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3 06-Nov-2017  christos Cleanup and clarify the ELFSIZE mess:

We now have 2 variables automatically set in elf_machdep.h:

ARCH_ELFSIZE: the size for userland binaries
KERN_ELFSIZE: the size for the kernel binaries

DB_ELFSIZE has been deleted and KERN_ELFSIZE should have always the
same values DB_ELFSIZE used to have.

In sys/exec_elf.h, if ELFSIZE is not set, it is set to KERN_ELFSIZE
for the kernel and ARCH_ELFSIZE for userland. These defaults should
eliminate the need for most manual ELFSIZE setting.
 1.2 06-Dec-2001  minoura branches: 1.2.166;
Add ELF support.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.46; 1.1.1.1.50;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.50.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.1.1.46.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.166.1 03-Dec-2017  jdolecek update from HEAD
 1.7 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.6 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.5 23-Nov-2009  pooka If cpu_disklabel includes struct dkbad, define __HAVE_DISKLABEL_DKBAD.
This allows use of subr_disk_mbr on all archs. Default to it for
the rump disk component. No functional change for regular kernels.
(The other option would've been to include dkbad in disklabels
everywhere, but arguably this approach has less possible side-effects,
especially given that wedges and related magic will take over the
world any second now).
 1.4 11-Dec-2005  christos branches: 1.4.78;
merge ktrace-lwp.
 1.3 12-Jun-2005  dyoung Make disklabel(8) and fdisk(8) into "host tools " last step: build
and install ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-disklabel,
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk by "reaching over" to
the sources in ${NETBSDSRCDIR}/sbin/{disklabel fdisk}/.

To avoid clashes with a build-host's header files, especially on
*BSD, the host-tools versions of fdisk and disklabel search for
#includes such as disklabel.h, disklabel_acorn.h, disklabel_gpt.h,
and bootinfo.h in a new #includes namespace, nbinclude/. That is,
they #include <nbinclude/sys/disklabel.h>, <nbinclude/machine/disklabel.h>,
<nbinclude/sparc64/disklabel.h>, instead of <sys/disklabel.h> and
such. I have also updated the system headers to #include from
nbinclude/-space when HAVE_NBTOOL_CONFIG_H is #defined.
 1.2 30-Jun-1998  msaitoh branches: 1.2.50;
sync with -current after a long silence
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.50.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.78.1 11-Mar-2010  yamt sync with head
 1.1 12-Jul-1998  thorpej Basic elf_machdep.h for m68k; doesn't include relocations, yet.
 1.4 17-Mar-2000  mycroft In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.3 16-Mar-1999  minoura branches: 1.3.8;
Merged minoura_x68k_bus_h branch.
 1.2 24-Jan-1999  mycroft Format consistency.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.24;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.24.1 31-Jan-1999  minoura Sync.
 1.3.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:30:05 +0000
 1.3 08-Oct-1996  cgd moved to aout_machdep.h (via repository copy)
 1.2 08-Sep-1996  thorpej Use <m68k/exec.h>.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 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:49 +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:44 +0000
 1.2 03-Feb-1998  mycroft Prototype __flt_rounds() consistently.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.16;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.16.1 08-May-1998  mycroft Sync with trunk, per request of mycroft.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.7 07-Sep-2015  dholland 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.6 08-Feb-2011  rmind branches: 1.6.14; 1.6.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.5 04-Mar-2007  christos branches: 1.5.66; 1.5.72; 1.5.74;
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 25-Jan-2004  minoura branches: 1.3.16;
Remove COMPAT_HPUX support. It did not work for a long time,
and I do not think emulating frame buffer devices is useful.
KNF.
 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 06-Aug-1998  minoura branches: 1.1.48;
Moved grfioctl.h and iteioctl.h to the public include directory.
 1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.48.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.5.74.1 17-Feb-2011  bouyer Sync with HEAD
 1.5.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.66.1 05-Mar-2011  rmind sync with head
 1.6.32.1 22-Sep-2015  skrll Sync with HEAD
 1.6.14.1 03-Dec-2017  jdolecek update from HEAD
 1.2 30-Aug-1999  mycroft A foolish consistency.
 1.1 15-Mar-1999  minoura Pullin m68k/ieee.h.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 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:45 +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:55:02 +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:19 +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:55:02 +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:14 +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:55:02 +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:20:03 +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:55:02 +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:30:05 +0000
 1.23 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.22 11-Jul-2023  riastradh x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.
 1.21 22-Mar-2014  tsutsui branches: 1.21.60;
Remove obsolete ssir stuff which was used for pre-5.0 softintr(9).

No visible problem on X68030.
 1.20 23-Jun-2008  isaki branches: 1.20.30; 1.20.40; 1.20.46;
Unify splraiseipl(9) implementation among m68k ports,
discussed with tsutsui@ on port-m68k.

For x68k:
- export ipl2psl_table[] and make it uint16_t
- make makeiplcookie(9) inline
- put PSL_S bit into ipl2psl_table[] rather than adding it in makeiplcookie(9)
- define both IPL_SCHED and IPL_HIGH independently to avoid confusion
 1.19 23-May-2008  isaki branches: 1.19.2;
Initialize IPL_SERIAL. Analysed by tsutsui@.
Fixed kern/38684 (and other many panics).
 1.18 28-Apr-2008  martin branches: 1.18.2;
Remove clause 3 and 4 from TNF licenses
 1.17 03-Dec-2007  ad branches: 1.17.14; 1.17.16; 1.17.18;
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.16 11-Mar-2007  isaki branches: 1.16.16; 1.16.18; 1.16.24;
Remove #ifdef _KERNEL since this file is no longer exported.
Suggested by tsutsui@.
 1.15 11-Mar-2007  thorpej - 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.14 04-Mar-2007  tsutsui branches: 1.14.2;
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.13 04-Mar-2007  tsutsui Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.12 16-Feb-2007  ad branches: 1.12.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.11 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.10 27-Nov-2005  yamt branches: 1.10.20; 1.10.22;
implement splraiseipl() for the following ports.
evbppc, evbmips, evbsh3, hp700, mac68k, vax, x68k.
 1.9 18-Jan-2005  chs branches: 1.9.8; 1.9.14;
de-__P, remove register, ansify.
 1.8 13-Apr-2001  thorpej branches: 1.8.8; 1.8.24; 1.8.32;
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.7 14-Jan-2001  thorpej branches: 1.7.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.6 22-Aug-2000  thorpej Add spllock(). See spl(9) for details.
 1.5 16-Jan-2000  minoura Minor cleanups & corrections.
 1.4 23-Sep-1999  minoura branches: 1.4.2;
Protect some declarations by #ifdef _KERNEL.
 1.3 05-Aug-1999  thorpej 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.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 13-Dec-1998  minoura branches: 1.1.2;
Splitted out the interrupt handling code to a separate file.
Disallow getting down the interrupt level by splXX.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.4.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.32.1 29-Apr-2005  kent sync with -current
 1.8.24.2 11-Dec-2005  christos Sync with head.
 1.8.24.1 24-Jan-2005  skrll Sync with HEAD.
 1.8.8.2 13-Apr-2001  thorpej 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.8.8.1 13-Apr-2001  thorpej file intr.h was added on branch nathanw_sa on 2001-04-13 23:30:08 +0000
 1.9.14.1 29-Nov-2005  yamt sync with head.
 1.9.8.5 07-Dec-2007  yamt sync with head
 1.9.8.4 03-Sep-2007  yamt sync with head.
 1.9.8.3 26-Feb-2007  yamt sync with head.
 1.9.8.2 30-Dec-2006  yamt sync with head.
 1.9.8.1 21-Jun-2006  yamt sync with head.
 1.10.22.1 21-Sep-2006  yamt implement new api for x68k.
 1.10.20.1 12-Jan-2007  ad Sync with head.
 1.12.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.2.2 03-Dec-2007  ad Sync with HEAD.
 1.14.2.1 13-Mar-2007  ad Sync with head.
 1.16.24.1 08-Dec-2007  mjf Sync with HEAD.
 1.16.18.1 09-Jan-2008  matt sync with HEAD
 1.16.16.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.17.18.2 04-May-2009  yamt sync with head.
 1.17.18.1 16-May-2008  yamt sync with head.
 1.17.16.2 04-Jun-2008  yamt sync with head
 1.17.16.1 18-May-2008  yamt sync with head.
 1.17.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.17.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.18.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.19.2.1 27-Jun-2008  simonb Sync with head.
 1.20.46.1 18-May-2014  rmind sync with head
 1.20.40.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.30.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.60.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.10 01-Nov-2021  andvar fix typos, mainly in words minimum and maximum, but also few others.
 1.9 07-Sep-2015  dholland 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.8 08-Feb-2011  rmind branches: 1.8.14; 1.8.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.7 11-Dec-2005  christos branches: 1.7.100; 1.7.106; 1.7.108;
merge ktrace-lwp.
 1.6 12-May-2004  minoura Populate kbdmap-related definitions to the userland.
Also g/c unused ioctls.
Pointed out by he.
 1.5 08-May-2004  minoura #ifndef _XXX_H_ #define _XXX_H_ .... #endif
 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 24-Mar-1999  minoura branches: 1.3.42;
Shut up gcc -Wall.
 1.2 03-Sep-1998  minoura Eliminated meaningless ITEKANJI.
 1.1 06-Aug-1998  minoura Moved grfioctl.h and iteioctl.h to the public include directory.
 1.3.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.42.1 03-Aug-2004  skrll Sync with HEAD
 1.7.108.1 17-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.8.32.1 22-Sep-2015  skrll Sync with HEAD
 1.8.14.1 03-Dec-2017  jdolecek update from HEAD
 1.4 11-Dec-2005  christos 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 13-Oct-1997  lukem branches: 1.2.52;
rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.52.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.52.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.52.1 03-Aug-2004  skrll Sync with HEAD
 1.3 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 12-May-2004  minoura branches: 1.1.2;
Populate kbdmap-related definitions to the userland.
Also g/c unused ioctls.
Pointed out by he.
 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 12-May-2004  skrll file kbdmap.h was added on branch ktrace-lwp on 2004-08-03 10:42:56 +0000
 1.6 07-Sep-2015  dholland 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.5 28-Aug-2006  he branches: 1.5.104; 1.5.124;
Add duplicate include protection to <dev/sun/kbio.h>.
Make the x68k port use this include file, so that what remains
is only the port-specific additions.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 08-May-2004  minoura branches: 1.3.12;
#ifndef _XXX_H_ #define _XXX_H_ .... #endif
 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 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.12.1 30-Dec-2006  yamt sync with head.
 1.4.8.1 03-Sep-2006  yamt sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.124.1 22-Sep-2015  skrll Sync with HEAD
 1.5.104.1 03-Dec-2017  jdolecek update from HEAD
 1.1 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.4 28-Mar-2012  christos - Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
 1.3 23-Jun-2002  perry branches: 1.3.146; 1.3.150;
remove definition of CLOCKS_PER_SEC protected by #ifdef KERNEL. It is
used nowhere, and KERNEL is defined nowhere (vs. _KERNEL).
 1.2 09-Jan-1998  perry branches: 1.2.30; 1.2.34; 1.2.42;
multiple include protect machine/limits.h, fixes pr 4473 (from Mika Nystrom)
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.42.1 17-Jul-2002  gehenna catch up with -current.
 1.2.34.1 01-Aug-2002  nathanw Catch up to -current.
 1.2.30.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.150.1 05-Apr-2012  mrg sync to latest -current.
 1.3.146.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 20-Mar-2012  minoura branches: 1.7.2; 1.7.12;
Add xxboot (stage1) support.
 1.6 28-Apr-2008  martin branches: 1.6.34; 1.6.38; 1.6.40;
Remove clause 3 and 4 from TNF licenses
 1.5 25-Jan-2006  christos branches: 1.5.72; 1.5.74; 1.5.76;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.4 11-Dec-2005  christos branches: 1.4.2;
merge ktrace-lwp.
 1.3 18-Jan-2005  chs branches: 1.3.8;
de-__P, remove register, ansify.
 1.2 31-Oct-2001  thorpej branches: 1.2.2; 1.2.4; 1.2.20; 1.2.28;
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.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.4;
libsa for the new bootloader of x68k port.
 1.1.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file loadfile_machdep.h was added on branch thorpej-devvp on 2001-10-01 12:43:06 +0000
 1.2.28.1 29-Apr-2005  kent sync with -current
 1.2.20.1 24-Jan-2005  skrll Sync with HEAD.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 31-Oct-2001  thorpej file loadfile_machdep.h was added on branch kqueue on 2002-01-10 19:50:24 +0000
 1.2.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.2.2.1 31-Oct-2001  thorpej file loadfile_machdep.h was added on branch nathanw_sa on 2001-10-31 17:20:51 +0000
 1.3.8.1 21-Jun-2006  yamt sync with head.
 1.4.2.1 01-Feb-2006  yamt sync with head.
 1.5.76.1 16-May-2008  yamt sync with head.
 1.5.74.1 18-May-2008  yamt sync with head.
 1.5.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.40.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.6.38.1 05-Apr-2012  mrg sync to latest -current.
 1.6.34.1 17-Apr-2012  yamt sync with head
 1.7.12.1 10-Aug-2014  tls Rebase.
 1.7.2.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:30:06 +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:56:15 +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:30:07 +0000
 1.2 18-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.2 11-Jun-1997  kleink GC this file. It has been unused for quite a while.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 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:08:45 +0000
 1.6 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 08-May-2004  minoura An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 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 13-Oct-1997  lukem branches: 1.2.52;
rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.52.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.52.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.52.1 03-Aug-2004  skrll Sync with HEAD
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-May-2004  minoura branches: 1.1.2;
An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 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 opmreg.h was added on branch ktrace-lwp on 2004-08-03 10:42:56 +0000
 1.31 06-Jan-2024  isaki x68k: Make _delay() argument to microseconds.
'<< 8' is just a magnification factor and should not be visible
from the outside.
 1.30 31-May-2021  simonb Include "opt_param.h" (ifdef _KERNEL_OPT) everywhere that MSGBUFSIZE is
referenced since some sources include <machine/param.h>.
 1.29 28-Dec-2019  isaki branches: 1.29.12;
Bump MSGBUFSIZE (2 * NBPG).
Since timestamp was introduced, it was too small to store full dmesg
of one boot.
And putting this behind of #include <m68k/param.h> had no effect.
This was fixed on many arch in 1997 but x68k was not...
http://mail-index.netbsd.org/source-changes/1997/09/20/0021.html
 1.28 10-Feb-2012  para branches: 1.28.48; 1.28.52;
proper sizing of kmem_arena on different ports

PR port-i386/45946: Kernel locks up in VMEM system
 1.27 08-Feb-2011  rmind branches: 1.27.4; 1.27.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.26 11-Dec-2009  tsutsui branches: 1.26.4; 1.26.6; 1.26.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.25 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.24 31-Dec-2007  ad branches: 1.24.10;
Remove COMPAT_HPUX.
 1.23 11-Mar-2007  isaki branches: 1.23.18; 1.23.24; 1.23.30;
Merge #ifdef _KERNEL stuff into one place.
Suggested by tsutsui@.
 1.22 11-Mar-2007  isaki Include <machine/intr.h> only in _KERNEL.
Suggested by tsutsui@.
 1.21 11-Dec-2005  christos branches: 1.21.26; 1.21.30;
merge ktrace-lwp.
 1.20 18-Jan-2005  chs branches: 1.20.8;
de-__P, remove register, ansify.
 1.19 07-Aug-2003  agc branches: 1.19.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.18 18-Jan-2003  thorpej branches: 1.18.2;
Merge the nathanw_sa branch.
 1.17 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.16 30-May-2001  mrg branches: 1.16.8;
use _KERNEL_OPT
 1.15 11-Jan-2001  minoura branches: 1.15.2;
Sync. w/ luna68k; eliminate irrelavant code imposed by
the restriction of hp300 hardware and HP-UX compatibility.
 1.14 11-Feb-2000  thorpej Update for the NKMEMPAGES changes.
 1.13 04-Dec-1999  ragge CL* discarding.
 1.12 05-May-1999  minoura branches: 1.12.2; 1.12.8;
Use mvme68k-derived delay routine.
Now that we support various models, the old constant-loop delay routine
may cause problems.
 1.11 13-Dec-1998  minoura branches: 1.11.4; 1.11.6; 1.11.8;
Splitted out the interrupt handling code to a separate file.
Disallow getting down the interrupt level by splXX.
 1.10 30-Jun-1998  msaitoh sync with -current after a long silence
 1.9 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.8 09-Oct-1997  oki Prototype spl0().
 1.7 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.6 10-Jul-1997  veego branches: 1.6.2;
Restore the define of NPTEPG.
 1.5 10-Jun-1997  veego The 'Mach derived conversion macros' are now in <m68k/param.h>
 1.4 10-Jun-1997  veego Use the MI <m68k/param.h> include.
 1.3 24-Feb-1997  fvdl Define ALIGNED_POINTER
 1.2 16-May-1996  oki branches: 1.2.8;
spl0 prototype.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.8.1 12-Mar-1997  is Merge in changes from Trunk
 1.6.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.2.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.8.1 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.11.6.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11.4.1 24-Jun-1999  perry pullup 1.11->1.12 (minoura): Use mvme68k-derived delay() routine
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.12.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.15.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.16.8.4 11-Nov-2002  nathanw Catch up to -current
 1.16.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.16.8.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.16.8.1 30-May-2001  scw file param.h was added on branch nathanw_sa on 2001-11-18 18:44:18 +0000
 1.18.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.18.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.8.1 29-Apr-2005  kent sync with -current
 1.20.8.2 21-Jan-2008  yamt sync with head
 1.20.8.1 03-Sep-2007  yamt sync with head.
 1.21.30.1 13-Mar-2007  ad Sync with head.
 1.21.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.30.1 02-Jan-2008  bouyer Sync with HEAD
 1.23.24.1 18-Feb-2008  mjf Sync with HEAD.
 1.23.18.1 09-Jan-2008  matt sync with HEAD
 1.24.10.1 11-Mar-2010  yamt sync with head
 1.26.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.26.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.26.4.1 05-Mar-2011  rmind sync with head
 1.27.8.1 18-Feb-2012  mrg merge to -current.
 1.27.4.1 17-Apr-2012  yamt sync with head
 1.28.52.1 02-Jan-2020  martin Pull up following revision(s) (requested by isaki in ticket #594):

sys/arch/x68k/include/param.h: revision 1.29

Bump MSGBUFSIZE (2 * NBPG).

Since timestamp was introduced, it was too small to store full dmesg
of one boot.

And putting this behind of #include <m68k/param.h> had no effect.

This was fixed on many arch in 1997 but x68k was not...
http://mail-index.netbsd.org/source-changes/1997/09/20/0021.html
 1.28.48.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.29.12.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 08-May-2004  minoura #ifndef _XXX_H_ #define _XXX_H_ .... #endif
 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 07-Aug-1998  minoura branches: 1.1.48;
Moved parioctl.h to the system header directory.
 1.1.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2 31-Mar-1997  gwr Need a common <m68k/pcb.h> for gdb.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2 01-Jun-2008  isaki Remove x68k/include/pci_machdep.h.
x68k does not have PCI-bus, and no one refers to it.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.168; 1.1.1.1.170; 1.1.1.1.172; 1.1.1.1.174;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.174.2 23-Jun-2008  wrstuden Remove files removed on branch. Updating using patch has its
drawbacks. :-)
 1.1.1.1.174.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.1.1.1.172.1 04-May-2009  yamt sync with head.
 1.1.1.1.170.1 04-Jun-2008  yamt sync with head
 1.1.1.1.168.1 02-Jun-2008  mjf Sync with HEAD.
 1.27 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.26 28-Oct-2002  chs untangle includes a bit:
don't include cpu.h in pmap.h, nor cacheops.h in cpu.h. instead,
include cpu.h and cacheops.h in just those .c files that need them.
 1.25 22-Sep-2002  chs it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.
 1.24 22-Sep-2002  chs add pmap_remove_all() hook (empty on most platforms so far).
 1.23 10-Sep-2001  chris branches: 1.23.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.22 26-May-2001  chs branches: 1.22.2; 1.22.4;
replace vm_page_t with struct vm_page *.
 1.21 26-May-2001  chs replace {simple_,}lock{_data,}_t with struct {simple,}lock {,*}.
 1.20 22-Apr-2001  thorpej Undo a misguided previous change to the pmap_update() API.
 1.19 22-Apr-2001  thorpej Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.
 1.18 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.17 21-Sep-2000  thorpej branches: 1.17.2;
Make PMAP_PAGEIDLEZERO() return a boolean value. FALSE indidcates
that the page being zero'd was not completed and that page zeroing
should be aborted. This may be used by machine-dependent code doing
slow page access to reduce the latency of running a process that has
become runnable while in the middle of doing a slow page zero.
 1.16 26-Aug-2000  minoura Add #ifdef _KERNEL ~ #endif to protect kernel variables from userland.
 1.15 14-May-2000  minoura branches: 1.15.4;
MD parts of uvm_pageidlezero.
 1.14 13-May-1999  minoura branches: 1.14.2;
Missing #if for 060.
 1.13 16-Mar-1999  minoura branches: 1.13.2; 1.13.4; 1.13.6;
Merged minoura_x68k_bus_h branch.
 1.12 26-Feb-1999  is x68k specific part of fix for PR 6152
 1.11 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.10 22-Aug-1998  minoura branches: 1.10.6;
Eliminated vm_offset_t and vm_size_t.
 1.9 30-Jun-1998  msaitoh sync with -current after a long silence
 1.8 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.7 06-Jan-1998  thorpej Garbage-collect pm_stchanged; it's not used by anything.
 1.6 06-Jan-1998  thorpej Garbage-collect use of the PCB's copy of the user segment table pointer.
 1.5 03-Jan-1998  thorpej Now that all ports have pmap_activate(), and it has an identical interface,
prototype it in <vm/pmap.h>
 1.4 01-Jan-1998  thorpej Change an argument name to PMAP_ACTIVATE() to more accurately describe the
semantics of the argument.
 1.3 01-Jan-1998  thorpej - Make pmap_activate() and pmap_deactivate() take a struct proc *.
- Define active_user_pmap() and use it in the appropriate places (from hp300
port).
 1.2 10-Jun-1997  veego s/x68k_btop/m68k_btop/
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.10.6.2 14-Mar-1999  minoura Sync.
 1.10.6.1 31-Jan-1999  minoura Sync.
 1.13.6.1 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.13.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.13.2.1 21-Jun-1999  perry pullup 1.13->1.14 (minoura): Missing #if for 060 & minor cosmetics
 1.14.2.2 23-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.15.4.1 31-Aug-2000  minoura Pullup rev.1.16. Approved by thorpej.
Add #ifdef _KERNEL ~ #endif to protect kernel variables from userland.
 1.17.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.22.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.22.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.22.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.23.4.6 11-Nov-2002  nathanw Catch up to -current
 1.23.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.23.4.4 02-Jul-2002  nathanw Adjust whitespace so that this matches the trunk.
 1.23.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.23.4.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.23.4.1 10-Sep-2001  scw file pmap.h was added on branch nathanw_sa on 2001-11-18 18:44:18 +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:42:43 +0000
 1.1.4.2 31-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-31 14:52:55 +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:19:10 +0000
 1.5 19-Nov-2011  isaki Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.4 20-Dec-2008  isaki branches: 1.4.14;
x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.78; 1.3.86;
merge ktrace-lwp.
 1.2 08-May-2004  minoura #ifndef _XXX_H_ #define _XXX_H_ .... #endif
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.3.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.4.14.1 17-Apr-2012  yamt sync with head
 1.4 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.3 30-Jun-1998  msaitoh branches: 1.3.30; 1.3.34; 1.3.42;
sync with -current after a long silence
 1.2 24-Dec-1997  oki Add MDP_STACKADJ.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.16;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.16.1 25-Dec-1997  perry pull up from trunk (oki)
 1.3.42.1 17-Jul-2002  gehenna catch up with -current.
 1.3.34.2 01-Aug-2002  nathanw Catch up to -current.
 1.3.34.1 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.3.30.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3 14-Oct-2002  chs merge pte.h for m68k w/ motorola or compatible MMU
(only 4k-page platforms so far).
 1.2 21-Feb-2001  minoura branches: 1.2.8;
Use m68k_page_offset and m68k_trunc_page macros,
instead of using PGOFSET directly.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.32;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.32.1 12-Mar-2001  bouyer Sync with HEAD.
 1.2.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 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 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll 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:08:45 +0000
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2 13-Sep-1998  mycroft Minor change.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4 07-Sep-2015  dholland 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 11-Dec-2005  christos branches: 1.3.122; 1.3.142;
merge ktrace-lwp.
 1.2 08-May-2004  minoura #ifndef _XXX_H_ #define _XXX_H_ .... #endif
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.142.1 22-Sep-2015  skrll Sync with HEAD
 1.3.122.1 03-Dec-2017  jdolecek update from HEAD
 1.4 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.3 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.2 22-Jan-1999  mycroft Standardize format.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.24;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.24.1 31-Jan-1999  minoura Sync.
 1.2 11-Dec-2005  christos branches: 1.2.18;
merge ktrace-lwp.
 1.1 11-Jul-2005  christos branches: 1.1.6;
Add m68k sunos_machdep.h
 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 14:00:15 +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:57:48 +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.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.16 01-Apr-2021  simonb Define __HAVE_LEGACY_INTRCNT to indicate this port uses legacy intrcnt
interrupt accounting.
 1.15 20-Jan-2008  joerg branches: 1.15.110; 1.15.112;
Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
 1.14 17-Oct-2007  garbled branches: 1.14.2; 1.14.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.13 14-Jul-2007  ad branches: 1.13.10;
Generic soft interrupts are mandatory.
 1.12 04-Mar-2007  tsutsui branches: 1.12.2; 1.12.10;
Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.11 19-Sep-2006  gdamore branches: 1.11.4;
Convert x68k to timecounters. This conversion is not tested, due to lack
of available test candidates. It uses the previously unused (as far as I
can tell) Timer D, in freerunning mode. It only uses a 1/200 prescaler
(20KHz), as anything faster would roll over too fast for the system timer.
(Gotta love 8-bit resolution timers!) Approved for untested commit by core@.
 1.10 14-Sep-2006  gdamore branches: 1.10.2;
Converted x68k to todr. Compile tested only, but it has a low probably
of breaking anything.
 1.9 11-Dec-2005  christos branches: 1.9.8; 1.9.20;
merge ktrace-lwp.
 1.8 18-Jan-2005  chs branches: 1.8.8;
x68k no longer abuses cf_unit.
 1.7 28-Feb-2002  simonb branches: 1.7.16; 1.7.24;
Use "#define<tab>".
 1.6 05-Feb-2000  cgd branches: 1.6.8; 1.6.12;
add __BROKEN_CONFIG_UNIT_USAGE #define, becuase these ports do very
wrong things with device configuration data "cf_unit" information.
 1.5 01-Feb-2000  danw #define __HAVE_DEVICE_REGISTER on ports that have it, and check for
that, rather than a list of architecture defines, in config_attach
 1.4 04-Aug-1998  minoura branches: 1.4.14;
__BROKEN_INDIRECT_CONFIG fixes.
 1.3 09-Oct-1997  oki Remove __BDEVSW_DUMP_OLD_TYPE.
 1.2 05-Dec-1996  cgd branches: 1.2.10;
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.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.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.6.12.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.8.1 16-Mar-2002  jdolecek Catch up with -current.
 1.7.24.1 29-Apr-2005  kent sync with -current
 1.7.16.1 24-Jan-2005  skrll Sync with HEAD.
 1.8.8.2 21-Jan-2008  yamt sync with head
 1.8.8.1 30-Dec-2006  yamt sync with head.
 1.9.20.1 18-Nov-2006  ad Sync with head.
 1.9.8.1 14-Sep-2006  yamt sync with head.
 1.10.2.1 22-Oct-2006  yamt sync with head
 1.11.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.10.1 03-Oct-2007  garbled Sync with HEAD
 1.12.2.1 15-Jul-2007  ad Sync with head.
 1.13.10.2 23-Mar-2008  matt sync with HEAD
 1.13.10.1 06-Nov-2007  matt sync with HEAD
 1.14.8.1 23-Jan-2008  bouyer Sync with HEAD.
 1.14.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.15.112.1 03-Apr-2021  thorpej Sync with HEAD.
 1.15.110.1 03-Apr-2021  thorpej Sync with HEAD.
 1.2 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.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.41 08-Feb-2025  tsutsui Bump DFLSSIZ from 512KB to 2MB on all hp300 pmap m68k ports.

Some modern applications could require 512KB buffer on stack and
no particular comment on port-m68k@:
https://mail-index.netbsd.org/port-m68k/2025/02/02/msg000893.html
 1.40 01-Feb-2020  tsutsui branches: 1.40.30;
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.39 28-Jun-2019  tsutsui branches: 1.39.2; 1.39.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.38 02-Feb-2017  rin branches: 1.38.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.37 02-Feb-2017  rin PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos
 1.36 25-Jan-2014  tsutsui branches: 1.36.6; 1.36.10; 1.36.14;
Increase VM_KERNEL_PT_PAGES from 2 to 4 for x68k.

X68030 with 8MB or 12MB RAM (which is default for most X68030s)
now gets "pmap_enter_ptpage: can't get KPT page" panic again
with VM_KERNEL_PT_PAGES=2 while it works with >=14MB.
3 is enough to boot for now, but I also add a spare.

I guess this is because the post netbsd-6 vmem(9) bootstrap
changes require more kernel memory before MD pmap_init().

Note1: netbsd-6 (which also pulls physmem detection changes
that affect nptpages) doesn't have this problem.
Note2: other hp300 pmap based m68k ports might have the same issue,
but at least 12MB luna68k works with VM_KERNEL_PT_PAGES=2
so I think it depends on kernel size and/or iomapsize.
 1.35 21-Jan-2012  tsutsui branches: 1.35.6; 1.35.10;
Give higher priority to faster local memory on uvm_page_physload().
Tested by Y.Sugahara on his 060turbo with 128MB local memory and
this improved even simple benchmark. Ok'ed by isaki@.
 1.34 09-Oct-2011  tsutsui branches: 1.34.2; 1.34.6;
Move VM_MAXUSER_ADDRESS and VM_MAX_ADDRESS from 0xFFFFD000 to 0xFFF00000
which is used by other hp300 derived ports.
The previous values might be derived from (0 - UPAGES * PAGE_SIZE), but
there is no particular reason to have different values among m68k ports.
 1.33 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.32 06-Nov-2010  uebayasi branches: 1.32.2; 1.32.4;
Remove incomplete, never worked dynamic run-time memory registration
(uvm_page_physload(9)). This functionality will be re-added later.
 1.31 08-Dec-2009  tsutsui branches: 1.31.2; 1.31.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.30 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.29 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.28 11-Dec-2005  christos branches: 1.28.78; 1.28.86; 1.28.92;
merge ktrace-lwp.
 1.27 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.26 07-Aug-2003  agc branches: 1.26.8; 1.26.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.25 02-Apr-2003  thorpej branches: 1.25.2;
Use PAGE_SIZE rather than NBPG.
 1.24 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.23 15-Nov-2001  soren MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
 1.22 28-Oct-2001  isaki branches: 1.22.2;
fix typo s/X86K/X68K/ in comment.
 1.21 01-May-2001  thorpej branches: 1.21.2; 1.21.6;
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.20 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.19 11-Jan-2001  minoura branches: 1.19.2;
Sync. w/ luna68k; eliminate irrelavant code imposed by
the restriction of hp300 hardware and HP-UX compatibility.
 1.18 11-Jan-2001  minoura Eliminate EIOMAPSIZE.
 1.17 11-Jan-2001  minoura G/C.
 1.16 01-Dec-2000  tsutsui Remove unused pcbb() macro.
 1.15 14-Nov-2000  thorpej We use 4K pages on the x86k. Make PAGE_SIZE and friends into
compile-time constants.
 1.14 11-Feb-2000  thorpej Update for the NKMEMPAGES changes.
 1.13 26-Jan-2000  tsutsui Remove obsoleted macros.
 1.12 15-Jan-2000  minoura Change physseg allocation strategy to VM_PSTRAT_BIGFIRST.
Required when big (>64MB) high memory is installed.
 1.11 04-Dec-1999  ragge CL* discarding.
 1.10 26-Apr-1999  thorpej branches: 1.10.2; 1.10.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.9 16-Mar-1999  minoura branches: 1.9.2; 1.9.4;
Merged minoura_x68k_bus_h branch.
 1.8 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.7 03-Sep-1998  minoura branches: 1.7.6;
Unimplemented EIOMAPSIZE defaults to 0.
 1.6 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.5 08-Jul-1998  thorpej Define one page free list, and put all pages on it.
 1.4 30-Jun-1998  msaitoh sync with -current after a long silence
 1.3 12-Jul-1997  perry branches: 1.3.6;
update comment from 1981 on memory and disk prices -- pr-2754 from Curt Sampson
 1.2 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainilne.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.6; 1.1.1.1.10;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.10.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.1.1.1.6.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.3.6.1 13-Oct-1998  cgd work around broken extended memory detection, via patch. (minoura)
 1.7.6.1 31-Jan-1999  minoura Sync.
 1.9.4.2 06-Aug-1999  chs take an initial guess at UBC parameters.
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.2.1 15-Jan-2000  he Pull up revision 1.12 (requested by minoura):
Change physseg allocation strategy to VM_PSTRAT_BIGFIRST. Required
when big (>64MB) high memory is installed, i.e. in a situation
where DMA reachable memory runs out because of the large buffer
cache.
 1.10.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.10.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.10.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.10.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.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.21.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.21.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.22.2.3 11-Dec-2002  thorpej Sync with HEAD.
 1.22.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.22.2.1 28-Oct-2001  nathanw file vmparam.h was added on branch nathanw_sa on 2002-01-08 00:28:43 +0000
 1.25.2.4 01-Apr-2005  skrll Sync with HEAD.
 1.25.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.10.1 23-Feb-2005  yamt change kernel va layout, following mac68k.
XXX why maps p0upa cache invalidated?
 1.26.8.1 29-Apr-2005  kent sync with -current
 1.28.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.28.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.28.78.3 11-Mar-2010  yamt sync with head
 1.28.78.2 16-Sep-2009  yamt sync with head
 1.28.78.1 04-May-2009  yamt sync with head.
 1.31.4.1 05-Mar-2011  rmind sync with head
 1.31.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.32.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.32.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.34.6.1 18-Feb-2012  mrg merge to -current.
 1.34.2.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.34.2.1 17-Apr-2012  yamt sync with head
 1.35.10.1 18-May-2014  rmind sync with head
 1.35.6.2 03-Dec-2017  jdolecek update from HEAD
 1.35.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.36.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.36.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.36.6.1 05-Feb-2017  skrll Sync with HEAD
 1.38.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.39.4.1 29-Feb-2020  ad Sync with head.
 1.39.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.40.30.1 02-Aug-2025  perseant Sync with HEAD
 1.5 28-Aug-2006  he Collapse two more separate instances of MD vuid_event.h header
files to instead use the common <dev/sun/vuid_event.h> header.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 08-May-2004  minoura branches: 1.3.12;
#ifndef _XXX_H_ #define _XXX_H_ .... #endif
 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 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.12.1 30-Dec-2006  yamt sync with head.
 1.4.8.1 03-Sep-2006  yamt sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 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:42:56 +0000
 1.9 29-Mar-2008  tsutsui Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.8 07-Nov-2007  ad branches: 1.8.14;
Merge tty changes from the vmlocking branch.
 1.7 04-Mar-2007  tsutsui branches: 1.7.2; 1.7.18; 1.7.20; 1.7.24; 1.7.26;
Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.6 11-Dec-2005  christos branches: 1.6.26;
merge ktrace-lwp.
 1.5 18-Jan-2005  chs branches: 1.5.8;
de-__P, remove register, ansify.
 1.4 23-Mar-2004  minoura branches: 1.4.8;
Fix my bogus copyright notice. Pointed out by wiz.
 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 16-Mar-1999  minoura branches: 1.2.42;
Merged minoura_x68k_bus_h branch.
 1.1 07-Aug-1998  minoura branches: 1.1.6;
Switched to MI zs driver.
 1.1.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.2.42.4 24-Jan-2005  skrll Sync with HEAD.
 1.2.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.42.1 03-Aug-2004  skrll Sync with HEAD
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.8.2 15-Nov-2007  yamt sync with head.
 1.5.8.1 03-Sep-2007  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.7.24.1 13-Nov-2007  bouyer Sync with HEAD
 1.7.20.1 08-Nov-2007  matt sync with -HEAD
 1.7.18.1 11-Nov-2007  joerg Sync with HEAD.
 1.7.2.1 03-Dec-2007  ad Sync with HEAD.
 1.8.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.15 16-Aug-2020  isaki Replace boot_ustar with xxboot_ustarfs.
The old boot_ustar had many hard coding and was small(<1KB).
The new xxboot_ustarfs is a part of integrated larger(<8KB) xxboot.
We had to maintain three similar but not the same bootloaders, but
now we have two!
 1.14 14-Aug-2020  isaki Style fixes. One entry per line for some parts.
 1.13 12-Oct-2012  tsutsui First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.12 12-Oct-2012  tsutsui Tweak SUBDIR build order and add comments about each dir.
 1.11 19-Jun-2012  minoura branches: 1.11.2;
Descend to xxboot.
 1.10 06-Apr-2012  isaki put library first.
 1.9 05-Apr-2012  isaki mboot now depends on libiocs. noticed by tsutsui@.
 1.8 27-Jan-2002  minoura branches: 1.8.156; 1.8.160; 1.8.162;
omit xxboot, old a.out-only bootblock.
 1.7 02-Dec-2001  minoura Descend to new boot programs.
 1.6 09-Jan-2001  lukem branches: 1.6.4; 1.6.8;
convert to using .WAIT
 1.5 24-Dec-1999  minoura Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.4 04-Jul-1999  minoura branches: 1.4.2;
Enable mboot.
 1.3 01-Sep-1998  itohy branches: 1.3.10;
Use subdirs.
 1.2 30-Jun-1998  msaitoh sync with -current after a long silence
 1.1 19-Oct-1997  oki branches: 1.1.2;
New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.1.2.1 13-Oct-1998  cgd fix various bugs in the installation and operation of 'writefdboot'
(which has since been removed from -current), via patch. (minoura)
 1.3.10.1 02-Aug-1999  thorpej Update from trunk.
 1.4.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.6.4.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.162.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.8.162.1 09-Apr-2012  riz Pull up following revision(s) (requested by isaki in ticket #171):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.10
sys/arch/x68k/stand/mboot/Makefile: revision 1.16
sys/arch/x68k/stand/Makefile: revision 1.9
Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
mboot now depends on libiocs. noticed by tsutsui@.
 1.8.160.2 29-Apr-2012  mrg sync to latest -current.
 1.8.160.1 05-Apr-2012  mrg sync to latest -current.
 1.8.156.2 30-Oct-2012  yamt sync with head
 1.8.156.1 17-Apr-2012  yamt sync with head
 1.11.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10 17-Sep-2016  christos Kill ssp
 1.9 17-Sep-2016  christos Kill the PIE
 1.8 12-Jan-2014  tsutsui branches: 1.8.6; 1.8.10;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.7 11-Oct-2011  tsutsui branches: 1.7.2; 1.7.12; 1.7.16;
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:

- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)

The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!

Should also be pulled up to netbsd-5.
 1.6 11-Apr-2011  tsutsui Use bsd.klinks.mk to create machine and ${MACHINE_ARCH} symlinks.
 1.5 12-Jan-2009  tsutsui branches: 1.5.6; 1.5.8;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.78; 1.4.86; 1.4.88;
merge ktrace-lwp.
 1.3 30-Oct-2003  he Add -ffreestanding to CFLAGS to avoid type conflicts with built-in
functions in gcc.
 1.2 08-Oct-2003  simonb Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
 1.1 05-May-2002  isaki branches: 1.1.6; 1.1.8; 1.1.14;
libsa/Makefile: Fix rules to create symlinks on read-only source tree.
{boot,libsa,mboot}/Makefile, Makefile.booters:
move that common rule to Makefile.booters
 1.1.14.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.14.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.14.1 03-Aug-2004  skrll Sync with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 05-May-2002  jdolecek file Makefile.booters was added on branch kqueue on 2002-06-23 17:43:18 +0000
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 05-May-2002  nathanw file Makefile.booters was added on branch nathanw_sa on 2002-06-20 03:42:32 +0000
 1.4.88.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.
 1.4.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.4.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.6.1 21-Apr-2011  rmind sync with head
 1.7.16.1 18-May-2014  rmind sync with head
 1.7.12.2 03-Dec-2017  jdolecek update from HEAD
 1.7.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.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.8.10.1 04-Nov-2016  pgoyette Sync with HEAD
 1.8.6.1 05-Oct-2016  skrll Sync with HEAD
 1.4 15-Apr-2021  mrg more -fcommon for boot programs.
 1.3 10-Aug-2020  rin branches: 1.3.4;
Make x68k/stand compile with GCC8. Tested with XEiJ.
 1.2 12-Aug-2013  joerg Build boot loaders without unwind tables.
 1.1 07-Jan-2002  minoura branches: 1.1.2; 1.1.4; 1.1.160; 1.1.170; 1.1.176;
Use -Os optimization.
 1.1.176.1 28-Aug-2013  rmind sync with head
 1.1.170.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.160.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.4.2 11-Jan-2002  nathanw More catchup.
 1.1.4.1 07-Jan-2002  nathanw file Makefile.inc was added on branch nathanw_sa on 2002-01-11 23:38:46 +0000
 1.1.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 07-Jan-2002  thorpej file Makefile.inc was added on branch kqueue on 2002-01-10 19:50:25 +0000
 1.3.4.1 17-Apr-2021  thorpej Sync with HEAD.
 1.3 16-Aug-2020  isaki Update and fix.
All primary bootloaders can recognize Human68k partition table.
 1.2 16-Aug-2020  isaki Replace boot_ustar with xxboot_ustarfs.
The old boot_ustar had many hard coding and was small(<1KB).
The new xxboot_ustarfs is a part of integrated larger(<8KB) xxboot.
We had to maintain three similar but not the same bootloaders, but
now we have two!
 1.1 18-Jan-2020  isaki branches: 1.1.2; 1.1.6;
Add a document about this directory.
Reviewed by tsutsui@ on port-x68k.
 1.1.6.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.6.1 18-Jan-2020  martin file README was added on branch phil-wifi on 2020-04-08 14:07:57 +0000
 1.1.2.2 25-Jan-2020  ad Sync with head.
 1.1.2.1 18-Jan-2020  ad file README was added on branch ad-namecache on 2020-01-25 22:38:44 +0000
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 30-Jun-1998  msaitoh sync with -current after a long silence
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.4 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.3 30-Jun-1998  msaitoh sync with -current after a long silence
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki branches: 1.1.2;
New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.1.2.1 13-Oct-1998  cgd fix various bugs in the installation and operation of 'writefdboot'
(which has since been removed from -current), via patch. (minoura)
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.3 01-Sep-1998  itohy The files are moved to stand/xxboot/.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 19-Oct-1997  oki New bootblock code (compressed kernel support).
mostly written by ITOH Yasufumi.
 1.8 27-Jan-2019  dholland fix duplicated chunk from merge
 1.7 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.6 01-May-2018  christos branches: 1.6.2;
more NOMAN= removal.
 1.5 01-May-2018  christos Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
 1.4 12-Dec-2001  tv branches: 1.4.28;
MKfoo=no -> NOfoo
 1.3 15-May-2000  itohy branches: 1.3.8; 1.3.12;
Use bsd.hostprog.mk to allow ELF target on a.out host.
 1.2 17-Mar-1999  minoura branches: 1.2.8;
Move aout2hux manpage to share/man/man1/man1.x68k/.
 1.1 01-Sep-1998  itohy New utility program.
Convert a.out to Human68k ".x" format executable.
 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.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.3.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.28.1 02-May-2018  pgoyette Synch with HEAD
 1.6.2.1 10-Jun-2019  christos Sync with HEAD
 1.2 17-Mar-1999  minoura Move aout2hux manpage to share/man/man1/man1.x68k/.
 1.1 01-Sep-1998  itohy New utility program.
Convert a.out to Human68k ".x" format executable.
 1.14 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.13 21-Feb-2011  itohy Cleanup my copyright notice.
 1.12 15-Nov-2009  dholland branches: 1.12.4; 1.12.6; 1.12.8;
Remove PROTO(), which is like _P() only spelled differently.

The change causes gcc to harmlessly permute two instructions in the output
for some reason, but otherwise has no effect on the generated code.
 1.11 15-Nov-2009  dholland Since this is a host program, fix some 64-bit cleanliness issues.
 1.10 18-Mar-2009  cegger bzero -> memset
 1.9 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.8 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.7 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 19-Nov-1999  itohy branches: 1.5.134; 1.5.142; 1.5.148;
Oops, I misspelt a macro name.
 1.4 16-Nov-1999  itohy Support conversion from ELF, as well as from a.out.
 1.3 16-Mar-1999  minoura branches: 1.3.8; 1.3.14;
Merged minoura_x68k_bus_h branch.
 1.2 02-Feb-1999  itohy Fix typo.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
New utility program.
Convert a.out to Human68k ".x" format executable.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.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.5.148.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.142.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.134.2 11-Mar-2010  yamt sync with head
 1.5.134.1 04-May-2009  yamt sync with head.
 1.12.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.12.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.4 21-Feb-2011  itohy Cleanup my copyright notice.
 1.3 19-Nov-1999  itohy branches: 1.3.156; 1.3.162; 1.3.164;
Oops, I misspelt a macro name.
 1.2 16-Nov-1999  itohy Support conversion from ELF, as well as from a.out.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.20;
New utility program.
Convert a.out to Human68k ".x" format executable.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 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.3.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.156.1 05-Mar-2011  rmind sync with head
 1.4 21-Feb-2011  itohy Cleanup my copyright notice.
 1.3 16-Mar-1999  minoura branches: 1.3.170; 1.3.176; 1.3.178;
Merged minoura_x68k_bus_h branch.
 1.2 02-Feb-1999  itohy Fix typo.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
New utility program.
Convert a.out to Human68k ".x" format executable.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.3.178.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.176.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.170.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 15-Nov-2009  dholland branches: 1.2.4; 1.2.6; 1.2.8;
Remove PROTO(), which is like _P() only spelled differently.

The change causes gcc to harmlessly permute two instructions in the output
for some reason, but otherwise has no effect on the generated code.
 1.1 01-Sep-1998  itohy branches: 1.1.154;
New utility program.
Convert a.out to Human68k ".x" format executable.
 1.1.154.1 11-Mar-2010  yamt sync with head
 1.2.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.4.1 05-Mar-2011  rmind sync with head
 1.34 10-Aug-2020  rin Make x68k/stand compile with GCC8. Tested with XEiJ.
 1.33 18-Jan-2020  isaki Add 0x prefix when defining variables, not when using it.
This was necessary for bc(1) but it's no longer necessary.
 1.32 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.31 14-Jun-2019  isaki branches: 1.31.4;
boot_ufs (primary bootloader) expects /boot OMAGIC a.out.
 1.30 02-Jan-2019  christos use the right version of ELF2AOUT
 1.29 31-Dec-2018  christos use elf2aout for boot.
 1.28 08-Apr-2017  christos branches: 1.28.12; 1.28.14;
centralize vers.c building for standalone programs.
 1.27 25-Jun-2016  isaki branches: 1.27.2; 1.27.4;
Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.26 08-Aug-2014  isaki branches: 1.26.4;
Remove STRIP?=strip.
Falling back to the hosttool is not a good way now.
 1.25 06-Aug-2014  isaki Remove unused variable.
 1.24 05-Aug-2014  isaki Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.23 06-Jul-2014  tsutsui Merge and share boot.c between normal boot and netboot by dumb #ifdefs.

Tested on XM6i.
 1.22 20-Mar-2012  minoura branches: 1.22.2; 1.22.12;
Be silent.
 1.21 25-Dec-2011  tsutsui Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

- add 'ls' op to struct fs_ops to support ls command on each fs,
enabled by -DLIBSA_ENABLE_LS_OP and SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
in libsa
- split sys/lib/libsa/ufs_ls.c into UFS specific part and MI part (ls.c)
that opens the target fs and calls fs-depedent XXX_ls() functions
- add a ls op for ext2fs
(all other fs than ufs and ext2fs don't have actual ls ops yet)
- replace existing MD ufs_ls() calls with this new MI ls()

The original patch was written for i386 and ext2fs.
zaurus zboot has been tested by nonaka@.
ews4800mips and x68k loaders have been tested by me (with several fixes).
landisk might be okay since it was almost copied from i386.

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.20 12-Apr-2011  tsutsui branches: 1.20.4; 1.20.8;
Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.19 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.18 06-Jul-2010  mrg branches: 1.18.2; 1.18.4;
remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.17 14-Feb-2009  abs branches: 1.17.2; 1.17.4;
Use relative paths so we can avoid using ${MACHINE} in a path
 1.16 12-Jan-2009  tsutsui branches: 1.16.2;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.15 19-Oct-2008  apb branches: 1.15.2;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.14 11-Nov-2007  isaki branches: 1.14.14; 1.14.18; 1.14.24;
${PROG} depends on libsa and libiocs.
 1.13 29-Jun-2006  lukem branches: 1.13.14; 1.13.32; 1.13.34; 1.13.38; 1.13.40;
Support MAKEVERBOSE
 1.12 29-Jun-2006  lukem Rename LDFLAGS to LINKFLAGS, as the former is for CC not LD.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.8; 1.11.16;
merge ktrace-lwp.
 1.10 26-Oct-2003  lukem branches: 1.10.16;
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.9 05-May-2002  isaki branches: 1.9.10;
libsa/Makefile: Fix rules to create symlinks on read-only source tree.
{boot,libsa,mboot}/Makefile, Makefile.booters:
move that common rule to Makefile.booters
 1.8 12-Dec-2001  lukem branches: 1.8.2;
Set NOxxx= before <bsd.own.mk> is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
 1.7 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.6 14-Nov-2001  tv ${MAKE} print-objdir -> ${PRINTOBJDIR}
 1.5 15-Oct-2001  minoura branches: 1.5.4;
Use newvers_stand.sh to record the version.
 1.4 29-Sep-2001  minoura -D_STANDALONE
 1.3 28-Sep-2001  minoura Create stripped version by default.
 1.2 27-Sep-2001  minoura Make these compile with the old (a.out) toolchain.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.5.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.5.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 15-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:44 +0000
 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 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:50:26 +0000
 1.9.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.10.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.2 15-Nov-2007  yamt sync with head.
 1.10.16.1 30-Dec-2006  yamt sync with head.
 1.11.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.11.8.1 11-Aug-2006  yamt sync with head
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.13.40.1 19-Nov-2007  mjf Sync with HEAD.
 1.13.38.1 13-Nov-2007  bouyer Sync with HEAD
 1.13.34.1 09-Jan-2008  matt sync with HEAD
 1.13.32.1 11-Nov-2007  joerg Sync with HEAD.
 1.13.14.1 03-Dec-2007  ad Sync with HEAD.
 1.14.24.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.14.18.2 11-Aug-2010  yamt sync with head.
 1.14.18.1 04-May-2009  yamt sync with head.
 1.14.14.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.15.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.16.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.4.2 21-Apr-2011  rmind sync with head
 1.17.4.1 05-Mar-2011  rmind sync with head
 1.17.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.18.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.18.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.8.2 05-Apr-2012  mrg sync to latest -current.
 1.20.8.1 18-Feb-2012  mrg merge to -current.
 1.20.4.1 17-Apr-2012  yamt sync with head
 1.22.12.1 10-Aug-2014  tls Rebase.
 1.22.2.2 03-Dec-2017  jdolecek update from HEAD
 1.22.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.4.2 28-Aug-2017  skrll Sync with HEAD
 1.26.4.1 09-Jul-2016  skrll Sync with HEAD
 1.27.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.27.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.28.14.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.28.14.1 10-Jun-2019  christos Sync with HEAD
 1.28.12.1 18-Jan-2019  pgoyette Synch with HEAD
 1.31.4.1 25-Jan-2020  ad Sync with head.
 1.33 08-Aug-2025  isaki Fix an issue where the boot device was set to "sd0`" when sd_getbsdpartition()
returned an error.
 1.32 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.31 14-Jan-2020  isaki consio_init() should be done before printf().
 1.30 04-Aug-2016  isaki branches: 1.30.16; 1.30.22;
gets -> kgets. the last part of PR/51200.
It was using libsa's gets, so it's possible to change to kgets
as rev 1.23. I've confirmed that it works.
 1.29 26-Jun-2016  isaki branches: 1.29.2;
Add SCSI host adaptor selector to "boot" command of /boot.
By this function, /boot which booted from non-SCSI
(in other words, floppy) can load SCSI kernel.
Now, single /boot can load kernel of all supported filesystems
of all supported boot devices.

---
New "boot" command's syntax is: boot [hostadaptor@][dev:][file]

If you booted from SCSI, hostadaptor is already set (from IOCS)
and you can omit hostadaptor in this case. You can type like
"boot sd0a:netbsd" as before.

If you booted from floppy (hostadaptor is not set) and want to
load the SCSI kernel (hostadaptor is needed), you have to select
your hostadaptor in boot command, like "boot spc0@sd0a:netbsd".
 1.28 25-Jun-2016  isaki Fix my mistake of previous commit.
 1.27 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.26 19-Jun-2016  isaki Display debug messages before loading the kernel.
It makes easy to read.
 1.25 19-Jun-2016  isaki Split variable.
'dev' is the device number in devspec[] and
'bootdev' is the boot device parameter made from 'dev'.
 1.24 11-Jun-2016  dholland Revert this one; I can't tell for sure if it's using libsa gets or its
own firmware one in ../libdos. If the latter, switching and bringing
in the libsa one (a) might not work and (b) might make the bootloader
overflow size limits.

PR 51200.
 1.23 11-Jun-2016  dholland PR 51200 gets in libsa considered harmful: use kgets
 1.22 05-Aug-2014  isaki branches: 1.22.4;
Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.21 06-Jul-2014  tsutsui Probe the actual memory size and warn if it's different from SRAM value.

Without this, ancient X680x0 machines with a dead SRAM battery will
fail to boot silently (or hang right after early copyright messages).

Discussed with and reviewed by isaki@.

XXX: probably we should rather pass the probed memory size to a kernel
XXX: than the size value stored in SRAM..
 1.20 06-Jul-2014  tsutsui Merge and share boot.c between normal boot and netboot by dumb #ifdefs.

Tested on XM6i.
 1.19 06-Jul-2014  tsutsui Reduce diffs to prepare to merge these files.
 1.18 20-Mar-2012  minoura branches: 1.18.2; 1.18.12;
Be silent.
 1.17 25-Dec-2011  tsutsui Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

- add 'ls' op to struct fs_ops to support ls command on each fs,
enabled by -DLIBSA_ENABLE_LS_OP and SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
in libsa
- split sys/lib/libsa/ufs_ls.c into UFS specific part and MI part (ls.c)
that opens the target fs and calls fs-depedent XXX_ls() functions
- add a ls op for ext2fs
(all other fs than ufs and ext2fs don't have actual ls ops yet)
- replace existing MD ufs_ls() calls with this new MI ls()

The original patch was written for i386 and ext2fs.
zaurus zboot has been tested by nonaka@.
ews4800mips and x68k loaders have been tested by me (with several fixes).
landisk might be okay since it was almost copied from i386.

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.16 22-Jan-2011  joerg branches: 1.16.4; 1.16.8;
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.15 25-Aug-2010  christos branches: 1.15.2; 1.15.4;
s/LOAD_NOTE/LOAD_BACKWARDS/
 1.14 31-Jan-2009  tsutsui branches: 1.14.4; 1.14.6;
Disable LOAD_NOTE on floppy boot.
Tested by isaki@ and fixes PR install/38943 on x68k.
 1.13 17-Oct-2007  garbled branches: 1.13.20; 1.13.28; 1.13.30;
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.12 12-May-2007  isaki branches: 1.12.10;
Remove a local block for readability.
 1.11 04-Mar-2007  christos branches: 1.11.2; 1.11.4; 1.11.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 11-Dec-2005  christos branches: 1.10.26;
merge ktrace-lwp.
 1.9 18-Sep-2005  nsmrtks Add diagnostic message. (for debugging with 060)
 1.8 02-Dec-2001  minoura branches: 1.8.2; 1.8.18; 1.8.34;
Small message fixes.
 1.7 15-Oct-2001  minoura branches: 1.7.4;
Use newvers_stand.sh to record the version.
 1.6 15-Oct-2001  minoura Prepare to set WARNS=2.
 1.5 01-Oct-2001  minoura Add a prompt message.
 1.4 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.3 29-Sep-2001  minoura Minor KNF.
 1.2 28-Sep-2001  minoura Message cosmetics.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.7.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.4.1 15-Oct-2001  nathanw file boot.c was added on branch nathanw_sa on 2002-01-08 00:28:44 +0000
 1.8.34.2 03-Sep-2007  yamt sync with head.
 1.8.34.1 21-Jun-2006  yamt sync with head.
 1.8.18.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.1 02-Dec-2001  thorpej file boot.c was added on branch kqueue on 2002-01-10 19:50:26 +0000
 1.10.26.2 17-May-2007  yamt sync with head.
 1.10.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.10.1 22-May-2007  matt Update to HEAD.
 1.11.4.1 11-Jul-2007  mjf Sync with head.
 1.11.2.1 27-May-2007  ad Sync with head.
 1.12.10.1 06-Nov-2007  matt sync with HEAD
 1.13.30.1 02-Feb-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #407):
sys/arch/x68k/stand/boot/boot.c: revision 1.14
Disable LOAD_NOTE on floppy boot.
Tested by isaki@ and fixes PR install/38943 on x68k.
 1.13.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.13.20.2 09-Oct-2010  yamt sync with head
 1.13.20.1 04-May-2009  yamt sync with head.
 1.14.6.1 05-Mar-2011  rmind sync with head
 1.14.4.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.15.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.15.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.16.8.2 05-Apr-2012  mrg sync to latest -current.
 1.16.8.1 18-Feb-2012  mrg merge to -current.
 1.16.4.1 17-Apr-2012  yamt sync with head
 1.18.12.1 10-Aug-2014  tls Rebase.
 1.18.2.2 03-Dec-2017  jdolecek update from HEAD
 1.18.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.4.2 05-Oct-2016  skrll Sync with HEAD
 1.22.4.1 09-Jul-2016  skrll Sync with HEAD
 1.29.2.1 06-Aug-2016  pgoyette Sync with HEAD
 1.30.22.1 17-Jan-2020  ad Sync with head.
 1.30.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.10 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.9 18-Jan-2020  isaki Remove commented out ALIGN() operation.
It looks unnecessary and has never been used.
 1.8 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.7 31-Dec-2018  christos branches: 1.7.6;
use elf2aout for boot.
 1.6 02-Mar-2014  isaki branches: 1.6.28; 1.6.30;
Discard .SUNW_ctf section just in case.
patch from martin@, see PR/48623.
 1.5 12-Aug-2013  joerg Discard ELF unwind sections for the boot loader.
 1.4 24-May-2013  christos branches: 1.4.2;
discard debug sections that are not representable in the a.out object format.
 1.3 20-Mar-2012  minoura branches: 1.3.2;
Comment fix.
 1.2 30-Oct-2003  he branches: 1.2.140; 1.2.144; 1.2.146;
Add .rodata.str1.1 to the text segment, and discard the .comment section.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.22;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file boot.ldscript was added on branch kqueue on 2002-01-10 19:50:26 +0000
 1.1.4.2 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.4.1 27-Sep-2001  minoura file boot.ldscript was added on branch nathanw_sa on 2001-09-27 10:14:50 +0000
 1.2.146.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.144.1 05-Apr-2012  mrg sync to latest -current.
 1.2.140.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.2.140.1 17-Apr-2012  yamt sync with head
 1.3.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.2.1 23-Jun-2013  tls resync from head
 1.4.2.2 18-May-2014  rmind sync with head
 1.4.2.1 28-Aug-2013  rmind sync with head
 1.6.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6.30.1 10-Jun-2019  christos Sync with HEAD
 1.6.28.1 18-Jan-2019  pgoyette Synch with HEAD
 1.7.6.1 25-Jan-2020  ad Sync with head.
 1.13 23-Jun-2022  isaki x68k/stand: Merge {sd,cd}strategy and {sd,cd}close respectively.
For sd and cd devs, only open differs and the rest is the same.
No functional changes intended.
Suggested by tsutsui@ at port-x68k.
 1.12 25-Apr-2022  mlelstv libsa now needs ioctl to support media with large sectors. Provide
missing functions.

libsa defines files[] array itself, just reference it.
This also adds another global variable that tracks the root
filesystem module.
 1.11 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.10 12-Oct-2012  tsutsui branches: 1.10.14;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.9 20-Mar-2012  minoura branches: 1.9.2;
Add FFSv2 support.
 1.8 11-Dec-2005  christos branches: 1.8.112; 1.8.116; 1.8.118;
merge ktrace-lwp.
 1.7 28-Jun-2005  junyoung Cosmetic changes.
 1.6 23-Jun-2005  junyoung Use FS_OPS() macro.
 1.5 23-Jun-2005  junyoung Drop trailing spaces.
 1.4 23-Feb-2003  simonb branches: 1.4.2;
Update for LFSv2 support. Ports that have "bootxx_lfs"-style
bootblocks currently only support LFSv2, but the second level
"boot" program supports both LFS versions.
 1.3 17-Mar-2002  minoura Make this compile again.
 1.2 28-Sep-2001  minoura branches: 1.2.4; 1.2.6;
Add ustarfs support.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.2.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 28-Sep-2001  thorpej file conf.c was added on branch kqueue on 2002-01-10 19:50:26 +0000
 1.2.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.1 28-Sep-2001  nathanw file conf.c was added on branch nathanw_sa on 2002-04-01 07:43:42 +0000
 1.4.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.118.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.8.116.1 05-Apr-2012  mrg sync to latest -current.
 1.8.112.2 30-Oct-2012  yamt sync with head
 1.8.112.1 17-Apr-2012  yamt sync with head
 1.9.2.2 03-Dec-2017  jdolecek update from HEAD
 1.9.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10.14.1 09-Jul-2016  skrll Sync with HEAD
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file dp8390.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file dp8390.c was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file dp8390.c was added on branch netbsd-6 on 2012-11-18 19:05:19 +0000
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file dp8390.h was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file dp8390.h was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file dp8390.h was added on branch netbsd-6 on 2012-11-18 19:05:19 +0000
 1.3 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file if_ne.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file if_ne.c was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file if_ne.c was added on branch netbsd-6 on 2012-11-18 19:05:19 +0000
 1.3 11-Jul-2015  kamil Improve spelling: regsiter -> register

This change is non-functional.

Approved by <riastradh>, <pgoyette>
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4; 1.2.18;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file ne.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.18.1 22-Sep-2015  skrll Sync with HEAD
 1.2.4.3 03-Dec-2017  jdolecek update from HEAD
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file ne.c was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file ne.c was added on branch netbsd-6 on 2012-11-18 19:05:18 +0000
 1.1 12-Oct-2012  tsutsui branches: 1.1.2; 1.1.4; 1.1.6;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.6.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.6.1 12-Oct-2012  tls file ne.h was added on branch tls-maxphys on 2012-11-20 03:01:49 +0000
 1.1.4.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.4.1 12-Oct-2012  riz file ne.h was added on branch netbsd-6 on 2012-11-18 19:05:19 +0000
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file ne.h was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.3 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.2 12-Apr-2011  tsutsui Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.150; 1.1.156;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.156.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.150.1 21-Apr-2011  rmind sync with head
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file srt0.S was added on branch kqueue on 2002-01-10 19:50:27 +0000
 1.1.4.2 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.4.1 27-Sep-2001  minoura file srt0.S was added on branch nathanw_sa on 2001-09-27 10:14:50 +0000
 1.2 10-Aug-2014  isaki branches: 1.2.4;
Unify all arch/*/stand's atoi() to MI libsa.
lib/libsa/atoi.c was separated from lib/libsa/bootcfg.c.
PR/49084
 1.1 05-Aug-2014  isaki branches: 1.1.2;
Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 05-Aug-2014  tls file switch.c was added on branch tls-earlyentropy on 2014-08-10 06:54:10 +0000
 1.2.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.4.1 10-Aug-2014  tls file switch.c was added on branch tls-maxphys on 2014-08-20 00:03:28 +0000
 1.1 05-Aug-2014  isaki branches: 1.1.2; 1.1.6;
Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 05-Aug-2014  tls file switch.h was added on branch tls-maxphys on 2014-08-20 00:03:28 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 05-Aug-2014  tls file switch.h was added on branch tls-earlyentropy on 2014-08-10 06:54:10 +0000
 1.9 21-Jun-2022  isaki x68k/stand: Bump boot's version. Fix blocksize parameter passes to SCSI IOCS.
 1.8 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.7 17-Jan-2016  tsutsui Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
XXX: recent visible changes (memsize probe, SRAM switch command)
were not denoted in versions
Tested on (real) X68030.
 1.6 12-Oct-2012  tsutsui branches: 1.6.14;
Bump version to denote check_getchar() bug fix.
 1.5 20-Mar-2012  minoura branches: 1.5.2;
Add FFSv2 support.
 1.4 13-Oct-2011  tsutsui branches: 1.4.2; 1.4.6; 1.4.8;
Bump version to denote 060turbo boot fix.
 1.3 11-Apr-2011  tsutsui Bump version to denote serial console fix.
 1.2 09-Nov-2001  scw branches: 1.2.2; 1.2.4; 1.2.136; 1.2.148; 1.2.154;
Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.1 15-Oct-2001  minoura branches: 1.1.2;
Use newvers_stand.sh to record the version.
 1.1.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.154.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.148.1 21-Apr-2011  rmind sync with head
 1.2.136.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 09-Nov-2001  thorpej file version was added on branch kqueue on 2002-01-10 19:50:27 +0000
 1.2.2.2 09-Nov-2001  scw Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.2.2.1 09-Nov-2001  scw file version was added on branch nathanw_sa on 2001-11-09 19:53:17 +0000
 1.4.8.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.6.1 05-Apr-2012  mrg sync to latest -current.
 1.4.2.2 30-Oct-2012  yamt sync with head
 1.4.2.1 17-Apr-2012  yamt sync with head
 1.5.2.2 03-Dec-2017  jdolecek update from HEAD
 1.5.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.14.2 09-Jul-2016  skrll Sync with HEAD
 1.6.14.1 19-Mar-2016  skrll Sync with HEAD
 1.39 11-Jan-2023  isaki Add udivdi3/umoddi3 (and ashldi3) that were required by recent UFS change.
This increases xxboot_ufs from about 4.5KB to 5.5KB (The upper limit is 8KB).
Thanks tsutsui@ for advices.
 1.38 15-Dec-2021  christos branches: 1.38.4;
-W === -Wextra
 1.37 15-Dec-2021  christos remove naked -W
 1.36 18-Jan-2020  isaki Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.
 1.35 18-Jan-2020  isaki Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.
 1.34 18-Jan-2020  isaki Change primary bootloader's load address from 0x0f0000 to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+ffffffffffff8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
text+data+bss 12KB or less. Current actual size is 5~7KB.
I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea. Even in this
case, this change limits text+data+bss 12KB or less (currently, it's
about 6KB). However, I take breaking the builds on errors rather than
future size limitation.
There is no user visible changes or interface changes.
 1.33 18-Jan-2020  isaki Add 0x prefix when defining variables, not when using it.
This was necessary for bc(1) but it's no longer necessary.
 1.32 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.31 16-Jan-2020  isaki Rewrite limit check using cross-build tools.
This eliminates use of hosts tr(1) and bc(1).
(But I'm going to remove this again soon due to other reason)
 1.30 08-Apr-2017  christos branches: 1.30.14; 1.30.20;
centralize vers.c building for standalone programs.
 1.29 12-Aug-2013  joerg branches: 1.29.6; 1.29.10; 1.29.14;
Build boot loaders without unwind tables.
 1.28 15-Jun-2013  christos branches: 1.28.2;
revert previous
 1.27 15-Jun-2013  christos adjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs split
 1.26 11-Oct-2011  tsutsui branches: 1.26.2; 1.26.12;
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:

- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)

The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!

Should also be pulled up to netbsd-5.
 1.25 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.24 06-Jul-2010  mrg branches: 1.24.2; 1.24.4;
remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.23 25-Oct-2008  apb branches: 1.23.4; 1.23.14; 1.23.16;
Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.22 19-Oct-2008  apb Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.21 03-Mar-2007  isaki branches: 1.21.40; 1.21.44; 1.21.50;
-Wconversion is too strict.
 1.20 29-Jun-2006  lukem branches: 1.20.10;
Support MAKEVERBOSE
 1.19 29-Jun-2006  lukem Rename LDFLAGS to LINKFLAGS, as the former is for CC not LD.
 1.18 27-Dec-2005  he branches: 1.18.4; 1.18.8; 1.18.16;
Make this build again by using ${S}/../common/lib/libc/Makefile.inc,
after the libc/libkern consolidation.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 21-Mar-2004  itohy branches: 1.16.16;
Add notice on "relocation truncated to fit: R_68K_16" errors of ld.
Cleanup consistency check.
 1.15 30-Oct-2003  he Add -I${S} for <lib/libsa/stand.h> inclusion, and add
include of ../Makefile.booters for -ffreestanding.
 1.14 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.13 09-Apr-2003  itohy branches: 1.13.2;
Support UFS2 format for FFS.
 1.12 02-Feb-2003  isaki Use 32bit daddr_t.
 1.11 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.10 12-Dec-2001  lukem branches: 1.10.2;
Set NOxxx= before <bsd.own.mk> is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
 1.9 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.8 05-Dec-2001  minoura Correct LINKS to install sdboot_ufs properly.
 1.7 24-Nov-2001  minoura Emit the binaries directly from the loader.
 1.6 15-Oct-2001  minoura branches: 1.6.4;
Use newvers_stand.sh to record the version.
 1.5 01-Oct-2001  minoura Install as xxboot_*, and create links as fdboot_* and sdboot_*.
 1.4 28-Sep-2001  minoura Install as `boot_ufs'.
 1.3 27-Sep-2001  minoura Make these compile with the old (a.out) toolchain.
 1.2 27-Sep-2001  minoura Add some missing definitions.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.6.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.4.1 15-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:45 +0000
 1.10.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:50:27 +0000
 1.13.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.3 03-Sep-2007  yamt sync with head.
 1.16.16.2 30-Dec-2006  yamt sync with head.
 1.16.16.1 21-Jun-2006  yamt sync with head.
 1.18.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.18.8.1 11-Aug-2006  yamt sync with head
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.20.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.50.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.21.44.2 11-Aug-2010  yamt sync with head.
 1.21.44.1 04-May-2009  yamt sync with head.
 1.21.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.23.16.1 05-Mar-2011  rmind sync with head
 1.23.14.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.23.4.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.
 1.24.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.24.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.26.12.2 03-Dec-2017  jdolecek update from HEAD
 1.26.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.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.28.2.1 28-Aug-2013  rmind sync with head
 1.29.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.29.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.29.6.1 28-Aug-2017  skrll Sync with HEAD
 1.30.20.2 25-Jan-2020  ad Sync with head.
 1.30.20.1 17-Jan-2020  ad Sync with head.
 1.30.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.38.4.1 15-May-2023  martin Pull up following revision(s) (requested by chs in ticket #166):

sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.39

Add udivdi3/umoddi3 (and ashldi3) that were required by recent UFS change.

This increases xxboot_ufs from about 4.5KB to 5.5KB (The upper limit is 8KB).

Thanks tsutsui@ for advices.
 1.19 28-Jan-2020  isaki Revert placing .bss right after .data, and make .bss fixed at 0x5000.
.bss placed right after .data was overwritten when first 1KB loads full
.text+.data.
 1.18 28-Jan-2020  isaki Use __bss_start rather than edata to point the beginning of .bss.
Currently the .bss is placed right after .data. In that case, edata
points to the beginning of .bss so that there is no visible changes at
least currently.
 1.17 18-Jan-2020  isaki Change primary bootloader's load address from 0x0f0000 to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+ffffffffffff8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
text+data+bss 12KB or less. Current actual size is 5~7KB.
I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea. Even in this
case, this change limits text+data+bss 12KB or less (currently, it's
about 6KB). However, I take breaking the builds on errors rather than
future size limitation.
There is no user visible changes or interface changes.
 1.16 18-Jan-2020  isaki Typo in comment. s/availble/available/
 1.15 18-Jan-2020  isaki Add comment and figure of address map.
 1.14 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.13 16-Jan-2020  isaki Use .org directive to fix disklabel location instead of hand calculation.
If the code size before disklabel is less, zero is filled automatically.
If the code size before disklabel is exceeded, assembler stops with error.
Note that this changes a padding word in the current output binary from
a NOP instruction to zero but there are no functional changes.
 1.12 14-Jan-2020  isaki Clean up.
- B_KEYINP is no longer called from C.
- B_COLOR is no longer used.
 1.11 13-Jan-2020  isaki Typo in comment. s/LABELLOFFSET/LABELOFFSET/
 1.10 01-Nov-2012  isaki branches: 1.10.38; 1.10.44;
Fix typo in comment. s/d1/d0/
 1.9 21-Feb-2011  itohy branches: 1.9.4; 1.9.10; 1.9.14;
Cleanup my copyright notice.
 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 11-Dec-2005  christos branches: 1.7.26;
merge ktrace-lwp.
 1.6 04-Dec-2003  keihan branches: 1.6.16;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.5 09-Jun-2002  isaki branches: 1.5.6;
Divided 406 bytes disklabel area into 'nop' and 404 bytes area.
 1.4 24-Nov-2001  minoura branches: 1.4.2; 1.4.10;
boot_ufs can now used as the disk primary boot.
 1.3 28-Sep-2001  minoura branches: 1.3.4;
Update authors' mail addresses.
 1.2 27-Sep-2001  minoura Make these compile with the old (a.out) toolchain.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.3.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 28-Sep-2001  nathanw file boot.S was added on branch nathanw_sa on 2002-01-08 00:28:45 +0000
 1.4.10.1 15-Jul-2002  gehenna catch up with -current.
 1.4.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 24-Nov-2001  thorpej file boot.S was added on branch kqueue on 2002-01-10 19:50:28 +0000
 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.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 05-Mar-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.9.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.10.1 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.9.4.1 16-Jan-2013  yamt sync with (a bit old) head
 1.10.44.3 29-Feb-2020  ad Sync with head.
 1.10.44.2 25-Jan-2020  ad Sync with head.
 1.10.44.1 17-Jan-2020  ad Sync with head.
 1.10.38.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6 14-Jan-2020  isaki Clean up.
- B_KEYINP is no longer called from C.
- B_COLOR is no longer used.
 1.5 14-Mar-2009  dsl branches: 1.5.64; 1.5.70;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.4 24-Dec-2007  perry branches: 1.4.10; 1.4.18; 1.4.24;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.3 04-Aug-2006  mhitch branches: 1.3.34; 1.3.44; 1.3.48;
gcc4 fix: gcc4 more strict on checking signed/unsigned.
 1.2 17-Mar-2002  minoura branches: 1.2.28; 1.2.42; 1.2.46;
LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file boot_ufs.h was added on branch kqueue on 2002-01-10 19:50:28 +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 27-Sep-2001  nathanw file boot_ufs.h was added on branch nathanw_sa on 2002-04-01 07:43:43 +0000
 1.2.46.1 11-Aug-2006  yamt sync with head
 1.2.42.1 09-Sep-2006  rpaulo sync with head
 1.2.28.2 21-Jan-2008  yamt sync with head
 1.2.28.1 30-Dec-2006  yamt sync with head.
 1.3.48.1 02-Jan-2008  bouyer Sync with HEAD
 1.3.44.1 26-Dec-2007  ad Sync with head.
 1.3.34.1 09-Jan-2008  matt sync with HEAD
 1.4.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.10.1 04-May-2009  yamt sync with head.
 1.5.70.1 17-Jan-2020  ad Sync with head.
 1.5.64.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.8 28-Jan-2020  isaki Revert placing .bss right after .data, and make .bss fixed at 0x5000.
.bss placed right after .data was overwritten when first 1KB loads full
.text+.data.
 1.7 18-Jan-2020  isaki Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.
 1.6 18-Jan-2020  isaki Make .bss follows .data to detect size restriction easier.
Previously, if text+data exceeds the restricted size, it will conflict
with manually fixed .bss area and ldscript makes it an error.
By this change, ASSERT() can detect it.
 1.5 18-Jan-2020  isaki Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.
 1.4 18-Jan-2020  isaki Remove commented out ALIGN() operation.
It looks unnecessary and has never been used.
 1.3 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.2 24-Nov-2001  minoura branches: 1.2.2; 1.2.208; 1.2.214;
Emit the binaries directly from the loader.
 1.1 27-Sep-2001  minoura branches: 1.1.4;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.4.1 27-Sep-2001  nathanw file boot_ufs.ldscript was added on branch nathanw_sa on 2002-01-08 00:28:45 +0000
 1.2.214.2 29-Feb-2020  ad Sync with head.
 1.2.214.1 25-Jan-2020  ad Sync with head.
 1.2.208.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 24-Nov-2001  thorpej file boot_ufs.ldscript was added on branch kqueue on 2002-01-10 19:50:28 +0000
 1.14 14-Jun-2019  isaki Add missing newline.
 1.13 17-Jul-2010  isaki branches: 1.13.60;
Add a missing newline in BOOT_DEBUG mode.
 1.12 18-Mar-2009  cegger branches: 1.12.2; 1.12.4;
Ansify function definitions w/o arguments. Generated with sed.
 1.11 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.10 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.9 18-Dec-2008  isaki branches: 1.9.2;
Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.8 11-Dec-2005  christos branches: 1.8.74; 1.8.78; 1.8.86;
merge ktrace-lwp.
 1.7 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.6 30-Oct-2003  he branches: 1.6.16;
Add include of <lib/libsa/stand.h> for memcpy() and memset() prototypes.
 1.5 09-Apr-2003  itohy branches: 1.5.2;
Support UFS2 format for FFS.
 1.4 24-Nov-2001  minoura branches: 1.4.2;
boot_ufs can now used as the disk primary boot.
 1.3 15-Oct-2001  minoura branches: 1.3.4;
Use newvers_stand.sh to record the version.
 1.2 15-Oct-2001  minoura Prepare to set WARNS=2.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 15-Oct-2001  nathanw file bootmain.c was added on branch nathanw_sa on 2002-01-08 00:28:45 +0000
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 24-Nov-2001  thorpej file bootmain.c was added on branch kqueue on 2002-01-10 19:50:29 +0000
 1.5.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.8.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.78.2 11-Aug-2010  yamt sync with head.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.8.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.12.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.13.60.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.15 22-Jan-2013  dholland Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
ROOTINO -> UFS_ROOTINO
WINO -> UFS_WINO
NXADDR -> UFS_NXADDR
NDADDR -> UFS_NDADDR
NIADDR -> UFS_NIADDR
MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
 1.14 21-Feb-2011  itohy branches: 1.14.4; 1.14.14;
Cleanup my copyright notice.
 1.13 18-Mar-2009  cegger branches: 1.13.4; 1.13.6; 1.13.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.12 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 12-Jan-2009  tsutsui branches: 1.9.2;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.8 04-Mar-2007  christos branches: 1.8.40; 1.8.44; 1.8.52;
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 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.5 04-Dec-2003  keihan branches: 1.5.16;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.4 09-Apr-2003  itohy branches: 1.4.2;
Support UFS2 format for FFS.
 1.3 24-Jan-2003  fvdl Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.2 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file readufs.c was added on branch kqueue on 2002-01-10 19:50:29 +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 27-Sep-2001  nathanw file readufs.c was added on branch nathanw_sa on 2002-04-01 07:43:43 +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.5.16.2 03-Sep-2007  yamt sync with head.
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.8.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.44.1 04-May-2009  yamt sync with head.
 1.8.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 05-Mar-2011  rmind sync with head
 1.14.14.1 25-Feb-2013  tls resync with head
 1.14.4.1 23-Jan-2013  yamt sync with head
 1.13 21-Aug-2015  christos fix build (dholland)
 1.12 18-Jun-2013  christos branches: 1.12.10;
Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.
 1.11 15-Jun-2013  christos adjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs split
 1.10 21-Feb-2011  itohy branches: 1.10.4; 1.10.14;
Cleanup my copyright notice.
 1.9 14-Mar-2009  dsl branches: 1.9.4; 1.9.6; 1.9.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.8 11-Dec-2005  christos branches: 1.8.78; 1.8.86; 1.8.92;
merge ktrace-lwp.
 1.7 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.6 04-Dec-2003  keihan branches: 1.6.16;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.5 22-Oct-2003  itohy Fix in debug code (no functional changes).
 1.4 09-Apr-2003  itohy branches: 1.4.2;
Support UFS2 format for FFS.
 1.3 24-Jan-2003  fvdl Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.2 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file readufs.h was added on branch kqueue on 2002-01-10 19:50:29 +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 27-Sep-2001  nathanw file readufs.h was added on branch nathanw_sa on 2002-04-01 07:43:44 +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.6.16.1 21-Jun-2006  yamt sync with head.
 1.8.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.9.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.9.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.4.1 05-Mar-2011  rmind sync with head
 1.10.14.2 03-Dec-2017  jdolecek update from HEAD
 1.10.14.1 23-Jun-2013  tls resync from head
 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.12.10.1 22-Sep-2015  skrll Sync with HEAD
 1.15 17-Nov-2022  chs Restore backward compatibility of UFS2 with previous NetBSD releases by
disabling support in UFS2 for extended attributes (including ACLs).
Add a new variant of UFS2 called "UFS2ea" that does support extended attributes.
Add new fsck_ffs operations "-c ea" and "-c no-ea" to convert file systems
from UFS2 to UFS2ea and vice-versa (both of which delete all existing extended
attributes in the process).
 1.14 23-Jun-2013  dholland fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB()

(Christos already did the lfs ones a few days back)
 1.13 21-Feb-2011  itohy branches: 1.13.4; 1.13.14;
Cleanup my copyright notice.
 1.12 18-Mar-2009  cegger branches: 1.12.4; 1.12.6; 1.12.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 11-Dec-2005  christos branches: 1.9.78; 1.9.86; 1.9.92;
merge ktrace-lwp.
 1.8 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.7 27-Mar-2004  dsl branches: 1.7.16;
Rework previous to avoid checking FS_FLAGS_UPDATED for ffsv2
 1.6 21-Mar-2004  dsl A better fix for PR kern/24809, old filesystems should work ok now!
 1.5 20-Mar-2004  dsl When searching for the superblock, check that the fs_sblockloc field
matches the location we read it from to ensure we don't have one of the
alternate superblocks.
Fixes part of PR kern/24809
 1.4 04-Dec-2003  keihan netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.3 09-Apr-2003  itohy branches: 1.3.2;
Support UFS2 format for FFS.
 1.2 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file readufs_ffs.c was added on branch kqueue on 2002-01-10 19:50:29 +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 27-Sep-2001  nathanw file readufs_ffs.c was added on branch nathanw_sa on 2002-04-01 07:43:44 +0000
 1.3.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.9.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.78.1 04-May-2009  yamt sync with head.
 1.12.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.12.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.13.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.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.18 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.17 21-Aug-2015  christos fix build (dholland)
 1.16 28-Jul-2015  christos fix build
 1.15 09-Dec-2013  wiz branches: 1.15.6;
Fix typo ("then" instead of "than")
 1.14 18-Jun-2013  christos branches: 1.14.2;
Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.
 1.13 15-Jun-2013  christos adjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs splitadjust to the lfs split
 1.12 21-Feb-2011  itohy branches: 1.12.4; 1.12.14;
Cleanup my copyright notice.
 1.11 18-Mar-2009  cegger branches: 1.11.4; 1.11.6; 1.11.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.10 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.9 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.8 11-Dec-2005  christos branches: 1.8.78; 1.8.86; 1.8.92;
merge ktrace-lwp.
 1.7 25-Aug-2005  he Make these first-stage boot loaders use a locally-defined ino32_t
instead of introducing 64-bit operations in these space-constrained
pieces of code with the recent change to ino_t. This is patterned
slightly after recent changes to libsa's ufs.c.

Approved by christos.
 1.6 04-Dec-2003  keihan branches: 1.6.16;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.5 22-Oct-2003  itohy Fix in debug code (no functional changes).
 1.4 09-Apr-2003  itohy branches: 1.4.2;
Support UFS2 format for FFS.
 1.3 24-Jan-2003  fvdl Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.2 17-Mar-2002  minoura LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file readufs_lfs.c was added on branch kqueue on 2002-01-10 19:50:29 +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 27-Sep-2001  nathanw file readufs_lfs.c was added on branch nathanw_sa on 2002-04-01 07:43:44 +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.6.16.1 21-Jun-2006  yamt sync with head.
 1.8.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.11.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.11.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.4.1 05-Mar-2011  rmind sync with head
 1.12.14.3 03-Dec-2017  jdolecek update from HEAD
 1.12.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.14.1 23-Jun-2013  tls resync from head
 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.14.2.1 18-May-2014  rmind sync with head
 1.15.6.1 22-Sep-2015  skrll Sync with HEAD
 1.4 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.3 12-Jan-2020  isaki Fix broken RCS NetBSD tag.
 1.2 17-Mar-2002  minoura branches: 1.2.204; 1.2.210;
LFSv2 support.
Note that secondary boot does not support LFSv2.
Code written by itohy.
 1.1 15-Oct-2001  minoura branches: 1.1.4; 1.1.6;
Use newvers_stand.sh to record the version.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 15-Oct-2001  thorpej file version was added on branch kqueue on 2002-01-10 19:50:30 +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 15-Oct-2001  nathanw file version was added on branch nathanw_sa on 2002-04-01 07:43:44 +0000
 1.2.210.2 25-Jan-2020  ad Sync with head.
 1.2.210.1 17-Jan-2020  ad Sync with head.
 1.2.204.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 21-Feb-2011  itohy Cleanup my copyright notice.
 1.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.6; 1.1.8; 1.1.152; 1.1.158; 1.1.160;
libsa for the new bootloader of x68k port.
 1.1.160.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.158.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.152.1 05-Mar-2011  rmind sync with head
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 27-Sep-2001  thorpej file chkfmt.s was added on branch kqueue on 2002-01-10 19:50:31 +0000
 1.1.6.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.6.1 27-Sep-2001  minoura file chkfmt.s was added on branch nathanw_sa on 2001-09-27 10:03:28 +0000
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file chkfmt.s was added on branch thorpej-devvp on 2001-10-01 12:43:07 +0000
 1.3 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.2 27-Sep-2001  minoura branches: 1.2.2; 1.2.6; 1.2.8;
Make these compile with the old (a.out) toolchain.
 1.1 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.2.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.8.1 27-Sep-2001  thorpej file exec_image.S was added on branch kqueue on 2002-01-10 19:50:32 +0000
 1.2.6.2 27-Sep-2001  minoura Make these compile with the old (a.out) toolchain.
 1.2.6.1 27-Sep-2001  minoura file exec_image.S was added on branch nathanw_sa on 2001-09-27 14:08:29 +0000
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 27-Sep-2001  fvdl file exec_image.S was added on branch thorpej-devvp on 2001-10-01 12:43:08 +0000
 1.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.6; 1.1.8;
Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 27-Sep-2001  thorpej file exec_image.h was added on branch kqueue on 2002-01-10 19:50:32 +0000
 1.1.6.2 27-Sep-2001  minoura Initial commit of the new bootloader to support ELF kernel.
It consists of two programs named boot_ufs and boot; the former reads
the latter (an OMAGIC a.out).
Boot now utilizes the libsa library to read the actual kernel.

- LFS code exists, but probobly does not work.
- Currently the ELF toolchain is required.
- Many features are missing.
 1.1.6.1 27-Sep-2001  minoura file exec_image.h was added on branch nathanw_sa on 2001-09-27 10:14:51 +0000
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file exec_image.h was added on branch thorpej-devvp on 2001-10-01 12:43:08 +0000
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 24-Dec-2005  perry branches: 1.3.78; 1.3.86; 1.3.92;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 10-Dec-2002  thorpej branches: 1.2.22;
Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.1 18-May-2002  isaki branches: 1.1.4; 1.1.6; 1.1.8;
Make ELF kernel loadable, by itohy-san.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 18-May-2002  jdolecek file exec_sub.c was added on branch kqueue on 2002-06-23 17:43:22 +0000
 1.1.6.3 11-Dec-2002  thorpej Sync with HEAD.
 1.1.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.6.1 18-May-2002  nathanw file exec_sub.c was added on branch nathanw_sa on 2002-06-20 03:42:34 +0000
 1.1.4.2 30-May-2002  gehenna Catch up with -current.
 1.1.4.1 18-May-2002  gehenna file exec_sub.c was added on branch gehenna-devsw on 2002-05-30 15:36:38 +0000
 1.2.22.1 21-Jun-2006  yamt sync with head.
 1.3.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.4 21-Feb-2011  itohy Cleanup my copyright notice.
 1.3 18-May-2002  isaki branches: 1.3.136; 1.3.142; 1.3.144;
Make ELF kernel loadable, by itohy-san.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8; 1.2.16;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
Files used in common.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.16.1 30-May-2002  gehenna Catch up with -current.
 1.2.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.2.8.1 12-Jun-2001  nathanw file execkern.S was added on branch nathanw_sa on 2002-06-20 03:42:34 +0000
 1.2.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.144.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.142.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.136.1 05-Mar-2011  rmind sync with head
 1.5 21-Feb-2011  itohy Cleanup my copyright notice.
 1.4 14-Mar-2009  dsl branches: 1.4.4; 1.4.6; 1.4.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 24-Dec-2007  perry branches: 1.3.10; 1.3.18; 1.3.24;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.2 18-May-2002  isaki branches: 1.2.24; 1.2.86; 1.2.96; 1.2.100;
Make ELF kernel loadable, by itohy-san.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32; 1.1.40;
Files used in common.
 1.1.40.1 30-May-2002  gehenna Catch up with -current.
 1.1.32.1 20-Jun-2002  nathanw Catch up to -current.
 1.1.28.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.100.1 02-Jan-2008  bouyer Sync with HEAD
 1.2.96.1 26-Dec-2007  ad Sync with head.
 1.2.86.1 09-Jan-2008  matt sync with HEAD
 1.2.24.1 21-Jan-2008  yamt sync with head
 1.3.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.10.1 04-May-2009  yamt sync with head.
 1.4.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.4.1 05-Mar-2011  rmind sync with head
 1.4 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 11-Nov-1999  itohy branches: 1.2.156; 1.2.162; 1.2.164;
Make it build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Files used in common.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 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.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.156.1 05-Mar-2011  rmind sync with head
 1.5 21-Feb-2011  itohy Cleanup my copyright notice.
 1.4 14-Mar-2009  dsl branches: 1.4.4; 1.4.6; 1.4.8;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.3 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.2 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 01-Sep-1998  itohy branches: 1.1.154; 1.1.162; 1.1.168;
Files used in common.
 1.1.168.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.162.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.154.1 04-May-2009  yamt sync with head.
 1.4.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.4.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 14-Mar-2009  dsl branches: 1.2.4; 1.2.6; 1.2.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 01-Sep-1998  itohy branches: 1.1.154; 1.1.162; 1.1.168;
Files used in common.
 1.1.168.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.162.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.154.1 04-May-2009  yamt sync with head.
 1.2.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.4.1 05-Mar-2011  rmind sync with head
 1.5 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.4 27-Jan-2002  minoura branches: 1.4.8;
Install as /usr/mdec/install instead of installboot.new.
 1.3 12-Dec-2001  tv branches: 1.3.2;
MKfoo=no -> NOfoo
 1.2 02-Dec-2001  minoura Install as installboot.new.
 1.1 24-Nov-2001  minoura C version of installboot(8).
Shell script version required sed, od, etc. which were too big for install
media.
 1.3.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:50:32 +0000
 1.4.8.1 31-Aug-2002  gehenna catch up with -current.
 1.6 14-Oct-2012  tsutsui Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.5 23-Sep-2006  pavel branches: 1.5.90; 1.5.96; 1.5.100;
Replace wrong tests for character device (st.st_mode & S_IFCHR) by
S_ISCHR. Originally discovered by Paul Stoeber in OpenBSD.

OK elad@.
 1.4 04-Aug-2006  mhitch branches: 1.4.4; 1.4.6;
gcc4 fix: need to cast string variable.
 1.3 25-Nov-2001  minoura branches: 1.3.2; 1.3.34; 1.3.48; 1.3.52;
One more floppy fix.
 1.2 24-Nov-2001  minoura Remove debug messages.
Fix bogus floppy check.
 1.1 24-Nov-2001  minoura C version of installboot(8).
Shell script version required sed, od, etc. which were too big for install
media.
 1.3.52.1 11-Aug-2006  yamt sync with head
 1.3.48.1 09-Sep-2006  rpaulo sync with head
 1.3.34.1 30-Dec-2006  yamt sync with head.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 25-Nov-2001  thorpej file installboot.c was added on branch kqueue on 2002-01-10 19:50:33 +0000
 1.4.6.1 22-Oct-2006  yamt sync with head
 1.4.4.1 18-Nov-2006  ad Sync with head.
 1.5.100.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.96.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.5.90.1 30-Oct-2012  yamt sync with head
 1.13 26-May-2013  isaki Fix failed substitution in 1.10 (christos@) and
revert 1.12 (christos@) which was necessary by broken 1.10.
 1.12 24-May-2013  christos Add missing functions needed by loadbsd.
 1.11 24-May-2013  christos fix progress printing.
 1.10 24-May-2013  christos Don't play tricks trying to shortcut source rules because it breaks MKDEBUGLIB.
 1.9 12-Jan-2009  tsutsui branches: 1.9.14; 1.9.24;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.8 19-Oct-2008  apb branches: 1.8.2;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.7 29-Jun-2006  lukem branches: 1.7.58; 1.7.62; 1.7.68;
Support MAKEVERBOSE
 1.6 12-Dec-2001  tv branches: 1.6.32; 1.6.46; 1.6.50; 1.6.58;
MKfoo=no -> NOfoo
 1.5 14-Nov-2001  tv Work around <bsd.lib.mk> used for kernel libs in other places. Clean up
include paths.
 1.4 11-Nov-1999  itohy branches: 1.4.8; 1.4.12;
Make Human68k DOS library build on ELF toolchain.
 1.3 16-Mar-1999  minoura branches: 1.3.8; 1.3.10; 1.3.14;
Merged minoura_x68k_bus_h branch.
 1.2 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
Human68k DOS library.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.10.1 15-Nov-1999  fvdl Sync with -current
 1.3.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.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.58.1 13-Jul-2006  gdamore Merge from HEAD.
 1.6.50.1 11-Aug-2006  yamt sync with head
 1.6.46.1 09-Sep-2006  rpaulo sync with head
 1.6.32.1 30-Dec-2006  yamt sync with head.
 1.7.68.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.7.62.1 04-May-2009  yamt sync with head.
 1.7.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.24.1 23-Jun-2013  tls resync from head
 1.9.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.8 21-Feb-2011  itohy Cleanup my copyright notice.
 1.7 17-Mar-2009  he branches: 1.7.4; 1.7.6; 1.7.8;
Due to the way these files are used, ref. libdos/makedoscalls.awk and
libiocs/makeiocscalls.awk, we need a space between the function name
and the parameter list in the declaration.
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 24-Dec-2007  perry branches: 1.5.10; 1.5.18; 1.5.24;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.4 11-Dec-2005  christos branches: 1.4.50; 1.4.60; 1.4.64;
merge ktrace-lwp.
 1.3 30-Oct-2003  itohy branches: 1.3.16;
Change __const to __pure for function return type.
 1.2 22-Nov-1999  itohy branches: 1.2.28;
Add a bunch of "__attribute__((__packed__))"s
to get along with the ELF compiler.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 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.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.28.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 21-Jan-2008  yamt sync with head
 1.4.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.4.60.1 26-Dec-2007  ad Sync with head.
 1.4.50.1 09-Jan-2008  matt sync with HEAD
 1.5.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.10.1 04-May-2009  yamt sync with head.
 1.7.8.1 05-Mar-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.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 19-Jun-2000  itohy branches: 1.2.4; 1.2.156; 1.2.162; 1.2.164;
Fix weird macro definitions.
They are internal use only and the typos are no harm, you know. :)
 1.1 11-Nov-1999  itohy branches: 1.1.2; 1.1.4; 1.1.6;
Make Human68k DOS library build on ELF toolchain.
 1.1.6.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.2 15-Nov-1999  fvdl Sync with -current
 1.1.2.1 11-Nov-1999  fvdl file dos_asm.h was added on branch fvdl-softdep on 1999-11-15 00:39:55 +0000
 1.2.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.156.1 05-Mar-2011  rmind sync with head
 1.2.4.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.2.4.1 19-Jun-2000  bouyer file dos_asm.h was added on branch thorpej_scsipi on 2000-11-20 20:30:12 +0000
 1.2 21-Feb-2011  itohy Cleanup my copyright notice.
 1.1 11-Nov-1999  itohy branches: 1.1.2; 1.1.4; 1.1.10; 1.1.162; 1.1.168; 1.1.170;
Make Human68k DOS library build on ELF toolchain.
 1.1.170.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.168.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.162.1 05-Mar-2011  rmind sync with head
 1.1.10.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.10.1 11-Nov-1999  bouyer file dos_cerror.S was added on branch thorpej_scsipi on 2000-11-20 20:30:13 +0000
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.2 15-Nov-1999  fvdl Sync with -current
 1.1.2.1 11-Nov-1999  fvdl file dos_cerror.S was added on branch fvdl-softdep on 1999-11-15 00:39:56 +0000
 1.2 11-Nov-1999  itohy Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.1 01-Sep-1998  itohy Human68k DOS library.
 1.6 21-Feb-2011  itohy Cleanup my copyright notice.
 1.5 14-Mar-2009  dsl branches: 1.5.4; 1.5.6; 1.5.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.4 24-Dec-2005  perry branches: 1.4.78; 1.4.86; 1.4.92;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.3 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 11-Nov-1999  itohy branches: 1.2.44;
Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 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.44.1 21-Jun-2006  yamt sync with head.
 1.4.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.5.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.5.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.4.1 05-Mar-2011  rmind sync with head
 1.2 21-Feb-2011  itohy Cleanup my copyright notice.
 1.1 11-Nov-1999  itohy branches: 1.1.2; 1.1.4; 1.1.10; 1.1.162; 1.1.168; 1.1.170;
Make Human68k DOS library build on ELF toolchain.
 1.1.170.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.168.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.162.1 05-Mar-2011  rmind sync with head
 1.1.10.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.10.1 11-Nov-1999  bouyer file dos_procerr.S was added on branch thorpej_scsipi on 2000-11-20 20:30:14 +0000
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.2 15-Nov-1999  fvdl Sync with -current
 1.1.2.1 11-Nov-1999  fvdl file dos_procerr.S was added on branch fvdl-softdep on 1999-11-15 00:39:56 +0000
 1.2 11-Nov-1999  itohy Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 05-Jul-2001  toshii branches: 1.2.8; 1.2.152; 1.2.158; 1.2.160;
Fix typo. s/extention/extension/
 1.1 11-Nov-1999  itohy branches: 1.1.2; 1.1.4; 1.1.10;
Make Human68k DOS library build on ELF toolchain.
 1.1.10.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.10.1 11-Nov-1999  bouyer file dos_rename.S was added on branch thorpej_scsipi on 2000-11-20 20:30:14 +0000
 1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.2.2 15-Nov-1999  fvdl Sync with -current
 1.1.2.1 11-Nov-1999  fvdl file dos_rename.S was added on branch fvdl-softdep on 1999-11-15 00:39:57 +0000
 1.2.160.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.158.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.152.1 05-Mar-2011  rmind sync with head
 1.2.8.2 05-Jul-2001  toshii Fix typo. s/extention/extension/
 1.2.8.1 05-Jul-2001  toshii file dos_rename.S was added on branch nathanw_sa on 2001-07-05 08:38:27 +0000
 1.2 11-Nov-1999  itohy Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 1.1.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.4 21-Feb-2011  itohy Cleanup my copyright notice.
 1.3 19-Jun-2000  itohy branches: 1.3.154; 1.3.160; 1.3.162;
Store return value to a0 before calling CERROR function if __SVR4_ABI__.
 1.2 11-Nov-1999  itohy branches: 1.2.2;
Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 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.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.162.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.160.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.154.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 11-Nov-1999  itohy branches: 1.2.156; 1.2.162; 1.2.164;
Make Human68k DOS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
Human68k DOS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 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.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.156.1 05-Mar-2011  rmind sync with head
 1.11 24-May-2013  christos fix more of the same kind of shortcut rule lossage
 1.10 12-Jan-2009  tsutsui branches: 1.10.14; 1.10.24;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.9 19-Oct-2008  apb branches: 1.9.2;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.8 29-Jun-2006  lukem branches: 1.8.58; 1.8.62; 1.8.68;
Support MAKEVERBOSE
 1.7 12-Dec-2001  tv branches: 1.7.32; 1.7.46; 1.7.50; 1.7.58;
MKfoo=no -> NOfoo
 1.6 14-Nov-2001  tv Work around <bsd.lib.mk> used for kernel libs in other places. Clean up
include paths.
 1.5 19-Oct-2000  minoura branches: 1.5.4; 1.5.8;
Use up-to-date (newly installed) header files when DESTDIR is set.
 1.4 11-Nov-1999  itohy branches: 1.4.4;
Make X680x0 IOCS library build on ELF toolchain.
 1.3 16-Mar-1999  minoura branches: 1.3.8; 1.3.10; 1.3.14;
Merged minoura_x68k_bus_h branch.
 1.2 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
X680x0 IOCS library.
 1.1.6.1 14-Mar-1999  minoura Sync.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.10.1 15-Nov-1999  fvdl Sync with -current
 1.3.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.4.1 22-Oct-2000  tv Pullup 1.5 [minoura]:
Use up-to-date (newly installed) header files when DESTDIR is set.
 1.5.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.58.1 13-Jul-2006  gdamore Merge from HEAD.
 1.7.50.1 11-Aug-2006  yamt sync with head
 1.7.46.1 09-Sep-2006  rpaulo sync with head
 1.7.32.1 30-Dec-2006  yamt sync with head.
 1.8.68.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.8.62.1 04-May-2009  yamt sync with head.
 1.8.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.24.1 23-Jun-2013  tls resync from head
 1.10.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.9 11-Feb-2014  tsutsui Specify default SCSI inquiry size (36 bytes) on IOCS_S_INQUIRY() command.

X680x0 SCSI IOCS stalls if SCSI device doesn't return inquiry data
of specified allocation length size on the INQUIRY command,
and it causes hangup on the XM6 based emulators that return only
upto 36 byte inquiry data on SCSI disk emulation.

Many real SCSI-2 hard drives seem to support >100 byte inquiry data,
but at least there is a harddisk that returns only supported inquiry
data size and quits transfer.

The bootloader checks only the device type and there is no reason
to read 100 bytes that includes vender specific data.

Analyzed and reported by GIMONS, a developer of XM6 TypeG emulator,
which also can run NetBSD/x68k.
 1.8 21-Feb-2011  itohy branches: 1.8.4; 1.8.14; 1.8.18;
Cleanup my copyright notice.
 1.7 17-Mar-2009  he branches: 1.7.4; 1.7.6; 1.7.8;
Due to the way these files are used, ref. libdos/makedoscalls.awk and
libiocs/makeiocscalls.awk, we need a space between the function name
and the parameter list in the declaration.
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 24-Dec-2007  perry branches: 1.5.10; 1.5.18; 1.5.24;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.4 24-Dec-2005  perry branches: 1.4.50; 1.4.60; 1.4.64;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.3 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 22-Nov-1999  itohy branches: 1.2.44;
Add a bunch of "__attribute__((__packed__))"s
to get along with the ELF compiler.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.20;
X680x0 IOCS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 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.44.2 21-Jan-2008  yamt sync with head
 1.2.44.1 21-Jun-2006  yamt sync with head.
 1.4.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.4.60.1 26-Dec-2007  ad Sync with head.
 1.4.50.1 09-Jan-2008  matt sync with HEAD
 1.5.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.10.1 04-May-2009  yamt sync with head.
 1.7.8.1 05-Mar-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.8.18.1 18-May-2014  rmind sync with head
 1.8.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.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.3 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.2 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.6; 1.1.8; 1.1.214; 1.1.220;
libsa for the new bootloader of x68k port.
 1.1.220.1 25-Jan-2020  ad Sync with head.
 1.1.214.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 27-Sep-2001  thorpej file iocscall.h was added on branch kqueue on 2002-01-10 19:50:33 +0000
 1.1.6.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.6.1 27-Sep-2001  minoura file iocscall.h was added on branch nathanw_sa on 2001-09-27 10:03:28 +0000
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file iocscall.h was added on branch thorpej-devvp on 2001-10-01 12:43:09 +0000
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 11-Nov-1999  itohy branches: 1.2.156; 1.2.162; 1.2.164;
Make X680x0 IOCS library build on ELF toolchain.
 1.1 01-Sep-1998  itohy branches: 1.1.14; 1.1.16; 1.1.20;
X680x0 IOCS library.
 1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.16.1 15-Nov-1999  fvdl Sync with -current
 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.164.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.162.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.156.1 05-Mar-2011  rmind sync with head
 1.3 11-Feb-2014  tsutsui Remove unused inline version of SCSI IOCS functions.
 1.2 24-Dec-2005  perry branches: 1.2.112; 1.2.122; 1.2.128;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 27-Sep-2001  minoura branches: 1.1.2; 1.1.6; 1.1.8; 1.1.40;
libsa for the new bootloader of x68k port.
 1.1.40.1 21-Jun-2006  yamt sync with head.
 1.1.8.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.8.1 27-Sep-2001  thorpej file scsi.h was added on branch kqueue on 2002-01-10 19:50:34 +0000
 1.1.6.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.6.1 27-Sep-2001  minoura file scsi.h was added on branch nathanw_sa on 2001-09-27 10:03:28 +0000
 1.1.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.1 27-Sep-2001  fvdl file scsi.h was added on branch thorpej-devvp on 2001-10-01 12:43:10 +0000
 1.2.128.1 18-May-2014  rmind sync with head
 1.2.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.112.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.31 17-Jan-2016  tsutsui Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
XXX: recent visible changes (memsize probe, SRAM switch command)
were not denoted in versions
Tested on (real) X68030.
 1.30 25-Jul-2015  isaki sysinst is 15*2 sect/cyl (fdXc), not 8*2 sect/cyl (it's fdXa,
DOS compatible). It makes the loading of sysinst a bit faster.
Pointed out by Yosuke Sugahara.
 1.29 12-Oct-2012  tsutsui branches: 1.29.14;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.28 25-Dec-2011  tsutsui branches: 1.28.2; 1.28.6;
Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

- add 'ls' op to struct fs_ops to support ls command on each fs,
enabled by -DLIBSA_ENABLE_LS_OP and SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
in libsa
- split sys/lib/libsa/ufs_ls.c into UFS specific part and MI part (ls.c)
that opens the target fs and calls fs-depedent XXX_ls() functions
- add a ls op for ext2fs
(all other fs than ufs and ext2fs don't have actual ls ops yet)
- replace existing MD ufs_ls() calls with this new MI ls()

The original patch was written for i386 and ext2fs.
zaurus zboot has been tested by nonaka@.
ews4800mips and x68k loaders have been tested by me (with several fixes).
landisk might be okay since it was almost copied from i386.

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.27 11-Oct-2011  tsutsui branches: 1.27.2; 1.27.6;
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:

- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)

The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!

Should also be pulled up to netbsd-5.
 1.26 12-Apr-2011  tsutsui Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.25 19-Mar-2009  tsutsui branches: 1.25.4; 1.25.6;
Remove bcmp() from MD libsa.

XXX: These ports should be rewritten to use MI libsa for maintainability.
 1.24 12-Jan-2009  tsutsui branches: 1.24.2;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.23 28-Nov-2008  he We now also need globals.c from the common libsa.
 1.22 11-Nov-2007  isaki branches: 1.22.14; 1.22.18; 1.22.24; 1.22.26; 1.22.28;
x68k's floppy is 8*2 sect/cyl, not 18*2 sect/cyl.
 1.21 17-Oct-2007  garbled branches: 1.21.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.20 23-Jun-2007  isaki branches: 1.20.8; 1.20.10; 1.20.14;
Remove _ZLIB_PRIVATE that should have been removed 10 years ago.
 1.19 16-Jan-2006  he branches: 1.19.28; 1.19.30; 1.19.36;
Adapt to use of $S/../common/dist/zlib.
 1.18 27-Dec-2005  he branches: 1.18.2;
Make this build again by using ${S}/../common/lib/libc/Makefile.inc,
after the libc/libkern consolidation.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 23-Aug-2003  he branches: 1.16.16;
Add memmove.c, needed by new ufs.c.
 1.15 30-Mar-2003  isaki branches: 1.15.2;
Make it compilable.
see http://mail-index.netbsd.org/source-changes/2003/03/26/0009.html
 1.14 23-Feb-2003  simonb Update for LFSv2 support. Ports that have "bootxx_lfs"-style
bootblocks currently only support LFSv2, but the second level
"boot" program supports both LFS versions.
 1.13 02-Feb-2003  isaki - sys/lib/libsa/ufs_ls.c rev 1.3 needs strrchr.
- sort.
 1.12 25-Jan-2003  isaki Make it compilable with 64bit daddr_t.
 1.11 05-May-2002  isaki libsa/Makefile: Fix rules to create symlinks on read-only source tree.
{boot,libsa,mboot}/Makefile, Makefile.booters:
move that common rule to Makefile.booters
 1.10 12-Dec-2001  tv branches: 1.10.2;
MKfoo=no -> NOfoo
 1.9 02-Dec-2001  minoura Do not install libsa.a
 1.8 14-Nov-2001  tv Work around <bsd.lib.mk> used for kernel libs in other places. Clean up
include paths.
 1.7 31-Oct-2001  thorpej branches: 1.7.2;
Build the loadfile() a.out, ECOFF, and ELF back-ends as separate
objects.
 1.6 30-Sep-2001  minoura branches: 1.6.2;
Print daemon image on startup.
(any other missing features?)
 1.5 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.4 29-Sep-2001  minoura Exclude N/W code.
 1.3 28-Sep-2001  minoura Add changedisk_hook().
 1.2 27-Sep-2001  minoura Add some missing definitions.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.6.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.7.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.7.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.2.1 31-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:48 +0000
 1.10.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:50:34 +0000
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.3 15-Nov-2007  yamt sync with head.
 1.16.16.2 03-Sep-2007  yamt sync with head.
 1.16.16.1 21-Jun-2006  yamt sync with head.
 1.18.2.1 01-Feb-2006  yamt sync with head.
 1.19.36.1 26-Jun-2007  garbled Sync with HEAD.
 1.19.30.1 11-Jul-2007  mjf Sync with head.
 1.19.28.2 03-Dec-2007  ad Sync with HEAD.
 1.19.28.1 15-Jul-2007  ad Sync with head.
 1.20.14.1 13-Nov-2007  bouyer Sync with HEAD
 1.20.10.2 09-Jan-2008  matt sync with HEAD
 1.20.10.1 06-Nov-2007  matt sync with HEAD
 1.20.8.1 11-Nov-2007  joerg Sync with HEAD.
 1.21.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.22.28.1 17-Mar-2012  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
instructions which need to be handled by 060SP emulation
but not available in 060turbo IPL ROM
(LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo. Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.
 1.22.26.2 28-Apr-2009  skrll Sync with HEAD.
 1.22.26.1 19-Jan-2009  skrll Sync with HEAD.
 1.22.24.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.22.18.1 04-May-2009  yamt sync with head.
 1.22.14.1 17-Jan-2009  mjf Sync with HEAD.
 1.24.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.25.4.1 21-Apr-2011  rmind sync with head
 1.27.6.1 18-Feb-2012  mrg merge to -current.
 1.27.2.2 30-Oct-2012  yamt sync with head
 1.27.2.1 17-Apr-2012  yamt sync with head
 1.28.6.2 03-Dec-2017  jdolecek update from HEAD
 1.28.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.28.2.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.29.14.2 19-Mar-2016  skrll Sync with HEAD
 1.29.14.1 22-Sep-2015  skrll Sync with HEAD
 1.2 12-Oct-2012  tsutsui First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1 12-Apr-2011  tsutsui branches: 1.1.2; 1.1.6; 1.1.8; 1.1.14; 1.1.18;
Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.1.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.14.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.8.1 30-Oct-2012  yamt sync with head
 1.1.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.6.1 12-Apr-2011  jruoho file Makefile.inc was added on branch jruoho-x86intr on 2011-06-06 09:07:03 +0000
 1.1.2.2 21-Apr-2011  rmind sync with head
 1.1.2.1 12-Apr-2011  rmind file Makefile.inc was added on branch rmind-uvmplock on 2011-04-21 01:41:31 +0000
 1.4 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.3 07-Apr-2011  isaki Poll the next medium on both drive of #0 and #1.
 1.2 12-Jan-2009  tsutsui branches: 1.2.6; 1.2.8;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.1 28-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.124; 1.1.128; 1.1.136;
Add changedisk_hook().
 1.1.136.1 19-Jan-2009  skrll Sync with HEAD.
 1.1.128.1 04-May-2009  yamt sync with head.
 1.1.124.1 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 28-Sep-2001  thorpej file chdsk.c was added on branch kqueue on 2002-01-10 19:50:34 +0000
 1.1.4.2 28-Sep-2001  minoura Add changedisk_hook().
 1.1.4.1 28-Sep-2001  minoura file chdsk.c was added on branch nathanw_sa on 2001-09-28 15:19:34 +0000
 1.2.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 21-Apr-2011  rmind sync with head
 1.6 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.5 21-Nov-2014  christos put back missing paren.
 1.4 20-Nov-2014  christos This now needs clock.h
 1.3 17-Nov-2014  christos 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.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.4;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file clock.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.4.3 03-Dec-2017  jdolecek update from HEAD
 1.2.4.2 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.1 01-Nov-2012  tls file clock.c was added on branch tls-maxphys on 2012-11-20 03:01:50 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file clock.c was added on branch netbsd-6 on 2012-11-18 19:05:20 +0000
 1.12 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.11 17-Oct-2014  snj There's an r in "determine"
 1.10 12-Oct-2012  tsutsui Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.

The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
 1.9 17-Jul-2011  joerg branches: 1.9.2; 1.9.8; 1.9.12;
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.8 12-Apr-2011  tsutsui Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability. Tested on X68030, ok from isaki@.
 1.7 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.6 11-Apr-2011  tsutsui Add missing breaks. No need to output to SERIAL on ITE console.
 1.5 11-Nov-2007  isaki branches: 1.5.40; 1.5.46;
Style fix.
 1.4 02-Dec-2001  minoura branches: 1.4.2; 1.4.34; 1.4.76; 1.4.94; 1.4.96; 1.4.100; 1.4.102;
Small message fixes.
 1.3 30-Sep-2001  minoura branches: 1.3.4;
Print daemon image on startup.
(any other missing features?)
 1.2 28-Sep-2001  minoura Message cosmetics.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 30-Sep-2001  nathanw file consio.c was added on branch nathanw_sa on 2002-01-08 00:28:48 +0000
 1.4.102.1 19-Nov-2007  mjf Sync with HEAD.
 1.4.100.1 13-Nov-2007  bouyer Sync with HEAD
 1.4.96.1 09-Jan-2008  matt sync with HEAD
 1.4.94.1 11-Nov-2007  joerg Sync with HEAD.
 1.4.76.1 03-Dec-2007  ad Sync with HEAD.
 1.4.34.1 15-Nov-2007  yamt sync with head.
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 02-Dec-2001  thorpej file consio.c was added on branch kqueue on 2002-01-10 19:50:35 +0000
 1.5.46.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.40.1 21-Apr-2011  rmind sync with head
 1.9.12.2 03-Dec-2017  jdolecek update from HEAD
 1.9.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.8.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.9.2.1 30-Oct-2012  yamt sync with head
 1.3 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.2 11-Apr-2011  tsutsui Fix pasto. Now serial console output on bootloader works properly
after ~decade. ok from minoura@
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.150; 1.1.156;
libsa for the new bootloader of x68k port.
 1.1.156.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.150.1 21-Apr-2011  rmind sync with head
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file consio.h was added on branch kqueue on 2002-01-10 19:50:35 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file consio.h was added on branch nathanw_sa on 2001-09-27 10:03:28 +0000
 1.7 26-Jun-2016  isaki Add SCSI host adaptor selector to "boot" command of /boot.
By this function, /boot which booted from non-SCSI
(in other words, floppy) can load SCSI kernel.
Now, single /boot can load kernel of all supported filesystems
of all supported boot devices.

---
New "boot" command's syntax is: boot [hostadaptor@][dev:][file]

If you booted from SCSI, hostadaptor is already set (from IOCS)
and you can omit hostadaptor in this case. You can type like
"boot sd0a:netbsd" as before.

If you booted from floppy (hostadaptor is not set) and want to
load the SCSI kernel (hostadaptor is needed), you have to select
your hostadaptor in boot command, like "boot spc0@sd0a:netbsd".
 1.6 12-Oct-2012  tsutsui branches: 1.6.14;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.5 11-Apr-2011  tsutsui branches: 1.5.4; 1.5.10; 1.5.14;
Some KNF. No binary change.
 1.4 11-Nov-2007  isaki branches: 1.4.40; 1.4.46;
Style fix.
 1.3 10-May-2006  skrll branches: 1.3.18; 1.3.36; 1.3.38; 1.3.42; 1.3.44;
Fix a bunch of cast lvalues.
 1.2 29-Sep-2001  minoura branches: 1.2.4; 1.2.6; 1.2.38; 1.2.52; 1.2.54; 1.2.56; 1.2.58; 1.2.60;
Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.2.60.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.58.1 11-May-2006  elad sync with head
 1.2.56.1 24-May-2006  yamt sync with head.
 1.2.54.1 01-Jun-2006  kardel Sync with head.
 1.2.52.1 09-Sep-2006  rpaulo sync with head
 1.2.38.2 15-Nov-2007  yamt sync with head.
 1.2.38.1 21-Jun-2006  yamt sync with head.
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 29-Sep-2001  thorpej file devopen.c was added on branch kqueue on 2002-01-10 19:50:35 +0000
 1.2.4.2 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.2.4.1 29-Sep-2001  minoura file devopen.c was added on branch nathanw_sa on 2001-09-29 03:50:14 +0000
 1.3.44.1 19-Nov-2007  mjf Sync with HEAD.
 1.3.42.1 13-Nov-2007  bouyer Sync with HEAD
 1.3.38.1 09-Jan-2008  matt sync with HEAD
 1.3.36.1 11-Nov-2007  joerg Sync with HEAD.
 1.3.18.1 03-Dec-2007  ad Sync with HEAD.
 1.4.46.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.40.1 21-Apr-2011  rmind sync with head
 1.5.14.2 03-Dec-2017  jdolecek update from HEAD
 1.5.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.10.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.5.4.1 30-Oct-2012  yamt sync with head
 1.6.14.1 09-Jul-2016  skrll Sync with HEAD
 1.9 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.8 08-Mar-2014  isaki Unused variable, for GCC4.8.
 1.7 17-Jul-2011  joerg branches: 1.7.2; 1.7.12; 1.7.16;
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 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.5 18-Nov-2007  isaki branches: 1.5.40; 1.5.46;
Use the same prototypes as libx68k.h.
 1.4 11-Nov-2007  isaki Style fix.
 1.3 25-Jan-2006  christos branches: 1.3.28; 1.3.46; 1.3.48; 1.3.52; 1.3.54;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.2 15-Oct-2001  minoura branches: 1.2.4; 1.2.6; 1.2.38; 1.2.50;
Prepare to set WARNS=2.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.2.50.1 01-Feb-2006  yamt sync with head.
 1.2.38.3 07-Dec-2007  yamt sync with head
 1.2.38.2 15-Nov-2007  yamt sync with head.
 1.2.38.1 21-Jun-2006  yamt sync with head.
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 15-Oct-2001  thorpej file fd.c was added on branch kqueue on 2002-01-10 19:50:36 +0000
 1.2.4.2 15-Oct-2001  minoura Prepare to set WARNS=2.
 1.2.4.1 15-Oct-2001  minoura file fd.c was added on branch nathanw_sa on 2001-10-15 16:13:41 +0000
 1.3.54.1 19-Nov-2007  mjf Sync with HEAD.
 1.3.52.2 18-Nov-2007  bouyer Sync with HEAD
 1.3.52.1 13-Nov-2007  bouyer Sync with HEAD
 1.3.48.1 09-Jan-2008  matt sync with HEAD
 1.3.46.2 21-Nov-2007  joerg Sync with HEAD.
 1.3.46.1 11-Nov-2007  joerg Sync with HEAD.
 1.3.28.1 03-Dec-2007  ad Sync with HEAD.
 1.5.46.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.40.1 21-Apr-2011  rmind sync with head
 1.7.16.1 18-May-2014  rmind sync with head
 1.7.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.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.2 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6;
libsa for the new bootloader of x68k port.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file fdsub.S was added on branch kqueue on 2002-01-10 19:50:36 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file fdsub.S was added on branch nathanw_sa on 2001-09-27 10:03:29 +0000
 1.2 11-Nov-2007  isaki Style fix.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.38; 1.1.80; 1.1.98; 1.1.100; 1.1.104; 1.1.106;
libsa for the new bootloader of x68k port.
 1.1.106.1 19-Nov-2007  mjf Sync with HEAD.
 1.1.104.1 13-Nov-2007  bouyer Sync with HEAD
 1.1.100.1 09-Jan-2008  matt sync with HEAD
 1.1.98.1 11-Nov-2007  joerg Sync with HEAD.
 1.1.80.1 03-Dec-2007  ad Sync with HEAD.
 1.1.38.1 15-Nov-2007  yamt sync with head.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file fdvar.h was added on branch kqueue on 2002-01-10 19:50:37 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file fdvar.h was added on branch nathanw_sa on 2001-09-27 10:03:29 +0000
 1.8 23-Jun-2022  isaki x68k/stand: Merge {sd,cd}strategy and {sd,cd}close respectively.
For sd and cd devs, only open differs and the rest is the same.
No functional changes intended.
Suggested by tsutsui@ at port-x68k.
 1.7 26-Jun-2016  isaki Add SCSI host adaptor selector to "boot" command of /boot.
By this function, /boot which booted from non-SCSI
(in other words, floppy) can load SCSI kernel.
Now, single /boot can load kernel of all supported filesystems
of all supported boot devices.

---
New "boot" command's syntax is: boot [hostadaptor@][dev:][file]

If you booted from SCSI, hostadaptor is already set (from IOCS)
and you can omit hostadaptor in this case. You can type like
"boot sd0a:netbsd" as before.

If you booted from floppy (hostadaptor is not set) and want to
load the SCSI kernel (hostadaptor is needed), you have to select
your hostadaptor in boot command, like "boot spc0@sd0a:netbsd".
 1.6 12-Oct-2012  tsutsui branches: 1.6.14;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.5 18-Nov-2007  isaki branches: 1.5.52; 1.5.58; 1.5.62;
Correct filename in a comment.
 1.4 11-Nov-2007  isaki Style fix.
 1.3 15-Oct-2001  minoura branches: 1.3.4; 1.3.6; 1.3.38; 1.3.80; 1.3.98; 1.3.100; 1.3.104; 1.3.106;
Prepare to set WARNS=2.
 1.2 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.3.106.1 19-Nov-2007  mjf Sync with HEAD.
 1.3.104.2 18-Nov-2007  bouyer Sync with HEAD
 1.3.104.1 13-Nov-2007  bouyer Sync with HEAD
 1.3.100.1 09-Jan-2008  matt sync with HEAD
 1.3.98.2 21-Nov-2007  joerg Sync with HEAD.
 1.3.98.1 11-Nov-2007  joerg Sync with HEAD.
 1.3.80.1 03-Dec-2007  ad Sync with HEAD.
 1.3.38.2 07-Dec-2007  yamt sync with head
 1.3.38.1 15-Nov-2007  yamt sync with head.
 1.3.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.6.1 15-Oct-2001  thorpej file libx68k.h was added on branch kqueue on 2002-01-10 19:50:37 +0000
 1.3.4.2 15-Oct-2001  minoura Prepare to set WARNS=2.
 1.3.4.1 15-Oct-2001  minoura file libx68k.h was added on branch nathanw_sa on 2001-10-15 16:13:41 +0000
 1.5.62.2 03-Dec-2017  jdolecek update from HEAD
 1.5.62.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.58.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.5.52.1 30-Oct-2012  yamt sync with head
 1.6.14.1 09-Jul-2016  skrll Sync with HEAD
 1.4 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.3 31-May-2016  dholland PR 51194 David Binderman: simplify redundant conditional
 1.2 11-Nov-2007  isaki branches: 1.2.62; 1.2.82;
Style fix.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.38; 1.1.80; 1.1.98; 1.1.100; 1.1.104; 1.1.106;
libsa for the new bootloader of x68k port.
 1.1.106.1 19-Nov-2007  mjf Sync with HEAD.
 1.1.104.1 13-Nov-2007  bouyer Sync with HEAD
 1.1.100.1 09-Jan-2008  matt sync with HEAD
 1.1.98.1 11-Nov-2007  joerg Sync with HEAD.
 1.1.80.1 03-Dec-2007  ad Sync with HEAD.
 1.1.38.1 15-Nov-2007  yamt sync with head.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file parseutils.c was added on branch kqueue on 2002-01-10 19:50:37 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file parseutils.c was added on branch nathanw_sa on 2001-09-27 10:03:29 +0000
 1.2.82.1 09-Jul-2016  skrll Sync with HEAD
 1.2.62.1 03-Dec-2017  jdolecek update from HEAD
 1.5 25-Nov-2012  isaki Make the end of image address absolute-long.
It allows to locate the end of image higher than 0x10000.
 1.4 21-Feb-2011  itohy branches: 1.4.4; 1.4.14;
Cleanup my copyright notice.
 1.3 11-Dec-2005  christos branches: 1.3.100; 1.3.106; 1.3.108;
merge ktrace-lwp.
 1.2 04-Dec-2003  keihan netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.1 30-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.22;
Print daemon image on startup.
(any other missing features?)
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 30-Sep-2001  thorpej file putimage.S was added on branch kqueue on 2002-01-10 19:50:37 +0000
 1.1.4.2 30-Sep-2001  minoura Print daemon image on startup.
(any other missing features?)
 1.1.4.1 30-Sep-2001  minoura file putimage.S was added on branch nathanw_sa on 2001-09-30 15:54:39 +0000
 1.3.108.1 05-Mar-2011  bouyer Sync with HEAD
 1.3.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.100.1 05-Mar-2011  rmind sync with head
 1.4.14.1 25-Feb-2013  tls resync with head
 1.4.4.1 16-Jan-2013  yamt sync with (a bit old) head
 1.19 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.18 23-Jun-2022  isaki x68k/stand: Merge {sd,cd}strategy and {sd,cd}close respectively.
For sd and cd devs, only open differs and the rest is the same.
No functional changes intended.
Suggested by tsutsui@ at port-x68k.
 1.17 21-Jun-2022  isaki x68k/stand: Correct blocksize in case of CD.
- Fix calculation of the blocksize passes to SCSI IOCS.
- Use three kind of sector size (blocksize) properly; media's sector size,
DEV_BSIZE from xxstrategy, and Human68k's sector size.
By this change,
- For 512 bytes/sector HDD, no changes are intended.
- For CD, corrects the blocksize (%d5) passes to SCSI IOCS.
It has worked previously though the blocksize was incorrect. Now it
works with correct blocksize.
- As a secondary effect, 256 or 1024 bytes/sector media may work but not
well tested.
Reviewed by tsutsui@ at port-x68k.
 1.16 21-Jun-2022  isaki x68k/stand: Correct a condition expression.
- start is LBA but dblk is relative from this partition.
- The first term was wrong. It should be '(x & 0x1fffff) == x', but
it's more simple to use numerical comparison.
There would have been no impact.
 1.15 11-Feb-2014  tsutsui Specify default SCSI inquiry size (36 bytes) on IOCS_S_INQUIRY() command.

X680x0 SCSI IOCS stalls if SCSI device doesn't return inquiry data
of specified allocation length size on the INQUIRY command,
and it causes hangup on the XM6 based emulators that return only
upto 36 byte inquiry data on SCSI disk emulation.

Many real SCSI-2 hard drives seem to support >100 byte inquiry data,
but at least there is a harddisk that returns only supported inquiry
data size and quits transfer.

The bootloader checks only the device type and there is no reason
to read 100 bytes that includes vender specific data.

Analyzed and reported by GIMONS, a developer of XM6 TypeG emulator,
which also can run NetBSD/x68k.
 1.14 22-Nov-2012  tsutsui branches: 1.14.2;
Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.13 19-Jun-2012  minoura branches: 1.13.2;
Fix CD support (again!).
 1.12 20-Mar-2012  minoura Fix CD support.
 1.11 17-Jul-2011  joerg branches: 1.11.2; 1.11.6; 1.11.8;
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 09-Jul-2011  mrg don't assign sc->sc_partinfo.size to itself.
 1.9 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.8 18-Nov-2007  isaki branches: 1.8.40; 1.8.46;
Use the same prototypes as libx68k.h.
 1.7 11-Nov-2007  isaki Style fix.
 1.6 25-Jan-2006  christos branches: 1.6.28; 1.6.46; 1.6.48; 1.6.52; 1.6.54;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.5 07-Jan-2002  minoura branches: 1.5.2; 1.5.34; 1.5.46;
alloca() is now defined in libkern.h.
 1.4 15-Oct-2001  minoura branches: 1.4.4;
Prepare to set WARNS=2.
 1.3 15-Oct-2001  minoura set current_id properly.
 1.2 29-Sep-2001  minoura Implement ls command.
Correct bootdev detection.
Other minor changes.
 1.1 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.4.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.2 11-Jan-2002  nathanw More catchup.
 1.4.4.1 15-Oct-2001  nathanw file sdcd.c was added on branch nathanw_sa on 2002-01-11 23:38:47 +0000
 1.5.46.1 01-Feb-2006  yamt sync with head.
 1.5.34.3 07-Dec-2007  yamt sync with head
 1.5.34.2 15-Nov-2007  yamt sync with head.
 1.5.34.1 21-Jun-2006  yamt sync with head.
 1.5.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1 07-Jan-2002  thorpej file sdcd.c was added on branch kqueue on 2002-01-10 19:50:38 +0000
 1.6.54.1 19-Nov-2007  mjf Sync with HEAD.
 1.6.52.2 18-Nov-2007  bouyer Sync with HEAD
 1.6.52.1 13-Nov-2007  bouyer Sync with HEAD
 1.6.48.1 09-Jan-2008  matt sync with HEAD
 1.6.46.2 21-Nov-2007  joerg Sync with HEAD.
 1.6.46.1 11-Nov-2007  joerg Sync with HEAD.
 1.6.28.1 03-Dec-2007  ad Sync with HEAD.
 1.8.46.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.40.1 21-Apr-2011  rmind sync with head
 1.11.8.2 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.11.8.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.11.6.1 05-Apr-2012  mrg sync to latest -current.
 1.11.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.11.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.11.2.2 30-Oct-2012  yamt sync with head
 1.11.2.1 17-Apr-2012  yamt sync with head
 1.13.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.2.1 25-Feb-2013  tls resync with head
 1.14.2.1 18-May-2014  rmind sync with head
 1.2 11-Apr-2011  tsutsui Some KNF. No binary change.
 1.1 27-Sep-2001  minoura branches: 1.1.4; 1.1.6; 1.1.150; 1.1.156;
libsa for the new bootloader of x68k port.
 1.1.156.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.150.1 21-Apr-2011  rmind sync with head
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 27-Sep-2001  thorpej file sdcdvar.h was added on branch kqueue on 2002-01-10 19:50:38 +0000
 1.1.4.2 27-Sep-2001  minoura libsa for the new bootloader of x68k port.
 1.1.4.1 27-Sep-2001  minoura file sdcdvar.h was added on branch nathanw_sa on 2001-09-27 10:03:29 +0000
 1.20 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.19 23-Sep-2019  christos Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)
 1.18 10-Dec-2016  rin branches: 1.18.16;
Fix comment. We do not use the a.out format anymore...
 1.17 10-Dec-2016  rin Clear STRIPFLAG after include bsd.own.mk; it can be modified by mk.conf via
bsd.own.mk.
 1.16 21-Aug-2013  matt branches: 1.16.6; 1.16.10;
Use <bsd.klinks.mk>
 1.15 12-Aug-2013  joerg Build boot loaders without unwind tables.
 1.14 08-Feb-2012  joerg branches: 1.14.6; 1.14.10;
Don't depend on cat pages to be installed, just run mandoc here.
Also provide a HTML version for user of modern technology.
 1.13 13-Apr-2011  he branches: 1.13.4; 1.13.8;
Convert to using -nostdinc, and set include paths and create symlinks
so that we include the source tree's sys/, machine/ and m68k/ headers,
and only as a last resort use DESTDIR's /usr/include. For some reason
the host's bootinfo.h got included ahead of the x68k variant, causing
a build failure in my case.
 1.12 29-Jun-2006  lukem branches: 1.12.84; 1.12.90;
Support MAKEVERBOSE
 1.11 03-Jan-2003  lukem branches: 1.11.18; 1.11.32; 1.11.36; 1.11.44;
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.10 03-Nov-2002  isaki Place catman in RELEASEDIR/installation/misc.
 1.9 18-May-2002  isaki branches: 1.9.2;
Make ELF kernel loadable, by itohy-san.
 1.8 12-Dec-2001  tv branches: 1.8.8;
MKfoo=no -> NOfoo
 1.7 07-Dec-2001  minoura New target: release.
 1.6 14-Nov-2001  tv ${MAKE} print-objdir -> ${PRINTOBJDIR}
 1.5 12-Jun-2001  minoura branches: 1.5.2; 1.5.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.4 16-Mar-1999  minoura branches: 1.4.20;
Merged minoura_x68k_bus_h branch.
 1.3 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.2 20-Nov-1998  itohy branches: 1.2.4;
Moved the manual to share.
Added -L for libc.
Use `&&' instead of `;' for cd and print-objdir in order to avoid
infinite fork() if chdir failed.
 1.1 01-Sep-1998  itohy New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.2.4.1 14-Mar-1999  minoura Sync.
 1.4.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.8.5 07-Jan-2003  thorpej Sync with HEAD.
 1.5.8.4 11-Nov-2002  nathanw Catch up to -current
 1.5.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.5.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.8.1 12-Jun-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:48 +0000
 1.5.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.8.1 30-May-2002  gehenna Catch up with -current.
 1.9.2.1 12-Dec-2002  he Pull up revision 1.10 (requested by isaki in ticket #1010):
Place loadbsd manual page in RELEASEDIR/installation/misc.
 1.11.44.1 13-Jul-2006  gdamore Merge from HEAD.
 1.11.36.1 11-Aug-2006  yamt sync with head
 1.11.32.1 09-Sep-2006  rpaulo sync with head
 1.11.18.1 30-Dec-2006  yamt sync with head.
 1.12.90.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.84.1 21-Apr-2011  rmind sync with head
 1.13.8.1 18-Feb-2012  mrg merge to -current.
 1.13.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.13.4.1 17-Apr-2012  yamt sync with head
 1.14.10.1 28-Aug-2013  rmind sync with head
 1.14.6.2 03-Dec-2017  jdolecek update from HEAD
 1.14.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.16.6.1 05-Feb-2017  skrll Sync with HEAD
 1.18.16.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 20-Nov-1998  itohy Moved the manual to share.
Added -L for libc.
Use `&&' instead of `;' for cd and print-objdir in order to avoid
infinite fork() if chdir failed.
 1.1 01-Sep-1998  itohy New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.16 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.15 23-Dec-2023  andvar update usage() and usage comment with missing options.
 1.14 21-Feb-2011  itohy Cleanup my copyright notice.
 1.13 18-Mar-2009  cegger branches: 1.13.4; 1.13.6; 1.13.8;
Ansify function definitions w/o arguments. Generated with sed.
 1.12 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 24-Dec-2005  perry branches: 1.9.78; 1.9.86; 1.9.92;
bare asm -> __asm
 1.8 18-May-2002  isaki branches: 1.8.24;
Make ELF kernel loadable, by itohy-san.
 1.7 12-Jun-2001  minoura branches: 1.7.2; 1.7.8; 1.7.16;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.6 24-Sep-2000  jdolecek branches: 1.6.2;
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.5 29-Jul-2000  jdolecek g/c RB_DFLTROOT

I've tried hard to find also various usage() messages and remove the
appropriate flag from there as well, hopefully all occurences are covered.
 1.4 23-Sep-1999  minoura branches: 1.4.2; 1.4.12;
First step toward network boot.
By Takeshi Nakayama <tn@catvmics.ne.jp>.
 1.3 29-Jul-1999  itohy Fix typo in comment.
 1.2 30-Apr-1999  minoura Branch address was wrong.
 1.1 01-Sep-1998  itohy branches: 1.1.8;
New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.1.8.1 30-Apr-1999  perry branches: 1.1.8.1.2;
pullup 1..1->1.2 (minoura)
 1.1.8.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.1.8.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.12.1 13-Aug-2000  jdolecek pullup from trunk (approved by thorpej):
retire RB_DFLTROOT, it's no longer used

revisions pulled up:
arch/i386/stand/lib/netbsd_opts.c 1.3
arch/i386/stand/biosboot/main.c 1.23
arch/i386/stand/dosboot/main.c 1.15
arch/i386/stand/netboot/main.c 1.6
arch/arc/arc/machdep.c 1.42
arch/bebox/stand/boot/boot.c 1.11
arch/hpcmips/hpcmips/machdep.c 1.32
arch/newsmips/newsmips/machdep.c 1.45
arch/pc532/stand/boot/boot.c 1.2
arch/pmax/pmax/machdep.c 1.178
arch/prep/stand/boot/boot.c 1.2
arch/sparc/sparc/autoconf.c 1.141
arch/sparc64/sparc64/autoconf.c 1.38
arch/x68k/stand/loadbsd/loadbsd.c 1.5
arch/mvme68k/stand/libsa/parse_args.c 1.6
compat/osf1/osf1_cvt.c 1.9
sys/reboot.h 1.17
 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.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.16.1 30-May-2002  gehenna Catch up with -current.
 1.7.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.7.8.1 12-Jun-2001  nathanw file loadbsd.c was added on branch nathanw_sa on 2002-06-20 03:42:36 +0000
 1.7.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.24.1 21-Jun-2006  yamt sync with head.
 1.9.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.78.1 04-May-2009  yamt sync with head.
 1.13.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 05-Mar-2011  rmind sync with head
 1.3 21-Feb-2011  itohy Cleanup my copyright notice.
 1.2 12-Jun-2001  minoura branches: 1.2.8; 1.2.152; 1.2.158; 1.2.160;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.160.1 05-Mar-2011  bouyer Sync with HEAD
 1.2.158.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.152.1 05-Mar-2011  rmind sync with head
 1.2.8.2 12-Jun-2001  minoura Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.2.8.1 12-Jun-2001  minoura file trampoline.S was added on branch nathanw_sa on 2001-06-12 16:57:29 +0000
 1.2 21-Feb-2011  itohy Cleanup my copyright notice.
 1.1 01-Sep-1998  itohy branches: 1.1.176; 1.1.182; 1.1.184;
New boot program.
Load and execute NetBSD/x68k kernel from Human68k.
 1.1.184.1 05-Mar-2011  bouyer Sync with HEAD
 1.1.182.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.176.1 05-Mar-2011  rmind sync with head
 1.20 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.19 10-Aug-2020  rin Make x68k/stand compile with GCC8. Tested with XEiJ.
 1.18 01-Feb-2020  isaki Make it output 68000 binary.
CFLAGS already has -m68000 but AFLAGS didn't.

This change makes it proceed to next stage1 even if MPU is 68000.
All stage1 bootloader displays an error message if MPU is 68000.
 1.17 08-Aug-2014  isaki branches: 1.17.28; 1.17.34;
Remove STRIP?=strip.
Falling back to the hosttool is not a good way now.
 1.16 05-Apr-2012  isaki branches: 1.16.2; 1.16.12;
Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
 1.15 12-Jan-2009  tsutsui branches: 1.15.14; 1.15.18; 1.15.20;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.14 29-Jun-2006  lukem branches: 1.14.58; 1.14.62; 1.14.70;
Support MAKEVERBOSE
 1.13 29-Jun-2006  lukem Rename LDFLAGS to LINKFLAGS, as the former is for CC not LD.
 1.12 11-Dec-2005  christos branches: 1.12.4; 1.12.8; 1.12.16;
merge ktrace-lwp.
 1.11 08-Oct-2003  simonb branches: 1.11.16;
Add -D_STANDALONE to CPPFLAGS.
 1.10 05-May-2002  isaki branches: 1.10.10;
libsa/Makefile: Fix rules to create symlinks on read-only source tree.
{boot,libsa,mboot}/Makefile, Makefile.booters:
move that common rule to Makefile.booters
 1.9 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.8 22-Sep-2001  tv branches: 1.8.4;
objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.7 12-Jun-2001  minoura branches: 1.7.2; 1.7.4;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.6 26-Jan-2001  minoura branches: 1.6.2;
Use IOCS_S_READEXT only when reading the partition boot from
higher part of the disk than 0x200000.
 1.5 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.4 23-Jan-2000  mycroft Clean up the machine symlink stuff ever so slightly. Needs to be
standardized between files.
 1.3 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.2 24-Dec-1999  minoura Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.1 04-Jul-1999  minoura branches: 1.1.2;
SCSI primary boot program and its installer.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.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.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.4.1 01-Oct-2001  fvdl Catch up with -current.
 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.3 20-Jun-2002  nathanw Catch up to -current.
 1.8.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.4.1 22-Sep-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:49 +0000
 1.10.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.10.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.1 30-Dec-2006  yamt sync with head.
 1.12.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.12.8.1 11-Aug-2006  yamt sync with head
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.14.70.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.62.1 04-May-2009  yamt sync with head.
 1.14.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.20.1 09-Apr-2012  riz Pull up following revision(s) (requested by isaki in ticket #171):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.10
sys/arch/x68k/stand/mboot/Makefile: revision 1.16
sys/arch/x68k/stand/Makefile: revision 1.9
Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
mboot now depends on libiocs. noticed by tsutsui@.
 1.15.18.1 05-Apr-2012  mrg sync to latest -current.
 1.15.14.1 17-Apr-2012  yamt sync with head
 1.16.12.1 10-Aug-2014  tls Rebase.
 1.16.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.34.1 29-Feb-2020  ad Sync with head.
 1.17.28.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.12 06-Apr-2012  isaki Oops, One more message.
 1.11 06-Apr-2012  isaki Print my progname in error messages.
It makes easy to find who displayed it.
 1.10 05-Apr-2012  isaki Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
 1.9 01-Oct-2011  chs branches: 1.9.2; 1.9.6; 1.9.8;
fix build errors with gcc 4.5.
 1.8 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.7 12-Jan-2009  tsutsui branches: 1.7.2;
- WARNSfy
- make sure machine and ${MACHIN_ARCH} symlinks are always created
- several tweaks to allow build without installed DESTDIR
 1.6 28-Apr-2008  martin branches: 1.6.8;
Remove clause 3 and 4 from TNF licenses
 1.5 24-Dec-2005  perry branches: 1.5.74; 1.5.76; 1.5.78;
bare asm -> __asm
 1.4 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.3 12-Jun-2001  minoura branches: 1.3.8; 1.3.40;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.2 26-Jan-2001  minoura branches: 1.2.2;
Use IOCS_S_READEXT only when reading the partition boot from
higher part of the disk than 0x200000.
 1.1 04-Jul-1999  minoura branches: 1.1.2;
SCSI primary boot program and its installer.
 1.1.2.1 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.40.1 21-Jun-2006  yamt sync with head.
 1.3.8.2 12-Jun-2001  minoura Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.3.8.1 12-Jun-2001  minoura file mboot.c was added on branch nathanw_sa on 2001-06-12 16:57:29 +0000
 1.5.78.2 04-May-2009  yamt sync with head.
 1.5.78.1 16-May-2008  yamt sync with head.
 1.5.76.1 18-May-2008  yamt sync with head.
 1.5.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.5.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.6.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.8.2 09-Apr-2012  riz Pull up following revision(s) (requested by isaki in ticket #172):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.11
sys/arch/x68k/stand/mboot/mboot.c: revision 1.12
Print my progname in error messages.
It makes easy to find who displayed it.
Oops, One more message.
 1.9.8.1 09-Apr-2012  riz Pull up following revision(s) (requested by isaki in ticket #171):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.10
sys/arch/x68k/stand/mboot/Makefile: revision 1.16
sys/arch/x68k/stand/Makefile: revision 1.9
Use common library libiocs.a. suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
its expansion corrupted (from somewhere after branching netbsd-5).
This solves PR#46293 by using the common library.
This problem was reported by Y.Sugahara at NetBSD booth at
Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
mboot now depends on libiocs. noticed by tsutsui@.
 1.9.6.2 29-Apr-2012  mrg sync to latest -current.
 1.9.6.1 05-Apr-2012  mrg sync to latest -current.
 1.9.2.1 17-Apr-2012  yamt sync with head
 1.2 24-Dec-1999  minoura Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.1 04-Jul-1999  minoura branches: 1.1.2;
SCSI primary boot program and its installer.
 1.1.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.4 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 12-Jun-2001  minoura branches: 1.2.8; 1.2.126; 1.2.128; 1.2.130;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 04-Jul-1999  minoura branches: 1.1.14;
SCSI primary boot program and its installer.
 1.1.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.130.1 16-May-2008  yamt sync with head.
 1.2.128.1 18-May-2008  yamt sync with head.
 1.2.126.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.8.2 12-Jun-2001  minoura Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.2.8.1 12-Jun-2001  minoura file srt0.S was added on branch nathanw_sa on 2001-06-12 16:57:29 +0000
 1.7 25-Jun-2016  isaki branches: 1.7.16;
Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.6 08-Aug-2014  isaki branches: 1.6.4;
Remove STRIP?=strip.
Falling back to the hosttool is not a good way now.
 1.5 06-Aug-2014  isaki Remove unused variable.
 1.4 05-Aug-2014  isaki Support a 'switch' command.
It displays/modifies some SRAM parameters on X680x0, like as
memswitch(1) or Human68k's SWITCH.X .
It makes easy to change the boot devices or correct the inconsistency
of SRAM/real memory size.

sample usage:
> switch show .. show all supported parameters
> switch boot=std .. set boot order to 'STD'
> switch memory=12 .. set memory size to 12MB
 1.3 06-Jul-2014  tsutsui Merge and share boot.c between normal boot and netboot by dumb #ifdefs.

Tested on XM6i.
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.12;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.12.1 10-Aug-2014  tls Rebase.
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:21 +0000
 1.6.4.1 09-Jul-2016  skrll Sync with HEAD
 1.7.16.2 03-Dec-2017  jdolecek update from HEAD
 1.7.16.1 25-Jun-2016  jdolecek file Makefile was added on branch tls-maxphys on 2017-12-03 11:36:49 +0000
 1.4 06-Jul-2014  tsutsui Merge and share boot.c between normal boot and netboot by dumb #ifdefs.

Tested on XM6i.
 1.3 06-Jul-2014  tsutsui Reduce diffs to prepare to merge these files.
 1.2 01-Nov-2012  isaki branches: 1.2.2; 1.2.12;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file boot.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.12.1 10-Aug-2014  tls Rebase.
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file boot.c was added on branch netbsd-6 on 2012-11-18 19:05:21 +0000
 1.4 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.3 13-Jan-2013  tsutsui branches: 1.3.14;
Remove unnecessary struct open_file files[] leftover.
It's in libsa/files.c.
 1.2 01-Nov-2012  isaki branches: 1.2.2;
Remove my local RCS IDs.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.2.4 23-Jan-2013  yamt sync with head
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file conf.c was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 01-Nov-2012  riz file conf.c was added on branch netbsd-6 on 2012-11-18 19:05:21 +0000
 1.3.14.1 09-Jul-2016  skrll Sync with HEAD
 1.3 25-Jun-2016  isaki Unify netboot and boot (into boot).
Now boot becomes to be able to load the NFS kernel and
netboot also becomes to be able to load the local kernel.
The only difference is the default kernel which loads.
I.e., netboot's default is nfs.

Bump boot_ustar's BOOT_MAXSIZE.
 1.2 17-Jan-2016  tsutsui Enable LIBSA_CREAD_NOCRC. PR/50638

Bump version to denote user visible change.
XXX: recent visible changes (memsize probe, SRAM switch command)
were not denoted in versions
Tested on (real) X68030.
 1.1 12-Oct-2012  tsutsui branches: 1.1.2; 1.1.4; 1.1.18;
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.

Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.

Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
 1.1.18.2 09-Jul-2016  skrll Sync with HEAD
 1.1.18.1 19-Mar-2016  skrll Sync with HEAD
 1.1.4.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.4.1 12-Oct-2012  riz file version was added on branch netbsd-6 on 2012-11-18 19:05:21 +0000
 1.1.2.2 30-Oct-2012  yamt sync with head
 1.1.2.1 12-Oct-2012  yamt file version was added on branch yamt-pagecache on 2012-10-30 17:20:31 +0000
 1.3 04-May-2011  tsutsui WARNSfy to avoid further botch.
 1.2 12-Dec-2001  tv branches: 1.2.144; 1.2.150;
MKfoo=no -> NOfoo
 1.1 24-Dec-1999  minoura branches: 1.1.6; 1.1.10; 1.1.14;
Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.1.14.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 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 24-Dec-1999  bouyer file Makefile was added on branch thorpej_scsipi on 2000-11-20 20:30:18 +0000
 1.2.150.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.144.1 31-May-2011  rmind sync with head
 1.11 26-Mar-2014  christos kill sprintf, fix unused.
 1.10 23-Jun-2012  minoura branches: 1.10.2; 1.10.4;
Change to the 2-clauses license.
 1.9 04-May-2011  tsutsui branches: 1.9.4; 1.9.10;
WARNSfy to avoid further botch.
 1.8 29-Apr-2011  isaki Add a missing printf argument..
 1.7 29-Apr-2011  isaki - use getprogname() instead of argv[0]
- remove an extra decl. of optind
 1.6 29-Apr-2011  isaki Fix indent and style.
 1.5 14-Mar-2009  dsl branches: 1.5.4; 1.5.6;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 04-Aug-2006  mhitch branches: 1.3.62; 1.3.70; 1.3.76;
gcc4 fix: change prototype and definition of volatile void usage().
 1.2 08-Dec-2001  minoura branches: 1.2.32; 1.2.46; 1.2.50;
Add -p option to suppress creating the partition table.
 1.1 24-Dec-1999  minoura branches: 1.1.6; 1.1.10; 1.1.14;
Replace shell script version of newdisk utility with C version.
Add the man page newdisk(8).
 1.1.14.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 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 24-Dec-1999  bouyer file newdisk.c was added on branch thorpej_scsipi on 2000-11-20 20:30:19 +0000
 1.2.50.1 11-Aug-2006  yamt sync with head
 1.2.46.1 09-Sep-2006  rpaulo sync with head
 1.2.32.1 30-Dec-2006  yamt sync with head.
 1.3.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.62.1 04-May-2009  yamt sync with head.
 1.5.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.4.1 31-May-2011  rmind sync with head
 1.9.10.1 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.9.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.9.4.1 30-Oct-2012  yamt sync with head
 1.10.4.1 18-May-2014  rmind sync with head
 1.10.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17 16-Aug-2020  isaki Replace boot_ustar with xxboot_ustarfs.
The old boot_ustar had many hard coding and was small(<1KB).
The new xxboot_ustarfs is a part of integrated larger(<8KB) xxboot.
We had to maintain three similar but not the same bootloaders, but
now we have two!
 1.16 14-Aug-2020  isaki Style fixes. One entry per line for some parts.
 1.15 20-Mar-2012  minoura branches: 1.15.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.14 27-Jan-2002  minoura branches: 1.14.100;
Remove obsolete xxboot.
 1.13 07-Jan-2002  minoura New toolchain.
XXX: New toolchain generates 100byte bigger object than the 8KB limit.
XXX: Therefore, compilation always fails!
 1.12 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.11 02-Dec-2001  minoura .include <bsd.own.mk> for OBJECT_FMT.
 1.10 29-Sep-2001  minoura branches: 1.10.4;
Make this compile with the new toolchain.
 1.9 22-Sep-2001  tv objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.8 12-Jun-2001  minoura branches: 1.8.2; 1.8.4;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.7 01-Feb-2000  tsutsui branches: 1.7.6;
Revert STRIPPROG -> STRIP
 1.6 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.5 28-Mar-1999  minoura branches: 1.5.8;
Fixed the bug described in the previous commit log.
Re-enabled the title image.
 1.4 27-Mar-1999  minoura Work around for broken unzip routine.
Transition to egcs seems to have broken the trickily hacked inflate routine.
Disable the hack and size-consuming title image for a while.
 1.3 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.2 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 01-Sep-1998  itohy branches: 1.1.6;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.6.1 14-Mar-1999  minoura Sync.
 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.7.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.8.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.8.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.10.4.3 11-Jan-2002  nathanw More catchup.
 1.10.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.10.4.1 29-Sep-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:50 +0000
 1.14.100.1 17-Apr-2012  yamt sync with head
 1.15.4.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.15.4.1 20-Mar-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:18 +0000
 1.21 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.20 25-Apr-2022  mlelstv libsa now needs ioctl to support media with large sectors. Provide
missing functions.

libsa defines files[] array itself, just reference it.
This also adds another global variable that tracks the root
filesystem module.
 1.19 04-Feb-2022  isaki Add missing -m68020-60 option. This makes xxboot_ustarfs work even on 68060.
Problem reported by Makoto Kamada. Confirmed on XEiJ (68060 mode).
 1.18 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.17 14-Aug-2020  isaki Reduce binary size as possible. These reduce filesize about 20 words.
- Use word alignment (rather than longword alignment) for text/data section.
- Use short reference. In the bootloader, all symbols can be expressed in
short.
 1.16 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.15 14-Aug-2020  isaki Style fixes. One entry per line for some parts.
 1.14 14-Aug-2020  isaki - Restore display of first_kbyte. This is helpful for development.
- Check the filesize of resulting file instead of section sizes.
If there is a gap between sections, the filesize may be exceeded even
though the section total is not exceeded. Of course that doesn't
usually happen but I've experienced this during development.
 1.13 10-Aug-2020  rin Make x68k/stand compile with GCC8. Tested with XEiJ.
 1.12 28-Jan-2020  isaki Set heap area explicitly.
Until the load address was moved, the heap was placed at _end (it's default)
and it was large space. After moving, this default space was too small.
 1.11 18-Jan-2020  isaki Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.
 1.10 18-Jan-2020  isaki Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.
 1.9 18-Jan-2020  isaki Change primary bootloader's load address from 0x0f0000 to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+ffffffffffff8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
text+data+bss 12KB or less. Current actual size is 5~7KB.
I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea. Even in this
case, this change limits text+data+bss 12KB or less (currently, it's
about 6KB). However, I take breaking the builds on errors rather than
future size limitation.
There is no user visible changes or interface changes.
 1.8 18-Jan-2020  isaki Add 0x prefix when defining variables, not when using it.
This was necessary for bc(1) but it's no longer necessary.
 1.7 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.6 16-Jan-2020  isaki Rewrite limit check using cross-build tools.
This eliminates use of hosts tr(1) and bc(1).
(But I'm going to remove this again soon due to other reason)
 1.5 16-Jan-2020  isaki Remove .else part of .if OBJECT_FMT == ELF.
All similar parts in other Makefiles are removed in 2010.
 1.4 08-Apr-2017  christos branches: 1.4.14; 1.4.20;
centralize vers.c building for standalone programs.
 1.3 08-Aug-2014  isaki branches: 1.3.4; 1.3.8; 1.3.12;
Remove OBJCOPY?=objcopy.
Falling back to the hosttool is not a good way now.
 1.2 12-Aug-2013  joerg branches: 1.2.2;
Build boot loaders without unwind tables.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.8.1 28-Aug-2013  rmind sync with head
 1.1.6.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.6.1 20-Mar-2012  riz file Makefile.xxboot was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.1.4.2 03-Dec-2017  jdolecek update from HEAD
 1.1.4.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 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 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile.xxboot was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.3.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.3.8.1 26-Apr-2017  pgoyette Sync with HEAD
 1.3.4.1 28-Aug-2017  skrll Sync with HEAD
 1.4.20.3 29-Feb-2020  ad Sync with head.
 1.4.20.2 25-Jan-2020  ad Sync with head.
 1.4.20.1 17-Jan-2020  ad Sync with head.
 1.4.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.3 22-Aug-2020  isaki Minor improvement.
add/addx is faster and the size remains the same.
 1.2 22-Aug-2020  isaki typo in comment.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.13 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.12 28-Jan-2020  isaki Set heap area explicitly.
Until the load address was moved, the heap was placed at _end (it's default)
and it was large space. After moving, this default space was too small.
 1.11 28-Jan-2020  isaki Revert placing .bss right after .data, and make .bss fixed at 0x5000.
.bss placed right after .data was overwritten when first 1KB loads full
.text+.data.
 1.10 28-Jan-2020  isaki Use __bss_start rather than edata to point the beginning of .bss.
Currently the .bss is placed right after .data. In that case, edata
points to the beginning of .bss so that there is no visible changes at
least currently.
 1.9 18-Jan-2020  isaki Change primary bootloader's load address from 0x0f0000 to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+ffffffffffff8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
text+data+bss 12KB or less. Current actual size is 5~7KB.
I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea. Even in this
case, this change limits text+data+bss 12KB or less (currently, it's
about 6KB). However, I take breaking the builds on errors rather than
future size limitation.
There is no user visible changes or interface changes.
 1.8 18-Jan-2020  isaki Typo in comment. s/availble/available/
 1.7 18-Jan-2020  isaki Add comment and figure of address map.
 1.6 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.5 16-Jan-2020  isaki Use .org directive to fix disklabel location instead of hand calculation.
If the code size before disklabel is less, zero is filled automatically.
If the code size before disklabel is exceeded, assembler stops with error.
Note that this changes a padding word in the current output binary from
a NOP instruction to zero but there are no functional changes.
 1.4 13-Jan-2020  isaki Typo in comment. s/LABELLOFFSET/LABELOFFSET/
 1.3 17-Nov-2012  tsutsui branches: 1.3.2; 1.3.40; 1.3.46;
Use a correct function name in .globl decl.
 1.2 17-Nov-2012  tsutsui Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file boot.S was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.3.46.3 29-Feb-2020  ad Sync with head.
 1.3.46.2 25-Jan-2020  ad Sync with head.
 1.3.46.1 17-Jan-2020  ad Sync with head.
 1.3.40.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.3.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.3.2.1 17-Nov-2012  riz file boot.S was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.9 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.8 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.7 14-Aug-2020  isaki Use DEV_OPEN() macro.
 1.6 14-Aug-2020  isaki Add xxboot.h common header to share prototype definitions.
 1.5 14-Aug-2020  isaki Make compilable even with XXBOOT_DEBUG.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.
 1.2 17-Nov-2012  tsutsui - fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file bootmain.c was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file bootmain.c was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.4 27-Jan-2002  minoura Remove obsolete xxboot.
 1.3 07-Jan-2002  minoura Copy alloca() and memcpy() definitions from libkern.h.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.2 11-Jan-2002  nathanw More catchup.
 1.2.8.1 12-Jun-2001  nathanw file bootufs.c was added on branch nathanw_sa on 2002-01-11 23:38:48 +0000
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3 27-Jan-2002  minoura Remove obsolete xxboot.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 12-Jun-2001  nathanw file chkfmt.s was added on branch nathanw_sa on 2002-02-28 04:12:39 +0000
 1.2.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.6;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.6.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.6.1 20-Mar-2012  riz file conf.c was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file conf.c was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.6;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.6.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.6.1 20-Mar-2012  riz file consio1.c was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file consio1.c was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.3 27-Jan-2002  minoura Remove obsolete xxboot.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 12-Jun-2001  nathanw file iocscall.h was added on branch nathanw_sa on 2002-02-28 04:12:39 +0000
 1.2.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.2 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.4 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.3 18-Jan-2020  isaki Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
expects the screen to be initialized to display logo.
To keep messages (like version signature) displayed by primary bootloader,
this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030. This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).
 1.2 17-Nov-2012  tsutsui branches: 1.2.2; 1.2.40; 1.2.46;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file version was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2.46.1 25-Jan-2020  ad Sync with head.
 1.2.40.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 17-Nov-2012  riz file version was added on branch netbsd-6 on 2012-11-18 19:05:18 +0000
 1.5 25-Apr-2022  mlelstv libsa now needs ioctl to support media with large sectors. Provide
missing functions.

libsa defines files[] array itself, just reference it.
This also adds another global variable that tracks the root
filesystem module.
 1.4 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.3 14-Aug-2020  isaki Add xxboot.h common header to share prototype definitions.
 1.2 17-Nov-2012  tsutsui branches: 1.2.2;
- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file xx.c was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 17-Nov-2012  riz file xx.c was added on branch netbsd-6 on 2012-11-18 19:05:16 +0000
 1.3 27-Jan-2002  minoura Remove obsolete xxboot.
 1.2 12-Jun-2001  minoura branches: 1.2.2; 1.2.8;
Another steps for ELF.
- register prefix
- machine/asm.h
- deprecated -T option for ld(1)
 1.1 01-Sep-1998  itohy branches: 1.1.26;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.8.1 12-Jun-2001  nathanw file xxboot.S was added on branch nathanw_sa on 2002-02-28 04:12:39 +0000
 1.2.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.4 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.3 14-Aug-2020  isaki Add xxboot.h common header to share prototype definitions.
 1.2 27-Jan-2002  minoura Remove obsolete xxboot.
 1.1 01-Sep-1998  itohy branches: 1.1.28; 1.1.32;
NetBSD/x68k boot loader. The xxboot now can boot NetBSD from
1. >1GB SCSI disks,
2. any of the top 7 partitions on disks, and
3. any SCSI interface.
 1.1.32.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.28.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.10 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.9 14-Aug-2020  isaki Reduce binary size as possible. These reduce filesize about 20 words.
- Use word alignment (rather than longword alignment) for text/data section.
- Use short reference. In the bootloader, all symbols can be expressed in
short.
 1.8 14-Aug-2020  isaki - Restore display of first_kbyte. This is helpful for development.
- Check the filesize of resulting file instead of section sizes.
If there is a gap between sections, the filesize may be exceeded even
though the section total is not exceeded. Of course that doesn't
usually happen but I've experienced this during development.
 1.7 28-Jan-2020  isaki Revert placing .bss right after .data, and make .bss fixed at 0x5000.
.bss placed right after .data was overwritten when first 1KB loads full
.text+.data.
 1.6 18-Jan-2020  isaki Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.
 1.5 18-Jan-2020  isaki Make .bss follows .data to detect size restriction easier.
Previously, if text+data exceeds the restricted size, it will conflict
with manually fixed .bss area and ldscript makes it an error.
By this change, ASSERT() can detect it.
 1.4 18-Jan-2020  isaki Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.
 1.3 18-Jan-2020  isaki Remove commented out ALIGN() operation.
It looks unnecessary and has never been used.
 1.2 18-Jan-2020  isaki Pass address constants from Makefile to ldscript.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.6; 1.1.44; 1.1.50;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.50.2 29-Feb-2020  ad Sync with head.
 1.1.50.1 25-Jan-2020  ad Sync with head.
 1.1.44.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1.6.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.1.6.1 20-Mar-2012  riz file xxboot.ldscript was added on branch netbsd-6 on 2012-11-18 19:05:17 +0000
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file xxboot.ldscript was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.3 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.2 17-Nov-2012  tsutsui branches: 1.2.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:03 +0000
 1.2.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.2.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.2.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:23 +0000
 1.1 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.6 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.5 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Fix previous; no need to echo dummy command.
 1.2 17-Nov-2012  tsutsui Appease warning "nbmake: ${TOUCHPROG} expands to empty string".
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:04 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:16 +0000
 1.6 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.5 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Fix previous; no need to echo dummy command.
 1.2 17-Nov-2012  tsutsui Appease warning "nbmake: ${TOUCHPROG} expands to empty string".
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:04 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:23 +0000
 1.6 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.5 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Fix previous; no need to echo dummy command.
 1.2 17-Nov-2012  tsutsui Appease warning "nbmake: ${TOUCHPROG} expands to empty string".
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:04 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:22 +0000
 1.6 16-Aug-2020  isaki Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
 1.5 14-Aug-2020  isaki Use fixed 'xx' instead of DEV and DEVDRV for simplicity.
There is no choice other than xx for now.
 1.4 17-Nov-2012  tsutsui branches: 1.4.2;
Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.
 1.3 17-Nov-2012  tsutsui Fix previous; no need to echo dummy command.
 1.2 17-Nov-2012  tsutsui Appease warning "nbmake: ${TOUCHPROG} expands to empty string".
 1.1 20-Mar-2012  minoura branches: 1.1.2; 1.1.4;
Initial support for xxboot (cdboot_cd9660, specifically).
 1.1.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 20-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:07:04 +0000
 1.4.2.3 24-Nov-2012  jdc Pull up revisions:
src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
src/sys/arch/x68k/stand/boot/ne.c revision 1.2
src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
src/sys/arch/x68k/stand/xxboot/version revision 1.2
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
the first entry of root directory if specified path is empty.
Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.
 1.4.2.2 18-Nov-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #645):
sys/arch/x68k/stand/newdisk/newdisk.c: revision 1.10
sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile: revision 1.1
sys/arch/x68k/stand/xxboot/xx.c: revision 1.1
sys/arch/x68k/stand/Makefile: revision 1.10
sys/arch/x68k/stand/Makefile: revision 1.11
sys/arch/x68k/stand/boot/conf.c: revision 1.9
sys/arch/x68k/stand/Makefile: revision 1.12
sys/arch/x68k/stand/Makefile: revision 1.13
sys/arch/x68k/include/loadfile_machdep.h: revision 1.7
sys/arch/x68k/stand/xxboot/consio1.c: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.12
sys/arch/x68k/stand/libsa/libx68k.h: revision 1.6
sys/arch/x68k/stand/boot/ne.c: revision 1.1
sys/arch/x68k/stand/xxboot/boot.S: revision 1.1
sys/arch/x68k/stand/libsa/sdcd.c: revision 1.13
sys/arch/x68k/stand/netboot/boot.c: revision 1.1
sys/arch/x68k/stand/libsa/devopen.c: revision 1.6
sys/arch/x68k/stand/libsa/clock.c: revision 1.1
sys/arch/x68k/stand/boot/ne.h: revision 1.1
sys/arch/x68k/stand/netboot/conf.c: revision 1.1
sys/arch/x68k/stand/boot/version: revision 1.5
sys/arch/x68k/stand/boot/version: revision 1.6
sys/arch/x68k/stand/netboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile.xxboot: revision 1.1
sys/arch/x68k/stand/boot/if_ne.c: revision 1.1
sys/arch/x68k/stand/boot/dp8390.h: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile: revision 1.1
sys/arch/x68k/stand/boot/dp8390.c: revision 1.1
sys/arch/x68k/stand/xxboot/bootmain.c: revision 1.1
sys/arch/x68k/stand/installboot/installboot.c: revision 1.6
sys/arch/x68k/stand/xxboot/conf.c: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/Makefile.inc: revision 1.2
distrib/sets/lists/base/md.x68k: revision 1.44
sys/arch/x68k/stand/boot/conf.c: revision 1.10
sys/arch/x68k/stand/boot/boot.ldscript: revision 1.3
distrib/sets/lists/base/md.x68k: revision 1.45
sys/arch/x68k/stand/xxboot/xxboot.ldscript: revision 1.1
sys/arch/x68k/stand/xxboot/Makefile: revision 1.15
sys/arch/x68k/stand/libsa/Makefile: revision 1.29
sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile: revision 1.1
sys/arch/x68k/stand/netboot/Makefile: revision 1.1
sys/arch/x68k/stand/libsa/consio.c: revision 1.10
sys/arch/x68k/stand/xxboot/version: revision 1.1
sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile: revision 1.1
Comment fix.
Add FFSv2 support.
Fix CD support.
Initial support for xxboot (cdboot_cd9660, specifically).
Add xxboot (stage1) support.
put library first.
Fix CD support (again!).
Descend to xxboot.
Add xxboot_?fsv?.
Change to the 2-clauses license.
Tweak SUBDIR build order and add comments about each dir.
Fix a bug in check_getchar() (called from awaitkey_1sec()).
It didn't clear input key data when non ASCII keys (CTRL, OPT.1 etc)
were pressed so it couldn't detect further key inputs and
"any other key for boot menu" interrupt during boot didn't work
in that case.
The problem was tracked by Y.Sugahara,
and tested on X68030 and XM6i by me.
Bump version to denote check_getchar() bug fix.
First cut at x68k network bootloader via NE2000 on Neptune-X and Nereid.
Written by isaki@ back in 2003 based on x86's NE2000 netboot, and
misc debug and improvements by tsutsui@ and Y.Sugahara.
Tested on XM6i (emulating Nereid Ethernet) and X68030 + Neptune-X by me,
also on X68030 + Nereid and X68000 PRO-II + Xellent30 + Nereid by isaki@.
Note:
- X680x0 IPLROM doesn't support bootstrap from Neptune-X or Nereid,
so this network bootloader needs to be loaded from floppy or harddisk.
- Currently netboot support is not merged into the secondary Multi-boot
(/usr/mdec/boot) due to size restriction.
- Primary loaders assumes that the secondary bootloader name is /boot,
so /usr/mdec/netboot needs to be installed as /boot into the target
bootstrap device.
Add new /usr/mdec/netboot.
Check lp->d_npartitions before calling dkcksum()
(which is in src/sbin/disklabel/dkcksum.c) because
it doesn't check range and could cause coredump during
installboot against floppy that includes garbage in LABELSECTOR.
 1.4.2.1 17-Nov-2012  riz file Makefile was added on branch netbsd-6 on 2012-11-18 19:05:22 +0000
 1.2 19-Nov-2011  isaki Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.206;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.206.1 17-Apr-2012  yamt sync with head
 1.4 19-May-2011  tsutsui Set WARNS in common Makefile.inc.
 1.3 15-Jun-1996  oki branches: 1.3.192; 1.3.198;
deleted invalid MANDIR line.
 1.2 14-Jun-1996  oki change BINDIR /usr/local/bin --> /usr/bin
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.4;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.4.2 15-Jun-1996  oki from trunk: deleted invalid MANDIR line.
 1.1.1.1.4.1 14-Jun-1996  oki from trunk: change BINDIR /usr/local/bin --> /usr/bin
 1.3.198.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.192.1 31-May-2011  rmind sync with head
 1.10 19-May-2011  tsutsui Set WARNS in common Makefile.inc.
 1.9 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.8 12-Dec-2001  tv branches: 1.8.150;
MKfoo=no -> NOfoo
 1.7 16-Mar-1999  minoura branches: 1.7.22; 1.7.26;
Merged minoura_x68k_bus_h branch.
 1.6 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.5 04-Aug-1998  minoura branches: 1.5.6;
Some files were not deleted with make clean.
Keymap files are now installed in /usr/share/keymaps/x68k.
 1.4 26-Oct-1997  lukem use CPPFLAGS instead of CFLAGS
 1.3 22-Jun-1997  mrg move man pages into share/man.
 1.2 30-Aug-1996  thorpej RCS id police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5.6.1 14-Mar-1999  minoura Sync.
 1.7.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.7.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.150.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4 22-Jun-1997  mrg move man pages into share/man.
 1.3 30-Aug-1996  thorpej RCS id police.
 1.2 08-Jul-1996  oki fixed format error
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.4;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.4.1 08-Jul-1996  jtc Pulled up from rev 1.2 by request from Masaru Oki
 1.13 25-Aug-2011  christos fix non-literal format strings
 1.12 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.11 04-Aug-2006  mhitch branches: 1.11.84; 1.11.90;
gcc4 fix: needs string.h
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.8;
merge ktrace-lwp.
 1.9 08-May-2004  minoura branches: 1.9.12;
An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.8 15-Jul-2003  lukem rcsid
 1.7 17-May-2003  isaki branches: 1.7.2;
More style fix.
 1.6 17-May-2003  isaki Use err(3), instead of original error().
 1.5 17-May-2003  isaki Style and indent fix.
 1.4 17-May-2003  isaki Correct argument type of isdigit().
PR port-x68k/21173 by Christian Biere.
 1.3 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.2 30-Aug-1996  thorpej branches: 1.2.44; 1.2.48;
RCS id police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.48.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.44.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 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.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.11.90.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.84.1 31-May-2011  rmind sync with head
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 08-May-2004  minoura An unexported header file was #included from an exported header file.
Introduce <machine/opmreg.h> and move some definitions useful to
userland progs.
 1.3 15-Jul-2003  lukem rcsid
 1.2 30-Aug-1996  thorpej branches: 1.2.64;
RCS id police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.64.1 03-Aug-2004  skrll Sync with HEAD
 1.7 19-May-2011  tsutsui Set WARNS in common Makefile.inc.
 1.6 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.5 12-Dec-2001  tv branches: 1.5.150;
MKfoo=no -> NOfoo
 1.4 16-Mar-1999  minoura branches: 1.4.22; 1.4.26;
Merged minoura_x68k_bus_h branch.
 1.3 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.2 22-Jun-1997  mrg branches: 1.2.16;
move man pages into share/man.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.16.1 14-Mar-1999  minoura Sync.
 1.4.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.150.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.8 19-May-2011  christos fix header includes
 1.7 04-Aug-2006  mhitch branches: 1.7.84; 1.7.90;
gcc4 fix: needs stdlib.h
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8;
merge ktrace-lwp.
 1.5 15-Jul-2003  lukem branches: 1.5.16;
rcsid
 1.4 17-May-2003  isaki branches: 1.4.2;
Style and indent fix.
 1.3 06-Aug-1998  minoura Moved grfioctl.h and iteioctl.h to the public include directory.
 1.2 13-Oct-1997  lukem rcsid fascism
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.12;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 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.5.16.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.7.90.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.84.1 31-May-2011  rmind sync with head
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.13 19-May-2011  tsutsui Set WARNS in common Makefile.inc.
 1.12 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.11 11-Dec-2005  christos branches: 1.11.106;
merge ktrace-lwp.
 1.10 16-Jul-2003  he Use "${COMPILE.c}" instead of "$(CC) -c", so as to pick up the correct
include files when cross-compiling.
 1.9 12-Dec-2001  tv branches: 1.9.16;
MKfoo=no -> NOfoo
 1.8 22-Sep-2001  tv branches: 1.8.4;
objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.7 25-Nov-2000  minoura branches: 1.7.2; 1.7.4;
Use objcopy instead of dd. This will work after we'll switch to ELF.
Using command directly breaks cross compilation. Use macro instead.
 1.6 16-Apr-2000  minoura all -> realall.
 1.5 16-Mar-1999  minoura branches: 1.5.8;
Merged minoura_x68k_bus_h branch.
 1.4 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 04-Aug-1998  minoura branches: 1.3.6;
Some files were not deleted with make clean.
Keymap files are now installed in /usr/share/keymaps/x68k.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.6.1 14-Mar-1999  minoura Sync.
 1.5.8.2 08-Dec-2000  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.7.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.8.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.4.1 22-Sep-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:28:51 +0000
 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.11.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.8 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.7 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.6 11-Dec-2005  christos branches: 1.6.100; 1.6.106;
merge ktrace-lwp.
 1.5 12-May-2004  minoura Populate kbdmap-related definitions to the userland.
Also g/c unused ioctls.
Pointed out by he.
 1.4 28-Aug-2003  isaki Delete unnecessary RCSID.
 1.3 15-Jul-2003  lukem rcsid
 1.2 05-Jan-1998  perry branches: 1.2.50;
RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 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.6.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.100.1 31-May-2011  rmind sync with head
 1.7 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.6 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.5 11-Dec-2005  christos branches: 1.5.100; 1.5.106;
merge ktrace-lwp.
 1.4 12-May-2004  minoura Populate kbdmap-related definitions to the userland.
Also g/c unused ioctls.
Pointed out by he.
 1.3 15-Jul-2003  lukem rcsid
 1.2 05-Jan-1998  perry branches: 1.2.50;
RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 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.5.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.100.1 31-May-2011  rmind sync with head
 1.3 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.11 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.10 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.9 04-Aug-2006  mhitch branches: 1.9.84; 1.9.90;
gcc4 fix: needs stdlib.h
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.8;
merge ktrace-lwp.
 1.7 12-May-2004  minoura branches: 1.7.12;
Populate kbdmap-related definitions to the userland.
Also g/c unused ioctls.
Pointed out by he.
 1.6 15-Jul-2003  lukem rcsid
 1.5 17-May-2003  isaki branches: 1.5.2;
Style and indent fix.
 1.4 31-Jul-2000  minoura include <sys/types.h> to define u_int.
 1.3 06-Aug-1998  minoura branches: 1.3.14;
Moved grfioctl.h and iteioctl.h to the public include directory.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.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.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.12.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.90.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.84.1 31-May-2011  rmind sync with head
 1.7 19-May-2011  tsutsui Set WARNS in common Makefile.inc.
 1.6 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.5 12-Dec-2001  tv branches: 1.5.150;
MKfoo=no -> NOfoo
 1.4 16-Mar-1999  minoura branches: 1.4.22; 1.4.26;
Merged minoura_x68k_bus_h branch.
 1.3 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.2 22-Jun-1997  mrg branches: 1.2.16;
move man pages into share/man.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.16.1 14-Mar-1999  minoura Sync.
 1.4.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.150.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.8 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.7 04-Mar-2007  christos branches: 1.7.66; 1.7.72;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 04-Aug-2006  mhitch branches: 1.6.10;
gcc4 fix: needs stdlib.h
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8;
merge ktrace-lwp.
 1.4 15-Jul-2003  lukem branches: 1.4.16;
rcsid
 1.3 17-May-2003  isaki branches: 1.3.2;
Style fix.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.2 03-Sep-2007  yamt sync with head.
 1.4.16.1 30-Dec-2006  yamt sync with head.
 1.5.8.1 11-Aug-2006  yamt sync with head
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.66.1 31-May-2011  rmind sync with head
 1.7 19-May-2011  tsutsui Set WARNS in common Makefile.inc.
 1.6 19-May-2011  tsutsui WARNSfy.

XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
 1.5 12-Dec-2001  tv branches: 1.5.150;
MKfoo=no -> NOfoo
 1.4 16-Mar-1999  minoura branches: 1.4.22; 1.4.26;
Merged minoura_x68k_bus_h branch.
 1.3 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.2 22-Jun-1997  mrg branches: 1.2.16;
move man pages into share/man.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.16.1 14-Mar-1999  minoura Sync.
 1.4.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.150.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2 09-May-1996  oki binary file. (PR#2383)
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 15-Jul-2003  lukem rcsid
 1.6 17-May-2003  isaki branches: 1.6.2;
Style fix.
 1.5 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.4 13-Jan-1999  itohy Make it compile again.
Use err(3) functions.
KNF
 1.3 06-Aug-1998  minoura branches: 1.3.6;
Moved grfioctl.h and iteioctl.h to the public include directory.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.3.6.1 31-Jan-1999  minoura Sync.
 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 12-Sep-1997  mycroft Nuke Locore.c. It's way too out of date to be useful at this point.
 1.7 08-Jan-1997  oki branches: 1.7.10;
Fix typo.
 1.6 31-Dec-1996  oki #include "..." --> #include <...>
 1.5 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.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.7.10.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.69 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.68 26-Mar-2014  christos kill sprintf, fix unused.
 1.67 29-Jul-2012  mlelstv branches: 1.67.2; 1.67.4;
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.66 23-Apr-2012  isaki Print a message before enabling interrupts. It's helpful to
know when a kernel was hung up. Suggested by tsutsui@,
the message is derived from arch/sun3/sun3/autoconf.c.
 1.65 05-Nov-2009  dyoung branches: 1.65.12; 1.65.16; 1.65.18;
Use deviter(9) instead of accessing alldevs directly. Untested.
 1.64 18-Jan-2009  isaki struct device * -> device_t
 1.63 17-Jan-2009  isaki Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.62 17-Jan-2009  isaki Use device_xname().
 1.61 17-Jan-2009  isaki bootdev: dev_t -> uint32_t.
locore.s assumes bootdev being 32bit value.
 1.60 14-Jan-2009  isaki Use PRIu64 format to print 64bit dev_t.
 1.59 21-Dec-2008  isaki Clean up a header file and a prototype.
 1.58 21-Dec-2008  isaki Take out mainbus(4)-related code from autoconf.c and make it mainbus.c.
 1.57 16-Jul-2008  drochner branches: 1.57.2;
split device/softc for scsibus
 1.56 25-Jun-2008  isaki branches: 1.56.2;
Split device_t/softc. Use aprint*() and device_xname().
 1.55 12-Feb-2008  joerg branches: 1.55.6; 1.55.10; 1.55.12; 1.55.14;
Use device_find_by_xname and device_find_by_driver_unit.
 1.54 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.53 17-Oct-2007  garbled branches: 1.53.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.52 16-Jul-2007  isaki branches: 1.52.8; 1.52.10;
Clean up header file.
 1.51 12-May-2007  isaki Clean up white spaces and tabs.
 1.50 04-Mar-2007  tsutsui branches: 1.50.2; 1.50.4; 1.50.10;
Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.49 24-Nov-2006  wiz branches: 1.49.4;
s/independant/independent/, from Zafer.
 1.48 11-Nov-2006  bjh21 All of the older COMPAT_?? options imply COMPAT_13, so there's no need to
check each one individually.
 1.47 23-Feb-2006  thorpej branches: 1.47.14; 1.47.16;
Use device_parent().
 1.46 21-Feb-2006  thorpej Use device_class() instead of accessing dv_class directly.
 1.45 11-Dec-2005  christos branches: 1.45.2; 1.45.4; 1.45.6;
merge ktrace-lwp.
 1.44 03-Jul-2005  isaki branches: 1.44.2;
cfmatch_t was removed at sys/device.h rev 1.75,
and there is no need to cast for NULL.
 1.43 30-Jun-2005  drochner adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.42 13-Jun-2005  he Make this compile by adding __UNCONST() when calling config_found() or
similar functions with a text constant as the second argument.
 1.41 18-Jan-2005  chs de-__P, remove register, ansify.
 1.40 13-Dec-2004  chs branches: 1.40.2;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.39 23-Oct-2004  thorpej Centralize the declaration of booted_device and booted_partition.
 1.38 15-Jul-2003  lukem rcsid
 1.37 20-Oct-2002  isaki branches: 1.37.6;
x68k needs config_cfdriver_lookup() to initialize its console.
XXX ad-hoc way?
 1.36 13-Oct-2002  isaki Break a long line.
 1.35 13-Oct-2002  isaki - Delete simple_devprint(), which is meaningless.
- "adpcm" device is gone.
 1.34 04-Oct-2002  thorpej Overhaul the way cfattach structures are looked up. The cfdata entry
now carries the name of the attachment (e.g. "tlp_pci" or "audio"),
and cfattach structures are registered at boot time on a per-driver
basis. The cfdriver and cfattach pointers are cached in the device
structure when attached.
 1.33 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.32 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.31 30-Sep-2002  thorpej Add a config_init() function to initialize the config data structures.
Normally this is called by configure(), but some ports (amiga, atari,
x68k) need to do this early because of how they find the console.
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 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.28 22-Jun-2002  isaki Fix compilation error when scsibus* doesn't exist.
 1.27 16-May-2002  thorpej branches: 1.27.2;
Don't access a scsipi channel's periph table directly; use
scsipi_lookup_periph().
 1.26 25-Apr-2001  bouyer branches: 1.26.2; 1.26.8; 1.26.16;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.25 21-Feb-2001  minoura branches: 1.25.2;
Remove some redundant decls.
Fix some nested decls.
 1.24 01-Jun-2000  matt Don't pass booted_* to findroot/getdevice, access them via the globals.
Also, make findroot static. This eliminates unneeded clearing of them
and make their use consistent among the ports.
 1.23 01-Jun-2000  matt Make booted_device global (and booted_parition for consitency).
Eliminate it from header files and other extern definitions.
 1.22 23-Sep-1999  minoura branches: 1.22.2; 1.22.10;
First step toward network boot.
By Takeshi Nakayama <tn@catvmics.ne.jp>.
 1.21 17-Sep-1999  thorpej Centralize the declaration and clearing of `cold'.
 1.20 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.19 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.18 30-Mar-1999  minoura branches: 1.18.4;
G/c obsoleted devices.
 1.17 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.16 09-Sep-1998  minoura branches: 1.16.6;
Make device probe/attach sessions to be executed at splhigh.
mha driver used interrupt driven I/O.
 1.15 01-Sep-1998  itohy Changed algorightm to figure out boot device.
Use type of SCSI interface, target SCSI ID and LUN,
passed from the boot loader.
 1.14 04-Aug-1998  minoura __BROKEN_INDIRECT_CONFIG fixes.
 1.13 30-Jun-1998  msaitoh sync with -current after a long silence
 1.12 19-Oct-1997  oki Support of MK-HA1 Mach-2 SCSI adaptor.
 1.11 10-Oct-1997  oki Add prototypes.
 1.10 26-Mar-1997  gwr branches: 1.10.4;
Move findroot/setroot stuff from configure() to cpu_rootconf().
 1.9 03-Feb-1997  oki branches: 1.9.2;
Remove initialize mrh_list line, and fixed
 1.8 03-Feb-1997  oki Added missing semicolon
 1.7 31-Jan-1997  thorpej Use new machine-independent setroot() and mountroothook code.
 1.6 13-Jan-1997  oki branches: 1.6.2;
first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.5 13-Oct-1996  christos backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.2 08-Jul-1996  oki move wait for insert system floppy to mountroot_hook stuff
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.4;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.4.1 08-Jul-1996  jtc Pulled up from rev 1.2 by request from Masaru Oki
 1.6.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.9.2.1 02-Mar-1997  mrg swapconf() is no more.
 1.10.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.16.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.18.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.22.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.22.2.3 27-Mar-2001  bouyer Convert to thorpej_scsipi (untested).
 1.22.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.22.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.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.26.16.3 17-Jul-2002  gehenna catch up with -current.
 1.26.16.2 30-May-2002  gehenna Catch up with -current.
 1.26.16.1 17-May-2002  gehenna Replace the access to devsw table and the hard-coded major with devsw API.
 1.26.8.6 11-Nov-2002  nathanw Catch up to -current
 1.26.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.26.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.26.8.3 01-Aug-2002  nathanw Catch up to -current.
 1.26.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.26.8.1 25-Apr-2001  nathanw file autoconf.c was added on branch nathanw_sa on 2002-06-20 03:42:36 +0000
 1.26.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.26.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.26.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.2.1 24-Jun-2002  lukem Pull up revision 1.28 (requested by isaki in ticket #349):
Fix compilation error when scsibus* doesn't exist.
 1.37.6.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.37.6.6 24-Jan-2005  skrll Sync with HEAD.
 1.37.6.5 18-Dec-2004  skrll Sync with HEAD.
 1.37.6.4 02-Nov-2004  skrll Sync with HEAD.
 1.37.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.37.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.37.6.1 03-Aug-2004  skrll Sync with HEAD
 1.40.2.1 29-Apr-2005  kent sync with -current
 1.44.2.5 27-Feb-2008  yamt sync with head.
 1.44.2.4 07-Dec-2007  yamt sync with head
 1.44.2.3 03-Sep-2007  yamt sync with head.
 1.44.2.2 30-Dec-2006  yamt sync with head.
 1.44.2.1 21-Jun-2006  yamt sync with head.
 1.45.6.1 22-Apr-2006  simonb Sync with head.
 1.45.4.1 09-Sep-2006  rpaulo sync with head
 1.45.2.1 01-Mar-2006  yamt sync with head.
 1.47.16.1 10-Dec-2006  yamt sync with head.
 1.47.14.2 12-Jan-2007  ad Sync with head.
 1.47.14.1 18-Nov-2006  ad Sync with head.
 1.49.4.2 17-May-2007  yamt sync with head.
 1.49.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.50.10.2 03-Oct-2007  garbled Sync with HEAD
 1.50.10.1 22-May-2007  matt Update to HEAD.
 1.50.4.1 11-Jul-2007  mjf Sync with head.
 1.50.2.3 03-Dec-2007  ad Sync with HEAD.
 1.50.2.2 20-Aug-2007  ad Sync with HEAD.
 1.50.2.1 27-May-2007  ad Sync with head.
 1.52.10.3 23-Mar-2008  matt sync with HEAD
 1.52.10.2 09-Jan-2008  matt sync with HEAD
 1.52.10.1 06-Nov-2007  matt sync with HEAD
 1.52.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.53.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.53.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.55.14.2 18-Jul-2008  simonb Sync with head.
 1.55.14.1 27-Jun-2008  simonb Sync with head.
 1.55.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.55.10.2 11-Mar-2010  yamt sync with head
 1.55.10.1 04-May-2009  yamt sync with head.
 1.55.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.55.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.55.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.56.2.1 19-Oct-2008  haad Sync with HEAD.
 1.57.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.65.18.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.65.16.1 29-Apr-2012  mrg sync to latest -current.
 1.65.12.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.65.12.2 30-Oct-2012  yamt sync with head
 1.65.12.1 23-May-2012  yamt sync with head.
 1.67.4.1 18-May-2014  rmind sync with head
 1.67.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.39 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.38 26-Jul-2022  andvar s/functin/function/ in copy pasted comment.
 1.37 24-May-2022  andvar s/entrace/entrance/ in copy pasted comment.
 1.36 02-Oct-2012  christos move common/bus_dma/ -> dev/bus_dma/
 1.35 06-Jun-2010  mrg branches: 1.35.8; 1.35.18;
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.34 21-Aug-2009  thorpej branches: 1.34.2; 1.34.4;
Use bus_dmamem_common.
 1.33 04-Jun-2008  ad vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.
 1.32 28-Apr-2008  martin branches: 1.32.2;
Remove clause 3 and 4 from TNF licenses
 1.31 05-Mar-2007  he branches: 1.31.40; 1.31.42; 1.31.44;
Cast to char* before doing pointer arithmetic.
 1.30 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.29 11-Dec-2005  christos branches: 1.29.26;
merge ktrace-lwp.
 1.28 24-Nov-2005  yamt bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.27 01-Apr-2005  yamt branches: 1.27.2; 1.27.8;
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.26 09-Mar-2005  matt Add a dm_maxsegsz public member to bus_dmamap_t. This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create). dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.
 1.25 18-Jan-2005  chs branches: 1.25.2;
de-__P, remove register, ansify.
 1.24 28-Nov-2004  thorpej branches: 1.24.4;
bus_dmamap_load_mbuf(): Skip zero-length mbufs.
kern/24811
 1.23 15-Jul-2003  lukem rcsid
 1.22 29-Jun-2003  fvdl branches: 1.22.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.21 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.20 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.19 02-Jun-2002  drochner move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
 1.18 19-Dec-2001  minoura branches: 1.18.8;
Implement bus_dmamap_sync properly.
dma_cachectl is now used only for DMAC array chain.
 1.17 28-Sep-2001  chs branches: 1.17.4;
don't depend on other headers to include sys/proc.h for us.
 1.16 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.15 26-May-2001  chs branches: 1.15.2; 1.15.4;
replace vm_page_t with struct vm_page *.
 1.14 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.13 21-Mar-2001  soren s/vm_page_alloc_memory/uvm_pglistalloc/ in panic message.
 1.12 21-Feb-2001  minoura branches: 1.12.2;
Use m68k_page_offset and m68k_trunc_page macros,
instead of using PGOFSET directly.
 1.11 21-Feb-2001  minoura Remove some redundant decls.
Fix some nested decls.
 1.10 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.9 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.8 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.7 13-Nov-1999  thorpej branches: 1.7.4;
Update for pmap_enter() API change. No functional difference.
 1.6 08-Jul-1999  thorpej branches: 1.6.2; 1.6.4; 1.6.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.5 25-May-1999  thorpej bus_dmamem_map() maps DMA safe memory, which is usually one or more
managed pages, into KVA space. Since the pages are managed, we should
use pmap_enter(), not pmap_kenter_pa().

Also, when entering the mappings, enter with an access_type of
VM_PROT_READ | VM_PROT_WRITE. We do this for a couple of reasons:

(1) On systems that have H/W mod/ref attributes, the hardware
may not be able to track mod/ref done by a bus master.

(2) On systems that have to do mod/ref emulation, this prevents
a mod/ref page fault from potentially happening while in an
interrupt context, which can be problematic.

This latter change is fairly important if we ever want to be able to
transfer DMA-safe memory pages to anonymous memory objects; we will need
to know that the pages are modified, or else data could be lost!

Note that while the pages are unowned (i.e. "just DMA-safe memory pages"),
they won't consume any swap resources, as the mappings are wired, and
the pages aren't on the active or inactive queues.
 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 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.2 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.1 23-Dec-1998  minoura branches: 1.1.2;
file bus.c was initially added on branch minoura_x68k_bus_h.
 1.1.2.5 14-Mar-1999  minoura Use a single (inline) function instead of refering the bus_space switch.
 1.1.2.4 13-Feb-1999  minoura Implemented BUS_SPACE_MAP_SHIFTED.
Some of the devices are mapped only on the odd addresses for hardware
simplicity. To share drivers with other platforms, this should be
made transparent through the bus_space layer.
 1.1.2.3 02-Feb-1999  minoura Typo.
 1.1.2.2 30-Jan-1999  minoura Added DMAC driver.
 1.1.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.4.4.2 02-Aug-1999  thorpej Update from trunk.
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.6.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.4.1 15-Nov-1999  fvdl Sync with -current
 1.6.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.6.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.6.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.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.12.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.12.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.15.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.15.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.17.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.17.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.17.4.1 28-Sep-2001  nathanw file bus.c was added on branch nathanw_sa on 2002-01-08 00:28:53 +0000
 1.18.8.1 15-Jul-2002  gehenna catch up with -current.
 1.22.2.9 11-Dec-2005  christos Sync with head.
 1.22.2.8 01-Apr-2005  skrll Sync with HEAD.
 1.22.2.7 19-Feb-2005  skrll Don't deref a NULL struct lwp *. This shouldn't happen, but...
 1.22.2.6 24-Jan-2005  skrll Sync with HEAD.
 1.22.2.5 18-Dec-2004  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-Aug-2004  skrll Sync with HEAD
 1.22.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.24.4.1 29-Apr-2005  kent sync with -current
 1.25.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.25.2.1 26-Jan-2005  yamt convert arch/x68k to new apis.
 1.27.8.1 29-Nov-2005  yamt sync with head.
 1.27.2.2 03-Sep-2007  yamt sync with head.
 1.27.2.1 21-Jun-2006  yamt sync with head.
 1.29.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.31.44.4 11-Aug-2010  yamt sync with head.
 1.31.44.3 16-Sep-2009  yamt sync with head
 1.31.44.2 04-May-2009  yamt sync with head.
 1.31.44.1 16-May-2008  yamt sync with head.
 1.31.42.2 17-Jun-2008  yamt sync with head.
 1.31.42.1 18-May-2008  yamt sync with head.
 1.31.40.2 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.31.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.32.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.34.4.1 03-Jul-2010  rmind sync with head
 1.34.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.35.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.35.8.1 30-Oct-2012  yamt sync with head
 1.36 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.35 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.34 22-May-2012  isaki With the freerunnnig mode, set 0 (=256count) not 0xff (=255count)
in Timer-D. It fixes the clock ticked faster when timecounter uses
"mfp" (as default choice). It was introduced in rev 1.24 in 2006.
Thanks tsutsui@ for many comments.
Should be pulled up to netbsd-6 and netbsd-5.
 1.33 08-Feb-2011  rmind branches: 1.33.4; 1.33.8; 1.33.10;
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.32 14-Mar-2009  dsl branches: 1.32.4; 1.32.6; 1.32.8;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.31 18-Jan-2009  isaki branches: 1.31.2;
Clean up header files.
 1.30 18-Dec-2008  isaki unsigned -> unsigned int
 1.29 14-Dec-2008  isaki Use mfp_{set,clear}_*() macros to purge macros by the name of 'mfp'.
 1.28 25-Jun-2008  isaki branches: 1.28.4; 1.28.6; 1.28.10; 1.28.14;
Split device_t/softc. Use aprint*() and device_xname().
 1.27 17-Oct-2007  garbled branches: 1.27.16; 1.27.20; 1.27.22; 1.27.24;
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.26 12-May-2007  isaki branches: 1.26.10;
Clean up white spaces and tabs.
 1.25 04-Mar-2007  christos branches: 1.25.2; 1.25.4; 1.25.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.24 19-Sep-2006  gdamore branches: 1.24.4;
Convert x68k to timecounters. This conversion is not tested, due to lack
of available test candidates. It uses the previously unused (as far as I
can tell) Timer D, in freerunning mode. It only uses a 1/200 prescaler
(20KHz), as anything faster would roll over too fast for the system timer.
(Gotta love 8-bit resolution timers!) Approved for untested commit by core@.
 1.23 14-Sep-2006  gdamore branches: 1.23.2;
Converted x68k to todr. Compile tested only, but it has a low probably
of breaking anything.
 1.22 24-Dec-2005  perry branches: 1.22.8; 1.22.20;
bare asm -> __asm
 1.21 11-Dec-2005  christos merge ktrace-lwp.
 1.20 13-Jun-2005  he branches: 1.20.2;
Make this compile under -Wshadow by renaming an unused parameter.
 1.19 18-Jan-2005  chs de-__P, remove register, ansify.
 1.18 13-Dec-2004  chs branches: 1.18.2;
for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 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 15-Jul-2003  lukem rcsid
 1.15 02-Oct-2002  thorpej branches: 1.15.6;
Add trailing ; to CFATTACH_DECL.
 1.14 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.13 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.12 13-Jul-2002  isaki - Use HZ mechanism.
Pointed out by Perry E. Metzger <perry@piermont.com> on port-x68k.
- Correct microtime() value.
 1.11 15-Mar-2001  chs branches: 1.11.2; 1.11.4; 1.11.8; 1.11.16;
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.10 11-Jan-2001  minoura branches: 1.10.2;
Use MI clock_subr.c.
 1.9 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.8 19-Jan-2000  msaitoh check whether tv_usec >= 1000000
 1.7 16-Mar-1999  minoura branches: 1.7.8;
Merged minoura_x68k_bus_h branch.
 1.6 22-Aug-1998  minoura branches: 1.6.6;
Eliminated vm_offset_t and vm_size_t.
 1.5 12-Oct-1997  oki Add prototype.
 1.4 13-Oct-1996  christos branches: 1.4.10;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 15-May-1996  oki fixed gcc -Wall warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.7.8.3 27-Mar-2001  bouyer Sync with HEAD.
 1.7.8.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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.10.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.11.16.1 17-Jul-2002  gehenna catch up with -current.
 1.11.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.11.8.4 01-Aug-2002  nathanw Catch up to -current.
 1.11.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.11.8.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.11.8.1 15-Mar-2001  scw file clock.c was added on branch nathanw_sa on 2001-11-18 18:44:18 +0000
 1.11.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.11.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.11.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.15.6.4 18-Dec-2004  skrll Sync with HEAD.
 1.15.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.6.1 03-Aug-2004  skrll Sync with HEAD
 1.18.2.1 29-Apr-2005  kent sync with -current
 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.22.20.1 18-Nov-2006  ad Sync with head.
 1.22.8.1 14-Sep-2006  yamt sync with head.
 1.23.2.1 22-Oct-2006  yamt sync with head
 1.24.4.2 17-May-2007  yamt sync with head.
 1.24.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.25.10.1 22-May-2007  matt Update to HEAD.
 1.25.4.1 11-Jul-2007  mjf Sync with head.
 1.25.2.1 27-May-2007  ad Sync with head.
 1.26.10.1 06-Nov-2007  matt sync with HEAD
 1.27.24.1 27-Jun-2008  simonb Sync with head.
 1.27.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.27.20.1 04-May-2009  yamt sync with head.
 1.27.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.27.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.28.14.1 03-Jun-2012  jdc Pull up revision 1.34 (requested by isaki in ticket #1765).

With the freerunnnig mode, set 0 (=256count) not 0xff (=255count)
in Timer-D. It fixes the clock ticked faster when timecounter uses
"mfp" (as default choice). It was introduced in rev 1.24 in 2006.
Thanks tsutsui@ for many comments.
 1.28.10.1 03-Jun-2012  jdc Pull up revision 1.34 (requested by isaki in ticket #1765).

With the freerunnnig mode, set 0 (=256count) not 0xff (=255count)
in Timer-D. It fixes the clock ticked faster when timecounter uses
"mfp" (as default choice). It was introduced in rev 1.24 in 2006.
Thanks tsutsui@ for many comments.
 1.28.6.1 03-Jun-2012  jdc Pull up revision 1.34 (requested by isaki in ticket #1765).

With the freerunnnig mode, set 0 (=256count) not 0xff (=255count)
in Timer-D. It fixes the clock ticked faster when timecounter uses
"mfp" (as default choice). It was introduced in rev 1.24 in 2006.
Thanks tsutsui@ for many comments.
 1.28.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.28.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.31.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.32.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.32.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.32.4.1 05-Mar-2011  rmind sync with head
 1.33.10.1 05-Jun-2012  jdc Pull up revision 1.34 (requested by isaki in ticket #281).

With the freerunnnig mode, set 0 (=256count) not 0xff (=255count)
in Timer-D. It fixes the clock ticked faster when timecounter uses
"mfp" (as default choice). It was introduced in rev 1.24 in 2006.
Thanks tsutsui@ for many comments.
Should be pulled up to netbsd-6 and netbsd-5.
 1.33.8.1 02-Jun-2012  mrg sync to latest -current.
 1.33.4.1 23-May-2012  yamt sync with head.
 1.5 07-Sep-2015  dholland 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.4 08-Feb-2011  rmind branches: 1.4.14; 1.4.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.3 11-Dec-2005  christos branches: 1.3.100; 1.3.106; 1.3.108;
merge ktrace-lwp.
 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 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.3.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.100.1 05-Mar-2011  rmind sync with head
 1.4.32.1 22-Sep-2015  skrll Sync with HEAD
 1.4.14.1 03-Dec-2017  jdolecek update from HEAD
 1.36 11-Dec-2005  christos merge ktrace-lwp.
 1.35 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.34 15-Jul-2003  lukem rcsid
 1.33 26-Oct-2002  jdolecek branches: 1.33.6;
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.32 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.31 11-Aug-2002  isaki Add usb*, ugen*
 1.30 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.29 17-Jun-2002  christos MD systrace gluons.
 1.28 16-Mar-2002  martin branches: 1.28.4;
Rename ISDN devices, per discussion on tech-kern. The network devices
become ippp (ISDN ppp) and irip (ISDN raw IP). The character device now
are called: /dev/isdn (isdnd <-> kernel communication), /dev/isdnctl (dialing
and other control), /dev/isdntrc* (tracing), /dev/isdnbchan* (raw B channel
access, i.e. for user land PPP) and /dev/isdntel* (telephone devices, i.e.
for answering machines).
 1.27 19-Dec-2001  minoura clockctl. Compile test only.
 1.26 02-May-2001  scw branches: 1.26.2; 1.26.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.25 26-Mar-2001  lukem - 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.24 21-Mar-2001  lukem move duplicate definitions for:
pc, lpt, joy, ocis, apm, satlink, i4bctl, i4brbch, i4btel, i4btrc, i4b
from the port-specific arch/*/*/conf.c files into sys/conf.h
 1.23 14-Jan-2001  martin branches: 1.23.2;
The i4b raw b-channel devices actually do have an ioctl routine,
so better add this to the cdevsw entry.
Noted by Bruno Achauer.
 1.22 09-Jan-2001  martin When adding isdn devices I forgot to check chrtoblktbl.
Fix this know for the affected archs.
 1.21 08-Jan-2001  martin Add isdn devices to all archs that seem to support at least one of the
necessary busses. Sync comments with reality for archs that already had
the devices.
 1.20 13-Jul-2000  cgd fix some obvious paste errors in 'uk' cdev inits
 1.19 11-Jun-2000  minoura G/C of unused interrupt stubs, and other cleanups.
 1.18 19-Apr-1999  kleink branches: 1.18.2; 1.18.10;
Add COMPAT_SVR4 for m68k.
 1.17 16-Mar-1999  minoura branches: 1.17.4;
Merged minoura_x68k_bus_h branch.
 1.16 13-Nov-1998  oster branches: 1.16.4;
Updating of bdev's and cdev's to support RAIDframe.
 1.15 10-Oct-1998  thorpej Add scsibus entry points to the cdevsw[].
 1.14 05-Aug-1998  minoura Switched to MI zs driver.
 1.13 15-Oct-1997  thorpej branches: 1.13.2;
Pulldown from marc-pcmcia branch: minimal changes to change x68k port's
"com" (now "xcom") driver to avoid name collision with the more
heaviliy-used "com" driver.
 1.12 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.11 10-Oct-1997  oki Fdopen --> fdopen
 1.10 01-Jun-1997  oki branches: 1.10.4;
Use cdev_ipf_unit() instead of cdev_ch_unit()
 1.9 04-Feb-1997  oki Added ipfilter device
 1.8 28-Dec-1996  pk rename: ramdisk => md
 1.7 16-Sep-1996  oki added ccd(blk)/ch/uk device
 1.6 08-Sep-1996  mycroft Use cdev_scanner_init() rather than local cdev_ss_init().
 1.5 07-Sep-1996  mycroft Implement poll(2).
 1.4 05-Sep-1996  mycroft Remove duplicate declarations of LKM functions and macros.
 1.3 20-May-1996  oki Add 'rd' ram-disk pseudo-device.
 1.2 12-May-1996  oki fixed for gcc -Wall warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.10.4.2 15-Oct-1997  thorpej Minimal changes to rename the x68k port's "com" driver to "xcom", to
avoid a namespace collision with the more heavily-used "com" driver,
which needs to be declared in sys/conf/files.
 1.10.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.2.1 05-Feb-1999  cgd pull up patch to make mouse optional. Previously it was mandatory
because some mouse-related functions were referenced from other files.
Never committed to trunk because -current uses MI zs driver. (minoura)
 1.16.4.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.17.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.18.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.18.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.18.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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.23.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.23.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.26.8.8 11-Nov-2002  nathanw Catch up to -current
 1.26.8.7 17-Sep-2002  nathanw Catch up to -current.
 1.26.8.6 13-Aug-2002  nathanw Catch up to -current.
 1.26.8.5 01-Aug-2002  nathanw Catch up to -current.
 1.26.8.4 20-Jun-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 02-May-2001  nathanw file conf.c was added on branch nathanw_sa on 2002-01-08 00:28:54 +0000
 1.26.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.26.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.26.2.4 24-Jun-2002  jdolecek use cdev_tty_init() for ite; this also makes ite use ttykqfilter
 1.26.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.26.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.26.2.1 10-Jul-2001  lukem add kqfilter cdev methods as appropriate
 1.28.4.4 31-Aug-2002  gehenna catch up with -current.
 1.28.4.3 21-Jul-2002  gehenna catch up with -current.
 1.28.4.2 15-Jul-2002  gehenna catch up with -current.
 1.28.4.1 16-May-2002  gehenna Bye block/character device swicth tables.
 1.33.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.33.6.1 03-Aug-2004  skrll Sync with HEAD
 1.13 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.12 21-Feb-2001  minoura branches: 1.12.8;
Use m68k_page_offset and m68k_trunc_page macros,
instead of using PGOFSET directly.
 1.11 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.10 22-Aug-1998  minoura branches: 1.10.14;
Eliminated vm_offset_t and vm_size_t.
 1.9 16-Oct-1997  oki Remove use of register.
 1.8 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.7 10-Jun-1997  veego branches: 1.7.4;
s/x68k_trunc_page/m68k_trunc_page/
 1.6 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.5 09-Dec-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.7.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.14.2 12-Mar-2001  bouyer Sync with HEAD.
 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.12.8.1 11-Nov-2002  nathanw Catch up to -current
 1.37 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.36 18-Jun-2020  tsutsui Use a sane default for size of partition a: rather than odd 0x1fffffff.

The latter one seems derived from 386BSD (and 4.4BSD),
but it could confuse sysinst as noted in PR/55187.
Sync with most other modern ports that use secperunit
as well as RAW_PART.
 1.35 03-Apr-2019  christos branches: 1.35.4;
centralize setdisklabel(9)
 1.34 05-May-2011  tsutsui branches: 1.34.56;
Fix buffer overrun in readdisklabel(9) (and writedisklabel(9))
that causes unexpected panic during installation and
DIAGNOSTIC pool assertions.
Also fix bp->b_flags in writedisklabel(9) error path.

The problem was reported from Y.Sugahara during XM6i development,
and this fix is confirmed on both X68030 (by me) and XM6i (by Sugahara).

XXX: broken dkbad support (which makes struct cpu_disklabel larger
XXX: than 512 bytes) should be removed...
 1.33 02-Jan-2008  ad branches: 1.33.20; 1.33.32; 1.33.38;
Merge vmlocking2 to head.
 1.32 17-Oct-2007  garbled branches: 1.32.2; 1.32.4; 1.32.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.31 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.30 29-Jul-2007  ad branches: 1.30.4; 1.30.6; 1.30.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.29 12-May-2007  isaki branches: 1.29.2; 1.29.4;
Clean up white spaces and tabs.
 1.28 05-Mar-2007  tsutsui branches: 1.28.2; 1.28.4; 1.28.10;
Add (char *) casts on pointer arith.
 1.27 25-Nov-2006  scw branches: 1.27.4;
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.26 11-Dec-2005  christos branches: 1.26.20; 1.26.22;
merge ktrace-lwp.
 1.25 13-Jun-2005  he branches: 1.25.2;
Make this build with -Wcast-qual by adding a few consts.
 1.24 18-Jan-2005  chs de-__P, remove register, ansify.
 1.23 01-Nov-2003  jdolecek branches: 1.23.8;
fix potential use of uninitialized local variable 'error'
 1.22 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.21 15-Jul-2003  lukem rcsid
 1.20 10-May-2003  thorpej branches: 1.20.2;
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.19 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.18 16-Apr-2003  bouyer Nake return values from bounds_check_with_label() conform to the man
page: -1 for error, 0 for EOF, 1 otherwise. Inspired by an OpenBSD commit
message, pointed out by Miod Vallat in private mail.
vax/mba/hp.c: check return value <= 0, not < 0 to be concistent with how
other places handle return values from bounds_check_with_label().
 1.17 19-Feb-2002  wiz strategy should have an 'r'. Inspired by similar change in OpenBSD.
 1.16 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.15 24-Nov-2001  minoura Support BSD style disklabel on harddisks.
XXX need consistency check between the native label and the BSD label.
 1.14 20-Nov-2000  chs branches: 1.14.2; 1.14.4; 1.14.8;
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.13 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.12 16-May-2000  thorpej Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
 1.11 05-Feb-2000  itohy Mark LFS partitions as "BSD lfs ".
Now, swap partition should be "BSD swap" unless COMPAT_14.
 1.10 18-Jan-2000  thorpej Use b_cylinder as defined in sys/buf.h
 1.9 16-Mar-1999  minoura branches: 1.9.8; 1.9.14;
Merged minoura_x68k_bus_h branch.
 1.8 09-Jan-1999  itohy Avoid `void *' arithmetic.
 1.7 05-Jul-1998  jonathan branches: 1.7.8;
* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
 1.6 12-Oct-1997  oki Oops, dk_establish still need.
Backout previous commit, added prototype.
 1.5 12-Oct-1997  oki Prune unused function.
 1.4 10-Oct-1997  oki Remove use of register.
 1.3 16-Jun-1996  oki branches: 1.3.10;
fixed to write disklabel correctly.
 1.2 21-May-1996  oki branches: 1.2.2;
Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.1 16-Jun-1996  oki from trunk: fixed to write disklabel correctly.
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.8.1 31-Jan-1999  minoura Sync.
 1.9.14.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.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.9.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.14.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.14.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.14.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.14.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.20.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.23.8.1 29-Apr-2005  kent sync with -current
 1.25.2.4 21-Jan-2008  yamt sync with head
 1.25.2.3 27-Oct-2007  yamt sync with head.
 1.25.2.2 03-Sep-2007  yamt sync with head.
 1.25.2.1 30-Dec-2006  yamt sync with head.
 1.26.22.1 10-Dec-2006  yamt sync with head.
 1.26.20.1 12-Jan-2007  ad Sync with head.
 1.27.4.2 17-May-2007  yamt sync with head.
 1.27.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.28.10.3 16-Oct-2007  garbled Sync with HEAD
 1.28.10.2 03-Oct-2007  garbled Sync with HEAD
 1.28.10.1 22-May-2007  matt Update to HEAD.
 1.28.4.1 11-Jul-2007  mjf Sync with head.
 1.28.2.3 09-Oct-2007  ad Sync with head.
 1.28.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.28.2.1 27-May-2007  ad Sync with head.
 1.29.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.29.2.1 07-Aug-2007  matt Sync with HEAD.
 1.30.8.1 14-Oct-2007  yamt sync with head.
 1.30.6.2 09-Jan-2008  matt sync with HEAD
 1.30.6.1 06-Nov-2007  matt sync with HEAD
 1.30.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.32.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.32.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.32.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.33.38.1 06-Jun-2011  jruoho Sync with HEAD.
 1.33.32.1 31-May-2011  rmind sync with head
 1.33.20.1 20-May-2011  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1621):
sys/arch/x68k/x68k/disksubr.c: revision 1.34
Fix buffer overrun in readdisklabel(9) (and writedisklabel(9))
that causes unexpected panic during installation and
DIAGNOSTIC pool assertions.
Also fix bp->b_flags in writedisklabel(9) error path.
The problem was reported from Y.Sugahara during XM6i development,
and this fix is confirmed on both X68030 (by me) and XM6i (by Sugahara).
XXX: broken dkbad support (which makes struct cpu_disklabel larger
XXX: than 512 bytes) should be removed...
 1.34.56.1 10-Jun-2019  christos Sync with HEAD
 1.35.4.1 30-Jun-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #973):

sys/arch/x68k/x68k/disksubr.c: revision 1.36

Use a sane default for size of partition a: rather than odd 0x1fffffff.

The latter one seems derived from 386BSD (and 4.4BSD),
but it could confuse sysinst as noted in PR/55187.

Sync with most other modern ports that use secperunit
as well as RAW_PART.
 1.3 30-Mar-1999  minoura Remove unused files.
 1.2 16-May-1996  oki fixed gcc -Wall warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.15 15-Nov-2011  tsutsui Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
 1.14 28-Apr-2008  martin branches: 1.14.34;
Remove clause 3 and 4 from TNF licenses
 1.13 24-Dec-2005  perry branches: 1.13.74; 1.13.76; 1.13.78;
bare asm -> __asm
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 18-Jan-2005  chs branches: 1.11.8;
de-__P, remove register, ansify.
 1.10 15-Jul-2003  lukem branches: 1.10.8;
rcsid
 1.9 08-Dec-2000  itohy branches: 1.9.24;
Fix asm() directive.
 1.8 09-Oct-1997  jtc branches: 1.8.18;
Fix tipo inherited from old version of TNF copyright template.
 1.7 18-Jan-1997  oki branches: 1.7.8;
Use struct fpframe instead of int[], suggested from Takeshi Nakayama.
 1.6 08-Jan-1997  oki Compile again.
 1.5 08-Jan-1997  oki Use FPU_XXXXX macro, x68k is now use this file.
 1.4 09-Dec-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.3 13-Oct-1996  christos backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.7.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.18.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.9.24.4 24-Jan-2005  skrll Sync with HEAD.
 1.9.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.24.1 03-Aug-2004  skrll Sync with HEAD
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.11.8.1 21-Jun-2006  yamt 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.14.34.1 17-Apr-2012  yamt sync with head
 1.8 14-Jul-1997  oki Use genassym.cf to make assym.h
 1.7 13-May-1997  gwr Eliminate references to vmspace.vm_pmap
 1.6 20-Jan-1997  oki Oops, fixed typo in previous commit, compile again.
 1.5 18-Jan-1997  oki Added FPU_XXXX macros.
 1.4 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.3 08-Jan-1997  oki Add macros.
 1.2 09-Dec-1996  oki CACHE4_OFF --> CACHE40_OFF, compile again.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.40 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.39 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.38 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.37 20-Feb-2020  skrll G/C
 1.36 17-Feb-2020  skrll G/C LS{SLEEP,RUN,ONPROC}

LWP status manipulation was moved out of assembly long ago.
 1.35 19-Dec-2018  maxv branches: 1.35.6;
Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.34 08-Mar-2014  tsutsui branches: 1.34.28; 1.34.30;
Misc cosmetic changes to reduce diffs from other m68k ports.

- replace magic numbers with macro via genassym.cf
- include opt_fpu_emulate.h at the top
- use C-style comments
- add register '%' prefix in comments
- sync several comments
- indent adjustments etc.

No text binary changes. (only .global _KERNEL_OPT_FPU_EMULATE is moved)
 1.33 14-Jan-2011  rmind branches: 1.33.8; 1.33.18; 1.33.22;
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.32 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.31 10-Dec-2009  rmind branches: 1.31.4;
Rename L_ADDR to L_PCB and amend some comments accordingly.
 1.30 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.29 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.28 04-Jun-2008  ad branches: 1.28.4;
Remove ref to uvm.page_idle_zero
 1.27 17-Oct-2007  garbled branches: 1.27.16; 1.27.18; 1.27.20; 1.27.22;
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.26 19-May-2007  isaki branches: 1.26.10;
Adapt to the merge of yamt-idlelwp branch.
tested on my X68030.
 1.25 11-Dec-2005  christos branches: 1.25.30; 1.25.32; 1.25.38;
merge ktrace-lwp.
 1.24 04-Nov-2003  dsl branches: 1.24.16;
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.23 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.22 08-Apr-2003  thorpej branches: 1.22.2;
Use PAGE_SIZE rather than NBPG.
 1.21 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.20 26-Sep-2002  thorpej Remove <sys/map.h>
 1.19 11-May-2002  jdolecek use _KERNEL_OPT rather than _KERNEL && !_LKM
 1.18 29-Sep-2001  minoura branches: 1.18.4;
Forgot to include <machine/bootinfo.h> for the new symbol added in the
previous commit.
 1.17 27-Sep-2001  minoura Embed the version number of the interface between the bootloader and
kernel. See amiga.
 1.16 22-Mar-2001  minoura branches: 1.16.2; 1.16.4;
Sync with amiga 1.15.
Make this compile again (when building the LKMs).
 1.15 21-Nov-2000  tsutsui branches: 1.15.2;
Define proper macros for FP frame offsets rather than magic numbers.
 1.14 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.13 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.12 14-May-2000  minoura MD parts of uvm_pageidlezero.
 1.11 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.10 06-May-1999  kleink branches: 1.10.2; 1.10.4; 1.10.6;
SVR4-related typo in previous.
 1.9 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.8 24-Mar-1999  minoura branches: 1.8.2; 1.8.4;
Mach VM removal.
 1.7 01-Oct-1998  thorpej Define SYS_compat_13_sigreturn13.
 1.6 30-Sep-1998  thorpej Make sure SYS_exit and SYS___sigreturn14 are defined. Garbage collect
SYS_sigreturn.
 1.5 30-Jun-1998  msaitoh sync with -current after a long silence
 1.4 06-Jan-1998  thorpej Garbage-collect VM_PMAP.
 1.3 06-Jan-1998  thorpej Garbage-collect pm_stchanged.
 1.2 12-Oct-1997  oki Added FPU_68060
 1.1 14-Jul-1997  oki branches: 1.1.2;
Use genassym.cf to make assym.h
 1.1.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.2.1 21-Nov-1999  he Pull up revision 1.11 (requested by itohy):
Fix the problem where single-step tracing of a trap instruction
makes the system fall into kernel debugger.
 1.10.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.4.1 15-Nov-1999  fvdl Sync with -current
 1.10.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.10.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.10.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.15.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.16.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.16.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.16.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.16.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.18.4.7 18-Oct-2002  nathanw Catch up to -current.
 1.18.4.6 05-Oct-2002  gmcgarry Add RAS offsets. Nuke saframe.h
 1.18.4.5 02-Aug-2002  nathanw Don't need SAF_UPCALL anymore.
 1.18.4.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.18.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.18.4.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.18.4.1 29-Sep-2001  scw file genassym.cf was added on branch nathanw_sa on 2001-11-18 18:44:18 +0000
 1.22.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.2.1 03-Aug-2004  skrll Sync with HEAD
 1.24.16.1 03-Sep-2007  yamt sync with head.
 1.25.38.1 22-May-2007  matt Update to HEAD.
 1.25.32.1 11-Jul-2007  mjf Sync with head.
 1.25.30.1 27-May-2007  ad Sync with head.
 1.26.10.1 06-Nov-2007  matt sync with HEAD
 1.27.22.2 10-Oct-2008  skrll Sync with HEAD.
 1.27.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.27.20.2 11-Mar-2010  yamt sync with head
 1.27.20.1 04-May-2009  yamt sync with head.
 1.27.18.1 17-Jun-2008  yamt sync with head.
 1.27.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.27.16.1 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.28.4.1 19-Oct-2008  haad Sync with HEAD.
 1.31.4.1 05-Mar-2011  rmind sync with head
 1.33.22.1 18-May-2014  rmind sync with head
 1.33.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.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.34.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.34.30.1 10-Jun-2019  christos Sync with HEAD
 1.34.28.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.35.6.1 29-Feb-2020  ad Sync with head.
 1.19 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.18 14-May-2011  tsutsui IODEVbase is the same address as intiobase, so make it an alias macro
and remove now almost empty x68k_init.c.
 1.17 17-Jan-2009  isaki branches: 1.17.6; 1.17.8;
Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.16 18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.15 14-Dec-2008  isaki Simplify #ifdefs.
 1.14 14-Dec-2008  isaki Remove unused macros.
 1.13 14-Dec-2008  isaki Use intio_set_*() macros to purge macros by the name of sysport, ioctlr.
 1.12 14-Dec-2008  isaki Use mfp_{set,clear}_*() macros to purge macros by the name of 'mfp'.
 1.11 17-Oct-2007  garbled branches: 1.11.16; 1.11.20; 1.11.28;
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.10 12-May-2007  isaki branches: 1.10.10;
Clean up white spaces and tabs.
 1.9 11-Dec-2005  christos branches: 1.9.26; 1.9.30; 1.9.32; 1.9.38;
merge ktrace-lwp.
 1.8 18-Jan-2005  chs branches: 1.8.8;
de-__P, remove register, ansify.
 1.7 14-May-2002  matt branches: 1.7.10; 1.7.18;
Eliminate commons (including many used ones). Clean up variable references.
 1.6 16-Mar-1999  minoura branches: 1.6.22; 1.6.26;
Merged minoura_x68k_bus_h branch.
 1.5 05-Aug-1998  minoura branches: 1.5.6;
Switched to MI zs driver.
 1.4 11-Oct-1997  oki Added header file for prototype.
 1.3 10-Oct-1997  oki Add prototypes.
 1.2 18-Jan-1997  oki branches: 1.2.8;
tvram[] should be u_char, instead of u_short.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.6.26.1 20-Jun-2002  nathanw Catch up to -current.
 1.6.22.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.18.1 29-Apr-2005  kent sync with -current
 1.7.10.1 24-Jan-2005  skrll Sync with HEAD.
 1.8.8.1 03-Sep-2007  yamt sync with head.
 1.9.38.1 22-May-2007  matt Update to HEAD.
 1.9.32.1 11-Jul-2007  mjf Sync with head.
 1.9.30.1 27-May-2007  ad Sync with head.
 1.9.26.1 17-May-2007  yamt sync with head.
 1.10.10.1 06-Nov-2007  matt sync with HEAD
 1.11.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.11.20.1 04-May-2009  yamt sync with head.
 1.11.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.17.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.6.1 31-May-2011  rmind sync with head
 1.2 30-Mar-1999  minoura Remove unused files.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.10 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.9 12-May-2007  isaki branches: 1.9.10;
Clean up white spaces and tabs.
 1.8 24-Dec-2005  perry branches: 1.8.26; 1.8.30; 1.8.32; 1.8.38;
bare asm -> __asm
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 18-Jan-2005  chs branches: 1.6.8;
de-__P, remove register, ansify.
 1.5 07-Aug-2003  agc branches: 1.5.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 15-Jul-2003  lukem rcsid
 1.3 30-May-2001  lukem branches: 1.3.8; 1.3.24;
add missing #include "opt_kgdb.h"
 1.2 22-Mar-2001  minoura A bit of ELF support. From scw.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.32; 1.1.1.1.44;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.44.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.1.1.44.1 09-Apr-2001  nathanw Catch up with -current.
 1.1.1.1.32.1 27-Mar-2001  bouyer Sync with HEAD.
 1.3.24.4 24-Jan-2005  skrll Sync with HEAD.
 1.3.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.24.1 03-Aug-2004  skrll Sync with HEAD
 1.3.8.2 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.3.8.1 30-May-2001  lukem file kgdb_glue.c was added on branch nathanw_sa on 2001-05-30 15:24:41 +0000
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.6.8.2 03-Sep-2007  yamt sync with head.
 1.6.8.1 21-Jun-2006  yamt sync with head.
 1.8.38.1 22-May-2007  matt Update to HEAD.
 1.8.32.1 11-Jul-2007  mjf Sync with head.
 1.8.30.1 27-May-2007  ad Sync with head.
 1.8.26.1 17-May-2007  yamt sync with head.
 1.9.10.1 06-Nov-2007  matt sync with HEAD
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 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 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki branches: 1.1.1.1.66;
NetBSD/x68k, by Masaru Oki.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.21 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.20 28-Mar-2023  andvar s/ourput/output/ in comment.
 1.19 10-Nov-2021  msaitoh s/procesing/processing/ in comment.
 1.18 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.17 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.16 17-Oct-2007  garbled branches: 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 12-May-2007  isaki branches: 1.15.10;
Clean up white spaces and tabs.
 1.14 04-Mar-2007  christos branches: 1.14.2; 1.14.4; 1.14.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 24-Dec-2005  perry branches: 1.13.26;
bare asm -> __asm
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 18-Jan-2005  chs branches: 1.11.8;
de-__P, remove register, ansify.
 1.10 13-Feb-2004  wiz branches: 1.10.8;
Uppercase CPU, plural is CPUs.
 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-Jul-2003  lukem rcsid
 1.7 20-Nov-2001  lukem branches: 1.7.16;
- pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
 1.6 16-Sep-2001  wiz branches: 1.6.4;
Spell 'occurred' with two 'r's.
 1.5 30-May-2001  lukem branches: 1.5.2; 1.5.4;
add missing #include "opt_kgdb.h"
 1.4 13-Oct-1996  christos branches: 1.4.42;
backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 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.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4.42.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.5.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.4.1 16-Sep-2001  nathanw file kgdb_stub.c was added on branch nathanw_sa on 2002-01-08 00:28:55 +0000
 1.7.16.4 24-Jan-2005  skrll Sync with HEAD.
 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.10.8.1 29-Apr-2005  kent sync with -current
 1.11.8.2 03-Sep-2007  yamt sync with head.
 1.11.8.1 21-Jun-2006  yamt sync with head.
 1.13.26.2 17-May-2007  yamt sync with head.
 1.13.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.10.1 22-May-2007  matt Update to HEAD.
 1.14.4.1 11-Jul-2007  mjf Sync with head.
 1.14.2.1 27-May-2007  ad Sync with head.
 1.15.10.1 06-Nov-2007  matt sync with HEAD
 1.16.20.1 11-Mar-2010  yamt sync with head
 1.134 07-Sep-2024  andvar spelling and grammar fixes, mainly in comments.
 1.133 19-Jan-2024  thorpej branches: 1.133.2;
Switch the x68k port to use the same clockframe layout as the other
m68k ports.
 1.132 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.131 17-Jan-2024  thorpej Make sigcode.s and sunos_sigcode.s build as their own stand-alone files.
 1.130 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.129 16-Jan-2024  thorpej Build m68k/support.s on its own; don't include it from locore.s
 1.128 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.127 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.126 06-Jan-2024  isaki x68k: Make _delay() argument to microseconds.
'<< 8' is just a magnification factor and should not be visible
from the outside.
 1.125 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.124 26-Dec-2023  thorpej G/C unused ploadw().
 1.123 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.122 17-Sep-2023  andvar add "#if defined(M68030)" around 68030 specific busaddrerr2030 calls.

Makes M68030 build without 040/060 counterparts enabled for x68k.
 1.121 30-May-2022  andvar branches: 1.121.4;
s/identifing/identifying/ and s/multipler/multiplier/ in comments.
 1.120 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.119 25-Jul-2015  isaki branches: 1.119.16; 1.119.18;
Add a comment on mnemonic that assembler cannot recognize.
 1.118 31-Jul-2014  isaki branches: 1.118.4;
Remove the variable not used anymore.
sync with x68k/pmap_bootstrap.c,v 1.21 (in 2001).
 1.117 22-Mar-2014  tsutsui branches: 1.117.2;
Remove obsolete ssir stuff which was used for pre-5.0 softintr(9).

No visible problem on X68030.
 1.116 22-Mar-2014  tsutsui Use common m68k/busaddrerr.s for bus error and address error handlers.

No binary changes on GENERIC.
(though the previous revision has not been tested on 040/060 yet)
 1.115 14-Mar-2014  tsutsui Sync bus error and address error handlers with other m68k implementation.

Tested on X68030. Needs tests on 040 and 060turbo
(though it should work as other m68k ports).

The x68k port implemented 68060 support including these vector handlers
as early as amiga back in 1996, but even after amiga's locore.s was
improved several times (updating vectors at runtime to switch handlers
per CPU types etc.), x68k's one has not been updated.
After that, atari and mac68k pulled amiga's implementation,
hp300 pulled mac68k, and then most other m68k ports pulled hp300 ones.

Probably that's the reason why only x68k had different implementations
(i.e. no reason that avoids using common handler implementation),
and now it's time to prepare common arch/m68k/m68k/busaddrerr.s.
 1.114 08-Mar-2014  tsutsui Misc cosmetic changes to reduce diffs from other m68k ports.

- replace magic numbers with macro via genassym.cf
- include opt_fpu_emulate.h at the top
- use C-style comments
- add register '%' prefix in comments
- sync several comments
- indent adjustments etc.

No text binary changes. (only .global _KERNEL_OPT_FPU_EMULATE is moved)
 1.113 31-Jan-2014  tsutsui defined(LKM) -> defined(MODULAR)
 1.112 31-Jan-2014  tsutsui Move the startup routine to the beginning of the source as other m68k ports.

No particular comments on port-x68k@.
 1.111 27-Oct-2013  tsutsui Probe extended memories before pmap_boostrap() for actual fix of PR/45915.

Also expand expected maximum extended memory regions to recognize
upto 1008 MB RAM that is supported by the XM6i emulator.

See my post on port-x68k@ for more details:
http://mail-index.NetBSD.org/port-x68k/2013/10/19/msg000039.html

Probably worth to pullup to netbsd-6.
 1.110 19-May-2012  tsutsui branches: 1.110.2; 1.110.4;
Fix leftover comment derived from hp300 but not applicable to x68k.
 1.109 29-Apr-2012  tsutsui Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.108 22-Dec-2011  tsutsui branches: 1.108.2;
Merge m68881_save() and m68881_restore() (using most common mvme68k ones).
All functions are checked by my eyes, and all GENERIC kernels compile.
 1.107 26-Nov-2011  tsutsui branches: 1.107.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.106 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.105 04-Nov-2011  tsutsui 64040 -> 68040 in comment
 1.104 09-Oct-2011  tsutsui branches: 1.104.2;
Make NetBSD/x68k kernel work with 8KB/page (i.e. PGSHIFT==13) settings.

It's quite interesting to check ATC miss rate with both settings on XM6i,
as noted in XM6i presentation by isaki@ at OSC 2011 Hiroshima.
 1.103 14-May-2011  tsutsui It's a bit horrible to call uvm_page_physload() from consinit().
Instead, prepare x68k_init() function for pre-main MD initialization as other
m68k ports and move uvm_page_physload() call and msgbuf initialization there.

Tested on X68030, but options EXTENDED_MEMORY is untested.
 1.102 11-May-2011  tsutsui Defer fpu_probe() call until curlwp and related variables are initialized.
Fixes pre-consinit KASSERT() in trap() caused by fnop instruction in
fpu_probe() on machines without FPU, including XM6i.
 1.101 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.100 27-Dec-2010  tsutsui branches: 1.100.2; 1.100.4;
Fix typo (and pasted lines). From OpenBSD.
 1.99 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.98 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.97 25-Feb-2010  skrll branches: 1.97.2;
s/cpu_fork/cpu_lwp_fork/ in comment.
 1.96 13-Dec-2009  tsutsui branches: 1.96.2;
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.95 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.94 04-Dec-2009  tsutsui Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Also update some comment.
Compile test only.
 1.93 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.92 18-Jan-2009  isaki Delete 10 years old #if 0'd comments in intio.c, locore.s.
According to the old comment, the interrupt handler via intiotrap
should set his interrupt level again, but it's not right. And
don't set it again by interrupt hander.
 1.91 11-Jan-2009  tsutsui Fix inverted logic on FPU type check in fpfault(). From OpenBSD.
 1.90 21-Dec-2008  isaki Remove an old comment (about amiga?).
 1.89 21-Dec-2008  isaki - Split idepth from INTERRUPT_*REG macros to avoid confusing.
- timertrap: add idepth stuff, and use INTERRUPT_*REG macros.
- lev7intr: add idepth stuff.
 1.88 21-Dec-2008  isaki Remove extiobase. x68k does not use it.
 1.87 20-Dec-2008  isaki Make pow(4) a hardware device.
Now pow(4) uses intio_intr_establish() which is a common interrupt
routine, but not powtrap which is a device specific routine.
 1.86 18-Dec-2008  isaki Move external decl. of intiobase: dev/intiovar.h -> include/cpu.h
Move definition of intiobase: x68k/pmap_bootstrap.c -> x68k/locore.s
These synchronize code with other m68k ports.
 1.85 18-Dec-2008  isaki Remove intr_reset(), which has disabled device interrupt just
after start in locore.s. Initializing interrupt should be done
by each device driver.
 1.84 23-Jun-2008  isaki branches: 1.84.4; 1.84.6;
Make intio_intr_establish() use evcnt(9),
instead of dynamic allocation of intrnames/intrcnt.
 1.83 23-Jun-2008  isaki Remove some unused intrnames/intrcnt.
 1.82 03-Dec-2007  ad branches: 1.82.14; 1.82.18; 1.82.20; 1.82.22;
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.81 17-Oct-2007  garbled branches: 1.81.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.80 27-Jun-2007  mhitch branches: 1.80.8; 1.80.10;
Ooops - I missed another call to trap. Fixes PR#36567.
 1.79 12-Jun-2007  mhitch 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.78 19-May-2007  isaki Adapt to the merge of yamt-idlelwp branch.
tested on my X68030.
 1.77 04-Mar-2007  tsutsui branches: 1.77.2; 1.77.4; 1.77.10;
Global ssir (similated software intnerrupt request?) is now declared
in softintr.c so remove it from locore.s.
 1.76 11-Dec-2005  christos branches: 1.76.24; 1.76.26; 1.76.30;
merge ktrace-lwp.
 1.75 15-Dec-2004  jmc branches: 1.75.10;
Convert -MMU_68040 into a form gas will take now (-- isn't valid)
 1.74 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.73 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.72 29-Apr-2003  itohy branches: 1.72.2;
white-space police
 1.71 27-Apr-2003  ragge Preserve the symbol table in the LKM || KSYMS cases also.
 1.70 08-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.69 02-Feb-2003  wiz guarantee, not guarentee. Idea from miod@openbsd.
 1.68 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.67 05-Dec-2001  atatat It's not called "opt_fpuemulate.h", it's called "opt_fpu_emulate.h". :)
 1.66 27-Sep-2001  minoura branches: 1.66.4;
Embed the version number of the interface between the bootloader and
kernel. See amiga.
 1.65 30-May-2001  lukem branches: 1.65.2; 1.65.4;
add missing #include "opt_kgdb.h"
 1.64 08-Dec-2000  itohy branches: 1.64.2;
1. Add register prefix.
2. movb #0x01,0x01800003@ -> movb #0x01,0x01800003 (found by tsutsui).
 1.63 26-Nov-2000  jdolecek 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.62 21-Nov-2000  tsutsui Define proper macros for FP frame offsets rather than magic numbers.
 1.61 26-Aug-2000  minoura Set fputype earlier, before proc0 initialization.
 1.60 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.59 11-Jun-2000  minoura branches: 1.59.2;
G/C of unused interrupt stubs, and other cleanups.
 1.58 31-May-2000  thorpej Add a comment on single-processor systems about p_cpu being initialized
by fork1().
 1.57 26-May-2000  thorpej branches: 1.57.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.56 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.55 18-May-2000  minoura Wrong logic. Pointed out by Yasufumi.
 1.54 14-May-2000  minoura defopt FPSP.
 1.53 14-May-2000  minoura MD parts of uvm_pageidlezero.
 1.52 14-Jan-2000  itohy - Do not lower interrupt level at clock interrupt.
The original code lowers level 6 to 4, and if a
clock interrupt occurs in splzs (or similar) the
system may be in unpredictable state.
To do such a hack correctly, checking the original priority
and duplicated clock interrupts would be required.
For now, just disable the hack.

- Do not use clock interrupt for ms polling.
 1.51 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.50 23-Sep-1999  minoura branches: 1.50.2; 1.50.4; 1.50.6;
Use m68k common cacheops.c.
 1.49 17-Sep-1999  thorpej Centralize the declaration and clearing of `cold'.
 1.48 05-Aug-1999  minoura Make use of _C_LABEL and other macros in m68k/asm.h.
 1.47 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.46 05-May-1999  minoura Use mvme68k-derived delay routine.
Now that we support various models, the old constant-loop delay routine
may cause problems.
 1.45 30-Apr-1999  christos Include opt_compat_sunos.h
 1.44 28-Apr-1999  minoura Handle fpunimp properly for fpu_emulate.
 1.43 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.42 18-Apr-1999  minoura Handle F line emulation correctly when FPU_EMULATE is enabled.
 1.41 24-Mar-1999  mrg branches: 1.41.2;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.40 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.39 26-Feb-1999  is x68k specific part of fix for PR 6152
 1.38 02-Feb-1999  itohy Trivial asm-level optimizations.
 1.37 11-Nov-1998  thorpej branches: 1.37.4;
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.36 30-Sep-1998  thorpej Garbage collect trap #1 and trap #2 handlers; they're moved to
trap_subr.s
 1.35 30-Sep-1998  thorpej Pull in opt_compat_netbsd.h
 1.34 09-Sep-1998  minoura Make device probe/attach sessions to be executed at splhigh.
mha driver used interrupt driven I/O.
 1.33 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.32 07-Sep-1998  minoura Cleanup _doboot, fixing the 040 reboot bug.
 1.31 05-Aug-1998  minoura Switched to MI zs driver.
 1.30 04-Jul-1998  jonathan defopt DDB.
 1.29 30-Jun-1998  msaitoh sync with -current after a long silence
 1.28 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.27 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.26 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.25 01-Jan-1998  thorpej - Make pmap_activate() and pmap_deactivate() take a struct proc *.
- Define active_user_pmap() and use it in the appropriate places (from hp300
port).
 1.24 19-Oct-1997  oki branches: 1.24.2;
add support for MK-HA2 Mach-2 SCSI host adaptor.
 1.23 15-Oct-1997  thorpej Pulldown from marc-pcmcia branch: minimal changes to change x68k port's
"com" (now "xcom") driver to avoid name collision with the more
heaviliy-used "com" driver.
 1.22 12-Oct-1997  oki Replace trap1 and trap2 to native 4.3 process.
 1.21 08-Oct-1997  oki Use _ASM_LABEL.
 1.20 12-Sep-1997  mycroft Add and use fputype. Optimize floating point save/restore routines a bit more
if only one CPU type is defined. Eliminate FPCOPROC.
 1.19 26-Jun-1997  is branches: 1.19.4;
The recent buserr handler cleanup in the Amiga locore.s made the label
_buserr point to the 68020/030 buserr code _only_. This has broken access
error handling in the 060 support code.
This is repaired by jumping to _buserr60 from the 060SP, and by providing
a _buserr60 label identical to the _buserr in the unchanged m68k ports
using the 68060.
 1.18 13-May-1997  gwr Eliminate references to vmspace.vm_pmap
 1.17 25-Apr-1997  thorpej Adjust for <m68k/m68k/trap_subr.s>
 1.16 13-Apr-1997  thorpej Use common m68k sigcode.
 1.15 09-Apr-1997  thorpej Use <m68k/m68k/proc_subr.s>
 1.14 16-Mar-1997  thorpej Use <m68k/m68k/support.s>
 1.13 02-Feb-1997  thorpej Garbage-collect extra copypage()
 1.12 18-Jan-1997  oki silly little optimization.
 1.11 18-Jan-1997  oki bxx --> jxx
 1.10 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.9 09-Dec-1996  oki CACHE4_OFF --> CACHE40_OFF, compile again.
 1.8 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.7 03-Sep-1996  mycroft Remove gratuitous insn.
 1.6 19-Aug-1996  oki Oops, added forgotten "-". closes port-x68k/2706.
 1.5 11-Aug-1996  oki fixed use of uninitialized pointer.
 1.4 16-Jul-1996  oki From Ignatios Souvatzis <is@NetBSD.ORG>:
properly distinguish between a bus error and an MMU fault
on systems with 68030 MMU
 1.3 29-May-1996  oki fixed reboot problem on Xellent30.
 1.2 17-May-1996  oki branches: 1.2.4;
Add a "_kernel_text" symbol, for libkvm. From Gordon Ross.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.4.4 06-Sep-1996  jtc Pulled up rev 1.6 by request from oki
 1.2.4.3 16-Aug-1996  jtc Pulled up from rev 1.5 by request from oki
 1.2.4.2 16-Jul-1996  jtc Pulled up from rev 1.4 by request from Masaru Oki
 1.2.4.1 29-May-1996  oki pull up version 1.3 from the main branch.
 1.19.4.3 15-Oct-1997  thorpej Minimal changes to rename the x68k port's "com" driver to "xcom", to
avoid a namespace collision with the more heavily-used "com" driver,
which needs to be declared in sys/conf/files.
 1.19.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.19.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.24.2.2 05-Feb-1999  cgd pull up patch to make mouse optional. Previously it was mandatory
because some mouse-related functions were referenced from other files.
Never committed to trunk because -current uses MI zs driver. (minoura)
 1.24.2.1 13-Oct-1998  cgd pull up something resembling the changes in rev 1.29, via patch. (minoura)
 1.37.4.8 14-Mar-1999  minoura Sync.
 1.37.4.7 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.37.4.6 12-Mar-1999  minoura Gather interrupt statics.
 1.37.4.5 13-Feb-1999  minoura intiotrap priority level change (splhigh -> default).
Handle SPC interrupts via the intiotrap.
XXX: exspc cannot be used until the mha driver is bus.h'fied.
 1.37.4.4 10-Feb-1999  minoura Update uvmexp (cnt for old VM) on intiotrap.
 1.37.4.3 02-Feb-1999  minoura Delete fdctrap routine.
 1.37.4.2 30-Jan-1999  minoura Added DMAC driver.
 1.37.4.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.41.2.5 15-Jan-2000  he Pull up revision 1.52 (via patch, requested by itohy):
Change the implementation of ms(4) polling to use timeout(9)
software timer, and change the clock interrupt handler not to
lower interrupt level, in order to eliminate glitches on MPU
interrupt levels.
 1.41.2.4 21-Nov-1999  he Pull up part of revision 1.51 (via patch, requested by itohy):
Fix the problem where single-step tracing of a trap instruction
makes the system fall into kernel debugger.
 1.41.2.3 24-Jun-1999  perry pullup 1.45->1.46 (minoura): Use mvme68k-derived delay() routine
 1.41.2.2 20-Jun-1999  perry pullup 1.41->1.42, 1.43->1.44 (minoura)
 1.41.2.1 30-Apr-1999  perry branches: 1.41.2.1.2; 1.41.2.1.4;
pullup 1.44->1.45 (christos); conflicts manually edited
 1.41.2.1.4.1 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.41.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.41.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.50.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.50.4.1 15-Nov-1999  fvdl Sync with -current
 1.50.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.50.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.50.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.57.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.59.2.1 31-Aug-2000  minoura Pullup rev.1.61. Approved by thorpej.
Set fputype earlier, before proc0 initialization.
 1.64.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.65.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.65.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.66.4.4 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.66.4.3 08-Jan-2002  nathanw Catch up to -current.
 1.66.4.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.66.4.1 27-Sep-2001  scw file locore.s was added on branch nathanw_sa on 2001-11-18 18:44:18 +0000
 1.72.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.72.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.72.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.72.2.1 03-Aug-2004  skrll Sync with HEAD
 1.75.10.2 07-Dec-2007  yamt sync with head
 1.75.10.1 03-Sep-2007  yamt sync with head.
 1.76.30.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.76.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.76.24.2 01-Jul-2007  bouyer Pull up following revision(s) (requested by mhitch in ticket #751):
sys/arch/x68k/x68k/locore.s: revision 1.80
Ooops - I missed another call to trap. Fixes PR#36567.
 1.76.24.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.77.10.3 03-Oct-2007  garbled Sync with HEAD
 1.77.10.2 26-Jun-2007  garbled Sync with HEAD.
 1.77.10.1 22-May-2007  matt Update to HEAD.
 1.77.4.1 11-Jul-2007  mjf Sync with head.
 1.77.2.3 03-Dec-2007  ad Sync with HEAD.
 1.77.2.2 15-Jul-2007  ad Sync with head.
 1.77.2.1 27-May-2007  ad Sync with head.
 1.80.10.2 09-Jan-2008  matt sync with HEAD
 1.80.10.1 06-Nov-2007  matt sync with HEAD
 1.80.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.81.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.82.22.1 27-Jun-2008  simonb Sync with head.
 1.82.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.82.18.3 11-Aug-2010  yamt sync with head.
 1.82.18.2 11-Mar-2010  yamt sync with head
 1.82.18.1 04-May-2009  yamt sync with head.
 1.82.14.2 17-Jan-2009  mjf Sync with HEAD.
 1.82.14.1 29-Jun-2008  mjf Sync with HEAD.
 1.84.6.1 15-Jul-2011  riz Pull up following revision(s) (requested by tsutsui in ticket #1640):
sys/arch/x68k/x68k/locore.s: revision 1.102
Defer fpu_probe() call until curlwp and related variables are initialized.
Fixes pre-consinit KASSERT() in trap() caused by fnop instruction in
fpu_probe() on machines without FPU, including XM6i.
 1.84.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.96.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.96.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.97.2.3 31-May-2011  rmind sync with head
 1.97.2.2 05-Mar-2011  rmind sync with head
 1.97.2.1 03-Jul-2010  rmind sync with head
 1.100.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.100.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.104.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.104.2.3 23-May-2012  yamt sync with head.
 1.104.2.2 17-Apr-2012  yamt sync with head
 1.104.2.1 10-Nov-2011  yamt sync with head
 1.107.2.3 02-Jun-2012  mrg sync to latest -current.
 1.107.2.2 29-Apr-2012  mrg sync to latest -current.
 1.107.2.1 18-Feb-2012  mrg merge to -current.
 1.108.2.1 12-Jan-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1001):
sys/arch/x68k/x68k/machdep.c: revision 1.187
sys/arch/x68k/x68k/locore.s: revision 1.111
sys/arch/x68k/x68k/pmap_bootstrap.c: revision 1.60
Probe extended memories before pmap_boostrap() for actual fix of PR/45915.
Also expand expected maximum extended memory regions to recognize
upto 1008 MB RAM that is supported by the XM6i emulator.
See my post on port-x68k@ for more details:
http://mail-index.NetBSD.org/port-x68k/2013/10/19/msg000039.html
Probably worth to pullup to netbsd-6.
 1.110.4.1 18-May-2014  rmind sync with head
 1.110.2.2 03-Dec-2017  jdolecek update from HEAD
 1.110.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.117.2.1 10-Aug-2014  tls Rebase.
 1.118.4.1 22-Sep-2015  skrll Sync with HEAD
 1.119.18.1 10-Jun-2019  christos Sync with HEAD
 1.119.16.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.121.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.133.2.1 02-Aug-2025  perseant Sync with HEAD
 1.213 19-Jan-2024  thorpej Now that we've agreed on the name "intr_depth", let's agree on the type, too.
 1.212 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.211 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.210 28-Mar-2023  andvar s/interrput/interrupt/ and s/accesss/access/ in comments.
 1.209 16-Jul-2022  isaki The system should halt if the powerdown fails.
On X680x0 hardware, front power button is an alternate switch.
If the power button is left on, the power will not turn off.
In addition, with this change, power_switch_is_off in powsw.c is
no longer necessary.
 1.208 25-Jun-2022  isaki Fix build without EXTENDED_MEMORY.
 1.207 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.206 06-Aug-2021  isaki Fix broken mm_md_physacc().
- Fix access to main memory and extended memory.
This makes /dev/mem work again.
- Introduce kauth(9) to access unmanaged memory area.
Now you can read/write the internal I/O space via /dev/mem when
securelevel = -1.
Thanks ryo@, tsutsui@ for advices and reviews.
 1.205 11-Feb-2021  tsutsui Fix a message for NMI.

Maybe the "keyboard NMI" message was derived from hp300 but
on X68030 NMI is triggered by the NMI button, and there is no
parity check.
 1.204 07-Feb-2021  tsutsui Restore fixes for PR/51663 lost in r1.195 (uvm_hotplug(9) merge).

The kernel crashdump and savecore(8) on NetBSD/x68k have been broken
(even without EXTNEDED_MEMORY) since NetBSD 8.0. Oops.

Should be pulled up to netbsd-9 and netbsd-8.
 1.203 11-Jun-2020  ad branches: 1.203.2;
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.202 31-Dec-2019  ad Rename uvm_free() -> uvm_availmem().
 1.201 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.200 04-Apr-2019  isaki branches: 1.200.4;
Remove cpuspeed info for 68060.
- On 68060, it's not accurate so worthless.
- I don't have 68040 so I leave it untouched.
 1.199 04-Apr-2019  isaki Display 68060 revision. From amiga/amiga/machdep.c.
 1.198 14-Mar-2019  thorpej G/C "MAPPECOPY". It is the deadest of wood, and never actually worked in
NetBSD.
 1.197 15-Sep-2017  christos branches: 1.197.4;
pass the correct argument
 1.196 03-Apr-2017  christos branches: 1.196.4; 1.196.6;
PR/52135: David Binderman: Fix loop bounds checking.
 1.195 23-Dec-2016  cherry branches: 1.195.2;
"Make NetBSD great again!"

Introduce uvm_hotplug(9) to the kernel.

Many thanks, in no particular order to:

TNF, for funding the project.

Chuck Silvers - for multiple API reviews and feedback.
Nick Hudson - for testing on multiple architectures and bugfix patches.
Everyone who helped with boot testing.

KeK (http://www.kek.org.in) for hosting the primary developers.
 1.194 02-Dec-2016  tsutsui Fix crashdump on machines with EXTENDED_MEMORY.

PR port-x68k/51663 from Rin Okuyama.
 1.193 14-Jun-2016  isaki branches: 1.193.2;
In XM6 TypeG (and original XM6), its version number is
represented by BCD, not decimal.
Reported by GIMONS (the author of XM6 typeG).
 1.192 16-Sep-2015  isaki To turn off the power, it's necessary to turn off the alarm signal
of RTC before writing the system port. This is a fix for rev 1.191.
Thanks to Y.Sugahara.
Should be pulled up to netbsd-7.
 1.191 26-Mar-2014  isaki branches: 1.191.4; 1.191.6;
Implement the software power-off (correctly) when RB_POWERDOWN is
specified. Before this, the kernel doesn't turn off the power in fact,
and thus the power off had happened in IPLROM after software reset.

Many thanks to tsutsui@ on port-x68k.
 1.190 26-Mar-2014  christos kill sprintf, fix unused.
 1.189 24-Mar-2014  christos use cpu_{g,s}etmodel
 1.188 22-Mar-2014  tsutsui Remove obsolete ssir stuff which was used for pre-5.0 softintr(9).

No visible problem on X68030.
 1.187 27-Oct-2013  tsutsui Probe extended memories before pmap_boostrap() for actual fix of PR/45915.

Also expand expected maximum extended memory regions to recognize
upto 1008 MB RAM that is supported by the XM6i emulator.

See my post on port-x68k@ for more details:
http://mail-index.NetBSD.org/port-x68k/2013/10/19/msg000039.html

Probably worth to pullup to netbsd-6.
 1.186 22-Jan-2013  isaki branches: 1.186.2;
Detect emulators (and display it on dmesg).
 1.185 30-Jul-2012  christos branches: 1.185.2;
Remove extra definition of physmem (locore sets it anyway). Someone please
check.
 1.184 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.183 16-May-2012  isaki - Remove duplicated declarations.
- Make declaration of doboot() "extern" explicitly.
 1.182 06-May-2012  tsutsui Make x68k's floppy driver actually work with proper bounce buffer xfer ops
on machines with extended high memories:

- dev/fd.c:
- add missing bus_dmamap_sync(9) POSTREAD/POSTWRITE ops

- x68k/machdep.c:
- update avail_end variable (which is used to check DMA'able memory range
in intio.c) properly per probed extended memory regions

The problem was found during debugging XM6i's FDC emulation by
Y.Sugahara, isaki@, and me.

Should be pulled up to netbsd-6.
 1.181 29-Jan-2012  isaki branches: 1.181.2;
Make it compile with EM_DEBUG (..here, EM_ is EXTENDED_MEMORY).
 1.180 21-Jan-2012  tsutsui Give higher priority to faster local memory on uvm_page_physload().
Tested by Y.Sugahara on his 060turbo with 128MB local memory and
this improved even simple benchmark. Ok'ed by isaki@.
 1.179 12-Dec-2011  mrg 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.178 12-Jun-2011  rmind branches: 1.178.2; 1.178.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.177 16-May-2011  tsutsui branches: 1.177.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.176 15-May-2011  tsutsui Misc KNF and cosmetics.
 1.175 14-May-2011  tsutsui Use pmap_kenter_pa(9) for msgbuf memory which is not managed by VM.
 1.174 14-May-2011  tsutsui It's a bit horrible to call uvm_page_physload() from consinit().
Instead, prepare x68k_init() function for pre-main MD initialization as other
m68k ports and move uvm_page_physload() call and msgbuf initialization there.

Tested on X68030, but options EXTENDED_MEMORY is untested.
 1.173 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.172 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.171 17-Jan-2011  tsutsui branches: 1.171.2;
Explicitly include <machine/pcb.h> for struct pcb.
 1.170 13-Nov-2010  uebayasi branches: 1.170.2;
Typon.
 1.169 13-Nov-2010  uebayasi Pull in uvm/uvm.h for vm_nphysseg.
 1.168 10-Nov-2010  uebayasi Use more VM_PHYSMEM_*() accessors. No functional changes.
 1.167 16-Oct-2010  tsutsui Prepare empty module_init_md() for options MODULAR for all other m68k ports.
 1.166 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.165 08-Feb-2010  joerg branches: 1.165.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.164 10-Dec-2009  matt branches: 1.164.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.163 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.162 15-Aug-2009  matt Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for us.
 1.161 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.160 21-Jan-2009  he branches: 1.160.2;
Re-adapt to the changed return types for major() and minor().
 1.159 18-Jan-2009  isaki Clean up header files.
 1.158 17-Jan-2009  isaki Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.157 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.156 14-Jan-2009  isaki Use PRIu64 format to print 64bit dev_t.
 1.155 03-Jan-2009  isaki rtclockinit() and range_test*() were removed in rtclock.c,v 1.19.
 1.154 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.153 25-Nov-2008  ad dumpsys: don't spew numbers into the log.
 1.152 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.151 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.150 02-Jul-2008  ad branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.149 25-Jun-2008  isaki Cosmetic change. Sort IPL_XXX as described in spl(9).
 1.148 23-Jun-2008  isaki Unify splraiseipl(9) implementation among m68k ports,
discussed with tsutsui@ on port-m68k.

For x68k:
- export ipl2psl_table[] and make it uint16_t
- make makeiplcookie(9) inline
- put PSL_S bit into ipl2psl_table[] rather than adding it in makeiplcookie(9)
- define both IPL_SCHED and IPL_HIGH independently to avoid confusion
 1.147 23-May-2008  isaki branches: 1.147.2;
Initialize IPL_SERIAL. Analysed by tsutsui@.
Fixed kern/38684 (and other many panics).
 1.146 03-Dec-2007  ad branches: 1.146.14; 1.146.16; 1.146.18; 1.146.20;
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.145 17-Oct-2007  garbled branches: 1.145.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.144 14-Jul-2007  isaki branches: 1.144.8; 1.144.10;
Declare candbtimer_ch earlier.
 1.143 09-Jul-2007  ad Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.142 19-May-2007  isaki Adapt to the merge of yamt-idlelwp branch.
tested on my X68030.
 1.141 12-May-2007  isaki Clean up white spaces and tabs.
 1.140 29-Apr-2007  isaki branches: 1.140.2;
Remove obsoleted #undef.
 1.139 05-Mar-2007  he branches: 1.139.2; 1.139.4;
Cast to char* before doing pointer arithmetic.
 1.138 05-Mar-2007  tsutsui Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
 1.137 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.136 04-Mar-2007  tsutsui Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.135 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.134 09-Feb-2007  ad branches: 1.134.2;
Merge newlock2 to head.
 1.133 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.132 04-Aug-2006  mhitch branches: 1.132.4; 1.132.6;
gcc4 fix: gcc4 bug generates a label twice. This label can't be conveniently
ignored like bpendtsleep, but a clue from the commit skipping the bpendtsleep
label for vax provides a workaround. Move the label to an earlier location
and gcc4 only generates one label. The label just marks the start of
memory protected during a memory test, so excluding a little more memory
from that test should be fine.
 1.131 24-Dec-2005  perry branches: 1.131.4; 1.131.8;
bare asm -> __asm
 1.130 11-Dec-2005  christos merge ktrace-lwp.
 1.129 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.128 13-Jun-2005  he branches: 1.128.2; 1.128.4;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.127 25-Apr-2005  lukem 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.126 18-Jan-2005  chs branches: 1.126.6;
de-__P, remove register, ansify.
 1.125 24-Mar-2004  atatat branches: 1.125.8;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
 1.124 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.123 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.122 01-Nov-2003  jdolecek mem_exists(): pacify one apparently bogus -Wuninitialized warning

setmemrange(): add default case for cputype (same as CPU_68030), to fix
a potential uninitialized use
 1.121 01-Nov-2003  jdolecek drop register qualifiers
 1.120 27-Sep-2003  cl Cast through (void *) to appease gcc3.
 1.119 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.118 15-Jul-2003  lukem rcsid
 1.117 29-Jun-2003  fvdl branches: 1.117.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.116 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.115 01-May-2003  he Move inclusion of "ksyms.h" up to above first test for NKSYMS, so that
this compiles again.
 1.114 26-Apr-2003  ragge Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.113 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.112 23-Mar-2003  isaki Make it compilable after something is modified..
 1.111 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.110 28-Oct-2002  chs untangle includes a bit:
don't include cpu.h in pmap.h, nor cacheops.h in cpu.h. instead,
include cpu.h and cacheops.h in just those .c files that need them.
 1.109 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.108 19-Sep-2002  ragge Do not include <sys/clist.h>, it's not used in NetBSD at all.
 1.107 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.106 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.105 20-Mar-2002  christos branches: 1.105.4;
kill remaining PS_STRINGS instances.
 1.104 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.103 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.102 05-Dec-2001  atatat It's not called "opt_fpuemulate.h", it's called "opt_fpu_emulate.h". :)
 1.101 25-Nov-2001  minoura Surround a conditionally used varable with #if.
 1.100 10-Sep-2001  chris branches: 1.100.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.99 02-Jun-2001  chs branches: 1.99.2; 1.99.4;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.98 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.97 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.96 22-Mar-2001  minoura A bit of ELF support. From scw.
 1.95 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.94 01-Mar-2001  minoura branches: 1.94.2;
Sync with news68k:
Remove unneeded COMPAT_HPUX stuff.
 1.93 21-Feb-2001  minoura Remove some redundant decls.
Fix some nested decls.
 1.92 20-Feb-2001  minoura Fix some nested extern declarations.
From syssrc/sys/arch/news68k/news68k/machdep.c:1.16.
 1.91 18-Dec-2000  minoura %reg -> %%reg in asm() directive.
 1.90 08-Dec-2000  itohy Add register prefix in asm() directives.
 1.89 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.88 26-Aug-2000  minoura Set fputype earlier, before proc0 initialization.
 1.87 28-Jul-2000  minoura Prototype netintr().
 1.86 02-Jul-2000  cgd undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h
 1.85 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.84 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.83 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.82 05-Jun-2000  jhawk branches: 1.82.2;
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.81 26-May-2000  thorpej branches: 1.81.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.80 18-Apr-2000  minoura Explicitly include opt_m680x0.h.
 1.79 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.78 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.77 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.76 19-Jan-2000  thorpej Move callout initialization to a single location; no need to duplicate
that code all over the place.
 1.75 17-Jan-2000  minoura Wrong () balance in dumpsize calculation.
 1.74 04-Dec-1999  ragge CL* discarding.
 1.73 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.72 12-Sep-1999  chs branches: 1.72.2; 1.72.4; 1.72.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.71 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.70 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.69 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.68 13-May-1999  minoura 060 is much faster than Chuck thought according to Ken Midorikawa
<k-mid@msg.biglobe.ne.jp>
Print both the core clock and the bus clock on 040/060 machines.
 1.67 05-May-1999  minoura Use mvme68k-derived delay routine.
Now that we support various models, the old constant-loop delay routine
may cause problems.
 1.66 05-May-1999  minoura Move config_console to ensure that it is always called.
 1.65 05-May-1999  minoura mem_exists was called with wrong 2nd argument.
Because of this, >12MB high memory was not detected.
 1.64 28-Apr-1999  minoura Message cosmetics.
 1.63 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.62 25-Apr-1999  simonb g/c REAL_CLISTS.
 1.61 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.60 01-Apr-1999  thorpej branches: 1.60.2;
Don't call configure() from cpu_startup().
 1.59 31-Mar-1999  minoura Mapped copy was always disabled.
 1.58 30-Mar-1999  minoura defopt EXTENDED_MEMORY and ITE_KERNEL_ATTR.
 1.57 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.56 24-Mar-1999  minoura G/c amiga's key repeat handler.
 1.55 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.54 23-Mar-1999  minoura u?vm_page_physload args are in page.
 1.53 23-Mar-1999  minoura Move high-memory detect routine.
This seems to fix the problem that it hangs up on 040turbo without
high-memory.
 1.52 18-Mar-1999  minoura Remove extra ;. Extended memory could not be added correctly.
 1.51 17-Mar-1999  minoura Crash dump support.
It was broken for long time because of somewhat unknown reasons.
 1.50 17-Mar-1999  minoura MACHINE_NONCONTIG -> EXTENDED_MEMORY.
 1.49 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.48 27-Feb-1999  scottr defopt BUFCACHE and BUFPAGES.
 1.47 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.46 09-Jan-1999  thorpej Garbage-collect `mbutl'.
 1.45 29-Nov-1998  minoura branches: 1.45.4;
BUFCACHE option.
 1.44 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.43 01-Sep-1998  minoura Typo.
 1.42 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.41 05-Aug-1998  minoura Switched to MI zs driver.
 1.40 05-Aug-1998  minoura Fixed typo.
 1.39 04-Aug-1998  minoura RB_POWERDOWN is now supported.
Check if the power switch is open (off) in the shutdown_hook,
and try removing the power in cpu_reboot.
poffd default action is now shutdown -p.
 1.38 08-Jul-1998  thorpej Define one page free list, and put all pages on it.
 1.37 05-Jul-1998  jonathan * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
 1.36 05-Jul-1998  jonathan defopt NS, NSIP.
 1.35 05-Jul-1998  jonathan defopt ISO TPIP.
 1.34 05-Jul-1998  jonathan defopt CCITT.
 1.33 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.32 04-Jul-1998  jonathan defopt DDB.
 1.31 30-Jun-1998  msaitoh sync with -current after a long silence
 1.30 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.29 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.28 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.27 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.26 19-Feb-1998  thorpej Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.
 1.25 24-Jan-1998  mycroft When dumping, print out the device number as major,minor.
 1.24 19-Oct-1997  oki branches: 1.24.2;
pretty message.
 1.23 19-Oct-1997  oki Use common m68k/sig_machdep.c.
 1.22 19-Oct-1997  oki Make this compile again.
 1.21 12-Oct-1997  oki call arpintr() if NARP > 0.
 1.20 12-Oct-1997  oki Added prototypes.
 1.19 10-Oct-1997  oki Remove use of register.
 1.18 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.17 12-Sep-1997  mycroft Set the status word as well, and remove a bogus comment.
 1.16 12-Sep-1997  mycroft Eliminate some uses of FPCOPROC.
 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 12-Jun-1997  mrg branches: 1.13.4; 1.13.6;
bring mrg-vm-swap2 onto mainilne.
 1.12 08-Jun-1997  veego Initialize machine from MACHINE.
 1.11 09-Apr-1997  thorpej branches: 1.11.2;
Garbage-collect regdump() and friends.
 1.10 03-Apr-1997  christos Add netatalk netisr
 1.9 27-Mar-1997  thorpej Don't allocate mclrefcnt[]; it's dead and gone.
 1.8 26-Mar-1997  gwr Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/
 1.7 04-Feb-1997  oki branches: 1.7.2;
hit any key to reboot when halted (like hp300)
 1.6 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.5 13-Oct-1996  christos backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 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.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.7.2.1 12-Feb-1997  mrg don't allocate swap map in allocsys.
 1.11.2.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 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.3 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.4.2 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.24.2.1 13-Oct-1998  cgd work around broken extended memory detection, via patch. (minoura)
 1.45.4.4 14-Mar-1999  minoura Sync.
 1.45.4.3 31-Jan-1999  minoura Sync.
 1.45.4.2 30-Jan-1999  minoura Added DMAC driver.
 1.45.4.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.60.2.7 17-Jan-2000  he Pull up revision 1.75 (requested by minoura):
Fix wrong () balance in dumpsize calculation.
 1.60.2.6 25-Jun-1999  perry pullup 1.67->1.68 (minoura)
 1.60.2.5 24-Jun-1999  perry pullup 1.66->1.67 (minoura): Use mvme68k-derived delay() routine
 1.60.2.4 22-Jun-1999  perry pullup 1.65->1.66 (minoura)
 1.60.2.3 21-Jun-1999  perry pullup 1.64->1.65 (minoura)
 1.60.2.2 21-Jun-1999  perry pullup 1.63->1.64 (minoura)
 1.60.2.1 16-Apr-1999  chs branches: 1.60.2.1.2; 1.60.2.1.4;
pull up 1.60 -> 1.61:
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.60.2.1.4.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.60.2.1.4.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.60.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.60.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.72.8.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.5 27-Mar-2001  bouyer Sync with HEAD.
 1.72.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.72.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.72.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 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.81.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.82.2.1 31-Aug-2000  minoura Pullup rev.1.88. Approved by thorpej.
Set fputype earlier, before proc0 initialization.
 1.94.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.94.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.99.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.99.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.99.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.99.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.99.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.99.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.99.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.100.4.13 11-Nov-2002  nathanw Catch up to -current
 1.100.4.12 18-Oct-2002  nathanw Catch up to -current.
 1.100.4.11 05-Oct-2002  gmcgarry LWPify
 1.100.4.10 17-Sep-2002  nathanw Catch up to -current.
 1.100.4.9 27-Aug-2002  nathanw Catch up to -current.
 1.100.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.100.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.100.4.6 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.100.4.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.100.4.4 08-Jan-2002  nathanw Catch up to -current.
 1.100.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.100.4.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.100.4.1 10-Sep-2001  scw file machdep.c was added on branch nathanw_sa on 2001-11-18 18:44:19 +0000
 1.105.4.2 31-Aug-2002  gehenna catch up with -current.
 1.105.4.1 17-May-2002  gehenna Replace the access to devsw table and the hard-coded major with devsw API.
 1.117.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.117.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.117.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.117.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.117.2.2 03-Aug-2004  skrll Sync with HEAD
 1.117.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.125.8.1 29-Apr-2005  kent sync with -current
 1.126.6.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.128.4.1 02-Nov-2005  yamt sync with head.
 1.128.2.5 07-Dec-2007  yamt sync with head
 1.128.2.4 03-Sep-2007  yamt sync with head.
 1.128.2.3 26-Feb-2007  yamt sync with head.
 1.128.2.2 30-Dec-2006  yamt sync with head.
 1.128.2.1 21-Jun-2006  yamt sync with head.
 1.131.8.1 11-Aug-2006  yamt sync with head
 1.131.4.1 09-Sep-2006  rpaulo sync with head
 1.132.6.1 22-Oct-2006  yamt sync with head
 1.132.4.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.132.4.1 18-Nov-2006  ad Sync with head.
 1.134.2.4 17-May-2007  yamt sync with head.
 1.134.2.3 07-May-2007  yamt sync with head.
 1.134.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.134.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.139.4.1 11-Jul-2007  mjf Sync with head.
 1.139.2.3 03-Dec-2007  ad Sync with HEAD.
 1.139.2.2 15-Jul-2007  ad Sync with head.
 1.139.2.1 27-May-2007  ad Sync with head.
 1.140.2.2 03-Oct-2007  garbled Sync with HEAD
 1.140.2.1 22-May-2007  matt Update to HEAD.
 1.144.10.2 09-Jan-2008  matt sync with HEAD
 1.144.10.1 06-Nov-2007  matt sync with HEAD
 1.144.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.145.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.146.20.4 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.146.20.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.146.20.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.146.20.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.146.18.4 11-Aug-2010  yamt sync with head.
 1.146.18.3 11-Mar-2010  yamt sync with head
 1.146.18.2 19-Aug-2009  yamt sync with head.
 1.146.18.1 04-May-2009  yamt sync with head.
 1.146.16.1 04-Jun-2008  yamt sync with head
 1.146.14.4 17-Jan-2009  mjf Sync with HEAD.
 1.146.14.3 02-Jul-2008  mjf Sync with HEAD.
 1.146.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.146.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.147.2.2 03-Jul-2008  simonb Sync with head.
 1.147.2.1 27-Jun-2008  simonb Sync with head.
 1.150.6.1 02-Feb-2009  snj Pull up following revision(s) (requested by ad in ticket #346):
sys/arch/alpha/alpha/machdep.c: revision 1.311
sys/arch/amiga/amiga/machdep.c: revision 1.211
sys/arch/atari/atari/machdep.c: revision 1.153
sys/arch/hp700/hp700/machdep.c: revision 1.53
sys/arch/i386/i386/dumpsys.c: revision 1.5
sys/arch/mips/mips/mips_machdep.c: revision 1.206
sys/arch/mvme68k/mvme68k/machdep.c: revision 1.132
sys/arch/news68k/news68k/machdep.c: revision 1.75
sys/arch/next68k/next68k/machdep.c: revision 1.88
sys/arch/sparc/sparc/machdep.c: revision 1.285
sys/arch/sparc64/sparc64/machdep.c: revision 1.230
sys/arch/sun2/sun2/machdep.c: revision 1.56
sys/arch/sun3/sun3/machdep.c: revision 1.188
sys/arch/sun3/sun3x/machdep.c: revision 1.114
sys/arch/x68k/x68k/machdep.c: revision 1.153
dumpsys: don't spew numbers into the log.
 1.150.4.2 03-Mar-2009  skrll Sync with HEAD.
 1.150.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.150.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.160.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.164.2.4 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.164.2.3 17-Aug-2010  uebayasi Sync with HEAD.
 1.164.2.2 30-Apr-2010  uebayasi Sync with HEAD.
 1.164.2.1 28-Apr-2010  uebayasi Always use struct vm_physseg *vm_physmem_ptrs[] in MD code.
 1.165.2.5 31-May-2011  rmind sync with head
 1.165.2.4 05-Mar-2011  rmind sync with head
 1.165.2.3 03-Jul-2010  rmind sync with head
 1.165.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.165.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.170.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.171.2.2 05-Mar-2011  bouyer Sync with HEAD
 1.171.2.1 17-Feb-2011  bouyer Sync with HEAD
 1.177.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.178.6.2 02-Jun-2012  mrg sync to latest -current.
 1.178.6.1 18-Feb-2012  mrg merge to -current.
 1.178.2.5 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.178.2.4 23-Jan-2013  yamt sync with head
 1.178.2.3 30-Oct-2012  yamt sync with head
 1.178.2.2 23-May-2012  yamt sync with head.
 1.178.2.1 17-Apr-2012  yamt sync with head
 1.181.2.2 12-Jan-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1001):
sys/arch/x68k/x68k/machdep.c: revision 1.187
sys/arch/x68k/x68k/locore.s: revision 1.111
sys/arch/x68k/x68k/pmap_bootstrap.c: revision 1.60
Probe extended memories before pmap_boostrap() for actual fix of PR/45915.
Also expand expected maximum extended memory regions to recognize
upto 1008 MB RAM that is supported by the XM6i emulator.
See my post on port-x68k@ for more details:
http://mail-index.NetBSD.org/port-x68k/2013/10/19/msg000039.html
Probably worth to pullup to netbsd-6.
 1.181.2.1 09-May-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #236):
sys/arch/x68k/x68k/machdep.c: revision 1.182
sys/arch/x68k/dev/fd.c: revision 1.97
Make x68k's floppy driver actually work with proper bounce buffer xfer ops
on machines with extended high memories:
- dev/fd.c:
- add missing bus_dmamap_sync(9) POSTREAD/POSTWRITE ops
- x68k/machdep.c:
- update avail_end variable (which is used to check DMA'able memory range
in intio.c) properly per probed extended memory regions
The problem was found during debugging XM6i's FDC emulation by
Y.Sugahara, isaki@, and me.
Should be pulled up to netbsd-6.
 1.185.2.3 03-Dec-2017  jdolecek update from HEAD
 1.185.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.185.2.1 25-Feb-2013  tls resync with head
 1.186.2.1 18-May-2014  rmind sync with head
 1.191.6.5 28-Aug-2017  skrll Sync with HEAD
 1.191.6.4 05-Feb-2017  skrll Sync with HEAD
 1.191.6.3 05-Dec-2016  skrll Sync with HEAD
 1.191.6.2 09-Jul-2016  skrll Sync with HEAD
 1.191.6.1 22-Sep-2015  skrll Sync with HEAD
 1.191.4.2 06-Dec-2016  snj Pull up following revision(s) (requested by tsutsui in ticket #1282):
sys/arch/x68k/x68k/machdep.c: revision 1.194
Fix crashdump on machines with EXTENDED_MEMORY.
PR port-x68k/51663 from Rin Okuyama.
 1.191.4.1 05-Nov-2015  riz branches: 1.191.4.1.2;
Pull up following revision(s) (requested by isaki in ticket #983):
sys/arch/x68k/x68k/machdep.c: revision 1.192
To turn off the power, it's necessary to turn off the alarm signal
of RTC before writing the system port. This is a fix for rev 1.191.
Thanks to Y.Sugahara.
Should be pulled up to netbsd-7.
 1.191.4.1.2.1 18-Jan-2017  skrll Sync with netbsd-5
 1.193.2.3 26-Apr-2017  pgoyette Sync with HEAD
 1.193.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.193.2.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.195.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.196.6.1 11-Feb-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1654):

sys/arch/x68k/x68k/machdep.c: revision 1.204

Restore fixes for PR/51663 lost in r1.195 (uvm_hotplug(9) merge).

The kernel crashdump and savecore(8) on NetBSD/x68k have been broken
(even without EXTNEDED_MEMORY) since NetBSD 8.0. Oops.

Should be pulled up to netbsd-9 and netbsd-8.
 1.196.4.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.197.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.197.4.1 10-Jun-2019  christos Sync with HEAD
 1.200.4.1 11-Feb-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1205):

sys/arch/x68k/x68k/machdep.c: revision 1.204

Restore fixes for PR/51663 lost in r1.195 (uvm_hotplug(9) merge).

The kernel crashdump and savecore(8) on NetBSD/x68k have been broken
(even without EXTNEDED_MEMORY) since NetBSD 8.0. Oops.

Should be pulled up to netbsd-9 and netbsd-8.
 1.203.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.7 07-Aug-2021  thorpej 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-May-2012  tsutsui branches: 1.5.54;
com at mainbus was gone.
http://mail-index.NetBSD.org/source-changes/2012/04/29/msg034022.html
 1.4 16-Oct-2011  isaki branches: 1.4.2; 1.4.6;
Switch to 2-clause license.
 1.3 31-Dec-2008  isaki branches: 1.3.2; 1.3.4; 1.3.8;
Remove a meaningless "*" @ mainbus.
 1.2 21-Dec-2008  isaki par(4) is a child of intio(4) (since 2000).
 1.1 21-Dec-2008  isaki Take out mainbus(4)-related code from autoconf.c and make it mainbus.c.
 1.3.8.2 04-May-2009  yamt sync with head.
 1.3.8.1 31-Dec-2008  yamt file mainbus.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:09 +0000
 1.3.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.4.1 31-Dec-2008  skrll file mainbus.c was added on branch nick-hppapmap on 2009-01-19 13:17:08 +0000
 1.3.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.2.1 31-Dec-2008  mjf file mainbus.c was added on branch mjf-devfs2 on 2009-01-17 13:28:37 +0000
 1.4.6.1 02-Jun-2012  mrg sync to latest -current.
 1.4.2.1 23-May-2012  yamt sync with head.
 1.5.54.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.6.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.41 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.40 08-Feb-2011  rmind branches: 1.40.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.39 13-Nov-2010  uebayasi branches: 1.39.2; 1.39.4;
Typon.
 1.38 13-Nov-2010  uebayasi Pull in uvm/uvm.h for vm_nphysseg.
 1.37 10-Nov-2010  uebayasi Use more VM_PHYSMEM_*() accessors. No functional changes.
 1.36 05-Mar-2007  tsutsui branches: 1.36.40; 1.36.64; 1.36.66;
Remove an unnecessary cast and use (char *) on pointer arith.
 1.35 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.34 11-Dec-2005  christos branches: 1.34.26;
merge ktrace-lwp.
 1.33 18-Jan-2005  chs branches: 1.33.8;
de-__P, remove register, ansify.
 1.32 07-Aug-2003  agc branches: 1.32.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.31 15-Jul-2003  lukem rcsid
 1.30 01-Apr-2003  thorpej branches: 1.30.2;
Use PAGE_SIZE rather than NBPG.
 1.29 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.28 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.27 27-Feb-2002  christos branches: 1.27.8;
- Use DEV_ constants, instead of documenting the numbers!
- Delete cdev_decl(mm); where appropriate, and other hand-crufting [hi powerpc!]
 1.26 10-Sep-2001  chris branches: 1.26.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.25 24-Apr-2001  thorpej branches: 1.25.2; 1.25.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.24 21-Feb-2001  minoura branches: 1.24.2;
Use m68k_page_offset and m68k_trunc_page macros,
instead of using PGOFSET directly.
 1.23 21-Feb-2001  minoura Remove some redundant decls.
Fix some nested decls.
 1.22 11-Jan-2001  minoura isinram() argument is not a virtual address but a physical address.
 1.21 11-Jan-2001  minoura X68k's physical RAM is not at lowram-0xffffffff, but has multiple segments.
 1.20 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.19 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.18 10-Mar-2000  minoura branches: 1.18.4;
Sync. with news68k/news68k/mem.c:1.2.
 1.17 04-Dec-1999  ragge CL* discarding.
 1.16 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.15 27-Mar-1999  mycroft branches: 1.15.8; 1.15.10; 1.15.14;
Oops; vm_offset_t -> vaddr_t.
 1.14 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.13 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.12 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.11 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.10 30-Jun-1998  msaitoh sync with -current after a long silence
 1.9 07-May-1998  kleink Fix some arithmetics lossage on typeless pointers.
 1.8 10-Oct-1997  oki branches: 1.8.2;
Remove use of register.
 1.7 10-Oct-1997  oki Add missing prototypes.
 1.6 10-Jun-1997  veego branches: 1.6.4;
s/x68k_btop/m68k_btop/
 1.5 02-Feb-1997  thorpej zeropage -> devzeropage, and make it static.
 1.4 19-May-1996  oki 'unlock' label is used for #ifndef DEBUG, my previous change
is bogus.
 1.3 19-May-1996  oki Added 'unlock' label for #ifdef DEBUG,
 1.2 16-May-1996  oki fixed gcc -Wall warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.6.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.2.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.15.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.10.1 15-Nov-1999  fvdl Sync with -current
 1.15.8.3 12-Mar-2001  bouyer Sync with HEAD.
 1.15.8.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.15.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.18.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.24.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.25.4.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.25.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.25.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.25.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.25.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.26.4.4 11-Nov-2002  nathanw Catch up to -current
 1.26.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.26.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.26.4.1 10-Sep-2001  nathanw file mem.c was added on branch nathanw_sa on 2002-02-28 04:12:41 +0000
 1.27.8.1 17-May-2002  gehenna Add the character device switch.
 1.30.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.30.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.30.2.1 03-Aug-2004  skrll Sync with HEAD
 1.32.8.1 29-Apr-2005  kent sync with -current
 1.33.8.1 03-Sep-2007  yamt sync with head.
 1.34.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.36.66.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.36.64.2 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.36.64.1 28-Apr-2010  uebayasi Always use struct vm_physseg *vm_physmem_ptrs[] in MD code.
 1.36.40.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.39.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.39.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.40.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.82 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.81 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.80 28-Oct-2002  chs untangle includes a bit:
don't include cpu.h in pmap.h, nor cacheops.h in cpu.h. instead,
include cpu.h and cacheops.h in just those .c files that need them.
 1.79 14-Oct-2002  chs merge pte.h for m68k w/ motorola or compatible MMU
(only 4k-page platforms so far).
 1.78 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.77 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.76 08-Mar-2002  thorpej branches: 1.76.6;
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.75 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.74 16-Dec-2001  tsutsui Fix comments for ref-count of PT pages.
 1.73 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.72 06-Dec-2001  minoura Sync with mvme68k.
 1.71 25-Nov-2001  minoura Delete unused variables.
 1.70 24-Nov-2001  isaki fix typo s/68551/68851/ in a comment.
 1.69 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.68 17-Oct-2001  chs branches: 1.68.4;
fix pmap_changebit() to look for the bit in the page attrs
in addition to any PTEs.
 1.67 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.66 26-Jul-2001  minoura branches: 1.66.2;
implement pmap_k{enter_pa,remove}() correctly.
other misc cleanup.
patch written by chs; equivalent to hp300 pmap.c:1.95.
 1.65 02-Jun-2001  chs branches: 1.65.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.64 26-May-2001  chs replace vm_page_t with struct vm_page *.
 1.63 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.62 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.61 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.60 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.59 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.58 21-Feb-2001  minoura branches: 1.58.2;
Remove some redundant decls.
Fix some nested decls.
 1.57 14-Jan-2001  thorpej splimp() -> splvm()
 1.56 11-Jan-2001  minoura Eliminate EIOMAPSIZE.
 1.55 28-Sep-2000  itohy Fix the type of pmap_zero_page_uncached from void (paddr_t) to
boolean_t (paddr_t) to make it compile again.
 1.54 21-Sep-2000  thorpej Make PMAP_PAGEIDLEZERO() return a boolean value. FALSE indidcates
that the page being zero'd was not completed and that page zeroing
should be aborted. This may be used by machine-dependent code doing
slow page access to reduce the latency of running a process that has
become runnable while in the middle of doing a slow page zero.
 1.53 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.52 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.51 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.50 14-May-2000  minoura MD parts of uvm_pageidlezero.
 1.49 18-Apr-2000  minoura Explicitly include opt_m680x0.h.
 1.48 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.47 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.46 16-Sep-1999  minoura branches: 1.46.2; 1.46.4; 1.46.8;
Sync (hp300).
 1.45 16-Sep-1999  minoura Finish PMAP_NEW.
- Wrong argument to pmap_kremove (vm_machdep.c:pagemove()).
- Uninitialized variable (pmap.c:pmap_kremove <- this should be fixed long ago...)
 1.44 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.43 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.42 28-Jun-1999  minoura Correct imbalance #if.
 1.41 18-Jun-1999  minoura Reduce TLB operations.
 1.40 17-Jun-1999  thorpej pmap_change_wiring() -> pmap_unwire().
 1.39 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.38 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.37 03-Jun-1999  minoura Could not be compiled without PMAP_NEW.
 1.36 31-May-1999  minoura First attempt to implement PMAP_NEW interface.
The code was mostly written before the pmap_k* inconsistency fixes.
Work around might still remain. Should be removed.
 1.35 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.34 21-May-1999  minoura Tribial optimizations.
 1.33 19-May-1999  minoura Disable on-chip cache for PT and ST pages for '060 stability.
 1.32 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.31 27-Mar-1999  mycroft branches: 1.31.2;
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.30 27-Mar-1999  mycroft Oops; forgot to change some pmap_enter() calls.
 1.29 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.28 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.27 17-Mar-1999  minoura Sync hp300's.
- Remove pmapvacflush debugging code (1.63)
- pmap_collect (1.60)
- Use pool allocator (1.59)
- pmap_zero_page, pmap_copy_page improvements (1.58)
- Use PMAP_DPRINTF (1.56)
- pmap_changebit() changes (1.54)
- Remove deprecated PMAPSTATS (1.53)
- Other cosmetic changes
 1.26 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.25 02-Mar-1999  itohy Fix parameter type mismatch.
 1.24 26-Feb-1999  is x68k specific part of fix for PR 6152
 1.23 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.22 11-Oct-1998  chuck branches: 1.22.6;
remove unused share map code from UVM:
- update calls to uvm_unmap_remove/uvm_unmap (mainonly boolean arg
has been removed)
 1.21 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.20 30-Jun-1998  msaitoh sync with -current after a long silence
 1.19 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.18 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.17 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.16 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.15 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.14 06-Jan-1998  thorpej Garbage-collect pm_stchanged; it's not used by anything.
 1.13 06-Jan-1998  thorpej Garbage-collect use of the PCB's copy of the user segment table pointer.
 1.12 01-Jan-1998  thorpej - Make pmap_activate() and pmap_deactivate() take a struct proc *.
- Define active_user_pmap() and use it in the appropriate places (from hp300
port).
 1.11 24-Dec-1997  oki Make compile without options MACHINE_NONCONTIG.
 1.10 16-Oct-1997  oki branches: 1.10.2;
Fixed gcc warnings.
 1.9 10-Oct-1997  oki Remove use of register.
 1.8 10-Oct-1997  oki Add missing prototypes.
 1.7 10-Jun-1997  veego branches: 1.7.4;
s/x68k_trunc_page/m68k_trunc_page/ s/x68k_btop/m68k_btop/
s/x68k_ptob/m68k_ptob/
 1.6 02-Feb-1997  thorpej Use zeropage() in pmap_zero_page()
 1.5 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.7.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.2.2 07-Feb-1998  mellon Pull up 1.15 (ross)
 1.10.2.1 25-Dec-1997  perry pull up from trunk (oki)
 1.22.6.2 14-Mar-1999  minoura Sync.
 1.22.6.1 31-Jan-1999  minoura Sync.
 1.31.2.2 21-Jun-1999  perry pullup 1.32->1.33 (minoura)
 1.31.2.1 26-Apr-1999  perry branches: 1.31.2.1.2; 1.31.2.1.4;
pullup 1.31->1.32 (chuq)
 1.31.2.1.4.1 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.31.2.1.2.3 02-Aug-1999  thorpej Update from trunk.
 1.31.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.31.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.46.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.46.4.1 15-Nov-1999  fvdl Sync with -current
 1.46.2.5 23-Apr-2001  bouyer Sync with HEAD.
 1.46.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.46.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.46.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.46.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.58.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.58.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.65.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.65.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.65.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.65.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.65.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.65.2.1 03-Aug-2001  lukem update to -current
 1.66.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.68.4.10 11-Nov-2002  nathanw Catch up to -current
 1.68.4.9 18-Oct-2002  nathanw Catch up to -current.
 1.68.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.68.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.68.4.6 20-Jun-2002  nathanw Catch up to -current.
 1.68.4.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.68.4.4 08-Jan-2002  nathanw Catch up to -current.
 1.68.4.3 04-Dec-2001  scw Missed a s/proc/lwp/ with DEBUG defined.
Noted by Gregory McGarry in a commit messsage for hp300.
 1.68.4.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.68.4.1 17-Oct-2001  scw file pmap.c was added on branch nathanw_sa on 2001-11-18 18:44:19 +0000
 1.76.6.1 30-May-2002  gehenna Catch up with -current.
 1.62 06-Feb-2023  tsutsui Remove an obsolete comment.
 1.61 22-Dec-2016  cherry physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.
 1.60 27-Oct-2013  tsutsui branches: 1.60.6; 1.60.10;
Probe extended memories before pmap_boostrap() for actual fix of PR/45915.

Also expand expected maximum extended memory regions to recognize
upto 1008 MB RAM that is supported by the XM6i emulator.

See my post on port-x68k@ for more details:
http://mail-index.NetBSD.org/port-x68k/2013/10/19/msg000039.html

Probably worth to pullup to netbsd-6.
 1.59 25-Feb-2012  tsutsui branches: 1.59.2; 1.59.4;
Reserve more bootstrap kernel PT pages if options EXTENDED_MEMORY is defined
for VA allocation in the extended memory probe function and possible 128MB
memory on 060turbo, as worksaround for x68k specific part of PR/45915.
Fixes GENERIC kernel panic on X68030 even without extended memory.
XXX: we should rather have proper probe function before pmap_bootstrap()

Tested on 060turbo with 128MB SIMM by Y.Sugahara, and also
tested on XM6i with 68030 and custom 128MB memory settings by isaki@.

Should be pulled up to netbsd-6.
 1.58 10-Feb-2012  mhitch branches: 1.58.2;
Sigh, it's been too long since I've done some of this. Fix the RELOC().
 1.57 10-Feb-2012  mhitch Oops - have to RELOC(physmem) here.
 1.56 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.55 14-May-2011  tsutsui branches: 1.55.4; 1.55.8;
IODEVbase is the same address as intiobase, so make it an alias macro
and remove now almost empty x68k_init.c.
 1.54 02-Jan-2011  tsutsui branches: 1.54.2;
Tidy up common comments. (Yes, too many dup code...)
 1.53 02-Jan-2011  tsutsui Misc cosmetics to reduce diffs among these ports.
 1.52 25-Dec-2010  tsutsui Fix one more typo that affects x68k with 040/060.
I hope this is the last one...
 1.51 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.50 11-Dec-2009  tsutsui branches: 1.50.2; 1.50.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.49 11-Dec-2009  tsutsui Fix leftover botch in rev 1.48:
Remove initialization of protection_codes[] which has been movde into
pmap_bootstrap_finalize().
 1.48 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.47 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.46 05-Dec-2009  tsutsui Use proper macro, variable names, types, and assignments for readability.
 1.45 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.44 04-Dec-2009  tsutsui No need to initialize lwp0 u-area in pmap_bootstrap()
since it will be done in pmap_bootstrap_finalize().
 1.43 04-Dec-2009  tsutsui Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Also update some comment.
Compile test only.
 1.42 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.41 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.40 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.39 18-Dec-2008  isaki Move external decl. of intiobase: dev/intiovar.h -> include/cpu.h
Move definition of intiobase: x68k/pmap_bootstrap.c -> x68k/locore.s
These synchronize code with other m68k ports.
 1.38 18-Dec-2008  isaki There's no need to use initial value to intiobase and IODEVbase.
They are not refered to before it's initialized in pmap_bootstrap().
 1.37 18-Dec-2008  isaki Swap initialization of intiobase and IODEVbase.
It synchronizes other m68k ports (news68k, mvme68k, ...).
 1.36 17-Oct-2007  garbled branches: 1.36.16; 1.36.20; 1.36.28;
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;
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.34 12-May-2007  isaki Clean up white spaces and tabs.
 1.33 05-Mar-2007  he branches: 1.33.2; 1.33.4; 1.33.10;
Cast to char* before doing pointer arithmetic.
 1.32 05-Mar-2007  tsutsui Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
 1.31 05-Mar-2007  tsutsui - add missed '*'
- vmmap is (char *) in pmap_motorola.h
 1.30 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.29 11-Dec-2005  christos branches: 1.29.26;
merge ktrace-lwp.
 1.28 01-Apr-2005  yamt branches: 1.28.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.27 18-Jan-2005  chs branches: 1.27.2;
de-__P, remove register, ansify.
 1.26 07-Aug-2003  agc branches: 1.26.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.25 15-Jul-2003  lukem rcsid
 1.24 01-Apr-2003  thorpej branches: 1.24.2;
Use PAGE_SIZE rather than NBPG.
 1.23 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.22 21-Jan-2002  nsmrtks Fix uvm fault at startup on 040/060. (patch by minoura)
 1.21 11-Jan-2001  minoura branches: 1.21.4; 1.21.8;
Sync. w/ luna68k; eliminate irrelavant code imposed by
the restriction of hp300 hardware and HP-UX compatibility.
 1.20 11-Jan-2001  minoura Eliminate EIOMAPSIZE.
 1.19 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.18 18-Apr-2000  minoura Explicitly include opt_m680x0.h.
 1.17 23-Mar-1999  minoura branches: 1.17.8;
Move high-memory detect routine.
This seems to fix the problem that it hangs up on 040turbo without
high-memory.
 1.16 17-Mar-1999  minoura MACHINE_NONCONTIG -> EXTENDED_MEMORY.
 1.15 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.14 18-Jan-1999  itohy MACHINE_NEW_NONCONTIG is no longer optional
remove non-MNN code
 1.13 22-Aug-1998  minoura branches: 1.13.6;
Eliminated vm_offset_t and vm_size_t.
 1.12 30-Jun-1998  msaitoh sync with -current after a long silence
 1.11 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.10 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.9 12-Oct-1997  oki branches: 1.9.2;
Fix compiler warnings.
 1.8 10-Oct-1997  oki WARNify, add prototype, remove use of register.
 1.7 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.6 10-Jun-1997  veego branches: 1.6.4;
s/x68k_round_page/m68k_round_page/ s/x68k_trunc_page/m68k_trunc_page/
s/x68k_btop/m68k_btop/ s/x68k_ptob/m68k_ptob/
 1.5 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.6.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.4.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.2.1 13-Oct-1998  cgd work around broken extended memory detection, via patch. (minoura)
 1.13.6.2 31-Jan-1999  minoura Sync.
 1.13.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.17.8.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.17.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.21.8.2 11-Nov-2002  nathanw Catch up to -current
 1.21.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.21.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.24.2.5 01-Apr-2005  skrll Sync with HEAD.
 1.24.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.24.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.8.1 29-Apr-2005  kent sync with -current
 1.27.2.8 27-Feb-2005  tsutsui Fix typo. (s/PG_/SG_/ fot Sysptmap ste)
 1.27.2.7 26-Feb-2005  yamt initialize the last ste for Sysmap.
 1.27.2.6 24-Feb-2005  yamt comments.
 1.27.2.5 23-Feb-2005  yamt sync with other m68k pmaps slightly.
 1.27.2.4 23-Feb-2005  yamt fix a type error.
 1.27.2.3 23-Feb-2005  yamt fix a typo and merge botches.
 1.27.2.2 23-Feb-2005  yamt - remove redundant initialization of l2 descriptors.
- fix a merge botch.
 1.27.2.1 23-Feb-2005  yamt change kernel va layout, following mac68k.
XXX why maps p0upa cache invalidated?
 1.28.2.1 03-Sep-2007  yamt sync with head.
 1.29.26.2 17-May-2007  yamt sync with head.
 1.29.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.33.10.1 22-May-2007  matt Update to HEAD.
 1.33.4.1 11-Jul-2007  mjf Sync with head.
 1.33.2.1 27-May-2007  ad Sync with head.
 1.35.10.1 06-Nov-2007  matt sync with HEAD
 1.36.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.20.3 11-Aug-2010  yamt sync with head.
 1.36.20.2 11-Mar-2010  yamt sync with head
 1.36.20.1 04-May-2009  yamt sync with head.
 1.36.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.50.4.3 31-May-2011  rmind sync with head
 1.50.4.2 05-Mar-2011  rmind sync with head
 1.50.4.1 03-Jul-2010  rmind sync with head
 1.50.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.54.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.55.8.2 04-Mar-2012  mrg sync to latest -current.
 1.55.8.1 18-Feb-2012  mrg merge to -current.
 1.55.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.55.4.1 17-Apr-2012  yamt sync with head
 1.58.2.2 12-Jan-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1001):
sys/arch/x68k/x68k/machdep.c: revision 1.187
sys/arch/x68k/x68k/locore.s: revision 1.111
sys/arch/x68k/x68k/pmap_bootstrap.c: revision 1.60
Probe extended memories before pmap_boostrap() for actual fix of PR/45915.
Also expand expected maximum extended memory regions to recognize
upto 1008 MB RAM that is supported by the XM6i emulator.
See my post on port-x68k@ for more details:
http://mail-index.NetBSD.org/port-x68k/2013/10/19/msg000039.html
Probably worth to pullup to netbsd-6.
 1.58.2.1 27-Feb-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #55):
sys/arch/x68k/x68k/pmap_bootstrap.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.99
Use actual physmem size for allocation of bootstrap extra PT pages
to avoid wasting pages on low memory machines.
Improves atari specific part of PR/45915, tested on TT030.
Reserve more bootstrap kernel PT pages if options EXTENDED_MEMORY is defined
for VA allocation in the extended memory probe function and possible 128MB
memory on 060turbo, as worksaround for x68k specific part of PR/45915.
Fixes GENERIC kernel panic on X68030 even without extended memory.
XXX: we should rather have proper probe function before pmap_bootstrap()
Tested on 060turbo with 128MB SIMM by Y.Sugahara, and also
tested on XM6i with 68030 and custom 128MB memory settings by isaki@.
Should be pulled up to netbsd-6.
 1.59.4.1 18-May-2014  rmind sync with head
 1.59.2.2 03-Dec-2017  jdolecek update from HEAD
 1.59.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.60.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.60.6.1 05-Feb-2017  skrll Sync with HEAD
 1.5 16-Nov-2004  christos moved to m68k/m68k
 1.4 14-Nov-2004  christos Add CPU/FPU information from Radek Kujawa
 1.3 15-Jul-2003  lukem rcsid
 1.2 18-Jan-2001  tv branches: 1.2.24;
No-op commit to force update to a non-"-kk" revision.
 1.1 17-Jan-2001  fvdl branches: 1.1.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.1.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.1.2.1 17-Jan-2001  bouyer file procfs_machdep.c was added on branch thorpej_scsipi on 2001-01-18 09:23:12 +0000
 1.2.24.4 29-Nov-2004  skrll Sync with HEAD.
 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.5 31-Jan-1997  thorpej This file is obsolete; this information is now generated by config(8).
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.26 03-Nov-2002  chs use a merged sys_machdep.c for all the motorola-MMU m68k platforms.
 1.25 28-Oct-2002  chs untangle includes a bit:
don't include cpu.h in pmap.h, nor cacheops.h in cpu.h. instead,
include cpu.h and cacheops.h in just those .c files that need them.
 1.24 19-Dec-2001  minoura Implement bus_dmamap_sync properly.
dma_cachectl is now used only for DMAC array chain.
 1.23 21-Feb-2001  minoura branches: 1.23.4; 1.23.8;
Use m68k_page_offset and m68k_trunc_page macros,
instead of using PGOFSET directly.
 1.22 13-Dec-2000  jdolecek g/c obsolete vtrace(2) stuff
 1.21 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.20 18-Apr-2000  minoura Explicitly include opt_m680x0.h.
 1.19 28-Nov-1999  is Fix typo (&& -> &).
 1.18 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.17 08-Jul-1999  thorpej branches: 1.17.2; 1.17.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.16 24-Mar-1999  minoura branches: 1.16.2; 1.16.4;
Shut up gcc -Wall.
 1.15 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.14 26-Feb-1999  is synchronize types, and s/curproc/p/ in one forgotten place
 1.13 26-Feb-1999  is x68k specific part of fix for PR 6152
 1.12 19-Jan-1999  thorpej No need for <sys/mtio.h>
 1.11 22-Aug-1998  minoura branches: 1.11.6;
Eliminated vm_offset_t and vm_size_t.
 1.10 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.9 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.8 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.7 25-Feb-1998  perry note second parm of sysarch() is now void *, + trivial KNF, etc.
 1.6 10-Oct-1997  oki Remove use of register.
 1.5 19-May-1997  veego branches: 1.5.4;
Fix lossage from the latest vm_pmap changes.
 1.4 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.3 05-Jun-1996  oki fixed compiler error at kvtop().
 1.2 21-May-1996  oki branches: 1.2.2;
Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.2.1 05-Jun-1996  oki pull up from the trunk:
>fixed compiler error at kvtop().
 1.5.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.6.2 14-Mar-1999  minoura Sync.
 1.11.6.1 31-Jan-1999  minoura Sync.
 1.16.4.1 02-Aug-1999  thorpej Update from trunk.
 1.16.2.2 29-Nov-1999  he Pull up revision 1.19 (reqyested by is):
Fix a typo which caused excessive cache flushes.
 1.16.2.1 27-Nov-1999  he Pull up revision 1.18 (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.17.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.17.2.2 05-Jan-2001  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.23.8.5 11-Nov-2002  nathanw Catch up to -current
 1.23.8.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.23.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.23.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.23.8.1 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.23.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.114 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.113 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.112 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.111 16-Sep-2023  andvar remove static from dumpssw() and dumpwb() declarations.

Fixes DEBUG enabled builds for luna68k and x68k.
 1.110 25-Sep-2021  tsutsui 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.109 21-Nov-2019  ad mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.
 1.108 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.107 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.106 04-Mar-2015  martin branches: 1.106.18;
Handle EINVAL in the fault path and send SIGBUS on mmap'd access past EOF
 1.105 19-Feb-2012  rmind branches: 1.105.2; 1.105.16;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.104 08-Feb-2011  rmind branches: 1.104.4; 1.104.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.103 17-Jan-2011  tsutsui branches: 1.103.2;
Explicitly include <machine/pcb.h> for struct pcb.
 1.102 20-Dec-2010  matt branches: 1.102.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.101 07-Jul-2010  chs implement ucas_* for m68k.
 1.100 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.99 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.98 23-Nov-2009  rmind branches: 1.98.2; 1.98.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.97 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.96 15-Oct-2008  wrstuden branches: 1.96.2; 1.96.4;
Merge wrstuden-revivesa into HEAD.
 1.95 24-Apr-2008  ad branches: 1.95.2; 1.95.4; 1.95.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.94 31-Dec-2007  ad branches: 1.94.6; 1.94.8;
Remove COMPAT_HPUX.
 1.93 03-Dec-2007  ad branches: 1.93.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.92 05-Nov-2007  ad branches: 1.92.2;
Don't set l_usrpri / spc_curpriority here. mi_userret() does it.
 1.91 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.90 01-Sep-2007  mhitch branches: 1.90.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.89 12-Jun-2007  mhitch branches: 1.89.4; 1.89.8; 1.89.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.88 19-May-2007  isaki Adapt to the merge of yamt-idlelwp branch.
tested on my X68030.
 1.87 21-Mar-2007  isaki branches: 1.87.4;
Make it compilable with DEBUG.
 1.86 04-Mar-2007  christos branches: 1.86.2; 1.86.4; 1.86.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.85 04-Mar-2007  tsutsui Add MI softintr(9) support for x68k with common m68k/softintr.c.
Tested by isaki@ and Yasushi Oshima.

XXX: x68k/dev/com.c should be rewritten to use MI com(4).
 1.84 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.83 09-Feb-2007  ad branches: 1.83.2;
Merge newlock2 to head.
 1.82 23-Jul-2006  ad branches: 1.82.4; 1.82.8; 1.82.10;
Use the LWP cached credentials where sane.
 1.81 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.80 15-May-2006  yamt include kauth.h for kauth_cred_geteuid.
 1.79 14-May-2006  elad integrate kauth.
 1.78 15-Mar-2006  drochner branches: 1.78.2;
adapt to uvm_fault() interface cleanup: kill the useless 3rd argument
 1.77 25-Feb-2006  wiz branches: 1.77.2; 1.77.4;
Fix some typos.
 1.76 11-Dec-2005  christos branches: 1.76.2; 1.76.4; 1.76.6;
merge ktrace-lwp.
 1.75 13-Jun-2005  he branches: 1.75.2;
Make this build with -Wcast-qual by adding a few consts.
 1.74 18-Jan-2005  chs de-__P, remove register, ansify.
 1.73 28-Aug-2004  jdolecek branches: 1.73.4;
use uvm_grow() to update stack segment size on stack page fault instead
of MD code
 1.72 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.71 08-Nov-2003  tsutsui Remove obsolete comments about curproc.
 1.70 02-Nov-2003  isaki Oops, make it compilable with or without M68040.
 1.69 02-Nov-2003  isaki make it compilable.
 1.68 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.67 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.66 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.65 17-Sep-2003  cl add MD part of SA/pthread pagefault handling on all m68k ports
 1.64 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.63 15-Jul-2003  lukem rcsid
 1.62 01-Apr-2003  thorpej branches: 1.62.2;
Use PAGE_SIZE rather than NBPG.
 1.61 28-Jan-2003  wiz success, not sucess. Noted by mjl.
 1.60 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.59 28-Oct-2002  chs branches: 1.59.2;
untangle includes a bit:
don't include cpu.h in pmap.h, nor cacheops.h in cpu.h. instead,
include cpu.h and cacheops.h in just those .c files that need them.
 1.58 14-Feb-2002  chs allow writing to write-only mappings. fixes PR 3493.
 1.57 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.56 05-Dec-2001  atatat It's not called "opt_fpuemulate.h", it's called "opt_fpu_emulate.h". :)
 1.55 10-Sep-2001  chris branches: 1.55.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.54 02-Jun-2001  chs branches: 1.54.2; 1.54.4;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.53 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.52 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.51 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.50 21-Feb-2001  minoura branches: 1.50.2;
Use m68k_page_offset and m68k_trunc_page macros,
instead of using PGOFSET directly.
 1.49 20-Feb-2001  minoura include sunos_exec.h to declare emul_sunos.
From syssrc/sys/arch/news68k/news68k/trap.c:1.12.
 1.48 15-Jan-2001  thorpej Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.47 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.46 19-Dec-2000  scw Unification of the m68k syscall() function.
 1.45 21-Nov-2000  tsutsui s/struct const sysent/const struct sysent/

(BTW, luna68k was missed in emul/execsw changes?)
 1.44 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.43 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.42 27-Jun-2000  mrg remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h>
 1.41 06-Jun-2000  soren defopt SYSCALL_DEBUG.
 1.40 27-May-2000  sommerfeld branches: 1.40.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.39 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.38 24-May-2000  thorpej Use preempt(), not an open-coded equivalent (which won't be
equivalent for long).
 1.37 18-Apr-2000  minoura Explicitly include opt_m680x0.h.
 1.36 05-Dec-1999  ragge clrnd()/clbase() discarding.
 1.35 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.34 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.33 08-Jul-1999  thorpej branches: 1.33.2; 1.33.4; 1.33.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.32 18-Apr-1999  minoura Handle T_ILLINST in kernel mode.
This occurs in fpu_probe() when the FPU is not installed on the system.
Because of this, FPU_EMULATE wouldn't work at all.
 1.31 26-Mar-1999  mycroft branches: 1.31.2; 1.31.4; 1.31.6;
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.30 24-Mar-1999  minoura Shut up gcc -Wall.
 1.29 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.28 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.27 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.26 15-Dec-1998  itohy branches: 1.26.2;
Added COMPAT_LINUX support.
 1.25 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.24 01-Oct-1998  thorpej Adapt to signal changes.
 1.23 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.22 05-Aug-1998  minoura Switched to MI zs driver.
 1.21 04-Jul-1998  jonathan defopt DDB.
 1.20 30-Jun-1998  msaitoh sync with -current after a long silence
 1.19 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.18 25-Jun-1998  thorpej defopt COMPAT_SUNOS
 1.17 25-Jun-1998  thorpej defopt KTRACE
 1.16 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.15 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.14 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.13 12-Oct-1997  oki Fix compiler warnings.
 1.12 10-Oct-1997  oki Add prototype, remove use of register.
 1.11 12-Sep-1997  mycroft Eliminate some uses of FPCOPROC.
 1.10 08-Jul-1997  kleink branches: 1.10.2; 1.10.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.9 11-Jun-1997  kleink Do not #include the removed <machine/mtpr.h> any more. These definitions are
already living in <machine/cpu.h>.
 1.8 19-May-1997  veego Fix lossage from the latest vm_pmap changes.
 1.7 09-Apr-1997  thorpej regdump() takes a struct trapframe *
 1.6 13-Jan-1997  oki first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.5 13-Oct-1996  christos backout previous kprintf change
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 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.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.10.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.10.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.26.2.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.31.6.1 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.31.4.2 02-Aug-1999  thorpej Update from trunk.
 1.31.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.31.2.2 21-Nov-1999  he Pull up revision 1.34 (requested by itohy):
Fix the problem where single-step tracing of a trap instruction
makes the system fall into kernel debugger.
 1.31.2.1 20-Jun-1999  perry pullup 1.31->1.32 (minoura)
 1.33.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.33.4.1 15-Nov-1999  fvdl Sync with -current
 1.33.2.7 27-Mar-2001  bouyer Sync with HEAD.
 1.33.2.6 12-Mar-2001  bouyer Sync with HEAD.
 1.33.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.33.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.33.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.33.2.2 22-Nov-2000  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.40.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.50.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.50.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.54.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.54.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.54.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.54.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.55.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.55.4.11 11-Nov-2002  nathanw Catch up to -current
 1.55.4.10 05-Oct-2002  gmcgarry LWPify
 1.55.4.9 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.55.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.55.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.55.4.6 28-Feb-2002  nathanw Catch up to -current.
 1.55.4.5 08-Jan-2002  nathanw Catch up to -current.
 1.55.4.4 17-Dec-2001  nathanw cpu_upcall() -> sa_upcall_userret().
 1.55.4.3 25-Nov-2001  scw Deal with `want_resched' with trap()'s T_ASTFLT case where it belongs
instead of in userret().
 1.55.4.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.55.4.1 10-Sep-2001  scw file trap.c was added on branch nathanw_sa on 2001-11-18 18:44:19 +0000
 1.59.2.2 19-Dec-2002  gmcgarry Whitespace
 1.59.2.1 18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.62.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.62.2.5 24-Jan-2005  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.73.4.1 29-Apr-2005  kent sync with -current
 1.75.2.7 21-Jan-2008  yamt sync with head
 1.75.2.6 07-Dec-2007  yamt sync with head
 1.75.2.5 15-Nov-2007  yamt sync with head.
 1.75.2.4 03-Sep-2007  yamt sync with head.
 1.75.2.3 26-Feb-2007  yamt sync with head.
 1.75.2.2 30-Dec-2006  yamt sync with head.
 1.75.2.1 21-Jun-2006  yamt sync with head.
 1.76.6.2 01-Jun-2006  kardel Sync with head.
 1.76.6.1 22-Apr-2006  simonb Sync with head.
 1.76.4.1 09-Sep-2006  rpaulo sync with head
 1.76.2.1 01-Mar-2006  yamt sync with head.
 1.77.4.2 19-Apr-2006  elad sync with head - hopefully this will work
 1.77.4.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.77.2.3 11-Aug-2006  yamt sync with head
 1.77.2.2 24-May-2006  yamt sync with head.
 1.77.2.1 01-Apr-2006  yamt sync with head.
 1.78.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.82.10.2 23-Sep-2007  wrstuden Sync with somewhat-recent netbsd-4.
 1.82.10.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.82.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.82.8.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.82.4.2 06-Feb-2007  ad Update m68k pasteware.
 1.82.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.83.2.3 24-Mar-2007  yamt sync with head.
 1.83.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.83.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.86.6.1 29-Mar-2007  reinoud Pullup to -current
 1.86.4.1 11-Jul-2007  mjf Sync with head.
 1.86.2.5 03-Dec-2007  ad Sync with HEAD.
 1.86.2.4 09-Oct-2007  ad Sync with head.
 1.86.2.3 15-Jul-2007  ad Sync with head.
 1.86.2.2 27-May-2007  ad Sync with head.
 1.86.2.1 10-Apr-2007  ad Sync with head.
 1.87.4.3 03-Oct-2007  garbled Sync with HEAD
 1.87.4.2 26-Jun-2007  garbled Sync with HEAD.
 1.87.4.1 22-May-2007  matt Update to HEAD.
 1.89.10.2 09-Jan-2008  matt sync with HEAD
 1.89.10.1 06-Nov-2007  matt sync with HEAD
 1.89.8.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.89.8.2 06-Nov-2007  joerg Sync with HEAD.
 1.89.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.89.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.90.4.1 13-Nov-2007  bouyer Sync with HEAD
 1.92.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.92.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.93.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.94.8.1 18-May-2008  yamt sync with head.
 1.94.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.94.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.95.8.1 19-Oct-2008  haad Sync with HEAD.
 1.95.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.95.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.95.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.95.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.95.2.3 11-Aug-2010  yamt sync with head.
 1.95.2.2 11-Mar-2010  yamt sync with head
 1.95.2.1 04-May-2009  yamt sync with head.
 1.96.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.96.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.98.4.3 05-Mar-2011  rmind sync with head
 1.98.4.2 03-Jul-2010  rmind sync with head
 1.98.4.1 30-May-2010  rmind sync with head
 1.98.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.98.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.102.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.103.2.1 17-Feb-2011  bouyer Sync with HEAD
 1.104.8.1 24-Feb-2012  mrg sync to -current.
 1.104.4.1 17-Apr-2012  yamt sync with head
 1.105.16.1 06-Apr-2015  skrll Sync with HEAD
 1.105.2.1 03-Dec-2017  jdolecek update from HEAD
 1.106.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.106.18.1 10-Jun-2019  christos Sync with HEAD
 1.19 07-Jan-2024  isaki TAB/space/indent cleanup.
 1.18 14-Mar-2014  tsutsui Sync bus error and address error handlers with other m68k implementation.

Tested on X68030. Needs tests on 040 and 060turbo
(though it should work as other m68k ports).

The x68k port implemented 68060 support including these vector handlers
as early as amiga back in 1996, but even after amiga's locore.s was
improved several times (updating vectors at runtime to switch handlers
per CPU types etc.), x68k's one has not been updated.
After that, atari and mac68k pulled amiga's implementation,
hp300 pulled mac68k, and then most other m68k ports pulled hp300 ones.

Probably that's the reason why only x68k had different implementations
(i.e. no reason that avoids using common handler implementation),
and now it's time to prepare common arch/m68k/m68k/busaddrerr.s.
 1.17 29-Apr-2012  tsutsui branches: 1.17.2; 1.17.4;
Finally switch PSX16550 fast serial board driver to using MI com(4) driver.
Based on isaki@'s patch and debugged by both isaki@ and tsutsui@.

PSX16550 specific hardware infomation is taken from Human68k's PSXIO driver:
http://retropc.net/x68000/software/hardware/psx16550/

XXX1: TL16C550C seems to have some timing critical issue around THRE interrupt
XXX2: auto hardware flow control of TL16C550 is not implemented in MI com(4)
 1.16 08-Feb-2011  rmind branches: 1.16.4; 1.16.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.15 20-Dec-2008  isaki branches: 1.15.6; 1.15.8; 1.15.10;
Make pow(4) a hardware device.
Now pow(4) uses intio_intr_establish() which is a common interrupt
routine, but not powtrap which is a device specific routine.
 1.14 17-Oct-2007  garbled branches: 1.14.16; 1.14.20; 1.14.28;
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.13 12-May-2007  isaki branches: 1.13.10;
Remove an unnecessary semicolon.
 1.12 11-Dec-2005  christos branches: 1.12.26; 1.12.30; 1.12.32; 1.12.38;
merge ktrace-lwp.
 1.11 22-Sep-2003  cl branches: 1.11.16;
SA_SIGINFO support for m68k (port specific changes)
 1.10 11-Jun-2000  minoura branches: 1.10.26;
G/C of unused interrupt stubs, and other cleanups.
 1.9 05-Aug-1999  minoura branches: 1.9.2; 1.9.10;
Make use of _C_LABEL and other macros in m68k/asm.h.
 1.8 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.7 18-Oct-1998  itohy branches: 1.7.6;
Remove unwanted reference to "_trap1" if !defined(COMPAT_13).
 1.6 04-Oct-1998  thorpej 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.5 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.4 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.3 30-Jun-1998  msaitoh sync with -current after a long silence
 1.2 13-Jan-1997  oki branches: 1.2.14;
first commit of M68060 and FPU_EMULATE support.
M68060 support by YAMASAKI Yasushi, few arranged by me.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.14.1 13-Oct-1998  cgd pull up rev 1.3 from trunk (minoura)
 1.7.6.5 14-Mar-1999  minoura scsirom driver to probe CZ-6BS1-clone and Mach-2 SCSI host adaptor board
itself.
Modifications to spc and mha drivers.
NOTE: mha is not fully bus.h'fied.
 1.7.6.4 13-Feb-1999  minoura Handle SPC interrupts via the intiotrap.
GC SCSIDMA.
 1.7.6.3 02-Feb-1999  minoura Delete fdctrap routine.
 1.7.6.2 30-Jan-1999  minoura Added DMAC driver.
 1.7.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.9.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 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.10.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.26.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.1 03-Sep-2007  yamt sync with head.
 1.12.38.1 22-May-2007  matt Update to HEAD.
 1.12.32.1 11-Jul-2007  mjf Sync with head.
 1.12.30.1 27-May-2007  ad Sync with head.
 1.12.26.1 17-May-2007  yamt sync with head.
 1.13.10.1 06-Nov-2007  matt sync with HEAD
 1.14.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.20.1 04-May-2009  yamt sync with head.
 1.14.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.10.1 17-Feb-2011  bouyer Sync with HEAD
 1.15.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.15.6.1 05-Mar-2011  rmind sync with head
 1.16.8.1 29-Apr-2012  mrg sync to latest -current.
 1.16.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.16.4.1 23-May-2012  yamt sync with head.
 1.17.4.1 18-May-2014  rmind sync with head
 1.17.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40 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.39 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.38 27-Dec-2001  wiz bcopy/bcmp/bzero -> memcpy/memcmp/memset
 1.37 10-Sep-2001  chris branches: 1.37.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.36 19-Aug-2001  chs branches: 1.36.2;
use pmap_k* in vmapbuf() and vunmapbuf() since there's no VAC on this platform.

in vunmapbuf(), call pmap_*remove() explicitly since uvm_km_free_wakeup()
will soon no longer do it for us.
 1.35 24-Apr-2001  thorpej branches: 1.35.2;
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.34 21-Feb-2001  minoura branches: 1.34.2;
Use m68k_page_offset and m68k_trunc_page macros,
instead of using PGOFSET directly.
 1.33 20-Feb-2001  minoura Remove phys_map declaration, which is in <uvm/uvm_extern.h>.
From syssrc/sys/arch/news68k/news68k/vm_machdep.c:1.6.
 1.32 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.31 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.30 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.29 20-Jan-2000  sommerfeld branches: 1.29.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.28 04-Dec-1999  ragge CL* discarding.
 1.27 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.26 16-Sep-1999  minoura branches: 1.26.2; 1.26.4; 1.26.8;
Finish PMAP_NEW.
- Wrong argument to pmap_kremove (vm_machdep.c:pagemove()).
- Uninitialized variable (pmap.c:pmap_kremove <- this should be fixed long ago...)
 1.25 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.24 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.23 26-May-1999  thorpej Generally update the comment above vunmapbuf().
 1.22 26-May-1999  thorpej Generally update the comment above the vmapbuf() implementations.
 1.21 14-May-1999  nisimura - Adjust descriptive comment of cpu_fork() which returns nothing and
returns once.
- Minor fixes in mips/vm_machdep.c.
 1.20 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.19 26-Mar-1999  mycroft branches: 1.19.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.18 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.17 16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.16 18-Nov-1998  itohy branches: 1.16.4;
Get pmap_extract() return value with paddr_t, not vaddr_t.
Some other minor changes stolen from hp300. :)
 1.15 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.14 09-Sep-1998  thorpej In cpu_coredump(), use MID_MACHINE rather than MID_* (whatever it expands
to).
 1.13 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.12 22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.11 28-Jul-1998  thorpej Don't cast the null residual pointer passed to vn_rdwr().
 1.10 30-Jun-1998  msaitoh sync with -current after a long silence
 1.9 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.8 06-Jan-1998  thorpej Garbage-collect PMAP_ACTIVATE() call here; it's no longer necessary.
 1.7 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.6 10-Oct-1997  oki Prune unused function.
 1.5 10-Oct-1997  oki Remove use of register.
 1.4 19-May-1997  veego branches: 1.4.4;
Fix lossage from the latest vm_pmap changes.
 1.3 02-Feb-1997  thorpej Garbage-collect extra copy of mappedcopy.
 1.2 21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.4.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.16.4.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.19.4.2 02-Aug-1999  thorpej Update from trunk.
 1.19.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.26.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.26.4.1 15-Nov-1999  fvdl Sync with -current
 1.26.2.2 12-Mar-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.29.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.34.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.35.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.35.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.35.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.35.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.36.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.37.4.10 11-Nov-2002  nathanw Catch up to -current
 1.37.4.9 05-Oct-2002  gmcgarry LWPify
 1.37.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.37.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.37.4.6 28-Feb-2002  nathanw Catch up to -current.
 1.37.4.5 08-Jan-2002  nathanw Catch up to -current.
 1.37.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.37.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.37.4.2 18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.37.4.1 10-Sep-2001  scw file vm_machdep.c was added on branch nathanw_sa on 2001-11-18 18:44:20 +0000
 1.14 14-May-2011  tsutsui IODEVbase is the same address as intiobase, so make it an alias macro
and remove now almost empty x68k_init.c.
 1.13 18-Dec-2008  isaki branches: 1.13.6; 1.13.8;
There's no need to use initial value to intiobase and IODEVbase.
They are not refered to before it's initialized in pmap_bootstrap().
 1.12 18-Dec-2008  isaki Remove intr_reset(), which has disabled device interrupt just
after start in locore.s. Initializing interrupt should be done
by each device driver.
 1.11 14-Dec-2008  isaki Use intio_set_*() macros to purge macros by the name of sysport, ioctlr.
 1.10 24-Dec-2005  perry branches: 1.10.74; 1.10.78; 1.10.86;
bare asm -> __asm
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 18-Jan-2005  chs branches: 1.8.8;
de-__P, remove register, ansify.
 1.7 15-Jul-2003  lukem branches: 1.7.8;
rcsid
 1.6 16-Mar-1999  minoura branches: 1.6.42;
Merged minoura_x68k_bus_h branch.
 1.5 05-Aug-1998  minoura branches: 1.5.6;
Switched to MI zs driver.
 1.4 11-Oct-1997  oki Added header file.
 1.3 10-Oct-1997  oki Add prototypes.
 1.2 04-Feb-1997  oki branches: 1.2.8;
Added copyright notice
 1.1 05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1 05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.2.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.6.1 23-Dec-1998  minoura First import of bus_space implementation for x68k port.
 1.6.42.4 24-Jan-2005  skrll Sync with HEAD.
 1.6.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.42.1 03-Aug-2004  skrll Sync with HEAD
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.8.1 21-Jun-2006  yamt sync with head.
 1.10.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.78.1 04-May-2009  yamt sync with head.
 1.10.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.13.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.6.1 31-May-2011  rmind sync with head

RSS XML Feed