Home | History | Annotate | only in /src/sys/arch/next68k
History log of /src/sys/arch/next68k
RevisionDateAuthorComments
 1.7 25-Oct-2008  apb Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.6 06-Jan-2003  lukem branches: 1.6.104; 1.6.108; 1.6.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.5 03-Apr-2001  jhawk branches: 1.5.8;
Remove gratuitous setting of SYSDIR;
it is set in sys/kern/Make.tags.inc
 1.4 05-Oct-2000  tsutsui branches: 1.4.2;
Remove garbage in comment.
 1.3 20-Jul-1999  dbj branches: 1.3.2;
fixed TAGS target for emacs style tags
 1.2 12-Jul-1998  veego branches: 1.2.10;
Add include to SUBDIR to install the machine includes.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.10.1 02-Aug-1999  thorpej Update from trunk.
 1.3.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.3.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.5.8.2 07-Jan-2003  thorpej Sync with HEAD.
 1.5.8.1 03-Apr-2001  thorpej file Makefile was added on branch nathanw_sa on 2003-01-07 21:12:23 +0000
 1.6.114.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.6.108.1 04-May-2009  yamt sync with head.
 1.6.104.1 17-Jan-2009  mjf 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 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.32;
Initial import of NetBSD/next68k.
 1.1.1.1.32.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:12:24 +0000
 1.163 29-Jan-2024  christos PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.162 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.161 11-Feb-2023  tsutsui Disable rarely used options and devices, and add options MODULAR instead.

Also enable files-system MSDOS for file exchange via removable media.
 1.160 11-Feb-2023  tsutsui Remove unnecessary commented out lines.
 1.159 11-Feb-2023  tsutsui Remove nonexistent options SWAPDEBUG.
 1.158 11-Feb-2023  tsutsui Enable file-system CD9660.

It's useful for installation especially on emulators.
 1.157 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.156 03-Feb-2023  tsutsui Remove trailing TABs.
 1.155 27-Jan-2023  tsutsui next68k: Specify -fno-unwind-tables to shrink kernel binary size.

next68k bootloader cannot load a kernel larger than ~3.8 MB.
 1.154 22-Dec-2022  nat Driver for DaynaPORT SCSI/Link (dse.4).

Written by Hiroshi Noguchi, of which an updated version was posted to
port-mac68k in 2001.

Attachments were added to kernel configs for platforms that already had
the Cabletron (se.4) driver added, although other platorms may benefit.

Reviewed on tech-net by Izumi Tsutsui.
 1.153 07-Aug-2022  simonb branches: 1.153.4;
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.152 21-Jan-2021  nia add a commented out compat_ossaudio wherever there's compat_linux

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

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.150 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.149 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.148 26-Apr-2019  sevan branches: 1.148.2;
Enable BUFQ_PRIOCSCAN, CARP, Veriexec by default in GENERIC kernel configs.
On ports without a GENERIC kernel config enable in individul files, e.g evbmips.
Omit on:
atari, dreamcast, emips, epoc32, evbppc/VIRTEX*, ia64, luna68x, mvme68k,
mvmeppc, playstation2, riscv, sun2, sun3, x68k, zaurus due to resource
constraints or port infancy.
 1.147 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.146 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.145 23-Jan-2018  sevan branches: 1.145.2; 1.145.4;
Alternate buffer queue strategies no longer considered experimental, update
description.

Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
 1.144 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.143 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.142 29-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 3.
 1.141 09-Jul-2017  tsutsui Clarify serial port names. Affects zs(4) man page mentioned in PR/52377.

Actual port connection is briefly checked by "NeXT cube internal schematics"
http://web.archive.org/web/20091015214305/http://www.lrz-muenchen.de/~heller/NeXT/NeXT.html
 1.140 08-Aug-2015  maxv branches: 1.140.10;
Remove KMEMSTATS.
 1.139 16-Nov-2014  manu branches: 1.139.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.138 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.137 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.136 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.135 05-Jul-2014  tsutsui branches: 1.135.2;
Use COPTS="-O2 -fno-reorder-blocks" as defined in sys.mk for userland.

Compile tests only.
 1.134 30-Jun-2013  rmind branches: 1.134.4;
G/C PFIL_HOOKS from the kernel configs.
 1.133 05-Jun-2013  christos branches: 1.133.2;
remove obsolete networking options
 1.132 27-Apr-2013  christos the bogus number police
 1.131 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.130 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.129 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.128 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.127 05-Jun-2012  abs branches: 1.127.2;
Adjust the WSDISPLAY_COMPAT_USL comment to mention wsconscfg, to at least
give a hint that its not just for third party compat. No functional change.
 1.126 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.125 18-Dec-2011  dholland branches: 1.125.2;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.124 22-Nov-2011  tls branches: 1.124.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.123 06-Mar-2011  bouyer branches: 1.123.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.122 23-Nov-2010  hannken branches: 1.122.2; 1.122.4;
Remove unused count from pseudo-device md.
 1.121 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.120 29-Apr-2010  chs enable TMPFS in all GENERICs that have MFS enabled.
 1.119 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.118 05-Dec-2009  pooka branches: 1.118.2; 1.118.4;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.117 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.116 24-Jan-2009  mrg branches: 1.116.2;
add COMPAT_50 to all the configs with COMPAT_40.
 1.115 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

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

Proposed on tech-kern@.
 1.113 10-Aug-2008  tls branches: 1.113.2;
Add accept filters to GENERIC kernels where they exist.
 1.112 31-Jul-2008  simonb Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.111 30-May-2008  tsutsui branches: 1.111.4;
Add options COMPAT_40 to files which have options COMPAT_30.
 1.110 31-Dec-2007  ad branches: 1.110.6; 1.110.8; 1.110.10; 1.110.12;
Remove systrace. Ok core@.
 1.109 17-Oct-2007  garbled branches: 1.109.2; 1.109.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.108 04-Jun-2007  martin branches: 1.108.10;
Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.107 11-Nov-2006  jmmv branches: 1.107.2; 1.107.8; 1.107.10; 1.107.16; 1.107.18;
Remove tmpfs's experimental status. OK'ed by core@.
 1.106 26-Aug-2006  christos branches: 1.106.2; 1.106.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.105 26-Aug-2006  tsutsui Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.104 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.103 28-Jun-2006  liamjfoy branches: 1.103.2;
Add CARP to GENERIC kernel configs. CARP is not enabled by default.

ok: christos
 1.102 28-Mar-2006  pavel branches: 1.102.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.101 05-Feb-2006  cube branches: 1.101.2; 1.101.4; 1.101.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.100 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.99 02-Feb-2006  reinoud branches: 1.99.2;
Add commented out UDF file-system entry in all GENERIC configurations.
 1.98 09-Dec-2005  elad branches: 1.98.2; 1.98.4;
Add (commented out) Veriexec options and pseudo-device to GENERIC kernels,
and remove the i386 GENERIC_VERIEXEC config.
 1.97 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.96 03-Nov-2005  chs turn off DEBUG and DIAGNOSTIC in GENERIC kernels so that they
are compatible with the LKMs that are part of the release.
 1.95 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.94 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.93 19-Aug-2005  christos 64 bit inode changes.
 1.92 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.91 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.90 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.89 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.88 25-Jun-2005  rpaulo branches: 1.88.2;
Add file-system PTYFS (commented out) so that people know its existence.

Ok'ed by Christos Zoulas and Hubert Feyrer.
 1.87 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.86 25-Feb-2005  simonb branches: 1.86.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.85 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.84 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.83 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.82 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.81 17-Jan-2005  cube branches: 1.81.2;
Add tap(4) support to a random^Wcarefully chosen set of kernel configs.
All those kernels have a line for both tun and bridge, and if either is
commented out, tap is commented out also. With the exception of i386's
GENERIC_TINY.

XXX: we _need_ some way of making this more simple.
 1.80 10-Nov-2004  christos branches: 1.80.4;
Add COMPAT_BSDPTY on all the kernels that have COMPAT options.
 1.79 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.78 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.77 26-Jun-2004  abs Add (commented out) ALTQ options to all GENERIC-like files
 1.76 22-Jun-2004  itojun have pf and pflog pseudo-device (commented out).
reviewed by matt, perry, christos
 1.75 18-Jun-2004  christos ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM
 1.74 16-Jun-2004  christos Add pseudo-device ptm on all the generic flavored kernels.
 1.73 30-Sep-2003  mycroft branches: 1.73.2;
Add P1003_1B_SEMAPHORE.
 1.72 22-Sep-2003  cl add COMPAT_15/COMPAT_16
 1.71 26-Apr-2003  ragge branches: 1.71.2;
Add pseudo-device ksyms.
 1.70 10-Apr-2003  christos Bye Bye UCONSOLE
 1.69 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.68 22-Nov-2002  wiz Fix typo (responsiness -> responsiveness).
 1.67 18-Oct-2002  junyoung Add NEW_BUFQ_STRATEGY (disabled by default).
 1.66 06-Oct-2002  provos add SYSTRACE; approved perry.
 1.65 21-Sep-2002  mycroft FFS would help...
 1.64 21-Sep-2002  mycroft Enable SCSI target devices, and explicitly disable wide negotiation for esp.
 1.63 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.62 11-Sep-2002  mycroft Don't know whether it works, but enable the '030 support for the Hell of it.
 1.61 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.60 11-Jul-2002  mycroft Oops; add scsibus too.
 1.59 11-Jul-2002  mycroft Enable the SCSI driver.
 1.58 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.57 15-May-2002  jdolecek branches: 1.57.2; 1.57.4;
Comment out QUOTA as well. Suggested by Christian Limpach
in port-next68k/16792.
Applied even tho not strictly necessary, kernel nowadays actually
links with this option too.
 1.56 14-May-2002  matt Eliminate commons (including many used ones). Clean up variable references.
 1.55 25-Apr-2002  atatat Add the INCLUDE_CONFIG_FILE option to all config files. In config
files that are generic (ie, GENERIC, GENERICSBC, GENERIC32, ALL, or
ALPHA), it is uncommented.
 1.54 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.53 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.52 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.51 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.50 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.49 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.48 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.47 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.46 13-Nov-2001  augustss The wsmux pseudo device does not need a count anymore.
 1.45 01-Sep-2001  atatat branches: 1.45.6;
Comment out bridge pseudo devices from ports that don't
__HAVE_GENERIC_SOFT_INTERRUPTS. bridge(4) doesn't compile there.
 1.44 01-Sep-2001  atatat Add bridge pseudo devices to GENERIC configs
 1.43 08-Jul-2001  abs branches: 1.43.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.42 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.41 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.40 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.39 05-Apr-2001  dbj comment out M68030, since we do not yet support NeXT 68030 computers
 1.38 19-Dec-2000  tsutsui branches: 1.38.2;
Remove "rnd is EXPERIMENTAL" comments.
 1.37 19-Dec-2000  bouyer Add pseudo-device vlan
 1.36 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.35 29-Sep-2000  deberg add RCONS_BPP16 for color display
 1.34 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.33 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.32 30-Jun-2000  itojun add PULLDOWN_TEST for all the platforms.
XXX should be moved to somewhere else when stabilized
 1.31 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.30 14-Jun-2000  veego branches: 1.30.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.29 19-Apr-2000  itojun branches: 1.29.2;
add stf pseudo interface (commented out due to possible security risks)
 1.28 21-Mar-2000  deberg enable COMPAT_M68K4K - works fine w/ native toolchain and pkgsrc m68k
cross toolchain. closes port-next68k/6726.
 1.27 06-Mar-2000  deberg add comments to ZS_CONSOLE_ABORT and SERCONSOLE, and convert to
options<SPACE><TAB>NAME
 1.26 29-Feb-2000  simonb Do the "<space><tab>" thing with the RAID_AUTOCONFIG option.
 1.25 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.24 23-Jan-2000  hubertf Add commented out "ident"-command
 1.23 20-Jan-2000  wrstuden Add overlay to kernel configs.
 1.22 14-Dec-1999  dbj add files needed to use KGDB as suggested by Christian Limpach <chris@Nice.CH>
 1.21 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.20 15-Nov-1999  fvdl Add commented out option SOFTDEP to all GENERIC kernels.
 1.19 04-Aug-1999  dbj branches: 1.19.2; 1.19.8;
remove setting of WSDISPLAY_DEFAULTSCREENS
 1.18 29-Jul-1999  augustss Make two wsmux pseudo devices and add mux locators.
 1.17 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.16 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.15 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.14 27-Mar-1999  dbj branches: 1.14.2; 1.14.4;
added kgdb support.
 1.13 26-Mar-1999  dbj Disable non functional esp driver and scsi support.
 1.12 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.11 15-Feb-1999  hubertf RCS ID police
 1.10 31-Jan-1999  dbj use WSEMUL_VT100 instead of WSEMUL_SUN
 1.9 28-Jan-1999  dbj wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.8 09-Jan-1999  dbj Moved optional devices out of std.next68k and put them in GENERIC instead.
This is patch supplied in pr 6725.
 1.7 15-Dec-1998  itohy Added options COMPAT_LINUX and EXEC_ELF32 as comments
to GENERIC configuration files.
 1.6 25-Nov-1998  hwr Add (commented out) 'gre' pseudo device line. Feedback is welcome.
Inspired by Klaus Klein.
 1.5 16-Nov-1998  oster Added a (commented out) configuration line for the RAIDframe device driver.
 1.4 16-Nov-1998  dbj Moved UVM define from GENERIC to std.next68k
Added -Wno-main to warnflags, if compiler supports it.
 1.3 14-Nov-1998  dbj Finished changes to use UVM on next68k.
Turn on UVM by default in GENERIC kernel.
 1.2 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.14.4.2 02-Aug-1999  thorpej Update from trunk.
 1.14.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.14.2.1 03-Jun-2000  he Apply patch (requested by he):
Disable the UNION file system, to avoid a repeat of the 1.4.1
and 1.4.2 LAST_MINUTE changes. It is reportedly buggy, and can
be used by ordinary users to crash the system.
 1.19.8.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.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.19.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.19.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.19.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.30.2.4 01-May-2001  he Pull up revisions 1.37-1.38 (requested by he):
Add pseudo-device vlan.
Make sure "rnd is EXPERIMENTAL" comment is removed.
 1.30.2.3 06-Oct-2000  deberg pullup 1.35, approved by thorpej

add RCONS_BPP16 for color display
 1.30.2.2 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.30.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.38.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.38.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.43.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.43.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.43.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.43.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.43.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.43.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.45.6.10 11-Dec-2002  thorpej Sync with HEAD.
 1.45.6.9 11-Nov-2002  nathanw Catch up to -current
 1.45.6.8 18-Oct-2002  nathanw Catch up to -current.
 1.45.6.7 17-Sep-2002  nathanw Catch up to -current.
 1.45.6.6 01-Aug-2002  nathanw Catch up to -current.
 1.45.6.5 20-Jun-2002  nathanw Catch up to -current.
 1.45.6.4 17-Apr-2002  nathanw Catch up to -current.
 1.45.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.45.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.45.6.1 01-Sep-2001  nathanw file GENERIC was added on branch nathanw_sa on 2002-01-08 00:26:57 +0000
 1.57.4.1 01-Aug-2002  lukem Pull up revision 1.58 (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.57.2.2 16-Jul-2002  gehenna catch up with -current.
 1.57.2.1 15-Jul-2002  gehenna catch up with -current.
 1.71.2.10 11-Dec-2005  christos Sync with head.
 1.71.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.71.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.71.2.7 15-Feb-2005  skrll Sync with HEAD.
 1.71.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.71.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.71.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.71.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.71.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.71.2.1 03-Aug-2004  skrll Sync with HEAD
 1.73.2.2 15-Jul-2004  he Pull up revision 1.78 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.73.2.1 30-Jun-2004  jdc Pull up revision 1.77 (requested by abs in ticket #567).

Add (commented out) ALTQ options to all GENERIC-like files
 1.80.4.1 29-Apr-2005  kent sync with -current
 1.81.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.81.2.1 12-Feb-2005  yamt sync with head.
 1.86.2.3 05-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #929):
sys/arch/hp300/conf/GENERIC: revision 1.124
sys/arch/acorn32/conf/GENERIC: revision 1.62
sys/arch/pdp10/conf/GENERIC: revision 1.19
sys/arch/mvme68k/conf/GENERIC: revision 1.61
sys/arch/netwinder/conf/GENERIC: revision 1.70
sys/arch/sbmips/conf/GENERIC: revision 1.46
sys/arch/macppc/conf/GENERIC: revision 1.214
sys/arch/bebox/conf/GENERIC: revision 1.89
sys/arch/cobalt/conf/GENERIC: revision 1.83
sys/arch/cats/conf/GENERIC: revision 1.92
sys/arch/shark/conf/GENERIC: revision 1.53
sys/arch/amiga/conf/GENERIC.in: revision 1.45
sys/arch/acorn26/conf/GENERIC: revision 1.37
sys/arch/cesfic/conf/GENERIC: revision 1.38
sys/arch/iyonix/conf/GENERIC: revision 1.21
sys/arch/alpha/conf/GENERIC: revision 1.277
sys/arch/vax/conf/GENERIC: revision 1.143
sys/arch/atari/conf/GENERIC.in: revision 1.56
sys/arch/mipsco/conf/GENERIC: revision 1.53
sys/arch/ofppc/conf/GENERIC: revision 1.85
sys/arch/next68k/conf/GENERIC: revision 1.96
sys/arch/arc/conf/GENERIC: revision 1.125
sys/arch/dreamcast/conf/GENERIC: revision 1.62
turn off DEBUG and DIAGNOSTIC in GENERIC kernels so that they
are compatible with the LKMs that are part of the release.
 1.86.2.2 14-Aug-2005  riz Pull up revision 1.90 (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.86.2.1 18-Jul-2005  riz Pull up revision 1.89 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.88.2.4 21-Jan-2008  yamt sync with head
 1.88.2.3 03-Sep-2007  yamt sync with head.
 1.88.2.2 30-Dec-2006  yamt sync with head.
 1.88.2.1 21-Jun-2006  yamt sync with head.
 1.98.4.1 09-Sep-2006  rpaulo sync with head
 1.98.2.1 18-Feb-2006  yamt sync with head.
 1.99.2.1 22-Apr-2006  simonb Sync with head.
 1.101.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.101.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.101.2.3 03-Sep-2006  yamt sync with head.
 1.101.2.2 11-Aug-2006  yamt sync with head
 1.101.2.1 01-Apr-2006  yamt sync with head.
 1.102.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.103.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.103.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.106.4.1 10-Dec-2006  yamt sync with head.
 1.106.2.1 18-Nov-2006  ad Sync with head.
 1.107.18.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.107.16.1 26-Jun-2007  garbled Sync with HEAD.
 1.107.10.1 11-Jul-2007  mjf Sync with head.
 1.107.8.1 09-Jun-2007  ad Sync with head.
 1.107.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.108.10.2 09-Jan-2008  matt sync with HEAD
 1.108.10.1 06-Nov-2007  matt sync with HEAD
 1.109.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.109.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.110.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.110.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.110.10.3 11-Aug-2010  yamt sync with head.
 1.110.10.2 11-Mar-2010  yamt sync with head
 1.110.10.1 04-May-2009  yamt sync with head.
 1.110.8.1 04-Jun-2008  yamt sync with head
 1.110.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.110.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.110.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.111.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.111.4.1 19-Oct-2008  haad Sync with HEAD.
 1.113.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.113.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.113.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.116.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.118.4.3 21-Apr-2011  rmind sync with head
 1.118.4.2 05-Mar-2011  rmind sync with head
 1.118.4.1 30-May-2010  rmind sync with head
 1.118.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.118.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.122.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.122.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.123.4.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.123.4.2 30-Oct-2012  yamt sync with head
 1.123.4.1 17-Apr-2012  yamt sync with head
 1.124.2.2 11-Mar-2012  mrg sync to latest -current
 1.124.2.1 18-Feb-2012  mrg merge to -current.
 1.125.2.1 12-Jun-2012  riz Pull up following revision(s) (requested by abs in ticket #311):
sys/arch/netwinder/conf/GENERIC: revision 1.112
sys/arch/i386/conf/GENERIC: revision 1.1074
sys/arch/atari/conf/MILAN.in: revision 1.26
sys/arch/zaurus/conf/GENERIC: revision 1.54
sys/arch/shark/conf/GENERIC: revision 1.101
sys/arch/hpcmips/conf/MPC303: revision 1.60
sys/arch/i386/conf/XEN3_DOM0: revision 1.67
sys/arch/evbarm/conf/MPCSA_GENERIC: revision 1.29
sys/arch/vax/conf/GENERIC: revision 1.181
sys/arch/sparc/conf/KRUPS: revision 1.59
sys/arch/evbarm/conf/BEAGLEBOARD: revision 1.27
sys/arch/i386/conf/INSTALL_FLOPPY: revision 1.16
sys/arch/prep/conf/GENERIC: revision 1.163
sys/arch/hpcmips/conf/GENERIC: revision 1.216
sys/arch/sparc/conf/TADPOLE3GX: revision 1.56
sys/arch/shark/conf/INSTALL: revision 1.50
sys/arch/next68k/conf/GENERIC: revision 1.127
sys/arch/evbppc/conf/VIRTEX_GSRD2: revision 1.16
sys/arch/evbppc/conf/VIRTEX_DFC: revision 1.17
sys/arch/evbppc/conf/EXPLORA451: revision 1.48
sys/arch/bebox/conf/INSTALL: revision 1.54
sys/arch/next68k/conf/SLAB: revision 1.46
sys/arch/i386/conf/GENERIC_TINY: revision 1.132
sys/arch/bebox/conf/GENERIC: revision 1.131
sys/arch/amd64/conf/XEN3_DOM0: revision 1.84
sys/arch/amd64/conf/GENERIC: revision 1.356
sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.6
share/man/man4/wscons.4: revision 1.31
sys/arch/hpcmips/conf/TX3912: revision 1.79
sys/arch/evbarm/conf/ARMADILLO9: revision 1.35
sys/arch/hpcsh/conf/GENERIC: revision 1.97
sys/arch/i386/conf/ALL: revision 1.339
sys/arch/hpcmips/conf/TX3922: revision 1.93
sys/arch/cats/conf/INSTALL: revision 1.82
sys/arch/sparc64/conf/GENERIC: revision 1.151
sys/arch/i386/conf/INSTALL_TINY: revision 1.135
sys/arch/evbppc/conf/VIRTEX_GSRD1: revision 1.15
sys/arch/evbarm/conf/TS7200: revision 1.49
sys/arch/hpcmips/conf/VR41XX: revision 1.55
sys/arch/hp700/conf/GENERIC: revision 1.115
sys/arch/cats/conf/GENERIC: revision 1.140
Mention wsconscfg(8) needs WSDISPLAY_COMPAT_USL
If a port is going to have wscons for virtual terminals then it really make=
s
sense to enable WSDISPLAY_COMPAT_USL so the system can switch between the
virtual terminals...
Adjust the WSDISPLAY_COMPAT_USL comment to mention wsconscfg, to at least
give a hint that its not just for third party compat. No functional change.
 1.127.2.4 03-Dec-2017  jdolecek update from HEAD
 1.127.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.127.2.2 23-Jun-2013  tls resync from head
 1.127.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.133.2.1 28-Aug-2013  rmind sync with head
 1.134.4.1 10-Aug-2014  tls Rebase.
 1.135.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.135.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.139.2.2 28-Aug-2017  skrll Sync with HEAD
 1.139.2.1 22-Sep-2015  skrll Sync with HEAD
 1.140.10.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.145.4.1 10-Jun-2019  christos Sync with HEAD
 1.145.2.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.145.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.148.2.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1597):

sys/arch/next68k/conf/GENERIC: revision 1.155 (patch)

next68k: Specify -fno-unwind-tables to shrink kernel binary size.

next68k bootloader cannot load a kernel larger than ~3.8 MB.
 1.151.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.153.4.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #91):

etc/etc.next68k/MAKEDEV.conf: revision 1.7
sys/arch/next68k/conf/GENERIC: revision 1.156
sys/arch/next68k/conf/GENERIC: revision 1.157
sys/arch/next68k/conf/GENERIC: revision 1.158
distrib/next68k/instkernel/Makefile: revision 1.1
sys/arch/next68k/conf/GENERIC: revision 1.159
distrib/next68k/ramdisk/list: revision 1.1
etc/etc.next68k/Makefile.inc: revision 1.8
sys/arch/next68k/conf/RAMDISK: revision 1.5
distrib/next68k/ramdisk/dot.profile: revision 1.1
sys/arch/next68k/conf/SLAB: revision 1.62
sys/arch/next68k/conf/GENERIC: revision 1.160
sys/arch/next68k/conf/SLAB: revision 1.63
sys/arch/next68k/conf/GENERIC: revision 1.161
distrib/next68k/ramdisk/Makefile: revision 1.1
sys/arch/next68k/conf/majors.next68k: revision 1.26
distrib/next68k/Makefile: revision 1.2

Remove trailing TABs.

Remove trailing spaces and TABs.

Enable file-system CD9660.
It's useful for installation especially on emulators.

Remove nonexistent options SWAPDEBUG.

Remove unnecessary commented out lines.

Disable rarely used options and devices, and add options MODULAR instead.

Also enable files-system MSDOS for file exchange via removable media.

Build a RAMDISK root kernel on NetBSD/next68k release build.
No sysinst(8) yet, but useful on bootstrap and rescue ops.
 1.153.4.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #87):

sys/arch/next68k/conf/GENERIC: revision 1.155

next68k: Specify -fno-unwind-tables to shrink kernel binary size.

next68k bootloader cannot load a kernel larger than ~3.8 MB.
 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:15:00 +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.32 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.31 06-Sep-2015  uebayasi branches: 1.31.16; 1.31.18;
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.30 21-Jan-2011  joerg branches: 1.30.14; 1.30.32;
Switch remaining platforms to modern CPP for assembler.
 1.29 14-Feb-2008  joerg branches: 1.29.32; 1.29.38; 1.29.40;
Add missing assym.h dependencies.
 1.28 11-Dec-2005  christos branches: 1.28.50; 1.28.56;
merge ktrace-lwp.
 1.27 31-May-2005  christos branches: 1.27.2;
s/GENASSYM/GENASSYM_CONF/ so we can use "GENASSYM" as the program name.
 1.26 04-Jun-2004  thorpej Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
 1.25 26-Nov-2002  thorpej branches: 1.25.6; 1.25.10;
The traditional C preprocessor is fixed in GCC 3.3 now, so no need
to skip -traditional-cpp for HAVE_GCC3.
 1.24 04-Jun-2002  thorpej Don't use -traditional-cpp if HAVE_GCC3.
 1.23 09-Dec-2001  atatat branches: 1.23.8;
Roll the rest of the ports over to the new MI kernel build machinery.
Any problems reported by testers have been fixed, and massive
cross-compiling of kernels has shown that any problems that remain
with actually building kernels are not related to this.
 1.22 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.21 26-Oct-2001  jmc branches: 1.21.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.20 23-Oct-2001  thorpej branches: 1.20.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.19 29-May-2001  mrg branches: 1.19.2;
define _KERNEL_OPT as well as _KERNEL. we will use this in the future to
get kernel "opt_foo.h" headers, rather than _KERNEL && !_LKM.
 1.18 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.17 17-Dec-2000  jdolecek branches: 1.17.2;
delete obsolete comment
 1.16 09-May-2000  hubertf Add "install" target, so "make install" after building the kernel
does something useful. The target can be redefined by putting a
install-kernel-${MACHINE_NAME} target that fits your needs into
/etc/mk.conf.
 1.15 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.14 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.13 24-Jan-2000  tron Add "dependall" target for comfort.
 1.12 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.11 19-Jan-2000  tsutsui Change STRIPFLAGS=-g for cross-toolchains.
 1.10 08-Jan-2000  dbj resync with with hp300 port
 1.9 26-Jul-1999  cgd branches: 1.9.2;
be more efficient when doing the SYSTEM_LD_TAIL for -g kernels: don't
copy them just to strip them, use strip -o.
 1.8 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.7 15-Jan-1999  thorpej branches: 1.7.4;
Don't define "mc68020". Nothing uses it.
 1.6 08-Jan-1999  augustss Add -Wpointer-arith warning since `void *' arithmetic is not ANSI C.
 1.5 16-Nov-1998  dbj Moved UVM define from GENERIC to std.next68k
Added -Wno-main to warnflags, if compiler supports it.
 1.4 15-Oct-1998  drochner change handling of libkern:
-sys/lib/libkern builds as library per default (as it was documented all
the time)
-ports able to LKM set "KERN_AS=obj" explicitely in their Makefiles
(for now; should depend on actual "option LKM" or -better- functions
included for LKM use should be pulled in by a stub)
-always link libcompat before libkern - libkern stuff can be referred to
by libcompat, but not the other way
 1.3 05-Sep-1998  lukem distclean is a synonym for cleandir
 1.2 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.7.4.1 02-Aug-1999  thorpej Update from trunk.
 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.17.2.1 21-Jun-2001  nathanw Catch up to -current.
 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.20.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.21.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.21.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.21.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.21.2.1 26-Oct-2001  nathanw file Makefile.next68k was added on branch nathanw_sa on 2002-01-08 00:26:57 +0000
 1.23.8.1 15-Jul-2002  gehenna catch up with -current.
 1.25.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.25.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.25.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.6.1 03-Aug-2004  skrll Sync with HEAD
 1.27.2.1 27-Feb-2008  yamt sync with head.
 1.28.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.28.50.1 23-Mar-2008  matt sync with HEAD
 1.29.40.1 08-Feb-2011  bouyer Sync with HEAD
 1.29.38.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.32.1 05-Mar-2011  rmind sync with head
 1.30.32.1 22-Sep-2015  skrll Sync with HEAD
 1.30.14.1 03-Dec-2017  jdolecek update from HEAD
 1.31.18.1 10-Jun-2019  christos Sync with HEAD
 1.31.16.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.6 29-Jan-2024  christos PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.5 11-Feb-2023  tsutsui Build a RAMDISK root kernel on NetBSD/next68k release build.

No sysinst(8) yet, but useful on bootstrap and rescue ops.
 1.4 06-Feb-2009  jym branches: 1.4.96;
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.3 02-Apr-2002  lukem branches: 1.3.116; 1.3.124;
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.2 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.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.28; 1.1.1.1.32;
Initial import of NetBSD/next68k.
 1.1.1.1.32.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.1.1.32.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.1.1.28.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.1.1.28.1 16-Mar-2002  jdolecek Catch up with -current.
 1.3.124.1 03-Mar-2009  skrll Sync with HEAD.
 1.3.116.1 04-May-2009  yamt sync with head.
 1.4.96.2 23-Feb-2023  martin Remove driver not yet pressent in this branch, to fix the build after
ticket #91.
 1.4.96.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #91):

etc/etc.next68k/MAKEDEV.conf: revision 1.7
sys/arch/next68k/conf/GENERIC: revision 1.156
sys/arch/next68k/conf/GENERIC: revision 1.157
sys/arch/next68k/conf/GENERIC: revision 1.158
distrib/next68k/instkernel/Makefile: revision 1.1
sys/arch/next68k/conf/GENERIC: revision 1.159
distrib/next68k/ramdisk/list: revision 1.1
etc/etc.next68k/Makefile.inc: revision 1.8
sys/arch/next68k/conf/RAMDISK: revision 1.5
distrib/next68k/ramdisk/dot.profile: revision 1.1
sys/arch/next68k/conf/SLAB: revision 1.62
sys/arch/next68k/conf/GENERIC: revision 1.160
sys/arch/next68k/conf/SLAB: revision 1.63
sys/arch/next68k/conf/GENERIC: revision 1.161
distrib/next68k/ramdisk/Makefile: revision 1.1
sys/arch/next68k/conf/majors.next68k: revision 1.26
distrib/next68k/Makefile: revision 1.2

Remove trailing TABs.

Remove trailing spaces and TABs.

Enable file-system CD9660.
It's useful for installation especially on emulators.

Remove nonexistent options SWAPDEBUG.

Remove unnecessary commented out lines.

Disable rarely used options and devices, and add options MODULAR instead.

Also enable files-system MSDOS for file exchange via removable media.

Build a RAMDISK root kernel on NetBSD/next68k release build.
No sysinst(8) yet, but useful on bootstrap and rescue ops.
 1.64 29-Jan-2024  christos PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.63 11-Feb-2023  tsutsui Remove nonexistent options SWAPDEBUG.
 1.62 03-Feb-2023  tsutsui Remove trailing TABs.
 1.61 22-Dec-2022  nat Driver for DaynaPORT SCSI/Link (dse.4).

Written by Hiroshi Noguchi, of which an updated version was posted to
port-mac68k in 2001.

Attachments were added to kernel configs for platforms that already had
the Cabletron (se.4) driver added, although other platorms may benefit.

Reviewed on tech-net by Izumi Tsutsui.
 1.60 21-Jan-2021  nia branches: 1.60.18;
add a commented out compat_ossaudio wherever there's compat_linux

requested by mrg
 1.59 19-Dec-2018  maxv branches: 1.59.12;
Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.58 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.57 14-Sep-2017  mrg branches: 1.57.2; 1.57.4;
clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
 1.56 09-Jul-2017  tsutsui Clarify serial port names. Affects zs(4) man page mentioned in PR/52377.

Actual port connection is briefly checked by "NeXT cube internal schematics"
http://web.archive.org/web/20091015214305/http://www.lrz-muenchen.de/~heller/NeXT/NeXT.html
 1.55 21-Aug-2015  uebayasi Add `pseudo-device ksyms' where `options DDB' is used, because
config(1)/config(5) can't handle module dependency correctly at this
moment.

(This is another proof that shared file definition (`file xxx.c a|b')
is a bad idea.)
 1.54 07-Aug-2015  maxv Remove the KMEMSTATS option. It no longer exists.
 1.53 23-Aug-2014  dholland branches: 1.53.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.52 30-Jun-2013  rmind G/C PFIL_HOOKS from the kernel configs.
 1.51 05-Jun-2013  christos branches: 1.51.2;
remove obsolete networking options
 1.50 27-Apr-2013  christos the bogus number police
 1.49 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.48 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.47 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.46 05-Jun-2012  abs branches: 1.46.2;
Adjust the WSDISPLAY_COMPAT_USL comment to mention wsconscfg, to at least
give a hint that its not just for third party compat. No functional change.
 1.45 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.44 22-Nov-2011  tls branches: 1.44.2; 1.44.4;

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.43 06-Mar-2011  bouyer branches: 1.43.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.42 23-Nov-2010  hannken branches: 1.42.2; 1.42.4;
Remove unused count from pseudo-device md.
 1.41 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.40 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.39 05-Dec-2009  pooka branches: 1.39.2; 1.39.4;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.38 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.37 24-Nov-2008  ad branches: 1.37.4;
Remove softdep, pass 1. We are focused on improving journalling.

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

Proposed on tech-kern@.
 1.35 30-May-2008  tsutsui branches: 1.35.4; 1.35.6;
Add options COMPAT_40 to files which have options COMPAT_30.
 1.34 26-Aug-2006  christos branches: 1.34.56; 1.34.58; 1.34.60; 1.34.62;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.33 05-Feb-2006  cube branches: 1.33.2;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.32 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.31 11-Dec-2005  christos branches: 1.31.2; 1.31.4; 1.31.6;
merge ktrace-lwp.
 1.30 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.29 19-Aug-2005  christos 64 bit inode changes.
 1.28 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.27 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.26 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.25 25-Feb-2005  simonb branches: 1.25.2; 1.25.4;
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.24 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.23 10-Nov-2004  christos branches: 1.23.4; 1.23.6;
Add COMPAT_BSDPTY on all the kernels that have COMPAT options.
 1.22 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.21 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.20 30-Sep-2003  mycroft branches: 1.20.2;
Add P1003_1B_SEMAPHORE.
 1.19 22-Sep-2003  cl add COMPAT_15/COMPAT_16
 1.18 10-Apr-2003  christos branches: 1.18.2;
Bye Bye UCONSOLE
 1.17 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.16 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.15 11-Jul-2002  mycroft Oops; add scsibus too.
 1.14 11-Jul-2002  mycroft Enable the SCSI driver.
 1.13 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.12 25-Apr-2002  atatat branches: 1.12.2; 1.12.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.11 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.10 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.9 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.8 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.7 13-Nov-2001  augustss The wsmux pseudo device does not need a count anymore.
 1.6 08-Jul-2001  abs branches: 1.6.2; 1.6.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.5 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.4 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.3 29-Sep-2000  deberg branches: 1.3.2; 1.3.4;
add RCONS_BPP16 for color display

also lose esp0 since i have no disc in this machine, and build symbols.
 1.2 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.1 17-Jun-2000  deberg branches: 1.1.2; 1.1.4;
my development machine
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 17-Jun-2000  minoura file SLAB was added on branch minoura-xpg4dl on 2000-06-22 17:01:57 +0000
 1.1.2.1 06-Oct-2000  deberg pullup 1.3, approved by thorpej

add RCONS_BPP16 for color display

also lose esp0 since i have no disc in this machine, and build symbols.
 1.3.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.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.3.2.1 29-Sep-2000  bouyer file SLAB was added on branch thorpej_scsipi on 2000-11-20 20:18:12 +0000
 1.6.8.8 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.7 17-Sep-2002  nathanw Catch up to -current.
 1.6.8.6 01-Aug-2002  nathanw Catch up to -current.
 1.6.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.6.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.6.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.6.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.8.1 08-Jul-2001  nathanw file SLAB was added on branch nathanw_sa on 2002-01-08 00:26:57 +0000
 1.6.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.6.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.6.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.4.1 01-Aug-2002  lukem Pull up revision 1.13 (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.12.2.2 16-Jul-2002  gehenna catch up with -current.
 1.12.2.1 15-Jul-2002  gehenna catch up with -current.
 1.18.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.18.2.5 04-Feb-2005  skrll Sync with HEAD.
 1.18.2.4 14-Nov-2004  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.20.2.1 15-Jul-2004  he Pull up revision 1.21 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.23.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.23.6.1 12-Feb-2005  yamt sync with head.
 1.23.4.1 29-Apr-2005  kent sync with -current
 1.25.4.2 30-Dec-2006  yamt sync with head.
 1.25.4.1 21-Jun-2006  yamt sync with head.
 1.25.2.1 18-Jul-2005  riz Pull up revision 1.26 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.31.6.1 22-Apr-2006  simonb Sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.31.2.1 18-Feb-2006  yamt sync with head.
 1.33.2.1 03-Sep-2006  yamt sync with head.
 1.34.62.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.34.60.3 11-Aug-2010  yamt sync with head.
 1.34.60.2 11-Mar-2010  yamt sync with head
 1.34.60.1 04-May-2009  yamt sync with head.
 1.34.58.1 04-Jun-2008  yamt sync with head
 1.34.56.2 17-Jan-2009  mjf Sync with HEAD.
 1.34.56.1 02-Jun-2008  mjf Sync with HEAD.
 1.35.6.2 28-Apr-2009  skrll Sync with HEAD.
 1.35.6.1 19-Jan-2009  skrll Sync with HEAD.
 1.35.4.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.37.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.39.4.3 21-Apr-2011  rmind sync with head
 1.39.4.2 05-Mar-2011  rmind sync with head
 1.39.4.1 30-May-2010  rmind sync with head
 1.39.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.39.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.42.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.42.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.43.4.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.43.4.2 30-Oct-2012  yamt sync with head
 1.43.4.1 17-Apr-2012  yamt sync with head
 1.44.4.1 12-Jun-2012  riz Pull up following revision(s) (requested by abs in ticket #311):
sys/arch/netwinder/conf/GENERIC: revision 1.112
sys/arch/i386/conf/GENERIC: revision 1.1074
sys/arch/atari/conf/MILAN.in: revision 1.26
sys/arch/zaurus/conf/GENERIC: revision 1.54
sys/arch/shark/conf/GENERIC: revision 1.101
sys/arch/hpcmips/conf/MPC303: revision 1.60
sys/arch/i386/conf/XEN3_DOM0: revision 1.67
sys/arch/evbarm/conf/MPCSA_GENERIC: revision 1.29
sys/arch/vax/conf/GENERIC: revision 1.181
sys/arch/sparc/conf/KRUPS: revision 1.59
sys/arch/evbarm/conf/BEAGLEBOARD: revision 1.27
sys/arch/i386/conf/INSTALL_FLOPPY: revision 1.16
sys/arch/prep/conf/GENERIC: revision 1.163
sys/arch/hpcmips/conf/GENERIC: revision 1.216
sys/arch/sparc/conf/TADPOLE3GX: revision 1.56
sys/arch/shark/conf/INSTALL: revision 1.50
sys/arch/next68k/conf/GENERIC: revision 1.127
sys/arch/evbppc/conf/VIRTEX_GSRD2: revision 1.16
sys/arch/evbppc/conf/VIRTEX_DFC: revision 1.17
sys/arch/evbppc/conf/EXPLORA451: revision 1.48
sys/arch/bebox/conf/INSTALL: revision 1.54
sys/arch/next68k/conf/SLAB: revision 1.46
sys/arch/i386/conf/GENERIC_TINY: revision 1.132
sys/arch/bebox/conf/GENERIC: revision 1.131
sys/arch/amd64/conf/XEN3_DOM0: revision 1.84
sys/arch/amd64/conf/GENERIC: revision 1.356
sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.6
share/man/man4/wscons.4: revision 1.31
sys/arch/hpcmips/conf/TX3912: revision 1.79
sys/arch/evbarm/conf/ARMADILLO9: revision 1.35
sys/arch/hpcsh/conf/GENERIC: revision 1.97
sys/arch/i386/conf/ALL: revision 1.339
sys/arch/hpcmips/conf/TX3922: revision 1.93
sys/arch/cats/conf/INSTALL: revision 1.82
sys/arch/sparc64/conf/GENERIC: revision 1.151
sys/arch/i386/conf/INSTALL_TINY: revision 1.135
sys/arch/evbppc/conf/VIRTEX_GSRD1: revision 1.15
sys/arch/evbarm/conf/TS7200: revision 1.49
sys/arch/hpcmips/conf/VR41XX: revision 1.55
sys/arch/hp700/conf/GENERIC: revision 1.115
sys/arch/cats/conf/GENERIC: revision 1.140
Mention wsconscfg(8) needs WSDISPLAY_COMPAT_USL
If a port is going to have wscons for virtual terminals then it really make=
s
sense to enable WSDISPLAY_COMPAT_USL so the system can switch between the
virtual terminals...
Adjust the WSDISPLAY_COMPAT_USL comment to mention wsconscfg, to at least
give a hint that its not just for third party compat. No functional change.
 1.44.2.1 11-Mar-2012  mrg sync to latest -current
 1.46.2.3 03-Dec-2017  jdolecek update from HEAD
 1.46.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.46.2.1 23-Jun-2013  tls resync from head
 1.51.2.1 28-Aug-2013  rmind sync with head
 1.53.2.2 28-Aug-2017  skrll Sync with HEAD
 1.53.2.1 22-Sep-2015  skrll Sync with HEAD
 1.57.4.1 10-Jun-2019  christos Sync with HEAD
 1.57.2.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.57.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.59.12.1 03-Apr-2021  thorpej Sync with HEAD.
 1.60.18.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #91):

etc/etc.next68k/MAKEDEV.conf: revision 1.7
sys/arch/next68k/conf/GENERIC: revision 1.156
sys/arch/next68k/conf/GENERIC: revision 1.157
sys/arch/next68k/conf/GENERIC: revision 1.158
distrib/next68k/instkernel/Makefile: revision 1.1
sys/arch/next68k/conf/GENERIC: revision 1.159
distrib/next68k/ramdisk/list: revision 1.1
etc/etc.next68k/Makefile.inc: revision 1.8
sys/arch/next68k/conf/RAMDISK: revision 1.5
distrib/next68k/ramdisk/dot.profile: revision 1.1
sys/arch/next68k/conf/SLAB: revision 1.62
sys/arch/next68k/conf/GENERIC: revision 1.160
sys/arch/next68k/conf/SLAB: revision 1.63
sys/arch/next68k/conf/GENERIC: revision 1.161
distrib/next68k/ramdisk/Makefile: revision 1.1
sys/arch/next68k/conf/majors.next68k: revision 1.26
distrib/next68k/Makefile: revision 1.2

Remove trailing TABs.

Remove trailing spaces and TABs.

Enable file-system CD9660.
It's useful for installation especially on emulators.

Remove nonexistent options SWAPDEBUG.

Remove unnecessary commented out lines.

Disable rarely used options and devices, and add options MODULAR instead.

Also enable files-system MSDOS for file exchange via removable media.

Build a RAMDISK root kernel on NetBSD/next68k release build.
No sysinst(8) yet, but useful on bootstrap and rescue ops.
 1.45 18-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.44 13-Jan-2024  thorpej Switch next68k over to the common m68k vector table.
 1.43 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.42 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.41 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.40 12-Jun-2011  rmind branches: 1.40.52; 1.40.54;
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.39 20-Feb-2008  drochner branches: 1.39.32; 1.39.42;
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.38 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.37 08-Mar-2007  tsutsui branches: 1.37.2; 1.37.18; 1.37.20; 1.37.26;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.36 11-Dec-2005  christos branches: 1.36.26;
merge ktrace-lwp.
 1.35 14-Nov-2004  christos branches: 1.35.12;
Use common procfs_machdep.c
 1.34 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.33 25-Jun-2003  he branches: 1.33.2;
Declare USELEDS option, now that locore.s tries to include opt_useleds.h.
 1.32 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.31 03-Nov-2002  chs use a merged sys_machdep.c for all the motorola-MMU m68k platforms.
 1.30 03-Nov-2002  chs merge all the m68k copies of kgdb_machdep.c.
 1.29 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.28 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.27 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 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 17-May-2002  jdolecek make kgdb buildable again, g/c next68k/stub.c
Changes by Christian Limpach in kern/16794, with some minor adjustment
by me.
 1.24 21-Jan-2002  jdolecek branches: 1.24.8;
Switch to MI dev/md_root.c for archs which don't have any special
memory disk hooks (i.e. everything except atari).
 1.23 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.22 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.21 20-Nov-2001  lukem whitespace cleanup
 1.20 18-Jun-2001  christos branches: 1.20.2; 1.20.8;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.19 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.18 17-Jan-2001  fvdl branches: 1.18.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.17 29-Sep-2000  deberg merge lines
 1.16 27-Mar-2000  scottr The declaration for esp has moved to conf/files. (Hi Charles!)
 1.15 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.14 03-Aug-1999  dbj branches: 1.14.2;
defopt SERCONSOLE
 1.13 07-Jun-1999  thorpej Only declare block major numbers for devices which can be the root device.
 1.12 24-Apr-1999  dbj add nextkbd flag to nextcons.c so that kernel can be cleanly
configured without a video console
patch submitted by Matt Debergalis
 1.11 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.10 27-Mar-1999  dbj branches: 1.10.2;
added kgdb support.
 1.9 26-Mar-1999  dbj Added support for using wscons as console.
Enabled wscons as default console.
Use option SERCONSOLE now to use serial console instead now.
 1.8 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.7 28-Jan-1999  dbj wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.6 27-Jan-1999  dbj Finished the setting of the system date from the rtc.
 1.5 02-Jan-1999  dbj Aded include for files.wscons so changes from pr 6707 to conf.c compile.
 1.4 15-Dec-1998  itohy Added COMPAT_LINUX support.
 1.3 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.2 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.10.2.1 26-Apr-1999  perry branches: 1.10.2.1.2;
pullup 1.11->1.12 (dbj): allow kernels to build without video console
 1.10.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.14.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.14.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.18.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.20.8.6 11-Nov-2002  nathanw Catch up to -current
 1.20.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.20.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.20.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.20.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.20.8.1 18-Jun-2001  nathanw file files.next68k was added on branch nathanw_sa on 2002-01-08 00:26:58 +0000
 1.20.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.20.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.20.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.24.8.3 30-May-2002  gehenna Catch up with -current.
 1.24.8.2 17-May-2002  gehenna Remove old block majors list.
 1.24.8.1 16-May-2002  gehenna Include the list of block/character major numbers.
 1.33.2.4 29-Nov-2004  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.35.12.3 27-Feb-2008  yamt sync with head.
 1.35.12.2 07-Dec-2007  yamt sync with head
 1.35.12.1 03-Sep-2007  yamt sync with head.
 1.36.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.37.20.2 23-Mar-2008  matt sync with HEAD
 1.37.20.1 09-Jan-2008  matt sync with HEAD
 1.37.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.37.2.1 03-Dec-2007  ad Sync with HEAD.
 1.39.42.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.39.32.1 18-Mar-2010  rmind Unify /dev/{mem,kmem,zero,null} implementations in MI code. Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
 1.40.54.1 10-Jun-2019  christos Sync with HEAD
 1.40.52.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.26 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.25 04-Apr-2020  jdolecek branches: 1.25.22;
mark nsmb major obsolete
 1.24 28-Jan-2019  dholland Systematize handling of removed drivers.

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

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

Note that some of the things now explicitly listed as obsolete are
really ancient history. My scan went back as far as when the majors
files were added. (But not before that.)
 1.23 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.22 30-Jun-2011  wiz branches: 1.22.52; 1.22.54;
dependant -> dependent
 1.21 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.20 31-Dec-2007  ad branches: 1.20.6; 1.20.10; 1.20.16; 1.20.18;
Remove systrace. Ok core@.
 1.19 24-Nov-2006  wiz branches: 1.19.28; 1.19.34; 1.19.42;
s/independant/independent/, from Zafer.
 1.18 11-Dec-2005  christos branches: 1.18.20; 1.18.22;
merge ktrace-lwp.
 1.17 17-Sep-2005  yamt make VMSWAP optional again.
 1.16 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.15 30-Jul-2005  yamt defflag VMSWAP.
 1.14 10-May-2005  jdolecek branches: 1.14.2;
assign major for nsmb(4)
 1.13 10-Dec-2003  jmc Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
 1.12 24-Oct-2003  jdolecek add major for 'ses' for archs which have the other scsi devices
 1.11 22-Oct-2003  jdolecek add wsfont major to archs which have the other wscons 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 04-Oct-2002  elric branches: 1.4.2;
assign majors for raw and cooked cgd's.
 1.3 21-Sep-2002  mycroft Fix the device name for ptc so ptys actually work again.
 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.next68k was initially added on branch gehenna-devsw.
 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.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.next68k was added on branch nathanw_sa on 2002-09-17 21:16:20 +0000
 1.4.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.4.2.1 04-Oct-2002  jdolecek file majors.next68k was added on branch kqueue on 2002-10-10 18:34:36 +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.14.2.3 21-Jan-2008  yamt sync with head
 1.14.2.2 30-Dec-2006  yamt sync with head.
 1.14.2.1 21-Jun-2006  yamt sync with head.
 1.18.22.1 10-Dec-2006  yamt sync with head.
 1.18.20.1 12-Jan-2007  ad Sync with head.
 1.19.42.1 02-Jan-2008  bouyer Sync with HEAD
 1.19.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.19.28.1 09-Jan-2008  matt sync with HEAD
 1.20.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.20.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.20.10.1 04-May-2009  yamt sync with head.
 1.20.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.22.54.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.22.54.1 10-Jun-2019  christos Sync with HEAD
 1.22.52.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.25.22.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #91):

etc/etc.next68k/MAKEDEV.conf: revision 1.7
sys/arch/next68k/conf/GENERIC: revision 1.156
sys/arch/next68k/conf/GENERIC: revision 1.157
sys/arch/next68k/conf/GENERIC: revision 1.158
distrib/next68k/instkernel/Makefile: revision 1.1
sys/arch/next68k/conf/GENERIC: revision 1.159
distrib/next68k/ramdisk/list: revision 1.1
etc/etc.next68k/Makefile.inc: revision 1.8
sys/arch/next68k/conf/RAMDISK: revision 1.5
distrib/next68k/ramdisk/dot.profile: revision 1.1
sys/arch/next68k/conf/SLAB: revision 1.62
sys/arch/next68k/conf/GENERIC: revision 1.160
sys/arch/next68k/conf/SLAB: revision 1.63
sys/arch/next68k/conf/GENERIC: revision 1.161
distrib/next68k/ramdisk/Makefile: revision 1.1
sys/arch/next68k/conf/majors.next68k: revision 1.26
distrib/next68k/Makefile: revision 1.2

Remove trailing TABs.

Remove trailing spaces and TABs.

Enable file-system CD9660.
It's useful for installation especially on emulators.

Remove nonexistent options SWAPDEBUG.

Remove unnecessary commented out lines.

Disable rarely used options and devices, and add options MODULAR instead.

Also enable files-system MSDOS for file exchange via removable media.

Build a RAMDISK root kernel on NetBSD/next68k release build.
No sysinst(8) yet, but useful on bootstrap and rescue ops.
 1.12 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.11 11-Dec-2005  christos branches: 1.11.78; 1.11.98; 1.11.100;
merge ktrace-lwp.
 1.10 17-Sep-2005  yamt include "conf/std".
 1.9 12-May-2001  chs branches: 1.9.8; 1.9.24; 1.9.40;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.8 22-Jun-2000  fvdl branches: 1.8.2;
Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.7 15-Nov-1999  fvdl branches: 1.7.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.6 24-Mar-1999  mrg branches: 1.6.8; 1.6.14;
clean up kernel/config files files for machVM lossage.
 1.5 09-Jan-1999  dbj Moved optional devices out of std.next68k and put them in GENERIC instead.
This is patch supplied in pr 6725.
 1.4 16-Nov-1998  dbj Moved UVM define from GENERIC to std.next68k
Added -Wno-main to warnflags, if compiler supports it.
 1.3 21-Jul-1998  dbj Continued work on the esp scsi driver. Not yet working, but progress continues.
 1.2 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.6.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 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.4.1 23-Jun-2000  fvdl As on the trunk, update these for the move of ffs_softdep.c into the
kernel source itself. Remove prefix construction, and add the SOFTDEP
option to GENERIC kernels.
 1.8.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.9.40.1 21-Jun-2006  yamt sync with head.
 1.9.24.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.8.2 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.9.8.1 12-May-2001  chs file std.next68k was added on branch nathanw_sa on 2001-05-12 22:35:30 +0000
 1.11.100.1 05-Mar-2011  rmind sync with head
 1.11.98.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.11.78.1 09-Oct-2010  yamt sync with head
 1.4 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.3 23-Oct-2009  snj Remove 3rd and 4th clauses. OK cl@ (copyright holder).
 1.2 11-Sep-2002  mycroft branches: 1.2.112;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.1 11-Jul-2002  christos branches: 1.1.2; 1.1.4; 1.1.6;
Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 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-Jul-2002  jdolecek file bmapreg.h was added on branch kqueue on 2002-09-06 08:38:21 +0000
 1.1.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.1.4.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.4.1 11-Jul-2002  nathanw file bmapreg.h was added on branch nathanw_sa on 2002-08-01 02:42:47 +0000
 1.1.2.2 16-Jul-2002  gehenna catch up with -current.
 1.1.2.1 11-Jul-2002  gehenna file bmapreg.h was added on branch gehenna-devsw on 2002-07-16 12:58:55 +0000
 1.2.112.1 11-Mar-2010  yamt sync with head
 1.27 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.26 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.25 10-Sep-2001  chris branches: 1.25.4; 1.25.12;
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.24 16-Jun-2001  dbj branches: 1.24.2; 1.24.4;
allow unaligned pointers in bus_dmamap_sync
 1.23 28-May-2001  chs assert that pmap_extract() succeeds.
 1.22 26-May-2001  chs replace vm_page_t with struct vm_page *.
 1.21 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.20 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.19 01-Apr-2001  dbj purge the cache on BUS_DMASYNC_PREREAD instead of BUS_DMASYNC_POSTREAD
 1.18 21-Mar-2001  soren s/vm_page_alloc_memory/uvm_pglistalloc/ in panic message.
 1.17 26-Dec-2000  dbj branches: 1.17.2;
fix logic error in bus_dmamap_sync that was preventing from flush/purging
full pages instead of only by cache lines
 1.16 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.15 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.14 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.13 13-Nov-1999  thorpej branches: 1.13.4;
Update for pmap_enter() API change. No functional difference.
 1.12 12-Sep-1999  chs branches: 1.12.2; 1.12.4; 1.12.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.11 17-Aug-1999  dbj implement _bus_dmamap_load_raw_direct
 1.10 03-Aug-1999  dbj resync bus_dma functions with current alpha versions.
added a field to a dma segment to return the actual length of that segment that
was successfully transferred.
 1.9 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.8 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.7 26-Mar-1999  mycroft branches: 1.7.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.6 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.5 14-Nov-1998  dbj Finished changes to use UVM on next68k.
Turn on UVM by default in GENERIC kernel.
 1.4 21-Sep-1998  thorpej Make bus_dmamap_load_uio() work, from Kevin Lahey <kml@nas.nasa.gov>.
 1.3 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.2 17-Jul-1998  thorpej Implement bus_dmamap_load_uio().
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.7.4.2 02-Aug-1999  thorpej Update from trunk.
 1.7.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.4.1 15-Nov-1999  fvdl Sync with -current
 1.12.2.4 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.12.2.2 05-Jan-2001  bouyer Sync with HEAD
 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.13.4.3 16-Jun-2001  he Pull up revision 1.24 (requested by dbj):
Fix bugs related to calculation of transmit packet length and
allow unaligned pointers in bus_dmamap_sync(). Fixes problems
related to full-size ethernet packets, as reported in PR#13212.
 1.13.4.2 05-Apr-2001  he Pull up revisions 1.17,1.19 (requested by dbj):
Purge/flush by pages when possible instead of just cache lines.
Purge cache on BUS_DMASYNC_PREREAD instead of BUS_DMASYNC_POSTREAD.
 1.13.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.17.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.17.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.24.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.24.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.24.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.24.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.25.12.1 15-Jul-2002  gehenna catch up with -current.
 1.25.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.25.4.2 20-Jun-2002  nathanw Catch up to -current.
 1.25.4.1 10-Sep-2001  nathanw file bus_dma.c was added on branch nathanw_sa on 2002-06-20 03:40:21 +0000
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.32;
Initial import of NetBSD/next68k.
 1.1.1.1.32.1 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.2 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.28; 1.1.1.1.32;
Initial import of NetBSD/next68k.
 1.1.1.1.32.1 17-Sep-2002  nathanw Catch up to -current.
 1.1.1.1.28.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.67 03-Feb-2023  tsutsui Make local functions static.
 1.66 03-Feb-2023  tsutsui Misc cleanup.

- use C99 designated initializer
- misc KNF
- TAB/space cleanup
 1.65 27-Jan-2023  tsutsui next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.
This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.64 31-Mar-2017  msaitoh branches: 1.64.18; 1.64.44;
Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
 1.63 29-Mar-2014  christos branches: 1.63.6; 1.63.10; 1.63.14;
fix misplaced line
 1.62 27-Mar-2014  christos correct/add protection against snprintf overflow.
 1.61 25-Mar-2014  christos fix sprintf debugging mess.
 1.60 27-Oct-2012  chs branches: 1.60.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.59 23-Nov-2009  rmind branches: 1.59.12; 1.59.22;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.58 02-Sep-2009  tsutsui Some backends may use ncr53c9x_abort(), so remove static declaration from
the function and explicitly declare it in ncr53c9xvar.h. Noticed by he@.
 1.57 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.56 28-Apr-2008  martin branches: 1.56.8;
Remove clause 3 and 4 from TNF licenses
 1.55 13-Apr-2008  tsutsui branches: 1.55.2; 1.55.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.54 05-Mar-2007  tsutsui branches: 1.54.40;
Fix caddr_t fallout. Well, this driver is too ugly to read...
 1.53 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.52 08-Mar-2006  lukem branches: 1.52.16;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.51 11-Dec-2005  christos branches: 1.51.4; 1.51.6; 1.51.8; 1.51.10;
merge ktrace-lwp.
 1.50 17-May-2005  christos branches: 1.50.2;
Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
 1.49 19-Jan-2005  chs de-__P, remove register, ansify.
 1.48 24-Feb-2004  wiz branches: 1.48.8;
occured -> occurred. From Peter Postma.
 1.47 04-Dec-2003  keihan netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.46 27-Sep-2003  cl make gcc3's `deprecated use of label at end of compound statement' go away
 1.45 15-Jul-2003  lukem __KERNEL_RCSID()
 1.44 03-May-2003  wiz branches: 1.44.2;
DMA, not dma nor Dma.
 1.43 02-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.42 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.41 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.40 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.39 21-Sep-2002  mycroft Force synchronous negotiation off even if the target initiates it, by setting
minsync to 0. It may be possible to make this work, but I don't know how.
 1.38 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.37 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.36 20-May-2002  jdolecek Adapt this to post thorpej-scsipi world.
Fix provided by Christian Limpach in port-next68k/16928.
 1.35 23-May-2001  chs branches: 1.35.2; 1.35.8; 1.35.16;
fix printf format strings and the call to ncr53c9x_attach() so that
this compiles again.
 1.34 17-Apr-2001  dbj increase maxsegs of esp main dma map by one to avoid error
tweak esp glue to read xfer_len from dma map
add some debugging checks for dma driver invariants
read DD_LIMIT instead of DD_SAVED_LIMIT on scsi dma shutdowns
 1.33 16-Apr-2001  dbj add receive ethernet bpf tap
keep receive ethernet crc and set M_HASFCS
change bus_dma MD fields to keep xfer_len for entire map
instead of per segment
turn off automatic dma restarts in preparation for changing
scsi driver to handle them.
add dma debugging routines to keep history of dma states
tweak checking for unusual dma limit register
 1.32 07-Apr-2001  dbj continue to tweak nextdma detection of xfer length
add check to esp driver for incomplete transfers, but still does not handle them.
 1.31 02-Apr-2001  dbj reenabled flushcount diagnostic check.
tweaked formatting on hex dump debugging routine
 1.30 31-Mar-2001  dbj comment out device register structure definitions, used for reference only.
remove unnecessary BUS_SPACE_MAP_LINEAR when mapping ethernet dma registers.
 1.29 29-Mar-2001  petrov use NCR_F_DMASELECT instead of ncr53c9x_dmaselect
 1.28 09-Aug-2000  tv branches: 1.28.2;
%b -> bitmask_snprintf()
 1.27 05-Jun-2000  nisimura Have MI ncr53c9x_attach() the 2nd and 3rd arguments for scsipi_adater
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
 1.26 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.25 28-Aug-1999  dbj branches: 1.25.2; 1.25.10;
discovered the purpose of another bit in the dma control register.
DMACSR_READ is now a CSR status bit which can be used to know if current transfer is
from cpu to device.
the old DMACSR_READ bit is renamed DMACSR_SETREAD. This is a control bit that tells
the dma transfer to be from cpu to device.
 1.24 23-Mar-1999  dbj more minor changes, mostly in minor tweaks to debuggin output.
tweaks to handling dmasize != dmalen correctly.
changed minimum dma segment length for tail buffer.
 1.23 14-Mar-1999  dbj changed dma start alignment from 4 to 16 so that the cache flush
functions always have cache line aligned segments.
continued experimentation with scsi driver.
 1.22 03-Mar-1999  dbj continued experimentation trying to understand why we drop
scsi write completion interrupts (the dma appears to complete ok)
Now copy read tail buffer after we bus_dma_sync it and not before.
 1.21 02-Mar-1999  dbj turn on diagnostic check in dma for controller bits at shutdown.
adjusted esp overrun to avoid diagnostic check triggering.
 1.20 14-Feb-1999  dbj Continue hacking on esp driver. Seems relatively stable in read only mode.
write operations appear to lose scsi interrupts and causes timeouts.
changes in this checkin include:
a nextdma bugfix causing a diagnostic check to erroneously trigger
Changed tail strategy to only use tail buffer for the minimal end slop
changed expected write dma overrun to 32 bytes.
turned on nextdma diagnostic check for dma end address since it
no longer gets triggerred by ethernet dma and helps debug scsi dma.
Added esp debugging printout and support.
 1.19 13-Feb-1999  dbj Continued work on esp scsi driver. Now can at least do enough i/o to create and mount
a filesystem, but is not stable enough yet for general use.
increased priority of ethernet interrupts, mostly useful to aid debugging
of scsi interrupts while using an nfs disk.
added additional debugging output in the next dma driver.
perform extranneous cache flushes/purges before dma reads/ after dma writes
to aid debugging of scsi dma.
 1.18 03-Feb-1999  dbj overhalt of scsi driver.
it still probes the disks ok, but is having trouble with 0xdeadbeef
in buffers read from the disk. Suspected problems with DMA alignment
and toggling the secret ninja dma control register
 1.17 02-Feb-1999  dbj make dma flushing more efficient and avoid stray interrupts when not using polled io.
remove check for normal chaining interrupts and add check for combined chaining interrupts
only when used with a tail chain. This allows scsi to work for short unaligned buffers
and large aligned buffers.
 1.16 02-Feb-1999  dbj Removed some already commented out test code.
added debugging printout when invoking polled dma interrupt.
 1.15 01-Feb-1999  dbj Fix return value in interrupt routine so that dma gets flushed correctly.
Turn on the esp_match since polling the scsi bus now works.
 1.14 27-Jan-1999  dbj Continue work on scsi driver. Added tail dma buffer. Still non functional.
 1.13 30-Dec-1998  dbj Continued work on esp driver. Now successfully identifies a scsi target.
Unfortunately, to get dma to work, we have to align past the end of
the buffer, which smashes other variables on the stack.
match function still disabled, as it isn't ready yet.
 1.12 27-Dec-1998  dbj After some experimentation, now allow dma start alignment to be 4.
Removed separate alignment constant for ethernet since it appears to
be unnecessary.
 1.11 26-Dec-1998  dbj Continued experimentation on SCSI driver.
Added nextdma_debug variable to control debug printouts in nextdma driver
when ND_DEBUG is defined.
 1.10 19-Dec-1998  dbj Revamped DMA interface to unify chaining and non-chaining dma sequences.
Updated ethernet driver to work with new interface.
Continue work on esp driver.
 1.9 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.8 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.7 05-Sep-1998  pk Relinquish my copyright claims on this file.
 1.6 15-Aug-1998  mycroft Minor edit.
 1.5 15-Aug-1998  mycroft Assign copyright to TNF.
 1.4 21-Jul-1998  dbj Continued work on the esp scsi driver. Not yet working, but progress continues.
 1.3 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.2 13-Jul-1998  dbj worked on adding nextdma support for scsi driver.
 1.1 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.25.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.25.2.3 24-Apr-2001  bouyer Convert to new ncr53c9x attachement
 1.25.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.25.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.28.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.28.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.35.16.2 16-Jul-2002  gehenna catch up with -current.
 1.35.16.1 30-May-2002  gehenna Catch up with -current.
 1.35.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.35.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.35.8.3 01-Aug-2002  nathanw Catch up to -current.
 1.35.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.35.8.1 23-May-2001  nathanw file esp.c was added on branch nathanw_sa on 2002-06-20 03:40:22 +0000
 1.35.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.35.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.35.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.44.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.44.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.44.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.44.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.44.2.1 03-Aug-2004  skrll Sync with HEAD
 1.48.8.1 29-Apr-2005  kent sync with -current
 1.50.2.2 03-Sep-2007  yamt sync with head.
 1.50.2.1 21-Jun-2006  yamt sync with head.
 1.51.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.51.8.1 13-Mar-2006  yamt sync with head.
 1.51.6.1 22-Apr-2006  simonb Sync with head.
 1.51.4.1 09-Sep-2006  rpaulo sync with head
 1.52.16.1 12-Mar-2007  rmind Sync with HEAD.
 1.54.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.54.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.55.4.4 11-Mar-2010  yamt sync with head
 1.55.4.3 16-Sep-2009  yamt sync with head
 1.55.4.2 04-May-2009  yamt sync with head.
 1.55.4.1 16-May-2008  yamt sync with head.
 1.55.2.1 18-May-2008  yamt sync with head.
 1.56.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.59.22.3 03-Dec-2017  jdolecek update from HEAD
 1.59.22.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.59.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.59.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.59.12.1 30-Oct-2012  yamt sync with head
 1.60.2.1 18-May-2014  rmind sync with head
 1.63.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.63.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.63.6.1 28-Aug-2017  skrll Sync with HEAD
 1.64.44.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #63):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.64.18.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1581):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.5 03-Feb-2023  tsutsui Misc cleanup.

- use C99 designated initializer
- misc KNF
- TAB/space cleanup
 1.4 16-Sep-2001  jdolecek branches: 1.4.4;
remove unused defines; they duplicate appropriate defines from
<dev/ic/ncr53c9xreg.h> anyway
 1.3 03-Aug-1999  dbj branches: 1.3.14; 1.3.16;
added define for %b bitfield labels
 1.2 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 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 16-Sep-2001  jdolecek remove unused defines; they duplicate appropriate defines from
<dev/ic/ncr53c9xreg.h> anyway
 1.4.4.1 16-Sep-2001  jdolecek file espreg.h was added on branch nathanw_sa on 2001-09-16 10:39:11 +0000
 1.20 03-Feb-2023  tsutsui Misc cleanup.

- use C99 designated initializer
- misc KNF
- TAB/space cleanup
 1.19 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.18 13-Apr-2008  tsutsui branches: 1.18.2; 1.18.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.17 05-Mar-2007  tsutsui branches: 1.17.40;
Fix caddr_t fallout. Well, this driver is too ugly to read...
 1.16 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 03-May-2003  wiz branches: 1.15.18; 1.15.56;
DMA, not dma nor Dma.
 1.14 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.13 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.12 14-Sep-2001  jdolecek branches: 1.12.4; 1.12.12;
fix indentation
 1.11 14-Mar-1999  dbj branches: 1.11.20; 1.11.22;
changed dma start alignment from 4 to 16 so that the cache flush
functions always have cache line aligned segments.
continued experimentation with scsi driver.
 1.10 02-Mar-1999  dbj turn on diagnostic check in dma for controller bits at shutdown.
adjusted esp overrun to avoid diagnostic check triggering.
 1.9 14-Feb-1999  dbj Continue hacking on esp driver. Seems relatively stable in read only mode.
write operations appear to lose scsi interrupts and causes timeouts.
changes in this checkin include:
a nextdma bugfix causing a diagnostic check to erroneously trigger
Changed tail strategy to only use tail buffer for the minimal end slop
changed expected write dma overrun to 32 bytes.
turned on nextdma diagnostic check for dma end address since it
no longer gets triggerred by ethernet dma and helps debug scsi dma.
Added esp debugging printout and support.
 1.8 13-Feb-1999  dbj Continued work on esp scsi driver. Now can at least do enough i/o to create and mount
a filesystem, but is not stable enough yet for general use.
increased priority of ethernet interrupts, mostly useful to aid debugging
of scsi interrupts while using an nfs disk.
added additional debugging output in the next dma driver.
perform extranneous cache flushes/purges before dma reads/ after dma writes
to aid debugging of scsi dma.
 1.7 03-Feb-1999  dbj overhalt of scsi driver.
it still probes the disks ok, but is having trouble with 0xdeadbeef
in buffers read from the disk. Suspected problems with DMA alignment
and toggling the secret ninja dma control register
 1.6 27-Jan-1999  dbj Continue work on scsi driver. Added tail dma buffer. Still non functional.
 1.5 19-Dec-1998  dbj Revamped DMA interface to unify chaining and non-chaining dma sequences.
Updated ethernet driver to work with new interface.
Continue work on esp driver.
 1.4 21-Jul-1998  dbj Continued work on the esp scsi driver. Not yet working, but progress continues.
 1.3 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.2 13-Jul-1998  dbj worked on adding nextdma support for scsi driver.
 1.1 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.11.22.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.22.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.11.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.20.1 01-Oct-2001  fvdl Catch up with -current.
 1.12.12.1 16-Jul-2002  gehenna catch up with -current.
 1.12.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.12.4.2 01-Aug-2002  nathanw Catch up to -current.
 1.12.4.1 14-Sep-2001  nathanw file espvar.h was added on branch nathanw_sa on 2002-08-01 02:42:48 +0000
 1.15.56.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.18.1 03-Sep-2007  yamt sync with head.
 1.17.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.4.1 16-May-2008  yamt sync with head.
 1.18.2.1 18-May-2008  yamt sync with head.
 1.29 05-Jul-2024  rin sys: Drop redundant NULL check before m_freem(9)

m_freem(9) safely has accepted NULL argument at least since 4.2BSD:
https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c

Compile-tested on amd64/ALL.

Suggested by knakahara@
 1.28 03-Feb-2023  tsutsui branches: 1.28.6;
TAB/space cleanup.
 1.27 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.26 10-Nov-2019  chs branches: 1.26.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.25 25-Apr-2019  msaitoh - KNF.
- Use __arraycount.
- Remove extra 'n' from debug printf.
 1.24 10-Jun-2016  ozaki-r branches: 1.24.18;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.23 25-Mar-2014  christos branches: 1.23.6;
fix sprintf debugging mess.
 1.22 27-Oct-2012  chs branches: 1.22.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.21 24-Apr-2010  dbj branches: 1.21.8; 1.21.18;
switch from 4 clause to 2 clause BSD license.
 1.20 19-Jan-2010  pooka branches: 1.20.2; 1.20.4;
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.19 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.18 18-Mar-2009  cegger bcopy -> memcpy
 1.17 11-Dec-2005  christos branches: 1.17.78; 1.17.86; 1.17.92;
merge ktrace-lwp.
 1.16 19-Jan-2005  chs de-__P, remove register, ansify.
 1.15 11-Aug-2004  perseant branches: 1.15.4;
Allow compilation in the absence of DIAGNOSTIC and/or DEBUG options.
 1.14 15-Jul-2003  lukem __KERNEL_RCSID()
 1.13 03-May-2003  wiz branches: 1.13.2;
DMA, not dma nor Dma.
 1.12 20-Jan-2003  bouyer bzero the part of the buffer used to pad the packet to
ETHER_MIN_LEN - ETHER_CRC_LEN.
 1.11 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.10 01-Oct-2002  provos more trailing \r cleanup; pointed out by wiz
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.7 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.6 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.5 31-Mar-2001  dbj branches: 1.5.2; 1.5.8; 1.5.16;
comment out device register structure definitions, used for reference only.
remove unnecessary BUS_SPACE_MAP_LINEAR when mapping ethernet dma registers.
 1.4 01-Jun-2000  matt branches: 1.4.4;
Make booted_device global (and booted_parition for consitency).
Eliminate it from header files and other extern definitions.
 1.3 13-Feb-1999  dbj branches: 1.3.8; 1.3.16;
Continued work on esp scsi driver. Now can at least do enough i/o to create and mount
a filesystem, but is not stable enough yet for general use.
increased priority of ethernet interrupts, mostly useful to aid debugging
of scsi interrupts while using an nfs disk.
added additional debugging output in the next dma driver.
perform extranneous cache flushes/purges before dma reads/ after dma writes
to aid debugging of scsi dma.
 1.2 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.3.16.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.8.2 21-Apr-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.1 09-Apr-2001  nathanw Catch up with -current.
 1.5.16.1 16-Jul-2002  gehenna catch up with -current.
 1.5.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.5.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.5.8.2 01-Aug-2002  nathanw Catch up to -current.
 1.5.8.1 31-Mar-2001  nathanw file if_xe.c was added on branch nathanw_sa on 2002-08-01 02:42:48 +0000
 1.5.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.5.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.13.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.13.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.15.4.1 29-Apr-2005  kent sync with -current
 1.17.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.17.78.3 11-Aug-2010  yamt sync with head.
 1.17.78.2 11-Mar-2010  yamt sync with head
 1.17.78.1 04-May-2009  yamt sync with head.
 1.20.4.1 30-May-2010  rmind sync with head
 1.20.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.21.18.3 03-Dec-2017  jdolecek update from HEAD
 1.21.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.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.21.8.1 30-Oct-2012  yamt sync with head
 1.22.2.1 18-May-2014  rmind sync with head
 1.23.6.1 09-Jul-2016  skrll Sync with HEAD
 1.24.18.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.24.18.1 10-Jun-2019  christos Sync with HEAD
 1.26.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.28.6.1 02-Aug-2025  perseant Sync with HEAD
 1.3 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.2 23-Oct-2009  snj Remove 3rd and 4th clauses. OK cl@ (copyright holder).
 1.1 11-Sep-2002  mycroft branches: 1.1.2; 1.1.4; 1.1.116;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.1.116.1 11-Mar-2010  yamt sync with head
 1.1.4.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.1.4.1 11-Sep-2002  jdolecek file if_xereg.h was added on branch kqueue on 2002-10-10 18:34:37 +0000
 1.1.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.1 11-Sep-2002  nathanw file if_xereg.h was added on branch nathanw_sa on 2002-09-17 21:16:25 +0000
 1.5 24-Apr-2010  dbj switch from 4 clause to 2 clause BSD license.
 1.4 03-May-2003  wiz branches: 1.4.108; 1.4.128; 1.4.130;
DMA, not dma nor Dma.
 1.3 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.2 04-Mar-1999  dbj branches: 1.2.22; 1.2.26;
moved declaration of nextdma_intr into correct header file.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.26.1 17-Sep-2002  nathanw Catch up to -current.
 1.2.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.4.130.1 30-May-2010  rmind sync with head
 1.4.128.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.4.108.1 11-Aug-2010  yamt sync with head.
 1.19 11-Feb-2023  tsutsui Handle NeXT Turbo VRAM regions properly.

Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
 1.18 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.17 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.16 07-Aug-2021  thorpej branches: 1.16.6;
Merge thorpej-cfargs2.
 1.15 24-Apr-2021  thorpej branches: 1.15.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.14 06-Jun-2011  matt branches: 1.14.58; 1.14.68;
CFATTACH_DECL(..., sizeof(struct device), -> CFATTACH_DECL_NEW(..., 0
struct device * -> device_t
struct cfdata * -> cfdata_t
use bool when appropriate
 1.13 28-Apr-2008  martin branches: 1.13.22; 1.13.32;
Remove clause 3 and 4 from TNF licenses
 1.12 11-Dec-2005  christos branches: 1.12.74; 1.12.76; 1.12.78;
merge ktrace-lwp.
 1.11 26-Aug-2005  drochner s/locdesc_t/int/g
 1.10 30-Jun-2005  drochner branches: 1.10.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.9 19-Jan-2005  chs de-__P, remove register, ansify.
 1.8 15-Jul-2003  lukem branches: 1.8.8;
__KERNEL_RCSID()
 1.7 01-Jan-2003  thorpej branches: 1.7.2;
Use aprint_normal() for cfprint routines.
 1.6 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 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.3 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.2 28-Jan-1999  dbj branches: 1.2.22; 1.2.26;
wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.26.3 03-Jan-2003  thorpej Sync with HEAD.
 1.2.26.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.26.1 17-Sep-2002  nathanw Catch up to -current.
 1.2.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.7.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.2.4 24-Jan-2005  skrll Sync with HEAD.
 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.8.8.1 29-Apr-2005  kent sync with -current
 1.10.2.1 21-Jun-2006  yamt sync with head.
 1.12.78.1 16-May-2008  yamt sync with head.
 1.12.76.1 18-May-2008  yamt sync with head.
 1.12.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.32.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.22.1 12-Jun-2011  rmind sync with head
 1.14.68.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.14.68.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.14.68.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.14.68.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.14.68.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.14.68.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.14.58.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.15.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.16.6.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.8 11-Feb-2023  tsutsui Handle NeXT Turbo VRAM regions properly.

Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
 1.7 02-Jan-2011  tsutsui branches: 1.7.64; 1.7.90;
Explicitly include <machine/bus.h> here for bus_space_tag_t and bus_dma_tag_t.
 1.6 28-Apr-2008  martin branches: 1.6.22;
Remove clause 3 and 4 from TNF licenses
 1.5 04-Mar-2007  christos branches: 1.5.40; 1.5.42; 1.5.44;
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 01-Oct-2003  mycroft branches: 1.3.16;
Some small cleanup -- make the base,limit values vaddr_t, not char*.
Also add some code that attempts to deal with C16_VIDEO interrupts, though it
does not seem to make my color slabs work again.
 1.2 11-Sep-2002  mycroft branches: 1.2.6;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.28; 1.1.1.1.32;
Initial import of NetBSD/next68k.
 1.1.1.1.32.1 17-Sep-2002  nathanw Catch up to -current.
 1.1.1.1.28.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.2.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.6.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.44.1 16-May-2008  yamt sync with head.
 1.5.42.1 18-May-2008  yamt sync with head.
 1.5.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.22.1 05-Mar-2011  rmind sync with head
 1.7.90.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.7.64.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.71 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.70 03-Feb-2023  tsutsui Add proper rnd_add_uint32(9) calls to next68k xe(4) driver.
 1.69 18-Sep-2022  thorpej Eliminate use of IFF_OACTIVE. (It was not being used correctly here in
any case.)
 1.68 17-Mar-2022  andvar revert broken to borken, it is used spelling in BSD and "tastes better that way".
 1.67 16-Mar-2022  andvar s/paniced/panicked/ and s/borken/broken/ in comments.
 1.66 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.65 29-May-2019  msaitoh branches: 1.65.4;
Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
- Add ec_ifmedia into struct ethercom.
- ec_mii in struct ethercom is kept and used as it is. It might be used in
future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
ec_mii for keeping the if_media. Those should be changed in future.
 1.64 29-May-2019  msaitoh KNF. No functional change.
 1.63 29-May-2019  msaitoh Whitespace fix. No functional change.
 1.62 24-Apr-2019  msaitoh KNF. No functional change.
 1.61 05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.60 26-Jun-2018  msaitoh branches: 1.60.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.59 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.58 31-Mar-2017  msaitoh branches: 1.58.6; 1.58.12;
Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
 1.57 15-Dec-2016  ozaki-r branches: 1.57.2;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.56 10-Jun-2016  ozaki-r branches: 1.56.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.55 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.54 13-Apr-2015  riastradh MD rnd.h cleanups. Please let me know if I broke anything!
 1.53 10-Aug-2014  tls branches: 1.53.4;
Merge tls-earlyentropy branch into HEAD.
 1.52 24-Mar-2014  christos branches: 1.52.2;
- use cpu_{g,s}etmodel
- fix unused
 1.51 27-Oct-2012  chs branches: 1.51.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.50 02-Feb-2012  tls branches: 1.50.6;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.49 24-Apr-2010  dbj branches: 1.49.8; 1.49.12;
switch from 4 clause to 2 clause BSD license.
 1.48 05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.47 19-Jan-2010  pooka branches: 1.47.2; 1.47.4;
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.46 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.45 18-Mar-2009  cegger bcopy -> memcpy
 1.44 16-Dec-2008  christos branches: 1.44.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.43 07-Nov-2008  dyoung *** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.42 17-Oct-2007  garbled branches: 1.42.16; 1.42.20; 1.42.26; 1.42.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.41 01-Sep-2007  dyoung Change a bazillion occurrences of code resembling this,

error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);

if (error == ENETRESET) {

to this,

if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
 1.40 04-Mar-2007  christos branches: 1.40.2; 1.40.10; 1.40.14; 1.40.18; 1.40.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.39 07-Sep-2006  dogcow branches: 1.39.8;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.38 11-Dec-2005  christos branches: 1.38.4; 1.38.8;
merge ktrace-lwp.
 1.37 17-May-2005  christos branches: 1.37.2;
Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
 1.36 30-Jan-2005  thorpej Eliminate use of M_HASFCS.
 1.35 19-Jan-2005  chs branches: 1.35.2;
de-__P, remove register, ansify.
 1.34 30-Oct-2004  thorpej branches: 1.34.4;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.33 15-Jul-2003  lukem branches: 1.33.4;
__KERNEL_RCSID()
 1.32 03-May-2003  wiz branches: 1.32.2;
DMA, not dma nor Dma.
 1.31 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.30 11-Sep-2002  mycroft Don't blindly receive all multicast packets just because we're on a turbo.
Pay lip service to making promiscuous mode work.
 1.29 11-Sep-2002  mycroft Remove straggling NEXT_TURBO #ifdefs.
 1.28 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.27 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.26 20-May-2002  jdolecek branches: 1.26.2;
Fix race condition between the DMA handler (which gets called
on spldma), and rest of driver/network code (which runs on splnet) in way
if->if_snd queue is accessed. Solve by using intermediate queue.

Problem found, and fix provided by Christian Limpach in port-next68k/16798
 1.25 18-May-2002  jdolecek Various whitespace fixes, and turn 'No packet to start' message to DPRINTF().
Mostly inspired by Christian Limpach's patch in port-next68k/16978.
 1.24 16-Jun-2001  dbj branches: 1.24.2; 1.24.8; 1.24.16;
fix handling of transmit length calculation so we now handle full length xmits
 1.23 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.22 16-Apr-2001  dbj add receive ethernet bpf tap
keep receive ethernet crc and set M_HASFCS
change bus_dma MD fields to keep xfer_len for entire map
instead of per segment
turn off automatic dma restarts in preparation for changing
scsi driver to handle them.
add dma debugging routines to keep history of dma states
tweak checking for unusual dma limit register
 1.21 02-Apr-2001  dbj removed unused mediachange routines
changed ethernet receive to handle unexpected dma shutdowns
 1.20 14-Jan-2001  thorpej branches: 1.20.2;
Use splnet() to block network interrupts, not splimp().
 1.19 15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.18 09-Aug-2000  tv %b -> bitmask_snprintf()
 1.17 29-Aug-1999  dbj branches: 1.17.2; 1.17.12;
made debugging printfs switchable at run time via the "xe_debug" variable.
 1.16 28-Aug-1999  dbj discovered the purpose of another bit in the dma control register.
DMACSR_READ is now a CSR status bit which can be used to know if current transfer is
from cpu to device.
the old DMACSR_READ bit is renamed DMACSR_SETREAD. This is a control bit that tells
the dma transfer to be from cpu to device.
 1.15 05-Aug-1999  dbj changed dma segment field "ds_read_len" to "ds_xfer_len" since it is valid for
either read or write transfers.
 1.14 03-Aug-1999  dbj resync bus_dma functions with current alpha versions.
added a field to a dma segment to return the actual length of that segment that
was successfully transferred.
 1.13 03-Aug-1999  dbj removed unused variable.
 1.12 23-Jun-1999  abs In xxx_mediachange(), if there is no callback to the front-end, just
return 0 instead of EINVAL. In this case, there will only be one media
type, and the upper-level if_media code will ensure that the user is
setting to that type.
This matches changes Jason made a while back to sys/dev/ic/lance.c
 1.11 18-May-1999  thorpej 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.10 28-Feb-1999  explorer branches: 1.10.4;
Update to slightly altered rnd_attach_source() api
 1.9 27-Dec-1998  dbj After some experimentation, now allow dma start alignment to be 4.
Removed separate alignment constant for ethernet since it appears to
be unnecessary.
 1.8 19-Dec-1998  dbj Revamped DMA interface to unify chaining and non-chaining dma sequences.
Updated ethernet driver to work with new interface.
Continue work on esp driver.
 1.7 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.6 11-Jul-1998  dbj Reserved 8k at top of memory for ROM. This fixes warp9c boot problems.
changed ethernet panic to a warning when out of DMA buffers. This allows
resuming if you sit in ddb too long.
 1.5 05-Jul-1998  jonathan defopt NS, NSIP.
 1.4 05-Jul-1998  jonathan defopt LLC
 1.3 05-Jul-1998  jonathan defopt CCITT.
 1.2 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.10.4.2 01-Jul-1999  thorpej Sync w/ -current.
 1.10.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.12.2 16-Jun-2001  he Pull up revision 1.24 (via patch, requested by dbj):
Fix bugs related to calculation of transmit packet length and
allow unaligned pointers in bus_dmamap_sync(). Fixes problems
related to full-size ethernet packets, as reported in PR#13212.
 1.17.12.1 05-Apr-2001  he Apply patch (requested by dbj):
Truncate oversize packets caused by ethernet dma overruns.
 1.17.2.4 21-Apr-2001  bouyer Sync with HEAD
 1.17.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.17.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.17.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.20.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.20.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.24.16.2 16-Jul-2002  gehenna catch up with -current.
 1.24.16.1 30-May-2002  gehenna Catch up with -current.
 1.24.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.24.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.24.8.3 01-Aug-2002  nathanw Catch up to -current.
 1.24.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.24.8.1 16-Jun-2001  nathanw file mb8795.c was added on branch nathanw_sa on 2002-06-20 03:40:22 +0000
 1.24.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.24.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.24.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.26.2.1 28-Jan-2003  jmc Pullup revisions 1.11-1.12 of sys/arch/next68k/dev/if_xe.c via patch
(requested by bouyer in ticket #1125)
bzero the part of the buffer used to pad the packet to
ETHER_MIN_LEN - ETHER_CRC_LEN.
 1.32.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.32.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.32.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.32.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.32.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.2.1 03-Aug-2004  skrll Sync with HEAD
 1.33.4.1 24-Jan-2005  he Pull up revision 1.34 (requested by thorpej in ticket #939):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#27678.
 1.34.4.1 29-Apr-2005  kent sync with -current
 1.35.2.1 12-Feb-2005  yamt sync with head.
 1.37.2.2 03-Sep-2007  yamt sync with head.
 1.37.2.1 30-Dec-2006  yamt sync with head.
 1.38.8.1 14-Sep-2006  yamt sync with head.
 1.38.4.1 09-Sep-2006  rpaulo sync with head
 1.39.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.40.20.1 06-Nov-2007  matt sync with HEAD
 1.40.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.40.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.40.10.1 03-Oct-2007  garbled Sync with HEAD
 1.40.2.1 09-Oct-2007  ad Sync with head.
 1.42.28.2 28-Apr-2009  skrll Sync with HEAD.
 1.42.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.42.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.42.20.3 11-Aug-2010  yamt sync with head.
 1.42.20.2 11-Mar-2010  yamt sync with head
 1.42.20.1 04-May-2009  yamt sync with head.
 1.42.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.44.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.47.4.1 30-May-2010  rmind sync with head
 1.47.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.49.12.1 18-Feb-2012  mrg merge to -current.
 1.49.8.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.49.8.2 30-Oct-2012  yamt sync with head
 1.49.8.1 17-Apr-2012  yamt sync with head
 1.50.6.3 03-Dec-2017  jdolecek update from HEAD
 1.50.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.50.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.51.2.1 18-May-2014  rmind sync with head
 1.52.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.53.4.5 28-Aug-2017  skrll Sync with HEAD
 1.53.4.4 05-Feb-2017  skrll Sync with HEAD
 1.53.4.3 09-Jul-2016  skrll Sync with HEAD
 1.53.4.2 19-Mar-2016  skrll Sync with HEAD
 1.53.4.1 06-Jun-2015  skrll Sync with HEAD
 1.56.2.2 26-Apr-2017  pgoyette Sync with HEAD
 1.56.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.57.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.58.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.58.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.58.6.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.60.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.60.2.1 10-Jun-2019  christos Sync with HEAD
 1.65.4.1 29-Feb-2020  ad Sync with head.
 1.5 10-Jun-2023  dbj gratuitous commit to fix spelling error
 1.4 24-Apr-2010  dbj switch from 4 clause to 2 clause BSD license.
 1.3 11-Sep-2002  mycroft branches: 1.3.112; 1.3.132; 1.3.134;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.2 31-Mar-2001  dbj branches: 1.2.2; 1.2.8;
comment out device register structure definitions, used for reference only.
remove unnecessary BUS_SPACE_MAP_LINEAR when mapping ethernet dma registers.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.14; 1.1.1.1.26;
Initial import of NetBSD/next68k.
 1.1.1.1.26.1 09-Apr-2001  nathanw Catch up with -current.
 1.1.1.1.14.1 21-Apr-2001  bouyer Sync with HEAD
 1.2.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.2.8.1 31-Mar-2001  nathanw file mb8795reg.h was added on branch nathanw_sa on 2002-09-17 21:16:27 +0000
 1.2.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.3.134.1 30-May-2010  rmind sync with head
 1.3.132.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.3.112.1 11-Aug-2010  yamt sync with head.
 1.16 03-Feb-2023  tsutsui Use proper C99 int types.
 1.15 13-Apr-2015  riastradh MD rnd.h cleanups. Please let me know if I broke anything!
 1.14 27-Oct-2012  chs branches: 1.14.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.13 02-Feb-2012  tls branches: 1.13.6;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.12 19-Nov-2011  tls branches: 1.12.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.11 24-Apr-2010  dbj branches: 1.11.8;
switch from 4 clause to 2 clause BSD license.
 1.10 04-Mar-2007  christos branches: 1.10.44; 1.10.64; 1.10.66;
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 19-Jan-2005  chs branches: 1.8.8;
de-__P, remove register, ansify.
 1.7 11-Sep-2002  mycroft branches: 1.7.6; 1.7.14;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.6 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.5 20-May-2002  jdolecek Fix race condition between the DMA handler (which gets called
on spldma), and rest of driver/network code (which runs on splnet) in way
if->if_snd queue is accessed. Solve by using intermediate queue.

Problem found, and fix provided by Christian Limpach in port-next68k/16798
 1.4 18-May-2002  jdolecek whitespace & formatting fixes, from Christian Limpach in port-next68/16798
 1.3 02-Apr-2001  dbj branches: 1.3.2; 1.3.8; 1.3.16;
remove unused ifmedia fields
 1.2 09-Oct-2000  dbj branches: 1.2.2;
add rnd_source field to mb8796_softc
this fixes compile problems with rnd pseudo-device added to GENERIC kernel
patch submitted by greg oster
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.14; 1.1.1.1.24;
Initial import of NetBSD/next68k.
 1.1.1.1.24.1 16-Oct-2000  tv Pullup 1.2 [dbj]:
add rnd_source field to mb8796_softc
this fixes compile problems with rnd pseudo-device added to GENERIC kernel
patch submitted by greg oster
 1.1.1.1.14.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.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 09-Apr-2001  nathanw Catch up with -current.
 1.3.16.2 16-Jul-2002  gehenna catch up with -current.
 1.3.16.1 30-May-2002  gehenna Catch up with -current.
 1.3.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.3.8.3 01-Aug-2002  nathanw Catch up to -current.
 1.3.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.3.8.1 02-Apr-2001  nathanw file mb8795var.h was added on branch nathanw_sa on 2002-06-20 03:40:22 +0000
 1.3.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.3.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.14.1 29-Apr-2005  kent sync with -current
 1.7.6.1 24-Jan-2005  skrll Sync with HEAD.
 1.8.8.1 03-Sep-2007  yamt sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.66.1 30-May-2010  rmind sync with head
 1.10.64.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.10.44.1 11-Aug-2010  yamt sync with head.
 1.11.8.2 30-Oct-2012  yamt sync with head
 1.11.8.1 17-Apr-2012  yamt sync with head
 1.12.2.1 18-Feb-2012  mrg merge to -current.
 1.13.6.2 03-Dec-2017  jdolecek update from HEAD
 1.13.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.14.1 06-Jun-2015  skrll Sync with HEAD
 1.3 21-Jan-2002  jdolecek Switch to MI dev/md_root.c for archs which don't have any special
memory disk hooks (i.e. everything except atari).
 1.2 17-Mar-1999  sommerfe branches: 1.2.22; 1.2.26;
defopt MINIROOTSIZE
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.26.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.22.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.15 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.14 11-Feb-2023  tsutsui Add and check machine type NeXT_CUBE_TURBO (type 8).

Info from Andreas Grabher on port-next68k@.
 1.13 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.12 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.11 24-Apr-2010  dbj branches: 1.11.64; 1.11.90;
switch from 4 clause to 2 clause BSD license.
 1.10 05-Jan-2008  ad branches: 1.10.10; 1.10.30; 1.10.32;
Fix includes.
 1.9 24-Jan-2007  hubertf branches: 1.9.24; 1.9.30; 1.9.36;
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.8 11-Dec-2005  christos branches: 1.8.20;
merge ktrace-lwp.
 1.7 19-Jan-2005  chs branches: 1.7.8;
de-__P, remove register, ansify.
 1.6 15-Jul-2003  lukem branches: 1.6.8;
__KERNEL_RCSID()
 1.5 11-Sep-2002  mycroft branches: 1.5.6;
Attach nextdisplay on the mono turbo.
 1.4 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.3 29-Sep-2000  deberg branches: 1.3.4; 1.3.8;
add support for 12-bit color displays, from Timm Wetzel w/ changes by
me. closes 10741.
 1.2 29-Apr-1999  bad branches: 1.2.2; 1.2.12;
Don't use the direct console on color machines, which is currently not
supported. Use serial console instead.
From Matt Debergalis PR 7488.
 1.1 26-Mar-1999  dbj branches: 1.1.2;
Added support for using wscons as console.
Enabled wscons as default console.
Use option SERCONSOLE now to use serial console instead now.
 1.1.2.1 29-Apr-1999  perry branches: 1.1.2.1.2;
pullup 1.1->1.2 (bad)
 1.1.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.12.1 06-Oct-2000  deberg pullup 1.3, approved by thorpej

add support for 12-bit color displays, from Timm Wetzel w/ changes by
me. closes 10741.
 1.2.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.3.8.1 17-Sep-2002  nathanw Catch up to -current.
 1.3.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.5.6.4 24-Jan-2005  skrll Sync with HEAD.
 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.8.1 29-Apr-2005  kent sync with -current
 1.7.8.2 21-Jan-2008  yamt sync with head
 1.7.8.1 26-Feb-2007  yamt sync with head.
 1.8.20.1 01-Feb-2007  ad Sync with head.
 1.9.36.1 08-Jan-2008  bouyer Sync with HEAD
 1.9.30.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.24.1 09-Jan-2008  matt sync with HEAD
 1.10.32.1 30-May-2010  rmind sync with head
 1.10.30.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.10.10.1 11-Aug-2010  yamt sync with head.
 1.11.90.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.11.64.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.31 02-Feb-2024  tsutsui Add WSDISPLAY_GINFO, LINEBYTES, and SMODE ioctl(2)s and mmap(2) support.

mlterm-wscons partially works (no 2 bpp support) with these APIs.
XXX: Xorg server needs wsmouse support.
 1.30 11-Feb-2023  tsutsui NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.

Info from Andreas Grabher on port-next68k@.
 1.29 11-Feb-2023  tsutsui Add and check machine type NeXT_CUBE_TURBO (type 8).

Info from Andreas Grabher on port-next68k@.
 1.28 11-Feb-2023  tsutsui Handle NeXT Turbo VRAM regions properly.

Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
 1.27 03-Feb-2023  tsutsui Use proper C99 int types.
 1.26 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.25 07-Aug-2021  thorpej branches: 1.25.6;
Merge thorpej-cfargs2.
 1.24 24-Apr-2021  thorpej branches: 1.24.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.23 21-Nov-2020  thorpej branches: 1.23.2;
malloc(9) -> kmem(9)
 1.22 12-Nov-2019  msaitoh branches: 1.22.8;
Add missing initialization of sc_dev.
 1.21 27-Oct-2012  chs branches: 1.21.30; 1.21.38; 1.21.42;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.20 04-Mar-2007  christos branches: 1.20.78; 1.20.88;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 12-Apr-2006  jmmv branches: 1.19.14;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10; 1.18.12;
merge ktrace-lwp.
 1.17 19-Jan-2005  chs branches: 1.17.8;
de-__P, remove register, ansify.
 1.16 11-Jan-2005  chs branches: 1.16.2;
remove leftover debug printf.
 1.15 05-Oct-2003  mycroft Minor tweaks to the color framebuffer code -- still don't know what the deal
with the interrupt is.
 1.14 01-Oct-2003  mycroft Some small cleanup -- make the base,limit values vaddr_t, not char*.
Also add some code that attempts to deal with C16_VIDEO interrupts, though it
does not seem to make my color slabs work again.
 1.13 15-Jul-2003  lukem __KERNEL_RCSID()
 1.12 02-Oct-2002  thorpej branches: 1.12.6;
Use CFATTACH_DECL().
 1.11 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.10 11-Sep-2002  mycroft Attach nextdisplay on the mono turbo.
 1.9 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.8 04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.7 17-Mar-2002  atatat branches: 1.7.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.6 15-Jun-2001  dbj branches: 1.6.2; 1.6.8;
remove extra args from printf
 1.5 29-Sep-2000  deberg branches: 1.5.2;
add support for 12-bit color displays, from Timm Wetzel w/ changes by
me. closes 10741.
 1.4 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.3 06-Dec-1999  drochner branches: 1.3.4;
update for changed struct wsdisplay_accessops:show_screen signature.
no functional changes
 1.2 24-Mar-1999  dbj branches: 1.2.8; 1.2.14;
Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.1 28-Jan-1999  dbj wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.2.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.4.2 06-Oct-2000  deberg pullup 1.5, approved by thorpej

add support for 12-bit color displays, from Timm Wetzel w/ changes by
me. closes 10741.
 1.3.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.5.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.6.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.6.8.3 01-Aug-2002  nathanw Catch up to -current.
 1.6.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.6.8.1 15-Jun-2001  nathanw file nextdisplay.c was added on branch nathanw_sa on 2002-04-01 07:41:44 +0000
 1.6.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.6.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.6.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.4.1 16-Jul-2002  gehenna catch up with -current.
 1.12.6.6 31-Jan-2005  skrll Adapt to branch.
 1.12.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.12.6.4 17-Jan-2005  skrll Sync with HEAD.
 1.12.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.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 21-Jun-2006  yamt sync with head.
 1.18.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.18.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.18.8.1 24-May-2006  yamt sync with head.
 1.18.6.1 22-Apr-2006  simonb Sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.19.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.20.88.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.20.78.1 30-Oct-2012  yamt sync with head
 1.21.42.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.21.42.1 14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #425):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.

Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.

Add missing initialization of sc_dev.
 1.21.38.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.21.30.1 14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1439):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.


Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.


Add missing initialization of sc_dev.
 1.22.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.23.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.24.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.25.6.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.7 02-Feb-2024  tsutsui Add WSDISPLAY_GINFO, LINEBYTES, and SMODE ioctl(2)s and mmap(2) support.

mlterm-wscons partially works (no 2 bpp support) with these APIs.
XXX: Xorg server needs wsmouse support.
 1.6 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.5 27-Oct-2012  chs branches: 1.5.42; 1.5.68;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.4 11-Dec-2005  christos branches: 1.4.112; 1.4.122;
merge ktrace-lwp.
 1.3 19-Jan-2005  chs de-__P, remove register, ansify.
 1.2 24-Mar-1999  dbj branches: 1.2.42; 1.2.50;
Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.1 28-Jan-1999  dbj wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.2.50.1 29-Apr-2005  kent sync with -current
 1.2.42.1 24-Jan-2005  skrll Sync with HEAD.
 1.4.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.112.1 30-Oct-2012  yamt sync with head
 1.5.68.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.5.42.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.52 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.51 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.50 31-Mar-2017  msaitoh Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
 1.49 25-Mar-2014  christos branches: 1.49.6; 1.49.10; 1.49.14;
fix sprintf debugging mess.
 1.48 27-Oct-2012  chs branches: 1.48.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.47 06-Jun-2010  mrg branches: 1.47.8; 1.47.18;
fix some errors in debug code, found by henning petersen in PR#42529.
 1.46 24-Apr-2010  dbj switch from 4 clause to 2 clause BSD license.
 1.45 05-Nov-2009  dyoung branches: 1.45.2; 1.45.4;
Use deviter(9) instead of accessing alldevs directly. Untested.
 1.44 17-Dec-2008  cegger make the compile again
 1.43 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.42 14-May-2006  elad branches: 1.42.62; 1.42.66; 1.42.74;
integrate kauth.
 1.41 08-Mar-2006  lukem Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.40 24-Dec-2005  perry branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.39 11-Dec-2005  christos merge ktrace-lwp.
 1.38 05-Jun-2005  he branches: 1.38.2;
Adapt to -Wcast-qual by adding a few consts.
 1.37 19-Jan-2005  chs de-__P, remove register, ansify.
 1.36 04-Dec-2003  keihan branches: 1.36.8;
netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.35 15-Jul-2003  lukem __KERNEL_RCSID()
 1.34 02-Oct-2002  thorpej branches: 1.34.6;
Use CFATTACH_DECL().
 1.33 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.32 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.31 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.30 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.29 16-Jun-2001  dbj branches: 1.29.2; 1.29.8; 1.29.16;
fix handling of transmit length calculation so we now handle full length xmits
 1.28 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.27 17-Apr-2001  dbj increase maxsegs of esp main dma map by one to avoid error
tweak esp glue to read xfer_len from dma map
add some debugging checks for dma driver invariants
read DD_LIMIT instead of DD_SAVED_LIMIT on scsi dma shutdowns
 1.26 16-Apr-2001  dbj add receive ethernet bpf tap
keep receive ethernet crc and set M_HASFCS
change bus_dma MD fields to keep xfer_len for entire map
instead of per segment
turn off automatic dma restarts in preparation for changing
scsi driver to handle them.
add dma debugging routines to keep history of dma states
tweak checking for unusual dma limit register
 1.25 07-Apr-2001  dbj automatically restart dma for unexpected shutdowns
 1.24 07-Apr-2001  dbj continue to tweak nextdma detection of xfer length
add check to esp driver for incomplete transfers, but still does not handle them.
 1.23 02-Apr-2001  dbj No longer clobber the DMACSR_SETENABLE bit in the dma interrupt
Add the ability to handle unexpected dma shutdowns
 1.22 09-Aug-2000  tv branches: 1.22.2;
%b -> bitmask_snprintf()
 1.21 12-Jan-2000  dbj branches: 1.21.4;
applied patch from "Christian Limpach" <chris@Nice.CH>:
I've fixed the problem that's been keeping me from using anything newer than
1.4.1 now. I tracked down the problem checkin, it's the big reorg of
nextdma.c between 1.19 and 1.20. It didn't introduce a new bug but it
activated a check which wasn't activated before. It's the
is-the-limit-in-the-right-window-check which was ifdeffed before because
some DMA-regs would sometimes have strange values. I think I've fixed the
DMA-reg stuff for now: at the end of nextdma_intr, when the csr is poked
to make DMA do something, I think the check for the ENABLE bit introduces a
race condition. I fixed this by unconditionally setting DMACSR_SETENABLE,
this seems to work and also makes the code more readable. I've also tried
setting DMACSR_SETSUPDATE unconditionally and this also works well, but I
don't know what it implies. Unless you have reasons to not set SUPDATE all
the time, I'd suggest making this change as well, it makes the code cleaner
and faster...
I've tested this patch and it does stop the panics, although I don't think setting
SUPDATE all the tima as he suggests is a good idea. The "SUPDATE" bit implies
a single update (i.e. the end of a dma chain.)
 1.20 29-Aug-1999  dbj branches: 1.20.2;
minor rework of dma driver
now uses the DMACSR_READ bit and no longer keeps _nd_dmadir in softc
unified transfer cleanup code, now in routine next_dma_finish_xfer()
fixed bounds checking on registers after transfer.
removed checking for bus errors since the bit is always set on some nexts
(specifically, on mourning, a 25mhz 68040 mono slab)
fixed a couple of dma bugs involving chaining dma buffers.
 1.19 28-Aug-1999  dbj discovered the purpose of another bit in the dma control register.
DMACSR_READ is now a CSR status bit which can be used to know if current transfer is
from cpu to device.
the old DMACSR_READ bit is renamed DMACSR_SETREAD. This is a control bit that tells
the dma transfer to be from cpu to device.
 1.18 17-Aug-1999  dbj remove some debugging hacks that were no longer being used.
 1.17 05-Aug-1999  dbj changed dma segment field "ds_read_len" to "ds_xfer_len" since it is valid for
either read or write transfers.
 1.16 03-Aug-1999  dbj resync bus_dma functions with current alpha versions.
added a field to a dma segment to return the actual length of that segment that
was successfully transferred.
 1.15 14-Mar-1999  dbj branches: 1.15.2;
changed dma start alignment from 4 to 16 so that the cache flush
functions always have cache line aligned segments.
continued experimentation with scsi driver.
 1.14 04-Mar-1999  dbj moved declaration of nextdma_intr into correct header file.
 1.13 02-Mar-1999  dbj turn on diagnostic check in dma for controller bits at shutdown.
adjusted esp overrun to avoid diagnostic check triggering.
 1.12 14-Feb-1999  dbj Continue hacking on esp driver. Seems relatively stable in read only mode.
write operations appear to lose scsi interrupts and causes timeouts.
changes in this checkin include:
a nextdma bugfix causing a diagnostic check to erroneously trigger
Changed tail strategy to only use tail buffer for the minimal end slop
changed expected write dma overrun to 32 bytes.
turned on nextdma diagnostic check for dma end address since it
no longer gets triggerred by ethernet dma and helps debug scsi dma.
Added esp debugging printout and support.
 1.11 13-Feb-1999  dbj Continued work on esp scsi driver. Now can at least do enough i/o to create and mount
a filesystem, but is not stable enough yet for general use.
increased priority of ethernet interrupts, mostly useful to aid debugging
of scsi interrupts while using an nfs disk.
added additional debugging output in the next dma driver.
perform extranneous cache flushes/purges before dma reads/ after dma writes
to aid debugging of scsi dma.
 1.10 27-Jan-1999  dbj Fixed dma instability introduced with nextdma.c rev 1.7
This fix removes putting 0xfeedbeef in the unused restart registers.
When that was done, the machine would panic after a short while
with 0xfeedbeef in the normal dma buffer registers. A restart
cycle is probably hapenning without an interrupt or something.
 1.9 30-Dec-1998  dbj changed register for start of dma buffer to be DD_NEXT_INITBUF instead
of DD_NEXT for regular dma transfers, and not just ethernet transmit.
Keep track of dma read/write direction and set it each time we start or
restart dma. This allows scsi to work, and doesn't appear to hinder ethernet.
 1.8 26-Dec-1998  dbj Continued experimentation on SCSI driver.
Added nextdma_debug variable to control debug printouts in nextdma driver
when ND_DEBUG is defined.
 1.7 19-Dec-1998  dbj Revamped DMA interface to unify chaining and non-chaining dma sequences.
Updated ethernet driver to work with new interface.
Continue work on esp driver.
 1.6 08-Dec-1998  dbj initialized unused dma registers to 0xdeadbeef instead of 0 to aid debugging.
 1.5 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.4 21-Jul-1998  dbj Continued work on the esp scsi driver. Not yet working, but progress continues.
 1.3 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.2 01-Jul-1998  dbj changed diagnostic panic into a printf since an unexpected condition appears
to happen every once in a while. (The DMA interrupt gets called w/o
the completed bit set)
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.15.2.1 21-Jan-2000  he Pull up revision 1.21 (via patch, requested by dbj):
Fix problem that causes xe0 to get frequent weird DMA Rx interrupts
and panics. Fixes PR#8847.
 1.20.2.2 21-Apr-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.21.4.1 16-Jun-2001  he Pull up revision 1.29 (via patch, requested by dbj):
Fix bugs related to calculation of transmit packet length and
allow unaligned pointers in bus_dmamap_sync(). Fixes problems
related to full-size ethernet packets, as reported in PR#13212.
 1.22.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.22.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.29.16.1 16-Jul-2002  gehenna catch up with -current.
 1.29.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.29.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.29.8.2 01-Aug-2002  nathanw Catch up to -current.
 1.29.8.1 16-Jun-2001  nathanw file nextdma.c was added on branch nathanw_sa on 2002-08-01 02:42:49 +0000
 1.29.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.29.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.34.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.34.6.4 24-Jan-2005  skrll Sync with HEAD.
 1.34.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.34.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.34.6.1 03-Aug-2004  skrll Sync with HEAD
 1.36.8.1 29-Apr-2005  kent sync with -current
 1.38.2.1 21-Jun-2006  yamt sync with head.
 1.40.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.40.8.1 13-Mar-2006  yamt sync with head.
 1.40.6.1 22-Apr-2006  simonb Sync with head.
 1.40.4.1 09-Sep-2006  rpaulo sync with head
 1.42.74.1 19-Jan-2009  skrll Sync with HEAD.
 1.42.66.3 11-Aug-2010  yamt sync with head.
 1.42.66.2 11-Mar-2010  yamt sync with head
 1.42.66.1 04-May-2009  yamt sync with head.
 1.42.62.1 17-Jan-2009  mjf Sync with HEAD.
 1.45.4.2 03-Jul-2010  rmind sync with head
 1.45.4.1 30-May-2010  rmind sync with head
 1.45.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.45.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.47.18.3 03-Dec-2017  jdolecek update from HEAD
 1.47.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.47.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.47.8.1 30-Oct-2012  yamt sync with head
 1.48.2.1 18-May-2014  rmind sync with head
 1.49.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.49.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.49.6.1 28-Aug-2017  skrll Sync with HEAD
 1.10 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.9 24-Apr-2010  dbj switch from 4 clause to 2 clause BSD license.
 1.8 11-Sep-2002  mycroft branches: 1.8.112; 1.8.132; 1.8.134;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.7 31-Mar-2001  dbj branches: 1.7.2; 1.7.8;
comment out device register structure definitions, used for reference only.
remove unnecessary BUS_SPACE_MAP_LINEAR when mapping ethernet dma registers.
 1.6 28-Aug-1999  dbj branches: 1.6.2; 1.6.14;
fixed DMACSR_BITS definition to reflect DMACSR_READ bit renaming
 1.5 28-Aug-1999  dbj discovered the purpose of another bit in the dma control register.
DMACSR_READ is now a CSR status bit which can be used to know if current transfer is
from cpu to device.
the old DMACSR_READ bit is renamed DMACSR_SETREAD. This is a control bit that tells
the dma transfer to be from cpu to device.
 1.4 14-Mar-1999  dbj changed dma start alignment from 4 to 16 so that the cache flush
functions always have cache line aligned segments.
continued experimentation with scsi driver.
 1.3 27-Dec-1998  dbj After some experimentation, now allow dma start alignment to be 4.
Removed separate alignment constant for ethernet since it appears to
be unnecessary.
 1.2 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.6.14.1 09-Apr-2001  nathanw Catch up with -current.
 1.6.2.1 21-Apr-2001  bouyer Sync with HEAD
 1.7.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.7.8.1 31-Mar-2001  nathanw file nextdmareg.h was added on branch nathanw_sa on 2002-09-17 21:16:30 +0000
 1.7.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.8.134.1 30-May-2010  rmind sync with head
 1.8.132.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.8.112.1 11-Aug-2010  yamt sync with head.
 1.18 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.17 25-Mar-2014  christos fix sprintf debugging mess.
 1.16 27-Oct-2012  chs branches: 1.16.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.15 24-Apr-2010  dbj branches: 1.15.8; 1.15.18;
switch from 4 clause to 2 clause BSD license.
 1.14 11-Dec-2005  christos branches: 1.14.78; 1.14.98; 1.14.100;
merge ktrace-lwp.
 1.13 05-Jun-2005  he Adapt to -Wcast-qual by adding a few consts.
 1.12 19-Jan-2005  chs de-__P, remove register, ansify.
 1.11 11-Sep-2002  mycroft branches: 1.11.6; 1.11.14;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.10 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.9 29-Aug-1999  dbj branches: 1.9.16; 1.9.20; 1.9.28;
minor rework of dma driver
now uses the DMACSR_READ bit and no longer keeps _nd_dmadir in softc
unified transfer cleanup code, now in routine next_dma_finish_xfer()
fixed bounds checking on registers after transfer.
removed checking for bus errors since the bit is always set on some nexts
(specifically, on mourning, a 25mhz 68040 mono slab)
fixed a couple of dma bugs involving chaining dma buffers.
 1.8 28-Aug-1999  dbj discovered the purpose of another bit in the dma control register.
DMACSR_READ is now a CSR status bit which can be used to know if current transfer is
from cpu to device.
the old DMACSR_READ bit is renamed DMACSR_SETREAD. This is a control bit that tells
the dma transfer to be from cpu to device.
 1.7 03-Aug-1999  dbj resync bus_dma functions with current alpha versions.
added a field to a dma segment to return the actual length of that segment that
was successfully transferred.
 1.6 14-Mar-1999  dbj changed dma start alignment from 4 to 16 so that the cache flush
functions always have cache line aligned segments.
continued experimentation with scsi driver.
 1.5 04-Mar-1999  dbj moved declaration of nextdma_intr into correct header file.
 1.4 30-Dec-1998  dbj changed register for start of dma buffer to be DD_NEXT_INITBUF instead
of DD_NEXT for regular dma transfers, and not just ethernet transmit.
Keep track of dma read/write direction and set it each time we start or
restart dma. This allows scsi to work, and doesn't appear to hinder ethernet.
 1.3 19-Dec-1998  dbj Revamped DMA interface to unify chaining and non-chaining dma sequences.
Updated ethernet driver to work with new interface.
Continue work on esp driver.
 1.2 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.9.28.1 16-Jul-2002  gehenna catch up with -current.
 1.9.20.2 17-Sep-2002  nathanw Catch up to -current.
 1.9.20.1 01-Aug-2002  nathanw Catch up to -current.
 1.9.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.9.16.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.11.14.1 29-Apr-2005  kent sync with -current
 1.11.6.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.6.1 24-Jan-2005  skrll Sync with HEAD.
 1.14.100.1 30-May-2010  rmind sync with head
 1.14.98.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.14.78.1 11-Aug-2010  yamt sync with head.
 1.15.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.15.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.15.8.1 30-Oct-2012  yamt sync with head
 1.16.2.1 18-May-2014  rmind sync with head
 1.19 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.18 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.17 24-Apr-2021  thorpej branches: 1.17.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.16 21-Nov-2020  thorpej branches: 1.16.2;
malloc(9) -> kmem(9)
 1.15 24-Mar-2014  christos branches: 1.15.42;
- use cpu_{g,s}etmodel
- fix unused
 1.14 27-Oct-2012  chs branches: 1.14.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.13 05-Jan-2008  ad branches: 1.13.44; 1.13.54;
Fix includes.
 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 04-Aug-2006  mhitch branches: 1.11.10;
gcc4 fix: gcc3 was apparently more lax in structure declarations - change
order of including nextkbdvar.h and wskbbdmap_next.h.
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.8;
merge ktrace-lwp.
 1.9 19-Jan-2005  chs branches: 1.9.8;
de-__P, remove register, ansify.
 1.8 15-Jul-2003  lukem branches: 1.8.8;
__KERNEL_RCSID()
 1.7 02-Oct-2002  thorpej branches: 1.7.6;
Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.4 17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.3 26-Mar-1999  dbj branches: 1.3.22; 1.3.26;
fix polled keyboard support
 1.2 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.1 28-Jan-1999  dbj wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.3.26.3 18-Oct-2002  nathanw Catch up to -current.
 1.3.26.2 17-Sep-2002  nathanw Catch up to -current.
 1.3.26.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.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.3.22.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.6.5 31-Jan-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.8.8.1 29-Apr-2005  kent sync with -current
 1.9.8.4 21-Jan-2008  yamt sync with head
 1.9.8.3 03-Sep-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.8.1 11-Aug-2006  yamt sync with head
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.11.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.32.1 08-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.54.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.54.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.13.44.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.44.1 30-Oct-2012  yamt sync with head
 1.14.2.1 18-May-2014  rmind sync with head
 1.15.42.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.16.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.17.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.4 11-Dec-2005  christos branches: 1.4.112; 1.4.122;
merge ktrace-lwp.
 1.3 19-Jan-2005  chs de-__P, remove register, ansify.
 1.2 11-Sep-2002  mycroft branches: 1.2.6; 1.2.14;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.1 28-Jan-1999  dbj branches: 1.1.22; 1.1.26;
wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.1.26.1 17-Sep-2002  nathanw Catch up to -current.
 1.1.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.2.14.1 29-Apr-2005  kent sync with -current
 1.2.6.1 24-Jan-2005  skrll Sync with HEAD.
 1.4.122.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.112.1 30-Oct-2012  yamt sync with head
 1.2 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.1 28-Jan-1999  dbj wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.2 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.1 28-Jan-1999  dbj wscons based console video & keyboard support for the NeXT
from Matt DeBergalis
 1.6 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.76; 1.4.78;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 26-Mar-1999  dbj branches: 1.2.42;
add KS_bar and KS_backslash to default us keymap.
 1.1 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 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.78.1 16-May-2008  yamt sync with head.
 1.4.76.1 18-May-2008  yamt sync with head.
 1.4.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 24-Mar-1999  dbj branches: 1.1.144; 1.1.146; 1.1.148;
Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.1.148.1 16-May-2008  yamt sync with head.
 1.1.146.1 18-May-2008  yamt sync with head.
 1.1.144.1 02-Jun-2008  mjf Sync with HEAD.
 1.38 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.37 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.36 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.35 24-Apr-2021  thorpej branches: 1.35.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.34 01-May-2017  martin branches: 1.34.24;
PR port-next68k/52205 from Miod Vallat: cosmetic change to print the
physical address when attaching zs devices.
For the real work, zs_get_chan_addr() will still use the virtual address.
 1.33 13-Jun-2008  cegger branches: 1.33.40; 1.33.60; 1.33.74;
use device_lookup_private to get softc
 1.32 28-Apr-2008  martin branches: 1.32.2; 1.32.4;
Remove clause 3 and 4 from TNF licenses
 1.31 29-Mar-2008  tsutsui branches: 1.31.2; 1.31.4;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.30 28-Nov-2007  ad branches: 1.30.14;
Use the softint API.
 1.29 09-Nov-2007  ad Call zs_lock_init() to set up the chanstate's lock.
 1.28 08-Mar-2007  tsutsui branches: 1.28.2; 1.28.18; 1.28.20; 1.28.24; 1.28.26;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.27 11-Dec-2005  christos branches: 1.27.26;
merge ktrace-lwp.
 1.26 10-Jan-2005  chs branches: 1.26.10;
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 nexts can have more than 1 zsc.
 1.25 10-Jan-2005  chs really remove register.
 1.24 10-Jan-2005  chs de-__P, remove register, ansify, other cleanup.
 1.23 15-Jul-2003  lukem __KERNEL_RCSID()
 1.22 28-Jan-2003  pk branches: 1.22.2;
Provide locking required by the interrupt handlers running at IPL_SERIAL.
 1.21 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.20 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.19 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.18 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.17 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.16 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.15 30-May-2001  lukem branches: 1.15.2; 1.15.4; 1.15.8; 1.15.16;
add missing #include "opt_kgdb.h"
 1.14 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.13 05-Apr-2001  dbj initialize zsaddr to intio address space in zs_attach
addresses pr 6770
in the future, zs should be upgraded to use NEXT68k_INTIO_BUS_SPACE
instead of using IIOV directly.
 1.12 06-Mar-2000  deberg branches: 1.12.6;
we don't have callrom(), so stop pretending otherwise. fixes PR
next68k/7257.
 1.11 03-Aug-1999  dbj branches: 1.11.2;
defopt SERCONSOLE
 1.10 27-Mar-1999  dbj added kgdb support.
 1.9 27-Mar-1999  wrstuden Add pps support. Only enable pps if CLOCAL & !MDMBUF.
 1.8 26-Mar-1999  dbj Added support for using wscons as console.
Enabled wscons as default console.
Use option SERCONSOLE now to use serial console instead now.
 1.7 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.6 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.5 02-Jan-1999  dbj applied patch from pr port-next68k/6704: next68k zs driver formatting error
zs driver needs to print a newline.
 1.4 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.3 11-Jul-1998  dbj Reserved 8k at top of memory for ROM. This fixes warp9c boot problems.
changed ethernet panic to a warning when out of DMA buffers. This allows
resuming if you sit in ddb too long.
 1.2 04-Jul-1998  jonathan defopt DDB.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.11.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.11.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.6.2 21-Jun-2001  nathanw Catch up to -current.
 1.12.6.1 09-Apr-2001  nathanw Catch up with -current.
 1.15.16.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.15.8.4 03-Jan-2003  thorpej Sync with HEAD.
 1.15.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.15.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.15.8.1 30-May-2001  nathanw file zs.c was added on branch nathanw_sa on 2002-09-17 21:16:31 +0000
 1.15.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.15.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.22.2.4 17-Jan-2005  skrll Sync with HEAD.
 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.26.10.3 07-Dec-2007  yamt sync with head
 1.26.10.2 15-Nov-2007  yamt sync with head.
 1.26.10.1 03-Sep-2007  yamt sync with head.
 1.27.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.28.26.2 08-Dec-2007  mjf Sync with HEAD.
 1.28.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.28.24.1 13-Nov-2007  bouyer Sync with HEAD
 1.28.20.1 09-Jan-2008  matt sync with HEAD
 1.28.18.2 03-Dec-2007  joerg Sync with HEAD.
 1.28.18.1 11-Nov-2007  joerg Sync with HEAD.
 1.28.2.1 03-Dec-2007  ad Sync with HEAD.
 1.30.14.3 29-Jun-2008  mjf Sync with HEAD.
 1.30.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.30.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.31.4.2 04-May-2009  yamt sync with head.
 1.31.4.1 16-May-2008  yamt sync with head.
 1.31.2.2 17-Jun-2008  yamt sync with head.
 1.31.2.1 18-May-2008  yamt sync with head.
 1.32.4.1 18-Jun-2008  simonb Sync with head.
 1.32.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.33.74.1 02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.33.60.1 28-Aug-2017  skrll Sync with HEAD
 1.33.40.1 03-Dec-2017  jdolecek update from HEAD
 1.34.24.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.35.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 10-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 nexts can have more than 1 zsc.
 1.2 10-Jan-2005  chs de-__P, remove register, ansify.
 1.1 27-Mar-1999  dbj branches: 1.1.42;
added kgdb support.
 1.1.42.1 17-Jan-2005  skrll Sync with HEAD.
 1.13 20-Oct-2023  andvar make zs_kgdb.c build for next68k.

kgdb_dev expects llx/d format specifier.
change serial number print message to the same as sgimips.
remove rr0 definition in zs_kgdb_txint, it is unused.

Fixes also KGDB enabled build for next68k.
Similar or partial changes likely required for few other ports.
 1.12 28-Apr-2008  martin branches: 1.12.68; 1.12.78;
Remove clause 3 and 4 from TNF licenses
 1.11 29-Mar-2008  tsutsui branches: 1.11.2; 1.11.4;
Split softc and device_t for zsc(4) and its children.

XXX we should restructure MI APIs and make it really machine independent.
 1.10 17-Oct-2007  garbled branches: 1.10.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.9 23-Jun-2007  hauke branches: 1.9.10;
Fix a warning from gcc 4 about stripping the volatile qualifier by a cast
by doing the proper __UNVOLATILE() dance.
 1.8 11-Dec-2005  christos branches: 1.8.30; 1.8.32; 1.8.38;
merge ktrace-lwp.
 1.7 19-Jan-2005  chs branches: 1.7.8;
de-__P, remove register, ansify.
 1.6 10-Jan-2005  chs branches: 1.6.2;
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 nexts can have more than 1 zsc.
 1.5 10-Jan-2005  chs de-__P, remove register, ansify.
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 06-Sep-2002  gehenna branches: 1.3.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.2 17-May-2002  jdolecek make kgdb buildable again, g/c next68k/stub.c
Changes by Christian Limpach in kern/16794, with some minor adjustment
by me.
 1.1 27-Mar-1999  dbj branches: 1.1.22; 1.1.26; 1.1.34;
added kgdb support.
 1.1.34.2 30-May-2002  gehenna Catch up with -current.
 1.1.34.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.1.26.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.26.1 20-Jun-2002  nathanw Catch up to -current.
 1.1.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.1.22.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.3.6.4 17-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.6.2.1 29-Apr-2005  kent sync with -current
 1.7.8.1 03-Sep-2007  yamt sync with head.
 1.8.38.1 26-Jun-2007  garbled Sync with HEAD.
 1.8.32.1 11-Jul-2007  mjf Sync with head.
 1.8.30.1 15-Jul-2007  ad Sync with head.
 1.9.10.1 06-Nov-2007  matt sync with HEAD
 1.10.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.10.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.4.1 16-May-2008  yamt sync with head.
 1.11.2.1 18-May-2008  yamt sync with head.
 1.12.78.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.12.68.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.24 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.23 12-Jul-2018  maxv branches: 1.23.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.22 24-Dec-2015  christos branches: 1.22.16; 1.22.18;
fenv for m68k
 1.21 17-Jul-2011  joerg branches: 1.21.12; 1.21.30;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.20 09-Feb-2007  ad Merge newlock2 to head.
 1.19 26-Jul-2006  drochner branches: 1.19.4;
don't install <machine/db_machdep.h>, this is kernel only
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.8;
merge ktrace-lwp.
 1.17 08-May-2004  kleink branches: 1.17.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.16 18-Jan-2003  thorpej branches: 1.16.2;
Merge the nathanw_sa branch.
 1.15 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.14 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.13 28-Nov-2001  kleink branches: 1.13.8;
No point in installing svr4_machdep.h.
 1.12 15-Apr-2001  kleink branches: 1.12.2; 1.12.8;
Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.11 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.10 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
 1.9 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.8 26-Jun-2000  kleink branches: 1.8.2;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.7 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.6 17-Mar-2000  tron Install "machineendian_machdep.h".
 1.5 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.4 19-Apr-1999  kleink branches: 1.4.2;
Add COMPAT_SVR4 for m68k.
 1.3 15-Mar-1999  minoura branches: 1.3.4;
Pullin m68k/ieee.h.
 1.2 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.1 12-Jul-1998  veego New Makefile to install the includes, like all the other ports do.
 1.3.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.8.5 11-Dec-2002  thorpej Sync with HEAD.
 1.12.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.12.8.3 08-Jan-2002  nathanw Catch up to -current.
 1.12.8.2 10-Nov-2001  scw Kernel mcontext glue for Scheduler Activations on m68k from
Klaus Klein <kleink@netbsd.org>.
 1.12.8.1 15-Apr-2001  scw file Makefile was added on branch nathanw_sa on 2001-11-10 21:22:52 +0000
 1.12.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.12.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.8.1 31-Aug-2002  gehenna catch up with -current.
 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.17.12.2 26-Feb-2007  yamt sync with head.
 1.17.12.1 30-Dec-2006  yamt sync with head.
 1.18.8.1 11-Aug-2006  yamt sync with head
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.19.4.1 01-Feb-2007  ad Header file cleanup.
 1.21.30.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.21.12.1 03-Dec-2017  jdolecek update from HEAD
 1.22.18.1 10-Jun-2019  christos Sync with HEAD
 1.22.16.1 28-Jul-2018  pgoyette Sync with HEAD
 1.23.36.1 02-Aug-2025  perseant Sync with HEAD
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.7 16-Jun-2017  jdolecek dumpconf(void) long doesn't exist, remove the prototype

PR kern/39714 by Henning Petersen
 1.6 04-Mar-2007  christos branches: 1.6.88; 1.6.108;
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 19-Jan-2005  chs branches: 1.4.8;
de-__P, remove register, ansify.
 1.3 11-Sep-2002  mycroft branches: 1.3.6; 1.3.14;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.2 06-Oct-1998  thorpej branches: 1.2.26; 1.2.30;
configure() prototype is in <sys/device.h>
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.30.1 17-Sep-2002  nathanw Catch up to -current.
 1.2.26.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.3.14.1 29-Apr-2005  kent sync with -current
 1.3.6.1 24-Jan-2005  skrll Sync with HEAD.
 1.4.8.1 03-Sep-2007  yamt sync with head.
 1.5.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.108.1 28-Aug-2017  skrll Sync with HEAD
 1.6.88.1 03-Dec-2017  jdolecek update from HEAD
 1.2 21-Aug-1999  simonb Include <sys/bswap.h> for function prototypes. i386, pc532 and vax
still include <machine/byte_swap.h> and define macros for some of
the bswap*() functions.
 1.1 15-Jan-1999  bouyer Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
 1.3 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.2 03-Aug-1999  dbj branches: 1.2.16; 1.2.20;
resync bus_dma functions with current alpha versions.
added a field to a dma segment to return the actual length of that segment that
was successfully transferred.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.20.1 17-Sep-2002  nathanw Catch up to -current.
 1.2.16.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.10 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.9 19-Jul-2001  thorpej branches: 1.9.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.8 21-Jun-2001  wiz branches: 1.8.2;
constraint, not contraint.
 1.7 16-Apr-2001  dbj make sure that dm_segs is last field of next68k_bus_dmamap,
so that variable length allocations work
 1.6 16-Apr-2001  dbj add receive ethernet bpf tap
keep receive ethernet crc and set M_HASFCS
change bus_dma MD fields to keep xfer_len for entire map
instead of per segment
turn off automatic dma restarts in preparation for changing
scsi driver to handle them.
add dma debugging routines to keep history of dma states
tweak checking for unusual dma limit register
 1.5 07-Mar-2001  thorpej Add the BUS_DMA_STREAMING flag.
 1.4 26-Jun-2000  simonb branches: 1.4.2;
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.3 05-Aug-1999  dbj branches: 1.3.2; 1.3.12;
changed dma segment field "ds_read_len" to "ds_xfer_len" since it is valid for
either read or write transfers.
 1.2 03-Aug-1999  dbj resync bus_dma functions with current alpha versions.
added a field to a dma segment to return the actual length of that segment that
was successfully transferred.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.3.12.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.3.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.3.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.3.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.8.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.8.2.1 03-Aug-2001  lukem update to -current
 1.9.6.2 17-Sep-2002  nathanw Catch up to -current.
 1.9.6.1 19-Jul-2001  nathanw file bus_dma.h was added on branch nathanw_sa on 2002-09-17 21:16:33 +0000
 1.23 11-Feb-2023  tsutsui Handle NeXT Turbo VRAM regions properly.

Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
 1.22 03-Feb-2023  tsutsui Use proper C99 int types.
 1.21 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.20 27-Jan-2023  tsutsui next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.

Should be pulled up to netbsd-10 and netbsd-9.
 1.19 23-Jan-2021  christos branches: 1.19.18;
Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.
 1.18 02-Apr-2020  msaitoh branches: 1.18.4;
s/impliment/implement/ in comment.
 1.17 23-Sep-2019  skrll Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
 1.16 12-Feb-2012  matt branches: 1.16.48; 1.16.52;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.15 28-Apr-2008  martin branches: 1.15.34; 1.15.38;
Remove clause 3 and 4 from TNF licenses
 1.14 16-Feb-2006  perry branches: 1.14.68; 1.14.70; 1.14.72;
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.13 24-Dec-2005  perry branches: 1.13.2; 1.13.4; 1.13.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 19-Jan-2005  chs branches: 1.11.8;
de-__P, remove register, ansify.
 1.10 01-Oct-2003  mycroft branches: 1.10.8;
Some small cleanup -- make the base,limit values vaddr_t, not char*.
Also add some code that attempts to deal with C16_VIDEO interrupts, though it
does not seem to make my color slabs work again.
 1.9 11-Sep-2002  mycroft branches: 1.9.6;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.8 11-Jun-2002  deberg bus_space_mmap(), same as atari port. untested, as it is unused.
 1.7 12-May-2001  chs branches: 1.7.2; 1.7.8; 1.7.16;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.6 29-Sep-2000  deberg branches: 1.6.2;
add support for 12-bit color displays, from Timm Wetzel w/ changes by
me. closes 10741.
 1.5 10-Apr-1999  drochner branches: 1.5.2; 1.5.12;
add BUS_SPACE_ALIGNED_POINTER() definitions for completeness
 1.4 24-Mar-1999  dbj branches: 1.4.4;
Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.3 02-Jan-1999  dbj Applied supplied patches from pr port-next68k/6709
add bus_space support for mono framebuffer
 1.2 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.12.1 06-Oct-2000  deberg pullup 1.6, approved by thorpej

add support for 12-bit color displays, from Timm Wetzel w/ changes by
me. closes 10741.
 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.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.16.1 15-Jul-2002  gehenna catch up with -current.
 1.7.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.7.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.7.8.1 12-May-2001  nathanw file bus_space.h was added on branch nathanw_sa on 2002-06-20 03:40:22 +0000
 1.7.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.7.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue 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.1 21-Jun-2006  yamt sync with head.
 1.13.6.1 22-Apr-2006  simonb Sync with head.
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.13.2.1 18-Feb-2006  yamt sync with head.
 1.14.72.1 16-May-2008  yamt sync with head.
 1.14.70.1 18-May-2008  yamt sync with head.
 1.14.68.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.38.1 18-Feb-2012  mrg merge to -current.
 1.15.34.1 17-Apr-2012  yamt sync with head
 1.16.52.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.16.52.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1581):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.16.48.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16.48.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.18.4.1 03-Apr-2021  thorpej Sync with HEAD.
 1.19.18.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.19.18.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #63):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.58 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.57 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.56 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.55 18-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.54 13-Jan-2024  thorpej Switch next68k over to the common m68k vector table.
 1.53 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.52 11-Feb-2023  tsutsui Handle NeXT Turbo VRAM regions properly.

Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
 1.51 27-Jan-2023  tsutsui next68k: Fix delay_divisor value for proper delay(9) on 68040.
 1.50 23-Nov-2019  ad branches: 1.50.26;
cpu_need_resched():

- Remove all code that should be MI, leaving the bare minimum under arch/.
- Make the required actions very explicit.
- Pass in LWP pointer for convenience.
- When a trap is required on another CPU, have the IPI set it locally.
- Expunge cpu_did_resched().
 1.49 18-Feb-2019  thorpej branches: 1.49.4;
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.48 17-Dec-2016  flxd branches: 1.48.16;
Fix typo "one the" and architecture where appropriate.
 1.47 19-Oct-2013  christos branches: 1.47.6; 1.47.10;
make cpu_need_resched() macros consistent; __USE flags
 1.46 02-Feb-2012  tsutsui branches: 1.46.6; 1.46.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.45 16-May-2011  tsutsui branches: 1.45.4; 1.45.8;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.
 1.44 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.43 22-Dec-2010  matt branches: 1.43.2; 1.43.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.42 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.41 21-Oct-2009  rmind branches: 1.41.2; 1.41.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.40 17-Oct-2007  garbled branches: 1.40.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.39 04-Aug-2007  tsutsui branches: 1.39.2;
TAB/space cleanup.
 1.38 04-Aug-2007  tsutsui Add ci_cpuid where it's missing.
 1.37 21-May-2007  tsutsui branches: 1.37.2; 1.37.4; 1.37.8;
Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
 1.36 21-May-2007  tsutsui Remove obsolete "extern int want_resched" decls.
 1.35 21-May-2007  tsutsui Adapt rest of m68k ports to yamt-idlelwp. Compile tested only.
 1.34 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.33 04-Mar-2007  christos branches: 1.33.2; 1.33.4; 1.33.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.32 16-Feb-2007  ad branches: 1.32.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.31 09-Feb-2007  ad Merge newlock2 to head.
 1.30 11-Dec-2005  christos branches: 1.30.20;
merge ktrace-lwp.
 1.29 19-Jan-2005  chs branches: 1.29.8;
de-__P, remove register, ansify.
 1.28 26-Sep-2004  yamt branches: 1.28.4;
don't expose cpu_info to userland.
 1.27 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.26 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.25 05-Oct-2003  mycroft Minor tweaks to the color framebuffer code -- still don't know what the deal
with the interrupt is.
 1.24 01-Oct-2003  mycroft Some small cleanup -- make the base,limit values vaddr_t, not char*.
Also add some code that attempts to deal with C16_VIDEO interrupts, though it
does not seem to make my color slabs work again.
 1.23 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.22 18-Jan-2003  thorpej branches: 1.22.2;
Merge the nathanw_sa branch.
 1.21 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.20 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.19 14-May-2002  matt Eliminate commons (including many used ones). Clean up variable references.
 1.18 30-May-2001  mrg branches: 1.18.2; 1.18.8;
use _KERNEL_OPT
 1.17 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.16 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.15 19-Dec-2000  scw branches: 1.15.2;
Unification of the m68k syscall() function.
 1.14 29-Sep-2000  deberg add support for 12-bit color displays, from Timm Wetzel w/ changes by
me. closes 10741.
 1.13 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.12 26-May-2000  thorpej branches: 1.12.4;
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.11 10-Aug-1999  thorpej branches: 1.11.2;
Define cpu_number() as discussed on tech-smp.
 1.10 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.9 26-Feb-1999  is synchronize types, and s/curproc/p/ in one forgotten place
 1.8 26-Feb-1999  is next68k specific part of PR 6152 fix
 1.7 02-Jan-1999  dbj Applied supplied patches from pr port-next68k/6709
add bus_space support for mono framebuffer
 1.6 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.5 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.4 31-Aug-1998  dbj Fixed typo in printf bitfields for intrstat register.
 1.3 28-Aug-1998  dbj added a flag to disable the NEXT_SLOT_ID_BMAP for testing the turbo machines
 1.2 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.11.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.11.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.4.1 06-Oct-2000  deberg pullup 1.14, approved by thorpej

add support for 12-bit color displays, from Timm Wetzel w/ changes by
me. closes 10741.
 1.15.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.18.8.7 03-Dec-2002  gmcgarry Use cpu_proc_fork().
 1.18.8.6 11-Nov-2002  nathanw Catch up to -current
 1.18.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.18.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.18.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.18.8.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.18.8.1 30-May-2001  scw file cpu.h was added on branch nathanw_sa on 2001-11-18 18:43:06 +0000
 1.18.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.18.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.22.2.6 24-Jan-2005  skrll Sync with HEAD.
 1.22.2.5 19-Oct-2004  skrll Sync with HEAD
 1.22.2.4 24-Sep-2004  skrll Sync with HEAD.
 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.28.4.1 29-Apr-2005  kent sync with -current
 1.29.8.2 03-Sep-2007  yamt sync with head.
 1.29.8.1 26-Feb-2007  yamt sync with head.
 1.30.20.1 06-Feb-2007  ad Update m68k pasteware.
 1.32.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.33.10.2 03-Oct-2007  garbled 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.2 20-Aug-2007  ad Sync with HEAD.
 1.33.2.1 27-May-2007  ad Sync with head.
 1.37.8.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.37.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.37.2.1 07-Aug-2007  matt Sync with HEAD.
 1.39.2.1 06-Nov-2007  matt sync with HEAD
 1.40.20.2 11-Aug-2010  yamt sync with head.
 1.40.20.1 11-Mar-2010  yamt sync with head
 1.41.4.3 31-May-2011  rmind sync with head
 1.41.4.2 05-Mar-2011  rmind sync with head
 1.41.4.1 03-Jul-2010  rmind sync with head
 1.41.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.43.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.43.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.45.8.1 18-Feb-2012  mrg merge to -current.
 1.45.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.45.4.1 17-Apr-2012  yamt sync with head
 1.46.10.1 18-May-2014  rmind sync with head
 1.46.6.2 03-Dec-2017  jdolecek update from HEAD
 1.46.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.47.6.1 05-Feb-2017  skrll Sync with HEAD
 1.48.16.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.48.16.1 10-Jun-2019  christos Sync with HEAD
 1.49.4.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.49.4.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1581):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.50.26.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.50.26.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #63):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 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 12-May-2001  chs branches: 1.2.8; 1.2.174;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.26;
Initial import of NetBSD/next68k.
 1.1.1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.174.1 03-Dec-2017  jdolecek update from HEAD
 1.2.8.2 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.2.8.1 12-May-2001  chs file db_machdep.h was added on branch nathanw_sa on 2001-05-12 22:35:30 +0000
 1.7 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.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 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.4 15-Nov-2003  bouyer Commit changes proposed on tech-kern Thu, 6 Nov 2003
- factor out disksubr.c between sun3, sparc and sparc64. Keep the sun3
groveling code to find a NetBSD disklabel in the first sector (so that it
can find a label at the old sun3 LABELOFFSET) as a fallback is not
label at LABELOFFSET, or sun label is present.
- Fix the sun3 LABELOFFSET (was 64, but the kernel wrote the NetBSD label at
128)
- Make next68k disksubr.c always write a next-compatible disklabel.
- remove #ifdef __sparc__ hack from disklabel(8), and change it to issue
a DIOCWDINFO after writing the disklabel to the raw partition in the
-r/-I case (so that the kernel can convert the label if needed).
 1.3 27-Oct-2003  cl move structs nextstep_disklabel/cpu_partition and appendant #defines
to sys/sys/bootblock.h
- rename to next68k_disklabel and next68k_partition
- use {u,}int{8,16,32}_t instead of char/short/int (suggested by D. Laight)
 1.2 11-Jul-2002  christos branches: 1.2.6;
Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.28; 1.1.1.1.32; 1.1.1.1.40;
Initial import of NetBSD/next68k.
 1.1.1.1.40.1 16-Jul-2002  gehenna catch up with -current.
 1.1.1.1.32.1 01-Aug-2002  nathanw Catch up to -current.
 1.1.1.1.28.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.6.1 03-Aug-2004  skrll Sync with HEAD
 1.1 12-Jul-1998  thorpej Basic elf_machdep.h for m68k; doesn't include relocations, yet.
 1.2 17-Mar-2000  mycroft In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.14;
Initial import of NetBSD/next68k.
 1.1.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.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:18:15 +0000
 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:33 +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:39 +0000
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2 30-Aug-1999  mycroft A foolish consistency.
 1.1 15-Mar-1999  minoura Pullin m68k/ieee.h.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 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:41 +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:54:24 +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:15 +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:54:24 +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:10 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_limits.h was added on branch thorpej_scsipi on 2001-04-21 17:54:24 +0000
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.2 14-Apr-2001  kleink Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.1 14-Apr-2001  kleink file int_mwgwtypes.h was added on branch nathanw_sa on 2001-04-14 12:19:59 +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:54:25 +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:18:15 +0000
 1.25 19-Jan-2024  thorpej Add _KERNEL guards around most of the definitions in these files.
 1.24 18-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.23 11-Jul-2023  riastradh next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
 1.22 19-Apr-2018  christos branches: 1.22.32;
s/static inline/static __inline/g for consistency.
 1.21 26-Jun-2008  isaki branches: 1.21.82;
Unify splraiseipl(9) implementation among m68k ports,
discussed with tsutsui@ on port-m68k.

For next68k:
- 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.20 03-Dec-2007  ad branches: 1.20.14; 1.20.18; 1.20.20; 1.20.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.19 11-Mar-2007  thorpej branches: 1.19.16; 1.19.18; 1.19.24;
- 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.18 08-Mar-2007  tsutsui branches: 1.18.2;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.17 16-Feb-2007  ad branches: 1.17.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.16 21-Dec-2006  yamt merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.15 24-Dec-2005  perry branches: 1.15.20; 1.15.22;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.14 11-Dec-2005  christos merge ktrace-lwp.
 1.13 07-Sep-2005  drochner namespace sanity: kill includes which are not
used directly
 1.12 19-Jan-2005  chs branches: 1.12.8;
de-__P, remove register, ansify.
 1.11 11-Sep-2002  mycroft branches: 1.11.6; 1.11.14;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.10 13-Apr-2001  thorpej branches: 1.10.2; 1.10.8;
Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.9 14-Jan-2001  thorpej branches: 1.9.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.8 22-Aug-2000  thorpej Add spllock(). See spl(9) for details.
 1.7 21-Aug-2000  thorpej Make sure we provide splsched() as described in spl(9).
 1.6 05-Aug-1999  thorpej branches: 1.6.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.5 04-Aug-1999  dbj fixed prototype of allocate_sir()
 1.4 03-Jul-1999  dbj renamed splscc to splserial to match spl(9) man page
changed most of the spl* to use _splraise to match current usage
this fixes an observed bug where zstty_attach was calling splzs causing
interrupts to be turned on prematurely.
 1.3 15-Jun-1999  kleink Slightly rearrange the SSIR inline assembly implementation in order to avoid
making assumptions on C symbol name prefixes.
 1.2 10-Nov-1998  dbj branches: 1.2.6;
Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.6.2 02-Aug-1999  thorpej Update from trunk.
 1.2.6.1 21-Jun-1999  thorpej Sync w/ -current.
 1.6.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.6.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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.9.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.10.8.1 13-Apr-2001  nathanw file intr.h was added on branch nathanw_sa on 2002-09-17 21:16:35 +0000
 1.10.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.11.14.1 29-Apr-2005  kent sync with -current
 1.11.6.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.6.1 24-Jan-2005  skrll Sync with HEAD.
 1.12.8.5 07-Dec-2007  yamt sync with head
 1.12.8.4 03-Sep-2007  yamt sync with head.
 1.12.8.3 26-Feb-2007  yamt sync with head.
 1.12.8.2 30-Dec-2006  yamt sync with head.
 1.12.8.1 21-Jun-2006  yamt sync with head.
 1.15.22.1 02-Oct-2006  yamt implement splraiseipl/makeiplcookie for next68k.
 1.15.20.1 12-Jan-2007  ad Sync with head.
 1.17.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.18.2.2 03-Dec-2007  ad Sync with HEAD.
 1.18.2.1 13-Mar-2007  ad Sync with head.
 1.19.24.1 08-Dec-2007  mjf Sync with HEAD.
 1.19.18.1 09-Jan-2008  matt sync with HEAD
 1.19.16.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.20.22.1 27-Jun-2008  simonb Sync with head.
 1.20.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.20.18.1 04-May-2009  yamt sync with head.
 1.20.14.1 29-Jun-2008  mjf Sync with HEAD.
 1.21.82.1 22-Apr-2018  pgoyette Sync with HEAD
 1.22.32.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.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.5 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.4 28-Apr-2008  martin branches: 1.4.44; 1.4.60;
Remove clause 3 and 4 from TNF licenses
 1.3 25-Jan-2006  christos branches: 1.3.72; 1.3.74; 1.3.76;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.2 31-Oct-2001  thorpej branches: 1.2.2; 1.2.34; 1.2.46;
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 12-May-2001  chs branches: 1.1.2; 1.1.4; 1.1.8;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.1.8.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.46.1 01-Feb-2006  yamt sync with head.
 1.2.34.1 21-Jun-2006  yamt sync with head.
 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:49 +0000
 1.3.76.1 16-May-2008  yamt sync with head.
 1.3.74.1 18-May-2008  yamt sync with head.
 1.3.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.60.1 10-Aug-2014  tls Rebase.
 1.4.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1 29-Apr-2000  thorpej branches: 1.1.6;
Require that each each MACHINE/MACHINE_ARCH supply a lock.h. This file
contains the values __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED, which
replace the old SIMPLELOCK_LOCKED and SIMPLELOCK_UNLOCKED. These files
are also required to supply inline functions __cpu_simple_lock(),
__cpu_simple_lock_try(), and __cpu_simple_unlock() if locking is to be
supported on that platform (i.e. if MULTIPROCESSOR is defined in the
_KERNEL case). Change these functions to take an int * (&alp->lock_data)
rather than the struct simplelock * itself.

These changes make it possible for userland to use the locking primitives
by including <machine/lock.h>.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 29-Apr-2000  bouyer file lock.h was added on branch thorpej_scsipi on 2000-11-20 20:18:15 +0000
 1.1 30-Nov-2024  christos branches: 1.1.4;
Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 30-Nov-2024  perseant file lwp_private.h was added on branch perseant-exfatfs on 2025-08-02 05:55:58 +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:18:16 +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 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:07:41 +0000
 1.13 04-Feb-2023  tsutsui Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).
Tested on my NeXTstation slab.
 1.12 10-Feb-2012  para branches: 1.12.52; 1.12.78;
proper sizing of kmem_arena on different ports

PR port-i386/45946: Kernel locks up in VMEM system
 1.11 08-Feb-2011  rmind branches: 1.11.4; 1.11.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.10 11-Dec-2009  tsutsui branches: 1.10.4; 1.10.6; 1.10.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.9 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.8 11-Dec-2005  christos branches: 1.8.78;
merge ktrace-lwp.
 1.7 07-Sep-2005  drochner include machine/intr.h only in the _KERNEL case, as
most other ports do.
(In the -KERNEL case, it is needed because the spl*()
stuff ought to be pulled in by <sys/param.h> per the
manpages.)
This saves some namespace headaches.
 1.6 19-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 03-Nov-2002  chs branches: 1.4.6;
merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.3 11-Feb-2000  thorpej branches: 1.3.12;
Update for the NKMEMPAGES changes.
 1.2 04-Dec-1999  ragge CL* discarding.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.14; 1.1.1.1.20;
Initial import of NetBSD/next68k.
 1.1.1.1.20.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.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.12.1 11-Nov-2002  nathanw Catch up to -current
 1.4.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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 21-Jun-2006  yamt sync with head.
 1.8.78.1 11-Mar-2010  yamt sync with head
 1.10.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.10.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.4.1 05-Mar-2011  rmind sync with head
 1.11.8.1 18-Feb-2012  mrg merge to -current.
 1.11.4.1 17-Apr-2012  yamt sync with head
 1.12.78.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #77):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.12.52.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1590):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.16 27-Dec-2023  thorpej Define the values for the 68040 TT registers in terms of the definitions in
<m68k/mmu_40.h> rather than using magic numbers.
 1.15 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.14 22-Sep-2002  chs it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.
 1.13 22-Sep-2002  chs add pmap_remove_all() hook (empty on most platforms so far).
 1.12 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.11 10-Sep-2001  chris branches: 1.11.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.10 26-May-2001  chs branches: 1.10.2; 1.10.4;
replace vm_page_t with struct vm_page *.
 1.9 26-May-2001  chs replace {simple_,}lock{_data,}_t with struct {simple,}lock {,*}.
 1.8 22-Apr-2001  thorpej Undo a misguided previous change to the pmap_update() API.
 1.7 22-Apr-2001  thorpej Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.
 1.6 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.5 26-Feb-1999  is branches: 1.5.8; 1.5.20;
next68k specific part of PR 6152 fix
 1.4 15-Feb-1999  hubertf RCS ID police
 1.3 16-Jan-1999  chuck MNN is no longer optional
 1.2 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.5.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.8.1 23-Apr-2001  bouyer Sync with HEAD.
 1.10.4.1 01-Oct-2001  fvdl Catch up with -current.
 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 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.11.4.7 11-Nov-2002  nathanw Catch up to -current
 1.11.4.6 18-Oct-2002  nathanw Catch up to -current.
 1.11.4.5 17-Sep-2002  nathanw Catch up to -current.
 1.11.4.4 02-Jul-2002  nathanw Adjust whitespace so that this matches the trunk.
 1.11.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.11.4.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.11.4.1 10-Sep-2001  scw file pmap.h was added on branch nathanw_sa on 2001-11-18 18:43:07 +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:38:26 +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 13:45:32 +0000
 1.1.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 07-Aug-2002  nathanw file pmc.h was added on branch nathanw_sa on 2002-08-13 02:18:37 +0000
 1.3 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.2 28-Aug-1998  dbj branches: 1.2.26; 1.2.30; 1.2.38;
Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.38.1 16-Jul-2002  gehenna catch up with -current.
 1.2.30.2 01-Aug-2002  nathanw Catch up to -current.
 1.2.30.1 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.2.26.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.3 14-Oct-2002  chs merge pte.h for m68k w/ motorola or compatible MMU
(only 4k-page platforms so far).
 1.2 28-Aug-1998  dbj branches: 1.2.30;
Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.30.1 18-Oct-2002  nathanw Catch up to -current.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 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:07:41 +0000
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 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 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 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 13:57:58 +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:54:24 +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 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.8 18-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.7 01-Apr-2021  simonb Define __HAVE_LEGACY_INTRCNT to indicate this port uses legacy intrcnt
interrupt accounting.
 1.6 20-Jan-2008  joerg branches: 1.6.110; 1.6.112;
Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
 1.5 17-Oct-2007  garbled branches: 1.5.2; 1.5.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.4 14-Jul-2007  ad branches: 1.4.10;
Generic soft interrupts are mandatory.
 1.3 08-Mar-2007  tsutsui branches: 1.3.2; 1.3.10;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.2 11-Sep-2006  gdamore branches: 1.2.6;
Convert next68k to generic-todr and timecounter.
Tested by bouyer@.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.64; 1.1.1.1.82; 1.1.1.1.94;
Initial import of NetBSD/next68k.
 1.1.1.1.94.1 18-Nov-2006  ad Sync with head.
 1.1.1.1.82.1 14-Sep-2006  yamt sync with head.
 1.1.1.1.64.3 21-Jan-2008  yamt sync with head
 1.1.1.1.64.2 03-Sep-2007  yamt sync with head.
 1.1.1.1.64.1 30-Dec-2006  yamt sync with head.
 1.2.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.3.10.1 03-Oct-2007  garbled Sync with HEAD
 1.3.2.1 15-Jul-2007  ad Sync with head.
 1.4.10.2 23-Mar-2008  matt sync with HEAD
 1.4.10.1 06-Nov-2007  matt sync with HEAD
 1.5.8.1 23-Jan-2008  bouyer Sync with HEAD.
 1.5.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.6.112.1 03-Apr-2021  thorpej Sync with HEAD.
 1.6.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 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2 18-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.1 13-Jan-2024  thorpej Switch next68k over to the common m68k vector table.
 1.31 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.30 04-Feb-2023  tsutsui branches: 1.30.6;
Remove trailing spaces and TABs.
 1.29 04-Feb-2023  tsutsui Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).
Tested on my NeXTstation slab.
 1.28 05-Dec-2021  msaitoh branches: 1.28.4;
s/from from/from/ in comment.
 1.27 01-Feb-2020  tsutsui Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).

Background:
- All m68k ports have fixed PAGE_SIZE value in their kernels,
but each port uses different PAGE_SIZE value (4096 or 8192)
due to historical reasons.
- Currently module(7) binaries are built per each port so
all m68k kernel sources don't support run-time variable PAGE_SIZE.
- MI <uvm/uvm_param.h> assumes that the port supports a variable
PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE
are defined and they have different values.
- On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
for internal optimization.
- m68k ports share userland binaries (especially pkgsrc binaries)
among all ports, so we need to define MAX_PAGE_SHIFT as 13 to
support m68k ports where PAGE_SIZE==8192.
(though this would affect only if static binaries built on
4k page hosts are executed on 8k page hosts)

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.
For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case.

Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@:
https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035
https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954

Should be pulled up to netbsd-9.
 1.26 28-Jun-2019  tsutsui branches: 1.26.2; 1.26.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.25 02-Feb-2017  rin branches: 1.25.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.24 02-Feb-2017  rin PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos
 1.23 08-Feb-2011  rmind branches: 1.23.14; 1.23.32; 1.23.36; 1.23.40;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.22 06-Nov-2010  uebayasi branches: 1.22.2; 1.22.4;
Remove incomplete, never worked dynamic run-time memory registration
(uvm_page_physload(9)). This functionality will be re-added later.
 1.21 08-Dec-2009  tsutsui branches: 1.21.2; 1.21.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.20 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.19 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.18 11-Dec-2005  christos branches: 1.18.78; 1.18.86; 1.18.92;
merge ktrace-lwp.
 1.17 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.16 07-Aug-2003  agc branches: 1.16.8; 1.16.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.15 02-Apr-2003  thorpej branches: 1.15.2;
Use PAGE_SIZE rather than NBPG.
 1.14 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.13 15-Nov-2001  soren MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
 1.12 01-May-2001  thorpej branches: 1.12.2; 1.12.8;
Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.
 1.11 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.10 01-Dec-2000  tsutsui branches: 1.10.2;
Remove unused pcbb() macro.
 1.9 14-Nov-2000  thorpej We use 4K pages on the NeXT. Define PAGE_SIZE and friends to be
compile-time constants.
 1.8 11-Feb-2000  thorpej Update for the NKMEMPAGES changes.
 1.7 26-Jan-2000  tsutsui Remove obsoleted macros.
 1.6 04-Dec-1999  ragge CL* discarding.
 1.5 26-Apr-1999  thorpej branches: 1.5.2; 1.5.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.4 16-Jan-1999  chuck branches: 1.4.4;
MNN is no longer optional
 1.3 14-Nov-1998  dbj Finished changes to use UVM on next68k.
Turn on UVM by default in GENERIC kernel.
 1.2 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.5.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.8.3 11-Dec-2002  thorpej Sync with HEAD.
 1.12.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.12.8.1 01-May-2001  nathanw file vmparam.h was added on branch nathanw_sa on 2002-01-08 00:26:58 +0000
 1.12.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.4 01-Apr-2005  skrll Sync with HEAD.
 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.10.1 23-Feb-2005  yamt change kernel va layout, following mac68k.
 1.16.8.1 29-Apr-2005  kent sync with -current
 1.18.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.18.78.3 11-Mar-2010  yamt sync with head
 1.18.78.2 16-Sep-2009  yamt sync with head
 1.18.78.1 04-May-2009  yamt sync with head.
 1.21.4.1 05-Mar-2011  rmind sync with head
 1.21.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.22.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.22.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.23.40.1 21-Apr-2017  bouyer Sync with HEAD
 1.23.36.1 20-Mar-2017  pgoyette Sync with HEAD
 1.23.32.1 05-Feb-2017  skrll Sync with HEAD
 1.23.14.1 03-Dec-2017  jdolecek update from HEAD
 1.25.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.26.4.1 29-Feb-2020  ad Sync with head.
 1.26.2.2 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1590):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.26.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.28.4.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #77):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.30.6.1 02-Aug-2025  perseant 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:38:38 +0000
 1.8 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.7 07-Nov-2007  ad branches: 1.7.14;
Merge tty changes from the vmlocking branch.
 1.6 08-Mar-2007  tsutsui branches: 1.6.2; 1.6.18; 1.6.20; 1.6.24; 1.6.26;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.5 11-Dec-2005  christos branches: 1.5.26;
merge ktrace-lwp.
 1.4 19-Jan-2005  chs branches: 1.4.8;
de-__P, remove register, ansify.
 1.3 07-Aug-2003  agc branches: 1.3.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 03-Jul-1999  dbj branches: 1.2.36;
renamed splscc to splserial to match spl(9) man page
changed most of the spl* to use _splraise to match current usage
this fixes an observed bug where zstty_attach was calling splzs causing
interrupts to be turned on prematurely.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.10;
Initial import of NetBSD/next68k.
 1.1.1.1.10.1 02-Aug-1999  thorpej Update from trunk.
 1.2.36.4 24-Jan-2005  skrll Sync with HEAD.
 1.2.36.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.36.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.36.1 03-Aug-2004  skrll Sync with HEAD
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.4.8.2 15-Nov-2007  yamt sync with head.
 1.4.8.1 03-Sep-2007  yamt sync with head.
 1.5.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.6.24.1 13-Nov-2007  bouyer Sync with HEAD
 1.6.20.1 08-Nov-2007  matt sync with -HEAD
 1.6.18.1 11-Nov-2007  joerg Sync with HEAD.
 1.6.2.1 03-Dec-2007  ad Sync with HEAD.
 1.7.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.28 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.27 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.26 29-Jul-2012  mlelstv branches: 1.26.2;
Do not call setroot() from MD code and from MI code, which has
unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.

No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information
as a side effect. Instead call MI rootconf() from MD code which makes
rootconf() now a wrapper to setroot().

Adjust several MD routines to set the global booted_device,booted_partition
variables instead of passing partial information to setroot().

Make cpu_rootconf(9) describe the calling order.
 1.25 10-May-2011  tsutsui branches: 1.25.4; 1.25.10;
Move isrinit() call from early next68k_init() to cpu_configure(9)
since interrupt service routines would want evcnt(9).
 1.24 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.23 14-Feb-2008  joerg branches: 1.23.32; 1.23.38; 1.23.40;
GC unused variable.
 1.22 12-Feb-2008  joerg Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.
 1.21 05-Dec-2007  tsutsui Use TAILQ_FIRST(3) and TAILQ_NEXT(3) macro.
 1.20 03-Dec-2007  ad branches: 1.20.2;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.19 08-Mar-2007  tsutsui branches: 1.19.2; 1.19.18; 1.19.20; 1.19.26;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.18 11-Dec-2005  christos branches: 1.18.26;
merge ktrace-lwp.
 1.17 05-Jun-2005  he branches: 1.17.2;
Adapt to -Wcast-qual by adding a few consts.
 1.16 19-Jan-2005  chs de-__P, remove register, ansify.
 1.15 23-Oct-2004  thorpej branches: 1.15.4;
Centralize the declaration of booted_device and booted_partition.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.13 15-Jul-2003  lukem __KERNEL_RCSID()
 1.12 18-Jun-2003  drochner branches: 1.12.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.11 03-May-2003  wiz DMA, not dma nor Dma.
 1.10 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.9 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.8 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.7 17-Sep-1999  thorpej branches: 1.7.16; 1.7.20; 1.7.28;
Centralize the declaration and clearing of `cold'.
 1.6 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.5 23-Aug-1999  thorpej Garbage-collect reference to <sys/dmap.h>.
 1.4 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.3 31-Jan-1999  dbj branches: 1.3.4;
Accidentally uncommitted wscons change.
attach nextdisplay to mainbus for wscons support.
 1.2 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.3.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.7.28.1 16-Jul-2002  gehenna catch up with -current.
 1.7.20.3 18-Oct-2002  nathanw Catch up to -current.
 1.7.20.2 17-Sep-2002  nathanw Catch up to -current.
 1.7.20.1 01-Aug-2002  nathanw Catch up to -current.
 1.7.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.7.16.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.12.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.12.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.12.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.2.1 03-Aug-2004  skrll Sync with HEAD
 1.15.4.1 29-Apr-2005  kent sync with -current
 1.17.2.3 27-Feb-2008  yamt sync with head.
 1.17.2.2 07-Dec-2007  yamt sync with head
 1.17.2.1 03-Sep-2007  yamt sync with head.
 1.18.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.26.2 18-Feb-2008  mjf Sync with HEAD.
 1.19.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.19.20.2 23-Mar-2008  matt sync with HEAD
 1.19.20.1 09-Jan-2008  matt sync with HEAD
 1.19.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.19.2.1 03-Dec-2007  ad Sync with HEAD.
 1.20.2.1 08-Dec-2007  ad Sync with head.
 1.23.40.1 17-Feb-2011  bouyer Sync with HEAD
 1.23.38.1 06-Jun-2011  jruoho Sync with HEAD.
 1.23.32.2 31-May-2011  rmind sync with head
 1.23.32.1 05-Mar-2011  rmind sync with head
 1.25.10.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.25.4.1 30-Oct-2012  yamt sync with head
 1.26.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.13 27-Jan-2023  tsutsui next68k: Fix delay_divisor value for proper delay(9) on 68040.
 1.12 24-Apr-2010  dbj branches: 1.12.64; 1.12.90;
switch from 4 clause to 2 clause BSD license.
 1.11 11-Sep-2006  gdamore branches: 1.11.58; 1.11.78; 1.11.80;
Convert next68k to generic-todr and timecounter.
Tested by bouyer@.
 1.10 04-Aug-2006  mhitch branches: 1.10.4;
gcc4 fix: include sy/device.h to pick up a definition of something which
I've forgotten - needed by gcc4.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.8;
merge ktrace-lwp.
 1.8 19-Jan-2005  chs branches: 1.8.8;
de-__P, remove register, ansify.
 1.7 15-Jul-2003  lukem branches: 1.7.8;
__KERNEL_RCSID()
 1.6 18-Jan-2003  thorpej branches: 1.6.2;
Merge the nathanw_sa branch.
 1.5 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.4 13-May-2001  chs branches: 1.4.2; 1.4.8;
turn on printf format-string checking and -Werror. fix all warnings.
 1.3 19-Jan-2000  msaitoh branches: 1.3.6;
check whether tv_usec >= 1000000
 1.2 27-Jan-1999  dbj branches: 1.2.8;
Finished the setting of the system date from the rtc.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.4.8.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.4.8.1 13-May-2001  scw file clock.c was added on branch nathanw_sa on 2001-11-18 18:43:07 +0000
 1.4.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.6.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.8.1 30-Dec-2006  yamt sync with head.
 1.9.8.2 14-Sep-2006  yamt sync with head.
 1.9.8.1 11-Aug-2006  yamt sync with head
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.4.1 18-Nov-2006  ad Sync with head.
 1.11.80.1 30-May-2010  rmind sync with head
 1.11.78.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.11.58.1 11-Aug-2010  yamt sync with head.
 1.12.90.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #63):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.12.64.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1581):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.17 11-Dec-2005  christos merge ktrace-lwp.
 1.16 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.15 15-Jul-2003  lukem __KERNEL_RCSID()
 1.14 26-Oct-2002  jdolecek branches: 1.14.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.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 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.11 17-Jun-2002  christos MD systrace gluons.
 1.10 12-Jan-2002  manu branches: 1.10.8;
Added clockctl
 1.9 21-Mar-2000  deberg branches: 1.9.8; 1.9.12;
s/mac/NeXT/
 1.8 29-Jul-1999  augustss branches: 1.8.2;
Add wsmux device.
(Also add lots of missing chrtoblktbl[] entries.)
 1.7 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.6 26-Mar-1999  dbj branches: 1.6.4;
Added support for using wscons as console.
Enabled wscons as default console.
Use option SERCONSOLE now to use serial console instead now.
 1.5 02-Jan-1999  dbj Reformatted changes from previous patch to match style guidelines.
 1.4 02-Jan-1999  dbj applied patch from pr port-next68k/6708: add wscons devices to next68k MAKEDEV
 1.3 13-Nov-1998  oster Updating of bdev's and cdev's to support RAIDframe.
 1.2 10-Oct-1998  thorpej Add scsibus entry points to the cdevsw[].
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.6.4.2 02-Aug-1999  thorpej Update from trunk.
 1.6.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.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.9.12.5 11-Nov-2002  nathanw Catch up to -current
 1.9.12.4 17-Sep-2002  nathanw Catch up to -current.
 1.9.12.3 01-Aug-2002  nathanw Catch up to -current.
 1.9.12.2 20-Jun-2002  nathanw Catch up to -current.
 1.9.12.1 28-Feb-2002  nathanw Catch up to -current.
 1.9.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.9.8.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.8.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.10.8.3 21-Jul-2002  gehenna catch up with -current.
 1.10.8.2 15-Jul-2002  gehenna catch up with -current.
 1.10.8.1 16-May-2002  gehenna Bye block/character device swicth tables.
 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.5 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.4 29-Jun-2000  mrg branches: 1.4.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.3 13-Jan-1999  abs branches: 1.3.8;
Change 'from from' to 'from' in some comments
 1.2 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 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.8.1 11-Nov-2002  nathanw Catch up to -current
 1.32 04-Feb-2023  tsutsui Misc KNF and cleanup.
 1.31 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.30 03-Apr-2019  christos centralize setdisklabel(9)
 1.29 04-Sep-2018  riastradh Fix some min/max -> uimin/uimax stragglers.

Confirmed by the 2018-09-04T04:40Z autobuild.
 1.28 02-Jan-2015  christos branches: 1.28.16; 1.28.18;
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.27 24-Mar-2014  christos branches: 1.27.6;
fix typo.
 1.26 24-Mar-2014  christos fix memset bugs
 1.25 16-Mar-2009  dsl branches: 1.25.12; 1.25.22; 1.25.26;
ANSIfy functions with function-pointer arguments
 1.24 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.23 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.22 17-Oct-2007  garbled branches: 1.22.20; 1.22.28; 1.22.34;
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.21 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.20 25-Nov-2006  scw branches: 1.20.8; 1.20.16; 1.20.26; 1.20.28; 1.20.30;
Replace the myriad copies of bounds_check_with_label() with a single MI
version.

Add disk_blocksize(9) so that disk drivers can record the physical
block size of a disk if it is different to DEV_BSIZE. Right now this
simply initialises dk_blkshift and dk_byteshift according to the
supplied block size. This information is used in the MI version of
bounds_check_with_label().
 1.19 11-Dec-2005  christos branches: 1.19.20; 1.19.22;
merge ktrace-lwp.
 1.18 05-Jun-2005  he branches: 1.18.2;
Adapt to -Wcast-qual by adding a few consts.
 1.17 19-Jan-2005  chs de-__P, remove register, ansify.
 1.16 15-Nov-2003  bouyer branches: 1.16.8;
Commit changes proposed on tech-kern Thu, 6 Nov 2003
- factor out disksubr.c between sun3, sparc and sparc64. Keep the sun3
groveling code to find a NetBSD disklabel in the first sector (so that it
can find a label at the old sun3 LABELOFFSET) as a fallback is not
label at LABELOFFSET, or sun label is present.
- Fix the sun3 LABELOFFSET (was 64, but the kernel wrote the NetBSD label at
128)
- Make next68k disksubr.c always write a next-compatible disklabel.
- remove #ifdef __sparc__ hack from disklabel(8), and change it to issue
a DIOCWDINFO after writing the disklabel to the raw partition in the
-r/-I case (so that the kernel can convert the label if needed).
 1.15 27-Oct-2003  cl move structs nextstep_disklabel/cpu_partition and appendant #defines
to sys/sys/bootblock.h
- rename to next68k_disklabel and next68k_partition
- use {u,}int{8,16,32}_t instead of char/short/int (suggested by D. Laight)
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.13 15-Jul-2003  lukem __KERNEL_RCSID()
 1.12 10-May-2003  thorpej branches: 1.12.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.11 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.10 07-Apr-2003  he Track the SBSIZE -> SBLOCKSIZE rename done by the UFS2 merge.
 1.9 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.8 20-May-2002  jdolecek readdisklabel(): fabricate sane default disklabel in case there isn't
any on the disk
Implemented by Christian Limpach, sent in port-next68k/16929.
 1.7 05-Mar-2002  simonb branches: 1.7.6;
Don't cast argument to ffs() to long.
Per discussion on port-alpha, noticed by Robert Elz.
 1.6 19-Feb-2002  wiz strategy should have an 'r'. Inspired by similar change in OpenBSD.
 1.5 20-Nov-2000  chs branches: 1.5.2; 1.5.4; 1.5.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.4 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.3 10-Nov-1998  dbj branches: 1.3.10; 1.3.16;
Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.2 05-Jul-1998  dbj Started the esp scsi driver.
Fixed bus_space_handle_t in nextdma device.
Fixed scsi interrupt define.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.3.16.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.3.10.2 22-Nov-2000  bouyer Sync with HEAD.
 1.3.10.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.8.4 01-Aug-2002  nathanw Catch up to -current.
 1.5.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.5.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.5.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.5.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.5.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.5.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.7.6.2 16-Jul-2002  gehenna catch up with -current.
 1.7.6.1 30-May-2002  gehenna Catch up with -current.
 1.12.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.12.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.8.1 29-Apr-2005  kent sync with -current
 1.18.2.2 27-Oct-2007  yamt sync with head.
 1.18.2.1 30-Dec-2006  yamt sync with head.
 1.19.22.1 10-Dec-2006  yamt sync with head.
 1.19.20.1 12-Jan-2007  ad Sync with head.
 1.20.30.1 14-Oct-2007  yamt sync with head.
 1.20.28.1 06-Nov-2007  matt sync with HEAD
 1.20.26.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.20.16.1 16-Oct-2007  garbled Sync with HEAD
 1.20.8.1 09-Oct-2007  ad Sync with head.
 1.22.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.22.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.22.20.1 04-May-2009  yamt sync with head.
 1.25.26.1 18-May-2014  rmind sync with head
 1.25.22.2 03-Dec-2017  jdolecek update from HEAD
 1.25.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.27.6.1 06-Apr-2015  skrll Sync with HEAD
 1.28.18.1 10-Jun-2019  christos Sync with HEAD
 1.28.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.34 16-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.33 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.32 27-Dec-2023  thorpej Define the values for the 68040 TT registers in terms of the definitions in
<m68k/mmu_40.h> rather than using magic numbers.
 1.31 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.30 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.29 20-Feb-2020  skrll G/C
 1.28 17-Feb-2020  skrll G/C LS{SLEEP,RUN,ONPROC}

LWP status manipulation was moved out of assembly long ago.
 1.27 19-Dec-2018  maxv branches: 1.27.6;
Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.26 14-Jan-2011  rmind branches: 1.26.58; 1.26.60;
Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete. Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
 1.25 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.24 10-Dec-2009  rmind branches: 1.24.4;
Rename L_ADDR to L_PCB and amend some comments accordingly.
 1.23 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.22 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.21 17-Oct-2007  garbled branches: 1.21.16; 1.21.20; 1.21.22; 1.21.26;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.20 21-May-2007  tsutsui branches: 1.20.10;
Adapt rest of m68k ports to yamt-idlelwp. Compile tested only.
 1.19 11-Dec-2005  christos branches: 1.19.30; 1.19.32; 1.19.38;
merge ktrace-lwp.
 1.18 04-Nov-2003  dsl branches: 1.18.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.17 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.16 08-Apr-2003  thorpej branches: 1.16.2;
Use PAGE_SIZE rather than NBPG.
 1.15 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.14 26-Sep-2002  thorpej Remove <sys/map.h>
 1.13 11-May-2002  jdolecek protect opt_compat_svr4.h with 'if defined(_KERNEL_OPT)', so that
this is usable from e.g. LKM context
 1.12 21-Nov-2000  tsutsui branches: 1.12.4; 1.12.8;
Define proper macros for FP frame offsets rather than magic numbers.
 1.11 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.10 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.9 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.8 06-May-1999  kleink branches: 1.8.2; 1.8.4; 1.8.6;
SVR4-related typo in previous.
 1.7 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.6 24-Mar-1999  dbj branches: 1.6.4;
Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.5 02-Jan-1999  dbj Applied supplied patches from pr port-next68k/6709
add bus_space support for mono framebuffer
 1.4 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.3 01-Oct-1998  thorpej Define SYS_compat_13_sigreturn13.
 1.2 30-Sep-1998  thorpej Make sure SYS_exit and SYS___sigreturn14 are defined. Garbage collect
SYS_sigreturn.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.6.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.1 15-Nov-1999  fvdl Sync with -current
 1.8.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.8.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.12.8.5 05-Oct-2002  gmcgarry Add RAS offsets. Nuke saframe.h
 1.12.8.4 02-Aug-2002  nathanw Don't need SAF_UPCALL anymore.
 1.12.8.3 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.12.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.12.8.1 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.12.4.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.12.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 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.18.16.1 03-Sep-2007  yamt sync with head.
 1.19.38.1 22-May-2007  matt Update to HEAD.
 1.19.32.1 11-Jul-2007  mjf Sync with head.
 1.19.30.1 27-May-2007  ad Sync with head.
 1.20.10.1 06-Nov-2007  matt sync with HEAD
 1.21.26.1 19-Oct-2008  haad Sync with HEAD.
 1.21.22.1 10-Oct-2008  skrll Sync with HEAD.
 1.21.20.2 11-Mar-2010  yamt sync with head
 1.21.20.1 04-May-2009  yamt sync with head.
 1.21.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.24.4.1 05-Mar-2011  rmind sync with head
 1.26.60.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.26.60.1 10-Jun-2019  christos Sync with HEAD
 1.26.58.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.27.6.1 29-Feb-2020  ad Sync with head.
 1.36 16-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.35 15-Jan-2024  thorpej G/C unused isrlink_evcnt().
 1.34 13-Jan-2024  thorpej Switch next68k over to the common m68k vector table.
 1.33 03-Feb-2023  tsutsui Use proper LIST(3) macro.
 1.32 02-Apr-2021  rin For ports with __HAVE_LEGACY_INTRCNT, turn intrcnt[] and derived
variables into u_int, to match with kern/subr_evcnt.c.
 1.31 21-Nov-2020  thorpej branches: 1.31.2;
malloc(9) -> kmem(9)
 1.30 10-Nov-2019  chs branches: 1.30.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.29 31-Mar-2017  msaitoh branches: 1.29.14;
Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
 1.28 20-Dec-2010  matt branches: 1.28.18; 1.28.36; 1.28.40; 1.28.44;
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.27 16-Dec-2008  christos branches: 1.27.6;
replace bitmask_snprintf(9) with snprintb(3)
 1.26 26-Jun-2008  isaki branches: 1.26.4;
Unify splraiseipl(9) implementation among m68k ports,
discussed with tsutsui@ on port-m68k.

For next68k:
- 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.25 28-Apr-2008  martin branches: 1.25.2; 1.25.4;
Remove clause 3 and 4 from TNF licenses
 1.24 03-Dec-2007  ad branches: 1.24.14; 1.24.16; 1.24.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.23 08-Mar-2007  tsutsui branches: 1.23.2; 1.23.18; 1.23.20; 1.23.26;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.22 11-Dec-2005  christos branches: 1.22.26;
merge ktrace-lwp.
 1.21 07-Sep-2005  drochner include <sys/devive.h> explicitely because this is the
documented header for "evcnt" stuff
(should be separated, later)
 1.20 19-Jan-2005  chs branches: 1.20.8;
de-__P, remove register, ansify.
 1.19 01-Oct-2003  mycroft branches: 1.19.8;
Add some debugging code to log intrstat history so I can track down stray
interrupts.
 1.18 15-Jul-2003  lukem __KERNEL_RCSID()
 1.17 27-Sep-2002  provos branches: 1.17.6;
remove trailing \n in panic(). approved perry.
 1.16 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.15 13-May-2001  chs branches: 1.15.2; 1.15.8;
turn on printf format-string checking and -Werror. fix all warnings.
 1.14 09-Aug-2000  tv branches: 1.14.2;
%b -> bitmask_snprintf()
 1.13 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.12 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.11 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.10 28-Jun-1999  itojun branches: 1.10.2;
- 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.9 24-Mar-1999  mrg branches: 1.9.4;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.8 27-Jan-1999  dbj print out interrupt status register and mask when stray interrupt occurs.
to aid debugging
 1.7 13-Jan-1999  abs Change 'from from' to 'from' in some comments
 1.6 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.5 05-Jul-1998  jonathan defopt NS, NSIP.
 1.4 05-Jul-1998  jonathan defopt ISO TPIP.
 1.3 05-Jul-1998  jonathan defopt CCITT.
 1.2 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.9.4.1 01-Jul-1999  thorpej Sync w/ -current.
 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.15.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.15.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.15.8.1 13-May-2001  nathanw file isr.c was added on branch nathanw_sa on 2002-09-17 21:16:38 +0000
 1.15.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.17.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.6.4 24-Jan-2005  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.19.8.1 29-Apr-2005  kent sync with -current
 1.20.8.3 07-Dec-2007  yamt sync with head
 1.20.8.2 03-Sep-2007  yamt sync with head.
 1.20.8.1 21-Jun-2006  yamt sync with head.
 1.22.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.23.20.1 09-Jan-2008  matt sync with HEAD
 1.23.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.23.2.2 03-Dec-2007  ad Sync with HEAD.
 1.23.2.1 03-Dec-2007  ad Sync with HEAD.
 1.24.18.2 04-May-2009  yamt sync with head.
 1.24.18.1 16-May-2008  yamt sync with head.
 1.24.16.1 18-May-2008  yamt sync with head.
 1.24.14.3 17-Jan-2009  mjf Sync with HEAD.
 1.24.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.24.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.25.4.1 27-Jun-2008  simonb Sync with head.
 1.25.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.26.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.27.6.1 05-Mar-2011  rmind sync with head
 1.28.44.1 21-Apr-2017  bouyer Sync with HEAD
 1.28.40.1 26-Apr-2017  pgoyette Sync with HEAD
 1.28.36.1 28-Aug-2017  skrll Sync with HEAD
 1.28.18.1 03-Dec-2017  jdolecek update from HEAD
 1.29.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.30.8.2 03-Apr-2021  thorpej Sync with HEAD.
 1.30.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.31.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.11 16-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.10 15-Jan-2024  thorpej G/C unused isrlink_evcnt().
 1.9 13-Jan-2024  thorpej Switch next68k over to the common m68k vector table.
 1.8 05-Dec-2021  msaitoh s/from from/from/ in comment.
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.74; 1.6.76; 1.6.78;
merge ktrace-lwp.
 1.5 19-Jan-2005  chs de-__P, remove register, ansify.
 1.4 06-Jan-2003  wiz branches: 1.4.2; 1.4.10;
interrupt with two rs.
 1.3 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.2 10-Nov-1998  dbj branches: 1.2.24; 1.2.28;
Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.28.2 07-Jan-2003  thorpej Sync with HEAD.
 1.2.28.1 17-Sep-2002  nathanw Catch up to -current.
 1.2.24.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.10.1 29-Apr-2005  kent sync with -current
 1.4.2.1 24-Jan-2005  skrll Sync with HEAD.
 1.6.78.1 16-May-2008  yamt sync with head.
 1.6.76.1 18-May-2008  yamt sync with head.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.3 03-Nov-2002  chs merge all the m68k copies of kgdb_machdep.c.
 1.2 17-May-2002  jdolecek make kgdb buildable again, g/c next68k/stub.c
Changes by Christian Limpach in kern/16794, with some minor adjustment
by me.
 1.1 14-Dec-1999  dbj branches: 1.1.2; 1.1.8; 1.1.12; 1.1.16; 1.1.24;
add files needed to use KGDB as suggested by Christian Limpach <chris@Nice.CH>
 1.1.24.1 30-May-2002  gehenna Catch up with -current.
 1.1.16.2 11-Nov-2002  nathanw Catch up to -current
 1.1.16.1 20-Jun-2002  nathanw Catch up to -current.
 1.1.12.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1 14-Dec-1999  bouyer file kgdb_machdep.c was added on branch thorpej_scsipi on 2000-11-20 20:18:18 +0000
 1.1.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.85 17-Jan-2024  thorpej Make sigcode.s and sunos_sigcode.s build as their own stand-alone files.
 1.84 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.83 16-Jan-2024  thorpej Build m68k/support.s on its own; don't include it from locore.s
 1.82 16-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.81 13-Jan-2024  thorpej Switch next68k over to the common m68k vector table.
 1.80 12-Jan-2024  thorpej Make getsr() an inline in <m68k/psl.h> and G/C all of the now-redudant
copies.
 1.79 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.78 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.77 27-Dec-2023  thorpej Define the values for the 68040 TT registers in terms of the definitions in
<m68k/mmu_40.h> rather than using magic numbers.
 1.76 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.75 26-Dec-2023  thorpej G/C unused ploadw().
 1.74 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.73 16-Jun-2023  andvar fix typos in comments.
 1.72 11-Feb-2023  tsutsui Handle NeXT Turbo VRAM regions properly.

Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
 1.71 04-Feb-2023  tsutsui Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).
Tested on my NeXTstation slab.
 1.70 04-Feb-2023  tsutsui Remove #ifdef'ed out hp300 specific stuff.
 1.69 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.68 30-May-2022  andvar branches: 1.68.4;
s/identifing/identifying/ and s/multipler/multiplier/ in comments.
 1.67 25-Jan-2021  tsutsui Remove #undefs against INTERRUPT_SAVEREG and INTERRUPT_RESTOREREG.

They have been defined in <m68k/asm.h> for years.
 1.66 19-Dec-2018  maxv branches: 1.66.4; 1.66.12;
Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.65 15-Mar-2014  tsutsui branches: 1.65.28; 1.65.30;
Use common m68k/busaddrerr.s for bus error and address error handlers.

No binary changes on GENERIC.
 1.64 09-Mar-2014  tsutsui Remove an instruction for nonexistent 060 branch prediction error accounting.

It's amiga and atari specific and copied from amiga/locore.s
to mac68k/locore.s in rev 1.80, then pasted into other ports.
Note this is harmless because all these ports don't have 68060 variants
(i.e. it's inside #if defined(M68060) block) and mvme68k (which has 68060)
has removed it since the initial import.
 1.63 09-Mar-2014  tsutsui Remove unused m68k_fault_addr, which is required only on mac68k for SBC.

It looks hp300 one was copied from mac68k in rev 1.75
and then it was pasted to other ports again and again.
 1.62 31-Jan-2014  tsutsui defined(LKM) -> defined(MODULAR)
 1.61 22-Dec-2011  tsutsui branches: 1.61.6; 1.61.10;
Merge m68881_save() and m68881_restore() (using most common mvme68k ones).
All functions are checked by my eyes, and all GENERIC kernels compile.
 1.60 26-Nov-2011  tsutsui branches: 1.60.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.59 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.58 27-Dec-2010  tsutsui branches: 1.58.8;
Fix typo (and pasted lines). From OpenBSD.
 1.57 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.56 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.55 25-Feb-2010  skrll branches: 1.55.2;
s/cpu_fork/cpu_lwp_fork/ in comment.
 1.54 13-Dec-2009  tsutsui branches: 1.54.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.53 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.52 04-Dec-2009  tsutsui Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Also update some comment.
Compile test only.
 1.51 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.50 11-Jan-2009  tsutsui Fix inverted logic on FPU type check in fpfault(). From OpenBSD.
 1.49 17-Oct-2007  garbled branches: 1.49.16; 1.49.20; 1.49.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.48 12-Jun-2007  mhitch branches: 1.48.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.47 21-May-2007  tsutsui Adapt rest of m68k ports to yamt-idlelwp. Compile tested only.
 1.46 08-Mar-2007  tsutsui branches: 1.46.2; 1.46.4; 1.46.10;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.45 11-Dec-2005  christos branches: 1.45.24; 1.45.26; 1.45.30;
merge ktrace-lwp.
 1.44 24-Mar-2004  dbj branches: 1.44.16;
move my copyright statement up to new berkeley license
 1.43 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.42 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.41 23-Jun-2003  martin branches: 1.41.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.40 27-Apr-2003  ragge Preserve the symbol table in the LKM || KSYMS cases also.
 1.39 08-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.38 02-Feb-2003  wiz guarantee, not guarentee. Idea from miod@openbsd.
 1.37 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.36 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.35 30-May-2002  thorpej Fix a typo (#ifdef defined(...))
 1.34 17-May-2002  jdolecek branches: 1.34.2;
Force absolute jumps where necessary, newer gas generates pc-relative
jumps, which we don't want here.
Reported, suggested fix, and testing by Christian Limpach in port-next68k/16793.
 1.33 22-Jul-2001  wiz branches: 1.33.6; 1.33.14;
seperate -> separate
 1.32 30-May-2001  lukem branches: 1.32.2;
add missing #include "opt_kgdb.h"
 1.31 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.30 05-Apr-2001  dbj check for a 68040 MMU before using the TBIA instruction
addresses PR 10409
code grabbed from mvme68k locore.s
 1.29 05-Apr-2001  dbj remove unused cache operations, we now use shared m68k/cacheops.c
 1.28 26-Nov-2000  jdolecek branches: 1.28.2;
split m68k SunOS and SVR4-specific sigcode.s code to sunos_sigcode.s
and svr4_sigcode.s respectively
adjust individual m68k port's locore.s to include new sigcode files if
appropriate
 1.27 21-Nov-2000  tsutsui Define proper macros for FP frame offsets rather than magic numbers.
 1.26 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.25 31-May-2000  thorpej Add a comment on single-processor systems about p_cpu being initialized
by fork1().
 1.24 26-May-2000  thorpej branches: 1.24.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.23 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.22 14-May-2000  minoura defopt FPSP.
 1.21 08-Jan-2000  dbj add % to register names
use cpp macros for all symbol access
 1.20 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.19 17-Sep-1999  thorpej branches: 1.19.2; 1.19.4; 1.19.6;
Centralize the declaration and clearing of `cold'.
 1.18 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.17 29-Apr-1999  christos Include opt_compat_sunos.h
 1.16 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.15 24-Mar-1999  dbj branches: 1.15.2;
Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.14 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.13 26-Feb-1999  is next68k specific part of PR 6152 fix
 1.12 31-Jan-1999  dbj Made reboot and halt work.
 1.11 02-Jan-1999  dbj Applied supplied patches from pr port-next68k/6709
add bus_space support for mono framebuffer
 1.10 02-Jan-1999  dbj Added check that M68040 is defined in case user interrupted creation
of assym.h, leaving it empty.
 1.9 24-Nov-1998  dbj uncommented the "intrnames" definitions used by vmstat to
label interrupt counts.
 1.8 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.7 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.6 30-Sep-1998  thorpej Garbage collect trap #1 and trap #2 handlers; they're moved to
trap_subr.s
 1.5 30-Sep-1998  thorpej Pull in opt_compat_netbsd.h
 1.4 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.3 28-Aug-1998  dbj Moved initialization of vbr, and removed default machine configuration
varaiables to debug probing on the turbo machines.
 1.2 04-Jul-1998  jonathan defopt DDB.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.15.2.1 30-Apr-1999  perry branches: 1.15.2.1.2;
pullup 1.16->1.17 (christos); conflicts manually edited
 1.15.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.15.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.4.1 15-Nov-1999  fvdl Sync with -current
 1.19.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.19.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.19.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.28.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.28.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.32.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.32.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.32.2.1 03-Aug-2001  lukem update to -current
 1.33.14.2 15-Jul-2002  gehenna catch up with -current.
 1.33.14.1 30-May-2002  gehenna Catch up with -current.
 1.33.6.5 17-Sep-2002  nathanw Catch up to -current.
 1.33.6.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.33.6.3 20-Jun-2002  nathanw Catch up to -current.
 1.33.6.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.33.6.1 22-Jul-2001  scw file locore.s was added on branch nathanw_sa on 2001-11-18 18:43:07 +0000
 1.34.2.1 30-May-2002  tv Pull up revision 1.35 (requested by thorpej in ticket #98):
Fix a typo (#ifdef defined(...))
 1.41.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.41.2.1 03-Aug-2004  skrll Sync with HEAD
 1.44.16.1 03-Sep-2007  yamt sync with head.
 1.45.30.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.45.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.45.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.46.10.2 26-Jun-2007  garbled Sync with HEAD.
 1.46.10.1 22-May-2007  matt Update to HEAD.
 1.46.4.1 11-Jul-2007  mjf Sync with head.
 1.46.2.2 15-Jul-2007  ad Sync with head.
 1.46.2.1 27-May-2007  ad Sync with head.
 1.48.10.1 06-Nov-2007  matt sync with HEAD
 1.49.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.49.20.3 11-Aug-2010  yamt sync with head.
 1.49.20.2 11-Mar-2010  yamt sync with head
 1.49.20.1 04-May-2009  yamt sync with head.
 1.49.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.54.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.54.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.55.2.2 05-Mar-2011  rmind sync with head
 1.55.2.1 03-Jul-2010  rmind sync with head
 1.58.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.58.8.1 17-Apr-2012  yamt sync with head
 1.60.2.1 18-Feb-2012  mrg merge to -current.
 1.61.10.1 18-May-2014  rmind sync with head
 1.61.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.65.30.1 10-Jun-2019  christos Sync with HEAD
 1.65.28.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.66.12.1 03-Apr-2021  thorpej Sync with HEAD.
 1.66.4.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.66.4.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1590):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.68.4.3 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.68.4.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.68.4.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #77):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.122 05-Mar-2024  thorpej Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().

It's a small step, but it's a step.
 1.121 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.120 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.119 03-Feb-2023  tsutsui Use proper C99 int types.
 1.118 03-Feb-2023  tsutsui Use explicit CPU strings and remove hp300 derived stuff.
 1.117 27-Jan-2023  tsutsui next68k: Fix delay_divisor value for proper delay(9) on 68040.
 1.116 09-Oct-2021  tsutsui branches: 1.116.4;
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.115 11-Jun-2020  ad uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
 1.114 31-Dec-2019  ad Rename uvm_free() -> uvm_availmem().
 1.113 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.112 14-Mar-2019  thorpej branches: 1.112.4;
G/C "MAPPECOPY". It is the deadest of wood, and never actually worked in
NetBSD.
 1.111 24-Mar-2014  christos branches: 1.111.10; 1.111.20; 1.111.30;
- use cpu_{g,s}etmodel
- fix unused
 1.110 24-Mar-2014  christos fix typo.
 1.109 11-Aug-2012  tsutsui branches: 1.109.2; 1.109.4;
Sprinkle extern to appease gcc -fno-common.
 1.108 28-Jul-2012  matt Remove declartions of physmem
 1.107 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.106 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.105 12-Jun-2011  rmind branches: 1.105.2; 1.105.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.104 16-May-2011  tsutsui branches: 1.104.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.103 10-May-2011  tsutsui Move isrinit() call from early next68k_init() to cpu_configure(9)
since interrupt service routines would want evcnt(9).
 1.102 05-Mar-2011  joerg p_psstr -> p_psstrp
 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 17-Jan-2011  tsutsui branches: 1.100.2;
Explicitly include <machine/pcb.h> for struct pcb.
 1.99 16-Oct-2010  tsutsui branches: 1.99.2;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.
 1.98 08-Feb-2010  joerg branches: 1.98.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.97 10-Dec-2009  matt branches: 1.97.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.96 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.95 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.94 15-Aug-2009  matt Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for us.
 1.93 18-Mar-2009  cegger bcopy -> memcpy
 1.92 18-Mar-2009  cegger bzero -> memset
 1.91 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.90 12-Jan-2009  cegger branches: 1.90.2;
use PRIx64 format to printf type dev_t
 1.89 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.88 25-Nov-2008  ad dumpsys: don't spew numbers into the log.
 1.87 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.86 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.85 14-Sep-2008  tsutsui branches: 1.85.2; 1.85.4;
Remove ancient workaround hacks for gcc 2.7.2.
 1.84 02-Jul-2008  ad branches: 1.84.2;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.83 31-Dec-2007  ad branches: 1.83.6; 1.83.10; 1.83.12; 1.83.14;
Remove COMPAT_HPUX.
 1.82 17-Oct-2007  garbled branches: 1.82.2; 1.82.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.81 21-May-2007  tsutsui branches: 1.81.10;
Adapt rest of m68k ports to yamt-idlelwp. Compile tested only.
 1.80 05-Mar-2007  tsutsui branches: 1.80.2; 1.80.4; 1.80.10;
Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
 1.79 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.78 28-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.77 09-Feb-2007  ad branches: 1.77.2;
Merge newlock2 to head.
 1.76 24-Jan-2007  hubertf Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
 1.75 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.74 11-Dec-2005  christos branches: 1.74.20; 1.74.22;
merge ktrace-lwp.
 1.73 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.72 25-Apr-2005  lukem branches: 1.72.2; 1.72.4;
Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.
 1.71 11-Feb-2005  yamt branches: 1.71.4;
remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.
 1.70 19-Jan-2005  chs branches: 1.70.2;
de-__P, remove register, ansify.
 1.69 24-Mar-2004  atatat branches: 1.69.8;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
 1.68 24-Mar-2004  dbj move my copyright statement up to new berkeley license
 1.67 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.66 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.65 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.64 27-Sep-2003  cl Cast through (void *) to appease gcc3.
 1.63 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.62 15-Jul-2003  lukem __KERNEL_RCSID()
 1.61 29-Jun-2003  fvdl branches: 1.61.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.60 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.59 10-May-2003  thorpej Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
 1.58 08-May-2003  thorpej Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
 1.57 26-Apr-2003  ragge Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.56 02-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.55 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.54 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.53 19-Sep-2002  ragge Do not include <sys/clist.h>, it's not used in NetBSD at all.
 1.52 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.51 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.50 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.49 20-May-2002  jdolecek Check for zsc properly, and fix typo in #include.
Pointed out, and patch provided by Christian Limpach in private e-mail.
 1.48 17-May-2002  jdolecek make kgdb buildable again, g/c next68k/stub.c
Changes by Christian Limpach in kern/16794, with some minor adjustment
by me.
 1.47 20-Mar-2002  christos branches: 1.47.4;
kill remaining PS_STRINGS instances.
 1.46 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.45 10-Sep-2001  chris branches: 1.45.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.44 02-Jun-2001  chs branches: 1.44.2; 1.44.4;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.43 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.42 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.41 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.40 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.39 24-Sep-2000  jdolecek branches: 1.39.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.38 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.37 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.36 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.35 30-May-2000  deberg oops, we need nofault.
 1.34 29-May-2000  deberg use rtc.h for poweroff() and #if 0 out badaddr, which isn't used
anywhere. machdep.c compiles w/o any noise now.
 1.33 29-May-2000  deberg no need to include next{kbd,display}var.h
 1.32 26-May-2000  thorpej branches: 1.32.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.31 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.30 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.29 19-Jan-2000  thorpej Move callout initialization to a single location; no need to duplicate
that code all over the place.
 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 17-Sep-1999  thorpej branches: 1.26.2; 1.26.4; 1.26.8;
Centralize the declaration and clearing of `cold'.
 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 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.23 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.22 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.21 25-Apr-1999  simonb g/c REAL_CLISTS.
 1.20 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.19 01-Apr-1999  thorpej branches: 1.19.2;
Don't call configure() from cpu_startup().
 1.18 27-Mar-1999  dbj added kgdb support.
 1.17 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.16 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.15 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.14 27-Feb-1999  scottr defopt BUFCACHE and BUFPAGES.
 1.13 31-Jan-1999  dbj Made reboot and halt work.
 1.12 31-Jan-1999  dbj Added support for setting boothowto from boot loader flags.
print out string of `.' when powering down to work around ununderstood
behavior of rtc chip.
 1.11 09-Jan-1999  thorpej Garbage-collect `mbutl'.
 1.10 14-Nov-1998  dbj Finished changes to use UVM on next68k.
Turn on UVM by default in GENERIC kernel.
 1.9 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.8 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.7 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.6 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.5 04-Jul-1998  jonathan defopt DDB.
 1.4 01-Jul-1998  dbj Moved rom memory configuration reading code into nextrom.c from machdep.c
 1.3 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.2 09-Jun-1998  tv Add recent ddb_init() interface change.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.19.2.1 16-Apr-1999  chs branches: 1.19.2.1.2;
pull up 1.19 -> 1.20:
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.19.2.1.2.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 27-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.32.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.39.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.39.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.44.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.44.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.44.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.44.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.44.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.44.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.45.4.12 18-Oct-2002  nathanw Catch up to -current.
 1.45.4.11 05-Oct-2002  gmcgarry LWPify
 1.45.4.10 17-Sep-2002  nathanw Catch up to -current.
 1.45.4.9 27-Aug-2002  nathanw Catch up to -current.
 1.45.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.45.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.45.4.6 20-Jun-2002  nathanw Catch up to -current.
 1.45.4.5 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.45.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.45.4.3 02-Dec-2001  scw If an FPU is available, call m68k_make_fpu_idle_frame() to generate
a reference FPU idle frame.
 1.45.4.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.45.4.1 10-Sep-2001  scw file machdep.c was added on branch nathanw_sa on 2001-11-18 18:43:07 +0000
 1.47.4.3 31-Aug-2002  gehenna catch up with -current.
 1.47.4.2 30-May-2002  gehenna Catch up with -current.
 1.47.4.1 17-May-2002  gehenna Replace the access to devsw table and the hard-coded major with devsw API.
 1.61.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.61.2.6 15-Feb-2005  skrll Sync with HEAD.
 1.61.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.61.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.61.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.61.2.2 03-Aug-2004  skrll Sync with HEAD
 1.61.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.69.8.1 29-Apr-2005  kent sync with -current
 1.70.2.1 12-Feb-2005  yamt sync with head.
 1.71.4.1 01-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #923):
sys/arch/next68k/next68k/machdep.c: revision 1.73
sys/arch/luna68k/luna68k/machdep.c: revision 1.42
sys/arch/hp300/hp300/machdep.c: revision 1.184
sys/arch/amiga/amiga/machdep.c: revision 1.193
sys/arch/x68k/x68k/machdep.c: revision 1.129
sys/arch/mac68k/mac68k/machdep.c: revision 1.306
sys/arch/news68k/news68k/machdep.c: revision 1.61
sys/arch/mvme68k/mvme68k/machdep.c: revision 1.113
sys/arch/atari/atari/atari_init.c: revision 1.63
fix crash dumps on m68k platforms, cpu_kcore_hdr_t is larger than
512 bytes now so we need a bigger buffer. PR 26958.
 1.72.4.1 02-Nov-2005  yamt sync with head.
 1.72.2.5 21-Jan-2008  yamt sync with head
 1.72.2.4 03-Sep-2007  yamt sync with head.
 1.72.2.3 26-Feb-2007  yamt sync with head.
 1.72.2.2 30-Dec-2006  yamt sync with head.
 1.72.2.1 21-Jun-2006  yamt sync with head.
 1.74.22.1 22-Oct-2006  yamt sync with head
 1.74.20.3 01-Feb-2007  ad Sync with head.
 1.74.20.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.74.20.1 18-Nov-2006  ad Sync with head.
 1.77.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.80.10.1 22-May-2007  matt Update to HEAD.
 1.80.4.1 11-Jul-2007  mjf Sync with head.
 1.80.2.1 27-May-2007  ad Sync with head.
 1.81.10.2 09-Jan-2008  matt sync with HEAD
 1.81.10.1 06-Nov-2007  matt sync with HEAD
 1.82.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.82.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.83.14.1 03-Jul-2008  simonb Sync with head.
 1.83.12.4 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.83.12.3 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.83.12.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.83.12.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.83.10.3 11-Mar-2010  yamt sync with head
 1.83.10.2 19-Aug-2009  yamt sync with head.
 1.83.10.1 04-May-2009  yamt sync with head.
 1.83.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.83.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.83.6.1 02-Jul-2008  mjf Sync with HEAD.
 1.84.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.84.2.1 19-Oct-2008  haad Sync with HEAD.
 1.85.4.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.85.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.85.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.85.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.90.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.97.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.97.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.98.2.5 31-May-2011  rmind sync with head
 1.98.2.4 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.98.2.3 05-Mar-2011  rmind sync with head
 1.98.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.98.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.99.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.100.2.1 17-Feb-2011  bouyer Sync with HEAD
 1.104.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.105.6.1 18-Feb-2012  mrg merge to -current.
 1.105.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.105.2.2 30-Oct-2012  yamt sync with head
 1.105.2.1 17-Apr-2012  yamt sync with head
 1.109.4.1 18-May-2014  rmind sync with head
 1.109.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.111.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.111.30.1 10-Jun-2019  christos Sync with HEAD
 1.111.20.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.111.10.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.112.4.2 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1590):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.112.4.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1581):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.116.4.2 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #77):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.116.4.1 01-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #63):

sys/arch/next68k/next68k/machdep.c: revision 1.117
sys/arch/next68k/dev/esp.c: revision 1.65
sys/arch/next68k/include/cpu.h: revision 1.51
sys/arch/next68k/include/bus_space.h: revision 1.20
sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3. It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
 1.15 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.14 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.13 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.12 24-Apr-2021  thorpej branches: 1.12.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.11 05-Jun-2011  matt branches: 1.11.68;
struct device * -> device_t, struct cfdata * -> cfdata_t
CFATTACH_DECL(*, sizeof(struct device), -> CFATTACH_DECL_NEW(&, 0
 1.10 28-Apr-2008  martin branches: 1.10.22; 1.10.28; 1.10.32;
Remove clause 3 and 4 from TNF licenses
 1.9 11-Dec-2005  christos branches: 1.9.74; 1.9.76; 1.9.78;
merge ktrace-lwp.
 1.8 26-Aug-2005  drochner s/locdesc_t/int/g
 1.7 30-Jun-2005  drochner branches: 1.7.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.6 19-Jan-2005  chs de-__P, remove register, ansify.
 1.5 15-Jul-2003  lukem branches: 1.5.8;
__KERNEL_RCSID()
 1.4 02-Oct-2002  thorpej branches: 1.4.2; 1.4.8;
Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 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.1 11-Sep-2002  mycroft branches: 1.1.2;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.1.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.1 11-Sep-2002  nathanw file mainbus.c was added on branch nathanw_sa on 2002-09-17 21:16:41 +0000
 1.4.8.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.8.4 24-Jan-2005  skrll Sync with HEAD.
 1.4.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.8.1 03-Aug-2004  skrll Sync with HEAD
 1.4.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.4.2.1 02-Oct-2002  jdolecek file mainbus.c was added on branch kqueue on 2002-10-10 18:34:42 +0000
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.7.2.1 21-Jun-2006  yamt sync with head.
 1.9.78.1 16-May-2008  yamt sync with head.
 1.9.76.1 18-May-2008  yamt sync with head.
 1.9.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.32.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.10.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.22.1 12-Jun-2011  rmind sync with head
 1.11.68.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.11.68.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.11.68.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.11.68.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.11.68.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.11.68.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.12.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.27 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.26 08-Feb-2011  rmind branches: 1.26.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.25 05-Mar-2007  tsutsui branches: 1.25.40; 1.25.64; 1.25.66; 1.25.72; 1.25.74;
Remove an unnecessary cast and use (char *) on pointer arith.
 1.24 04-Mar-2007  christos 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 19-Jan-2005  chs branches: 1.22.8;
de-__P, remove register, ansify.
 1.21 07-Aug-2003  agc branches: 1.21.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.20 15-Jul-2003  lukem __KERNEL_RCSID()
 1.19 02-Apr-2003  thorpej branches: 1.19.2;
Use PAGE_SIZE rather than NBPG.
 1.18 23-Oct-2002  jdolecek merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.17 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.16 27-Feb-2002  christos branches: 1.16.8;
- Use DEV_ constants, instead of documenting the numbers!
- Delete cdev_decl(mm); where appropriate, and other hand-crufting [hi powerpc!]
 1.15 10-Sep-2001  chris branches: 1.15.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.14 13-May-2001  chs branches: 1.14.2; 1.14.4;
turn on printf format-string checking and -Werror. fix all warnings.
 1.13 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.12 29-Jun-2000  mrg branches: 1.12.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.11 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.10 04-Dec-1999  ragge branches: 1.10.4;
CL* discarding.
 1.9 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.8 27-Mar-1999  mycroft branches: 1.8.8; 1.8.10; 1.8.14;
Oops; vm_offset_t -> vaddr_t.
 1.7 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.6 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.5 10-Feb-1999  kleink Use of casts as lvalues is a GNU C extension; rearrange slightly.
 1.4 13-Jan-1999  abs Change 'from from' to 'from' in some comments
 1.3 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.2 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.8.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.10.1 15-Nov-1999  fvdl Sync with -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.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.12.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.14.4.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.14.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.14.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.14.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.14.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.15.4.4 11-Nov-2002  nathanw Catch up to -current
 1.15.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.15.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.15.4.1 10-Sep-2001  nathanw file mem.c was added on branch nathanw_sa on 2002-02-28 04:11:18 +0000
 1.16.8.1 17-May-2002  gehenna Add the character device switch.
 1.19.2.4 24-Jan-2005  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.21.8.1 29-Apr-2005  kent sync with -current
 1.22.8.1 03-Sep-2007  yamt sync with head.
 1.23.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.25.74.1 17-Feb-2011  bouyer Sync with HEAD
 1.25.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.25.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.25.64.1 30-Oct-2010  uebayasi Implement pmap_physload_device(9) to replace xmd(4) MD backend.
Implement pmap_mmap(9) and use it from mem(4) and xmd(4).
 1.25.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.26.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.29 11-Feb-2023  tsutsui Add and check machine type NeXT_CUBE_TURBO (type 8).

Info from Andreas Grabher on port-next68k@.
 1.28 11-Feb-2023  tsutsui Handle NeXT Turbo VRAM regions properly.

Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
 1.27 18-Jul-2018  sevan branches: 1.27.4; 1.27.30;
Be consistent among ethernet drivers on the convention for printing ethernet
addresses.

NFC
 1.26 08-Mar-2018  mrg branches: 1.26.2;
fix various gcc6 m68k issues:
- bad indentation. next68k en.c and mvme68k le_poll.c fixes real issues
in error handling, the rest are NFCI.
- pass 68030 flags as appropriate for mvme68k.
- next68k nextrom.c has -Warray-bounds ignored for an odd expression
that appears to run before relocation, and needs manual offsets
added which trips bounds array checking.

with this all m68k ports build with GCC 6.
 1.25 11-Aug-2012  tsutsui branches: 1.25.38;
Sprinkle extern to appease gcc -fno-common.
 1.24 18-Dec-2011  tsutsui Misc KNF and cosmetics. No binary changes.
 1.23 18-Dec-2011  tsutsui PR port-next68k/45719 from Jaime Fournier:
Fix RELOC() (awful VA -> PA conversion) usage introduced to appease gcc45
in rev 1.22.
 1.22 01-Oct-2011  chs branches: 1.22.2; 1.22.6;
fix build errors with gcc 4.5.
 1.21 24-Apr-2010  dbj switch from 4 clause to 2 clause BSD license.
 1.20 11-Dec-2005  christos branches: 1.20.78; 1.20.98; 1.20.100;
merge ktrace-lwp.
 1.19 05-Jun-2005  he Make reloc_elfmag const, so that this compiles.
 1.18 05-Jun-2005  he Adapt to -Wcast-qual and -Wshadow by adding const and renaming a
few local variables. One problem remains which makes this not
build related to the initial assignment of reloc_elfmag, where the
portmaster's opinion has been sought.
 1.17 19-Jan-2005  chs de-__P, remove register, ansify.
 1.16 15-Jul-2003  lukem branches: 1.16.8;
__KERNEL_RCSID()
 1.15 20-Jan-2003  simonb branches: 1.15.2;
The Double-Semi-Colon Police.
 1.14 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.13 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.12 12-May-2001  chs branches: 1.12.2; 1.12.8; 1.12.16;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.11 07-Dec-1999  dbj branches: 1.11.6;
applied patch from pr port-next68k/8962 from Christian Limpach <chris@nice.ch>
"boot fails on machines which do not have 32M of memory"
 1.10 24-Mar-1999  dbj branches: 1.10.2; 1.10.8; 1.10.14;
Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.9 31-Jan-1999  dbj Made reboot and halt work.
 1.8 31-Jan-1999  dbj Added support for setting boothowto from boot loader flags.
print out string of `.' when powering down to work around ununderstood
behavior of rtc chip.
 1.7 28-Aug-1998  dbj Added some machine probing information to console printouts.
 1.6 04-Aug-1998  dbj Fixed memory probe for color turbo machines.
 1.5 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.4 11-Jul-1998  dbj Reserved 8k at top of memory for ROM. This fixes warp9c boot problems.
changed ethernet panic to a warning when out of DMA buffers. This allows
resuming if you sit in ddb too long.
 1.3 04-Jul-1998  dbj Fixed pre-MMU rom console printing.
Fixed probing of the segment list on color NeXT's.
Added some debug messages on console as it reads the hardware config.
 1.2 01-Jul-1998  dbj Moved rom memory configuration reading code into nextrom.c from machdep.c
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.10.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.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 20-Jan-2000  he Pull up revision 1.11 (requested by dbj):
Fix boot failure on machines which do not have 32M of memory.
Fixes PR#8962.
 1.11.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.16.1 16-Jul-2002  gehenna catch up with -current.
 1.12.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.12.8.2 01-Aug-2002  nathanw Catch up to -current.
 1.12.8.1 12-May-2001  nathanw file nextrom.c was added on branch nathanw_sa on 2002-08-01 02:42:51 +0000
 1.12.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.12.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.4 24-Jan-2005  skrll Sync with HEAD.
 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.8.1 29-Apr-2005  kent sync with -current
 1.20.100.1 30-May-2010  rmind sync with head
 1.20.98.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.20.78.1 11-Aug-2010  yamt sync with head.
 1.22.6.1 18-Feb-2012  mrg merge to -current.
 1.22.2.2 30-Oct-2012  yamt sync with head
 1.22.2.1 17-Apr-2012  yamt sync with head
 1.25.38.2 28-Jul-2018  pgoyette Sync with HEAD
 1.25.38.1 15-Mar-2018  pgoyette Synch with HEAD
 1.26.2.1 10-Jun-2019  christos Sync with HEAD
 1.27.30.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.27.4.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.13 11-Feb-2023  tsutsui Add and check machine type NeXT_CUBE_TURBO (type 8).

Info from Andreas Grabher on port-next68k@.
 1.12 18-May-2022  andvar branches: 1.12.4;
fix typos in word "access" and it derivatives, mainly in comments.
 1.11 18-Dec-2011  tsutsui branches: 1.11.52;
Misc KNF and cosmetics. No binary changes.
 1.10 24-Apr-2010  dbj branches: 1.10.8; 1.10.12;
switch from 4 clause to 2 clause BSD license.
 1.9 04-Mar-2007  christos branches: 1.9.44; 1.9.64; 1.9.66;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 11-Sep-2002  mycroft branches: 1.8.22; 1.8.60;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.7 31-Aug-2001  simonb branches: 1.7.6;
Use comments around the token after a #endif.
 1.6 24-Mar-1999  dbj branches: 1.6.22;
Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.5 31-Jan-1999  dbj Made reboot and halt work.
 1.4 31-Jan-1999  dbj Added support for setting boothowto from boot loader flags.
print out string of `.' when powering down to work around ununderstood
behavior of rtc chip.
 1.3 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.2 04-Jul-1998  dbj Fixed pre-MMU rom console printing.
Fixed probing of the segment list on color NeXT's.
Added some debug messages on console as it reads the hardware config.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.6.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.6.22.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.7.6.2 17-Sep-2002  nathanw Catch up to -current.
 1.7.6.1 31-Aug-2001  nathanw file nextrom.h was added on branch nathanw_sa on 2002-09-17 21:16:42 +0000
 1.8.60.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.22.1 03-Sep-2007  yamt sync with head.
 1.9.66.1 30-May-2010  rmind sync with head
 1.9.64.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.9.44.1 11-Aug-2010  yamt sync with head.
 1.10.12.1 18-Feb-2012  mrg merge to -current.
 1.10.8.1 17-Apr-2012  yamt sync with head
 1.11.52.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.12.4.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.48 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.47 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.46 14-Oct-2002  chs merge pte.h for m68k w/ motorola or compatible MMU
(only 4k-page platforms so far).
 1.45 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.44 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.43 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.42 02-Jan-2002  chs branches: 1.42.8;
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.41 16-Dec-2001  tsutsui Fix comments for ref-count of PT pages.
 1.40 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.39 24-Nov-2001  isaki fix typo s/68551/68851/ in a comment.
 1.38 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.37 29-Sep-2001  chs branches: 1.37.4;
fix typo in pmap_kremove() which was invalidating the wrong TLB entry.
from Hiroki Tanikawa in PR 14099.
 1.36 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.35 04-Aug-2001  chs branches: 1.35.2;
implement pmap_k{enter_pa,remove}() correctly.
remove various checks for impossible conditions.
other misc cleanup.
 1.34 02-Jun-2001  chs branches: 1.34.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.33 26-May-2001  chs replace vm_page_t with struct vm_page *.
 1.32 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.31 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.30 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.29 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.28 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.27 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.26 14-Jan-2001  thorpej branches: 1.26.2;
splimp() -> splvm()
 1.25 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.24 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.23 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.22 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.21 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.20 21-Sep-1999  dbj branches: 1.20.2; 1.20.4; 1.20.8;
added a couple of functions missed when chuq removed PMAP_NEW
 1.19 16-Sep-1999  chs make this compile again after PMAP_NEW cleanup.
 1.18 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.17 17-Jun-1999  thorpej pmap_change_wiring() -> pmap_unwire().
 1.16 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.15 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.14 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.13 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.12 27-Mar-1999  mycroft branches: 1.12.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.11 27-Mar-1999  mycroft Oops; forgot to change some pmap_enter() calls.
 1.10 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.9 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.8 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.7 26-Feb-1999  is next68k specific part of PR 6152 fix
 1.6 13-Jan-1999  abs Change 'from from' to 'from' in some comments
 1.5 02-Jan-1999  dbj Applied supplied patches from pr port-next68k/6709
add bus_space support for mono framebuffer
 1.4 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.3 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.2 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.12.2.1 26-Apr-1999  perry branches: 1.12.2.1.2;
pullup 1.12->1.13 (chuq)
 1.12.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.12.2.1.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.4.1 15-Nov-1999  fvdl Sync with -current
 1.20.2.4 23-Apr-2001  bouyer Sync with HEAD.
 1.20.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.20.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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.26.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.26.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.34.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.34.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.34.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.34.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.34.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.35.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.37.4.9 11-Nov-2002  nathanw Catch up to -current
 1.37.4.8 18-Oct-2002  nathanw Catch up to -current.
 1.37.4.7 17-Sep-2002  nathanw Catch up to -current.
 1.37.4.6 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.37.4.5 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.37.4.4 20-Jun-2002  nathanw Catch up to -current.
 1.37.4.3 08-Jan-2002  nathanw Catch up to -current.
 1.37.4.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.37.4.1 29-Sep-2001  scw file pmap.c was added on branch nathanw_sa on 2001-11-18 18:43:08 +0000
 1.42.8.1 30-May-2002  gehenna Catch up with -current.
 1.47 11-Feb-2023  tsutsui Handle NeXT Turbo VRAM regions properly.

Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).
 1.46 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.45 04-Feb-2023  tsutsui Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).
Tested on my NeXTstation slab.
 1.44 23-Dec-2016  maya branches: 1.44.20; 1.44.46;
more psize_t physmem fallout. remove conflicting types.
 1.43 05-Jan-2014  tsutsui branches: 1.43.6; 1.43.10;
Move physmem calculations before nptpage initialization.

Should fix next68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page), and
this is the last possible m68k MD part of this PR.

Note this change is not tested on the actual machine (yet),
but as noted in comment next68k/pmap_bootstrap.c is based on
the mvme68k one which has been fixed by the similar diff.

Should be pulled up to all netbsd-6 branches.
 1.42 10-Feb-2012  mhitch branches: 1.42.2; 1.42.6; 1.42.8; 1.42.10; 1.42.16;
Sigh, it's been too long since I've done some of this. Fix the RELOC().
 1.41 10-Feb-2012  mhitch Oops - have to RELOC(physmem) here.
 1.40 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.39 02-Jan-2011  tsutsui branches: 1.39.8; 1.39.12;
Tidy up common comments. (Yes, too many dup code...)
 1.38 02-Jan-2011  tsutsui Misc cosmetics to reduce diff among hp300 derived m68k ports.
XXX: too many quirks to merge...
 1.37 25-Dec-2010  tsutsui Fix fatal typo and pasted lines slipped in the last December
that prevent 68030 machines boot on these ports.
(only hp300 and mvme68k have supported 030 models)

Sorry for so long breakage.
 1.36 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.35 11-Dec-2009  tsutsui branches: 1.35.2; 1.35.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.34 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.33 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.32 05-Dec-2009  tsutsui Use proper macro, variable names, types, and assignments for readability.
 1.31 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.30 04-Dec-2009  tsutsui No need to initialize lwp0 u-area in pmap_bootstrap()
since it will be done in pmap_bootstrap_finalize().
 1.29 04-Dec-2009  tsutsui Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Also update some comment.
Compile test only.
 1.28 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.27 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.26 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.25 17-Oct-2007  garbled branches: 1.25.16; 1.25.20; 1.25.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.24 18-May-2007  tsutsui branches: 1.24.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.23 05-Mar-2007  tsutsui branches: 1.23.2; 1.23.4; 1.23.10;
Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
 1.22 05-Mar-2007  tsutsui - add missed '*'
- vmmap is (char *) in pmap_motorola.h
 1.21 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20 11-Dec-2005  christos branches: 1.20.26;
merge ktrace-lwp.
 1.19 01-Apr-2005  yamt branches: 1.19.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.18 19-Jan-2005  chs branches: 1.18.2;
de-__P, remove register, ansify.
 1.17 13-Feb-2004  wiz branches: 1.17.8;
Uppercase CPU, plural is CPUs.
 1.16 01-Oct-2003  mycroft Enabling caching of the video memory, and preset the modified bits.
 1.15 01-Oct-2003  mycroft Some small cleanup -- make the base,limit values vaddr_t, not char*.
Also add some code that attempts to deal with C16_VIDEO interrupts, though it
does not seem to make my color slabs work again.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.13 15-Jul-2003  lukem __KERNEL_RCSID()
 1.12 02-Apr-2003  thorpej branches: 1.12.2;
Use PAGE_SIZE rather than NBPG.
 1.11 05-Nov-2002  chs merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.10 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.9 02-Apr-2001  dbj branches: 1.9.2; 1.9.8;
resync with mvme68k
 1.8 31-Mar-2001  dbj Initialize the entire pmap table before populating it.
This addresses pr 7174
Thanks to Christian Limapch for diagnosing the problem.
 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 24-Mar-1999  dbj branches: 1.6.8; 1.6.18;
fix typo allocating color framebuffer map.
 1.5 24-Mar-1999  dbj Applied patches from Matt Debergalis <deberg@mit.edu>.
These patches include:
Added framebuffer mapping for color framebuffer to support color wscons
which is coming soon.
Renamed wskbdmap_mfii[ch] to wskbdmap_next[ch]
Changed video to be white on black instead of black on white.
Now handles and discards mouse interrupts.
Video and keyboard is now working on mono machines.
 1.4 13-Jan-1999  abs Change 'from from' to 'from' in some comments
 1.3 02-Jan-1999  dbj Applied supplied patches from pr port-next68k/6709
add bus_space support for mono framebuffer
 1.2 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.6.18.1 01-Apr-2001  he Pull up revision 1.8 (requested by dbj):
Initialize the entire pmap table before populating it.
Fixes PR#7174.
 1.6.8.2 21-Apr-2001  bouyer Sync with HEAD
 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.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.9.8.3 11-Nov-2002  nathanw Catch up to -current
 1.9.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.9.8.1 02-Apr-2001  nathanw file pmap_bootstrap.c was added on branch nathanw_sa on 2002-09-17 21:16:44 +0000
 1.9.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.12.2.5 01-Apr-2005  skrll Sync with HEAD.
 1.12.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.12.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.2.1 03-Aug-2004  skrll Sync with HEAD
 1.17.8.1 29-Apr-2005  kent sync with -current
 1.18.2.2 23-Feb-2005  yamt - remove redundant initialization of l2 descriptors.
- fix type errors.
 1.18.2.1 23-Feb-2005  yamt change kernel va layout, following mac68k.
 1.19.2.1 03-Sep-2007  yamt sync with head.
 1.20.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.10.1 22-May-2007  matt Update to HEAD.
 1.23.4.1 11-Jul-2007  mjf Sync with head.
 1.23.2.1 27-May-2007  ad Sync with head.
 1.24.10.1 06-Nov-2007  matt sync with HEAD
 1.25.28.1 19-Jan-2009  skrll Sync with HEAD.
 1.25.20.3 11-Aug-2010  yamt sync with head.
 1.25.20.2 11-Mar-2010  yamt sync with head
 1.25.20.1 04-May-2009  yamt sync with head.
 1.25.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.35.4.2 05-Mar-2011  rmind sync with head
 1.35.4.1 03-Jul-2010  rmind sync with head
 1.35.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.39.12.1 18-Feb-2012  mrg merge to -current.
 1.39.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.39.8.1 17-Apr-2012  yamt sync with head
 1.42.16.1 08-Sep-2014  msaitoh Pull up following revision(s) (requested by tsutsui in ticket #1008):
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.43
Move physmem calculations before nptpage initialization.
Should fix next68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page), and
this is the last possible m68k MD part of this PR.
Note this change is not tested on the actual machine (yet),
but as noted in comment next68k/pmap_bootstrap.c is based on
the mvme68k one which has been fixed by the similar diff.
Should be pulled up to all netbsd-6 branches.
 1.42.10.1 18-May-2014  rmind sync with head
 1.42.8.1 08-Sep-2014  msaitoh Pull up following revision(s) (requested by tsutsui in ticket #1008):
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.43
Move physmem calculations before nptpage initialization.
Should fix next68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page), and
this is the last possible m68k MD part of this PR.
Note this change is not tested on the actual machine (yet),
but as noted in comment next68k/pmap_bootstrap.c is based on
the mvme68k one which has been fixed by the similar diff.
Should be pulled up to all netbsd-6 branches.
 1.42.6.2 03-Dec-2017  jdolecek update from HEAD
 1.42.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.42.2.1 12-Jan-2014  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1008):
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.43
Move physmem calculations before nptpage initialization.
Should fix next68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page), and
this is the last possible m68k MD part of this PR.
Note this change is not tested on the actual machine (yet),
but as noted in comment next68k/pmap_bootstrap.c is based on
the mvme68k one which has been fixed by the similar diff.
Should be pulled up to all netbsd-6 branches.
 1.43.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.43.6.1 05-Feb-2017  skrll Sync with HEAD
 1.44.46.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.44.46.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #77):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.44.20.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.44.20.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1590):

sys/arch/next68k/include/vmparam.h: revision 1.29
sys/arch/next68k/next68k/machdep.c: revision 1.118
sys/arch/next68k/include/param.h: revision 1.13
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.45
sys/arch/next68k/next68k/locore.s: revision 1.70
sys/arch/next68k/next68k/locore.s: revision 1.71

Use explicit CPU strings and remove hp300 derived stuff.

Remove #ifdef'ed out hp300 specific stuff.

Remove leftover "last kernel PT page" settings derived from hp300.

Whilehere, also remove VM definitions for obsolete COMPAT_HPUX stuff.

All hp300 machines has RAMs at a region from the highest address
i.e. 0xFFFFFFFF to smaller address (as HP claims "it's the MSB first"),
so kernels have to prepare PA==KVA mappings as the "last PT page" to
guarantee the running kernel works both before and after the MMU is
turned on. For such a special mapping, we have to set up necessary
segment table and page table during early startup, in pmap_bootstrap()
invoked from locore.s.

On the other hand, NeXT machines have RAMs at a region from 0x40000000
to below (i.e. to larger address) so we still need a PA==KVA mapping.
However currently NetBSD/next68k just uses the transparent translation
registers to achieve the PA==KVA mapping, so unlike hp300 we don't have
to prepare special segment table and page table for it.

Note many other m68k ports (like luna68k, news68k, x68k etc.) have
RAMs at a region from 0x00000000 so usually we can assume PA==KVA
and don't have to bother to prepare such speicial mappings.

No user visible changes (except now freed wasted pages for the tables).

Tested on my NeXTstation slab.
 1.4 14-Nov-2004  christos Delete empty function.
 1.3 15-Jul-2003  lukem __KERNEL_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:22:52 +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.21 07-Sep-2025  thorpej Remove unnecessary NULL-initialization of TODR handle fields.
 1.20 19-Oct-2023  andvar Fix printf specifier for tvp->tv_sec from 0x%08x to 0x%08llx.
Remove printf secs argument for "Regs after:" printout, none expected.
Remove "Setting RTC to 0x%08x." and non existing secs arg from settime_old().
Code was changed with rev. 1.14 without fully adjusting DEBUG code.

Fixes RTC_DEBUG build for next68k.
 1.19 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.18 20-Nov-2014  christos use the inline bcdtobin and bintobcd directly instead through a macro.
 1.17 24-Mar-2014  christos - use cpu_{g,s}etmodel
- fix unused
 1.16 24-Mar-2014  christos fix typo.
 1.15 12-Dec-2009  tsutsui branches: 1.15.12; 1.15.22; 1.15.26;
Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
 1.14 11-Sep-2006  gdamore branches: 1.14.58;
Convert next68k to generic-todr and timecounter.
Tested by bouyer@.
 1.13 15-Mar-2006  christos branches: 1.13.10;
New patch from Cory Bajus
 1.12 14-Mar-2006  christos Apply patch from Cory Bajus for writing to the RTC
 1.11 08-Mar-2006  christos Fix clock reading problem on turbo nexts and color slabs. First
reported by: Timm Wetzel twetzel at gwdg.de on 2001-06-22, and now
again by: Cory Bajus cbajus at mts.net
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10;
merge ktrace-lwp.
 1.9 19-Jan-2005  chs branches: 1.9.8;
de-__P, remove register, ansify.
 1.8 15-Jul-2003  lukem branches: 1.8.8;
__KERNEL_RCSID()
 1.7 27-Sep-2002  provos branches: 1.7.6;
remove trailing \n in panic(). approved perry.
 1.6 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.5 13-May-2001  chs branches: 1.5.2; 1.5.8;
turn on printf format-string checking and -Werror. fix all warnings.
 1.4 29-May-2000  deberg branches: 1.4.4;
prototype rtc stuff used elsewhere
 1.3 31-Jan-1999  dbj branches: 1.3.8; 1.3.16;
Added support for setting boothowto from boot loader flags.
print out string of `.' when powering down to work around ununderstood
behavior of rtc chip.
 1.2 27-Jan-1999  dbj Finished the setting of the system date from the rtc.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.3.16.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 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 21-Jun-2001  nathanw Catch up to -current.
 1.5.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.5.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.5.8.1 13-May-2001  nathanw file rtc.c was added on branch nathanw_sa on 2002-09-17 21:16:44 +0000
 1.5.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.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.8.8.1 29-Apr-2005  kent sync with -current
 1.9.8.2 30-Dec-2006  yamt sync with head.
 1.9.8.1 21-Jun-2006  yamt sync with head.
 1.10.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.10.8.3 14-Sep-2006  yamt sync with head.
 1.10.8.2 01-Apr-2006  yamt sync with head.
 1.10.8.1 13-Mar-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.13.10.1 18-Nov-2006  ad Sync with head.
 1.14.58.1 11-Mar-2010  yamt sync with head
 1.15.26.1 18-May-2014  rmind sync with head
 1.15.22.2 03-Dec-2017  jdolecek update from HEAD
 1.15.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 11-Sep-2006  gdamore branches: 1.4.54; 1.4.56; 1.4.58;
Convert next68k to generic-todr and timecounter.
Tested by bouyer@.
 1.3 19-Jan-2005  chs branches: 1.3.8; 1.3.24; 1.3.36;
de-__P, remove register, ansify.
 1.2 13-May-2001  chs branches: 1.2.8; 1.2.24; 1.2.32;
turn on printf format-string checking and -Werror. fix all warnings.
 1.1 29-May-2000  deberg branches: 1.1.4; 1.1.6; 1.1.8;
prototype rtc stuff used elsewhere
 1.1.8.1 21-Jun-2001  nathanw Catch up to -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 29-May-2000  bouyer file rtc.h was added on branch thorpej_scsipi on 2000-11-20 20:18:20 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 29-May-2000  minoura file rtc.h was added on branch minoura-xpg4dl on 2000-06-22 17:02:03 +0000
 1.2.32.1 29-Apr-2005  kent sync with -current
 1.2.24.1 24-Jan-2005  skrll Sync with HEAD.
 1.2.8.2 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.2.8.1 13-May-2001  chs file rtc.h was added on branch nathanw_sa on 2001-05-13 16:55:41 +0000
 1.3.36.1 18-Nov-2006  ad Sync with head.
 1.3.24.1 14-Sep-2006  yamt sync with head.
 1.3.8.1 30-Dec-2006  yamt sync with head.
 1.4.58.1 16-May-2008  yamt sync with head.
 1.4.56.1 18-May-2008  yamt sync with head.
 1.4.54.1 02-Jun-2008  mjf Sync with HEAD.
 1.7 05-Dec-2021  msaitoh s/from from/from/ in comment.
 1.6 23-Oct-2009  snj Drop 3rd and 4th clauses. Approved by scw (copyright holder).
 1.5 10-Nov-1998  dbj branches: 1.5.150;
Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.4 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.3 04-Aug-1998  dbj Fixed memory probe for color turbo machines.
 1.2 04-Jul-1998  dbj Fixed pre-MMU rom console printing.
Fixed probing of the segment list on color NeXT's.
Added some debug messages on console as it reads the hardware config.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.5.150.1 11-Mar-2010  yamt sync with head
 1.2 17-May-2002  jdolecek make kgdb buildable again, g/c next68k/stub.c
Changes by Christian Limpach in kern/16794, with some minor adjustment
by me.
 1.1 14-Dec-1999  dbj branches: 1.1.2; 1.1.8; 1.1.12; 1.1.16; 1.1.24;
add files needed to use KGDB as suggested by Christian Limpach <chris@Nice.CH>
 1.1.24.1 30-May-2002  gehenna Catch up with -current.
 1.1.16.1 20-Jun-2002  nathanw Catch up to -current.
 1.1.12.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.8.1 14-Dec-1999  bouyer file stub.c was added on branch thorpej_scsipi on 2000-11-20 20:18:20 +0000
 1.1.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.14 03-Nov-2002  chs use a merged sys_machdep.c for all the motorola-MMU m68k platforms.
 1.13 13-May-2001  chs branches: 1.13.8;
turn on printf format-string checking and -Werror. fix all warnings.
 1.12 13-Dec-2000  jdolecek branches: 1.12.2;
g/c obsolete vtrace(2) stuff
 1.11 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.10 28-Nov-1999  is Fix typo (&& -> &).
 1.9 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.8 08-Jul-1999  thorpej branches: 1.8.2; 1.8.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.7 26-Feb-1999  is branches: 1.7.2; 1.7.4;
synchronize types, and s/curproc/p/ in one forgotten place
 1.6 26-Feb-1999  is next68k specific part of PR 6152 fix
 1.5 19-Jan-1999  thorpej No need for <sys/mtio.h>
 1.4 13-Jan-1999  abs Change 'from from' to 'from' in some comments
 1.3 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.2 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.7.4.1 02-Aug-1999  thorpej Update from trunk.
 1.7.2.2 29-Nov-1999  he Pull up revision 1.10 (requested by is):
Fix a typo which caused excessive cache flushes.
 1.7.2.1 27-Nov-1999  he Pull up revision 1.9 (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.8.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.8.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 21-Jun-2001  nathanw Catch up to -current.
 1.13.8.5 11-Nov-2002  nathanw Catch up to -current
 1.13.8.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.13.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.13.8.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.13.8.1 13-May-2001  scw file sys_machdep.c was added on branch nathanw_sa on 2001-11-18 18:43:08 +0000
 1.97 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.96 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.95 16-Jan-2024  thorpej Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.
 1.94 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.93 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.92 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.91 21-Nov-2019  ad mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.
 1.90 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.89 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.88 04-Mar-2015  martin branches: 1.88.18;
Handle EINVAL in the fault path and send SIGBUS on mmap'd access past EOF
 1.87 24-Mar-2014  christos branches: 1.87.6;
- use cpu_{g,s}etmodel
- fix unused
 1.86 24-Mar-2014  christos fix typo.
 1.85 19-Feb-2012  rmind branches: 1.85.2; 1.85.4;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.84 08-Feb-2011  rmind branches: 1.84.4; 1.84.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.83 17-Jan-2011  tsutsui branches: 1.83.2;
Explicitly include <machine/pcb.h> for struct pcb.
 1.82 20-Dec-2010  matt branches: 1.82.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.81 07-Jul-2010  chs implement ucas_* for m68k.
 1.80 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.79 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.78 23-Nov-2009  rmind branches: 1.78.2; 1.78.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.77 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.76 18-Mar-2009  cegger bcopy -> memcpy
 1.75 27-Jan-2009  martin branches: 1.75.2;
Centralize fpu exception to siginfo code encoding for all m68k archs,
fixes a failure in the lib/libc/ieeefp/except regression test.
 1.74 15-Oct-2008  wrstuden branches: 1.74.2; 1.74.4;
Merge wrstuden-revivesa into HEAD.
 1.73 24-Apr-2008  ad branches: 1.73.2; 1.73.4; 1.73.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.72 31-Dec-2007  ad branches: 1.72.6; 1.72.8;
Remove COMPAT_HPUX.
 1.71 03-Dec-2007  ad branches: 1.71.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.70 05-Nov-2007  ad branches: 1.70.2;
Don't set l_usrpri / spc_curpriority here. mi_userret() does it.
 1.69 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.68 01-Sep-2007  mhitch branches: 1.68.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.67 12-Jun-2007  mhitch branches: 1.67.4; 1.67.8; 1.67.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.66 21-May-2007  tsutsui Adapt rest of m68k ports to yamt-idlelwp. Compile tested only.
 1.65 08-Mar-2007  tsutsui branches: 1.65.2; 1.65.4; 1.65.10;
MI softintr(9)'fy. Tested by bouyer@.
See also:
http://mail-index.netbsd.org/port-next68k/2007/03/06/0000.html
 1.64 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.63 28-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.62 09-Feb-2007  ad branches: 1.62.2;
Merge newlock2 to head.
 1.61 23-Jul-2006  ad branches: 1.61.4; 1.61.8; 1.61.10;
Use the LWP cached credentials where sane.
 1.60 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.59 15-May-2006  yamt include kauth.h for kauth_cred_geteuid.
 1.58 14-May-2006  elad integrate kauth.
 1.57 15-Mar-2006  drochner branches: 1.57.2;
adapt to uvm_fault() interface cleanup: kill the useless 3rd argument
 1.56 25-Feb-2006  wiz branches: 1.56.2; 1.56.4;
Fix some typos.
 1.55 11-Dec-2005  christos branches: 1.55.2; 1.55.4; 1.55.6;
merge ktrace-lwp.
 1.54 05-Jun-2005  he branches: 1.54.2;
Adapt to -Wcast-qual by adding a few consts.
 1.53 19-Jan-2005  chs de-__P, remove register, ansify.
 1.52 28-Aug-2004  jdolecek branches: 1.52.4;
use uvm_grow() to update stack segment size on stack page fault instead
of MD code
 1.51 16-May-2004  wiz "panicking" needs a k.
 1.50 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.49 08-Nov-2003  tsutsui Remove obsolete comments about curproc.
 1.48 02-Nov-2003  cl Extend the #ifdef M68040 so that the `sig' variable declaration is moved
in as well, as it's otherwise not used. (from atari/atari/trap.c and
x68k/x68k/trap.c)
 1.47 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.46 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.45 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.44 17-Sep-2003  cl add MD part of SA/pthread pagefault handling on all m68k ports
 1.43 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.42 15-Jul-2003  lukem __KERNEL_RCSID()
 1.41 02-Apr-2003  thorpej branches: 1.41.2;
Use PAGE_SIZE rather than NBPG.
 1.40 28-Jan-2003  wiz success, not sucess. Noted by mjl.
 1.39 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.38 11-Sep-2002  mycroft branches: 1.38.2;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.37 17-May-2002  jdolecek make kgdb buildable again, g/c next68k/stub.c
Changes by Christian Limpach in kern/16794, with some minor adjustment
by me.
 1.36 14-Feb-2002  chs branches: 1.36.8;
allow writing to write-only mappings. fixes PR 3493.
 1.35 10-Sep-2001  chris branches: 1.35.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.34 02-Jun-2001  chs branches: 1.34.2; 1.34.4;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.33 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.32 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.31 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.30 15-Jan-2001  thorpej branches: 1.30.2;
Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.29 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.28 19-Dec-2000  scw Unification of the m68k syscall() function.
 1.27 21-Nov-2000  tsutsui s/struct const sysent/const struct sysent/

(BTW, luna68k was missed in emul/execsw changes?)
 1.26 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.25 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.24 27-Jun-2000  mrg remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h>
 1.23 06-Jun-2000  soren defopt SYSCALL_DEBUG.
 1.22 27-May-2000  sommerfeld branches: 1.22.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.21 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.20 24-May-2000  thorpej Use preempt(), not an open-coded equivalent (which won't be
equivalent for long).
 1.19 05-Dec-1999  ragge clrnd()/clbase() discarding.
 1.18 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.17 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.16 04-Aug-1999  dbj branches: 1.16.2; 1.16.4; 1.16.6;
sync with mvme68k/mvme68k/trap.c:1.32
 1.15 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.14 27-Mar-1999  dbj branches: 1.14.4;
added kgdb support.
 1.13 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.12 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.11 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.10 13-Jan-1999  abs Change 'from from' to 'from' in some comments
 1.9 15-Dec-1998  itohy Added COMPAT_LINUX support.
 1.8 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.7 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.6 01-Oct-1998  thorpej Adapt to signal changes.
 1.5 04-Jul-1998  jonathan defopt DDB.
 1.4 25-Jun-1998  thorpej defopt COMPAT_HPUX
 1.3 25-Jun-1998  thorpej defopt COMPAT_SUNOS
 1.2 25-Jun-1998  thorpej defopt KTRACE
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.14.4.1 02-Aug-1999  thorpej Update from trunk.
 1.16.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.16.4.1 15-Nov-1999  fvdl Sync with -current
 1.16.2.6 27-Mar-2001  bouyer Sync with HEAD.
 1.16.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.16.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.16.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.16.2.2 22-Nov-2000  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.22.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.30.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.30.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.34.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.34.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.34.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.34.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.34.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.35.4.11 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.35.4.10 26-Sep-2002  nathanw Change "if (l->l_flag & L_SA_UPCALL)" to "while (l->l_flag & L_SA_UPCALL)"
in userret() functions or equivalent, to permit delivery of multiple upcalls
in a single kernel entry.

XXX It's getting crowded in here. Collapsing posting signals, upcalls, and
XXX kernel-exit handling into one mechanism would be nice.
 1.35.4.9 17-Sep-2002  nathanw Catch up to -current.
 1.35.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.35.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.35.4.6 20-Jun-2002  nathanw Catch up to -current.
 1.35.4.5 28-Feb-2002  nathanw Catch up to -current.
 1.35.4.4 17-Dec-2001  nathanw cpu_upcall() -> sa_upcall_userret().
 1.35.4.3 25-Nov-2001  scw Deal with `want_resched' with trap()'s T_ASTFLT case where it belongs
instead of in userret().
 1.35.4.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.35.4.1 10-Sep-2001  scw file trap.c was added on branch nathanw_sa on 2001-11-18 18:43:08 +0000
 1.36.8.1 30-May-2002  gehenna Catch up with -current.
 1.38.2.1 18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.41.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.41.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.41.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.41.2.2 03-Sep-2004  skrll Sync with HEAD
 1.41.2.1 03-Aug-2004  skrll Sync with HEAD
 1.52.4.1 29-Apr-2005  kent sync with -current
 1.54.2.7 21-Jan-2008  yamt sync with head
 1.54.2.6 07-Dec-2007  yamt sync with head
 1.54.2.5 15-Nov-2007  yamt sync with head.
 1.54.2.4 03-Sep-2007  yamt sync with head.
 1.54.2.3 26-Feb-2007  yamt sync with head.
 1.54.2.2 30-Dec-2006  yamt sync with head.
 1.54.2.1 21-Jun-2006  yamt sync with head.
 1.55.6.2 01-Jun-2006  kardel Sync with head.
 1.55.6.1 22-Apr-2006  simonb Sync with head.
 1.55.4.1 09-Sep-2006  rpaulo sync with head
 1.55.2.1 01-Mar-2006  yamt sync with head.
 1.56.4.2 19-Apr-2006  elad sync with head - hopefully this will work
 1.56.4.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.56.2.3 11-Aug-2006  yamt sync with head
 1.56.2.2 24-May-2006  yamt sync with head.
 1.56.2.1 01-Apr-2006  yamt sync with head.
 1.57.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.61.10.2 23-Sep-2007  wrstuden Sync with somewhat-recent netbsd-4.
 1.61.10.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.61.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.61.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.61.4.2 06-Feb-2007  ad Update m68k pasteware.
 1.61.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.62.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.65.10.3 03-Oct-2007  garbled Sync with HEAD
 1.65.10.2 26-Jun-2007  garbled Sync with HEAD.
 1.65.10.1 22-May-2007  matt Update to HEAD.
 1.65.4.1 11-Jul-2007  mjf Sync with head.
 1.65.2.4 03-Dec-2007  ad Sync with HEAD.
 1.65.2.3 09-Oct-2007  ad Sync with head.
 1.65.2.2 15-Jul-2007  ad Sync with head.
 1.65.2.1 27-May-2007  ad Sync with head.
 1.67.10.2 09-Jan-2008  matt sync with HEAD
 1.67.10.1 06-Nov-2007  matt sync with HEAD
 1.67.8.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.67.8.2 06-Nov-2007  joerg Sync with HEAD.
 1.67.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.67.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.68.4.1 13-Nov-2007  bouyer Sync with HEAD
 1.70.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.70.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.71.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.72.8.1 18-May-2008  yamt sync with head.
 1.72.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.72.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.73.8.1 19-Oct-2008  haad Sync with HEAD.
 1.73.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.73.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.73.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.73.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.73.2.3 11-Aug-2010  yamt sync with head.
 1.73.2.2 11-Mar-2010  yamt sync with head
 1.73.2.1 04-May-2009  yamt sync with head.
 1.74.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.74.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.74.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.75.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.78.4.3 05-Mar-2011  rmind sync with head
 1.78.4.2 03-Jul-2010  rmind sync with head
 1.78.4.1 30-May-2010  rmind sync with head
 1.78.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.78.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.82.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.83.2.1 17-Feb-2011  bouyer Sync with HEAD
 1.84.8.1 24-Feb-2012  mrg sync to -current.
 1.84.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.84.4.1 17-Apr-2012  yamt sync with head
 1.85.4.1 18-May-2014  rmind sync with head
 1.85.2.2 03-Dec-2017  jdolecek update from HEAD
 1.85.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.87.6.1 06-Apr-2015  skrll Sync with HEAD
 1.88.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.88.18.1 10-Jun-2019  christos Sync with HEAD
 1.14 13-Jan-2024  thorpej Switch next68k over to the common m68k vector table.
 1.13 03-Feb-2023  tsutsui Misc KNF and cosmetics.
 1.12 05-Dec-2021  msaitoh s/from from/from/ in comment.
 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 11-Dec-2005  christos branches: 1.10.100; 1.10.106; 1.10.108;
merge ktrace-lwp.
 1.9 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.8 11-Sep-2002  mycroft branches: 1.8.6;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.7 12-May-2001  chs branches: 1.7.2; 1.7.8;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.6 19-Nov-1998  dbj branches: 1.6.22;
Removed unused buserr and addrerr declarations.
 1.5 10-Nov-1998  dbj Sync'ed more files and routines with mvme port in prepartion for UVM.
Now use generic m68k cachops everywhere rather than defining them in locore.s
 1.4 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.3 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.2 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.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.6.22.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.7.8.1 12-May-2001  nathanw file vectors.s was added on branch nathanw_sa on 2002-09-17 21:16:45 +0000
 1.7.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.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.10.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.10.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.100.1 05-Mar-2011  rmind sync with head
 1.28 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.27 04-Mar-2002  simonb Don't need to declare phys_map - it is declared in <uvm/uvm_extern.h>.
 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 19-Aug-2001  chs branches: 1.25.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.24 02-Jun-2001  chs branches: 1.24.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.23 28-May-2001  chs in pagemove(), use pmap_k{enter_pa,remove} instead of pmap_{enter,remove}
since buffer cache pages aren't really managed by UVM.
 1.22 13-May-2001  chs turn on printf format-string checking and -Werror. fix all warnings.
 1.21 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.20 11-Jan-2001  scw branches: 1.20.2;
g/c the HP/UX core-dump code; it references a function which no longer exists.
 1.19 29-Jun-2000  mrg 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 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.16 20-Jan-2000  sommerfeld branches: 1.16.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.15 04-Dec-1999  ragge CL* discarding.
 1.14 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.13 08-Jul-1999  thorpej branches: 1.13.2; 1.13.4; 1.13.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.12 26-May-1999  thorpej Generally update the comment above vunmapbuf().
 1.11 26-May-1999  thorpej Generally update the comment above the vmapbuf() implementations.
 1.10 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.9 26-Mar-1999  mycroft branches: 1.9.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.8 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.7 13-Jan-1999  abs Change 'from from' to 'from' in some comments
 1.6 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.5 09-Sep-1998  thorpej In cpu_coredump(), use MID_MACHINE rather than MID_* (whatever it expands
to).
 1.4 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.3 28-Aug-1998  dbj Updated many of the pmap files to use current versions from the
mvme68k port. The next68k port now uses MACHINE_NEW_NONCONTIG.
 1.2 28-Jul-1998  thorpej Don't cast the null residual pointer passed to vn_rdwr().
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.9.4.2 02-Aug-1999  thorpej Update from trunk.
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.13.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.13.4.1 15-Nov-1999  fvdl Sync with -current
 1.13.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.13.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.16.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.20.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.24.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.24.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.24.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.25.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.26.4.7 11-Nov-2002  nathanw Catch up to -current
 1.26.4.6 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.26.4.5 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.26.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.26.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.26.4.2 18-Nov-2001  scw MD Scheduler Activation bits for Next68k.
Compile-tested only.
 1.26.4.1 10-Sep-2001  scw file vm_machdep.c was added on branch nathanw_sa on 2001-11-18 18:43:08 +0000
 1.2 21-Nov-2000  soren Remove obsolete comment.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.14;
Initial import of NetBSD/next68k.
 1.1.1.1.14.1 22-Nov-2000  bouyer Sync with HEAD.
 1.31 09-Feb-2023  tsutsui Disable DEBUG options properly.
 1.30 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.29 08-Apr-2017  christos branches: 1.29.18; 1.29.44;
centralize vers.c building for standalone programs.
 1.28 12-Jan-2014  tsutsui branches: 1.28.6; 1.28.10; 1.28.14;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.27 21-Aug-2013  matt Use <bsd.klinks.mk>
Add ${_MKTARGET_LINK}
 1.26 05-Nov-2012  apb branches: 1.26.2;
Revert previous. This boot loader has its own version number,
independent of the kernel version.
 1.25 04-Nov-2012  apb Add references to ${_NETBSD_VERSION_DEPENDS} for files that
need to be re-created when the NetBSD version changes. They
will also be re-created when any build settings are changed.
 1.24 22-Jan-2011  joerg branches: 1.24.4; 1.24.14;
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.23 29-Dec-2009  elad branches: 1.23.4; 1.23.6; 1.23.8;
Don't abuse INSECURE for allowing exec() to load files not owned by uid 0.

Adjust references where this has been used.
 1.22 12-Jan-2009  tsutsui - WARNSfy
- make sure machine and ${MACHINE_ARCH} symlinks are always created
- add incpath to AFLAGS too for build without DESTDIR
 1.21 19-Oct-2008  apb branches: 1.21.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.20 11-Dec-2005  christos branches: 1.20.74; 1.20.78; 1.20.84;
merge ktrace-lwp.
 1.19 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.18 08-Oct-2003  simonb Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
 1.17 10-Jul-2003  lukem NOxxx= variables should appear first
 1.16 11-Sep-2002  mycroft branches: 1.16.6;
Determine turbo-ness based on the ROM machine type here, too.
 1.15 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.14 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.13 12-May-2002  jdolecek branches: 1.13.2;
don't strip the resulting bootprog on install; it's raw binary
XXX I hope this is correct way to do this
 1.12 08-May-2002  jdolecek use ${.OBJDIR} rather than ${.CURDIR}/obj.${MACHINE} (eek)
g/c -I${.CURDIR} and -I${S}/lib/libkern from ${INCLUDES}
build libsa dev_net.c via .PATH and SRCS rather than special rules
 1.11 07-May-2002  jdolecek add -ffreestanding to CFLAGS, so that this wouldn't attempt to link in libc(ugh)
g/c the -Wno-main and HAVE_GCC28 stuff
make the machine symlinks via common .BEGIN cookie, so that they would
be properly setup for 'depend' or 'dependall' targets too; g/c the limits.h
symlink, which doesn't seem to be needed
 1.10 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.9 12-May-2001  chs branches: 1.9.2; 1.9.8;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.8 21-Jul-2000  jdolecek branches: 1.8.2;
do bootblock versioning standard way via sys/conf/newvers_stand.sh, keep what
was previously called "subversion" as "build", remove old cruft from newvers.sh

XXX very lighly tested build on NetBSD/hp300 1.4.1, though could not do full
XXX build due to toolchain differences to -current
 1.7 26-Mar-1999  dbj branches: 1.7.8;
tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.6 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.5 14-Sep-1998  tv Use WARNS=1 to get -Wall, and properly disable -Wmain on gcc 2.8
 1.4 28-Aug-1998  dbj added -Wno-main if USE_EGCS is defined
 1.3 19-Jul-1998  dbj Commented out some bus_dma code, until I can fix.
(bus_dma.c needs sync with alpha port!)
Continued progress on scsi driver.
A couple of other compiler warning level of tweaks.
 1.2 07-Jul-1998  dbj Removed unnecessary bug-workaround headers.
Minor compilation and header tweak.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 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.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.9.8.5 17-Sep-2002  nathanw Catch up to -current.
 1.9.8.4 01-Aug-2002  nathanw Catch up to -current.
 1.9.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.9.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.9.8.1 12-May-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:26:59 +0000
 1.9.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.9.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.2.1 16-Jul-2002  gehenna catch up with -current.
 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.20.84.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.20.78.2 11-Mar-2010  yamt sync with head
 1.20.78.1 04-May-2009  yamt sync with head.
 1.20.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.21.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.23.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.23.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.23.4.1 05-Mar-2011  rmind sync with head
 1.24.14.3 03-Dec-2017  jdolecek update from HEAD
 1.24.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.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.2.2 18-May-2014  rmind sync with head
 1.26.2.1 28-Aug-2013  rmind sync with head
 1.28.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.28.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.28.6.1 28-Aug-2017  skrll Sync with HEAD
 1.29.44.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.29.18.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.2 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.242; 1.1.1.1.268;
Initial import of NetBSD/next68k.
 1.1.1.1.268.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.1.1.1.242.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.15 12-Feb-2023  tsutsui Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.
Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.
 1.14 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.13 11-Feb-2023  tsutsui Add and check machine type NeXT_CUBE_TURBO (type 8).

Info from Andreas Grabher on port-next68k@.
 1.12 11-Jun-2016  dholland branches: 1.12.22; 1.12.48;
PR 51200 gets in libsa considered harmful: use kgets
 1.11 25-Mar-2014  christos branches: 1.11.6;
kill sprintf
 1.10 11-Dec-2005  christos branches: 1.10.112; 1.10.122; 1.10.128;
merge ktrace-lwp.
 1.9 19-Jan-2005  chs de-__P, remove register, ansify.
 1.8 23-Oct-2003  cl branches: 1.8.8;
Fix NULL change lossage.
 1.7 11-Sep-2002  mycroft branches: 1.7.6;
Determine turbo-ness based on the ROM machine type here, too.
 1.6 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.5 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.4 12-May-2001  chs branches: 1.4.2; 1.4.8; 1.4.16;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.3 21-Jul-2000  jdolecek branches: 1.3.2;
do bootblock versioning standard way via sys/conf/newvers_stand.sh, keep what
was previously called "subversion" as "build", remove old cruft from newvers.sh

XXX very lighly tested build on NetBSD/hp300 1.4.1, though could not do full
XXX build due to toolchain differences to -current
 1.2 07-Jul-1998  dbj branches: 1.2.14;
Removed unnecessary bug-workaround headers.
Minor compilation and header tweak.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.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.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.16.1 16-Jul-2002  gehenna catch up with -current.
 1.4.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.4.8.2 01-Aug-2002  nathanw Catch up to -current.
 1.4.8.1 12-May-2001  nathanw file boot.c was added on branch nathanw_sa on 2002-08-01 02:42:52 +0000
 1.4.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.4.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 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.8.8.1 29-Apr-2005  kent sync with -current
 1.10.128.1 18-May-2014  rmind sync with head
 1.10.122.2 03-Dec-2017  jdolecek update from HEAD
 1.10.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.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.11.6.1 09-Jul-2016  skrll Sync with HEAD
 1.12.48.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.12.48.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.12.22.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.12.22.1 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.8 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.7 11-Dec-2005  christos branches: 1.7.170; 1.7.196;
merge ktrace-lwp.
 1.6 23-Jun-2005  junyoung Use FS_OPS() macro.
 1.5 19-Jan-2005  chs 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 13-Mar-2003  drochner branches: 1.3.2;
cope with removal of this sick NENTS macro from libsa/netif.h
 1.2 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.28; 1.1.1.1.32; 1.1.1.1.40;
Initial import of NetBSD/next68k.
 1.1.1.1.40.1 16-Jul-2002  gehenna catch up with -current.
 1.1.1.1.32.1 01-Aug-2002  nathanw Catch up to -current.
 1.1.1.1.28.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.4 24-Jan-2005  skrll Sync with HEAD.
 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.8.1 29-Apr-2005  kent sync with -current
 1.7.196.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.7.170.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.2 26-Mar-1999  dbj tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2 26-Mar-1999  dbj tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.8 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.7 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.6 10-Aug-2014  isaki branches: 1.6.32; 1.6.58;
Unify all arch/*/stand's atoi() to MI libsa.
lib/libsa/atoi.c was separated from lib/libsa/bootcfg.c.
PR/49084
 1.5 11-Dec-2005  christos branches: 1.5.122;
merge ktrace-lwp.
 1.4 17-Apr-2005  christos PR/21172: Christian Biere: ctype function misuse.
 1.3 19-Jan-2005  chs de-__P, remove register, ansify.
 1.2 26-Mar-1999  dbj branches: 1.2.42; 1.2.50;
tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.50.1 29-Apr-2005  kent sync with -current
 1.2.42.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.42.1 24-Jan-2005  skrll Sync with HEAD.
 1.5.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.58.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.6.58.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.6.32.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.6.32.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.4 07-Feb-2023  tsutsui Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.
Should be pulled up to netbsd-10 and netbsd-9.
 1.3 11-Sep-2002  mycroft branches: 1.3.202; 1.3.228;
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.2 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.28; 1.1.1.1.32; 1.1.1.1.40;
Initial import of NetBSD/next68k.
 1.1.1.1.40.1 16-Jul-2002  gehenna catch up with -current.
 1.1.1.1.32.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.1.1.32.1 01-Aug-2002  nathanw Catch up to -current.
 1.1.1.1.28.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.1.1.28.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.228.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.3.202.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.20 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.19 08-Mar-2018  mrg branches: 1.19.6; 1.19.32;
fix various gcc6 m68k issues:
- bad indentation. next68k en.c and mvme68k le_poll.c fixes real issues
in error handling, the rest are NFCI.
- pass 68030 flags as appropriate for mvme68k.
- next68k nextrom.c has -Warray-bounds ignored for an odd expression
that appears to run before relocation, and needs manual offsets
added which trips bounds array checking.

with this all m68k ports build with GCC 6.
 1.18 23-Jan-2015  chs branches: 1.18.16;
fix build with gcc48.
 1.17 26-Oct-2009  cegger branches: 1.17.22; 1.17.38; 1.17.40;
kill extra whitespaces
reviewed by tsutsui@
 1.16 18-Mar-2009  cegger bcopy -> memcpy
 1.15 12-Jan-2009  tsutsui branches: 1.15.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.14 11-Dec-2005  christos branches: 1.14.74; 1.14.78; 1.14.86;
merge ktrace-lwp.
 1.13 28-Jun-2005  junyoung Cosmetic changes, notably drop trailing spaces.
 1.12 17-May-2005  christos Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
 1.11 19-Jan-2005  chs de-__P, remove register, ansify.
 1.10 03-May-2003  wiz branches: 1.10.2; 1.10.10;
DMA, not dma nor Dma.
 1.9 13-Mar-2003  drochner cope with removal of this sick NENTS macro from libsa/netif.h
 1.8 11-Sep-2002  mycroft Don't blindly receive all multicast packets just because we're on a turbo.
Pay lip service to making promiscuous mode work.
 1.7 11-Sep-2002  mycroft In en_put(), if we don't get a packet, just return 0. This is how we tell
the libsa code to retransmit.
 1.6 11-Sep-2002  mycroft Determine turbo-ness based on the ROM machine type here, too.
 1.5 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.4 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.3 07-May-1999  drochner branches: 1.3.16; 1.3.20; 1.3.28;
include <lib/libkern/libkern.h> for intoa()/inet_ntoa()
 1.2 26-Mar-1999  dbj branches: 1.2.4;
tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.28.1 16-Jul-2002  gehenna catch up with -current.
 1.3.20.2 17-Sep-2002  nathanw Catch up to -current.
 1.3.20.1 01-Aug-2002  nathanw Catch up to -current.
 1.3.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.3.16.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.10.10.1 29-Apr-2005  kent sync with -current
 1.10.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.2.1 24-Jan-2005  skrll Sync with HEAD.
 1.14.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.14.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.78.2 11-Mar-2010  yamt sync with head
 1.14.78.1 04-May-2009  yamt sync with head.
 1.14.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.15.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.40.1 06-Apr-2015  skrll Sync with HEAD
 1.17.38.1 04-Feb-2015  snj Pull up following revision(s) (requested by chs in ticket #485):
sys/arch/next68k/stand/boot/en.c: revision 1.18
fix build with gcc48.
 1.17.22.1 03-Dec-2017  jdolecek update from HEAD
 1.18.16.1 15-Mar-2018  pgoyette Synch with HEAD
 1.19.32.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.19.6.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.4 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.3 11-Sep-2002  mycroft branches: 1.3.22; 1.3.60;
Determine turbo-ness based on the ROM machine type here, too.
 1.2 11-Sep-2002  mycroft Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
turbo machines).
* The boot block is prone to timing out.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.28;
Initial import of NetBSD/next68k.
 1.1.1.1.28.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.3.60.1 12-Mar-2007  rmind Sync with HEAD.
 1.3.22.1 03-Sep-2007  yamt sync with head.
 1.2 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.28; 1.1.1.1.32; 1.1.1.1.40;
Initial import of NetBSD/next68k.
 1.1.1.1.40.1 16-Jul-2002  gehenna catch up with -current.
 1.1.1.1.32.1 01-Aug-2002  nathanw Catch up to -current.
 1.1.1.1.28.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.8 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.7 24-Dec-2007  perry branches: 1.7.102; 1.7.128;
Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.6 11-Dec-2005  christos branches: 1.6.50; 1.6.60; 1.6.64;
merge ktrace-lwp.
 1.5 19-Jan-2005  chs branches: 1.5.8;
de-__P, remove register, ansify.
 1.4 11-Jul-2002  christos branches: 1.4.6; 1.4.14;
Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.3 12-May-2001  chs branches: 1.3.2; 1.3.8; 1.3.16;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.2 26-Mar-1999  dbj branches: 1.2.20;
tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.16.1 16-Jul-2002  gehenna catch up with -current.
 1.3.8.2 01-Aug-2002  nathanw Catch up to -current.
 1.3.8.1 12-May-2001  nathanw file machdep.c was added on branch nathanw_sa on 2002-08-01 02:42:52 +0000
 1.3.2.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.14.1 29-Apr-2005  kent sync with -current
 1.4.6.1 24-Jan-2005  skrll Sync with HEAD.
 1.5.8.1 21-Jan-2008  yamt sync with head
 1.6.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.6.60.1 26-Dec-2007  ad Sync with head.
 1.6.50.1 09-Jan-2008  matt sync with HEAD
 1.7.128.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.7.128.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.7.102.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.7.102.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.2 07-Jul-1998  dbj Removed unnecessary bug-workaround headers.
Minor compilation and header tweak.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.3 30-Apr-2008  martin Convert TNF licenses to new 2 clause variant
 1.2 21-Jul-2000  jdolecek branches: 1.2.126; 1.2.128; 1.2.130;
do bootblock versioning standard way via sys/conf/newvers_stand.sh, keep what
was previously called "subversion" as "build", remove old cruft from newvers.sh

XXX very lighly tested build on NetBSD/hp300 1.4.1, though could not do full
XXX build due to toolchain differences to -current
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.14;
Initial import of NetBSD/next68k.
 1.1.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.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.8 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.7 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.6 12-Jan-2009  tsutsui branches: 1.6.70; 1.6.96;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.5 08-Mar-2006  christos branches: 1.5.64; 1.5.68; 1.5.76;
Fix clock reading problem on turbo nexts and color slabs. First
reported by: Timm Wetzel twetzel at gwdg.de on 2001-06-22, and now
again by: Cory Bajus cbajus at mts.net
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8; 1.4.10;
merge ktrace-lwp.
 1.3 19-Jan-2005  chs branches: 1.3.8;
de-__P, remove register, ansify.
 1.2 26-Mar-1999  dbj branches: 1.2.42; 1.2.50;
tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.50.1 29-Apr-2005  kent sync with -current
 1.2.42.1 24-Jan-2005  skrll Sync with HEAD.
 1.3.8.1 21-Jun-2006  yamt sync with head.
 1.4.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.4.8.1 13-Mar-2006  yamt sync with head.
 1.4.6.1 22-Apr-2006  simonb Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.76.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.68.1 04-May-2009  yamt sync with head.
 1.5.64.1 17-Jan-2009  mjf Sync with HEAD.
 1.6.96.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.6.96.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.6.70.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.6.70.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.2 12-Feb-2023  tsutsui branches: 1.2.2; 1.2.4;
Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.
Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.
 1.1 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.2.4.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.2.4.1 12-Feb-2023  martin file samachdep.h was added on branch netbsd-9 on 2023-02-22 12:09:16 +0000
 1.2.2.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.2.2.1 12-Feb-2023  martin file samachdep.h was added on branch netbsd-10 on 2023-02-22 12:07:08 +0000
 1.15 05-Feb-2024  andvar s/bufffer/buffer/ in comments and log message.
 1.14 12-Feb-2023  tsutsui Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.
Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.
 1.13 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.12 09-Feb-2023  tsutsui Disable DEBUG options properly.
 1.11 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.10 30-Mar-2008  he branches: 1.10.96; 1.10.122;
Convert from using bcopy() to memcpy(), so that this builds again.
 1.9 05-Mar-2007  he branches: 1.9.40;
Follow Izumi Tsutsui's advice, and use uint8_t* rather than char*.
 1.8 05-Mar-2007  he Need char* for pointer arithmetic and array indexing.
 1.7 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 03-May-2003  wiz branches: 1.6.18; 1.6.56;
DMA, not dma nor Dma.
 1.5 21-Sep-2002  mycroft Ignore bus exception errors here.
XXX I'm not sure exactly why this is necessary...
 1.4 11-Jul-2002  christos Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.3 07-May-2002  jdolecek branches: 1.3.2;
some esp register names are no longer provided by next68k espreg.h,
use MI <dev/ic/ncr53c9xreg.h> ones
 1.2 26-Mar-1999  dbj branches: 1.2.22; 1.2.26;
tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.26.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.26.2 01-Aug-2002  nathanw Catch up to -current.
 1.2.26.1 20-Jun-2002  nathanw Catch up to -current.
 1.2.22.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.22.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.22.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.1 16-Jul-2002  gehenna catch up with -current.
 1.6.56.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.18.1 03-Sep-2007  yamt sync with head.
 1.9.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.122.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.10.122.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.10.96.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.10.96.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.5 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.4 05-Mar-2007  he branches: 1.4.88;
Follow Izumi Tsutsui's advice, and use uint8_t* rather than char*.
 1.3 05-Mar-2007  he Need char* for pointer arithmetic and array indexing.
 1.2 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.64; 1.1.1.1.102;
Initial import of NetBSD/next68k.
 1.1.1.1.102.1 12-Mar-2007  rmind Sync with HEAD.
 1.1.1.1.64.1 03-Sep-2007  yamt sync with head.
 1.4.88.1 03-Dec-2017  jdolecek update from HEAD
 1.2 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.242; 1.1.1.1.268;
Initial import of NetBSD/next68k.
 1.1.1.1.268.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.1.1.1.242.1 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.17 12-Feb-2023  tsutsui Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.
 1.16 09-Feb-2023  tsutsui Disable DEBUG options properly.
 1.15 09-Feb-2023  tsutsui Request only 36 bytes for a response of INQUIRY command for legacy drives.

Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).

The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator)a on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html
 1.14 09-Feb-2023  tsutsui Avoid possible division by zero trap in error cases to make debug easier.
 1.13 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.12 29-Mar-2014  christos branches: 1.12.34; 1.12.60;
make this compile (missing header file)
 1.11 18-Mar-2009  cegger branches: 1.11.12; 1.11.22; 1.11.26;
bzero -> memset
 1.10 04-Aug-2006  mhitch branches: 1.10.62; 1.10.70; 1.10.76;
gcc4 fix: correct of couple of casting errors picked up by gcc4.
 1.9 25-Jan-2006  christos branches: 1.9.2; 1.9.6;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.8 11-Dec-2005  christos branches: 1.8.2;
merge ktrace-lwp.
 1.7 21-Feb-2005  thorpej branches: 1.7.4;
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.6 07-Dec-2004  thorpej branches: 1.6.2; 1.6.4;
READ_CAPACITY -> READ_CAPACITY_10
 1.5 07-Dec-2004  thorpej USe more appropriate macro/struct names for READ/WRITE (6) and
READ/WRITE (10).
 1.4 27-Oct-2003  cl move structs nextstep_disklabel/cpu_partition and appendant #defines
to sys/sys/bootblock.h
- rename to next68k_disklabel and next68k_partition
- use {u,}int{8,16,32}_t instead of char/short/int (suggested by D. Laight)
 1.3 11-Jul-2002  christos branches: 1.3.6;
Apply patches from Christian Limpach:

- NeXT label reading support
- SCSI dma fixes
- media support for if_xe.c

Some of these need more cleanup, but at least make SCSI support usable on
the NeXT.
 1.2 26-Mar-1999  dbj branches: 1.2.22; 1.2.26; 1.2.34;
tweaks to compile with egcs -Werror
minor changes to scsi driver register accesses.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.2.34.1 16-Jul-2002  gehenna catch up with -current.
 1.2.26.1 01-Aug-2002  nathanw Catch up to -current.
 1.2.22.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.6.4 18-Dec-2004  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.6.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.2.1 29-Apr-2005  kent sync with -current
 1.7.4.2 30-Dec-2006  yamt sync with head.
 1.7.4.1 21-Jun-2006  yamt sync with head.
 1.8.2.1 01-Feb-2006  yamt sync with head.
 1.9.6.1 11-Aug-2006  yamt sync with head
 1.9.2.1 09-Sep-2006  rpaulo sync with head
 1.10.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.10.62.1 04-May-2009  yamt sync with head.
 1.11.26.1 18-May-2014  rmind sync with head
 1.11.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.60.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.12.60.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.12.34.2 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.12.34.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.3 04-Feb-2023  tsutsui Remove trailing spaces and TABs.
 1.2 12-May-2001  chs branches: 1.2.8; 1.2.218; 1.2.244;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj branches: 1.1.1.1.26;
Initial import of NetBSD/next68k.
 1.1.1.1.26.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.244.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.2.218.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.2.8.2 12-May-2001  chs switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.2.8.1 12-May-2001  chs file srt0.s was added on branch nathanw_sa on 2001-05-12 22:35:31 +0000
 1.2 07-Jul-1998  dbj Removed unnecessary bug-workaround headers.
Minor compilation and header tweak.
 1.1 09-Jun-1998  dbj branches: 1.1.1;
Initial revision
 1.1.1.1 09-Jun-1998  dbj Initial import of NetBSD/next68k.
 1.7 12-Feb-2023  tsutsui Actually bump version (missed in the previous commit).
 1.6 11-Feb-2023  tsutsui Bump version again to denote NeXT_CUBE_TURBO support.
 1.5 11-Feb-2023  tsutsui Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.

All these fixes should be pulled up to netbsd-10 and netbsd-9.
 1.4 09-Nov-2001  scw branches: 1.4.2; 1.4.212; 1.4.238;
Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.3 02-Aug-2001  bjh21 branches: 1.3.4;
Bump version numbers of all bootloaders that use loadfile/ELF, to account for
my changes to symbol loading. I should probably have done this at the time,
but it's better late than never.
 1.2 12-May-2001  chs branches: 1.2.2;
switch next68k to ELF. highlight include:
add "%" prefix to register names in assembly code.
change assembly functions to return pointer values in %a0 instead of %d0.
C symbols no longer prepend an underscore, adjust assembly code for this.
32-bit values are now 32-bit aligned instead of 16-bit aligned,
adjust structure packing and padding to override this where necessary.
make EXEC_ELF std, make EXEC_AOUT and COMPAT_AOUT_M68K optional.
use the MI loadfile() instead of several home-grown versions.
 1.1 21-Jul-2000  jdolecek branches: 1.1.2; 1.1.4;
do bootblock versioning standard way via sys/conf/newvers_stand.sh, keep what
was previously called "subversion" as "build", remove old cruft from newvers.sh

XXX very lighly tested build on NetBSD/hp300 1.4.1, though could not do full
XXX build due to toolchain differences to -current
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 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 21-Jul-2000  bouyer file version was added on branch thorpej_scsipi on 2000-11-20 20:18:22 +0000
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 03-Aug-2001  lukem update to -current
 1.3.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.4.238.3 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #90):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.4.238.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #88):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17
sys/arch/next68k/dev/intio.c: revision 1.18
sys/arch/next68k/dev/intio.c: revision 1.19
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.4.238.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #78):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.4.212.3 22-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1600):

sys/arch/next68k/stand/boot/en.c: revision 1.20
sys/arch/next68k/stand/boot/scsi.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.14
sys/arch/next68k/stand/boot/conf.c: revision 1.8
sys/arch/next68k/stand/boot/sd.c: revision 1.17
sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
sys/arch/next68k/stand/boot/rtc.c: revision 1.8
sys/arch/next68k/stand/boot/machdep.c: revision 1.9
sys/arch/next68k/stand/boot/boot.c: revision 1.14
sys/arch/next68k/stand/boot/boot.c: revision 1.15
sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.8
sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
(where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).
 1.4.212.2 15-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1598):

sys/arch/next68k/next68k/nextrom.h: revision 1.13
sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
sys/arch/next68k/dev/intiovar.h: revision 1.8
sys/arch/next68k/dev/nextcons.c: revision 1.12
sys/arch/next68k/next68k/locore.s: revision 1.69
sys/arch/next68k/dev/nextcons.c: revision 1.13
sys/arch/next68k/dev/nextcons.c: revision 1.14
sys/arch/next68k/include/bus_space.h: revision 1.18
sys/arch/next68k/dev/nextdisplay.c: revision 1.30
sys/arch/next68k/include/bus_space.h: revision 1.19
sys/arch/next68k/stand/boot/boot.c: revision 1.13
sys/arch/next68k/next68k/nextrom.c: revision 1.28
sys/arch/next68k/next68k/nextrom.c: revision 1.29
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
sys/arch/next68k/include/cpu.h: revision 1.52
sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
sys/arch/next68k/next68k/locore.s: revision 1.72
sys/arch/next68k/stand/boot/version: revision 1.6
sys/arch/next68k/include/bus_space.h: revision 1.21
sys/arch/next68k/include/bus_space.h: revision 1.22
sys/arch/next68k/dev/nextdisplay.c: revision 1.26
sys/arch/next68k/include/bus_space.h: revision 1.23
sys/arch/next68k/dev/nextdisplay.c: revision 1.27
sys/arch/next68k/dev/nextdisplay.c: revision 1.28
sys/arch/next68k/dev/nextdisplay.c: revision 1.29

s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.
 1.4.212.1 12-Feb-2023  martin Pull up following revision(s) (requested by tsutsui in ticket #1591):

sys/arch/next68k/stand/boot/scsi.c: revision 1.11
sys/arch/next68k/stand/boot/sd.c: revision 1.13
sys/arch/next68k/stand/boot/scsi.c: revision 1.12
sys/arch/next68k/stand/boot/sd.c: revision 1.14
sys/arch/next68k/stand/boot/sd.c: revision 1.15
sys/arch/next68k/stand/boot/sd.c: revision 1.16
sys/arch/next68k/stand/boot/rtc.c: revision 1.7
sys/arch/next68k/stand/boot/dmareg.h: revision 1.4
sys/arch/next68k/stand/boot/machdep.c: revision 1.8
sys/arch/next68k/stand/boot/srt0.s: revision 1.3
sys/arch/next68k/stand/boot/README: revision 1.2
sys/arch/next68k/stand/boot/devopen.c: revision 1.7
sys/arch/next68k/stand/boot/Makefile: revision 1.30
sys/arch/next68k/stand/boot/Makefile: revision 1.31
sys/arch/next68k/stand/boot/version: revision 1.5

Remove trailing spaces and TABs.

Make sure to specify volatile explicitly on DMA register accesses.

It looks booting from SCSI disks on next68k have been broken
since NetBSD 1.6 days, but now it works.

Avoid possible division by zero trap in error cases to make debug easier.

Request only 36 bytes for a response of INQUIRY command for legacy drives.
Some drives don't respond larger requested size for newer
SCSI3 devices and not all drivers can handle short xfers.
We should fix drivers to handle such short xfers properly,
but we need only SCSI device type here (and the 36 bytes are
enough even if we want vendor and product names on a bootloader).
The problem is reported from Andreas Grabher (a maintainer of NeXT
Computer Emulator) on port-next68k@:
https://mail-index.netbsd.org/port-next68k/2023/02/thread1.html

Disable DEBUG options properly.

Bump version to 1.6 to denote recent bootloader's >20 years old bug fixes.
 1.4.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.4.2.1 09-Nov-2001  scw file version was added on branch nathanw_sa on 2001-11-09 19:53:18 +0000

RSS XML Feed