Home | History | Annotate | only in /src/sys/arch/atari
History log of /src/sys/arch/atari
RevisionDateAuthorComments
 1.8 04-Apr-2011  dyoung Fix target 'tags'.
 1.7 25-Oct-2008  apb branches: 1.7.16; 1.7.22;
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 02-Sep-1998  leo branches: 1.5.30;
Reorganize installation if include files. Nuke some from atari/include as
they make no sense out of the kernel add some from atari/dev (ioctl's).
 1.4 12-Jun-1998  cgd Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.3 11-Oct-1997  mycroft Make these closer to working.
 1.2 18-Mar-1996  leo branches: 1.2.12;
Build the 'stand' directory.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.12.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.30.1 07-Jan-2003  thorpej Sync with HEAD.
 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.7.22.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.16.1 21-Apr-2011  rmind sync with head
 1.9 12-Sep-1997  mycroft Nuke Locore.c. It's way too out of date to be useful at this point.
 1.8 03-Jan-1997  leo branches: 1.8.10;
Get rid of 'cpu040' variable. Use 'mmutype' or 'cputype' for testing
instead.
 1.7 06-Nov-1996  cgd Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed. Rename remrq() to
remrunqueue().
 1.6 13-Oct-1996  christos backout previous kprintf changes
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 10-Jun-1996  cgd locc() is unused. Remove it from the machine-independent kernel interface.
 1.3 13-Aug-1995  mycroft Add splsoftnet().
 1.2 14-May-1995  leo Fix double mapping of stack.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.8.10.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.113 10-Feb-2024  andvar Fix various typos in comments, log messages and documentation.
 1.112 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.111 15-Jan-2024  thorpej Guard references to protorp with M68030.
 1.110 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.109 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.108 07-Dec-2023  thorpej extent(9) -> vmem(9)
 1.107 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.106 03-Jul-2022  tsutsui Move the iomem extent stuff managed by bus_space(9) and make them static.

Inspired by MD bus_space(9) implemantation of arc.
Briefly tested on TT030.
 1.105 25-Jun-2022  tsutsui Allocalte enough reserved ST-RAM to make the old Xserver work by default.

Instead, check ST-RAM size and TT-RAM size on startup and restrict
size of reserved ST memory on lower RAM machines.
Closes PR port-atari/41002 from David Ross.

While here, make options ST_POOL_SIZE defparam'ed to make sure to
reflect config(5) changes on each build.
 1.104 24-May-2022  andvar fix various typos in comments, docs and log messages.
 1.103 12-Dec-2021  andvar fix various typos, mainly in comments.
 1.102 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.101 26-Feb-2018  tsutsui branches: 1.101.8;
Add dumb memory probe routines for Milan to use all available memory.

Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)

No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html
 1.100 10-Aug-2012  tsutsui branches: 1.100.32;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)
 1.99 21-Feb-2012  tsutsui Use actual physmem size for allocation of bootstrap extra PT pages
to avoid wasting pages on low memory machines.
Improves atari specific part of PR/45915, tested on TT030.
 1.98 10-Feb-2012  mhitch branches: 1.98.2;
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.97 27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.96 26-Nov-2011  tsutsui branches: 1.96.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.95 02-Jan-2011  tsutsui branches: 1.95.8;
Tidy up common comments. (Yes, too many dup code...)
 1.94 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.93 13-Apr-2010  tsutsui Misc KNF.
 1.92 11-Dec-2009  tsutsui branches: 1.92.2; 1.92.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.91 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.90 06-Dec-2009  tsutsui pm_stfree in struct pmap is a bitmap value so make it unsigned.
 1.89 02-Dec-2009  tsutsui Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on TT030.
 1.88 27-Nov-2009  rmind - Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.
- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places. Reduce sys/user.h inclusions.
 1.87 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.86 23-Aug-2009  mrg fix atari builds in two ways:
- isa_detach_hook() was missing a parameter name (hi dyoung!)
- PCI_CONF_SIZE -> PCI_CONFIG_SIZE; pcivar.h has a PCI_CONF_SIZE now (hi jak!)
 1.85 22-Aug-2009  tsutsui wrap long lines, fix indent.
 1.84 19-Aug-2009  he One more file needing <sys/exec_aout.h>.
 1.83 08-Jul-2009  tsutsui Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.82 07-Jul-2009  tsutsui Explicitly initialize the MFP Timer-B for delay(9) from atari_hwinit()
rather than using if(!atari_realconfig) in clockmatch().
(I doubt the latter one has actually been called..)
 1.81 06-Jul-2009  tsutsui Fix a botch in RELOC_PA() macro introduced in rev 1.80
inside #if defind(M68040) || defined(68060)/#endif block.
Noticed by he@.
 1.80 01-Jul-2009  tsutsui Define and use macro to calculate kernel physical addresses
after relocation to TT RAM. No binary changes.
 1.79 18-Mar-2009  cegger bzero -> memset
 1.78 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.77 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.76 13-Mar-2009  abs Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.
 1.75 05-Mar-2009  tsutsui Some KNF.
 1.74 05-Mar-2009  tsutsui Remove __P().
 1.73 17-Jan-2009  tsutsui branches: 1.73.2;
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.72 04-Jan-2009  tsutsui Use howmany(x, y) rather than roundup(x, y)/y. No binary change.
 1.71 03-Jan-2009  tsutsui Sync with an update on amiga:
Rewrite a weird calculation marked "XXX fix calculations XXX"
for an index value of lev2 segment table for the kernel Sysptmap
with more meaningful expressions and PAGE_SIZE independent macro.
Also use "~0" rather than "-1" for an unsigned bitmap value.

Should produce the same results and no functional change.

Tested on Falcon with 68060 by Tuomo Makinen.
 1.70 02-Jan-2009  tsutsui Update one more comment which was missed in previous.
 1.69 01-Jan-2009  tsutsui Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.68 15-Nov-2008  abs Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
 1.67 04-Mar-2007  christos branches: 1.67.40; 1.67.44; 1.67.50; 1.67.52; 1.67.54;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.66 24-Jan-2007  hubertf branches: 1.66.2;
Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

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

Thanks to martin@ for the input on testing.
 1.65 24-Dec-2005  perry branches: 1.65.20; 1.65.24;
bare asm -> __asm
 1.64 11-Dec-2005  christos merge ktrace-lwp.
 1.63 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.62 04-Jun-2005  he branches: 1.62.2; 1.62.4;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.61 13-Feb-2004  wiz branches: 1.61.14;
Uppercase CPU, plural is CPUs.
 1.60 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.59 15-Jul-2003  lukem __KERNEL_RCSID()
 1.58 23-Jun-2003  martin branches: 1.58.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.57 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.56 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.55 28-May-2001  leo branches: 1.55.8;
PCI_VGA_SIZE -> PCI_MEM_SIZE. (Plus some comments on those constants).
 1.54 14-May-2001  leo Adapt for the Milan.
 1.53 09-Feb-2001  leo branches: 1.53.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.
 1.52 01-Feb-2001  leo No longer update the PAGE_* variables. They have turned into compile time
constants.
 1.51 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.50 29-Jun-2000  leo Get 060 CacheCopyBack support in line with the amiga (and working ;-)
 1.49 27-Jun-2000  mrg remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h>
 1.48 28-Mar-2000  simonb branches: 1.48.4;
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.47 07-Feb-2000  leo Add bootm_init() prototype.
 1.46 06-Dec-1999  leo Implement an allocator for VA-space using fixed extent maps. It is now
possible to allocate VA-space before uvm is initialized.
 1.45 06-Dec-1999  leo Allocate the physical RAM from the extent map.
 1.44 28-Oct-1999  leo Use extent maps.
 1.43 22-Sep-1999  leo branches: 1.43.2; 1.43.4; 1.43.6;
Reverse the order in which PCI cards are scanned. Now the order matches the
TOS-scan order. This causes TOS & NetBSD to use the same video card on
a system with multiple VGA cards.
 1.42 20-Dec-1998  thomas Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.41 20-Nov-1998  leo Make it compile with -DDEBUG again.
 1.40 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.39 04-Jul-1998  jonathan defopt DDB.
 1.38 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.37 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.36 24-Feb-1998  leo Only try to initialize the PCI-bus when NPCI > 0.
 1.35 19-Feb-1998  leo Update Hades PCI support:
- Initialize the PCI bus and hand-out mem and i/o addresses. (there is
still lots of room for improvements here...)
- Implement the interupt functions
 1.34 23-Oct-1997  leo Do not relocate the kernel to TT-Ram by default. Some TT's choke on this. You
can now opt for relocation by either setting the RELOC_KERNEL config option
or patching 'reloc_kernel' to something other than zero.
 1.33 30-Jul-1997  leo branches: 1.33.4;
Use a buserror handler that just tests for 'nofault' being set when the
MMU is not yet initialized. This behaviour is necessary when probing
for the machine type - because we need the type before we can setup the
tables....
 1.32 05-Jul-1997  leo branches: 1.32.2;
Pull in latest Amiga bus/address error handling.
 1.31 10-Jun-1997  veego s/atari_round_page/m68k_round_page/
 1.30 05-Jun-1997  leo * finalize 060 stuff.

For locore.s also nuke cacheop-functions now provided in m68k.
 1.29 09-Apr-1997  thorpej Adjust for new <m68k/kcore.h>
 1.28 10-Mar-1997  leo Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.
 1.27 07-Mar-1997  leo Enable SCC & MFP interrupts through the vme_mask register instead of
using the sys_mask register.
 1.26 21-Jan-1997  leo branches: 1.26.4;
Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.
 1.25 12-Jan-1997  leo branches: 1.25.2;
Fix the machine-type detection, the Falcon was detected as a Hades. Regroup
the hardware initialisations in a separate function and make sure
that the Midi-ACIA is properly initialized. This prevents MIDI traffic
to lockup the keyboard.
 1.24 04-Jan-1997  leo Oops, the declaration of cputype was gone...
 1.23 03-Jan-1997  leo Get rid of 'cpu040' variable. Use 'mmutype' or 'cputype' for testing
instead.
 1.22 26-Dec-1996  leo Add intr_establish/disestablish functions. Currently only the lpt-driver
is converted to use them...
 1.21 15-Oct-1996  leo Initialisation of proc0->p_addr. (Gordon Ross)
This, in conjunction with the trap.c changes, solve the crashes when
referencing illegal addresses in the debugger. Thanks Jason for providing
the trigger and solution ;-)
 1.20 13-Oct-1996  christos backout previous kprintf changes
 1.19 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.18 16-Sep-1996  leo Initialize MFP2 on both TT&HADES.
 1.17 23-Aug-1996  leo - Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.
 1.16 20-Jul-1996  leo Checkpoint integration of 68040 MMU support. Also fix oversight in allocation
of (virtual) I/O area address range.
 1.15 12-Jul-1996  leo - Cleanup a bit
- Remove mapping of page zero
- Remove hackery around the first 8 bytes that were mapped to ROM by hardware
 1.14 26-Apr-1996  leo Corrections for removed <sys/cpu.h> and some more prototypes.
 1.13 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.12 12-Apr-1996  leo Prototyping.
 1.11 27-Mar-1996  leo Take out direct access to the YM2149. The chip definitions are moved
from video.h to ym2149reg.h.
 1.10 10-Mar-1996  leo Add the include files and the atari kernel support for new format panic
dumps.
 1.9 16-Dec-1995  leo Make an NMI activate the debugger. This only works on a TT and needs a small
hardware patch. This makes it easier to debug drivers that hang on an ipl
> splsoft.
 1.8 17-Aug-1995  leo Initialize the YM sound-chip to a sane state.
 1.7 09-Jun-1995  leo Support & require MACHINE_NONCONTIG
 1.6 28-May-1995  leo Make ST_POOL_SIZE configurable through config.
 1.5 14-May-1995  leo Remove double mapping of stack.
 1.4 10-May-1995  leo Added machine type detection, the presence of the 2nd MFP determines
if the machine is a Falcon or a TT030. The type is added to 'machineid'.
Interrupt initialisation is now dependend on the machine type.
 1.3 05-May-1995  leo Report "real mem" correctly and make one single module for handling
software interrupts.
 1.2 28-Apr-1995  leo - Remove cpuspeed
- Remove dead code (stmem_steal())
- Use round_page() on st_pool_size before using. This prevents crashes
when it is 'binpatched' with a value that is not a multiple of the
page size.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.25.2.1 30-Jan-1997  thorpej update from trunk
 1.26.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.32.2.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.33.4.1 23-Oct-1997  mellon Pull rev 1.34 up from trunk
 1.43.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.43.4.1 15-Nov-1999  fvdl Sync with -current
 1.43.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.43.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.48.4.1 06-Jul-2000  leo Pullup: atari_init.c 1.49-1.50, pmap.c 1.56-1.57. Approved by thorpej.

Get 060 CacheCopyBack support in line with the amiga (and working ;-)
 1.53.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.55.8.3 24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.55.8.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.55.8.1 28-May-2001  scw file atari_init.c was added on branch nathanw_sa on 2001-11-17 23:18:02 +0000
 1.58.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.58.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.58.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.58.2.1 03-Aug-2004  skrll Sync with HEAD
 1.61.14.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.62.4.1 02-Nov-2005  yamt sync with head.
 1.62.2.3 03-Sep-2007  yamt sync with head.
 1.62.2.2 26-Feb-2007  yamt sync with head.
 1.62.2.1 21-Jun-2006  yamt sync with head.
 1.65.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.65.20.1 01-Feb-2007  ad Sync with head.
 1.66.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.67.54.4 26-Mar-2009  snj Pull up following revision(s) (requested by abs in ticket #612):
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.3
sys/arch/atari/atari/atari_init.c: revision 1.76
sys/arch/atari/include/pmap.h: revision 1.40
sys/arch/atari/include/vmparam.h: revision 1.24
Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.
 1.67.54.3 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.70
Update one more comment which was missed in previous.
 1.67.54.2 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.69
sys/arch/atari/atari/pmap.c: revision 1.111 via patch
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.9
sys/arch/atari/include/pmap.h: revision 1.39 via patch
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and
pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.67.54.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.68
sys/arch/atari/atari/pmap.c: revision 1.106
sys/arch/atari/include/pmap.h: revision 1.37
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
 1.67.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.67.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.67.50.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.67.44.5 11-Aug-2010  yamt sync with head.
 1.67.44.4 11-Mar-2010  yamt sync with head
 1.67.44.3 16-Sep-2009  yamt sync with head
 1.67.44.2 18-Jul-2009  yamt sync with head.
 1.67.44.1 04-May-2009  yamt sync with head.
 1.67.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.73.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.92.4.3 05-Mar-2011  rmind sync with head
 1.92.4.2 03-Jul-2010  rmind sync with head
 1.92.4.1 30-May-2010  rmind sync with head
 1.92.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.92.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.95.8.2 30-Oct-2012  yamt sync with head
 1.95.8.1 17-Apr-2012  yamt sync with head
 1.96.2.2 24-Feb-2012  mrg sync to -current.
 1.96.2.1 18-Feb-2012  mrg merge to -current.
 1.98.2.1 27-Feb-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #55):
sys/arch/x68k/x68k/pmap_bootstrap.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.99
Use actual physmem size for allocation of bootstrap extra PT pages
to avoid wasting pages on low memory machines.
Improves atari specific part of PR/45915, tested on TT030.
Reserve more bootstrap kernel PT pages if options EXTENDED_MEMORY is defined
for VA allocation in the extended memory probe function and possible 128MB
memory on 060turbo, as worksaround for x68k specific part of PR/45915.
Fixes GENERIC kernel panic on X68030 even without extended memory.
XXX: we should rather have proper probe function before pmap_bootstrap()
Tested on 060turbo with 128MB SIMM by Y.Sugahara, and also
tested on XM6i with 68030 and custom 128MB memory settings by isaki@.
Should be pulled up to netbsd-6.
 1.100.32.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.101.8.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1519):

sys/arch/atari/conf/GENERIC.in: revision 1.123
sys/arch/atari/conf/files.atari: revision 1.124
sys/arch/atari/atari/atari_init.c: revision 1.105

Allocalte enough reserved ST-RAM to make the old Xserver work by default.

Instead, check ST-RAM size and TT-RAM size on startup and restrict
size of reserved ST memory on lower RAM machines.

Closes PR port-atari/41002 from David Ross.

While here, make options ST_POOL_SIZE defparam'ed to make sure to
reflect config(5) changes on each build.
 1.74 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.73 02-Jul-2022  tsutsui Use aprint_normal(9) for attach messages.
 1.72 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.71 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.70 27-Apr-2021  thorpej branches: 1.70.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.69 24-Apr-2021  thorpej branches: 1.69.2;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.68 03-Jan-2021  thorpej branches: 1.68.2;
malloc(9) -> kmem(9)
 1.67 29-Jun-2019  tsutsui branches: 1.67.10;
Make local functions static.
 1.66 03-May-2019  tsutsui Make sure interrupts are disabled during cpu_configure(9).

Fixes 'panic: kernel diagnostic assertion "cv_is_valid(cv)" failed'
during fdcisa(4) probe on Milan's DIAGNOSTIC kernel, caused by
a stray interrupt from the FDC right after isa_intr_establish().
No visible bad side effect on TT030 with this change.

Should be pulled up to netbsd-8.
 1.65 24-Mar-2014  christos branches: 1.65.10; 1.65.20; 1.65.30;
- remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.64 27-Oct-2012  chs branches: 1.64.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.63 29-Jul-2012  mlelstv branches: 1.63.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.62 30-Jun-2012  tsutsui Add a dirty hack for atari's ancient installation ramdisk:
Forcibly configure md0, md1, and md2 devices before setroot()
for atari's traditional "auto-load from floppy on open" md_root device
which loads installation ramdisk image from floppy.
md(4) has been changed dynamically configured at first open after 5.0
and md devices won't appear in "root device:" prompt without this hack.
Tested on TT030.

Should be pulled up to netbsd-6.
 1.61 05-Jun-2011  matt branches: 1.61.2; 1.61.8;
A few missed device_t, cfdata_t cleanups
 1.60 05-Jun-2011  tsutsui - use CFATTACH_DECL_NEW() (no softc)
- use device_t, cfdata_t etc.
 1.59 10-Apr-2010  tsutsui branches: 1.59.2; 1.59.6;
Comment out currently unused mbprint().
 1.58 10-Apr-2010  tsutsui Remove extern int atari_realconfig decls. It's in <atari/atari/device.h>.
 1.57 01-Apr-2010  tsutsui Add support for the EtherNEC.

The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.

See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
 1.56 08-Mar-2009  tsutsui branches: 1.56.2; 1.56.4;
ANSIfy, some KNF, misc cosmetics.
 1.55 05-Mar-2009  tsutsui Remove __P().
 1.54 03-Dec-2007  ad branches: 1.54.18; 1.54.26; 1.54.28; 1.54.32;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.53 21-Mar-2007  tsutsui branches: 1.53.12; 1.53.14; 1.53.20;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.52 11-Dec-2005  christos branches: 1.52.26; 1.52.30; 1.52.32; 1.52.34;
merge ktrace-lwp.
 1.51 03-Jul-2005  isaki branches: 1.51.2;
cfmatch_t was removed at sys/device.h rev 1.75,
and there is no need to cast for NULL.
 1.50 30-Jun-2005  drochner adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.49 04-Jun-2005  he Add use of __UNCONST() when passing a constant string to some of the
general autoconf functions which typically take a "void*". There may
be reason to revisit this later if the signature for the autoconf
functions can be adapted, but for now this gets the code building.
 1.48 13-Dec-2004  chs for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.47 23-Oct-2004  thorpej Centralize the declaration of booted_device and booted_partition.
 1.46 15-Jul-2003  lukem __KERNEL_RCSID()
 1.45 01-Apr-2003  he branches: 1.45.2;
Remove what appears to be a spurious brace.
 1.44 04-Feb-2003  leo Extra bug fix on the config changes as implemented by Aymeric on the Amiga:
fake up a dv_cfdriver entry before calling config_search(). config_search()
does not do the lookup for us anymore.
 1.43 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.42 08-Dec-2002  leo Make things work with the new autoconf stuff:
- The pcibus is now called 'pcib' and the isabus 'isab'. Their attributes are
'pcibus' and 'isabus' respectively. This makes the underlying busses
attach again.
- Initialize the parent structure in the config_console() function.
Otherwise we end up without a console.
 1.41 04-Oct-2002  thorpej Overhaul the way cfattach structures are looked up. The cfdata entry
now carries the name of the attachment (e.g. "tlp_pci" or "audio"),
and cfattach structures are registered at boot time on a per-driver
basis. The cfdriver and cfattach pointers are cached in the device
structure when attached.
 1.40 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.39 30-Sep-2002  thorpej Add a config_init() function to initialize the config data structures.
Normally this is called by configure(), but some ports (amiga, atari,
x68k) need to do this early because of how they find the console.
 1.38 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.37 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.36 07-Jun-2001  leo branches: 1.36.2; 1.36.4; 1.36.8; 1.36.16;
Try to search for an isa bus during console configuration too... Otherwise,
we miss the console keyboard on the Milan.
 1.35 28-Sep-2000  leo branches: 1.35.2;
Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).
 1.34 06-Jun-2000  leo Fix prototype definition of findroot().
 1.33 01-Jun-2000  matt Don't pass booted_* to findroot/getdevice, access them via the globals.
Also, make findroot static. This eliminates unneeded clearing of them
and make their use consistent among the ports.
 1.32 01-Jun-2000  matt Make booted_device global (and booted_parition for consitency).
Eliminate it from header files and other extern definitions.
 1.31 17-Sep-1999  thorpej branches: 1.31.2; 1.31.10;
Centralize the declaration and clearing of `cold'.
 1.30 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.29 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.28 02-Sep-1998  leo branches: 1.28.8;
mv vmebus -> avmebus to make room for MI vmebus implementation (per
reqest of Drochner).
 1.27 15-Apr-1998  leo Probe the 'mainbus' before the other busses. This gives less surprises when
adding things like SCSI controlers to the pci-bus.
 1.26 10-Apr-1998  leo Use MI wdc-driver.
 1.25 12-Jan-1998  thorpej Update for changes to config.
 1.24 15-Jul-1997  leo Isabus support.
 1.23 05-Jul-1997  leo If booted with RB_ASKNAME, don't go looking for a root device.
 1.22 25-May-1997  leo Add serial driver for 68901 UART (modem1 port).
 1.21 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.20 26-Mar-1997  gwr Move findroot/setroot stuff from configure() to cpu_rootconf().
 1.19 26-Mar-1997  leo Close disk after opening it to read the disklabel. The previous code did 2
opens...
 1.18 03-Mar-1997  leo Addition of VME bus code.
 1.17 16-Feb-1997  leo Fix some typo's from the setroot mega commit and re-order the device
preferences.
 1.16 31-Jan-1997  thorpej branches: 1.16.2; 1.16.4;
Use new machine-independent setroot()
 1.15 20-Dec-1996  leo branches: 1.15.2;
Get rid of BROKEN_INDIRECT_CONFIG
 1.14 13-Oct-1996  christos backout previous kprintf changes
 1.13 11-Oct-1996  leo - Fix configuration name of 'lpt'
- add 'pcibus' as a mainbus device.
 1.12 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.11 25-Sep-1996  leo Second arg to print function is now 'const char *'
 1.10 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.9 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.8 04-Apr-1996  cgd update for the fact that config_found() and config_rootfound() now
return pointers. (Check vs. NULL, rather than just boolean tests.)
 1.7 20-Mar-1996  leo Another bit of prototyping...
 1.6 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.5 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.4 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.3 06-Jan-1996  leo Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.2 11-Jul-1995  leo Dumping works, now if there were tools to handle it...
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.15.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.16.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.16.2.1 02-Mar-1997  mrg swapconf() is no more.
 1.28.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.31.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.31.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.35.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.36.16.1 17-May-2002  gehenna Replace the access to devsw table and the hard-coded major with devsw API.
 1.36.8.5 03-Jan-2003  thorpej Sync with HEAD.
 1.36.8.4 11-Dec-2002  thorpej Sync with HEAD.
 1.36.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.36.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.36.8.1 07-Jun-2001  nathanw file autoconf.c was added on branch nathanw_sa on 2002-09-17 21:13:37 +0000
 1.36.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.36.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.45.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.45.2.6 17-Jan-2005  skrll Adapt to branch.
 1.45.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.45.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.45.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.45.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.45.2.1 03-Aug-2004  skrll Sync with HEAD
 1.51.2.3 07-Dec-2007  yamt sync with head
 1.51.2.2 03-Sep-2007  yamt sync with head.
 1.51.2.1 21-Jun-2006  yamt sync with head.
 1.52.34.1 29-Mar-2007  reinoud Pullup to -current
 1.52.32.1 11-Jul-2007  mjf Sync with head.
 1.52.30.2 03-Dec-2007  ad Sync with HEAD.
 1.52.30.1 10-Apr-2007  ad Sync with head.
 1.52.26.1 24-Mar-2007  yamt sync with head.
 1.53.20.1 08-Dec-2007  mjf Sync with HEAD.
 1.53.14.1 09-Jan-2008  matt sync with HEAD
 1.53.12.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.54.32.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.54.28.1 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1367):
sys/dev/ic/ne2000var.h: revision 1.25
sys/arch/atari/conf/MILAN.in: revision 1.24
sys/arch/atari/conf/MILAN.in: revision 1.25
sys/dev/ic/ne2000.c: revision 1.71
sys/dev/ic/ne2000.c: revision 1.72
sys/arch/atari/dev/if_ne_mb.c: revision 1.1
sys/arch/atari/dev/if_ne_mb.c: revision 1.2
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.69
sys/arch/atari/conf/HADES.in: revision 1.10
sys/arch/atari/conf/HADES.in: revision 1.11
sys/arch/x68k/dev/if_ne_neptune.c: revision 1.20
sys/dev/isa/if_ne_isa.c: revision 1.27
sys/arch/atari/atari/autoconf.c: revision 1.57
sys/dev/ic/ne2000.c: revision 1.62
sys/dev/isapnp/if_ne_isapnp.c: revision 1.27
sys/arch/atari/conf/files.atari: revision 1.117
sys/arch/atari/conf/HADES: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.85
sys/dev/ic/ne2000.c: revision 1.65
sys/dev/ic/ne2000.c: revision 1.66
sys/dev/ic/ne2000.c: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.65
distrib/notes/atari/hardware: revision 1.24
sys/conf/files: revision 1.980
sys/dev/ic/ne2000var.h: revision 1.21
sys/arch/x68k/dev/if_ne_intio.c: revision 1.16
sys/dev/ic/dp8390.c: revision 1.74
sys/dev/ic/dp8390.c: revision 1.75
Added NE2000 with 8bit bus width support.
reviewd by tsutsui@ at tech-kern ML.
Fix a wrong calculation bug around RX ring buffer memory address
slipped in about sixteen years ago. Fortunately, it had been working
for ages because some devices used address zero and other devices
ignored wrong higher bits.
Tested on we(4) (SMC Elite Ultra) and ne(4) (NE2000 compatible
named UL0001) on ISA.
Note FreeBSD also uses the same correct value in their ed(4) driver.
Now dp8390_config() calculates mem_ring correctly so
no longer need to override it in ne2000_attach().
Use roundup2() in <sys/param.h> rather than a conditional.
Also fix a wrong mem_ring calculation in dp8390_ipkdb_attach().
Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.
* move RTL8019 probe and attach code from each bus attachment
to MI ne2000_detect() and ne2000_attach()
* change a method for backend and attachment to specify 8 bit mode
to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
* handle more NE2000 8 bit mode specific settings, including
bus_space(9) access width and available size of buffer memory
* add a function to detect NE2000 8 bit mode
(disabled by default, but enalbed by options NE2000_DETECT_8BIT
to avoid possible regression on various ISA clones)
* fix ipkdb attachment accordingly (untested)
Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.
See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
No need to override mem_ring value in ne2000_ipkdb_attach()
since a wrong calculation in dp8390_ipkdb_attach() was fixed.
Don't warn about DMA timeout during probe.
Add support for the EtherNEC.
The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.
See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
Also note EtherNEC.
Use callout_schedule(9) rather than callout_reset(9) on polling
as callout(9) man says.
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.54.26.1 28-Apr-2009  skrll Sync with HEAD.
 1.54.18.2 11-Aug-2010  yamt sync with head.
 1.54.18.1 04-May-2009  yamt sync with head.
 1.56.4.2 12-Jun-2011  rmind sync with head
 1.56.4.1 30-May-2010  rmind sync with head
 1.56.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.59.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.59.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.61.8.2 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.61.8.1 05-Jul-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #395):
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.95
sys/arch/atari/atari/autoconf.c: revision 1.62
sys/dev/md.c: revision 1.67
Add a dirty hack for atari's ancient installation ramdisk:
Forcibly configure md0, md1, and md2 devices before setroot()
for atari's traditional "auto-load from floppy on open" md_root device
which loads installation ramdisk image from floppy.
md(4) has been changed dynamically configured at first open after 5.0
and md devices won't appear in "root device:" prompt without this hack.
Tested on TT030.
Should be pulled up to netbsd-6.
Make sure that disklabel of md(4) device is initialized
in the case where it's configured in MD md_open_hook().
Without this, msdosfs_mountfs() (which is called from msdosfs_mountroot())
will be called with uninitialized disklabel (d_secsize == 0) and
it gets "panic: buf mem pool index 23" later on atari.
This is because getdisksize() doesn't check returned d_secsize value
and msdosfs_mountfs() blindly calls bread(9) with size==0 in that case.
Should be pulled up to netbsd-6 (at least for atari).
Add a sanity check if secsize returned from getdisksize() isn't bogus.
This prevent possible panic "panic: buf mem pool index 23" later in
vfs_bio.c:buf_mempoolidx().
(I'm not sure if it's okay for getdisksize() to assume that
partinfo taken from DIOCGPART is properly initialized
on all disk(9) devices or not)
See also:
http://mail-index.NetBSD.org/source-changes/2012/06/30/msg035298.html
 1.61.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.61.2.1 30-Oct-2012  yamt sync with head
 1.63.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.63.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.64.2.1 18-May-2014  rmind sync with head
 1.65.30.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.65.30.1 10-Jun-2019  christos Sync with HEAD
 1.65.20.2 17-May-2017  pgoyette At suggestion of chuq@, modify config_attach_pseudo() to return with a
reference held on the device.

Adapt callers to expect the reference to exist, and to ensure that the
reference is released.
 1.65.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.65.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.67.10.1 03-Apr-2021  thorpej Sync with HEAD.
 1.68.2.2 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.68.2.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.69.2.1 13-May-2021  thorpej Sync with HEAD.
 1.70.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.18 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.17 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.16 10-Nov-2019  chs branches: 1.16.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.15 01-Jul-2011  dyoung branches: 1.15.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 31-Mar-2010  tsutsui ANSIfy, some KNF.
 1.13 18-Mar-2009  cegger branches: 1.13.2; 1.13.4;
bzero -> memset
 1.12 08-Mar-2009  tsutsui ANSIfy, some KNF, misc cosmetics.
 1.11 05-Mar-2009  tsutsui Remove __P().
 1.10 27-Dec-2008  tsutsui branches: 1.10.2;
Sprinkle volatile to bus_space(9) access functions.
 1.9 28-Apr-2008  martin branches: 1.9.8; 1.9.10;
Remove clause 3 and 4 from TNF licenses
 1.8 04-Mar-2007  christos branches: 1.8.40; 1.8.42; 1.8.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 11-Dec-2005  christos branches: 1.7.24; 1.7.26;
merge ktrace-lwp.
 1.6 13-Feb-2004  wiz branches: 1.6.16;
Uppercase CPU, plural is CPUs.
 1.5 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 19-Jan-2000  leo branches: 1.4.28;
Allow storage-space to be passed to the alloc_bus_space_tag() functions. This
permits static tags to be used during early console init.
 1.3 25-May-1998  leo branches: 1.3.14;
Add bus_space_{read,write}_region_stream_N functions.
 1.2 23-Apr-1998  leo Update copyright year (it really is 1998).
 1.1 22-Apr-1998  leo Add the 'bus' code for a linear big endian bus (like VME).
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.28.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 03-Sep-2007  yamt sync with head.
 1.7.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.24.1 02-Jan-2009  jdc Pull up revisions:
1.10 src/sys/arch/atari/atari/be_bus.c
1.14 src/sys/arch/atari/atari/le_bus.c
1.8 src/sys/arch/atari/atari/mainbus.c
1.33 src/sys/arch/atari/dev/wdc_mb.c
(requested by tsutsui in ticket #1252).

Sprinkle volatile to bus_space(9) access functions.
 1.8.44.3 11-Aug-2010  yamt sync with head.
 1.8.44.2 04-May-2009  yamt sync with head.
 1.8.44.1 16-May-2008  yamt sync with head.
 1.8.42.1 18-May-2008  yamt sync with head.
 1.8.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.8.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.10.1 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #218):
sys/arch/atari/dev/wdc_mb.c: revision 1.33
sys/arch/atari/atari/mainbus.c: revision 1.8
sys/arch/atari/atari/le_bus.c: revision 1.14
sys/arch/atari/atari/be_bus.c: revision 1.10
Sprinkle volatile to bus_space(9) access functions.
 1.9.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.9.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.4.1 30-May-2010  rmind sync with head
 1.13.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.15.54.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16.8.1 03-Apr-2021  thorpej Sync with HEAD.
 1.69 07-Dec-2023  thorpej extent(9) -> vmem(9)
 1.68 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.67 26-Jul-2022  andvar s/functin/function/ in copy pasted comment.
 1.66 03-Jul-2022  tsutsui Use __func__ to print function names.
 1.65 03-Jul-2022  tsutsui Use proper TAILQ(3) macro as other bus_dma(9) implementation.

No binary change.
 1.64 03-Jul-2022  tsutsui Misc KNF. No binary change.
 1.63 03-Jul-2022  tsutsui Move the iomem extent stuff managed by bus_space(9) and make them static.

Inspired by MD bus_space(9) implemantation of arc.
Briefly tested on TT030.
 1.62 24-May-2022  andvar s/entrace/entrance/ in copy pasted comment.
 1.61 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.60 10-Mar-2018  tsutsui branches: 1.60.14;
Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.

This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.59 20-Jan-2018  tsutsui branches: 1.59.2;
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.
 1.58 18-Oct-2014  snj branches: 1.58.12;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.57 27-Jan-2012  para branches: 1.57.6;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.56 01-Jul-2011  dyoung branches: 1.56.2; 1.56.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.55 06-Nov-2010  uebayasi Machine dependent code is considered as part of UVM. Include
internal API header.
 1.54 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.53 13-Apr-2010  tsutsui Misc KNF.
 1.52 31-Mar-2010  tsutsui ANSIfy, some KNF.
 1.51 18-Mar-2009  cegger branches: 1.51.2; 1.51.4;
bzero -> memset
 1.50 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.49 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.48 05-Mar-2009  tsutsui Remove __P().
 1.47 04-Jun-2008  ad branches: 1.47.6; 1.47.12;
vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.
 1.46 28-Apr-2008  martin branches: 1.46.2;
Remove clause 3 and 4 from TNF licenses
 1.45 06-Mar-2007  tsutsui branches: 1.45.40; 1.45.42; 1.45.44;
Change bus_space_handle_t from void * (formerly caddr_t) to u_long
to make things easier.
 1.44 06-Mar-2007  he More fixes after the caddr_t removal.
Mostly cast to char* for pointer arithmetic,
but also one missing indirection, and one "void *v, x;" fix.
 1.43 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.42 01-Mar-2006  yamt branches: 1.42.20;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.
 1.41 11-Dec-2005  christos branches: 1.41.2; 1.41.4; 1.41.6;
merge ktrace-lwp.
 1.40 24-Nov-2005  yamt bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.39 01-Apr-2005  yamt branches: 1.39.2; 1.39.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.38 10-Mar-2005  matt Adapt to new dm_maxsegsz semantics.
 1.37 28-Nov-2004  thorpej branches: 1.37.4; 1.37.6;
bus_dmamap_load_mbuf(): Skip zero-length mbufs.
kern/24811
 1.36 15-Jul-2003  lukem __KERNEL_RCSID()
 1.35 29-Jun-2003  fvdl branches: 1.35.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.34 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.33 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.32 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.31 09-Jan-2002  leo branches: 1.31.8;
Nuke some unused code.
 1.30 07-Jan-2002  thorpej Implement bus_space_mmap().
 1.29 28-Sep-2001  chs branches: 1.29.4;
don't depend on other headers to include sys/proc.h for us.
 1.28 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.27 26-May-2001  chs branches: 1.27.2; 1.27.4;
replace vm_page_t with struct vm_page *.
 1.26 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.25 21-Mar-2001  soren s/vm_page_alloc_memory/uvm_pglistalloc/ in panic message.
 1.24 09-Mar-2001  leo Expand bus_dma implementation. It will now handle the bounce buffer
extensions needed to make the isa floppy driver on the Milan work.
 1.23 29-Jun-2000  mrg branches: 1.23.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.22 29-Jun-2000  leo When mapping non-cacheable memory with bus_space_map, make sure we use the
precise (serialized) way.
 1.21 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.20 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.19 09-Dec-1999  leo branches: 1.19.4;
Fix argument of extent_free().
 1.18 06-Dec-1999  leo Implement an allocator for VA-space using fixed extent maps. It is now
possible to allocate VA-space before uvm is initialized.
 1.17 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.16 28-Oct-1999  leo Use extent maps.
 1.15 08-Jul-1999  thorpej branches: 1.15.2; 1.15.4; 1.15.6;
Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.14 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.13 26-Mar-1999  mycroft branches: 1.13.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.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 21-Sep-1998  thorpej Make bus_dmamap_load_uio() work, from Kevin Lahey <kml@nas.nasa.gov>.
 1.10 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.9 03-Aug-1998  leo Pass the dma_tag to _bus_dmamap_load_buffer.
 1.8 17-Jul-1998  thorpej Implement bus_dmamap_load_uio().
 1.7 03-Jun-1998  thorpej Sync w/ i386 port.
 1.6 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.5 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.4 18-May-1998  leo Fix errors when compiling for M68030 only. (Witek Wnuk)
 1.3 11-May-1998  leo Add UVM option.
 1.2 10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.1 13-Mar-1998  leo Move the bus_* functions from machdep.c to bus.c .
 1.13.4.2 02-Aug-1999  thorpej Update from trunk.
 1.13.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.15.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.4.1 15-Nov-1999  fvdl Sync with -current
 1.15.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.15.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.15.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.19.4.2 06-Jul-2000  leo Pullup 1.21 - 1.22. Approved by thorpej.

When mapping non-cacheable memory with bus_space_map, make sure we use the
precise (serialized) way.
 1.19.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.23.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.23.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.27.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.27.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.27.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.29.4.4 20-Jun-2002  nathanw Catch up to -current.
 1.29.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.29.4.2 11-Jan-2002  nathanw More catchup.
 1.29.4.1 28-Sep-2001  nathanw file bus.c was added on branch nathanw_sa on 2002-01-11 23:38:11 +0000
 1.31.8.1 14-Jul-2002  gehenna catch up with -current.
 1.35.2.8 11-Dec-2005  christos Sync with head.
 1.35.2.7 01-Apr-2005  skrll Sync with HEAD.
 1.35.2.6 19-Feb-2005  skrll Don't deref a NULL struct lwp *. This shouldn't happen, but...
 1.35.2.5 18-Dec-2004  skrll Sync with HEAD.
 1.35.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.2 03-Aug-2004  skrll Sync with HEAD
 1.35.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.37.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.37.6.1 26-Jan-2005  yamt convert arch/atari to new apis.
 1.37.4.1 29-Apr-2005  kent sync with -current
 1.39.8.1 29-Nov-2005  yamt sync with head.
 1.39.2.2 03-Sep-2007  yamt sync with head.
 1.39.2.1 21-Jun-2006  yamt sync with head.
 1.41.6.1 22-Apr-2006  simonb Sync with head.
 1.41.4.1 09-Sep-2006  rpaulo sync with head
 1.41.2.1 18-Feb-2006  yamt adapt bus_dma implementations.
 1.42.20.1 12-Mar-2007  rmind Sync with HEAD.
 1.45.44.3 11-Aug-2010  yamt sync with head.
 1.45.44.2 04-May-2009  yamt sync with head.
 1.45.44.1 16-May-2008  yamt sync with head.
 1.45.42.2 17-Jun-2008  yamt sync with head.
 1.45.42.1 18-May-2008  yamt sync with head.
 1.45.40.2 05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.45.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.46.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.47.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.47.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.51.4.3 05-Mar-2011  rmind sync with head
 1.51.4.2 03-Jul-2010  rmind sync with head
 1.51.4.1 30-May-2010  rmind sync with head
 1.51.2.3 17-Aug-2010  uebayasi Sync with HEAD.
 1.51.2.2 27-May-2010  uebayasi Fix build.
 1.51.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.56.6.1 18-Feb-2012  mrg merge to -current.
 1.56.2.1 17-Apr-2012  yamt sync with head
 1.57.6.1 03-Dec-2017  jdolecek update from HEAD
 1.58.12.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.59.2.1 15-Mar-2018  pgoyette Synch with HEAD
 1.60.14.1 03-Apr-2021  thorpej Sync with HEAD.
 1.59 11-Dec-2005  christos merge ktrace-lwp.
 1.58 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.57 15-Jul-2003  lukem __KERNEL_RCSID()
 1.56 26-Oct-2002  jdolecek branches: 1.56.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.55 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.54 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.53 17-Jun-2002  christos MD systrace gluons.
 1.52 16-Mar-2002  martin branches: 1.52.4;
Rename ISDN devices, per discussion on tech-kern. The network devices
become ippp (ISDN ppp) and irip (ISDN raw IP). The character device now
are called: /dev/isdn (isdnd <-> kernel communication), /dev/isdnctl (dialing
and other control), /dev/isdntrc* (tracing), /dev/isdnbchan* (raw B channel
access, i.e. for user land PPP) and /dev/isdntel* (telephone devices, i.e.
for answering machines).
 1.51 12-Jan-2002  manu Added clockctl
 1.50 07-Jun-2001  leo branches: 1.50.2; 1.50.8;
We really need a wsdisplay on the Milan.
 1.49 28-May-2001  leo Add missing semicolon.
 1.48 28-May-2001  leo Add VGA console probes.
 1.47 10-Apr-2001  leo Take NFDISA into account.
 1.46 26-Mar-2001  lukem - add dev_noimpl(xxx,yyy) macro to replace "(dev_type_xxx((*))) yyy",
and use appropriately

- create more helper macros:
. cdev__xyz_init(c,n), such as cdev__ocri_init() for
/* open, close, read, ioctl */, etc.
. cdev__xRy_init(c,n), where nullop is used instead of enodev to dummy out
method `R' and the comments now read /* xxx (read) yyy */ instead
. cdev__xyz_t_init(c,n,t) - as per cdev__xyz_init, but sets d_type = t
as well

- use seltrue instead of dev_noimpl(poll,*), as (IIRC) cdevsw.d_poll should
always DTRT WRT returning a valid result. (a few devices previously
incorrectly returned ENODEV)

- use dev_noimpl(stop,enodev) instead of dev_noimpl(stop,nullop) if tty
== 0, because it doesn't matter if dev_type_stop isn't implemented in that
case, and it allows the use of the cdev__xyz_init macros. certain ports
(sparc,sparc64,x68k) used the nullop method for dev_type_stop in a few
drivers, whereas everything else uses enodev

- ensure that the comments are accurate WRT the behaviour of a given entry
 1.45 21-Mar-2001  lukem move duplicate definitions for:
pc, lpt, joy, ocis, apm, satlink, i4bctl, i4brbch, i4btel, i4btrc, i4b
from the port-specific arch/*/*/conf.c files into sys/conf.h
 1.44 14-Jan-2001  martin branches: 1.44.2;
The i4b raw b-channel devices actually do have an ioctl routine,
so better add this to the cdevsw entry.
Noted by Bruno Achauer.
 1.43 08-Jan-2001  martin Add isdn devices to all archs that seem to support at least one of the
necessary busses. Sync comments with reality for archs that already had
the devices.
 1.42 05-Jan-2001  martin Enable the imported ISDN4BSD based ISDN subsystem.

This is the kernel part (userland to follow soon) of the latest (and
very probably last) release (version 0.96) of ISDN4BSD. ISDN4BSD has a
homepage at http://www.freebsd-support.de/i4b/.

It gives the user various ways to use the isdn connection: raw data (via
the i4brbch "raw b-channel" device), ppp (via the isp "isdn PPP" device),
voice/answering machine (the i4btel "telephone" device) and ip over isdn
(the ipr device, "IP over raw ISDN").

Supported are a bunch of common and older cards, more to be added soon
after some cleanup. Currently only the european E-DSS1 variant of the
ISDN D channel protocol is supported.
 1.41 28-Oct-1999  leo branches: 1.41.6;
Define an audio device at c-major 42 and reserve 41 for wscons.
 1.40 19-Apr-1999  kleink branches: 1.40.2; 1.40.4; 1.40.6;
Add COMPAT_SVR4 for m68k.
 1.39 21-Nov-1998  oster branches: 1.39.6;
Fix RAIDframe typo. (Reported by msaitoh@netbsd.org)
 1.38 20-Nov-1998  leo NWDC -> NWD (wdc.h -> wd.h)
 1.37 13-Nov-1998  oster Updating of bdev's and cdev's to support RAIDframe.
 1.36 10-Oct-1998  thorpej Add scsibus entry points to the cdevsw[].
 1.35 18-Aug-1998  leo Circad Leonardo video driver by 'maximum entropy'.
 1.34 25-Jun-1998  leo Reserve devices for i4b (ISDN).
 1.33 23-Apr-1998  leo Crazy Dots driver by Julian Coleman.
 1.32 10-Apr-1998  leo Use MI wdc-driver.
 1.31 13-Oct-1997  explorer o Make usage of /dev/random dependant on
pseudo-device rnd # /dev/random and in-kernel generator
in config files.

o Add declaration to all architectures.

o Clean up copyright message in rnd.c, rnd.h, and rndpool.c to include
that this code is derived in part from Ted Tyso's linux code.
 1.30 27-Aug-1997  leo Add a char entry for md and add it to the chartoblk table. This fixes
the problem that kernfs was unable to determine the root device while
booting from the install floppy.
 1.29 02-Aug-1997  leo lpt -> lp
 1.28 02-Jun-1997  leo branches: 1.28.4;
Add ipfilter stuff.
 1.27 25-May-1997  leo Add serial driver for 68901 UART (modem1 port).
 1.26 04-Apr-1997  leo Add chrtoblk table entry for wd device.
 1.25 01-Apr-1997  leo Make it possible to remove the lpt device by making it 'needs-flag'.
Remove lpt-device from the BOOT kernel.
 1.24 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.23 01-Jan-1997  leo Fix some leftovers from rd -> md rename.
 1.22 28-Dec-1996  pk rename: ramdisk => md
 1.21 16-Dec-1996  leo Implement an rtc-device. Credits for the idea goes to Wolfgang Solfrank.
Because there is no way yet to tell init(1) to execute commands before
single user-mode is entered, the inittodr() function is still partly
functional. It retrieves the value of the RTC and sets the time as if
the RTC was running at UTC. The resettodr() function is a No-Op. The
RTC can only be changed by a write to /dev/rtc.
The TIMEZONE and DST options are no longer needed and removed from the
config files.
 1.20 09-Nov-1996  leo Count in the Hades floppy driver.
 1.19 06-Nov-1996  leo Remove fdopen->Fdopen cruft. This is no longer necessary.
 1.18 04-Oct-1996  leo Add ch/ss/uk devices.
 1.17 25-Sep-1996  leo More preps for et-driver.
 1.16 07-Sep-1996  mycroft Implement poll(2).
 1.15 05-Sep-1996  mycroft Remove duplicate declarations of LKM functions and macros.
 1.14 27-Mar-1996  leo Add centronics printer driver.
 1.13 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.12 14-Mar-1996  christos fdopen -> filedescopen
 1.11 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.10 17-Aug-1995  thorpej branches: 1.10.2;
Add entries for the ccd.
 1.9 11-Jul-1995  leo Fix pseudo tty's
 1.8 04-Jul-1995  mycroft Make each disk and tape driver define its own read and write functions.
Deprecate rawread() and rawwrite() completely. Remove d_strategy from cdevsw to
force the abstraction barrier.
 1.7 25-Jun-1995  leo Mouse driver added.
 1.6 22-Apr-1995  leo Adapt for new conf.h.
 1.5 16-Apr-1995  leo Make it work after last week's changes.
 1.4 10-Apr-1995  mycroft Minor tweak for ite.
 1.3 10-Apr-1995  mycroft Update for conf.h.
 1.2 05-Apr-1995  leo Fixed up chr to blk translations.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.10.2.1 12-Oct-1995  leo Add entry for tun
 1.28.4.3 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.28.4.2 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.28.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.39.6.1 21-Jun-1999  thorpej Sync w/ -current.
 1.40.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.40.4.1 15-Nov-1999  fvdl Sync with -current
 1.40.2.5 21-Apr-2001  bouyer Sync with HEAD
 1.40.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.40.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.40.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.40.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.41.6.1 01-May-2001  he Pull up revision 1.44 (via patch, requested by martin):
Add ioctl entry to cdevsw for i4b raw B-channel devices.
 1.44.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.44.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.50.8.7 11-Nov-2002  nathanw Catch up to -current
 1.50.8.6 17-Sep-2002  nathanw Catch up to -current.
 1.50.8.5 01-Aug-2002  nathanw Catch up to -current.
 1.50.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.50.8.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.50.8.2 28-Feb-2002  nathanw Catch up to -current.
 1.50.8.1 07-Jun-2001  nathanw file conf.c was added on branch nathanw_sa on 2002-02-28 04:08:21 +0000
 1.50.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.50.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.50.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.50.2.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.52.4.3 21-Jul-2002  gehenna catch up with -current.
 1.52.4.2 14-Jul-2002  gehenna catch up with -current.
 1.52.4.1 16-May-2002  gehenna Bye block/character device swicth tables.
 1.56.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.56.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.56.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14 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.13 29-Jun-2000  mrg branches: 1.13.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.12 02-Sep-1998  leo branches: 1.12.12;
Get rid of vm_offset_t/vm_size_t
 1.11 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.10 10-Jun-1997  veego branches: 1.10.4;
s/atari_trunc_page/m68k_trunc_page/
 1.9 04-Jun-1997  leo Use m68k cacheops
 1.8 09-Dec-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.7 25-Oct-1996  leo db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]
 1.6 13-Oct-1996  christos backout previous kprintf changes
 1.5 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 15-May-1996  leo Prototype + -Wall fixes.
 1.3 26-Apr-1996  leo Corrections for removed <sys/cpu.h> and some more prototypes.
 1.2 19-Jan-1996  leo Special handling for 2 and 4 byte sized transfers. The makes accessing
device registers work in a sane way. (gwr)
 1.1 09-Jun-1995  leo Add our own low-level access functions for ddb. This makes sure that
the system won't hang when referencing a non-existend page.
 1.10.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.8.1 11-Nov-2002  nathanw Catch up to -current
 1.9 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.8 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.7 27-Apr-2021  thorpej branches: 1.7.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.6 27-Oct-2012  chs branches: 1.6.54;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.5 10-Apr-2010  tsutsui branches: 1.5.8; 1.5.18;
Remove now unused getsoftc() macro.
 1.4 05-Mar-2009  tsutsui branches: 1.4.2; 1.4.4;
Remove __P().
 1.3 11-Jun-2008  tsutsui branches: 1.3.4; 1.3.10;
Use device_private() and device_lookup_privat() to get softc.
 1.2 27-Aug-1996  cgd branches: 1.2.164; 1.2.166; 1.2.168; 1.2.170; 1.2.172;
change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.172.1 18-Jun-2008  simonb Sync with head.
 1.2.170.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2.168.2 11-Aug-2010  yamt sync with head.
 1.2.168.1 04-May-2009  yamt sync with head.
 1.2.166.1 17-Jun-2008  yamt sync with head.
 1.2.164.1 29-Jun-2008  mjf Sync with HEAD.
 1.3.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.4.1 30-May-2010  rmind sync with head
 1.4.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.5.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.8.1 30-Oct-2012  yamt sync with head
 1.6.54.1 13-May-2021  thorpej Sync with HEAD.
 1.7.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.45 24-May-2022  andvar fix various typos in comments, docs and log messages.
 1.44 03-Apr-2019  christos centralize setdisklabel(9)
 1.43 13-Apr-2010  tsutsui branches: 1.43.60;
Misc KNF.
 1.42 31-Mar-2010  tsutsui Misc KNF and cosmetics.
 1.41 20-Oct-2009  snj branches: 1.41.2; 1.41.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.40 18-Mar-2009  cegger bzero -> memset
 1.39 16-Mar-2009  dsl ANSIfy functions with function-pointer arguments
 1.38 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.37 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.36 05-Mar-2009  tsutsui Remove __P().
 1.35 02-Jan-2008  ad branches: 1.35.10; 1.35.18; 1.35.24;
Merge vmlocking2 to head.
 1.34 17-Oct-2007  garbled branches: 1.34.2; 1.34.4; 1.34.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.33 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.32 25-Nov-2006  scw branches: 1.32.8; 1.32.16; 1.32.26; 1.32.28; 1.32.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.31 24-Nov-2006  wiz s/existance/existence/, from Zafer.
 1.30 11-Dec-2005  christos branches: 1.30.20; 1.30.22;
merge ktrace-lwp.
 1.29 15-Jul-2003  lukem branches: 1.29.16;
__KERNEL_RCSID()
 1.28 10-May-2003  thorpej branches: 1.28.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.27 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.26 03-Apr-2003  he Rename SBSIZE -> SBLOCKSIZE triggered by the UFS2 merge.
 1.25 04-Feb-2003  leo Fix typo.
 1.24 06-Jan-2003  wiz successful with only one l.
 1.23 16-Sep-2001  wiz branches: 1.23.4;
Spell 'occurred' with two 'r's.
 1.22 26-Jul-2001  wiz branches: 1.22.2;
auxilary -> auxiliary
 1.21 26-Jul-2001  wiz issueing -> issuing
 1.20 24-Apr-2001  leo branches: 1.20.2;
Handle cases in which the cpulabel pointer == NULL.
 1.19 20-Nov-2000  chs branches: 1.19.2;
rationalize the use of b_flags for geteblk() buffers.
rather than assigning to the whole field, set or clear individual flags,
which implies that the B_BUSY and B_INVAL flags will remain set.
this allows us to make the assertion in brelse() that B_BUSY is set,
which is the purpose of all this.
 1.18 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.17 22-Sep-1999  leo branches: 1.17.2; 1.17.8;
Make sure the pointer to the cpu_label is not NULL before trying to use it.
 1.16 05-Jul-1998  jonathan branches: 1.16.8;
* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
 1.15 15-Apr-1998  leo Don't clear the 'd_partitions' before starting to read the disklabel. Some
filesystems (iso9660) depend on the info they had already setup there.
 1.14 06-Mar-1998  fvdl Make this compile again.
 1.13 25-Apr-1997  leo Changes to bounds_check_with_label:
- Take care of the case where d_secsize < DEV_BSIZE (From Waldi Ravens)
- Don't check if an unsigned value <= 0. This was the cause of various
panics when savecore(1) was reading at bogus offsets because the crash
dump format was changed. Thanks to Jason for unintently revealing the
bug ;-)
 1.12 04-Oct-1996  leo Grok the broken ICD partition format. This should be part of the 1.2 patches.
 1.11 14-May-1996  leo branches: 1.11.4;
Make dk_establish() a void function.
 1.10 26-Apr-1996  leo Corrections for removed <sys/cpu.h> and some more prototypes.
 1.9 22-Mar-1996  leo Correct #ifdef that survived the after-debug cleanup (Thanks Chris).
 1.8 20-Mar-1996  leo Another bit of prototyping...
 1.7 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.6 19-Feb-1996  leo New disklabel handling code (Waldi Ravens).
These are the final (?) modifications to the layout of the NetBSD/Atari
bootblock. The bootblock handling can be made backwards compatible using
the right config options (COMPAT_11 + DISKLABEL_AHDI).
 1.5 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.4 14-Oct-1995  leo Allow only transfers that are a multiple of DEV_BSIZE when doing 'raw' I/O.
 1.3 05-Aug-1995  leo branches: 1.3.2;
Add disklabel support. In addition to the 'faked' disklables NetBSD/Atari
now also supports native NetBSD labels. When a NetBSD label is found it
overrules the Atari AHDI-partitioning.
 1.2 28-May-1995  leo Add FS_OTHER type partitions to 'user-partitions'
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.2.3 21-Nov-1995  leo Release checks on the AHDI-partition tables a little. Most formatters seem
to do a lousy job.
 1.3.2.2 27-Oct-1995  leo Fix memory leak in disklabel code when used on removables.
 1.3.2.1 21-Oct-1995  leo Oops, get it into the 1.1 branch.
 1.11.4.1 05-Dec-1996  rat Pullup rev 1.12 by request of Leo Weppelman <leo@wau.mis.ah.nl>

>Reason:
>The (native) ICD disk-toolbox does not correctly initialize the
>bad-sect-list values in the AHDI root-sector. This caused the
>kernel to think it was messing with an empty disk. This can cause
>significant data loss when using disklabel(1).
 1.16.8.1 04-Dec-1999  he Pull up revision 1.17 (requested by leo):
Make sure the pointer to the cpu_label is not NULL before trying
to use it.
 1.17.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.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.19.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.20.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.2.1 03-Aug-2001  lukem update to -current
 1.22.2.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.22.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.23.4.2 07-Jan-2003  thorpej Sync with HEAD.
 1.23.4.1 16-Sep-2001  thorpej file disksubr.c was added on branch nathanw_sa on 2003-01-07 21:04:31 +0000
 1.28.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.2.1 03-Aug-2004  skrll Sync with HEAD
 1.29.16.3 21-Jan-2008  yamt sync with head
 1.29.16.2 27-Oct-2007  yamt sync with head.
 1.29.16.1 30-Dec-2006  yamt sync with head.
 1.30.22.1 10-Dec-2006  yamt sync with head.
 1.30.20.1 12-Jan-2007  ad Sync with head.
 1.32.30.1 14-Oct-2007  yamt sync with head.
 1.32.28.2 09-Jan-2008  matt sync with HEAD
 1.32.28.1 06-Nov-2007  matt sync with HEAD
 1.32.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.32.16.1 16-Oct-2007  garbled Sync with HEAD
 1.32.8.1 09-Oct-2007  ad Sync with head.
 1.34.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.34.4.1 31-Dec-2007  ad Make compile with new buffer cache locking scheme.

XXX This should be largely MI, please do not make another clone of disksubr.c.
 1.34.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.35.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.35.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.35.10.3 11-Aug-2010  yamt sync with head.
 1.35.10.2 11-Mar-2010  yamt sync with head
 1.35.10.1 04-May-2009  yamt sync with head.
 1.41.4.1 30-May-2010  rmind sync with head
 1.41.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.43.60.1 10-Jun-2019  christos Sync with HEAD
 1.8 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.7 05-Mar-2009  tsutsui Remove __P().
 1.6 11-Dec-2005  christos branches: 1.6.78; 1.6.86; 1.6.92;
merge ktrace-lwp.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 20-Jul-1996  leo branches: 1.3.62;
Add a prototype.
 1.2 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.62.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.62.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.62.1 03-Aug-2004  skrll Sync with HEAD
 1.6.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.6.78.1 04-May-2009  yamt sync with head.
 1.16 15-Nov-2011  tsutsui Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
 1.15 18-Mar-2009  cegger branches: 1.15.12;
Ansify function definitions w/o arguments. Generated with sed.
 1.14 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.13 28-Apr-2008  martin branches: 1.13.8; 1.13.14;
Remove clause 3 and 4 from TNF licenses
 1.12 24-Dec-2005  perry branches: 1.12.74; 1.12.76; 1.12.78;
bare asm -> __asm
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 04-Jun-2005  he branches: 1.10.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 23-Jun-2003  martin branches: 1.8.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.7 09-Feb-2001  leo Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.
 1.6 24-Apr-1997  gwr branches: 1.6.22;
s/REGENTS/FOUNDATION/
 1.5 09-Dec-1996  thorpej Copyright assigned to The NetBSD Foundation.
 1.4 23-Aug-1996  leo Make the fpu config info print somewhat nicer.
 1.3 19-Apr-1996  leo Prototypes.
 1.2 09-Feb-1996  leo Remove reference to setjmp.h
 1.1 28-Aug-1995  leo Detect type and precence of an FPU in the kernel instead of relying on GEM.
 1.6.22.1 11-Feb-2001  bouyer Sync with HEAD.
 1.8.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.2.1 21-Jun-2006  yamt sync with head.
 1.12.78.2 04-May-2009  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.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.15.12.1 17-Apr-2012  yamt sync with head
 1.2 02-Jul-2022  tsutsui Use and print consistent CPU/MMU/FPU names.
 1.1 15-Nov-2011  tsutsui branches: 1.1.8;
Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
 1.1.8.2 17-Apr-2012  yamt sync with head
 1.1.8.1 15-Nov-2011  yamt file fpu_machdep.c was added on branch yamt-pagecache on 2012-04-17 00:06:08 +0000
 1.13 17-Mar-1997  leo Revert to new method of generating assym.h.
 1.12 03-Jan-1997  leo Get rid of 'cpu040' variable. Use 'mmutype' or 'cputype' for testing
instead.
 1.11 16-Oct-1996  leo locore.s now needs FR_SIZE.
 1.10 16-Sep-1996  leo Get it into sync with the previous changes to locore.s
 1.9 20-Mar-1996  leo Another bit of prototyping...
 1.8 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.7 02-Feb-1996  mycroft Don't define _KERNEL here.
 1.6 16-Dec-1995  leo Make an NMI activate the debugger. This only works on a TT and needs a small
hardware patch. This makes it easier to debug drivers that hang on an ipl
> splsoft.
 1.5 28-May-1995  leo Define T_FPEMUL? for locore.s
 1.4 14-May-1995  leo Fix double mapping of stack.
 1.3 05-May-1995  leo Remove some unused defines.
 1.2 30-Mar-1995  leo KERNEL -> _KERNEL
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.39 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.38 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.37 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.36 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.35 20-Feb-2020  skrll G/C
 1.34 17-Feb-2020  skrll G/C LS{SLEEP,RUN,ONPROC}

LWP status manipulation was moved out of assembly long ago.
 1.33 19-Dec-2018  maxv branches: 1.33.6;
Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.32 14-Jan-2011  rmind branches: 1.32.58; 1.32.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.31 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.30 10-Dec-2009  rmind branches: 1.30.4;
Rename L_ADDR to L_PCB and amend some comments accordingly.
 1.29 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.28 31-Dec-2008  tsutsui Remove quite obsolete pcb_cmap2.
 1.27 30-Apr-2008  martin branches: 1.27.8; 1.27.10;
Convert TNF licenses to new 2 clause variant
 1.26 17-Oct-2007  garbled branches: 1.26.16; 1.26.18; 1.26.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.25 18-May-2007  he branches: 1.25.10;
Adapt to the merge of the yamt-idlelwp branch.
curcpu()->ci_want_resched is now required, so get rid of the
want_resched global. Also, cpu_need_resched() now takes two arguments.
The l_next and l_back fields in struct lwp no longer exists, so delete
references to it from genassym.cf.
Also, m68k/m68k/proc_subr.s is no longer used, says mhitch, so remove its use.

This brings the atari BOOT kernel back to a buildable state.
 1.24 09-Feb-2007  ad branches: 1.24.6; 1.24.8; 1.24.14;
Merge newlock2 to head.
 1.23 11-Dec-2005  christos branches: 1.23.20; 1.23.24;
merge ktrace-lwp.
 1.22 04-Nov-2003  dsl branches: 1.22.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.21 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.20 08-Apr-2003  thorpej branches: 1.20.2;
Use PAGE_SIZE rather than NBPG.
 1.19 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.18 15-Apr-2002  bjh21 Only include opt_*.h #ifdef _KERNEL_OPT.
 1.17 24-Apr-2001  leo branches: 1.17.2; 1.17.8;
Don't emit SCU defines when it isn't present.
 1.16 21-Nov-2000  tsutsui branches: 1.16.2;
Define proper macros for FP frame offsets rather than magic numbers.
 1.15 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.14 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.13 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.12 06-May-1999  kleink branches: 1.12.2; 1.12.4; 1.12.6;
SVR4-related typo in previous.
 1.11 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.10 28-Mar-1999  simonb branches: 1.10.2; 1.10.4;
Hopefully get the last of the "ifdef UVM" bogons in genassym.cf's.
 1.9 01-Oct-1998  thorpej Define SYS_compat_13_sigreturn13.
 1.8 30-Sep-1998  thorpej Make sure SYS_exit and SYS___sigreturn14 are defined. Garbage collect
SYS_sigreturn.
 1.7 11-May-1998  leo Add UVM option.
 1.6 06-Jan-1998  thorpej Garbage-collect VM_PMAP.
 1.5 06-Jan-1998  thorpej Garbage-collect pm_stchanged.
 1.4 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.3 02-Jun-1997  leo branches: 1.3.4;
More stuff for handling an 68060.
 1.2 13-May-1997  gwr Eliminate references to vmspace.vm_pmap
 1.1 17-Mar-1997  leo Revert to new method of generating assym.h.
 1.3.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.10.2.1 21-Nov-1999  he Pull up revision 1.13 (requested by itohy):
Fix the problem where single-step tracing of a trap instruction
makes the system fall into kernel debugger.
 1.12.6.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.2 08-Dec-2000  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.16.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.17.8.6 05-Oct-2002  gmcgarry Add RAS offsets. Add FPU type values from mvme68k.
 1.17.8.5 02-Aug-2002  nathanw Don't need SAF_UPCALL anymore.
 1.17.8.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.17.8.3 17-Apr-2002  nathanw Catch up to -current.
 1.17.8.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.17.8.1 24-Apr-2001  scw file genassym.cf was added on branch nathanw_sa on 2001-11-17 23:18:03 +0000
 1.17.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.22.16.2 03-Sep-2007  yamt sync with head.
 1.22.16.1 26-Feb-2007  yamt sync with head.
 1.23.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.23.20.1 06-Feb-2007  ad Update m68k pasteware.
 1.24.14.1 22-May-2007  matt Update to HEAD.
 1.24.8.1 11-Jul-2007  mjf Sync with head.
 1.24.6.1 27-May-2007  ad Sync with head.
 1.25.10.1 06-Nov-2007  matt sync with HEAD
 1.26.20.3 11-Mar-2010  yamt sync with head
 1.26.20.2 04-May-2009  yamt sync with head.
 1.26.20.1 16-May-2008  yamt sync with head.
 1.26.18.1 18-May-2008  yamt sync with head.
 1.26.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.26.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.27.10.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/include/pcb.h: revision 1.8
Remove quite obsolete pcb_cmap2.
 1.27.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.30.4.1 05-Mar-2011  rmind sync with head
 1.32.60.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.32.60.1 10-Jun-2019  christos Sync with HEAD
 1.32.58.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.33.6.1 29-Feb-2020  ad Sync with head.
 1.33 19-Jan-2024  thorpej Now that we've agreed on the name "intr_depth", let's agree on the type, too.
 1.32 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.31 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.30 02-Jul-2022  tsutsui Misc cleanup.

- make local variables static
- use __func__ to print function names
- KNF
 1.29 02-Jul-2022  tsutsui Use queue(3) macro as hp300 etc. No binary change.
 1.28 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.27 10-Nov-2019  chs branches: 1.27.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.26 18-Oct-2014  snj branches: 1.26.20;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.25 26-Sep-2014  christos copy the leak fix to the other switch branch (from max)
 1.24 21-Sep-2014  christos fix leak.
 1.23 20-Dec-2010  matt branches: 1.23.18; 1.23.34;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.22 13-Apr-2010  tsutsui Misc KNF.
 1.21 31-Mar-2010  tsutsui Misc KNF and cosmetics.
 1.20 09-Feb-2010  wiz branches: 1.20.2;
Fix typo in comment.
 1.19 08-Jul-2009  tsutsui branches: 1.19.2;
Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.18 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.17 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.16 27-Dec-2008  tsutsui branches: 1.16.2;
Account idepth in all interrupt handlers in locore.s.
 1.15 28-Jun-2008  isaki branches: 1.15.4; 1.15.6;
Unify splraiseipl(9) implementation among m68k ports,
discussed with tsutsui@ on port-m68k. OK'ed by jdc@.

For atari:
- 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)
- vme/if_le_vme.c: fix a wrong usage of IPL_NET
 1.14 28-Apr-2008  martin branches: 1.14.2; 1.14.4;
Remove clause 3 and 4 from TNF licenses
 1.13 03-Dec-2007  ad branches: 1.13.14; 1.13.16; 1.13.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.12 21-Mar-2007  tsutsui branches: 1.12.12; 1.12.14; 1.12.20;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.11 11-Dec-2005  christos branches: 1.11.26; 1.11.30; 1.11.32; 1.11.34;
merge ktrace-lwp.
 1.10 15-Jul-2003  lukem branches: 1.10.16;
__KERNEL_RCSID()
 1.9 27-Sep-2002  provos branches: 1.9.6;
remove trailing \n in panic(). approved perry.
 1.8 29-Jun-2000  mrg branches: 1.8.4; 1.8.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.7 17-Sep-1999  thorpej branches: 1.7.2;
Centralize the declaration and clearing of `cold'.
 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 11-May-1998  leo Add UVM option.
 1.4 04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.3 15-Jul-1997  leo branches: 1.3.2;
Use '0' instead of NULL when talking about int's
 1.2 27-Jan-1997  leo Correct comment.
 1.1 26-Dec-1996  leo branches: 1.1.2;
Add intr_establish/disestablish functions. Currently only the lpt-driver
is converted to use them...
 1.1.2.1 30-Jan-1997  thorpej update from trunk
 1.3.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.8.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.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.16.2 07-Dec-2007  yamt sync with head
 1.10.16.1 03-Sep-2007  yamt sync with head.
 1.11.34.1 29-Mar-2007  reinoud Pullup to -current
 1.11.32.1 11-Jul-2007  mjf Sync with head.
 1.11.30.2 03-Dec-2007  ad Sync with HEAD.
 1.11.30.1 10-Apr-2007  ad Sync with head.
 1.11.26.1 24-Mar-2007  yamt sync with head.
 1.12.20.1 08-Dec-2007  mjf Sync with HEAD.
 1.12.14.1 09-Jan-2008  matt sync with HEAD
 1.12.12.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.13.18.5 11-Aug-2010  yamt sync with head.
 1.13.18.4 11-Mar-2010  yamt sync with head
 1.13.18.3 18-Jul-2009  yamt sync with head.
 1.13.18.2 04-May-2009  yamt sync with head.
 1.13.18.1 16-May-2008  yamt sync with head.
 1.13.16.1 18-May-2008  yamt sync with head.
 1.13.14.3 17-Jan-2009  mjf Sync with HEAD.
 1.13.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.13.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.4.1 03-Jul-2008  simonb Sync with head.
 1.14.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.15.6.1 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #219):
sys/arch/atari/include/intr.h: revision 1.19
sys/arch/atari/atari/locore.s: revision 1.102
sys/arch/atari/atari/intr.c: revision 1.16
Account idepth in all interrupt handlers in locore.s.
 1.15.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.15.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.16.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.20.2.2 05-Mar-2011  rmind sync with head
 1.20.2.1 30-May-2010  rmind sync with head
 1.23.34.1 10-Nov-2014  snj Pull up following revision(s) (requested by maxv in ticket #195):
sys/arch/arm/iomd/iomd_irqhandler.c: revision 1.21
sys/arch/arm/ofw/ofw_irqhandler.c: revision 1.21
sys/arch/atari/atari/intr.c: revision 1.24-1.25
sys/arch/ews4800mips/sbd/fb_sbdio.c: revision 1.14
sys/arch/hpcmips/tx/tx39icu.c: revision 1.34
sys/arch/shark/isa/isa_irqhandler.c: revision 1.27
sys/arch/sparc/sparc/machdep.c: revision 1.327
sys/arch/sparc64/dev/psycho.c: revision 1.119
sys/arch/sparc64/dev/schizo.c: revision 1.32
sys/arch/sparc64/sparc64/machdep.c: revision 1.279
sys/arch/sun68k/sun68k/bus.c: revision 1.22
sys/arch/x86/x86/ipmi.c: revision 1.58
sys/arch/xen/xen/privcmd.c: revision 1.46-1.49
Fix several memory leaks.
 1.23.18.1 03-Dec-2017  jdolecek update from HEAD
 1.26.20.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.27.8.1 03-Apr-2021  thorpej Sync with HEAD.
 1.6 08-Jul-2009  tsutsui Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.5 05-Mar-2009  tsutsui Remove __P().
 1.4 28-Apr-2008  martin branches: 1.4.8; 1.4.14;
Remove clause 3 and 4 from TNF licenses
 1.3 09-Oct-1997  jtc branches: 1.3.152; 1.3.154; 1.3.156;
Fix tipo inherited from old version of TNF copyright template.
 1.2 06-Jun-1997  leo branches: 1.2.4;
Guard agains multiple inclusion and pull in cpu.h to define clockframe.
 1.1 26-Dec-1996  leo Add intr_establish/disestablish functions. Currently only the lpt-driver
is converted to use them...
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.156.3 18-Jul-2009  yamt sync with head.
 1.3.156.2 04-May-2009  yamt sync with head.
 1.3.156.1 16-May-2008  yamt sync with head.
 1.3.154.1 18-May-2008  yamt sync with head.
 1.3.152.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.14.2 24-Oct-2010  jym Sync with HEAD
 1.4.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 08-Sep-2001  thomas branches: 1.4.4; 1.4.122; 1.4.124; 1.4.126;
Some ELF adaption.
 1.3 17-Jun-1998  leo branches: 1.3.26; 1.3.28;
Add some sense to the interrupt names.
 1.2 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.1 26-Dec-1996  leo branches: 1.1.10;
Add intr_establish/disestablish functions. Currently only the lpt-driver
is converted to use them...
 1.1.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.28.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.3.26.1 01-Oct-2001  fvdl Catch up with -current.
 1.4.126.1 16-May-2008  yamt sync with head.
 1.4.124.1 18-May-2008  yamt sync with head.
 1.4.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.4.2 08-Sep-2001  thomas Some ELF adaption.
 1.4.4.1 08-Sep-2001  thomas file intrcnt.h was added on branch nathanw_sa on 2001-09-08 11:14:34 +0000
 1.3 25-Sep-1996  leo The KDASSERT macro is now defined in libkern
 1.2 14-Feb-1996  leo Fix unterminated comment.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.23 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.22 16-Sep-2021  andvar fix various typos, mainly in comments.
 1.21 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.20 10-Nov-2019  chs branches: 1.20.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.19 13-Oct-2016  maya branches: 1.19.16;
Correct misleading indentation.
While here, remove whitespace.

NFC
 1.18 01-Jul-2011  dyoung branches: 1.18.12; 1.18.30; 1.18.34;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.17 18-Mar-2009  cegger bzero -> memset
 1.16 08-Mar-2009  tsutsui ANSIfy, some KNF, misc cosmetics.
 1.15 05-Mar-2009  tsutsui Remove __P().
 1.14 27-Dec-2008  tsutsui branches: 1.14.2;
Sprinkle volatile to bus_space(9) access functions.
 1.13 28-Apr-2008  martin branches: 1.13.8; 1.13.10;
Remove clause 3 and 4 from TNF licenses
 1.12 04-Mar-2007  christos branches: 1.12.40; 1.12.42; 1.12.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 29-Jan-2006  dsl branches: 1.11.22; 1.11.24;
Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
 1.10 24-Dec-2005  perry branches: 1.10.2;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 13-Feb-2004  wiz branches: 1.8.16;
Uppercase CPU, plural is CPUs.
 1.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 30-May-2002  thorpej branches: 1.6.6;
Don't use multi-line string literals.
 1.5 19-Jan-2000  leo branches: 1.5.8; 1.5.12; 1.5.20;
Allow storage-space to be passed to the alloc_bus_space_tag() functions. This
permits static tags to be used during early console init.
 1.4 19-Feb-1999  leo branches: 1.4.8;
Add <machine/bswap.h> in the list of include-files.
 1.3 25-May-1998  leo Add bus_space_{read,write}_region_stream_N functions.
 1.2 23-Apr-1998  leo Update copyright year (it really is 1998).
 1.1 10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.20.1 14-Jul-2002  gehenna catch up with -current.
 1.5.12.1 20-Jun-2002  nathanw Catch up to -current.
 1.5.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.2 03-Sep-2007  yamt sync with head.
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.10.2.1 01-Feb-2006  yamt sync with head.
 1.11.24.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.22.1 02-Jan-2009  jdc Pull up revisions:
1.10 src/sys/arch/atari/atari/be_bus.c
1.14 src/sys/arch/atari/atari/le_bus.c
1.8 src/sys/arch/atari/atari/mainbus.c
1.33 src/sys/arch/atari/dev/wdc_mb.c
(requested by tsutsui in ticket #1252).

Sprinkle volatile to bus_space(9) access functions.
 1.12.44.2 04-May-2009  yamt sync with head.
 1.12.44.1 16-May-2008  yamt sync with head.
 1.12.42.1 18-May-2008  yamt sync with head.
 1.12.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.12.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.10.1 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #218):
sys/arch/atari/dev/wdc_mb.c: revision 1.33
sys/arch/atari/atari/mainbus.c: revision 1.8
sys/arch/atari/atari/le_bus.c: revision 1.14
sys/arch/atari/atari/be_bus.c: revision 1.10
Sprinkle volatile to bus_space(9) access functions.
 1.13.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.13.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.34.1 04-Nov-2016  pgoyette Sync with HEAD
 1.18.30.1 05-Dec-2016  skrll Sync with HEAD
 1.18.12.1 03-Dec-2017  jdolecek update from HEAD
 1.19.16.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.20.8.1 03-Apr-2021  thorpej Sync with HEAD.
 1.127 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.126 17-Jan-2024  thorpej Make sigcode.s and sunos_sigcode.s build as their own stand-alone files.
 1.125 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.124 16-Jan-2024  thorpej Build m68k/support.s on its own; don't include it from locore.s
 1.123 12-Jan-2024  thorpej Remove getsp(); nothing uses it.
 1.122 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.121 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.120 26-Dec-2023  thorpej G/C unused ploadw().
 1.119 26-Dec-2023  thorpej G/C unused flushustp().
 1.118 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.117 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.116 30-May-2022  andvar branches: 1.116.4;
s/identifing/identifying/ and s/multipler/multiplier/ in comments.
 1.115 16-Mar-2022  andvar s/paniced/panicked/ and s/borken/broken/ in comments.
 1.114 03-May-2019  tsutsui Make sure interrupts are disabled during cpu_configure(9).

Fixes 'panic: kernel diagnostic assertion "cv_is_valid(cv)" failed'
during fdcisa(4) probe on Milan's DIAGNOSTIC kernel, caused by
a stray interrupt from the FDC right after isa_intr_establish().
No visible bad side effect on TT030 with this change.

Should be pulled up to netbsd-8.
 1.113 19-Mar-2019  thorpej G/C a couple of lingering instances of addupc(). There is still some bit-
rotten profiling code that references it, but that code is already almost
certainly broken for other reasons.
 1.112 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.111 20-Jan-2018  tsutsui branches: 1.111.2; 1.111.4;
Fix silent hang after isa_intr_establish() on Milan.

The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
 1.110 22-Dec-2011  tsutsui branches: 1.110.40;
Merge m68881_save() and m68881_restore() (using most common mvme68k ones).
All functions are checked by my eyes, and all GENERIC kernels compile.
 1.109 15-Nov-2011  tsutsui branches: 1.109.4;
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.108 08-Feb-2011  rmind branches: 1.108.4;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.107 20-Dec-2010  matt branches: 1.107.2; 1.107.4;
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.106 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.105 09-Apr-2010  tsutsui - establish zs interrupts via common intr_establish() function rather than
hardcording them in locore.s and vector.s
- also make interrupt handlers take per unit softc and put a softint cookie
into softc (though atari machines have only one zs)
- tweak some structures as per MI z8530sc driver

Tested on TT030 using sl(4) on zs.
 1.104 02-Dec-2009  tsutsui branches: 1.104.2; 1.104.4;
Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on TT030.
 1.103 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.102 27-Dec-2008  tsutsui Account idepth in all interrupt handlers in locore.s.
 1.101 03-Dec-2007  ad branches: 1.101.14; 1.101.18; 1.101.26; 1.101.28;
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.100 17-Oct-2007  garbled branches: 1.100.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.99 12-Jun-2007  mhitch branches: 1.99.8; 1.99.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.98 18-May-2007  he Adapt to the merge of the yamt-idlelwp branch.
curcpu()->ci_want_resched is now required, so get rid of the
want_resched global. Also, cpu_need_resched() now takes two arguments.
The l_next and l_back fields in struct lwp no longer exists, so delete
references to it from genassym.cf.
Also, m68k/m68k/proc_subr.s is no longer used, says mhitch, so remove its use.

This brings the atari BOOT kernel back to a buildable state.
 1.97 21-Mar-2007  tsutsui branches: 1.97.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.96 01-Sep-2006  matt branches: 1.96.6; 1.96.8; 1.96.12; 1.96.14; 1.96.16; 1.96.18;
Make sure .data is .long aligned. (fixes linker warning)
 1.95 11-Dec-2005  christos branches: 1.95.4; 1.95.8;
merge ktrace-lwp.
 1.94 04-Mar-2004  nathanw branches: 1.94.16;
Centralize identical copies of proc_trampoline code.

(lots more opportunites here for the bored hacker, such as rei and trap0...)
 1.93 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.92 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.91 08-Apr-2003  thorpej branches: 1.91.2;
Use PAGE_SIZE rather than NBPG.
 1.90 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.89 02-Nov-2002  chs finish conversion to the common m68k cacheops:
add support for machine-specific flavors of the ops for off-chip caches.
many thanks to Izumi Tsutsui for his help with this.
 1.88 23-May-2002  leo Force the absolute jump in a more elegant way. Suggested by Jaromir Dolecek.
 1.87 19-May-2002  leo branches: 1.87.2;
Try to defeat the assembler optimizer. If we jump to a local label, it tries
to use a pc-relative jump. Which is definitely not what is needed in the
relocation code!
This is new in the current assembler apparantly. None of the kernels build
after my latest upgrade were able to boot... What else is lurking!
 1.86 11-Feb-2002  wiz branches: 1.86.8;
s/seperate/separate/
 1.85 07-Jan-2002  thorpej Add missing register prefix.
 1.84 08-Sep-2001  thomas branches: 1.84.4;
Some ELF adaption.
 1.83 22-Jul-2001  wiz branches: 1.83.2;
seperate -> separate
 1.82 30-May-2001  lukem branches: 1.82.2;
add missing #include "opt_kgdb.h"
 1.81 28-May-2001  leo Add 'prev_sr' argument to milan_isa_intr() so we can properly defer interrupts
that come in at the wrong time.
 1.80 15-May-2001  leo Add some Milan support functions:
- Low level isa interrupt handler
- NMI fault handler - catches PLX access errors
- PCI configspace read/write functions
 1.79 12-Apr-2001  leo There are no level1 or level7 interrupts possible on the Milan...
 1.78 10-Apr-2001  leo full[tc]flush from GLOBAL -> ASLOCAL.
 1.77 17-Mar-2001  leo Conditionalize inclusion of the interrupt handlers for 'kbd', 'zs' and
'ncrscsi' since they are not present on the Milan.
 1.76 09-Feb-2001  leo branches: 1.76.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.
 1.75 26-Nov-2000  jdolecek split m68k SunOS and SVR4-specific sigcode.s code to sunos_sigcode.s
and svr4_sigcode.s respectively
adjust individual m68k port's locore.s to include new sigcode files if
appropriate
 1.74 21-Nov-2000  tsutsui Define proper macros for FP frame offsets rather than magic numbers.
 1.73 09-Oct-2000  leo Fix a typo that slipped in with the last round of scheduler changes. The
register numbers were exchanged.
 1.72 24-Sep-2000  jdolecek add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.71 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.70 13-Jun-2000  leo Throw in a bunch of _C_LABEL macro's. (Hi Klaus ;-)
 1.69 06-Jun-2000  leo _qs -> _sched_qs
 1.68 31-May-2000  thorpej Add a comment on single-processor systems about p_cpu being initialized
by fork1().
 1.67 26-May-2000  thorpej branches: 1.67.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.66 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.65 14-May-2000  minoura defopt FPSP.
 1.64 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.63 17-Sep-1999  thorpej branches: 1.63.2; 1.63.4; 1.63.6;
Centralize the declaration and clearing of `cold'.
 1.62 29-Apr-1999  christos Include opt_compat_sunos.h
 1.61 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.60 24-Mar-1999  mrg branches: 1.60.2;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.59 25-Feb-1999  is mac68k part of pr 6152 fix, and missing bits for the others
 1.58 25-Feb-1999  is Atari part of fix for pr 6152
 1.57 08-Jan-1999  leo Modifications of pmap_zero_page() and pmap_copy_page() inspired by recent
work from Jason Thorpe on the hp300 pmap.c.
Nuke the usage of the port-specific functions in favour of the m68k functions.
 1.56 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.55 30-Sep-1998  thorpej Garbage collect trap #1 and trap #2 handlers; they're moved to
trap_subr.s
 1.54 30-Sep-1998  thorpej Pull in opt_compat_netbsd.h
 1.53 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.52 04-Jul-1998  jonathan defopt DDB.
 1.51 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.50 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.49 11-May-1998  leo Add UVM option.
 1.48 05-Jan-1998  thorpej Fix a bogosity apparently inherited from when the Utah 4.3BSD code base
was converted to use Mach VM for Net2/4.4BSD. The user segment table
pointer was originally stored in the PCB. When Mach VM came along,
however, it was also stored in the pmap, and loaded into the PCB in
pmap_activate(). pmap_activate() would then note that the PCB's USTP
was now in sync with the pmap's USTP, and the low-level context switch
code would use the value from the PCB.

However, pmap_activate() would also load the hardware MMU context if
the pmap was the current pmap (or, in the case where pmaps can be shared,
such as in NetBSD, if the proc was the current proc). The low-level
context switch code would then reload the hardware _again_ using the
USTP from the PCB.

However, the optimization of not calling pmap_activate() if "stchanged"
was false ended up causing some processes to use stale USTP values from
the PCB when the low-level context switch code reloaded the hardware!
This was noticed by using a real vfork(2) (which worked for some time
before failing, surprisingly!)

Since I'm hard pressed to find any real optimization here (since the
hardware was always reloaded once, sometimes twice!), the code now always
calls pmap_activate(), which uses the correct USTP value (the one in the
pmap). The PCB's USTP is now ignored, and should eventually be g/c'd.

Another optimization can actually be performed, and I have added a comment
describing what it is, but have not yet implemented it.

Also note that most of the loadustp() functions where actually incomplete.
This has been corrected. These functions should probably be split up into
MMU-specific operations, and called indirectly, rather than doing constant
run-time decision making based on values that will never change during the
course of a boot's lifetime.
 1.47 01-Jan-1998  thorpej - Make pmap_activate() and pmap_deactivate() take a struct proc *.
- Define active_user_pmap() and use it in the appropriate places (from hp300
port).
 1.46 30-Jul-1997  leo Use a buserror handler that just tests for 'nofault' being set when the
MMU is not yet initialized. This behaviour is necessary when probing
for the machine type - because we need the type before we can setup the
tables....
 1.45 09-Jul-1997  leo branches: 1.45.2;
Introduce 'bootversion' in locore.s. Check this to decide if installing
a bootstrap with the running installboot makes sense.
 1.44 05-Jul-1997  leo Pull in latest Amiga bus/address error handling.
 1.43 04-Jul-1997  is addql does set condition codes, so we are not allowed to put it in between
the andl and the jeq.
Mea maxima culpa.
 1.42 26-Jun-1997  is The recent buserr handler cleanup in the Amiga locore.s made the label
_buserr point to the 68020/030 buserr code _only_. This has broken access
error handling in the 060 support code.
This is repaired by jumping to _buserr60 from the 060SP, and by providing
a _buserr60 label identical to the _buserr in the unchanged m68k ports
using the 68060.
 1.41 05-Jun-1997  leo * finalize 060 stuff.

For locore.s also nuke cacheop-functions now provided in m68k.
 1.40 02-Jun-1997  leo More stuff for handling an 68060.
 1.39 19-May-1997  leo Fix the 'shifting screens' bug on the Falcon. This solution is not perfect
since it gives a bit of flicker while switching frame buffers. From
Thomas Gerner.
 1.38 13-May-1997  gwr Eliminate references to vmspace.vm_pmap
 1.37 25-Apr-1997  thorpej Adjust for <m68k/m68k/trap_subr.s>
 1.36 13-Apr-1997  thorpej Use common m68k sigcode.
 1.35 09-Apr-1997  thorpej Use <m68k/m68k/proc_subr.s>
 1.34 30-Mar-1997  leo Remove a hardcoded interrupt handler. Now uses intr_establish() for the
SCSI-drq handler on the Hades.
 1.33 16-Mar-1997  thorpej Use <m68k/m68k/support.s>
 1.32 02-Feb-1997  thorpej Gerbage-collect extra copypage()
 1.31 04-Jan-1997  leo Remove ST-DMA handler, this interrupt now uses the glue code. Count the
clock interrupts in the new counter set.
 1.30 03-Jan-1997  leo Get rid of 'cpu040' variable. Use 'mmutype' or 'cputype' for testing
instead.
 1.29 26-Dec-1996  leo Add intr_establish/disestablish functions. Currently only the lpt-driver
is converted to use them...
 1.28 18-Dec-1996  leo Tweak the clockframe structure a bit so we are able to save a few cycles
at interrupt time. (From Gordon Ross).
 1.27 17-Nov-1996  leo Plug some spl-holes in the lp-driver. Also be more strict in protecting
the register access to the psg-chip. The combination of those bugs
caused the printer to print garbage sometimes.
 1.26 09-Nov-1996  leo Move the vector-table to kernel data space, so we can write to it.
 1.25 08-Nov-1996  leo Clear d0 before using it to turn off the 040 MMU. Clearing d0 was a side-effect
of the code removed in my previous commit.
 1.24 06-Nov-1996  cgd Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed. Rename remrq() to
remrunqueue().
 1.23 25-Oct-1996  leo Nuke 2 useless instructions that only cause _doboot to panic now that
page zero is *properly* protected.
 1.22 16-Oct-1996  leo Sync trace traps with the hp300.
 1.21 16-Sep-1996  leo Fix bootcode to work on the 68040.
 1.20 10-Sep-1996  leo - Add suline() for the new trap.c (Shouldn't this move to m68k/copy.s?)
- Fix some bugs in the interrupt handlers introduced by the new mapping
of the st io-area.
 1.19 12-Jul-1996  leo - Cleanup a bit
- Remove the kernel-jump-to-zero code as page zero mapping is removed
- Weed out cpu040 usage, use mmutype instead
- Fix doboot code
- add fill for page zero
- use m68k/sigreturn.s
 1.18 18-Jun-1996  leo Add fpfault & bus error handling corrections from Ignatios Souvatzis.
 1.17 26-May-1996  leo Add 'kernel_text' symbol (Gordon Ross).
 1.16 27-Mar-1996  leo branches: 1.16.4;
Add centronics printer driver.
 1.15 02-Feb-1996  mycroft assym.s -> assym.h
(Some ports did this already.)
 1.14 18-Dec-1995  leo Oops, forgot to change one fixed address into a define.
 1.13 16-Dec-1995  leo Make an NMI activate the debugger. This only works on a TT and needs a small
hardware patch. This makes it easier to debug drivers that hang on an ipl
> splsoft.
 1.12 11-Dec-1995  thorpej Move bcopy/ovbcopy/memcpy into m68/m68k/copy.s, which is used by all
m68k ports already anyhow. No use in keeping 6 identical copies of this
function around.
 1.11 30-Nov-1995  leo Add kernel option for separate {stat,prof}clock
 1.10 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.9 04-Sep-1995  leo branches: 1.9.2;
Add memcpy entry as suggested by gwr.
 1.8 11-Jul-1995  leo Remove some bogus comment.
 1.7 09-Jun-1995  leo Fix thinko
 1.6 28-May-1995  leo - Remove FPCOPROC ifdef's. Make fpu code dependant on fputype.
- Change clock interrupt handler: remove extra division by 4.
 1.5 21-May-1995  leo Remove icode, it doesn't seem to be used.
 1.4 14-May-1995  leo Fix double mapping of stack.
 1.3 10-May-1995  leo Ignore HBL/VBL interrupts instead of reporting them as stray as they
can't be turned off on a Falcon.
 1.2 05-May-1995  leo Shift system clocks from TT-mfp to ST-mfp for Falcon.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.9.2.2 21-Oct-1995  leo Don't call FPU specific functions before we are sure that there is an FPU.
 1.9.2.1 12-Oct-1995  leo Remove functions from locore.s that are duplicated in libkern. Also
replace blkclr() by bzero()
 1.16.4.1 18-Jun-1996  leo Pull up _kernel_text, fpfault & bus error changes.
 1.45.2.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.60.2.2 21-Nov-1999  he Pull up revision 1.64 (requested by itohy):
Fix the problem where single-step tracing of a trap instruction
makes the system fall into kernel debugger.
 1.60.2.1 30-Apr-1999  perry branches: 1.60.2.1.2;
pullup 1.61->1.62 (christos): conflicts manually edited
 1.60.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.63.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.63.4.1 15-Nov-1999  fvdl Sync with -current
 1.63.2.5 21-Apr-2001  bouyer Sync with HEAD
 1.63.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.63.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.63.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.63.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.67.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.76.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.76.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.82.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.82.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.82.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.82.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.82.2.1 03-Aug-2001  lukem update to -current
 1.83.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.84.4.7 11-Nov-2002  nathanw Catch up to -current
 1.84.4.6 24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.84.4.5 20-Jun-2002  nathanw Catch up to -current.
 1.84.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.84.4.3 11-Jan-2002  nathanw More catchup.
 1.84.4.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.84.4.1 08-Sep-2001  scw file locore.s was added on branch nathanw_sa on 2001-11-17 23:18:03 +0000
 1.86.8.1 30-May-2002  gehenna Catch up with -current.
 1.87.2.1 28-May-2002  lukem Pull up revision 1.88 (requested by leo):
Force the absolute jump in a more elegant way. Suggested by Jaromir Dolecek.
 1.91.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.91.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.91.2.1 03-Aug-2004  skrll Sync with HEAD
 1.94.16.3 07-Dec-2007  yamt sync with head
 1.94.16.2 03-Sep-2007  yamt sync with head.
 1.94.16.1 30-Dec-2006  yamt sync with head.
 1.95.8.1 03-Sep-2006  yamt sync with head.
 1.95.4.1 09-Sep-2006  rpaulo sync with head
 1.96.18.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.96.16.1 29-Mar-2007  reinoud Pullup to -current
 1.96.14.1 11-Jul-2007  mjf Sync with head.
 1.96.12.4 03-Dec-2007  ad Sync with HEAD.
 1.96.12.3 15-Jul-2007  ad Sync with head.
 1.96.12.2 27-May-2007  ad Sync with head.
 1.96.12.1 10-Apr-2007  ad Sync with head.
 1.96.8.1 24-Mar-2007  yamt sync with head.
 1.96.6.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.97.4.2 26-Jun-2007  garbled Sync with HEAD.
 1.97.4.1 22-May-2007  matt Update to HEAD.
 1.99.10.2 09-Jan-2008  matt sync with HEAD
 1.99.10.1 06-Nov-2007  matt sync with HEAD
 1.99.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.100.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.101.28.1 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #219):
sys/arch/atari/include/intr.h: revision 1.19
sys/arch/atari/atari/locore.s: revision 1.102
sys/arch/atari/atari/intr.c: revision 1.16
Account idepth in all interrupt handlers in locore.s.
 1.101.26.1 19-Jan-2009  skrll Sync with HEAD.
 1.101.18.3 11-Aug-2010  yamt sync with head.
 1.101.18.2 11-Mar-2010  yamt sync with head
 1.101.18.1 04-May-2009  yamt sync with head.
 1.101.14.1 17-Jan-2009  mjf Sync with HEAD.
 1.104.4.3 05-Mar-2011  rmind sync with head
 1.104.4.2 03-Jul-2010  rmind sync with head
 1.104.4.1 30-May-2010  rmind sync with head
 1.104.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.104.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.107.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.107.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.108.4.1 17-Apr-2012  yamt sync with head
 1.109.4.1 18-Feb-2012  mrg merge to -current.
 1.110.40.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.111.4.1 10-Jun-2019  christos Sync with HEAD
 1.111.2.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.116.4.1 27-Jun-2024  martin Pull up following revision(s) (requested by rin in ticket #724
to fix build fallout on the branch):

sys/arch/m68k/m68k/compat_16_sigreturn14.s: revision 1.6
sys/arch/mvme68k/mvme68k/locore.s: revision 1.129
sys/arch/news68k/news68k/locore.s: revision 1.84
sys/arch/hp300/hp300/locore.s: revision 1.183
sys/arch/m68k/m68k/compat_13_sigreturn13.s: revision 1.8
sys/arch/m68k/m68k/sigreturn.s: file removal
sys/arch/m68k/include/pte_motorola.h: revision 1.10
sys/arch/atari/atari/locore.s: revision 1.125
sys/arch/amiga/amiga/locore.s: revision 1.169
sys/arch/sun2/sun2/locore.s: revision 1.37
sys/arch/next68k/next68k/locore.s: revision 1.84
sys/arch/x68k/x68k/locore.s: revision 1.130
sys/arch/sun3/sun3x/locore.s: revision 1.77
sys/arch/cesfic/cesfic/locore.s: revision 1.45
sys/arch/m68k/conf/files.m68k: revision 1.53
sys/arch/sun3/sun3/locore.s: revision 1.109
sys/arch/luna68k/luna68k/locore.s: revision 1.81
sys/arch/mac68k/mac68k/locore.s: revision 1.182

Define PTE used in the pmap module int terms of the bit definitions
in mmu_{51,40}.h.

Make compat_13_sigreturn13.s and compat_16_sigreturn14.s build as their
own stand-alone files and G/C the now-empty sigreturn.s.
 1.191 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.190 13-Feb-2024  andvar s/enqueing/enqueuing/ in debug messages (took a bait from recent Nick's commit)
s/occaision/occasion/ in comment.
 1.189 07-Dec-2023  thorpej extent(9) -> vmem(9)
 1.188 03-Jul-2022  tsutsui Move the iomem extent stuff managed by bus_space(9) and make them static.

Inspired by MD bus_space(9) implemantation of arc.
Briefly tested on TT030.
 1.187 02-Jul-2022  tsutsui Use and print consistent CPU/MMU/FPU names.
 1.186 13-Mar-2022  andvar s/hander/handler/ and s/hader/header/ in comments and documentation.
 1.185 09-Oct-2021  tsutsui Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.
 1.184 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.183 11-Jun-2020  ad branches: 1.183.2;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
 1.182 31-Dec-2019  ad Rename uvm_free() -> uvm_availmem().
 1.181 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.180 29-Jun-2019  tsutsui Remove obsolete stuff.
 1.179 29-Jun-2019  tsutsui Fix PR/54325 (use of dangling pointer).
 1.178 29-Jun-2019  tsutsui TAB/space cleanup.
 1.177 26-Mar-2014  christos branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf
 1.176 24-Mar-2014  christos - remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.175 10-Aug-2012  tsutsui branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)
 1.174 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.173 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.172 12-Jun-2011  rmind branches: 1.172.2; 1.172.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.171 16-May-2011  tsutsui branches: 1.171.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.170 04-Mar-2011  joerg Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.169 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.168 16-Oct-2010  tsutsui branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.
 1.167 13-Apr-2010  tsutsui Misc KNF.
 1.166 31-Mar-2010  tsutsui Misc KNF and cosmetics.
 1.165 08-Feb-2010  joerg branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
 1.164 10-Dec-2009  matt branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.
 1.163 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.162 07-Nov-2009  cegger Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
 1.161 19-Aug-2009  he Another needing <sys/exec_aout.h>.
 1.160 05-Mar-2009  tsutsui Some KNF.
 1.159 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.158 24-Jan-2009  tsutsui branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.
 1.157 21-Jan-2009  he Re-adapt to the changed return types for major() and minor().
 1.156 17-Jan-2009  tsutsui Use PRIu64 to print 64 bit dev_t (for now).
 1.155 03-Jan-2009  tsutsui Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.
 1.154 30-Nov-2008  martin As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
 1.153 25-Nov-2008  ad dumpsys: don't spew numbers into the log.
 1.152 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.151 11-Nov-2008  dyoung It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks(). Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown(). No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown(). I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that. Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
 1.150 02-Jul-2008  ad branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.149 08-Jan-2008  joerg branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.
 1.148 03-Jan-2008  joerg ANSIfy.
 1.147 03-Dec-2007  ad branches: 1.147.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.146 17-Oct-2007  garbled branches: 1.146.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.145 21-May-2007  tsutsui branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.
 1.144 21-Mar-2007  tsutsui branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.143 04-Mar-2007  christos branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.142 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.141 09-Feb-2007  ad branches: 1.141.2;
Merge newlock2 to head.
 1.140 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.139 24-Dec-2005  perry branches: 1.139.20; 1.139.22;
bare asm -> __asm
 1.138 11-Dec-2005  christos merge ktrace-lwp.
 1.137 04-Jun-2005  he branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.136 25-Apr-2005  lukem Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.
 1.135 11-Feb-2005  yamt 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.134 24-Mar-2004  atatat branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
 1.133 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.132 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.131 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.130 27-Sep-2003  cl Cast through (void *) to appease gcc3.
 1.129 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.128 15-Jul-2003  lukem __KERNEL_RCSID()
 1.127 29-Jun-2003  fvdl branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.126 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.125 23-Jun-2003  martin Make sure to include opt_foo.h if a defflag option FOO is used.
 1.124 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.123 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.122 26-Apr-2003  ragge Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.121 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.120 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.119 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.118 19-Sep-2002  ragge Do not include <sys/clist.h>, it's not used in NetBSD at all.
 1.117 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.116 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.115 09-Apr-2002  leo branches: 1.115.2;
Pull in prototype for setregs()
 1.114 20-Mar-2002  christos kill remaining PS_STRINGS instances.
 1.113 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.112 10-Sep-2001  chris branches: 1.112.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.111 24-Aug-2001  chs branches: 1.111.2;
use pmap_k* for buffer cache pages.
 1.110 02-Jun-2001  chs branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.109 15-May-2001  leo Add an NMI handler for the Milan.
 1.108 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.107 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.106 09-Feb-2001  leo branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.
 1.105 15-Jan-2001  thorpej Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.104 07-Jan-2001  leo Expand identify_cpu() for the Milan.
 1.103 07-Jan-2001  leo Update the printf format in straymfpint() too.
 1.102 07-Jan-2001  leo Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.
 1.101 28-Sep-2000  leo Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).
 1.100 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.99 02-Jul-2000  cgd undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h
 1.98 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.97 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.96 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.95 05-Jun-2000  jhawk Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)
 1.94 26-May-2000  thorpej branches: 1.94.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.93 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.92 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.91 19-Jan-2000  thorpej Move callout initialization to a single location; no need to duplicate
that code all over the place.
 1.90 19-Jan-2000  msaitoh check whether tv_usec >= 1000000
 1.89 04-Dec-1999  ragge CL* discarding.
 1.88 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.87 28-Oct-1999  leo Use extent maps.
 1.86 22-Jul-1999  leo branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.
 1.85 28-Jun-1999  itojun - Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.
 1.84 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.83 26-May-1999  leo Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....
 1.82 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.81 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.80 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.79 01-Apr-1999  thorpej branches: 1.79.2;
Don't call configure() from cpu_startup().
 1.78 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.77 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.76 27-Feb-1999  scottr defopt BUFCACHE and BUFPAGES.
 1.75 09-Jan-1999  thorpej Garbage-collect `mbutl'.
 1.74 24-Nov-1998  leo Implement BUFCACHE option as suggested by lukem.
 1.73 24-Nov-1998  leo Make compile with -DDEBUG
 1.72 24-Nov-1998  leo Pull-in device.h for configure() prototype.
 1.71 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.70 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.69 11-Aug-1998  leo Add CCITT & NATM interrupt handlers. (Jonathan Stone).
 1.68 05-Jul-1998  jonathan * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
 1.67 05-Jul-1998  jonathan defopt NS, NSIP.
 1.66 05-Jul-1998  jonathan defopt ISO TPIP.
 1.65 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.64 04-Jul-1998  jonathan defopt DDB.
 1.63 09-Jun-1998  tv Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.
 1.62 11-May-1998  leo Add UVM option.
 1.61 07-May-1998  leo Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.
 1.60 13-Mar-1998  leo Move the bus_* functions from machdep.c to bus.c .
 1.59 10-Mar-1998  leo Bus-dma implementation for the atari. Heavily based on the i386
implementation.
 1.58 19-Feb-1998  thorpej Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.
 1.57 24-Jan-1998  mycroft When dumping, print out the device number as major,minor.
 1.56 04-Dec-1997  tv Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.
 1.55 22-Oct-1997  leo Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.
 1.54 19-Sep-1997  leo branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
 1.53 12-Sep-1997  mycroft Set the status word as well, and remove a bogus comment.
 1.52 12-Sep-1997  mycroft Always initialize all registers in setregs().
 1.51 11-Sep-1997  mycroft Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)
 1.50 15-Jul-1997  leo branches: 1.50.2;
Implement bus_space_subregion()
 1.49 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainilne.
 1.48 10-Jun-1997  veego s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/
 1.47 08-Jun-1997  veego Initialize machine from MACHINE.
 1.46 09-Apr-1997  thorpej branches: 1.46.2;
Garbage-collect regdump() and friends.
 1.45 06-Apr-1997  leo Calculate dumpsize correctly (in pages).
 1.44 02-Apr-1997  christos Add netatalk netisr
 1.43 27-Mar-1997  thorpej Don't allocate mclrefcnt[]; it's dead and gone.
 1.42 26-Mar-1997  gwr Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/
 1.41 26-Mar-1997  leo Use m68k/sig_machdep.c
 1.40 26-Mar-1997  leo Add missing 'break'.
 1.39 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.38 10-Mar-1997  leo Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.
 1.37 27-Jan-1997  leo branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.
 1.36 21-Jan-1997  leo Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.
 1.35 14-Dec-1996  leo branches: 1.35.2;
Remove some code accidently checked in on previous commit.
 1.34 08-Nov-1996  leo Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.
 1.33 06-Nov-1996  leo Add bus_mem_(un)map functions.
 1.32 25-Oct-1996  leo db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]
 1.31 13-Oct-1996  christos backout previous kprintf changes
 1.30 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.29 25-Sep-1996  leo Catchup with -current:
- Extra argument to boot()
- select -> poll
 1.28 23-Aug-1996  leo Recognize the Hades as a valid machine type.
 1.27 23-Aug-1996  leo - Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.
 1.26 09-Aug-1996  mrg Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.
 1.25 12-Jul-1996  leo Sync with atari_init cleanup
 1.24 29-Jun-1996  leo Remove references to kern_extern.h
 1.23 26-Apr-1996  leo branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.
 1.22 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.21 27-Mar-1996  leo Allow call-back functions to drop to spl0().
 1.20 10-Mar-1996  leo Add the include files and the atari kernel support for new format panic
dumps.
 1.19 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.18 04-Jan-1996  jtc Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.
 1.17 25-Dec-1995  leo Add doshutdownhooks
 1.16 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.15 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.14 01-Sep-1995  mycroft SA_ONSTACK --> SS_ONSTACK
 1.13 28-Aug-1995  leo Fix typo in previous commit
 1.12 28-Aug-1995  leo Detect type and precence of an FPU in the kernel instead of relying on GEM.
 1.11 13-Jul-1995  leo Add pppintr() to netintr().
 1.10 11-Jul-1995  leo Dumping works, now if there were tools to handle it...
 1.9 28-May-1995  leo Remove FPCOPROC use fputype instead.
 1.8 21-May-1995  leo Set A2 to PS_STRINGS.
 1.7 14-May-1995  leo - Remove double mapping of stack
- Change to new coredump format
 1.6 10-May-1995  leo Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.
 1.5 05-May-1995  leo Report "real mem" correctly and make one single module for handling
software interrupts.
 1.4 27-Apr-1995  leo Removed cpuspeed
 1.3 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.2 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.23.4.1 30-Jun-1996  jtc Pulled up rev 1.24 by request from Leo Weppelman
 1.35.2.1 30-Jan-1997  thorpej update from trunk
 1.37.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.37.2.1 12-Feb-1997  mrg don't allocate swap map in allocsys.
 1.46.2.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.50.2.2 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.50.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.54.2.2 08-May-1998  mycroft Pull up patch from leo.
 1.54.2.1 23-Oct-1997  mellon Pull version 1.55 up from trunk
 1.79.2.1 16-Apr-1999  chs branches: 1.79.2.1.2; 1.79.2.1.4;
pull up 1.79 -> 1.80:
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.79.2.1.4.2 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.79.2.1.4.1 28-Jun-1999  itojun KAME/NetBSD 1.4 SNAP kit, dated 19990628.

NOTE: this branch (kame) is used just for refernce. this may not compile
due to multiple reasons.
 1.79.2.1.2.3 02-Aug-1999  thorpej Update from trunk.
 1.79.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.79.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.86.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.86.4.1 15-Nov-1999  fvdl Sync with -current
 1.86.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.86.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.86.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.86.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.94.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.106.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.106.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.110.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.110.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.110.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.110.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.110.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.110.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.111.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.112.4.11 18-Oct-2002  nathanw Catch up to -current.
 1.112.4.10 17-Sep-2002  nathanw Catch up to -current.
 1.112.4.9 27-Aug-2002  nathanw Catch up to -current.
 1.112.4.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.112.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.112.4.6 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.112.4.5 17-Apr-2002  nathanw Catch up to -current.
 1.112.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.112.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.112.4.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.112.4.1 10-Sep-2001  scw file machdep.c was added on branch nathanw_sa on 2001-11-17 23:18:04 +0000
 1.115.2.2 30-Aug-2002  gehenna catch up with -current.
 1.115.2.1 17-May-2002  gehenna Replace the access to devsw table and the hard-coded major with devsw API.
 1.127.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.127.2.5 15-Feb-2005  skrll Sync with HEAD.
 1.127.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.127.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.127.2.2 03-Aug-2004  skrll Sync with HEAD
 1.127.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.134.10.1 12-Feb-2005  yamt sync with head.
 1.134.8.1 29-Apr-2005  kent sync with -current
 1.137.2.6 21-Jan-2008  yamt sync with head
 1.137.2.5 07-Dec-2007  yamt sync with head
 1.137.2.4 03-Sep-2007  yamt sync with head.
 1.137.2.3 26-Feb-2007  yamt sync with head.
 1.137.2.2 30-Dec-2006  yamt sync with head.
 1.137.2.1 21-Jun-2006  yamt sync with head.
 1.139.22.1 22-Oct-2006  yamt sync with head
 1.139.20.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.139.20.1 18-Nov-2006  ad Sync with head.
 1.141.2.3 24-Mar-2007  yamt sync with head.
 1.141.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.141.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.143.6.1 29-Mar-2007  reinoud Pullup to -current
 1.143.4.1 11-Jul-2007  mjf Sync with head.
 1.143.2.3 03-Dec-2007  ad Sync with HEAD.
 1.143.2.2 27-May-2007  ad Sync with head.
 1.143.2.1 10-Apr-2007  ad Sync with head.
 1.144.4.1 22-May-2007  matt Update to HEAD.
 1.145.10.3 23-Mar-2008  matt sync with HEAD
 1.145.10.2 09-Jan-2008  matt sync with HEAD
 1.145.10.1 06-Nov-2007  matt sync with HEAD
 1.145.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.146.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.146.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.147.6.1 08-Jan-2008  bouyer Sync with HEAD
 1.149.14.1 03-Jul-2008  simonb Sync with head.
 1.149.12.3 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.149.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.149.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.149.10.4 11-Aug-2010  yamt sync with head.
 1.149.10.3 11-Mar-2010  yamt sync with head
 1.149.10.2 16-Sep-2009  yamt sync with head
 1.149.10.1 04-May-2009  yamt sync with head.
 1.149.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.149.6.1 02-Jul-2008  mjf Sync with HEAD.
 1.150.6.2 02-Feb-2009  snj Pull up following revision(s) (requested by ad in ticket #346):
sys/arch/alpha/alpha/machdep.c: revision 1.311
sys/arch/amiga/amiga/machdep.c: revision 1.211
sys/arch/atari/atari/machdep.c: revision 1.153
sys/arch/hp700/hp700/machdep.c: revision 1.53
sys/arch/i386/i386/dumpsys.c: revision 1.5
sys/arch/mips/mips/mips_machdep.c: revision 1.206
sys/arch/mvme68k/mvme68k/machdep.c: revision 1.132
sys/arch/news68k/news68k/machdep.c: revision 1.75
sys/arch/next68k/next68k/machdep.c: revision 1.88
sys/arch/sparc/sparc/machdep.c: revision 1.285
sys/arch/sparc64/sparc64/machdep.c: revision 1.230
sys/arch/sun2/sun2/machdep.c: revision 1.56
sys/arch/sun3/sun3/machdep.c: revision 1.188
sys/arch/sun3/sun3x/machdep.c: revision 1.114
sys/arch/x68k/x68k/machdep.c: revision 1.153
dumpsys: don't spew numbers into the log.
 1.150.6.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #229):
sys/arch/atari/atari/machdep.c: revision 1.155
Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.
Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.
Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.
Should be pulled up to netbsd-5.
 1.150.4.3 28-Apr-2009  skrll Sync with HEAD.
 1.150.4.2 03-Mar-2009  skrll Sync with HEAD.
 1.150.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.150.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.158.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.164.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.164.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.165.2.4 31-May-2011  rmind sync with head
 1.165.2.3 05-Mar-2011  rmind sync with head
 1.165.2.2 30-May-2010  rmind sync with head
 1.165.2.1 18-Mar-2010  rmind Unify /dev/{mem,kmem,zero,null} implementations in MI code. Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
 1.168.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.168.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.168.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.171.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.172.6.1 18-Feb-2012  mrg merge to -current.
 1.172.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.172.2.2 30-Oct-2012  yamt sync with head
 1.172.2.1 17-Apr-2012  yamt sync with head
 1.175.4.1 18-May-2014  rmind sync with head
 1.175.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.177.30.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.177.30.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.177.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.177.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.183.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.14 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.13 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.12 10-Nov-2019  chs branches: 1.12.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.11 01-Jul-2011  dyoung branches: 1.11.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.10 08-Mar-2009  tsutsui ANSIfy, some KNF, misc cosmetics.
 1.9 05-Mar-2009  tsutsui Remove __P().
 1.8 27-Dec-2008  tsutsui branches: 1.8.2;
Sprinkle volatile to bus_space(9) access functions.
 1.7 19-Dec-2008  cegger use M_ZERO on malloc() and remove subsequent bzero().
 1.6 28-Apr-2008  martin branches: 1.6.8; 1.6.10;
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.24; 1.4.26;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem branches: 1.3.16;
__KERNEL_RCSID()
 1.2 25-May-1998  leo branches: 1.2.48;
Add bus_space_{read,write}_region_stream_N functions.
 1.1 10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.2.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.48.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 03-Sep-2007  yamt sync with head.
 1.4.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.4.24.1 02-Jan-2009  jdc Pull up revisions:
1.10 src/sys/arch/atari/atari/be_bus.c
1.14 src/sys/arch/atari/atari/le_bus.c
1.8 src/sys/arch/atari/atari/mainbus.c
1.33 src/sys/arch/atari/dev/wdc_mb.c
(requested by tsutsui in ticket #1252).

Sprinkle volatile to bus_space(9) access functions.
 1.5.44.2 04-May-2009  yamt 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.2 17-Jan-2009  mjf Sync with HEAD.
 1.5.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.10.1 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #218):
sys/arch/atari/dev/wdc_mb.c: revision 1.33
sys/arch/atari/atari/mainbus.c: revision 1.8
sys/arch/atari/atari/le_bus.c: revision 1.14
sys/arch/atari/atari/be_bus.c: revision 1.10
Sprinkle volatile to bus_space(9) access functions.
 1.6.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.6.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.11.54.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.12.8.1 03-Apr-2021  thorpej Sync with HEAD.
 1.37 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.36 08-Feb-2011  rmind branches: 1.36.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.35 14-Mar-2009  dsl branches: 1.35.4; 1.35.6; 1.35.8;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.34 19-Dec-2008  cegger branches: 1.34.2;
use M_ZERO on malloc() and remove subsequent bzero().
 1.33 06-Mar-2007  tsutsui branches: 1.33.40; 1.33.44; 1.33.52;
Remove an unnecessary cast.
 1.32 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.31 11-Dec-2005  christos branches: 1.31.26;
merge ktrace-lwp.
 1.30 07-Aug-2003  agc branches: 1.30.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.29 15-Jul-2003  lukem __KERNEL_RCSID()
 1.28 01-Apr-2003  thorpej branches: 1.28.2;
Use PAGE_SIZE rather than NBPG.
 1.27 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.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 09-Apr-2002  leo branches: 1.25.2;
Oops, clicked in a '+' from the diff..
 1.24 09-Apr-2002  leo Define minor for DEV_NVRAM
 1.23 27-Feb-2002  christos - Use DEV_ constants, instead of documenting the numbers!
- Delete cdev_decl(mm); where appropriate, and other hand-crufting [hi powerpc!]
 1.22 10-Sep-2001  chris branches: 1.22.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.21 24-Apr-2001  thorpej branches: 1.21.2; 1.21.4;
Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.20 29-Jun-2000  mrg branches: 1.20.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.19 29-Jun-2000  mhitch Add cdev_decl() to declare mm*() routines.
 1.18 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.17 04-Dec-1999  ragge branches: 1.17.4;
CL* discarding.
 1.16 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.15 27-Mar-1999  mycroft branches: 1.15.8; 1.15.10; 1.15.14;
Oops; vm_offset_t -> vaddr_t.
 1.14 26-Mar-1999  mycroft Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.13 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.12 19-Nov-1998  mrg fix problems in many d_mmap routines:
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.


XXX XXX XXX
the d_mmap cdev routine should be changed to have a prototype like:
paddr_t (*d_mmap) __P((dev_t, off_t, int));

by someone!
 1.11 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.10 11-May-1998  leo Add UVM option.
 1.9 25-Apr-1997  leo branches: 1.9.8;
Use info on the actual RAM-segments to check the validity of /dev/mem
accesses. Reformat some comments.
 1.8 26-Mar-1997  leo Apply optimizations suggested by gwr & mycroft.
 1.7 02-Feb-1997  thorpej zeropage -> devzeropage, and make it static.
 1.6 26-Apr-1996  leo Corrections for removed <sys/cpu.h> and some more prototypes.
 1.5 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.4 06-Jan-1996  leo Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.3 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.2 10-Apr-1995  mycroft Add mmopen(), mmclose(), and mmmmap() where appropriate. Lock vmmap when
needed. Make types consistent.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.9.8.1 23-Nov-1998  cgd Fix many real and potential security problems with character device
driver mmap routines that did not properly bounds check offsets.
See NetBSD security advisory NetBSD-SA1998-005 for details. Done
as a patch because it's large, and a fair number of bits are different
in -current. (mrg)
 1.15.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.10.1 15-Nov-1999  fvdl Sync with -current
 1.15.8.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.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.20.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.21.4.2 10-Oct-2001  fvdl Convert all remaining devices.
 1.21.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.21.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.21.2.3 17-Jun-2002  jdolecek catch up kqueue branch with -current
 1.21.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.21.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.22.4.5 11-Nov-2002  nathanw Catch up to -current
 1.22.4.4 17-Sep-2002  nathanw Catch up to -current.
 1.22.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.22.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.22.4.1 10-Sep-2001  nathanw file mem.c was added on branch nathanw_sa on 2002-02-28 04:08:22 +0000
 1.25.2.1 17-May-2002  gehenna Add the character device switch.
 1.28.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.2.1 03-Aug-2004  skrll Sync with HEAD
 1.30.16.1 03-Sep-2007  yamt sync with head.
 1.31.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.33.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.33.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.33.44.1 04-May-2009  yamt sync with head.
 1.33.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.33.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.34.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.35.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.35.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.35.4.1 18-Mar-2010  rmind Unify /dev/{mem,kmem,zero,null} implementations in MI code. Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
 1.36.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.5 12-Apr-1996  leo Just give them more descriptive names.
 1.4 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.3 21-May-1995  leo Fixup free_stmem().
 1.2 22-Apr-1995  leo Change allocation algorithm to best-fit, fix bug in free_stmem.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2 12-Apr-1996  leo Just give them more descriptive names.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.124 06-Dec-2009  tsutsui Remove old MD pmap.c files for amiga and atari.
They no longer work due to reorganization of common pmap_motorola.c.
 1.123 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.122 07-Nov-2009  cegger Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
 1.121 21-Oct-2009  rmind Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.120 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.119 18-Aug-2009  thorpej Add a real API for testing if a page is a managed page, and adjust callers
to stop relying on vm_physseg_find() for this purpose.
 1.118 21-Apr-2009  cegger change pmap flags argument from int to u_int.
discussed with christos@ on source-changes-d@
 1.117 18-Mar-2009  cegger bzero -> memset
 1.116 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.115 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.114 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.113 17-Jan-2009  tsutsui branches: 1.113.2;
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.112 01-Jan-2009  tsutsui Remove declarations of CADDR1, CADDR2, and vmmap.
These variables have been moved into pmap_bootstrap.c
and <m68k/pmap_motorola.h> has extern decls for them.
 1.111 01-Jan-2009  tsutsui Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.110 01-Jan-2009  tsutsui Pull a change from amiga/pmap.c rev 1.124 for yamt-idlelwp merge.
 1.109 19-Dec-2008  cegger use M_ZERO on malloc() and remove subsequent bzero().
 1.108 10-Dec-2008  pooka Make kernel_pmap_ptr a const. Requested by steve_martin.
 1.107 09-Dec-2008  pooka Make pmap_kernel() a MI macro for struct pmap *kernel_pmap_ptr,
which is now the "API" provided by the pmap module. pmap_kernel()
remains as the syntactic sugar.

Bonus cosmetics round: move all the pmap_t pointer typedefs into
uvm_pmap.h.

Thanks to Greg Oster for providing cpu muscle for doing test builds.
 1.106 15-Nov-2008  abs Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
 1.105 29-Jun-2008  tsutsui branches: 1.105.2; 1.105.4; 1.105.6;
Sync with arch/m68k/m68k/pmap_motorola.c rev 1.38:
> Remove ({ }) gcc extensions and use static inline functions instead.
 1.104 28-Apr-2008  martin branches: 1.104.2; 1.104.4;
Remove clause 3 and 4 from TNF licenses
 1.103 27-Apr-2008  tsutsui - use mutex(9) for uvm_kernel_object
- fix warnings in #ifdef DEBUG
 1.102 17-Oct-2007  garbled branches: 1.102.16; 1.102.18; 1.102.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.101 23-Jul-2007  he branches: 1.101.6;
Same change as -r1.133 of src/sys/arch/amiga/amiga/pmap.c:
As per hint from ad@, change uvm.kernel_object to uvm_kernel_object,
to adapt to the recent uvm changes.
 1.100 16-Jul-2007  macallan branches: 1.100.2; 1.100.4;
change pmap_phys_address()s parameter to paddr_t since that's what it gets
fed from mmap*() anyway
approved by gimpy
 1.99 22-May-2007  mhitch From pmap_motorols,c:

Allow pmap_enter_ptpage to fail, sometimes. Pass WAIT/NOWAIT flags and
fix some obvious locking problems. This allows us to run a LOCKDEBUG
ernel now.
 1.98 06-Mar-2007  tsutsui branches: 1.98.2; 1.98.4; 1.98.10;
Add a missed '*'.
 1.97 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.96 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.95 21-Feb-2007  thorpej Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.94 16-Sep-2006  mhitch branches: 1.94.4; 1.94.6; 1.94.8;
Sync with m68060 fix from amiga pmap.

Uvm changes over 17 months ago resulted in the 68040/060 segment table
page being entered with pmap_kenter(), which does not record the mapping
in the pv table. Attempting to inhibit caching of that page as required
by the 68060 hardware no longer changes the PTE and caused varying degrees
of multiple faulting, sometimes resulting in an unusable system. Apparently
very few people attempted to run a 68060 based system since that change.
Fix to to change the caching bits directly rather than using pmap_changebit().
 1.93 04-Aug-2006  mhitch branches: 1.93.2; 1.93.4;
gcc4 "uninitialized" variables; just like pmap_motorola.c and amiga/pmap.c.
 1.92 11-Dec-2005  christos branches: 1.92.4; 1.92.8;
merge ktrace-lwp.
 1.91 04-Jun-2005  he branches: 1.91.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.90 29-May-2005  chs in pmap_enter(), preset the mod/ref bits based on the flags argument.
fixes 25640.
 1.89 25-Apr-2005  skrll Add lost RCSId.
 1.88 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.87 01-Jan-2005  yamt branches: 1.87.2; 1.87.4; 1.87.8;
introduce vm_map_kernel, a subclass of vm_map, and
move some kernel-only members of vm_map to it.
 1.86 27-Sep-2003  cl branches: 1.86.2; 1.86.6;
Cast through (void *) to appease gcc3.
 1.85 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.84 15-Jul-2003  lukem __KERNEL_RCSID()
 1.83 10-May-2003  thorpej branches: 1.83.2;
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.82 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.81 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.80 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.79 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.78 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.77 02-Jan-2002  chs branches: 1.77.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.76 16-Dec-2001  tsutsui Fix comments for ref-count of PT pages.
 1.75 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.74 24-Nov-2001  isaki fix typo s/68551/68851/ in a comment.
 1.73 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.72 29-Sep-2001  chs branches: 1.72.4;
fix typo in pmap_kremove() which was invalidating the wrong TLB entry.
from Hiroki Tanikawa in PR 14099.
 1.71 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.70 06-Sep-2001  leo branches: 1.70.2;
Changes for Chuck Silvers:
implement pmap_k{enter_pa,remove}() correctly.
remove various checks for impossible conditions.
other misc cleanup.
 1.69 26-Aug-2001  tsutsui sysctl(2) -> sysctl(3) (in comments)
 1.68 02-Jun-2001  chs branches: 1.68.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.67 26-May-2001  chs replace vm_page_t with struct vm_page *.
 1.66 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.65 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.64 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.63 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.62 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.61 01-Feb-2001  leo branches: 1.61.2;
Announce page-size to the VM-system. Thanks to Izumi Tsutsui for pointing
this out.
 1.60 14-Jan-2001  thorpej splimp() -> splvm()
 1.59 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.58 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.57 29-Jun-2000  leo Get 060 CacheCopyBack support in line with the amiga (and working ;-)
 1.56 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.55 26-Mar-2000  kleink branches: 1.55.4;
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.54 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.53 16-Sep-1999  leo branches: 1.53.2; 1.53.4; 1.53.8;
Make this compile again.
 1.52 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.51 09-Jul-1999  thorpej Fix a typo.
 1.50 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.49 18-Jun-1999  leo Update pmap_check_wiring(). Also attach TNF copyright because of the
pmap_remove_mapping() changes.
 1.48 17-Jun-1999  thorpej pmap_change_wiring() -> pmap_unwire().
 1.47 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.46 17-Jun-1999  leo Comply with the changes Jason suggested yesterday. A copy of his log message:
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.45 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.44 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.43 27-Mar-1999  mycroft branches: 1.43.2;
Oops; forgot to change some pmap_enter() calls.
 1.42 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.41 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.40 25-Feb-1999  is Atari part of fix for pr 6152
 1.39 13-Jan-1999  leo As Ignatios suggested:
Use CCB when dealing with a 68040 type MMU (for cache consistency).
 1.38 08-Jan-1999  leo Modifications of pmap_zero_page() and pmap_copy_page() inspired by recent
work from Jason Thorpe on the hp300 pmap.c.
Nuke the usage of the port-specific functions in favour of the m68k functions.
 1.37 20-Nov-1998  leo Fix parameters of uvm_unmap().
 1.36 06-Oct-1998  leo Fix DEBUG printf
 1.35 28-Sep-1998  leo This was a copy of an very old editing error in the amiga pmap.c....
(Ignatios Souvatzis)
 1.34 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.33 08-Jul-1998  thorpej Define one page free list, and put all pages on it.
 1.32 12-Jun-1998  leo Make this compile for the M68060 (Thomas Gerner)
 1.31 11-Jun-1998  leo Add some function decls previously declared elsewhere??? While here make them
static.
 1.30 28-May-1998  leo Fix some errors occuring when compiling with DEBUG. These errors were hinted
at by recent hp300/mac68k changes.
 1.29 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.28 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.27 19-May-1998  thorpej It is no longer necessary for pmap_pinit() and pmap_release() to be
pmap interface functions, as NetBSD no longer uses statically allocated
pmaps (except for the kernel pmap, which is special-cased anyhow).
 1.26 11-May-1998  leo Add UVM option.
 1.25 07-May-1998  leo Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.
 1.24 06-Jan-1998  thorpej Garbage-collect pm_stchanged; it's not used by anything.
 1.23 06-Jan-1998  thorpej Garbage-collect use of the PCB's copy of the user segment table pointer.
 1.22 01-Jan-1998  thorpej - Make pmap_activate() and pmap_deactivate() take a struct proc *.
- Define active_user_pmap() and use it in the appropriate places (from hp300
port).
 1.21 19-Sep-1997  leo Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
 1.20 10-Jun-1997  veego branches: 1.20.4;
s/atari_round_seg/m68k_round_seg/ s/atari_trunc_seg/m68k_trunc_seg/
s/atari_round_page/m68k_round_page/ s/atari_btop/m68k_btop/
s/atari_ptob/m68k_ptob/
 1.19 04-Jun-1997  leo Use m68k cacheops
 1.18 10-Mar-1997  leo Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.
 1.17 06-Nov-1996  leo branches: 1.17.6;
pmap_changebit() can no longer be static since the bus_mem* functions use
it.
 1.16 13-Oct-1996  christos backout previous kprintf changes
 1.15 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.14 23-Aug-1996  leo Fix a compiler error.
 1.13 20-Jul-1996  leo Checkpoint integration of 68040 MMU support. Also fix oversight in allocation
of (virtual) I/O area address range.
 1.12 12-Jul-1996  leo Sync with cleanup of atari_init.c
 1.11 19-Apr-1996  leo Check for curproc being NULL in pmap_remove().
 1.10 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.9 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.8 25-Dec-1995  leo Fix possible integer overflow when allocating PT map.
 1.7 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.6 16-Sep-1995  leo branches: 1.6.2;
Fix segment table reference bug (Michael Hitch)
 1.5 11-Jul-1995  leo Oops, this one is also needed to make dumping work.
 1.4 09-Jun-1995  leo Support & require MACHINE_NONCONTIG
 1.3 14-May-1995  leo Fix double mapping of stack.
 1.2 10-Apr-1995  mycroft Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.6.2.1 12-Oct-1995  leo Remove functions from locore.s that are duplicated in libkern. Also
replace blkclr() by bzero()
 1.17.6.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.20.4.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.43.2.1 26-Apr-1999  perry branches: 1.43.2.1.2;
pullup 1.43->1.44 (chuq)
 1.43.2.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.43.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.53.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.53.4.1 15-Nov-1999  fvdl Sync with -current
 1.53.2.5 23-Apr-2001  bouyer Sync with HEAD.
 1.53.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.53.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.53.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.53.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.55.4.1 06-Jul-2000  leo Pullup: atari_init.c 1.49-1.50, pmap.c 1.56-1.57. Approved by thorpej.

Get 060 CacheCopyBack support in line with the amiga (and working ;-)
 1.61.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.61.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.68.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.68.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.68.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.68.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.70.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.72.4.8 18-Oct-2002  nathanw Catch up to -current.
 1.72.4.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.72.4.6 24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.72.4.5 20-Jun-2002  nathanw Catch up to -current.
 1.72.4.4 08-Jan-2002  nathanw Catch up to -current.
 1.72.4.3 18-Nov-2001  scw In pmap_activate(), we only need to load the pmap if switching to
a new/different process.
 1.72.4.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.72.4.1 29-Sep-2001  scw file pmap.c was added on branch nathanw_sa on 2001-11-17 23:18:05 +0000
 1.77.8.1 30-May-2002  gehenna Catch up with -current.
 1.83.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.83.2.5 01-Apr-2005  skrll Sync with HEAD.
 1.83.2.4 17-Jan-2005  skrll Sync with HEAD.
 1.83.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.83.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.83.2.1 03-Aug-2004  skrll Sync with HEAD
 1.86.6.1 08-Jun-2005  tron Pull up revision 1.90 (requested by chs in ticket #1980):
in pmap_enter(), preset the mod/ref bits based on the flags argument.
fixes 25640.
 1.86.2.1 08-Jun-2005  tron Pull up revision 1.90 (requested by chs in ticket #1980):
in pmap_enter(), preset the mod/ref bits based on the flags argument.
fixes 25640.
 1.87.8.1 06-Jun-2005  tron Pull up revision 1.90 (requested by chs in ticket #424):
in pmap_enter(), preset the mod/ref bits based on the flags argument.
fixes 25640.
 1.87.4.4 18-Feb-2005  chs with the new km API, we must longer explicitly unmap and free the
st_map pages, so don't. also, use the correct km type for freeing the
st_map space on amiga.
 1.87.4.3 31-Jan-2005  yamt convert to new apis.
 1.87.4.2 27-Jan-2005  yamt follow uvm_km_pgremove prototype change.
 1.87.4.1 26-Jan-2005  yamt convert arch/atari to new apis.
 1.87.2.1 29-Apr-2005  kent sync with -current
 1.91.2.3 03-Sep-2007  yamt sync with head.
 1.91.2.2 26-Feb-2007  yamt sync with head.
 1.91.2.1 30-Dec-2006  yamt sync with head.
 1.92.8.1 11-Aug-2006  yamt sync with head
 1.92.4.1 09-Sep-2006  rpaulo sync with head
 1.93.4.1 18-Nov-2006  ad Sync with head.
 1.93.2.1 23-Sep-2006  snj Pull up following revision(s) (requested by mhitch in ticket #178):
sys/arch/atari/atari/pmap.c: revision 1.94
Sync with m68060 fix from amiga pmap.
Uvm changes over 17 months ago resulted in the 68040/060 segment table
page being entered with pmap_kenter(), which does not record the mapping
in the pv table. Attempting to inhibit caching of that page as required
by the 68060 hardware no longer changes the PTE and caused varying degrees
of multiple faulting, sometimes resulting in an unusable system. Apparently
very few people attempted to run a 68060 based system since that change.
Fix to to change the caching bits directly rather than using pmap_changebit().
 1.94.8.1 04-Jun-2007  wrstuden Update to today's netbsd-4.
 1.94.6.2 12-Mar-2007  rmind Sync with HEAD.
 1.94.6.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.94.4.2 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.94.4.1 30-May-2007  riz Pull up following revision(s) (requested by mhitch in ticket #682):
sys/arch/atari/atari/pmap.c: revision 1.99
sys/arch/amiga/amiga/pmap.c: revision 1.125
From pmap_motorols,c:
Allow pmap_enter_ptpage to fail, sometimes. Pass WAIT/NOWAIT flags and
fix some obvious locking problems. This allows us to run a LOCKDEBUG
ernel now.
 1.98.10.2 03-Oct-2007  garbled Sync with HEAD
 1.98.10.1 22-May-2007  matt Update to HEAD.
 1.98.4.1 11-Jul-2007  mjf Sync with head.
 1.98.2.2 20-Aug-2007  ad Sync with HEAD.
 1.98.2.1 27-May-2007  ad Sync with head.
 1.100.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.100.2.1 07-Aug-2007  matt Sync with HEAD.
 1.101.6.1 06-Nov-2007  matt sync with HEAD
 1.102.20.5 11-Mar-2010  yamt sync with head
 1.102.20.4 16-Sep-2009  yamt sync with head
 1.102.20.3 19-Aug-2009  yamt sync with head.
 1.102.20.2 04-May-2009  yamt sync with head.
 1.102.20.1 16-May-2008  yamt sync with head.
 1.102.18.1 18-May-2008  yamt sync with head.
 1.102.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.102.16.2 02-Jul-2008  mjf Sync with HEAD.
 1.102.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.104.4.1 03-Jul-2008  simonb Sync with head.
 1.104.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.105.6.3 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.69
sys/arch/atari/atari/pmap.c: revision 1.111 via patch
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.9
sys/arch/atari/include/pmap.h: revision 1.39 via patch
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and
pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.105.6.2 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/pmap.c: revision 1.110
Pull a change from amiga/pmap.c rev 1.124 for yamt-idlelwp merge.
 1.105.6.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.68
sys/arch/atari/atari/pmap.c: revision 1.106
sys/arch/atari/include/pmap.h: revision 1.37
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
 1.105.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.105.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.105.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.113.2.2 24-Oct-2010  jym Sync with HEAD
 1.113.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.11 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.10 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.9 10-Mar-2018  tsutsui Fix another possible out of bounds.
 1.8 22-Dec-2016  cherry branches: 1.8.8; 1.8.14;
switch all ports to use uvm_init.c:uvm_md_init()

uvm_setpagesize() is now subsumed within this funciton.
 1.7 13-Apr-2010  tsutsui branches: 1.7.18; 1.7.36; 1.7.40;
Remove a declaration of unused variable.
 1.6 06-Dec-2009  tsutsui branches: 1.6.2; 1.6.4;
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.5 06-Dec-2009  tsutsui pm_stfree in struct pmap is a bitmap value so make it unsigned.
 1.4 23-Nov-2009  rmind Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.3 13-Mar-2009  abs branches: 1.3.2;
Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.
 1.2 17-Jan-2009  tsutsui branches: 1.2.2; 1.2.4; 1.2.6;
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.1 01-Jan-2009  tsutsui branches: 1.1.2; 1.1.4;
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.1.4.2 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.1.4.1 01-Jan-2009  bouyer file pmap_bootstrap.c was added on branch netbsd-4 on 2009-01-15 22:40:54 +0000
 1.1.2.3 26-Mar-2009  snj Pull up following revision(s) (requested by abs in ticket #612):
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.3
sys/arch/atari/atari/atari_init.c: revision 1.76
sys/arch/atari/include/pmap.h: revision 1.40
sys/arch/atari/include/vmparam.h: revision 1.24
Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.
 1.1.2.2 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.69
sys/arch/atari/atari/pmap.c: revision 1.111 via patch
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.9
sys/arch/atari/include/pmap.h: revision 1.39 via patch
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and
pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.1.2.1 01-Jan-2009  snj file pmap_bootstrap.c was added on branch netbsd-5 on 2009-01-08 22:45:30 +0000
 1.2.6.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.4.3 28-Apr-2009  skrll Sync with HEAD.
 1.2.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.2.4.1 17-Jan-2009  skrll file pmap_bootstrap.c was added on branch nick-hppapmap on 2009-01-19 13:16:00 +0000
 1.2.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.2.1 17-Jan-2009  mjf file pmap_bootstrap.c was added on branch mjf-devfs2 on 2009-01-17 13:27:54 +0000
 1.3.2.4 11-Aug-2010  yamt sync with head.
 1.3.2.3 11-Mar-2010  yamt sync with head
 1.3.2.2 04-May-2009  yamt sync with head.
 1.3.2.1 13-Mar-2009  yamt file pmap_bootstrap.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:46 +0000
 1.6.4.1 30-May-2010  rmind sync with head
 1.6.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.7.40.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.7.36.1 05-Feb-2017  skrll Sync with HEAD
 1.7.18.1 03-Dec-2017  jdolecek update from HEAD
 1.8.14.1 15-Mar-2018  pgoyette Synch with HEAD
 1.8.8.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.4 07-Dec-2004  chs use the m68k-common procfs_machdep.c on all m68k platforms.
 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:23 +0000
 1.2.24.4 18-Dec-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.20 24-Jan-2023  mlelstv whitespace, no code change.
 1.19 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.18 02-Jul-2022  tsutsui Misc KNF. No binary change.
 1.17 31-May-2022  tsutsui Restore NULL pointer checks lost in rev 1.16.

Fixes PR port-atari/56859, ok'ed mlelstv@, and confirmed on TT030.
Should be pulled up to netbsd-9 and netbsd-8.
 1.16 03-Jan-2014  mlelstv branches: 1.16.22; 1.16.34;
Fix allocator routines. Instead of abusing CIRCLEQ pointers, add an explicit
type field to tag memory nodes that are or are not on the free list.
 1.15 27-Nov-2013  christos Change the queue.3 *_END(&head) macros to NULL. Since we don't have CIRCLEQ
anymore, all the macros expand to NULL anyway, so this improves readability.
Requested by rmind@
 1.14 23-Nov-2013  christos convert from CIRCLEQ to TAILQ; remove open coding.
 1.13 13-Apr-2010  tsutsui branches: 1.13.8; 1.13.18; 1.13.22;
Misc KNF.
 1.12 18-Mar-2009  cegger branches: 1.12.2; 1.12.4;
Ansify function definitions w/o arguments. Generated with sed.
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 11-Dec-2005  christos branches: 1.10.78; 1.10.86; 1.10.92;
merge ktrace-lwp.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 13-Oct-1996  christos branches: 1.8.62;
backout previous kprintf changes
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.6 12-Apr-1996  leo Prototyping.
 1.5 12-Apr-1996  leo Just give them more descriptive names.
 1.4 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.3 21-May-1995  leo Fixup free_stmem().
 1.2 22-Apr-1995  leo Change allocation algorithm to best-fit, fix bug in free_stmem.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.8.62.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.62.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.62.1 03-Aug-2004  skrll Sync with HEAD
 1.10.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.10.78.2 11-Aug-2010  yamt sync with head.
 1.10.78.1 04-May-2009  yamt sync with head.
 1.12.4.1 30-May-2010  rmind sync with head
 1.12.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.13.22.1 18-May-2014  rmind sync with head
 1.13.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.34.1 04-Jun-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1462):

sys/arch/atari/atari/stalloc.c: revision 1.17

Restore NULL pointer checks lost in rev 1.16.

Fixes PR port-atari/56859, ok'ed mlelstv@, and confirmed on TT030.
Should be pulled up to netbsd-9 and netbsd-8.
 1.16.22.1 04-Jun-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1747):

sys/arch/atari/atari/stalloc.c: revision 1.17

Restore NULL pointer checks lost in rev 1.16.

Fixes PR port-atari/56859, ok'ed mlelstv@, and confirmed on TT030.
Should be pulled up to netbsd-9 and netbsd-8.
 1.7 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.6 03-Jan-2014  mlelstv Fix allocator routines. Instead of abusing CIRCLEQ pointers, add an explicit
type field to tag memory nodes that are or are not on the free list.
 1.5 23-Nov-2013  christos convert from CIRCLEQ to TAILQ; remove open coding.
 1.4 05-Mar-2009  tsutsui branches: 1.4.12; 1.4.22; 1.4.26;
Remove __P().
 1.3 12-Apr-1996  leo branches: 1.3.170; 1.3.178; 1.3.184;
Prototyping.
 1.2 12-Apr-1996  leo Just give them more descriptive names.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.184.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.178.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.170.1 04-May-2009  yamt sync with head.
 1.4.26.1 18-May-2014  rmind sync with head
 1.4.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.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.2 22-Apr-1995  christos Remove sunos_machdep.c
 1.1 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.12 31-Jan-1997  thorpej This file is obsolete; this information is now generated by config(8).
 1.11 12-Jan-1997  leo Another part of the rd->md saga...
 1.10 01-Jan-1997  leo Fix some leftovers from rd -> md rename.
 1.9 06-Nov-1996  leo Re-arrange the order in which devices are scanned for a root filesystem.
It's really bogus to try a floppy before a harddisk.
 1.8 13-Oct-1996  christos backout previous kprintf changes
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.6 26-Apr-1996  leo Corrections for removed <sys/cpu.h> and some more prototypes.
 1.5 19-Mar-1996  leo Use the right cd-names.
 1.4 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.3 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.2 30-Nov-1995  leo KNF-ify
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.25 03-Nov-2002  chs use a merged sys_machdep.c for all the motorola-MMU m68k platforms.
 1.24 13-Dec-2000  jdolecek branches: 1.24.8;
g/c obsolete vtrace(2) stuff
 1.23 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.22 28-Nov-1999  is Fix typo (&& -> &).
 1.21 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.20 15-Jul-1999  leo branches: 1.20.2; 1.20.8;
Make this compile again.
 1.19 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.18 26-Feb-1999  is branches: 1.18.2; 1.18.4;
synchronize types, and s/curproc/p/ in one forgotten place
 1.17 25-Feb-1999  is mac68k part of pr 6152 fix, and missing bits for the others
 1.16 25-Feb-1999  is Atari part of fix for pr 6152
 1.15 19-Jan-1999  thorpej No need for <sys/mtio.h>
 1.14 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.13 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.12 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.11 25-Feb-1998  perry note second parm of sysarch() is now void *, + trivial KNF, etc.
 1.10 04-Jun-1997  leo Use m68k cacheops
 1.9 19-May-1997  veego Fix lossage from the latest vm_pmap changes.
 1.8 10-Mar-1997  leo Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.
 1.7 03-Jan-1997  leo branches: 1.7.6;
Get rid of 'cpu040' variable. Use 'mmutype' or 'cputype' for testing
instead.
 1.6 23-Aug-1996  leo Fix some compiler warnings.
 1.5 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.4 03-Dec-1995  leo Something forgotten in the namespace changes.
 1.3 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.2 19-Sep-1995  thorpej branches: 1.2.2;
Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.2.1 12-Oct-1995  leo Rename sysarch to sys_sysarch
 1.7.6.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.18.4.1 02-Aug-1999  thorpej Update from trunk.
 1.18.2.2 29-Nov-1999  he Pull up revision 1.22 (requested by is):
Fix a typo which caused excessive cache flushes.
 1.18.2.1 27-Nov-1999  he Pull up revision 1.21 (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.20.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.20.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.20.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.24.8.4 11-Nov-2002  nathanw Catch up to -current
 1.24.8.3 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.24.8.2 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.24.8.1 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.119 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.118 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.117 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.116 21-Nov-2019  ad mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.
 1.115 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.114 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.113 04-Mar-2015  martin branches: 1.113.18;
Handle EINVAL in the fault path and send SIGBUS on mmap'd access past EOF
 1.112 19-Feb-2012  rmind branches: 1.112.2; 1.112.16;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.111 08-Feb-2011  rmind branches: 1.111.4; 1.111.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.110 17-Jan-2011  tsutsui branches: 1.110.2;
Explicitly include <machine/pcb.h> for struct pcb.
 1.109 20-Dec-2010  matt branches: 1.109.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.108 07-Jul-2010  chs implement ucas_* for m68k.
 1.107 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.106 20-Mar-2010  chs fix copy{in,out}{,str}() to return the error returned by uvm_fault().
fixes PR 41813.
 1.105 23-Nov-2009  rmind branches: 1.105.2; 1.105.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.104 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.103 18-Mar-2009  cegger bcopy -> memcpy
 1.102 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.101 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.100 05-Mar-2009  tsutsui Remove __P().
 1.99 27-Jan-2009  martin branches: 1.99.2;
Centralize fpu exception to siginfo code encoding for all m68k archs,
fixes a failure in the lib/libc/ieeefp/except regression test.
 1.98 15-Oct-2008  wrstuden branches: 1.98.2; 1.98.4;
Merge wrstuden-revivesa into HEAD.
 1.97 27-Apr-2008  tsutsui branches: 1.97.2; 1.97.6;
Fix warnings #ifdef DEBUG case.
 1.96 24-Apr-2008  ad branches: 1.96.2;
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.95 03-Dec-2007  ad branches: 1.95.14; 1.95.16;
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.94 05-Nov-2007  ad branches: 1.94.2;
Don't set l_usrpri / spc_curpriority here. mi_userret() does it.
 1.93 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.92 01-Sep-2007  mhitch branches: 1.92.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.91 12-Jun-2007  mhitch branches: 1.91.4; 1.91.8; 1.91.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.90 21-May-2007  tsutsui curlwp can't be NULL so no need to check it.
 1.89 18-May-2007  he Adapt to the merge of the yamt-idlelwp branch.
curcpu()->ci_want_resched is now required, so get rid of the
want_resched global. Also, cpu_need_resched() now takes two arguments.
The l_next and l_back fields in struct lwp no longer exists, so delete
references to it from genassym.cf.
Also, m68k/m68k/proc_subr.s is no longer used, says mhitch, so remove its use.

This brings the atari BOOT kernel back to a buildable state.
 1.88 21-Mar-2007  tsutsui branches: 1.88.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.87 04-Mar-2007  christos branches: 1.87.2; 1.87.4; 1.87.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.86 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.85 09-Feb-2007  ad branches: 1.85.2;
Merge newlock2 to head.
 1.84 23-Jul-2006  ad branches: 1.84.4; 1.84.8; 1.84.10;
Use the LWP cached credentials where sane.
 1.83 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.82 15-May-2006  yamt include kauth.h for kauth_cred_geteuid.
 1.81 14-May-2006  elad integrate kauth.
 1.80 15-Mar-2006  drochner branches: 1.80.2;
adapt to uvm_fault() interface cleanup: kill the useless 3rd argument
 1.79 11-Dec-2005  christos branches: 1.79.4; 1.79.6; 1.79.8; 1.79.10;
merge ktrace-lwp.
 1.78 04-Jun-2005  he branches: 1.78.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.77 28-Aug-2004  jdolecek use uvm_grow() to update stack segment size on stack page fault instead
of MD code
 1.76 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.75 08-Nov-2003  tsutsui Remove obsolete comments about curproc.
 1.74 02-Nov-2003  he Extend the #ifdef M68040 so that the `sig' variable declaration is moved
in as well, as it's otherwise not used.
 1.73 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.72 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.71 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.70 17-Sep-2003  cl add MD part of SA/pthread pagefault handling on all m68k ports
 1.69 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.68 15-Jul-2003  lukem __KERNEL_RCSID()
 1.67 23-Jun-2003  martin branches: 1.67.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.66 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.65 28-Jan-2003  wiz success, not sucess. Noted by mjl.
 1.64 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.63 14-Feb-2002  chs branches: 1.63.12;
allow writing to write-only mappings. fixes PR 3493.
 1.62 10-Sep-2001  chris branches: 1.62.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.61 02-Jun-2001  chs branches: 1.61.2; 1.61.4;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.60 30-May-2001  lukem add missing #include "opt_kgdb.h"
 1.59 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.58 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.57 23-Dec-2000  jdolecek branches: 1.57.2;
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.56 19-Dec-2000  scw Unification of the m68k syscall() function.
 1.55 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.54 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.53 27-Jun-2000  mrg remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h>
 1.52 06-Jun-2000  soren defopt SYSCALL_DEBUG.
 1.51 27-May-2000  sommerfeld branches: 1.51.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.50 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.49 24-May-2000  thorpej Use preempt(), not an open-coded equivalent (which won't be
equivalent for long).
 1.48 30-Mar-2000  leo Make this compile with -DDEBUG
 1.47 05-Dec-1999  ragge clrnd()/clbase() discarding.
 1.46 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.45 26-Oct-1999  itohy Fix the problem that single-step tracing of a trap instruction
drops the system into kernel debugger.
 1.44 08-Jul-1999  thorpej branches: 1.44.2; 1.44.4; 1.44.6;
Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.43 18-Jun-1999  thorpej Sync up with the following hp300 trap.c change:

revision 1.41
date: 1996/09/07 22:26:50; author: mycroft; state: Exp; lines: +5 -20
Use SIGBUS iff we get a legitimate bus fault. Use SIGSEGV for page protection
violations (per Solaris, SVR4, AIX, Linux, Irix, and SunOS).

...which happens to eliminate an unsafe call to uvm_map_checkprot().
 1.42 26-Mar-1999  mycroft branches: 1.42.2; 1.42.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.41 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.40 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.39 15-Dec-1998  itohy Added COMPAT_LINUX support.
 1.38 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.37 06-Oct-1998  leo Some DEBUG fixups
 1.36 01-Oct-1998  thorpej Adapt to signal changes.
 1.35 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.34 04-Jul-1998  jonathan defopt DDB.
 1.33 25-Jun-1998  thorpej defopt COMPAT_SUNOS
 1.32 25-Jun-1998  thorpej defopt KTRACE
 1.31 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.30 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.29 11-May-1998  leo Add UVM option.
 1.28 08-Jul-1997  kleink branches: 1.28.4;
From sun3:
Correct handling for Trap #2 in SunOS executables,
now that we know it is supposed to flush the cache.
(Was thought to be "some obscure FPU operation".)
 1.27 04-Jun-1997  leo Use m68k cacheops
 1.26 19-May-1997  veego Fix lossage from the latest vm_pmap changes.
 1.25 09-Apr-1997  thorpej regdump() takes a struct trapframe *
 1.24 16-Jan-1997  gwr Use db_regs_t instead of struct mc68020_saved_state
 1.23 04-Jan-1997  leo branches: 1.23.2;
Use the [HD|WR]FAULT macro's from the hp300 version of trap.c and use
cputype where appropriate.
 1.22 15-Oct-1996  leo - Some re-arrangements that make tracking of the hp300 version easier.
- Re-write panictrap() so that faults generated by the debugger can be
handled by the debugger.
- Add a small bit of extra checking to the MMU_FAULT case, to make it more
robust against pieces of the proc-structure being NULL (Jason Thorpe)
- If p == NULL at the entry of trap(), assign proc0 to it. Fixes a *lot* of
NULL-pointer dereferences. (Gordon Ross)
 1.21 13-Oct-1996  christos backout previous kprintf changes
 1.20 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.19 04-Oct-1996  leo Only prototype the writeback() function when the M68040 option is defined.
 1.18 10-Sep-1996  leo Conform to the hp300 style of trap.c as suggested by Jason.
 1.17 07-Sep-1996  mycroft Use SIGBUS iff we get a legitimate bus fault. Use SIGSEGV for page protection
violations (per Solaris, SVR4, AIX, Linux, Irix, and SunOS).
 1.16 12-Jul-1996  leo Fix a prototype warning.
 1.15 15-May-1996  leo Prototype + -Wall fixes.
 1.14 29-Apr-1996  leo There seem to be 2 types for a trap frame....
 1.13 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.12 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.11 11-Feb-1996  leo Be a bit more carefull when accessing the proc structure on a kernel buserror.
 1.10 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.9 02-Sep-1995  leo branches: 1.9.2;
Fix missing clock-ticks in child after fork as suggested by cgd & Allan Briggs.
 1.8 28-May-1995  leo Add emulation traps.
 1.7 21-May-1995  leo Get syscall() code in sync with the rest of the world.
 1.6 14-May-1995  leo Remove double mapping of stack
 1.5 05-May-1995  leo Report "real mem" correctly and make one single module for handling
software interrupts.
 1.4 22-Apr-1995  christos Fixed comparison in SYS__syscall to be against sysent instead of
p->p_emul->e_sysent [Thanks Charles for pointing this out].
I think that this code needs to be fixed anyway for emulations where
SYS_syscall is not the same number as the NetBSD one (0)... (Only the
alpha port so far?)
 1.3 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.2 26-Mar-1995  leo cgd for leo: adjust ktrsyscall() invocation to behave like ktrsyscall()
now expects.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.9.2.3 23-Oct-1995  leo Fix thinko in previous modification.
 1.9.2.2 22-Oct-1995  leo Don't call trapsignal() when fpu_emulate() successfully emulated the
instruction.
 1.9.2.1 13-Oct-1995  leo Make COMPAT_SUNOS compile again.
 1.23.2.1 18-Jan-1997  thorpej Update from trunk.
 1.28.4.1 08-Sep-1997  thorpej Significantly restructure the way signal state for a process is stored.
Rather than using bitmasks to redundantly store the information kept
in the process's sigacts (because the sigacts was kept in the u-area),
hang sigacts directly off the process, and access it directly.

Simplify signal setup code tremendously by storing information in
the sigacts as an array of struct sigactions, rather than in a different
format, since userspace uses sigactions.

Make sigacts sharable by adding reference counting.
 1.42.4.2 02-Aug-1999  thorpej Update from trunk.
 1.42.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.42.2.1 21-Nov-1999  he Pull up revision 1.45 (requested by itohy):
Fix the problem where single-step tracing of a trap instruction
makes the system fall into kernel debugger.
 1.44.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.44.4.1 15-Nov-1999  fvdl Sync with -current
 1.44.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.44.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.44.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.44.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.51.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.57.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.57.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.61.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.61.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.61.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.62.4.9 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.62.4.8 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.62.4.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.62.4.6 24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.62.4.5 28-Feb-2002  nathanw Catch up to -current.
 1.62.4.4 17-Dec-2001  nathanw cpu_upcall() -> sa_upcall_userret().
 1.62.4.3 25-Nov-2001  scw Deal with `want_resched' with trap()'s T_ASTFLT case where it belongs
instead of in userret().
 1.62.4.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.62.4.1 10-Sep-2001  scw file trap.c was added on branch nathanw_sa on 2001-11-17 23:18:06 +0000
 1.63.12.1 18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.67.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.67.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.67.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.67.2.2 03-Sep-2004  skrll Sync with HEAD
 1.67.2.1 03-Aug-2004  skrll Sync with HEAD
 1.78.2.6 07-Dec-2007  yamt sync with head
 1.78.2.5 15-Nov-2007  yamt sync with head.
 1.78.2.4 03-Sep-2007  yamt sync with head.
 1.78.2.3 26-Feb-2007  yamt sync with head.
 1.78.2.2 30-Dec-2006  yamt sync with head.
 1.78.2.1 21-Jun-2006  yamt sync with head.
 1.79.10.2 19-Apr-2006  elad sync with head - hopefully this will work
 1.79.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.79.8.3 11-Aug-2006  yamt sync with head
 1.79.8.2 24-May-2006  yamt sync with head.
 1.79.8.1 01-Apr-2006  yamt sync with head.
 1.79.6.2 01-Jun-2006  kardel Sync with head.
 1.79.6.1 22-Apr-2006  simonb Sync with head.
 1.79.4.1 09-Sep-2006  rpaulo sync with head
 1.80.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.84.10.2 23-Sep-2007  wrstuden Sync with somewhat-recent netbsd-4.
 1.84.10.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.84.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.84.8.1 26-Jul-2007  pavel Pull up following revision(s) (requested by mhitch in ticket #729):
sys/arch/atari/atari/trap.c: revision 1.91
sys/arch/amiga/amiga/trap.c: revision 1.115
sys/arch/hp300/hp300/trap.c: revision 1.131
Pass a frame pointer to trap() rather than the 'entire frame' trick. Gcc4
was optimizing away modifications to the frame contents (it's not nice to
trick gcc). Pass the pointer as the first argument to reduce the number
of places that would be changed otherwise. Fixes the getcwd regression
test on most m68k ports.
 1.84.4.2 06-Feb-2007  ad Update m68k pasteware.
 1.84.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.85.2.3 24-Mar-2007  yamt sync with head.
 1.85.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.85.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.87.6.1 29-Mar-2007  reinoud Pullup to -current
 1.87.4.1 11-Jul-2007  mjf Sync with head.
 1.87.2.5 03-Dec-2007  ad Sync with HEAD.
 1.87.2.4 09-Oct-2007  ad Sync with head.
 1.87.2.3 15-Jul-2007  ad Sync with head.
 1.87.2.2 27-May-2007  ad Sync with head.
 1.87.2.1 10-Apr-2007  ad Sync with head.
 1.88.4.3 03-Oct-2007  garbled Sync with HEAD
 1.88.4.2 26-Jun-2007  garbled Sync with HEAD.
 1.88.4.1 22-May-2007  matt Update to HEAD.
 1.91.10.2 09-Jan-2008  matt sync with HEAD
 1.91.10.1 06-Nov-2007  matt sync with HEAD
 1.91.8.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.91.8.2 06-Nov-2007  joerg Sync with HEAD.
 1.91.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.91.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.92.4.1 13-Nov-2007  bouyer Sync with HEAD
 1.94.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.95.16.1 18-May-2008  yamt sync with head.
 1.95.14.2 17-Jan-2009  mjf Sync with HEAD.
 1.95.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.96.2.5 11-Aug-2010  yamt sync with head.
 1.96.2.4 11-Mar-2010  yamt sync with head
 1.96.2.3 19-Aug-2009  yamt sync with head.
 1.96.2.2 04-May-2009  yamt sync with head.
 1.96.2.1 16-May-2008  yamt sync with head.
 1.97.6.1 19-Oct-2008  haad Sync with HEAD.
 1.97.2.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.97.2.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.97.2.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.97.2.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.98.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.98.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.98.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.99.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.105.4.3 05-Mar-2011  rmind sync with head
 1.105.4.2 03-Jul-2010  rmind sync with head
 1.105.4.1 30-May-2010  rmind sync with head
 1.105.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.105.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.109.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.110.2.1 17-Feb-2011  bouyer Sync with HEAD
 1.111.8.1 24-Feb-2012  mrg sync to -current.
 1.111.4.1 17-Apr-2012  yamt sync with head
 1.112.16.1 06-Apr-2015  skrll Sync with HEAD
 1.112.2.1 03-Dec-2017  jdolecek update from HEAD
 1.113.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.113.18.1 10-Jun-2019  christos Sync with HEAD
 1.24 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.23 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.22 09-Apr-2010  tsutsui branches: 1.22.2; 1.22.4;
- establish zs interrupts via common intr_establish() function rather than
hardcording them in locore.s and vector.s
- also make interrupt handlers take per unit softc and put a softint cookie
into softc (though atari machines have only one zs)
- tweak some structures as per MI z8530sc driver

Tested on TT030 using sl(4) on zs.
 1.21 11-Dec-2005  christos branches: 1.21.78; 1.21.98; 1.21.100;
merge ktrace-lwp.
 1.20 22-Sep-2003  cl SA_SIGINFO support for m68k (port specific changes)
 1.19 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.18 24-Sep-2001  jdc branches: 1.18.4; 1.18.20;
Fix typo in !COMPAT_13 case.
 1.17 15-May-2001  leo branches: 1.17.2; 1.17.4;
Enable NMI for Milan. It is used for signalling PLX faults.
 1.16 12-Apr-2001  leo There are no level1 or level7 interrupts possible on the Milan...
 1.15 17-Mar-2001  leo Conditionalize inclusion of the interrupt handlers for 'kbd', 'zs' and
'ncrscsi' since they are not present on the Milan.
 1.14 09-Feb-2001  leo branches: 1.14.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.
 1.13 18-Oct-1998  itohy branches: 1.13.12;
Remove unwanted reference to "_trap1" if !defined(COMPAT_13).
 1.12 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.11 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.10 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.9 15-Jul-1997  leo Isabus support.
 1.8 04-Jun-1997  leo Export vectab label (68060 changes).
 1.7 01-Jan-1997  leo The ST-DMA driver now uses intr_establish.
 1.6 26-Dec-1996  leo Add intr_establish/disestablish functions. Currently only the lpt-driver
is converted to use them...
 1.5 09-Nov-1996  leo Move the vector-table to kernel data space, so we can write to it.
 1.4 27-Mar-1996  leo Add centronics printer driver.
 1.3 30-Nov-1995  leo Add kernel option for separate {stat,prof}clock
 1.2 05-May-1995  leo Shift system clocks from TT-mfp to ST-mfp for Falcon.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.13.12.3 21-Apr-2001  bouyer Sync with HEAD
 1.13.12.2 27-Mar-2001  bouyer Sync with HEAD.
 1.13.12.1 11-Feb-2001  bouyer Sync with HEAD.
 1.14.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.14.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.17.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.17.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.18.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.20.1 03-Aug-2004  skrll Sync with HEAD
 1.18.4.2 24-Sep-2001  jdc Fix typo in !COMPAT_13 case.
 1.18.4.1 24-Sep-2001  jdc file vectors.s was added on branch nathanw_sa on 2001-09-24 13:19:55 +0000
 1.21.100.2 05-Mar-2011  rmind sync with head
 1.21.100.1 30-May-2010  rmind sync with head
 1.21.98.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.21.78.1 11-Aug-2010  yamt sync with head.
 1.22.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.22.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.43 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.42 04-Mar-2002  simonb Don't need to declare phys_map - it is declared in <uvm/uvm_extern.h>.
 1.41 26-Feb-2002  simonb Purge CLSIZE, CLSIZELOG2 and MCLOFSET.
Be consistant in the way that MSIZE, MCLSHIFT, MCLBYTES and NMBCLUSTERS
are defined.
Remove old VM constants from cesfic port.
Bump MSIZE to 256 on mipsco (the only one that wasn't already 256).
 1.40 24-Sep-2001  leo branches: 1.40.4;
Add missing argument to pmap_update().
 1.39 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.38 19-Aug-2001  chs branches: 1.38.2;
add missing pmap_update().
 1.37 04-Aug-2001  chs use pmap_k* in pagemove() (ie. for buffer cache pages)
and in vmapbuf() and vunmapbuf() (since there's no VAC on this platform).
 1.36 02-Jun-2001  chs branches: 1.36.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.35 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.34 29-Jun-2000  mrg branches: 1.34.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.33 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.32 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.31 20-Jan-2000  sommerfeld branches: 1.31.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.30 04-Dec-1999  ragge CL* discarding.
 1.29 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.28 08-Jul-1999  thorpej branches: 1.28.2; 1.28.4; 1.28.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.27 26-May-1999  thorpej Generally update the comment above vunmapbuf().
 1.26 26-May-1999  thorpej Generally update the comment above the vmapbuf() implementations.
 1.25 14-May-1999  nisimura - Adjust descriptive comment of cpu_fork() which returns nothing and
returns once.
- Minor fixes in mips/vm_machdep.c.
 1.24 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.23 26-Mar-1999  mycroft branches: 1.23.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.22 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.21 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.20 09-Sep-1998  thorpej In cpu_coredump(), use MID_MACHINE rather than MID_* (whatever it expands
to).
 1.19 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.18 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.17 28-Jul-1998  thorpej Don't cast the null residual pointer passed to vn_rdwr().
 1.16 11-Jun-1998  thomas Fix egcs warning
 1.15 11-May-1998  leo Add UVM option.
 1.14 06-Jan-1998  thorpej Garbage-collect PMAP_ACTIVATE() call here; it's no longer necessary.
 1.13 11-Oct-1997  scottr Address PR 4120 by synchronizing v{,un}mapbuf() with the i386 vm_machdep.c,
v 1.27, pulling in changes made there by Charles Hannum. Also, incorporate
a few tweaks made by Gordon W. Ross in the sun3 version of this change.
 1.12 04-Jun-1997  leo branches: 1.12.4;
Use m68k cacheops
 1.11 19-May-1997  veego Fix lossage from the latest vm_pmap changes.
 1.10 03-Jan-1997  leo Get rid of 'cpu040' variable. Use 'mmutype' or 'cputype' for testing
instead.
 1.9 29-Jun-1996  leo Remove references to kern_extern.h
 1.8 26-Apr-1996  leo branches: 1.8.4;
Corrections for removed <sys/cpu.h> and some more prototypes.
 1.7 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.6 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.5 05-Feb-1996  christos vm prototype changes
 1.4 09-Dec-1995  mycroft cpu_fork() now returns void.
 1.3 14-May-1995  leo - Remove double mapping of kernel stack
- Change to new coredump format
 1.2 10-Apr-1995  mycroft kernel_pmap --> pmap_kernel()
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.8.4.1 30-Jun-1996  jtc Pulled up rev 1.9 by request from Leo Weppelman
 1.12.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.23.4.2 02-Aug-1999  thorpej Update from trunk.
 1.23.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.28.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.28.4.1 15-Nov-1999  fvdl Sync with -current
 1.28.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.31.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.34.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.36.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.36.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.36.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.36.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.38.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.40.4.8 11-Nov-2002  nathanw Catch up to -current
 1.40.4.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.40.4.6 24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.40.4.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.40.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.40.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.40.4.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.40.4.1 24-Sep-2001  scw file vm_machdep.c was added on branch nathanw_sa on 2001-11-17 23:18:06 +0000
 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 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.50;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.50.1 07-Jan-2003  thorpej Sync with HEAD.
 1.1 06-Jan-2003  lukem branches: 1.1.2;
Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

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

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

Per lengthy discussion with Andrew Brown.
 1.1.2.2 07-Jan-2003  thorpej Sync with HEAD.
 1.1.2.1 06-Jan-2003  thorpej file Makefile was added on branch nathanw_sa on 2003-01-07 21:04:32 +0000
 1.126 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.125 07-Aug-2022  simonb Regen.
 1.124 25-Jun-2022  tsutsui Regen from GENERIC.in rev 1.123.

> Allocalte enough reserved ST-RAM to make the old Xserver work by default.
 1.123 12-Jun-2022  tsutsui Regen from GENERIC.in rev 1.122.

> Specify -fno-unwind-tables to shrink binaries.
 1.122 26-Jan-2021  rin Regen for previous commit to GENERIC.in.
 1.121 10-Aug-2020  rin branches: 1.121.2;
regen
 1.120 13-Apr-2019  isaki branches: 1.120.4;
Regen.
> Add drvctl to kernel which has audio device.
> audiocfg(1) requires drvctl(4).
 1.119 31-Mar-2018  tsutsui branches: 1.119.2;
Regen to denote GENERIC.in rev 1.115 in "Created from:" lines.
 1.118 20-Jan-2018  tsutsui branches: 1.118.2;
Regenerate config files to update RCSIds in "Created from:" lines.
 1.117 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.116 24-Nov-2014  tsutsui Regen config files from GENERIC.in rev 1.109 by makeconf:

> Shrink GENERIC and enable options MODULAR instead, as other poor m68k ports.
>
> This allows all (at least ATARITT and FALCON, which have certain users)
> gzipped kernel binaries put into 1440KB 2HD floppy so that users can
> load these kernels on the native TOS using LOADBSD.TTP utility for
> installation. Note SMALL030 kernel doesn't include any Ethernet
> configuration and requires CD-ROM or other removable disks.
>
> Should be pulled up to netbsd-7.
 1.115 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.114 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.113 05-Jul-2014  tsutsui branches: 1.113.2;
Regen from GENERIC.in rev 1.106:

> Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.
>
> Also remove COPTS="-Os" from std.* files and specify it in
> GENERIC.in template for SMALL030_KERNEL.
 1.112 30-Jun-2013  rmind branches: 1.112.4;
G/C PFIL_HOOKS from the kernel configs.
 1.111 27-Apr-2013  christos branches: 1.111.4;
remove confusing numeric locators where they are unused.
 1.110 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.109 10-Mar-2012  joerg branches: 1.109.2;
P1003_1B_SEMAPHORE is no longer optional.
 1.108 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.107 22-Nov-2011  tls branches: 1.107.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.106 12-Dec-2010  tsutsui branches: 1.106.8;
Regen from GENERIC.in rev 1.92:
> Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
 1.105 23-Nov-2010  hannken Regen.
 1.104 08-May-2010  mrg regenerate these configurations from GENERIC.in.
 1.103 08-May-2010  tsutsui Regen from GENERIC.in rev 1.89:
> - don't enable TMPFS for SMALL030
> - remove dup PTYFS
 1.102 29-Apr-2010  chs regen
 1.101 16-Apr-2010  pooka regen
 1.100 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.99 10-Apr-2010  tsutsui Regen from GENERIC.in rev 1.86:
> Disable options SERCONSOLE (force serial console if DCD is detected)
> because now it's patchable by binpatch(8).
 1.98 01-Apr-2010  tsutsui Regen from GENERIC.in rev 1.85, HADES.in rev 1.10, and MILAN.in rev 1.24:
> Add support for the EtherNEC.
 1.97 13-Mar-2010  tsutsui branches: 1.97.2;
Regen from GENERIC.in rev 1.84:
> Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
 1.96 21-Feb-2010  tsutsui Regen from GENERIC.in rev 1.83:
> Add pseudo-device ksyms. Noticed by David Ross on port-atari.
 1.95 05-Dec-2009  pooka branches: 1.95.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.94 23-Nov-2009  abs Do not include FPU_EMULATE in ATARITT only config
 1.93 06-Mar-2009  abs Regenerate after shrinking kernels to fit on floppies
 1.92 24-Jan-2009  abs branches: 1.92.2;
- Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
- Regenerate everything else - only changes in comments
 1.91 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.90 15-Nov-2008  abs Regenerate: Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo
 1.89 09-Nov-2008  abs Regenerate from GENERIC.in 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.88 06-Nov-2008  abs Add the following note to README:

Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.

Then follow it. Noted by tsutsui@
 1.87 05-Nov-2008  abs Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.86 31-Jul-2008  simonb branches: 1.86.2; 1.86.4;
Regen for "options WAPBL".
 1.85 17-Oct-2007  garbled branches: 1.85.16; 1.85.20; 1.85.22; 1.85.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.84 16-Jul-2007  he branches: 1.84.10;
Regenerate configurations after adding COMPAT_40 to GENERIC.in.
 1.83 06-Jun-2007  martin regen
 1.82 26-Aug-2006  christos branches: 1.82.6; 1.82.12; 1.82.14; 1.82.20; 1.82.22;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.81 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.80 28-Mar-2006  pavel branches: 1.80.6;
regen (added stf).
 1.79 28-Mar-2006  rpaulo regen
 1.78 05-Feb-2006  cube branches: 1.78.2; 1.78.4; 1.78.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.77 04-Feb-2006  rpaulo regen
 1.76 03-Feb-2006  reinoud branches: 1.76.2;
Regen GENERIC files
 1.75 11-Dec-2005  christos branches: 1.75.2; 1.75.4;
merge ktrace-lwp.
 1.74 03-Nov-2005  chs regen
 1.73 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.72 19-Aug-2005  christos 64 bit inode changes.
 1.71 31-Jul-2005  yamt regen.
 1.70 30-Jul-2005  yamt regen.
 1.69 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.68 25-Feb-2005  simonb branches: 1.68.2; 1.68.4;
Regen for COMPAT_20 additions.
 1.67 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.66 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.65 31-Jan-2005  hannken Regen.
 1.64 17-Jan-2005  cube branches: 1.64.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.63 24-Nov-2004  bouyer branches: 1.63.4;
Regen (initially for pdcsata(4), but it looks like the files were not
regenerated after some recent addition to kernel configs).
 1.62 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.61 28-Jun-2004  bouyer Regen, added P1003_1B_SEMAPHORE.
 1.60 26-Jun-2004  abs Regenerate from master config files
 1.59 08-Oct-2003  bouyer branches: 1.59.2;
Regen: Add new per-chip pciide drivers.
 1.58 08-Oct-2003  bouyer Regen: add atabus.
 1.57 22-Sep-2003  cl regen
 1.56 10-Apr-2003  christos branches: 1.56.2;
Bye Bye UCONSOLE
 1.55 02-Feb-2003  thomas Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.54 28-Dec-2002  leo Regen.
 1.53 22-Nov-2002  wiz regen
 1.52 21-Oct-2002  jdc Regenerate config. files from GENERIC.in rev. 1.28.
 1.51 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.50 06-Oct-2002  provos regen from GENERIC.in
 1.49 18-Sep-2002  lukem regen for: enable USERCONF
 1.48 17-Jun-2002  lukem regen for clockctl
 1.47 25-Apr-2002  atatat branches: 1.47.2; 1.47.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.46 16-Apr-2002  bjh21 Regen. Remove pppoe from FALCON kernels.
 1.45 12-Apr-2002  leo Regen.
 1.44 12-Apr-2002  leo Move USERCONF to GENERIC.in and trim the phy-list.
 1.43 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.42 27-Jan-2002  jdolecek regen:
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.41 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.40 09-Jul-2001  leo branches: 1.40.2; 1.40.8;
Regen.
 1.39 08-Jul-2001  abs (Regenerated atari and amiga)
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.38 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.37 10-Apr-2001  leo Regen. again...
 1.36 10-Apr-2001  leo Regen.
 1.35 06-Apr-2001  leo Regen.
 1.34 05-Apr-2001  leo And commit the generated files.
 1.33 28-Sep-2000  leo branches: 1.33.2;
Move the grfbus out of std.atari. You don't want a grfbus defined on headless
and wscons setups.
 1.32 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.31 12-Feb-2000  thorpej branches: 1.31.4;
Nuke NKMEMCLUSTERS.
 1.30 26-Jan-2000  leo Restructure the ite/grf definitions:
- Make the ite<n> -> grfXX<n> relations explicit. This solves problems
with the newer autoconf code.
- Nuke the grfcc definition in std.atari. A Hades has not grfcc...
 1.29 16-Sep-1999  leo branches: 1.29.2;
Remove FP-emulation from the TT-kernel. All TT's should have an FPU.
 1.28 29-Jul-1999  augustss It's time to be COMPAT_14.
 1.27 26-Jun-1998  lukem branches: 1.27.10;
remove options FIFO; it's now the default
 1.26 01-Dec-1997  kleink Add COMPAT_13.
 1.25 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.24 29-Aug-1997  leo Define 2 md devices.
 1.23 30-Jul-1997  leo Rename lpt to lp on some places to avoid botches between files.isa and
files.atari.
 1.22 07-May-1997  lukem branches: 1.22.4;
clean up use of whitespace
remove unnecessary quotes around options
 1.21 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.20 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.19 28-Dec-1996  pk branches: 1.19.2;
rename: ramdisk => md
 1.18 16-Dec-1996  leo Implement an rtc-device. Credits for the idea goes to Wolfgang Solfrank.
Because there is no way yet to tell init(1) to execute commands before
single user-mode is entered, the inittodr() function is still partly
functional. It retrieves the value of the RTC and sets the time as if
the RTC was running at UTC. The resettodr() function is a No-Op. The
RTC can only be changed by a write to /dev/rtc.
The TIMEZONE and DST options are no longer needed and removed from the
config files.
 1.17 17-Nov-1996  leo Move SWAPPAGER, VNODEPAGER and DEVPAGER options to std.atari.
 1.16 08-Nov-1996  leo Move the definition for the floppy device from std.atari to the different
config files because the Hades needs another driver for it.
 1.15 16-Oct-1996  leo Update pathnames of included files for new version of config.
 1.14 04-Oct-1996  leo Add the COMPAT_12 options. For GENERIC, also add the ch/ss/uk devices.
 1.13 16-Sep-1996  leo - Add M68040 option where appropriate
- Reflect changes on the grf/ite/view system for et4000 console support
- Set timezone to 0
- Document FPSP option
 1.12 26-Aug-1996  mrg add COMPAT_12.
 1.11 27-Mar-1996  leo - Add printer device
- Add ym2149 files
- Make ramdisk a pseudo-device
 1.10 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.9 19-Feb-1996  leo New disklabel handling code (Waldi Ravens).
These are the final (?) modifications to the layout of the NetBSD/Atari
bootblock. The bootblock handling can be made backwards compatible using
the right config options (COMPAT_11 + DISKLABEL_AHDI).
 1.8 06-Jan-1996  leo Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.7 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.6 30-Sep-1995  leo branches: 1.6.2;
Add CD9660 option.
 1.5 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.4 11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.3 25-Jun-1995  leo Mouse driver added.
 1.2 28-May-1995  leo Add HZ=64, remove FPCOPROC.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.6.2.1 15-Nov-1995  leo Add COMPAT_10
 1.19.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.22.4.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.22.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.27.10.1 02-Aug-1999  thorpej Update from trunk.
 1.29.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.29.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.31.4.2 23-Feb-2002  he Apply patch (requested by leo):
Remove the vlan device because it causes link failure on this
port.
 1.31.4.1 01-May-2001  he Apply patch (requested by he):
Add pseudo-device vlan.
Make sure "rnd is EXPERIMENTAL" comment is removed.
 1.33.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.33.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.40.8.9 29-Dec-2002  thorpej Sync with HEAD.
 1.40.8.8 11-Dec-2002  thorpej Sync with HEAD.
 1.40.8.7 11-Nov-2002  nathanw Catch up to -current
 1.40.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.40.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.40.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.40.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.40.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.40.8.1 09-Jul-2001  nathanw file ATARITT was added on branch nathanw_sa on 2002-01-08 00:23:33 +0000
 1.40.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.40.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.40.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.40.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.40.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.47.4.2 10-Jan-2003  jmc Pullup versions 1.29-1.30 of GENERIC.in and regenerate config's (requested by
leo in ticket #1062)
Since 1.6 we have 3 images (not 2\!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.47.4.1 01-Aug-2002  lukem Pull up revision 1.48 (requested by lukem in ticket #313):
regen for clockctl
 1.47.2.1 14-Jul-2002  gehenna catch up with -current.
 1.56.2.10 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.56.2.9 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.56.2.8 15-Feb-2005  skrll Sync with HEAD.
 1.56.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.56.2.6 24-Jan-2005  skrll Sync with HEAD.
 1.56.2.5 29-Nov-2004  skrll Sync with HEAD.
 1.56.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.56.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.56.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.56.2.1 03-Aug-2004  skrll Sync with HEAD
 1.59.2.4 11-Aug-2007  bouyer Regen for ticket 11356
 1.59.2.3 15-Jul-2004  he branches: 1.59.2.3.2;
Pull up regenerated files (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.59.2.2 02-Jul-2004  he Pull up regenerated files (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.59.2.1 30-Jun-2004  jdc Pull up revision 1.60 (requested by abs in ticket #567).

Regenerate from master config files
 1.59.2.3.2.2 11-Aug-2007  bouyer regen for ticket 11356
 1.59.2.3.2.1 02-Apr-2005  he branches: 1.59.2.3.2.1.2;
Pull up regenerated files (requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx)
series of controllers.
 1.59.2.3.2.1.2.1 11-Aug-2007  bouyer Regen for ticket 11356
 1.63.4.1 29-Apr-2005  kent sync with -current
 1.64.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.64.2.1 12-Feb-2005  yamt sync with head.
 1.68.4.3 03-Sep-2007  yamt sync with head.
 1.68.4.2 30-Dec-2006  yamt sync with head.
 1.68.4.1 21-Jun-2006  yamt sync with head.
 1.68.2.2 05-Nov-2005  tron Regen for ticket #929.
 1.68.2.1 14-Aug-2005  riz Pull up revision 1.69 (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.75.4.1 09-Sep-2006  rpaulo sync with head
 1.75.2.1 18-Feb-2006  yamt sync with head.
 1.76.2.1 22-Apr-2006  simonb Sync with head.
 1.78.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.78.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.78.2.2 03-Sep-2006  yamt sync with head.
 1.78.2.1 01-Apr-2006  yamt sync with head.
 1.80.6.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.82.22.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.82.20.2 03-Oct-2007  garbled Sync with HEAD
 1.82.20.1 26-Jun-2007  garbled Sync with HEAD.
 1.82.14.1 11-Jul-2007  mjf Sync with head.
 1.82.12.2 20-Aug-2007  ad Sync with HEAD.
 1.82.12.1 09-Jun-2007  ad Sync with head.
 1.82.6.3 16-Jan-2009  bouyer Regen for ticket 1264:
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory
issues. Tested by Tuomo.
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.82.6.2 18-Nov-2008  snj Regen for ticket 1227.
 1.82.6.1 06-Jun-2007  bouyer Regen for ticket 699.
 1.84.10.1 06-Nov-2007  matt sync with HEAD
 1.85.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.85.26.1 19-Oct-2008  haad Sync with HEAD.
 1.85.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.85.20.3 11-Aug-2010  yamt sync with head.
 1.85.20.2 11-Mar-2010  yamt sync with head
 1.85.20.1 04-May-2009  yamt sync with head.
 1.85.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.85.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.86.4.7 20-Nov-2010  riz Regen for ticket 1368.
 1.86.4.6 20-Nov-2010  riz Regen for ticket 1367.
 1.86.4.5 20-Nov-2010  riz Regen for ticket 1366.
 1.86.4.4 12-Mar-2009  snj Regen for ticket 553.
 1.86.4.3 26-Jan-2009  snj Regen for ticket 320.
 1.86.4.2 25-Nov-2008  snj Regen for ticket 123.
 1.86.4.1 06-Nov-2008  snj Regen for ticket 19.
 1.86.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.86.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.86.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.92.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.95.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.95.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.97.2.2 05-Mar-2011  rmind sync with head
 1.97.2.1 30-May-2010  rmind sync with head
 1.106.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.106.8.2 30-Oct-2012  yamt sync with head
 1.106.8.1 17-Apr-2012  yamt sync with head
 1.107.2.2 11-Mar-2012  mrg sync to latest -current
 1.107.2.1 18-Feb-2012  mrg merge to -current.
 1.109.2.4 03-Dec-2017  jdolecek update from HEAD
 1.109.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.109.2.2 23-Jun-2013  tls resync from head
 1.109.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.111.4.1 28-Aug-2013  rmind sync with head
 1.112.4.1 10-Aug-2014  tls Rebase.
 1.113.2.1 14-Dec-2014  martin Regen for #321
 1.118.2.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.119.2.1 10-Jun-2019  christos Sync with HEAD
 1.120.4.2 11-Sep-2022  martin regen (ticket #1521)
 1.120.4.1 11-Sep-2022  martin regen (ticket #1519)
 1.121.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.5 24-Jan-2009  abs - Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.4 10-Apr-2001  leo branches: 1.4.2; 1.4.10; 1.4.132; 1.4.140; 1.4.142;
files.atari:
Defopt motherboard type and make ym2149.c dependend on 'standard' atari
boards.
Configfiles:
Add pseudo device mouse. It got dropped in the moves by accident.
 1.3 10-Apr-2001  leo Move GENERIC to GENERIC.in . This avoids confusion since GENERIC is not a
standalone config file anymore.
 1.2 06-Apr-2001  leo branches: 1.2.2;
Add a 'ser0' device to all. Add ne2000, 3Com 3c59x/3c90x and ESS Solo-1
support to the Hades.
 1.1 05-Apr-2001  leo Major overhaul in the config files. The idea is to have the major part of
the generic options in GENERIC instead of duplicated all over the place.
To generate a config file, run 'makeconf'. This script uses cpp to combine
a '.in' file and GENERIC to a real config file.
 1.2.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.142.1 26-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #320):
sys/arch/atari/conf/ATARITT.in: file removal
sys/arch/atari/conf/FALCON.in: file removal
sys/arch/atari/conf/GENERIC.in: revision 1.78 via patch
sys/arch/atari/conf/HADES.in: revision 1.9
sys/arch/atari/conf/makeconf: revision 1.7
sys/arch/atari/conf/MILAN.in: revision 1.22
- Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.4.140.1 03-Mar-2009  skrll Sync with HEAD.
 1.4.132.1 04-May-2009  yamt sync with head.
 1.4.10.2 10-Apr-2001  leo files.atari:
Defopt motherboard type and make ym2149.c dependend on 'standard' atari
boards.
Configfiles:
Add pseudo device mouse. It got dropped in the moves by accident.
 1.4.10.1 10-Apr-2001  leo file ATARITT.in was added on branch nathanw_sa on 2001-04-10 06:28:39 +0000
 1.4.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.1 10-Apr-2001  bouyer file ATARITT.in was added on branch thorpej_scsipi on 2001-04-21 17:53:22 +0000
 1.81 24-Jan-2009  abs - Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
- Regenerate everything else - only changes in comments
 1.80 15-Nov-2008  abs Regenerate: Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo
 1.79 09-Nov-2008  abs Regenerate from GENERIC.in 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.78 06-Nov-2008  abs Add the following note to README:

Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.

Then follow it. Noted by tsutsui@
 1.77 05-Nov-2008  abs Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.76 31-Jul-2008  simonb branches: 1.76.2; 1.76.4;
Regen for "options WAPBL".
 1.75 17-Oct-2007  garbled branches: 1.75.16; 1.75.20; 1.75.22; 1.75.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.74 16-Jul-2007  he branches: 1.74.10;
Regenerate configurations after adding COMPAT_40 to GENERIC.in.
 1.73 06-Jun-2007  martin regen
 1.72 28-Mar-2006  pavel branches: 1.72.12; 1.72.18; 1.72.20; 1.72.26; 1.72.28;
regen (added stf).
 1.71 28-Mar-2006  rpaulo regen
 1.70 05-Feb-2006  cube branches: 1.70.2; 1.70.4; 1.70.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.69 04-Feb-2006  rpaulo regen
 1.68 03-Feb-2006  reinoud branches: 1.68.2;
Regen GENERIC files
 1.67 11-Dec-2005  christos branches: 1.67.2; 1.67.4;
merge ktrace-lwp.
 1.66 03-Nov-2005  chs regen
 1.65 19-Aug-2005  christos 64 bit inode changes.
 1.64 31-Jul-2005  yamt regen.
 1.63 30-Jul-2005  yamt regen.
 1.62 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.61 25-Feb-2005  simonb branches: 1.61.2; 1.61.4;
Regen for COMPAT_20 additions.
 1.60 31-Jan-2005  hannken Regen.
 1.59 24-Nov-2004  bouyer branches: 1.59.4; 1.59.6;
Regen (initially for pdcsata(4), but it looks like the files were not
regenerated after some recent addition to kernel configs).
 1.58 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.57 26-Jun-2004  abs Regenerate from master config files
 1.56 08-Oct-2003  bouyer branches: 1.56.2;
Regen: Add new per-chip pciide drivers.
 1.55 08-Oct-2003  bouyer Regen: add atabus.
 1.54 22-Sep-2003  cl regen
 1.53 02-Feb-2003  thomas branches: 1.53.2;
Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.52 28-Dec-2002  leo Regen.
 1.51 22-Nov-2002  wiz regen
 1.50 21-Oct-2002  jdc Regenerate config. files from GENERIC.in rev. 1.28.
 1.49 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.48 18-Sep-2002  lukem regen for: enable USERCONF
 1.47 17-Jun-2002  lukem regen for clockctl
 1.46 25-Apr-2002  atatat branches: 1.46.2; 1.46.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.45 16-Apr-2002  bjh21 Regen. Remove pppoe from FALCON kernels.
 1.44 12-Apr-2002  leo Regen.
 1.43 12-Apr-2002  leo Move USERCONF to GENERIC.in and trim the phy-list.
 1.42 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.41 27-Jan-2002  jdolecek regen:
add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.40 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.39 09-Jul-2001  leo branches: 1.39.2; 1.39.8;
Regen.
 1.38 08-Jul-2001  abs (Regenerated atari and amiga)
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.37 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.36 10-Apr-2001  leo Regen. again...
 1.35 10-Apr-2001  leo Regen.
 1.34 06-Apr-2001  leo Regen.
 1.33 05-Apr-2001  leo And commit the generated files.
 1.32 28-Sep-2000  leo branches: 1.32.2;
Move the grfbus out of std.atari. You don't want a grfbus defined on headless
and wscons setups.
 1.31 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.30 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.29 26-Jan-2000  leo Restructure the ite/grf definitions:
- Make the ite<n> -> grfXX<n> relations explicit. This solves problems
with the newer autoconf code.
- Nuke the grfcc definition in std.atari. A Hades has not grfcc...
 1.28 29-Jul-1999  augustss branches: 1.28.2;
It's time to be COMPAT_14.
 1.27 26-Jun-1998  lukem branches: 1.27.10;
remove options FIFO; it's now the default
 1.26 10-Apr-1998  leo Use MI wdc-driver.
 1.25 01-Dec-1997  kleink Add COMPAT_13.
 1.24 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.23 29-Aug-1997  leo Define 2 md devices.
 1.22 07-May-1997  lukem branches: 1.22.4;
clean up use of whitespace
remove unnecessary quotes around options
 1.21 01-Apr-1997  leo Make it possible to remove the lpt device by making it 'needs-flag'.
Remove lpt-device from the BOOT kernel.
 1.20 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.19 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.18 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.17 28-Dec-1996  pk branches: 1.17.2;
rename: ramdisk => md
 1.16 16-Dec-1996  leo Implement an rtc-device. Credits for the idea goes to Wolfgang Solfrank.
Because there is no way yet to tell init(1) to execute commands before
single user-mode is entered, the inittodr() function is still partly
functional. It retrieves the value of the RTC and sets the time as if
the RTC was running at UTC. The resettodr() function is a No-Op. The
RTC can only be changed by a write to /dev/rtc.
The TIMEZONE and DST options are no longer needed and removed from the
config files.
 1.15 17-Nov-1996  leo Move SWAPPAGER, VNODEPAGER and DEVPAGER options to std.atari.
 1.14 08-Nov-1996  leo Move the definition for the floppy device from std.atari to the different
config files because the Hades needs another driver for it.
 1.13 16-Oct-1996  leo Update pathnames of included files for new version of config.
 1.12 04-Oct-1996  leo Add the COMPAT_12 options. For GENERIC, also add the ch/ss/uk devices.
 1.11 16-Sep-1996  leo - Add M68040 option where appropriate
- Reflect changes on the grf/ite/view system for et4000 console support
- Set timezone to 0
- Document FPSP option
 1.10 26-Aug-1996  mrg add COMPAT_12.
 1.9 15-May-1996  leo branches: 1.9.4;
Make a BOOTX(tra) config file. It suits more people than BOOT and it allows
me to keep the BOOT config small.
 1.8 27-Mar-1996  leo - Add printer device
- Add ym2149 files
- Make ramdisk a pseudo-device
 1.7 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.6 19-Feb-1996  leo New disklabel handling code (Waldi Ravens).
These are the final (?) modifications to the layout of the NetBSD/Atari
bootblock. The bootblock handling can be made backwards compatible using
the right config options (COMPAT_11 + DISKLABEL_AHDI).
 1.5 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.4 30-Sep-1995  leo branches: 1.4.2;
Add CD9660 option.
 1.3 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.2 11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.1 28-May-1995  leo Define a config for the kernel on the boot-floppy. It should be resonably
small and boot on both TT and Falcon.
 1.4.2.1 15-Nov-1995  leo Add COMPAT_10
 1.9.4.1 05-Dec-1996  rat Apply patch to atari/conf/BOOT by request of Leo Weppelman <leo@wau.mis.ah.nl>

>Reason:
>Because interrupt functions are hard-wired in locore.s, not including
>the lpt-driver causes undefined symbols. Work is being done to fix this,
>for the moment however this patch hides the real bug....
 1.17.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.22.4.1 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.27.10.1 02-Aug-1999  thorpej Update from trunk.
 1.28.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.28.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.32.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.32.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.39.8.9 29-Dec-2002  thorpej Sync with HEAD.
 1.39.8.8 11-Dec-2002  thorpej Sync with HEAD.
 1.39.8.7 11-Nov-2002  nathanw Catch up to -current
 1.39.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.39.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.39.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.39.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.39.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.39.8.1 09-Jul-2001  nathanw file BOOT was added on branch nathanw_sa on 2002-01-08 00:23:33 +0000
 1.39.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.39.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.39.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.39.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.39.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.46.4.2 10-Jan-2003  jmc Pullup versions 1.29-1.30 of GENERIC.in and regenerate config's (requested by
leo in ticket #1062)
Since 1.6 we have 3 images (not 2\!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.46.4.1 01-Aug-2002  lukem Pull up revision 1.47 (requested by lukem in ticket #313):
regen for clockctl
 1.46.2.1 14-Jul-2002  gehenna catch up with -current.
 1.53.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.53.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.53.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.53.2.5 29-Nov-2004  skrll Sync with HEAD.
 1.53.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.53.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.53.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.53.2.1 03-Aug-2004  skrll Sync with HEAD
 1.56.2.4 11-Aug-2007  bouyer Regen for ticket 11356
 1.56.2.3 15-Jul-2004  he branches: 1.56.2.3.2;
Pull up regenerated files (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.56.2.2 02-Jul-2004  he Pull up regenerated files (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.56.2.1 30-Jun-2004  jdc Pull up revision 1.57 (requested by abs in ticket #567).

Regenerate from master config files
 1.56.2.3.2.2 11-Aug-2007  bouyer regen for ticket 11356
 1.56.2.3.2.1 02-Apr-2005  he branches: 1.56.2.3.2.1.2;
Pull up regenerated files (requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx)
series of controllers.
 1.56.2.3.2.1.2.1 11-Aug-2007  bouyer Regen for ticket 11356
 1.59.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.59.6.1 12-Feb-2005  yamt sync with head.
 1.59.4.1 29-Apr-2005  kent sync with -current
 1.61.4.2 03-Sep-2007  yamt sync with head.
 1.61.4.1 21-Jun-2006  yamt sync with head.
 1.61.2.2 05-Nov-2005  tron Regen for ticket #929.
 1.61.2.1 14-Aug-2005  riz Pull up revision 1.62 (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.67.4.1 09-Sep-2006  rpaulo sync with head
 1.67.2.1 18-Feb-2006  yamt sync with head.
 1.68.2.1 22-Apr-2006  simonb Sync with head.
 1.70.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.70.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.70.2.1 01-Apr-2006  yamt sync with head.
 1.72.28.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.72.26.2 03-Oct-2007  garbled Sync with HEAD
 1.72.26.1 26-Jun-2007  garbled Sync with HEAD.
 1.72.20.1 11-Jul-2007  mjf Sync with head.
 1.72.18.2 20-Aug-2007  ad Sync with HEAD.
 1.72.18.1 09-Jun-2007  ad Sync with head.
 1.72.12.3 16-Jan-2009  bouyer Regen for ticket 1264:
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory
issues. Tested by Tuomo.
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.72.12.2 18-Nov-2008  snj Regen for ticket 1227.
 1.72.12.1 06-Jun-2007  bouyer Regen for ticket 699.
 1.74.10.1 06-Nov-2007  matt sync with HEAD
 1.75.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.75.26.1 19-Oct-2008  haad Sync with HEAD.
 1.75.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.75.20.1 04-May-2009  yamt sync with head.
 1.75.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.75.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.76.4.3 26-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #320):
sys/arch/atari/conf/BOOT: file removal
sys/arch/atari/conf/BOOTX: file removal
- Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
 1.76.4.2 25-Nov-2008  snj Regen for ticket 123.
 1.76.4.1 06-Nov-2008  snj Regen for ticket 19.
 1.76.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.76.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.76 24-Jan-2009  abs - Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
- Regenerate everything else - only changes in comments
 1.75 15-Nov-2008  abs Regenerate: Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo
 1.74 09-Nov-2008  abs Regenerate from GENERIC.in 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.73 06-Nov-2008  abs Add the following note to README:

Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.

Then follow it. Noted by tsutsui@
 1.72 05-Nov-2008  abs Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.71 31-Jul-2008  simonb branches: 1.71.2; 1.71.4;
Regen for "options WAPBL".
 1.70 17-Oct-2007  garbled branches: 1.70.16; 1.70.20; 1.70.22; 1.70.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.69 16-Jul-2007  he branches: 1.69.10;
Regenerate configurations after adding COMPAT_40 to GENERIC.in.
 1.68 06-Jun-2007  martin regen
 1.67 28-Mar-2006  pavel branches: 1.67.12; 1.67.18; 1.67.20; 1.67.26; 1.67.28;
regen (added stf).
 1.66 28-Mar-2006  rpaulo regen
 1.65 05-Feb-2006  cube branches: 1.65.2; 1.65.4; 1.65.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.64 04-Feb-2006  rpaulo regen
 1.63 03-Feb-2006  reinoud branches: 1.63.2;
Regen GENERIC files
 1.62 11-Dec-2005  christos branches: 1.62.2; 1.62.4;
merge ktrace-lwp.
 1.61 03-Nov-2005  chs regen
 1.60 19-Aug-2005  christos 64 bit inode changes.
 1.59 31-Jul-2005  yamt regen.
 1.58 30-Jul-2005  yamt regen.
 1.57 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.56 25-Feb-2005  simonb branches: 1.56.2; 1.56.4;
Regen for COMPAT_20 additions.
 1.55 31-Jan-2005  hannken Regen.
 1.54 24-Nov-2004  bouyer branches: 1.54.4; 1.54.6;
Regen (initially for pdcsata(4), but it looks like the files were not
regenerated after some recent addition to kernel configs).
 1.53 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.52 26-Jun-2004  abs Regenerate from master config files
 1.51 08-Oct-2003  bouyer branches: 1.51.2;
Regen: Add new per-chip pciide drivers.
 1.50 08-Oct-2003  bouyer Regen: add atabus.
 1.49 22-Sep-2003  cl regen
 1.48 10-Apr-2003  christos branches: 1.48.2;
Bye Bye UCONSOLE
 1.47 02-Feb-2003  thomas Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.46 28-Dec-2002  leo Regen.
 1.45 22-Nov-2002  wiz regen
 1.44 21-Oct-2002  jdc Regenerate config. files from GENERIC.in rev. 1.28.
 1.43 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.42 18-Sep-2002  lukem regen for: enable USERCONF
 1.41 17-Jun-2002  lukem regen for clockctl
 1.40 25-Apr-2002  atatat branches: 1.40.2; 1.40.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.39 16-Apr-2002  bjh21 Regen. Remove pppoe from FALCON kernels.
 1.38 12-Apr-2002  leo Regen.
 1.37 12-Apr-2002  leo Move USERCONF to GENERIC.in and trim the phy-list.
 1.36 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.35 27-Jan-2002  jdolecek regen:
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.34 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.33 09-Jul-2001  leo branches: 1.33.2; 1.33.8;
Regen.
 1.32 08-Jul-2001  abs (Regenerated atari and amiga)
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.31 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.30 10-Apr-2001  leo Regen. again...
 1.29 10-Apr-2001  leo Regen.
 1.28 06-Apr-2001  leo Regen.
 1.27 05-Apr-2001  leo And commit the generated files.
 1.26 28-Sep-2000  leo branches: 1.26.2;
Move the grfbus out of std.atari. You don't want a grfbus defined on headless
and wscons setups.
 1.25 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.24 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.23 26-Jan-2000  leo Restructure the ite/grf definitions:
- Make the ite<n> -> grfXX<n> relations explicit. This solves problems
with the newer autoconf code.
- Nuke the grfcc definition in std.atari. A Hades has not grfcc...
 1.22 29-Jul-1999  augustss branches: 1.22.2;
It's time to be COMPAT_14.
 1.21 26-Jun-1998  lukem branches: 1.21.10;
remove options FIFO; it's now the default
 1.20 10-Apr-1998  leo Use MI wdc-driver.
 1.19 01-Dec-1997  kleink Add COMPAT_13.
 1.18 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.17 29-Aug-1997  leo Define 2 md devices.
 1.16 30-Jul-1997  leo Rename lpt to lp on some places to avoid botches between files.isa and
files.atari.
 1.15 07-May-1997  lukem branches: 1.15.4;
clean up use of whitespace
remove unnecessary quotes around options
 1.14 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.13 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.12 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.11 04-Jan-1997  leo branches: 1.11.2;
grf? -> grfcc?
 1.10 28-Dec-1996  pk rename: ramdisk => md
 1.9 16-Dec-1996  leo Implement an rtc-device. Credits for the idea goes to Wolfgang Solfrank.
Because there is no way yet to tell init(1) to execute commands before
single user-mode is entered, the inittodr() function is still partly
functional. It retrieves the value of the RTC and sets the time as if
the RTC was running at UTC. The resettodr() function is a No-Op. The
RTC can only be changed by a write to /dev/rtc.
The TIMEZONE and DST options are no longer needed and removed from the
config files.
 1.8 17-Nov-1996  leo Move SWAPPAGER, VNODEPAGER and DEVPAGER options to std.atari.
 1.7 08-Nov-1996  leo Move the definition for the floppy device from std.atari to the different
config files because the Hades needs another driver for it.
 1.6 16-Oct-1996  leo Update pathnames of included files for new version of config.
 1.5 04-Oct-1996  leo Add the COMPAT_12 options. For GENERIC, also add the ch/ss/uk devices.
 1.4 16-Sep-1996  leo - Add M68040 option where appropriate
- Reflect changes on the grf/ite/view system for et4000 console support
- Set timezone to 0
- Document FPSP option
 1.3 26-Aug-1996  mrg add COMPAT_12.
 1.2 29-May-1996  leo Add UCONSOLE option.
 1.1 15-May-1996  leo branches: 1.1.4;
Make a BOOTX(tra) config file. It suits more people than BOOT and it allows
me to keep the BOOT config small.
 1.1.4.1 18-Jun-1996  leo Pull up from trunk.
 1.11.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.15.4.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.21.10.1 02-Aug-1999  thorpej Update from trunk.
 1.22.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.22.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.26.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.26.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.33.8.9 29-Dec-2002  thorpej Sync with HEAD.
 1.33.8.8 11-Dec-2002  thorpej Sync with HEAD.
 1.33.8.7 11-Nov-2002  nathanw Catch up to -current
 1.33.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.33.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.33.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.33.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.33.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.33.8.1 09-Jul-2001  nathanw file BOOTX was added on branch nathanw_sa on 2002-01-08 00:23:34 +0000
 1.33.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.33.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.33.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.33.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.33.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.40.4.2 10-Jan-2003  jmc Pullup versions 1.29-1.30 of GENERIC.in and regenerate config's (requested by
leo in ticket #1062)
Since 1.6 we have 3 images (not 2\!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.40.4.1 01-Aug-2002  lukem Pull up revision 1.41 (requested by lukem in ticket #313):
regen for clockctl
 1.40.2.1 14-Jul-2002  gehenna catch up with -current.
 1.48.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.48.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.48.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.48.2.5 29-Nov-2004  skrll Sync with HEAD.
 1.48.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.48.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.48.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.48.2.1 03-Aug-2004  skrll Sync with HEAD
 1.51.2.4 11-Aug-2007  bouyer Regen for ticket 11356
 1.51.2.3 15-Jul-2004  he branches: 1.51.2.3.2;
Pull up regenerated files (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.51.2.2 02-Jul-2004  he Pull up regenerated files (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.51.2.1 30-Jun-2004  jdc Pull up revision 1.52 (requested by abs in ticket #567).

Regenerate from master config files
 1.51.2.3.2.2 11-Aug-2007  bouyer regen for ticket 11356
 1.51.2.3.2.1 02-Apr-2005  he branches: 1.51.2.3.2.1.2;
Pull up regenerated files (requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx)
series of controllers.
 1.51.2.3.2.1.2.1 11-Aug-2007  bouyer Regen for ticket 11356
 1.54.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.54.6.1 12-Feb-2005  yamt sync with head.
 1.54.4.1 29-Apr-2005  kent sync with -current
 1.56.4.2 03-Sep-2007  yamt sync with head.
 1.56.4.1 21-Jun-2006  yamt sync with head.
 1.56.2.2 05-Nov-2005  tron Regen for ticket #929.
 1.56.2.1 14-Aug-2005  riz Pull up revision 1.57 (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.62.4.1 09-Sep-2006  rpaulo sync with head
 1.62.2.1 18-Feb-2006  yamt sync with head.
 1.63.2.1 22-Apr-2006  simonb Sync with head.
 1.65.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.65.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.65.2.1 01-Apr-2006  yamt sync with head.
 1.67.28.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.67.26.2 03-Oct-2007  garbled Sync with HEAD
 1.67.26.1 26-Jun-2007  garbled Sync with HEAD.
 1.67.20.1 11-Jul-2007  mjf Sync with head.
 1.67.18.2 20-Aug-2007  ad Sync with HEAD.
 1.67.18.1 09-Jun-2007  ad Sync with head.
 1.67.12.3 16-Jan-2009  bouyer Regen for ticket 1264:
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory
issues. Tested by Tuomo.
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.67.12.2 18-Nov-2008  snj Regen for ticket 1227.
 1.67.12.1 06-Jun-2007  bouyer Regen for ticket 699.
 1.69.10.1 06-Nov-2007  matt sync with HEAD
 1.70.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.70.26.1 19-Oct-2008  haad Sync with HEAD.
 1.70.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.70.20.1 04-May-2009  yamt sync with head.
 1.70.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.70.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.71.4.3 26-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #320):
sys/arch/atari/conf/BOOT: file removal
sys/arch/atari/conf/BOOTX: file removal
- Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
 1.71.4.2 25-Nov-2008  snj Regen for ticket 123.
 1.71.4.1 06-Nov-2008  snj Regen for ticket 19.
 1.71.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.71.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.123 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.122 07-Aug-2022  simonb Regen.
 1.121 25-Jun-2022  tsutsui Regen from GENERIC.in rev 1.123.

> Allocalte enough reserved ST-RAM to make the old Xserver work by default.
 1.120 12-Jun-2022  tsutsui Regen from GENERIC.in rev 1.122.

> Specify -fno-unwind-tables to shrink binaries.
 1.119 26-Jan-2021  rin Regen for previous commit to GENERIC.in.
 1.118 10-Aug-2020  rin branches: 1.118.2;
regen
 1.117 13-Apr-2019  isaki branches: 1.117.4;
Regen.
> Add drvctl to kernel which has audio device.
> audiocfg(1) requires drvctl(4).
 1.116 31-Mar-2018  tsutsui branches: 1.116.2;
Regen to denote GENERIC.in rev 1.115 in "Created from:" lines.
 1.115 20-Jan-2018  tsutsui branches: 1.115.2;
Regenerate config files to update RCSIds in "Created from:" lines.
 1.114 14-Sep-2017  mrg clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
 1.113 24-Nov-2014  tsutsui Regen config files from GENERIC.in rev 1.109 by makeconf:

> Shrink GENERIC and enable options MODULAR instead, as other poor m68k ports.
>
> This allows all (at least ATARITT and FALCON, which have certain users)
> gzipped kernel binaries put into 1440KB 2HD floppy so that users can
> load these kernels on the native TOS using LOADBSD.TTP utility for
> installation. Note SMALL030 kernel doesn't include any Ethernet
> configuration and requires CD-ROM or other removable disks.
>
> Should be pulled up to netbsd-7.
 1.112 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.111 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.110 05-Jul-2014  tsutsui branches: 1.110.2;
Regen from GENERIC.in rev 1.106:

> Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.
>
> Also remove COPTS="-Os" from std.* files and specify it in
> GENERIC.in template for SMALL030_KERNEL.
 1.109 30-Jun-2013  rmind branches: 1.109.4;
G/C PFIL_HOOKS from the kernel configs.
 1.108 27-Apr-2013  christos branches: 1.108.4;
remove confusing numeric locators where they are unused.
 1.107 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.106 10-Mar-2012  joerg branches: 1.106.2;
P1003_1B_SEMAPHORE is no longer optional.
 1.105 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.104 22-Nov-2011  tls branches: 1.104.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.103 12-Dec-2010  tsutsui branches: 1.103.8;
Regen from GENERIC.in rev 1.92:
> Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
 1.102 23-Nov-2010  hannken Regen.
 1.101 08-May-2010  mrg regenerate these configurations from GENERIC.in.
 1.100 08-May-2010  tsutsui Regen from GENERIC.in rev 1.89:
> - don't enable TMPFS for SMALL030
> - remove dup PTYFS
 1.99 29-Apr-2010  chs regen
 1.98 16-Apr-2010  pooka regen
 1.97 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.96 10-Apr-2010  tsutsui Regen from GENERIC.in rev 1.86:
> Disable options SERCONSOLE (force serial console if DCD is detected)
> because now it's patchable by binpatch(8).
 1.95 01-Apr-2010  tsutsui Regen from GENERIC.in rev 1.85, HADES.in rev 1.10, and MILAN.in rev 1.24:
> Add support for the EtherNEC.
 1.94 13-Mar-2010  tsutsui branches: 1.94.2;
Regen from GENERIC.in rev 1.84:
> Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
 1.93 21-Feb-2010  tsutsui Regen from GENERIC.in rev 1.83:
> Add pseudo-device ksyms. Noticed by David Ross on port-atari.
 1.92 05-Dec-2009  pooka branches: 1.92.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.91 06-Mar-2009  abs Regenerate after shrinking kernels to fit on floppies
 1.90 24-Jan-2009  abs branches: 1.90.2;
- Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
- Regenerate everything else - only changes in comments
 1.89 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.88 15-Nov-2008  abs Regenerate: Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo
 1.87 09-Nov-2008  abs Regenerate from GENERIC.in 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.86 06-Nov-2008  abs Add the following note to README:

Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.

Then follow it. Noted by tsutsui@
 1.85 05-Nov-2008  abs Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.84 31-Jul-2008  simonb branches: 1.84.2; 1.84.4;
Regen for "options WAPBL".
 1.83 17-Oct-2007  garbled branches: 1.83.16; 1.83.20; 1.83.22; 1.83.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.82 16-Jul-2007  he branches: 1.82.10;
Regenerate configurations after adding COMPAT_40 to GENERIC.in.
 1.81 06-Jun-2007  martin regen
 1.80 26-Aug-2006  christos branches: 1.80.6; 1.80.12; 1.80.14; 1.80.20; 1.80.22;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.79 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.78 28-Mar-2006  pavel branches: 1.78.6;
regen (added stf).
 1.77 28-Mar-2006  rpaulo regen
 1.76 05-Feb-2006  cube branches: 1.76.2; 1.76.4; 1.76.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.75 04-Feb-2006  rpaulo regen
 1.74 03-Feb-2006  reinoud branches: 1.74.2;
Regen GENERIC files
 1.73 11-Dec-2005  christos branches: 1.73.2; 1.73.4;
merge ktrace-lwp.
 1.72 03-Nov-2005  chs regen
 1.71 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.70 19-Aug-2005  christos 64 bit inode changes.
 1.69 31-Jul-2005  yamt regen.
 1.68 30-Jul-2005  yamt regen.
 1.67 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.66 25-Feb-2005  simonb branches: 1.66.2; 1.66.4;
Regen for COMPAT_20 additions.
 1.65 31-Jan-2005  hannken Regen.
 1.64 24-Nov-2004  bouyer branches: 1.64.4; 1.64.6;
Regen (initially for pdcsata(4), but it looks like the files were not
regenerated after some recent addition to kernel configs).
 1.63 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.62 28-Jun-2004  bouyer Regen, added P1003_1B_SEMAPHORE.
 1.61 26-Jun-2004  abs Regenerate from master config files
 1.60 08-Oct-2003  bouyer branches: 1.60.2;
Regen: Add new per-chip pciide drivers.
 1.59 08-Oct-2003  bouyer Regen: add atabus.
 1.58 22-Sep-2003  cl regen
 1.57 10-Apr-2003  christos branches: 1.57.2;
Bye Bye UCONSOLE
 1.56 02-Feb-2003  thomas Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.55 28-Dec-2002  leo Regen.
 1.54 22-Nov-2002  wiz regen
 1.53 21-Oct-2002  jdc Regenerate config. files from GENERIC.in rev. 1.28.
 1.52 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.51 06-Oct-2002  provos regen from GENERIC.in
 1.50 18-Sep-2002  lukem regen for: enable USERCONF
 1.49 02-Sep-2002  leo Regen.
 1.48 17-Jun-2002  lukem regen for clockctl
 1.47 25-Apr-2002  atatat branches: 1.47.2; 1.47.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.46 16-Apr-2002  bjh21 Regen. Remove pppoe from FALCON kernels.
 1.45 12-Apr-2002  leo Regen.
 1.44 12-Apr-2002  leo Move USERCONF to GENERIC.in and trim the phy-list.
 1.43 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.42 27-Jan-2002  jdolecek regen:
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.41 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.40 09-Jul-2001  leo branches: 1.40.2; 1.40.8;
Regen.
 1.39 08-Jul-2001  abs (Regenerated atari and amiga)
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.38 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.37 10-Apr-2001  leo Regen. again...
 1.36 10-Apr-2001  leo Regen.
 1.35 06-Apr-2001  leo Regen.
 1.34 05-Apr-2001  leo And commit the generated files.
 1.33 28-Sep-2000  leo branches: 1.33.2;
Move the grfbus out of std.atari. You don't want a grfbus defined on headless
and wscons setups.
 1.32 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.31 12-Feb-2000  thorpej branches: 1.31.4;
Nuke NKMEMCLUSTERS.
 1.30 26-Jan-2000  leo Restructure the ite/grf definitions:
- Make the ite<n> -> grfXX<n> relations explicit. This solves problems
with the newer autoconf code.
- Nuke the grfcc definition in std.atari. A Hades has not grfcc...
 1.29 29-Jul-1999  augustss branches: 1.29.2;
It's time to be COMPAT_14.
 1.28 20-Nov-1998  leo branches: 1.28.6;
Adapt to new wd world-order.
 1.27 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.26 10-Apr-1998  leo Use MI wdc-driver.
 1.25 01-Dec-1997  kleink Add COMPAT_13.
 1.24 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.23 29-Aug-1997  leo Define 2 md devices.
 1.22 30-Jul-1997  leo Rename lpt to lp on some places to avoid botches between files.isa and
files.atari.
 1.21 07-May-1997  lukem branches: 1.21.4;
clean up use of whitespace
remove unnecessary quotes around options
 1.20 04-Apr-1997  leo Add IDE driver (Markus Kilbinger).
 1.19 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.18 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.17 04-Jan-1997  leo branches: 1.17.2;
grf? -> grfcc?
 1.16 28-Dec-1996  pk rename: ramdisk => md
 1.15 16-Dec-1996  leo Implement an rtc-device. Credits for the idea goes to Wolfgang Solfrank.
Because there is no way yet to tell init(1) to execute commands before
single user-mode is entered, the inittodr() function is still partly
functional. It retrieves the value of the RTC and sets the time as if
the RTC was running at UTC. The resettodr() function is a No-Op. The
RTC can only be changed by a write to /dev/rtc.
The TIMEZONE and DST options are no longer needed and removed from the
config files.
 1.14 17-Nov-1996  leo Move SWAPPAGER, VNODEPAGER and DEVPAGER options to std.atari.
 1.13 08-Nov-1996  leo Move the definition for the floppy device from std.atari to the different
config files because the Hades needs another driver for it.
 1.12 16-Oct-1996  leo Update pathnames of included files for new version of config.
 1.11 04-Oct-1996  leo Add the COMPAT_12 options. For GENERIC, also add the ch/ss/uk devices.
 1.10 16-Sep-1996  leo - Add M68040 option where appropriate
- Reflect changes on the grf/ite/view system for et4000 console support
- Set timezone to 0
- Document FPSP option
 1.9 26-Aug-1996  mrg add COMPAT_12.
 1.8 27-Mar-1996  leo - Add printer device
- Add ym2149 files
- Make ramdisk a pseudo-device
 1.7 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.6 19-Feb-1996  leo New disklabel handling code (Waldi Ravens).
These are the final (?) modifications to the layout of the NetBSD/Atari
bootblock. The bootblock handling can be made backwards compatible using
the right config options (COMPAT_11 + DISKLABEL_AHDI).
 1.5 06-Jan-1996  leo Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.4 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.3 30-Sep-1995  leo branches: 1.3.2;
Add CD9660 option.
 1.2 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.1 11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.3.2.1 15-Nov-1995  leo Add COMPAT_10
 1.17.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.21.4.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.21.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.28.6.1 02-Aug-1999  thorpej Update from trunk.
 1.29.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.29.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.31.4.2 23-Feb-2002  he Apply patch (requested by leo):
Remove the vlan device because it causes link failure on this
port.
 1.31.4.1 01-May-2001  he Apply patch (requested by he):
Add pseudo-device vlan.
Make sure "rnd is EXPERIMENTAL" comment is removed.
 1.33.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.33.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.40.8.10 29-Dec-2002  thorpej Sync with HEAD.
 1.40.8.9 11-Dec-2002  thorpej Sync with HEAD.
 1.40.8.8 11-Nov-2002  nathanw Catch up to -current
 1.40.8.7 18-Oct-2002  nathanw Catch up to -current.
 1.40.8.6 17-Sep-2002  nathanw Catch up to -current.
 1.40.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.40.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.40.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.40.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.40.8.1 09-Jul-2001  nathanw file FALCON was added on branch nathanw_sa on 2002-01-08 00:23:34 +0000
 1.40.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.40.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.40.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.40.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.40.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.47.4.2 10-Jan-2003  jmc Pullup versions 1.29-1.30 of GENERIC.in and regenerate config's (requested by
leo in ticket #1062)
Since 1.6 we have 3 images (not 2\!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.47.4.1 01-Aug-2002  lukem Pull up revision 1.48 (requested by lukem in ticket #313):
regen for clockctl
 1.47.2.1 14-Jul-2002  gehenna catch up with -current.
 1.57.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.57.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.57.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.57.2.5 29-Nov-2004  skrll Sync with HEAD.
 1.57.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.57.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.57.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.57.2.1 03-Aug-2004  skrll Sync with HEAD
 1.60.2.4 11-Aug-2007  bouyer Regen for ticket 11356
 1.60.2.3 15-Jul-2004  he branches: 1.60.2.3.2;
Pull up regenerated files (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.60.2.2 02-Jul-2004  he Pull up regenerated files (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.60.2.1 30-Jun-2004  jdc Pull up revision 1.61 (requested by abs in ticket #567).

Regenerate from master config files
 1.60.2.3.2.2 11-Aug-2007  bouyer regen for ticket 11356
 1.60.2.3.2.1 02-Apr-2005  he branches: 1.60.2.3.2.1.2;
Pull up regenerated files (requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx)
series of controllers.
 1.60.2.3.2.1.2.1 11-Aug-2007  bouyer Regen for ticket 11356
 1.64.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.64.6.1 12-Feb-2005  yamt sync with head.
 1.64.4.1 29-Apr-2005  kent sync with -current
 1.66.4.3 03-Sep-2007  yamt sync with head.
 1.66.4.2 30-Dec-2006  yamt sync with head.
 1.66.4.1 21-Jun-2006  yamt sync with head.
 1.66.2.2 05-Nov-2005  tron Regen for ticket #929.
 1.66.2.1 14-Aug-2005  riz Pull up revision 1.67 (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.73.4.1 09-Sep-2006  rpaulo sync with head
 1.73.2.1 18-Feb-2006  yamt sync with head.
 1.74.2.1 22-Apr-2006  simonb Sync with head.
 1.76.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.76.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.76.2.2 03-Sep-2006  yamt sync with head.
 1.76.2.1 01-Apr-2006  yamt sync with head.
 1.78.6.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.80.22.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.80.20.2 03-Oct-2007  garbled Sync with HEAD
 1.80.20.1 26-Jun-2007  garbled Sync with HEAD.
 1.80.14.1 11-Jul-2007  mjf Sync with head.
 1.80.12.2 20-Aug-2007  ad Sync with HEAD.
 1.80.12.1 09-Jun-2007  ad Sync with head.
 1.80.6.3 16-Jan-2009  bouyer Regen for ticket 1264:
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory
issues. Tested by Tuomo.
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.80.6.2 18-Nov-2008  snj Regen for ticket 1227.
 1.80.6.1 06-Jun-2007  bouyer Regen for ticket 699.
 1.82.10.1 06-Nov-2007  matt sync with HEAD
 1.83.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.83.26.1 19-Oct-2008  haad Sync with HEAD.
 1.83.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.83.20.3 11-Aug-2010  yamt sync with head.
 1.83.20.2 11-Mar-2010  yamt sync with head
 1.83.20.1 04-May-2009  yamt sync with head.
 1.83.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.83.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.84.4.7 20-Nov-2010  riz Regen for ticket 1368.
 1.84.4.6 20-Nov-2010  riz Regen for ticket 1367.
 1.84.4.5 20-Nov-2010  riz Regen for ticket 1366.
 1.84.4.4 12-Mar-2009  snj Regen for ticket 553.
 1.84.4.3 26-Jan-2009  snj Regen for ticket 320.
 1.84.4.2 25-Nov-2008  snj Regen for ticket 123.
 1.84.4.1 06-Nov-2008  snj Regen for ticket 19.
 1.84.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.84.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.84.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.92.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.92.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.94.2.2 05-Mar-2011  rmind sync with head
 1.94.2.1 30-May-2010  rmind sync with head
 1.103.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.103.8.2 30-Oct-2012  yamt sync with head
 1.103.8.1 17-Apr-2012  yamt sync with head
 1.104.2.2 11-Mar-2012  mrg sync to latest -current
 1.104.2.1 18-Feb-2012  mrg merge to -current.
 1.106.2.4 03-Dec-2017  jdolecek update from HEAD
 1.106.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.106.2.2 23-Jun-2013  tls resync from head
 1.106.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.108.4.1 28-Aug-2013  rmind sync with head
 1.109.4.1 10-Aug-2014  tls Rebase.
 1.110.2.1 14-Dec-2014  martin Regen for #321
 1.115.2.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.116.2.1 10-Jun-2019  christos Sync with HEAD
 1.117.4.2 11-Sep-2022  martin regen (ticket #1521)
 1.117.4.1 11-Sep-2022  martin regen (ticket #1519)
 1.118.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.9 24-Jan-2009  abs - Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.8 11-Dec-2005  christos branches: 1.8.78; 1.8.86; 1.8.88;
merge ktrace-lwp.
 1.7 08-Oct-2003  bouyer Add atabus.
 1.6 02-Sep-2002  leo branches: 1.6.6;
Introduce NO_PHYS_NETWORK as a define in the FALCON kernel. This define is
used to turn off the vlan, bridge and pppoe pseudo devices and the NETATALK
protocol.
 1.5 20-Nov-2001  lukem cleanup whitespace
 1.4 10-Apr-2001  leo branches: 1.4.2; 1.4.4; 1.4.10;
files.atari:
Defopt motherboard type and make ym2149.c dependend on 'standard' atari
boards.
Configfiles:
Add pseudo device mouse. It got dropped in the moves by accident.
 1.3 10-Apr-2001  leo Move GENERIC to GENERIC.in . This avoids confusion since GENERIC is not a
standalone config file anymore.
 1.2 06-Apr-2001  leo branches: 1.2.2;
Add a 'ser0' device to all. Add ne2000, 3Com 3c59x/3c90x and ESS Solo-1
support to the Hades.
 1.1 05-Apr-2001  leo Major overhaul in the config files. The idea is to have the major part of
the generic options in GENERIC instead of duplicated all over the place.
To generate a config file, run 'makeconf'. This script uses cpp to combine
a '.in' file and GENERIC to a real config file.
 1.2.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.10.3 17-Sep-2002  nathanw Catch up to -current.
 1.4.10.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.10.1 10-Apr-2001  nathanw file FALCON.in was added on branch nathanw_sa on 2002-01-08 00:23:34 +0000
 1.4.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.1 10-Apr-2001  bouyer file FALCON.in was added on branch thorpej_scsipi on 2001-04-21 17:53:22 +0000
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.88.1 26-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #320):
sys/arch/atari/conf/ATARITT.in: file removal
sys/arch/atari/conf/FALCON.in: file removal
sys/arch/atari/conf/GENERIC.in: revision 1.78 via patch
sys/arch/atari/conf/HADES.in: revision 1.9
sys/arch/atari/conf/makeconf: revision 1.7
sys/arch/atari/conf/MILAN.in: revision 1.22
- Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.8.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.77 10-Apr-2001  leo Move GENERIC to GENERIC.in . This avoids confusion since GENERIC is not a
standalone config file anymore.
 1.76 05-Apr-2001  leo Major overhaul in the config files. The idea is to have the major part of
the generic options in GENERIC instead of duplicated all over the place.
To generate a config file, run 'makeconf'. This script uses cpp to combine
a '.in' file and GENERIC to a real config file.
 1.75 19-Dec-2000  tsutsui branches: 1.75.2;
Remove "rnd is EXPERIMENTAL" comments.
 1.74 19-Dec-2000  bouyer Add pseudo-device vlan
 1.73 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.72 28-Sep-2000  leo Move the grfbus out of std.atari. You don't want a grfbus defined on headless
and wscons setups.
 1.71 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.70 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.69 27-Jul-2000  mason Moving to a default of 64 PTYs.
 1.68 30-Jun-2000  itojun add PULLDOWN_TEST for all the platforms.
XXX should be moved to somewhere else when stabilized
 1.67 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.66 14-Jun-2000  veego branches: 1.66.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.65 19-Apr-2000  itojun branches: 1.65.2;
add stf pseudo interface (commented out due to possible security risks)
 1.64 22-Mar-2000  cgd add commented out option PCI_CONFIG_DUMP whever there's a PCIVERBOSE.
 1.63 29-Feb-2000  simonb Do the "<space><tab>" thing with the RAID_AUTOCONFIG option.
 1.62 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.61 12-Feb-2000  thorpej Nuke NKMEMCLUSTERS.
 1.60 26-Jan-2000  leo Restructure the ite/grf definitions:
- Make the ite<n> -> grfXX<n> relations explicit. This solves problems
with the newer autoconf code.
- Nuke the grfcc definition in std.atari. A Hades has not grfcc...
 1.59 23-Jan-2000  hubertf Add commented out "ident"-command
 1.58 20-Jan-2000  wrstuden Add overlay to kernel configs.
 1.57 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.56 15-Nov-1999  fvdl Add commented out option SOFTDEP to all GENERIC kernels.
 1.55 29-Jul-1999  augustss branches: 1.55.2; 1.55.8;
It's time to be COMPAT_14.
 1.54 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.53 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.52 15-Dec-1998  itohy branches: 1.52.2; 1.52.4;
Added options COMPAT_LINUX and EXEC_ELF32 as comments
to GENERIC configuration files.
 1.51 09-Dec-1998  leo BVME410 ethernet driver by 'maximum entropy'.
 1.50 25-Nov-1998  hwr Add (commented out) 'gre' pseudo device line. Feedback is welcome.
Inspired by Klaus Klein.
 1.49 16-Nov-1998  oster Added a (commented out) configuration line for the RAIDframe device driver.
 1.48 02-Oct-1998  leo Re-arrange networking options a bit (Julian Coleman)
 1.47 02-Sep-1998  mrg really turn UVM on on the atari...
 1.46 02-Sep-1998  leo mv vmebus -> avmebus to make room for MI vmebus implementation (per
reqest of Drochner).
 1.45 11-Aug-1998  leo KERNEL_RELOC -> RELOC_KERNEL (Entropy)
 1.44 30-Jul-1998  leo Make this a bit more complete. (Triggered by Julian Coleman ;-)
 1.43 26-Jun-1998  lukem branches: 1.43.2;
remove options FIFO; it's now the default
 1.42 11-May-1998  leo Add UVM option.
 1.41 23-Apr-1998  leo Crazy Dots driver by Julian Coleman.
 1.40 18-Mar-1998  bouyer Add commented out "options FFS_EI"
 1.39 01-Dec-1997  kleink Add COMPAT_13.
 1.38 20-Nov-1997  fair add pseudo-device rnd, commented out
 1.37 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.36 29-Aug-1997  leo branches: 1.36.4;
Define 2 md devices.
 1.35 23-Aug-1997  mjacob add a before tab to SCSIVERBOSE
 1.34 20-Aug-1997  mjacob add commented out reference SCSIVERBOSE option
 1.33 30-Jul-1997  leo Rename lpt to lp on some places to avoid botches between files.isa and
files.atari.
 1.32 02-Jun-1997  leo branches: 1.32.4;
Add ipfilter stuff.
 1.31 25-May-1997  leo Add serial driver for 68901 UART (modem1 port).
 1.30 07-May-1997  lukem clean up use of whitespace
remove unnecessary quotes around options
 1.29 09-Apr-1997  thorpej Remove extra "options FPU_EMULATE"
 1.28 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.27 10-Mar-1997  leo Add support for the Lance ethernet card on the VME-bus (Riebl/PAM)
 1.26 03-Mar-1997  leo Addition of VME bus code.
 1.25 31-Jan-1997  thorpej branches: 1.25.4;
Adopt for new file system and root spec grammar.
 1.24 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.23 28-Dec-1996  pk branches: 1.23.2;
rename: ramdisk => md
 1.22 16-Dec-1996  leo Implement an rtc-device. Credits for the idea goes to Wolfgang Solfrank.
Because there is no way yet to tell init(1) to execute commands before
single user-mode is entered, the inittodr() function is still partly
functional. It retrieves the value of the RTC and sets the time as if
the RTC was running at UTC. The resettodr() function is a No-Op. The
RTC can only be changed by a write to /dev/rtc.
The TIMEZONE and DST options are no longer needed and removed from the
config files.
 1.21 17-Nov-1996  leo Move SWAPPAGER, VNODEPAGER and DEVPAGER options to std.atari.
 1.20 08-Nov-1996  leo Move the definition for the floppy device from std.atari to the different
config files because the Hades needs another driver for it.
 1.19 16-Oct-1996  leo Update pathnames of included files for new version of config.
 1.18 04-Oct-1996  leo Add the COMPAT_12 options. For GENERIC, also add the ch/ss/uk devices.
 1.17 16-Sep-1996  leo - Add M68040 option where appropriate
- Reflect changes on the grf/ite/view system for et4000 console support
- Set timezone to 0
- Document FPSP option
 1.16 26-Aug-1996  mrg add COMPAT_12.
 1.15 15-May-1996  leo Get in sync with the mac68k version of the 5380 driver. Also increase
the maximum values of wait_req_xx() functions so some old (slow) scsi-1 drives
will work.
 1.14 14-May-1996  leo Document some more interesting options.
 1.13 27-Mar-1996  leo - Add printer device
- Add ym2149 files
- Make ramdisk a pseudo-device
 1.12 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.11 19-Feb-1996  leo New disklabel handling code (Waldi Ravens).
These are the final (?) modifications to the layout of the NetBSD/Atari
bootblock. The bootblock handling can be made backwards compatible using
the right config options (COMPAT_11 + DISKLABEL_AHDI).
 1.10 06-Jan-1996  leo Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.9 30-Nov-1995  leo Add kernel option for separate {stat,prof}clock
 1.8 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.7 30-Sep-1995  leo branches: 1.7.2;
Add CD9660 option.
 1.6 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.5 11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.4 25-Jun-1995  leo Mouse driver added.
 1.3 09-Jun-1995  leo Show FPU_EMULATE exists
 1.2 28-May-1995  leo Add HZ=64, remove FPCOPROC.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.7.2.3 15-Nov-1995  leo Add COMPAT_10
 1.7.2.2 22-Oct-1995  leo The ccd pseudo-device should be in GENERIC. Also enable FPU_EMULATE.
 1.7.2.1 12-Oct-1995  leo Add bfp+tun devices
 1.23.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.25.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.32.4.3 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.32.4.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk (missed these the last time.)
 1.32.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.36.4.1 20-Nov-1997  mellon Pull rev 1.38 up from trunk (fair)
 1.43.2.1 08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.52.4.2 02-Aug-1999  thorpej Update from trunk.
 1.52.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.52.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.55.8.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.55.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.55.2.5 21-Apr-2001  bouyer Sync with HEAD
 1.55.2.4 02-Apr-2001  bouyer ahc compiles now, and it works on sparc64 so I can't see why it wouldn't
work on something else :)
 1.55.2.3 28-Mar-2001  bouyer ahc not ready yet.
 1.55.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.55.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.65.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.66.2.4 01-May-2001  he Pull up revisions 1.74-1.75 (requested by he):
Add pseudo-device vlan.
Make sure "rnd is EXPERIMENTAL" comment is removed.
 1.66.2.3 04-Oct-2000  itojun pullup (approved by releng-1-5)

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

cvs rdiff -r1.166 -r1.167 syssrc/sys/arch/alpha/conf/GENERIC
cvs rdiff -r1.149 -r1.150 syssrc/sys/arch/amiga/conf/GENERIC
cvs rdiff -r1.11 -r1.12 syssrc/sys/arch/arm26/conf/GENERIC
cvs rdiff -r1.72 -r1.73 syssrc/sys/arch/atari/conf/GENERIC
cvs rdiff -r1.60 -r1.61 syssrc/sys/arch/hp300/conf/GENERIC
cvs rdiff -r1.10 -r1.11 syssrc/sys/arch/luna68k/conf/GENERIC
cvs rdiff -r1.35 -r1.36 syssrc/sys/arch/next68k/conf/GENERIC
cvs rdiff -r1.32 -r1.33 syssrc/sys/arch/ofppc/conf/GENERIC
cvs rdiff -r1.73 -r1.74 syssrc/sys/arch/sun3/conf/GENERIC
cvs rdiff -r1.80 -r1.81 syssrc/sys/arch/vax/conf/GENERIC
cvs rdiff -r1.52 -r1.53 syssrc/sys/arch/x68k/conf/GENERIC
 1.66.2.2 11-Aug-2000  mason Move to default of 64 PTYs in GENERIC kernel config.
Requested by mason, approved by jhawk.
 1.66.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.75.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.126 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.125 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.124 07-Aug-2022  simonb UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.
 1.123 25-Jun-2022  tsutsui Allocalte enough reserved ST-RAM to make the old Xserver work by default.

Instead, check ST-RAM size and TT-RAM size on startup and restrict
size of reserved ST memory on lower RAM machines.
Closes PR port-atari/41002 from David Ross.

While here, make options ST_POOL_SIZE defparam'ed to make sure to
reflect config(5) changes on each build.
 1.122 12-Jun-2022  tsutsui Specify -fno-unwind-tables to shrink binaries.
 1.121 21-Jan-2021  nia add a commented out compat_ossaudio wherever there's compat_linux

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

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.119 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.118 13-Apr-2019  isaki branches: 1.118.4;
Add drvctl to kernel which has audio device.
audiocfg(1) requires drvctl(4).
 1.117 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.116 01-Aug-2018  maxv Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
 1.115 23-Jan-2018  sevan branches: 1.115.2; 1.115.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.114 14-Sep-2017  mrg clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
 1.113 29-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 3.
 1.112 13-Dec-2016  christos branches: 1.112.8;
wildcard speaker attachments, now that we can handle many of them.
 1.111 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.110 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.109 24-Nov-2014  tsutsui branches: 1.109.2; 1.109.4;
Shrink GENERIC and enable options MODULAR instead, as other poor m68k ports.

This allows all (at least ATARITT and FALCON, which have certain users)
gzipped kernel binaries put into 1440KB 2HD floppy so that users can
load these kernels on the native TOS using LOADBSD.TTP utility for
installation. Note SMALL030 kernel doesn't include any Ethernet
configuration and requires CD-ROM or other removable disks.

Should be pulled up to netbsd-7.
 1.108 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.107 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.106 05-Jul-2014  tsutsui branches: 1.106.2;
Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.

Also remove COPTS="-Os" from std.* files and specify it in
GENERIC.in template for SMALL030_KERNEL.
 1.105 30-Jun-2013  rmind branches: 1.105.4;
G/C PFIL_HOOKS from the kernel configs.
 1.104 05-Jun-2013  christos branches: 1.104.2;
remove obsolete networking options
 1.103 27-Apr-2013  christos the bogus number police
 1.102 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.101 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.100 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.99 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.98 10-Mar-2012  joerg branches: 1.98.2;
P1003_1B_SEMAPHORE is no longer optional.
 1.97 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.96 17-Dec-2011  he Drop makeoptions COPTS=-Os for the SMALL030 kernel now that std.atari
contains it.
 1.95 22-Nov-2011  tls branches: 1.95.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.94 30-Jun-2011  wiz branches: 1.94.2;
dependant -> dependent
 1.93 06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.92 12-Dec-2010  tsutsui branches: 1.92.2; 1.92.4;
Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
to deliver the name to recently committed newer and more common MI device,
et(4) at PCIe (Agere ET1310/ET1301 network driver) in PR kern/39094.
http://mail-index.NetBSD.org/source-changes/2010/11/13/msg014416.html

No particular reaction for a month on source-changes-d@,
no responsible person on atari port, and probably
no active user still using ET4000 on TT030 running NetBSD/atari.
 1.91 23-Nov-2010  hannken Remove unused count from pseudo-device md.
 1.90 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.89 08-May-2010  tsutsui - don't enable TMPFS for SMALL030
- remove dup PTYFS
 1.88 29-Apr-2010  chs enable TMPFS in all GENERICs that have MFS enabled.
 1.87 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.86 10-Apr-2010  tsutsui Disable options SERCONSOLE (force serial console if DCD is detected)
because now it's patchable by binpatch(8).

Enabling serial console by DCD signal could be problematic
on some earlier TT030 (with revision A board), and it's also
annoying for users who connect an active device on the serial port
as mentioned in PR port-atari/39849.

XXX: Eventually serial console should be enabled by MD bootloader flags,
XXX: but I have no idea how to build bootloader binaries for TOS.
 1.85 01-Apr-2010  tsutsui Add support for the EtherNEC.

The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.

See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
 1.84 13-Mar-2010  tsutsui branches: 1.84.2;
Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.

The SMC_TT is the user designed "handmade" VME-ISA bridge circuit
for 16 bit VME slot on TT030 and the SMC Elite Ultra ISA Ethernet card.
More information about SMC_TT can be found in the following archive:
ftp://ftp.funet.fi/pub/atari/net/smc_tt1.zip

Demonstrated on the NetBSD booth in Open Source Conference 2010 Kansai@Kobe.
 1.83 21-Feb-2010  tsutsui Add pseudo-device ksyms. Noticed by David Ross on port-atari.
 1.82 05-Dec-2009  pooka branches: 1.82.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.81 23-Nov-2009  abs Do not include FPU_EMULATE in ATARITT only config
 1.80 06-Mar-2009  abs Shuffle some things around and comment out some options to try to ensure
we can fit a gzipped SMALL030 on a 720K floppy and FALCON / ATARITT on
1.44MB ones
 1.79 24-Jan-2009  mrg branches: 1.79.2;
add COMPAT_50 to all the configs with COMPAT_40.
 1.78 24-Jan-2009  abs - Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.77 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.76 15-Nov-2008  abs Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo
 1.75 09-Nov-2008  abs Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.74 05-Nov-2008  abs Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.73 31-Jul-2008  simonb branches: 1.73.2; 1.73.4;
Move "options WAPBL" so that it also gets added to INSTALL kernels.
 1.72 31-Jul-2008  simonb Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.71 31-Dec-2007  ad branches: 1.71.6; 1.71.10; 1.71.12; 1.71.16;
Remove systrace. Ok core@.
 1.70 04-Nov-2007  xtraeme branches: 1.70.2; 1.70.8;
Remove System V semaphores and share memory options to set the limits:
SEMMNI, SEMMNS, SEMUME and SHMMAXPGS.

They can be tweaked via sysctl now. Ports that were setting values on
them weren't touched, I only removed the ones that were commented out.
 1.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 06-Aug-2007  adrianp branches: 1.68.2; 1.68.6;
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.67 16-Jul-2007  he branches: 1.67.2; 1.67.4; 1.67.8;
The COMPAT_AOUT_M68K option now requies COMPAT_40 after the changes
to mount(), so define COMPAT_40 too.
 1.66 06-Jun-2007  martin Add pseudo-device agr
 1.65 11-Nov-2006  jmmv branches: 1.65.2; 1.65.8; 1.65.10; 1.65.16; 1.65.18;
Remove tmpfs's experimental status. OK'ed by core@.
 1.64 26-Aug-2006  christos branches: 1.64.2; 1.64.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.63 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.62 29-Jun-2006  liamjfoy branches: 1.62.2;
Add CARP to further platforms

ok christos, julian coleman and matthew green
 1.61 28-Mar-2006  pavel branches: 1.61.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.60 05-Feb-2006  cube branches: 1.60.2; 1.60.4; 1.60.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.59 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.58 03-Feb-2006  reinoud branches: 1.58.2;
Add uncommented file-system UDF for generated config GENERIC files.
 1.57 11-Dec-2005  christos branches: 1.57.2; 1.57.4;
merge ktrace-lwp.
 1.56 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.55 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.54 19-Aug-2005  christos 64 bit inode changes.
 1.53 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.52 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.51 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.50 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.49 25-Jun-2005  rpaulo branches: 1.49.2;
Add file-system PTYFS (commented out) so that people know its existence.

Ok'ed by Christos Zoulas and Hubert Feyrer.
 1.48 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.47 25-Feb-2005  simonb branches: 1.47.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.46 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.45 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.44 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.43 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.42 17-Jan-2005  cube branches: 1.42.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.41 10-Nov-2004  christos branches: 1.41.4;
Add COMPAT_BSDPTY to the rest of the config files.
 1.40 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.39 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.38 28-Jun-2004  bouyer Add options P1003_1B_SEMAPHORE
to all GENERIC-like kernel config files where SYSV* options were already
present (commented out if the SYSV* options are commented out).
Fix lib/25897 and lib/25898.
 1.37 26-Jun-2004  abs Add (commented out) ALTQ options to all GENERIC-like files
 1.36 22-Jun-2004  itojun have pf and pflog pseudo-device (commented out).
reviewed by matt, perry, christos
 1.35 18-Jun-2004  christos ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM
 1.34 16-Jun-2004  christos Add pseudo-device ptm on all the generic flavored kernels.
 1.33 22-Sep-2003  cl branches: 1.33.2;
add COMPAT_15/COMPAT_16
 1.32 10-Apr-2003  christos branches: 1.32.2;
Bye Bye UCONSOLE
 1.31 02-Feb-2003  thomas Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.30 28-Dec-2002  leo Since 1.6 we have 3 images (not 2!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.29 22-Nov-2002  wiz Fix typo (responsiness -> responsiveness).
 1.28 19-Oct-2002  junyoung Add NEW_BUFQ_STRATEGY (disabled by default).
 1.27 14-Oct-2002  elric Added a commented out cgd(4).
 1.26 06-Oct-2002  provos add SYSTRACE here; pointed out by lukem
 1.25 25-Sep-2002  martti Add one space between "#option" and "<tab>IPFILTER_DEFAULT_BLOCK"
 1.24 20-Sep-2002  martti Added (commented out) IPFILTER_DEFAULT_BLOCK.
 1.23 18-Sep-2002  lukem enable USERCONF
 1.22 02-Sep-2002  leo Introduce NO_PHYS_NETWORK as a define in the FALCON kernel. This define is
used to turn off the vlan, bridge and pppoe pseudo devices and the NETATALK
protocol.
 1.21 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.20 23-May-2002  leo Remove the 'ex at pci' driver. The ex driver does not work with the
3c900-COMBO card at the moment. Something is wrong with DMA.
 1.19 25-Apr-2002  atatat branches: 1.19.2; 1.19.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.18 16-Apr-2002  bjh21 Don't include pppoe in FALCON kernels, since they don't include any Ethernet
devices.
 1.17 12-Apr-2002  leo Move USERCONF to GENERIC.in and trim the phy-list.
 1.16 12-Apr-2002  leo Oops, remove some unintended changes.
 1.15 12-Apr-2002  leo Add some PCI ethernet/audio cards for the Hades and the Milan.
 1.14 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.13 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.12 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.11 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.10 20-Nov-2001  lukem cleanup whitespace
 1.9 08-Sep-2001  thomas branches: 1.9.4;
Now the default ecexutable is ELF.
Add COMPAT_AOUT_M68K to GENERIC options.
 1.8 01-Sep-2001  atatat branches: 1.8.2;
Comment out bridge pseudo devices from ports that don't
__HAVE_GENERIC_SOFT_INTERRUPTS. bridge(4) doesn't compile there.
 1.7 01-Sep-2001  atatat Add bridge pseudo devices to GENERIC configs
 1.6 09-Jul-2001  leo branches: 1.6.2;
Remove Ident.
 1.5 09-Jul-2001  leo Add SysV Semaphore tunables.
 1.4 08-Jul-2001  abs 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.3 11-Jun-2001  wiz branches: 1.3.2;
Fix various misspellings of compatible/compatibility.
 1.2 10-Apr-2001  leo branches: 1.2.2;
The Hades also uses the TT030 like SCSI driver. Remove 'mouse' here...
 1.1 10-Apr-2001  leo Move GENERIC to GENERIC.in . This avoids confusion since GENERIC is not a
standalone config file anymore.
 1.2.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.2.2.1 10-Apr-2001  bouyer file GENERIC.in was added on branch thorpej_scsipi on 2001-04-21 17:53:22 +0000
 1.3.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.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.6.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.8.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.4.10 29-Dec-2002  thorpej Sync with HEAD.
 1.9.4.9 11-Dec-2002  thorpej Sync with HEAD.
 1.9.4.8 11-Nov-2002  nathanw Catch up to -current
 1.9.4.7 18-Oct-2002  nathanw Catch up to -current.
 1.9.4.6 17-Sep-2002  nathanw Catch up to -current.
 1.9.4.5 20-Jun-2002  nathanw Catch up to -current.
 1.9.4.4 17-Apr-2002  nathanw Catch up to -current.
 1.9.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.9.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.9.4.1 08-Sep-2001  nathanw file GENERIC.in was added on branch nathanw_sa on 2002-01-08 00:23:34 +0000
 1.19.4.4 10-Jan-2003  jmc Pullup versions 1.29-1.30 of GENERIC.in and regenerate config's (requested by
leo in ticket #1062)
Since 1.6 we have 3 images (not 2\!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.19.4.3 24-Oct-2002  lukem Pull up upgrade to IPfilter 3.4.29 (requested by martti in ticket #905).
Affected files & revisions:

dist/ipf/HISTORY 1.14
dist/ipf/fils.c 1.17-1.21
dist/ipf/ipf.c 1.11-1.13
dist/ipf/ipfs.c 1.8-1.10
dist/ipf/ipft_ef.c 1.6-1.7
dist/ipf/ipft_td.c 1.6-1.7
dist/ipf/ipft_tx.c 1.7-1.8
dist/ipf/ipmon.c 1.12-1.17
dist/ipf/ipnat.c 1.11-1.12
dist/ipf/ipsend/ip_var.h 1.2
dist/ipf/ipsend/ipsend.c 1.8
dist/ipf/ipsend/iptests.c 1.5
dist/ipf/ipt.c 1.8-1.10
dist/ipf/kmem.c 1.8-1.10
dist/ipf/man/ipf.4 1.10
dist/ipf/man/ipf.5 1.8
dist/ipf/man/ipftest.1 1.3
dist/ipf/man/ipmon.8 1.10
dist/ipf/man/ipnat.5 1.9-1.10
dist/ipf/man/ipnat.8 1.4
dist/ipf/misc.c 1.7
dist/ipf/natparse.c 1.10
dist/ipf/parse.c 1.13
dist/ipf/printnat.c 1.8-1.10
dist/ipf/relay.c 1.5-1.6
dist/ipf/rules/example.9 1.2
etc/rc.d/ipnat 1.8
regress/sys/kern/ipf/Makefile 1.3-1.4
regress/sys/kern/ipf/dotest6 1.2
regress/sys/kern/ipf/expected/f13 1.1.1.2
regress/sys/kern/ipf/expected/i12 1.1.1.1
regress/sys/kern/ipf/expected/ni3 1.1.1.1
regress/sys/kern/ipf/expected/ni5 1.2
regress/sys/kern/ipf/input/f13 1.1.1.2
regress/sys/kern/ipf/input/ipv6.1 1.1.1.1
regress/sys/kern/ipf/input/ni3 1.1.1.1
regress/sys/kern/ipf/regress/i12 1.1.1.1
regress/sys/kern/ipf/regress/ipv6.1 1.1.1.1
regress/sys/kern/ipf/regress/ni3.ipf 1.1.1.1
regress/sys/kern/ipf/regress/ni3.nat 1.1.1.1
sys/arch/alpha/conf/ALPHA 1.169,1.171
sys/arch/amiga/conf/GENERIC 1.185-1.186
sys/arch/arc/conf/GENERIC 1.71-1.72
sys/arch/atari/conf/GENERIC.in 1.24-1.25
sys/arch/cats/conf/GENERIC 1.31-1.32
sys/arch/cobalt/conf/GENERIC 1.34-1.35
sys/arch/hp300/conf/GENERIC 1.83-1.84
sys/arch/i386/conf/CARDBUS 1.66-1.67
sys/arch/i386/conf/GENERIC 1.510,1.512
sys/arch/i386/conf/GENERIC_LAPTOP 1.58-1.59
sys/arch/i386/conf/GENERIC_PS2TINY 1.19-1.20
sys/arch/i386/conf/GENERIC_TINY 1.47-1.48
sys/arch/luna68k/conf/GENERIC 1.33-1.33
sys/arch/mac68k/conf/GENERIC 1.130-1.131
sys/arch/mac68k/conf/GENERICSBC 1.21-1.22
sys/arch/mac68k/conf/SMALLRAM 1.4-1.5
sys/arch/macppc/conf/GENERIC 1.142-1.143
sys/arch/mipsco/conf/GENERIC 1.21-1.22
sys/arch/mmeye/conf/GENERIC 1.44-1.45
sys/arch/news68k/conf/GENERIC 1.36-1.37
sys/arch/news68k/conf/GENERIC_TINY 1.18-1.19
sys/arch/newsmips/conf/GENERIC 1.50-1.51
sys/arch/ofppc/conf/GENERIC 1.56-1.57
sys/arch/pmax/conf/GENERIC 1.103-1.104
sys/arch/prep/conf/GENERIC 1.55-1.56
sys/arch/sbmips/conf/GENERIC 1.11-1.12
sys/arch/sgimips/conf/GENERIC 1.7-1.8
sys/arch/sparc/conf/GENERIC 1.138-1.139
sys/arch/sparc64/conf/GENERIC32 1.46-1.47
sys/arch/vax/conf/GENERIC 1.102-1.103
sys/arch/x68k/conf/ALL 1.55-1.56
sys/arch/x68k/conf/GENERIC 1.80-1.81
sys/lkm/netinet/if_ipl/mln_ipl.c 1.29
sys/netinet/fil.c 1.57-1.58
sys/netinet/ip_auth.c 1.29-1.30
sys/netinet/ip_compat.h 1.30-1.31
sys/netinet/ip_fil.c 1.81-1.86
sys/netinet/ip_fil.h 1.46-1.49
sys/netinet/ip_frag.c 1.33-1.34
sys/netinet/ip_frag.h 1.18
sys/netinet/ip_ftp_pxy.c 1.25-1.26
sys/netinet/ip_h323_pxy.c 1.5-1.6
sys/netinet/ip_log.c 1.22-1.23
sys/netinet/ip_nat.c 1.51-1.53
sys/netinet/ip_nat.h 1.27
sys/netinet/ip_netbios_pxy.c 1.4
sys/netinet/ip_proxy.c 1.35-1.36
sys/netinet/ip_proxy.h 1.18
sys/netinet/ip_state.c 1.41-1.42
sys/netinet/ip_state.h 1.23
sys/netinet/ipl.h 1.14
 1.19.4.2 01-Aug-2002  lukem Pull up revision 1.21 (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.19.4.1 28-May-2002  lukem Pull up revision 1.20 (requested by leo):
Remove the 'ex at pci' driver. The ex driver does not work with the
3c900-COMBO card at the moment. Something is wrong with DMA.
 1.19.2.2 14-Jul-2002  gehenna catch up with -current.
 1.19.2.1 30-May-2002  gehenna Catch up with -current.
 1.32.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.32.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.32.2.7 15-Feb-2005  skrll Sync with HEAD.
 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 14-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.2.4 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.33.2.3 15-Jul-2004  he branches: 1.33.2.3.2; 1.33.2.3.4;
Pull up revision 1.39 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.33.2.2 02-Jul-2004  he Pull up revision 1.38 (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.33.2.1 30-Jun-2004  jdc Pull up revision 1.37 (requested by abs in ticket #567).

Add (commented out) ALTQ options to all GENERIC-like files
 1.33.2.3.4.1 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.33.2.3.2.1 11-Aug-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11356):
sys/arch/acorn32/conf/GENERIC 1.80 via patch
sys/arch/amd64/conf/GENERIC 1.154 via patch
sys/arch/amiga/conf/GENERIC.in 1.61 via patch
sys/arch/arc/conf/GENERIC 1.148 via patch
sys/arch/atari/conf/GENERIC.in 1.68 via patch
sys/arch/cats/conf/GENERIC 1.116 via patch
sys/arch/hp300/conf/GENERIC 1.141 via patch
sys/arch/hp700/conf/GENERIC patch
sys/arch/i386/conf/GENERIC 1.840 via patch
sys/arch/i386/conf/GENERIC_LAPTOP 1.239 via patch
sys/arch/i386/conf/GENERIC.MPACPI patch
sys/arch/mac68k/conf/GENERIC 1.182 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x 1.68 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x 1.66 via patch
sys/arch/sparc/conf/GENERIC 1.200 via patch
sys/arch/sparc64/conf/GENERIC32 patch
sys/arch/xen/conf/GENERIC patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.41.4.1 29-Apr-2005  kent sync with -current
 1.42.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.42.2.1 12-Feb-2005  yamt sync with head.
 1.47.2.4 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net&#64;
Ok'ed by core&#64;
 1.47.2.3 05-Nov-2005  tron branches: 1.47.2.3.2; 1.47.2.3.4;
Pull up following revision(s) (requested by chs in ticket #929):
sys/arch/hp300/conf/GENERIC: revision 1.124
sys/arch/acorn32/conf/GENERIC: revision 1.62
sys/arch/pdp10/conf/GENERIC: revision 1.19
sys/arch/mvme68k/conf/GENERIC: revision 1.61
sys/arch/netwinder/conf/GENERIC: revision 1.70
sys/arch/sbmips/conf/GENERIC: revision 1.46
sys/arch/macppc/conf/GENERIC: revision 1.214
sys/arch/bebox/conf/GENERIC: revision 1.89
sys/arch/cobalt/conf/GENERIC: revision 1.83
sys/arch/cats/conf/GENERIC: revision 1.92
sys/arch/shark/conf/GENERIC: revision 1.53
sys/arch/amiga/conf/GENERIC.in: revision 1.45
sys/arch/acorn26/conf/GENERIC: revision 1.37
sys/arch/cesfic/conf/GENERIC: revision 1.38
sys/arch/iyonix/conf/GENERIC: revision 1.21
sys/arch/alpha/conf/GENERIC: revision 1.277
sys/arch/vax/conf/GENERIC: revision 1.143
sys/arch/atari/conf/GENERIC.in: revision 1.56
sys/arch/mipsco/conf/GENERIC: revision 1.53
sys/arch/ofppc/conf/GENERIC: revision 1.85
sys/arch/next68k/conf/GENERIC: revision 1.96
sys/arch/arc/conf/GENERIC: revision 1.125
sys/arch/dreamcast/conf/GENERIC: revision 1.62
turn off DEBUG and DIAGNOSTIC in GENERIC kernels so that they
are compatible with the LKMs that are part of the release.
 1.47.2.2 14-Aug-2005  riz Pull up revision 1.51 (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.47.2.1 18-Jul-2005  riz Pull up revision 1.50 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.47.2.3.4.1 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.47.2.3.2.1 28-Aug-2007  ghen Pull up following revision(s) (requested by adrianp in ticket #1826):
sys/arch/hp300/conf/GENERIC: revision 1.141 via patch
sys/arch/amd64/conf/GENERIC: revision 1.154 via patch
sys/arch/cats/conf/GENERIC: revision 1.116 via patch
sys/arch/arc/conf/GENERIC: revision 1.148 via patch
sys/arch/acorn32/conf/GENERIC: revision 1.80 via patch
sys/arch/sparc/conf/GENERIC: revision 1.200 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.88 via patch
sys/arch/atari/conf/GENERIC.in: revision 1.68 via patch
sys/arch/amiga/conf/GENERIC: revision 1.248 via patch
sys/arch/i386/conf/GENERIC.MPACPI: patch
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239 via patch
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66 via patch
sys/arch/i386/conf/GENERIC: revision 1.840 via patch
sys/arch/amiga/conf/GENERIC.in: revision 1.61 via patch
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68 via patch
sys/arch/mac68k/conf/GENERIC: revision 1.182 via patch
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.49.2.5 21-Jan-2008  yamt sync with head
 1.49.2.4 15-Nov-2007  yamt sync with head.
 1.49.2.3 03-Sep-2007  yamt sync with head.
 1.49.2.2 30-Dec-2006  yamt sync with head.
 1.49.2.1 21-Jun-2006  yamt sync with head.
 1.57.4.1 09-Sep-2006  rpaulo sync with head
 1.57.2.1 18-Feb-2006  yamt sync with head.
 1.58.2.1 22-Apr-2006  simonb Sync with head.
 1.60.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.60.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.60.2.3 03-Sep-2006  yamt sync with head.
 1.60.2.2 11-Aug-2006  yamt sync with head
 1.60.2.1 01-Apr-2006  yamt sync with head.
 1.61.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.62.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.64.4.1 10-Dec-2006  yamt sync with head.
 1.64.2.1 18-Nov-2006  ad Sync with head.
 1.65.18.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.65.16.2 03-Oct-2007  garbled Sync with HEAD
 1.65.16.1 26-Jun-2007  garbled Sync with HEAD.
 1.65.10.1 11-Jul-2007  mjf Sync with head.
 1.65.8.3 03-Dec-2007  ad Sync with HEAD.
 1.65.8.2 20-Aug-2007  ad Sync with HEAD.
 1.65.8.1 09-Jun-2007  ad Sync with head.
 1.65.2.4 16-Jan-2009  bouyer Pull up following revision(s) (requested by tjam in ticket #1264):
sys/arch/atari/conf/GENERIC.in: revision 1.75, 1.76 via patch
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues.
Tested by Tuomo
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.65.2.3 18-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1227):
sys/arch/atari/conf/GENERIC.in: revision 1.74
Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.65.2.2 25-Aug-2007  liamjfoy Pull up following revision(s) (requested by adrianp in ticket #820):
sys/arch/hp300/conf/GENERIC: revision 1.141
sys/arch/alpha/conf/GENERIC: revision 1.315
sys/arch/amd64/conf/GENERIC: revision 1.154
sys/arch/cats/conf/GENERIC: revision 1.116
sys/arch/arc/conf/GENERIC: revision 1.148
sys/arch/acorn32/conf/GENERIC: revision 1.80
sys/arch/sparc/conf/GENERIC: revision 1.200
sys/arch/sparc64/conf/GENERIC: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.68
sys/arch/amiga/conf/GENERIC: revision 1.248
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.239
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.66
sys/arch/i386/conf/GENERIC: revision 1.840
sys/arch/amiga/conf/GENERIC.in: revision 1.61
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.68
sys/arch/mac68k/conf/GENERIC: revision 1.182
Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
 1.65.2.1 06-Jun-2007  bouyer pullup the following revisions (requested my martin in ticket #699):
sys/arch/acorn26/conf/GENERIC 1.50
sys/arch/acorn32/conf/GENERIC 1.79
sys/arch/alpha/conf/GENERIC 1.313
sys/arch/amd64/conf/GENERIC 1.148
sys/arch/amiga/conf/GENERIC 1.245
sys/arch/arc/conf/GENERIC 1.146
sys/arch/bebox/conf/GENERIC 1.105
sys/arch/cats/conf/GENERIC 1.115
sys/arch/cobalt/conf/GENERIC 1.108
sys/arch/dreamcast/conf/GENERIC 1.78
sys/arch/ews4800mips/conf/GENERIC 1.18
sys/arch/hp300/conf/GENERIC 1.139
sys/arch/hp700/conf/GENERIC 1.74
sys/arch/hpcmips/conf/GENERIC 1.196
sys/arch/i386/conf/GENERIC 1.831
sys/arch/iyonix/conf/GENERIC 1.38 via patch
sys/arch/landisk/conf/GENERIC 1.8 via patch
sys/arch/luna68k/conf/GENERIC 1.78
sys/arch/mac68k/conf/GENERIC 1.181
sys/arch/macppc/conf/GENERIC 1.256 via patch
sys/arch/mipsco/conf/GENERIC 1.65
sys/arch/mmeye/conf/GENERIC 1.88
sys/arch/mvme68k/conf/GENERIC 1.71
sys/arch/news68k/conf/GENERIC 1.88
sys/arch/newsmips/conf/GENERIC 1.98
sys/arch/next68k/conf/GENERIC 1.108
sys/arch/ofppc/conf/GENERIC 1.98
sys/arch/pc532/conf/GENERIC 1.70
sys/arch/pmax/conf/GENERIC 1.152
sys/arch/prep/conf/GENERIC 1.135
sys/arch/sbmips/conf/GENERIC 1.61
sys/arch/sparc/conf/GENERIC 1.199
sys/arch/sparc64/conf/GENERIC 1.85
sys/arch/sun3/conf/GENERIC 1.138
sys/arch/vax/conf/GENERIC 1.157
sys/arch/x68k/conf/GENERIC 1.134
sys/arch/amiga/conf/GENERIC.in 1.59
sys/arch/sgimips/conf/GENERIC32_IP2x 1.66
sys/arch/sgimips/conf/GENERIC32_IP3x 1.63
sys/arch/sun3/conf/GENERIC3X 1.95
sys/arch/atari/conf/GENERIC.in 1.66

Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.67.8.2 04-Nov-2007  jmcneill Sync with HEAD.
 1.67.8.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.67.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.67.2.1 07-Aug-2007  matt Sync with HEAD.
 1.68.6.1 13-Nov-2007  bouyer Sync with HEAD
 1.68.2.2 09-Jan-2008  matt sync with HEAD
 1.68.2.1 06-Nov-2007  matt sync with HEAD
 1.70.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.70.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.71.16.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.71.16.1 19-Oct-2008  haad Sync with HEAD.
 1.71.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.71.10.3 11-Aug-2010  yamt sync with head.
 1.71.10.2 11-Mar-2010  yamt sync with head
 1.71.10.1 04-May-2009  yamt sync with head.
 1.71.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.71.6.1 28-Sep-2008  mjf Sync with HEAD.
 1.73.4.8 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1368):
sys/arch/atari/dev/ser.c: revision 1.49
sys/arch/atari/conf/GENERIC.in: revision 1.86
Make options SERCONSOLE (force serial console if DCD is detected)
patchable by binpatch(8) like:
---
serconsole(0x23bac4): 0x00000001 (1), at offset 0x23bb44 in /netbsd
new value: 0x00000000 (0)
---
May work around PR port-atari/39849
(netbsd-ATARITT kernel fails with serial port connected)
and some old TT030 with early revision boards.
Disable options SERCONSOLE (force serial console if DCD is detected)
because now it's patchable by binpatch(8).
Enabling serial console by DCD signal could be problematic
on some earlier TT030 (with revision A board), and it's also
annoying for users who connect an active device on the serial port
as mentioned in PR port-atari/39849.
XXX: Eventually serial console should be enabled by MD bootloader flags,
XXX: but I have no idea how to build bootloader binaries for TOS.
 1.73.4.7 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1367):
sys/dev/ic/ne2000var.h: revision 1.25
sys/arch/atari/conf/MILAN.in: revision 1.24
sys/arch/atari/conf/MILAN.in: revision 1.25
sys/dev/ic/ne2000.c: revision 1.71
sys/dev/ic/ne2000.c: revision 1.72
sys/arch/atari/dev/if_ne_mb.c: revision 1.1
sys/arch/atari/dev/if_ne_mb.c: revision 1.2
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.69
sys/arch/atari/conf/HADES.in: revision 1.10
sys/arch/atari/conf/HADES.in: revision 1.11
sys/arch/x68k/dev/if_ne_neptune.c: revision 1.20
sys/dev/isa/if_ne_isa.c: revision 1.27
sys/arch/atari/atari/autoconf.c: revision 1.57
sys/dev/ic/ne2000.c: revision 1.62
sys/dev/isapnp/if_ne_isapnp.c: revision 1.27
sys/arch/atari/conf/files.atari: revision 1.117
sys/arch/atari/conf/HADES: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.85
sys/dev/ic/ne2000.c: revision 1.65
sys/dev/ic/ne2000.c: revision 1.66
sys/dev/ic/ne2000.c: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.65
distrib/notes/atari/hardware: revision 1.24
sys/conf/files: revision 1.980
sys/dev/ic/ne2000var.h: revision 1.21
sys/arch/x68k/dev/if_ne_intio.c: revision 1.16
sys/dev/ic/dp8390.c: revision 1.74
sys/dev/ic/dp8390.c: revision 1.75
Added NE2000 with 8bit bus width support.
reviewd by tsutsui@ at tech-kern ML.
Fix a wrong calculation bug around RX ring buffer memory address
slipped in about sixteen years ago. Fortunately, it had been working
for ages because some devices used address zero and other devices
ignored wrong higher bits.
Tested on we(4) (SMC Elite Ultra) and ne(4) (NE2000 compatible
named UL0001) on ISA.
Note FreeBSD also uses the same correct value in their ed(4) driver.
Now dp8390_config() calculates mem_ring correctly so
no longer need to override it in ne2000_attach().
Use roundup2() in <sys/param.h> rather than a conditional.
Also fix a wrong mem_ring calculation in dp8390_ipkdb_attach().
Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.
* move RTL8019 probe and attach code from each bus attachment
to MI ne2000_detect() and ne2000_attach()
* change a method for backend and attachment to specify 8 bit mode
to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
* handle more NE2000 8 bit mode specific settings, including
bus_space(9) access width and available size of buffer memory
* add a function to detect NE2000 8 bit mode
(disabled by default, but enalbed by options NE2000_DETECT_8BIT
to avoid possible regression on various ISA clones)
* fix ipkdb attachment accordingly (untested)
Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.
See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
No need to override mem_ring value in ne2000_ipkdb_attach()
since a wrong calculation in dp8390_ipkdb_attach() was fixed.
Don't warn about DMA timeout during probe.
Add support for the EtherNEC.
The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.
See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
Also note EtherNEC.
Use callout_schedule(9) rather than callout_reset(9) on polling
as callout(9) man says.
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.73.4.6 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1366):
sys/arch/atari/vme/if_we_vme.c: revision 1.1
sys/arch/atari/vme/if_we_vme.c: revision 1.2
sys/arch/atari/conf/files.atari: revision 1.116
sys/arch/atari/conf/GENERIC.in: revision 1.84
share/man/man4/we.4: revision 1.17
distrib/notes/atari/hardware: revision 1.23
Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
The SMC_TT is the user designed "handmade" VME-ISA bridge circuit
for 16 bit VME slot on TT030 and the SMC Elite Ultra ISA Ethernet card.
More information about SMC_TT can be found in the following archive:
ftp://ftp.funet.fi/pub/atari/net/smc_tt1.zip
Demonstrated on the NetBSD booth in Open Source Conference 2010 Kansai@Kobe.
Check if mapped bus_space regions are actually valid
before trying to access them.
Fixes trap panic when SMC_TT board is not installed. (oops)
Note atari SMC_TT in SYNOPSIS.
- note SMC_TT to supported VME-bus devices
- capitalize Ethernet
 1.73.4.5 12-Mar-2009  snj Pull up following revision(s) (requested by abs in ticket #553):
sys/arch/atari/conf/GENERIC.in: revision 1.80
Shuffle some things around and comment out some options to try to ensure
we can fit a gzipped SMALL030 on a 720K floppy and FALCON / ATARITT on
1.44MB ones
 1.73.4.4 26-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #320):
sys/arch/atari/conf/ATARITT.in: file removal
sys/arch/atari/conf/FALCON.in: file removal
sys/arch/atari/conf/GENERIC.in: revision 1.78 via patch
sys/arch/atari/conf/HADES.in: revision 1.9
sys/arch/atari/conf/makeconf: revision 1.7
sys/arch/atari/conf/MILAN.in: revision 1.22
- Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.73.4.3 25-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #123):
sys/arch/atari/conf/GENERIC.in: revision 1.76
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues.
Tested by Tuomo
 1.73.4.2 25-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #123):
sys/arch/atari/conf/GENERIC.in: revision 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.73.4.1 06-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #19):
sys/arch/atari/conf/GENERIC.in: revision 1.74
Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.73.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.73.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.73.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.79.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.82.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.82.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.84.2.3 21-Apr-2011  rmind sync with head
 1.84.2.2 05-Mar-2011  rmind sync with head
 1.84.2.1 30-May-2010  rmind sync with head
 1.92.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.92.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.94.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.94.2.2 30-Oct-2012  yamt sync with head
 1.94.2.1 17-Apr-2012  yamt sync with head
 1.95.2.2 11-Mar-2012  mrg sync to latest -current
 1.95.2.1 18-Feb-2012  mrg merge to -current.
 1.98.2.4 03-Dec-2017  jdolecek update from HEAD
 1.98.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.98.2.2 23-Jun-2013  tls resync from head
 1.98.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.104.2.1 28-Aug-2013  rmind sync with head
 1.105.4.1 10-Aug-2014  tls Rebase.
 1.106.2.1 14-Dec-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #321):
sys/arch/atari/conf/ATARITT: revision 1.116
sys/arch/atari/conf/FALCON: revision 1.113
sys/arch/atari/conf/HADES: revision 1.107
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.88
sys/arch/atari/conf/SMALL030: revision 1.20
sys/arch/atari/conf/GENERIC.in: revision 1.109
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.84
Shrink GENERIC and enable options MODULAR instead, as other poor m68k ports.

This allows all (at least ATARITT and FALCON, which have certain users)
gzipped kernel binaries put into 1440KB 2HD floppy so that users can
load these kernels on the native TOS using LOADBSD.TTP utility for
installation. Note SMALL030 kernel doesn't include any Ethernet
configuration and requires CD-ROM or other removable disks.
 1.109.4.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.109.2.2 28-Aug-2017  skrll Sync with HEAD
 1.109.2.1 05-Feb-2017  skrll Sync with HEAD
 1.112.8.1 26-Jan-2018  martin Pull up following revision(s) (requested by sevan in ticket #510):
sys/arch/sun3/conf/GENERIC3X: revision 1.130
sys/arch/sparc64/conf/GENERIC: revision 1.203
sys/arch/news68k/conf/LIBERO: revision 1.66
sys/arch/amiga/conf/DRACO: revision 1.185
sys/arch/evbarm/conf/MV2120: revision 1.35
sys/arch/x68k/conf/GENERIC: revision 1.187
sys/arch/rs6000/conf/GENERIC: revision 1.39
sys/arch/news68k/conf/GENERIC_TINY: revision 1.86
sys/arch/i386/conf/XEN3_DOMU: revision 1.88
sys/arch/iyonix/conf/GENERIC: revision 1.97
sys/arch/evbarm64/conf/A64EMUL: revision 1.11
sys/arch/mvme68k/conf/GENERIC: revision 1.98
sys/arch/acorn32/conf/GENERIC: revision 1.124
sys/arch/i386/conf/XEN3_DOM0: revision 1.125
sys/arch/cobalt/conf/INSTALL: revision 1.65
sys/arch/macppc/conf/GENERIC_601: revision 1.16
sys/arch/hppa/conf/GENERIC: revision 1.17
sys/arch/amiga/conf/GENERIC.in: revision 1.137
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.33
sys/arch/netwinder/conf/GENERIC: revision 1.134
sys/arch/amd64/conf/XEN3_DOMU: revision 1.83
sys/arch/mac68k/conf/GENERIC: revision 1.225
sys/arch/arc/conf/RPC44: revision 1.54
sys/arch/mipsco/conf/GENERIC: revision 1.92
sys/arch/cats/conf/GENERIC: revision 1.166
sys/arch/amd64/conf/XEN3_DOM0: revision 1.145
sys/arch/amigappc/conf/GENERIC: revision 1.33
sys/arch/sun3/conf/GENERIC: revision 1.176
sys/arch/news68k/conf/GENERIC: revision 1.130
sys/arch/hpcsh/conf/GENERIC: revision 1.110
sys/arch/hp300/conf/GENERIC: revision 1.198
sys/arch/atari/conf/GENERIC.in: revision 1.115
sys/arch/sparc/conf/MRCOFFEE: revision 1.54
sys/arch/evbppc/conf/EXPLORA451: revision 1.62
sys/arch/cesfic/conf/GENERIC: revision 1.69
sys/arch/vax/conf/GENERIC: revision 1.204
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.115
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.112
sys/arch/sparc/conf/GENERIC: revision 1.258
sys/arch/next68k/conf/GENERIC: revision 1.145
sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.34
sys/arch/prep/conf/GENERIC: revision 1.185
sys/arch/amiga/conf/INSTALL: revision 1.129
sys/arch/newsmips/conf/GENERIC: revision 1.133
sys/arch/cobalt/conf/GENERIC: revision 1.156
sys/arch/sun2/conf/GENERIC: revision 1.99
sys/arch/luna68k/conf/INSTALL: revision 1.25
sys/arch/amigappc/conf/NULL: revision 1.53
sys/arch/acorn26/conf/GENERIC: revision 1.85
sys/arch/vax/conf/VAX780: revision 1.25
sys/arch/luna68k/conf/GENERIC: revision 1.125
sys/arch/ews4800mips/conf/GENERIC: revision 1.56
sys/arch/macppc/conf/POWERMAC_G5: revision 1.29
sys/arch/arc/conf/GENERIC: revision 1.189
sys/arch/macppc/conf/MAMBO: revision 1.27
sys/arch/acorn32/conf/EB7500ATX: revision 1.64
sys/arch/pmax/conf/GENERIC: revision 1.196
sys/arch/pmax/conf/GENERIC64: revision 1.28
sys/arch/amiga/conf/GENERIC: revision 1.319
sys/arch/evbarm/conf/MPCSA_GENERIC: revision 1.55
sys/arch/macppc/conf/GENERIC: revision 1.339
sys/arch/emips/conf/GENERIC: revision 1.21
sys/arch/sandpoint/conf/GENERIC: revision 1.97
sys/arch/landisk/conf/GENERIC: revision 1.58
sys/arch/bebox/conf/GENERIC: revision 1.157
sys/arch/alpha/conf/GENERIC: revision 1.379
Alternate buffer queue strategies no longer considered experimental, update
description.
Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
 1.115.4.1 10-Jun-2019  christos Sync with HEAD
 1.115.2.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.115.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.118.4.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1519):

sys/arch/atari/conf/GENERIC.in: revision 1.123
sys/arch/atari/conf/files.atari: revision 1.124
sys/arch/atari/atari/atari_init.c: revision 1.105

Allocalte enough reserved ST-RAM to make the old Xserver work by default.

Instead, check ST-RAM size and TT-RAM size on startup and restrict
size of reserved ST memory on lower RAM machines.

Closes PR port-atari/41002 from David Ross.

While here, make options ST_POOL_SIZE defparam'ed to make sure to
reflect config(5) changes on each build.
 1.120.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.3 21-Nov-1999  itojun bring in content of GENERIC.v6 into GENERIC.
remove GENERIC.v6 file (as it is part of GENERIC now).

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

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

XXX what to do with arch/arm32/SHARK{,.v6}?
 1.2 09-Jul-1999  thorpej branches: 1.2.2; 1.2.8;
Add examples for including the kernel crypto bits from either crypto-us
or crypto-intl, commented out, with instructions to use only one, and
adjust the prefix as necessary.
 1.1 01-Jul-1999  itojun branches: 1.1.2;
kernel configuration for IPv6/IPsec. should be in GENERIC in the future.
(source code will be committed soon)
 1.1.2.3 02-Aug-1999  thorpej Update from trunk.
 1.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 01-Jul-1999  thorpej file GENERIC.v6 was added on branch chs-ubc2 on 1999-07-01 23:03:49 +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.121 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.120 07-Aug-2022  simonb Regen.
 1.119 25-Jun-2022  tsutsui Regen from GENERIC.in rev 1.123.

> Allocalte enough reserved ST-RAM to make the old Xserver work by default.
 1.118 12-Jun-2022  tsutsui Regen from GENERIC.in rev 1.122.

> Specify -fno-unwind-tables to shrink binaries.
 1.117 26-Jan-2021  rin Regen for previous commit to GENERIC.in.
 1.116 10-Aug-2020  rin branches: 1.116.2;
regen
 1.115 13-Apr-2019  isaki branches: 1.115.4;
Regen.
> Add drvctl to kernel which has audio device.
> audiocfg(1) requires drvctl(4).
 1.114 31-Mar-2018  tsutsui branches: 1.114.2;
Regen from HADES.in rev 1.16:

> Remove duplicated devices already defined in the common GENERIC.in.
 1.113 31-Mar-2018  tsutsui Regen to denote GENERIC.in rev 1.115 in "Created from:" lines.
 1.112 20-Jan-2018  tsutsui branches: 1.112.2;
Regenerate config files to update RCSIds in "Created from:" lines.
 1.111 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.110 13-Dec-2016  christos wildcard speaker attachments, now that we can handle many of them.
 1.109 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.108 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.107 24-Nov-2014  tsutsui branches: 1.107.2; 1.107.4;
Regen config files from GENERIC.in rev 1.109 by makeconf:

> Shrink GENERIC and enable options MODULAR instead, as other poor m68k ports.
>
> This allows all (at least ATARITT and FALCON, which have certain users)
> gzipped kernel binaries put into 1440KB 2HD floppy so that users can
> load these kernels on the native TOS using LOADBSD.TTP utility for
> installation. Note SMALL030 kernel doesn't include any Ethernet
> configuration and requires CD-ROM or other removable disks.
>
> Should be pulled up to netbsd-7.
 1.106 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.105 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.104 05-Jul-2014  tsutsui branches: 1.104.2;
Regen from GENERIC.in rev 1.106:

> Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.
>
> Also remove COPTS="-Os" from std.* files and specify it in
> GENERIC.in template for SMALL030_KERNEL.
 1.103 30-Jun-2013  rmind branches: 1.103.4;
G/C PFIL_HOOKS from the kernel configs.
 1.102 27-Apr-2013  christos branches: 1.102.4;
remove confusing numeric locators where they are unused.
 1.101 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.100 10-Mar-2012  joerg branches: 1.100.2;
P1003_1B_SEMAPHORE is no longer optional.
 1.99 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.98 22-Nov-2011  tls branches: 1.98.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.97 12-Dec-2010  tsutsui branches: 1.97.8;
Regen from HADES.in rev 1.12:
> Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4).
 1.96 12-Dec-2010  tsutsui Regen from GENERIC.in rev 1.92:
> Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
 1.95 23-Nov-2010  hannken Regen.
 1.94 08-May-2010  mrg regenerate these configurations from GENERIC.in.
 1.93 08-May-2010  tsutsui Regen from GENERIC.in rev 1.89:
> - don't enable TMPFS for SMALL030
> - remove dup PTYFS
 1.92 29-Apr-2010  chs regen
 1.91 16-Apr-2010  pooka regen
 1.90 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.89 10-Apr-2010  tsutsui Regen from GENERIC.in rev 1.86:
> Disable options SERCONSOLE (force serial console if DCD is detected)
> because now it's patchable by binpatch(8).
 1.88 10-Apr-2010  tsutsui Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
> Remove EtherNEC from HADES and MILAN.
> They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.87 01-Apr-2010  tsutsui Regen from GENERIC.in rev 1.85, HADES.in rev 1.10, and MILAN.in rev 1.24:
> Add support for the EtherNEC.
 1.86 13-Mar-2010  tsutsui branches: 1.86.2;
Regen from GENERIC.in rev 1.84:
> Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
 1.85 21-Feb-2010  tsutsui Regen from GENERIC.in rev 1.83:
> Add pseudo-device ksyms. Noticed by David Ross on port-atari.
 1.84 05-Dec-2009  pooka branches: 1.84.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.83 06-Mar-2009  abs Regenerate after shrinking kernels to fit on floppies
 1.82 24-Jan-2009  abs branches: 1.82.2;
- Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
- Regenerate everything else - only changes in comments
 1.81 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.80 15-Nov-2008  abs Regenerate: Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo
 1.79 09-Nov-2008  abs Regenerate from GENERIC.in 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.78 06-Nov-2008  abs Add the following note to README:

Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.

Then follow it. Noted by tsutsui@
 1.77 05-Nov-2008  abs Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.76 31-Jul-2008  simonb branches: 1.76.2; 1.76.4;
Regen for "options WAPBL".
 1.75 17-Oct-2007  garbled branches: 1.75.16; 1.75.20; 1.75.22; 1.75.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.74 16-Jul-2007  he branches: 1.74.10;
Regenerate configurations after adding COMPAT_40 to GENERIC.in.
 1.73 06-Jun-2007  martin regen
 1.72 26-Aug-2006  christos branches: 1.72.6; 1.72.12; 1.72.14; 1.72.20; 1.72.22;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.71 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.70 28-Mar-2006  pavel branches: 1.70.6;
regen (added stf).
 1.69 28-Mar-2006  rpaulo regen
 1.68 05-Feb-2006  cube branches: 1.68.2; 1.68.4; 1.68.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.67 04-Feb-2006  rpaulo regen
 1.66 03-Feb-2006  reinoud branches: 1.66.2;
Regen GENERIC files
 1.65 11-Dec-2005  christos branches: 1.65.2; 1.65.4;
merge ktrace-lwp.
 1.64 03-Nov-2005  chs regen
 1.63 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.62 19-Aug-2005  christos 64 bit inode changes.
 1.61 31-Jul-2005  yamt regen.
 1.60 30-Jul-2005  yamt regen.
 1.59 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.58 25-Feb-2005  simonb branches: 1.58.2; 1.58.4;
Regen for COMPAT_20 additions.
 1.57 31-Jan-2005  hannken Regen.
 1.56 17-Jan-2005  cube branches: 1.56.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.55 24-Nov-2004  bouyer branches: 1.55.4;
Regen (initially for pdcsata(4), but it looks like the files were not
regenerated after some recent addition to kernel configs).
 1.54 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.53 28-Jun-2004  bouyer Regen, added P1003_1B_SEMAPHORE.
 1.52 26-Jun-2004  abs Regenerate from master config files
 1.51 08-Oct-2003  bouyer branches: 1.51.2;
Regen: Add new per-chip pciide drivers.
 1.50 08-Oct-2003  bouyer Regen: add atabus.
 1.49 22-Sep-2003  cl regen
 1.48 10-Apr-2003  christos branches: 1.48.2;
Bye Bye UCONSOLE
 1.47 02-Feb-2003  thomas Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.46 28-Dec-2002  leo Regen.
 1.45 08-Dec-2002  leo regen.
 1.44 22-Nov-2002  wiz regen
 1.43 21-Oct-2002  jdc Regenerate config. files from GENERIC.in rev. 1.28.
 1.42 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.41 06-Oct-2002  provos regen from GENERIC.in
 1.40 18-Sep-2002  lukem regen for: enable USERCONF
 1.39 17-Jun-2002  lukem regen for clockctl
 1.38 23-May-2002  leo regen.
 1.37 25-Apr-2002  atatat branches: 1.37.2; 1.37.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.36 16-Apr-2002  bjh21 Regen. Remove pppoe from FALCON kernels.
 1.35 12-Apr-2002  leo Regen.
 1.34 12-Apr-2002  leo Move USERCONF to GENERIC.in and trim the phy-list.
 1.33 27-Jan-2002  jdolecek regen:
add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.32 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.31 09-Jul-2001  leo branches: 1.31.2; 1.31.8;
Regen.
 1.30 08-Jul-2001  abs (Regenerated atari and amiga)
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.29 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.28 10-Apr-2001  leo Regen. again...
 1.27 10-Apr-2001  leo Regen.
 1.26 06-Apr-2001  leo Regen.
 1.25 05-Apr-2001  leo And commit the generated files.
 1.24 28-Sep-2000  leo branches: 1.24.2;
Move the grfbus out of std.atari. You don't want a grfbus defined on headless
and wscons setups.
 1.23 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.22 12-Feb-2000  thorpej branches: 1.22.4;
Nuke NKMEMCLUSTERS.
 1.21 26-Jan-2000  leo Restructure the ite/grf definitions:
- Make the ite<n> -> grfXX<n> relations explicit. This solves problems
with the newer autoconf code.
- Nuke the grfcc definition in std.atari. A Hades has not grfcc...
 1.20 29-Jul-1999  augustss branches: 1.20.2;
It's time to be COMPAT_14.
 1.19 20-Nov-1998  leo branches: 1.19.6;
Adapt to new wd world-order.
 1.18 02-Sep-1998  leo mv vmebus -> avmebus to make room for MI vmebus implementation (per
reqest of Drochner).
 1.17 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.16 10-Apr-1998  leo Use MI wdc-driver.
 1.15 01-Dec-1997  kleink Add COMPAT_13.
 1.14 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.13 15-Sep-1997  leo Define isabus by default on the Hades.
 1.12 29-Aug-1997  leo Define 2 md devices.
 1.11 02-Aug-1997  leo Remove 030 support, add 060 support instead.
 1.10 30-Jul-1997  leo Rename lpt to lp on some places to avoid botches between files.isa and
files.atari.
 1.9 07-May-1997  lukem branches: 1.9.4;
clean up use of whitespace
remove unnecessary quotes around options
 1.8 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.7 03-Mar-1997  leo Addition of VME bus code.
 1.6 31-Jan-1997  thorpej branches: 1.6.4;
Adopt for new file system and root spec grammar.
 1.5 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.4 28-Dec-1996  pk branches: 1.4.2;
rename: ramdisk => md
 1.3 16-Dec-1996  leo Implement an rtc-device. Credits for the idea goes to Wolfgang Solfrank.
Because there is no way yet to tell init(1) to execute commands before
single user-mode is entered, the inittodr() function is still partly
functional. It retrieves the value of the RTC and sets the time as if
the RTC was running at UTC. The resettodr() function is a No-Op. The
RTC can only be changed by a write to /dev/rtc.
The TIMEZONE and DST options are no longer needed and removed from the
config files.
 1.2 17-Nov-1996  leo Move SWAPPAGER, VNODEPAGER and DEVPAGER options to std.atari.
 1.1 09-Nov-1996  leo Config file for the Hades.
 1.4.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.6.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.9.4.3 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.4.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.19.6.1 02-Aug-1999  thorpej Update from trunk.
 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.22.4.3 23-Feb-2002  he Apply patch (requested by leo):
Remove the vlan device because it causes link failure on this
port.
 1.22.4.2 25-Jun-2001  he Apply patch (requested by leo):
Omit vlan, correct spelling mistake.
 1.22.4.1 01-May-2001  he Apply patch (requested by he):
Add pseudo-device vlan.
Make sure "rnd is EXPERIMENTAL" comment is removed.
 1.24.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.24.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.31.8.9 29-Dec-2002  thorpej Sync with HEAD.
 1.31.8.8 11-Dec-2002  thorpej Sync with HEAD.
 1.31.8.7 11-Nov-2002  nathanw Catch up to -current
 1.31.8.6 18-Oct-2002  nathanw Catch up to -current.
 1.31.8.5 20-Jun-2002  nathanw Catch up to -current.
 1.31.8.4 17-Apr-2002  nathanw Catch up to -current.
 1.31.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.31.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.31.8.1 09-Jul-2001  nathanw file HADES was added on branch nathanw_sa on 2002-01-08 00:23:34 +0000
 1.31.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.31.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.31.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.31.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.31.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.37.4.3 10-Jan-2003  jmc Pullup versions 1.29-1.30 of GENERIC.in and regenerate config's (requested by
leo in ticket #1062)
Since 1.6 we have 3 images (not 2\!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.37.4.2 01-Aug-2002  lukem Pull up revision 1.39 (requested by lukem in ticket #313):
regen for clockctl
 1.37.4.1 28-May-2002  lukem Pull up revision 1.38 (requested by leo):
regen.
 1.37.2.2 14-Jul-2002  gehenna catch up with -current.
 1.37.2.1 30-May-2002  gehenna Catch up with -current.
 1.48.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.48.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.48.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.48.2.6 24-Jan-2005  skrll Sync with HEAD.
 1.48.2.5 29-Nov-2004  skrll Sync with HEAD.
 1.48.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.48.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.48.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.48.2.1 03-Aug-2004  skrll Sync with HEAD
 1.51.2.4 11-Aug-2007  bouyer Regen for ticket 11356
 1.51.2.3 15-Jul-2004  he branches: 1.51.2.3.2;
Pull up regenerated files (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.51.2.2 02-Jul-2004  he Pull up regenerated files (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.51.2.1 30-Jun-2004  jdc Pull up revision 1.52 (requested by abs in ticket #567).

Regenerate from master config files
 1.51.2.3.2.2 11-Aug-2007  bouyer regen for ticket 11356
 1.51.2.3.2.1 02-Apr-2005  he branches: 1.51.2.3.2.1.2;
Pull up regenerated files (requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx)
series of controllers.
 1.51.2.3.2.1.2.1 11-Aug-2007  bouyer Regen for ticket 11356
 1.55.4.1 29-Apr-2005  kent sync with -current
 1.56.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.56.2.1 12-Feb-2005  yamt sync with head.
 1.58.4.3 03-Sep-2007  yamt sync with head.
 1.58.4.2 30-Dec-2006  yamt sync with head.
 1.58.4.1 21-Jun-2006  yamt sync with head.
 1.58.2.2 05-Nov-2005  tron Regen for ticket #929.
 1.58.2.1 14-Aug-2005  riz Pull up revision 1.59 (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.65.4.1 09-Sep-2006  rpaulo sync with head
 1.65.2.1 18-Feb-2006  yamt sync with head.
 1.66.2.1 22-Apr-2006  simonb Sync with head.
 1.68.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.68.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.68.2.2 03-Sep-2006  yamt sync with head.
 1.68.2.1 01-Apr-2006  yamt sync with head.
 1.70.6.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.72.22.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.72.20.2 03-Oct-2007  garbled Sync with HEAD
 1.72.20.1 26-Jun-2007  garbled Sync with HEAD.
 1.72.14.1 11-Jul-2007  mjf Sync with head.
 1.72.12.2 20-Aug-2007  ad Sync with HEAD.
 1.72.12.1 09-Jun-2007  ad Sync with head.
 1.72.6.3 16-Jan-2009  bouyer Regen for ticket 1264:
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory
issues. Tested by Tuomo.
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.72.6.2 18-Nov-2008  snj Regen for ticket 1227.
 1.72.6.1 06-Jun-2007  bouyer Regen for ticket 699.
 1.74.10.1 06-Nov-2007  matt sync with HEAD
 1.75.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.75.26.1 19-Oct-2008  haad Sync with HEAD.
 1.75.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.75.20.3 11-Aug-2010  yamt sync with head.
 1.75.20.2 11-Mar-2010  yamt sync with head
 1.75.20.1 04-May-2009  yamt sync with head.
 1.75.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.75.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.76.4.7 20-Nov-2010  riz Regen for ticket 1368.
 1.76.4.6 20-Nov-2010  riz Regen for ticket 1367.
 1.76.4.5 20-Nov-2010  riz Regen for ticket 1366.
 1.76.4.4 12-Mar-2009  snj Regen for ticket 553.
 1.76.4.3 26-Jan-2009  snj Regen for ticket 320.
 1.76.4.2 25-Nov-2008  snj Regen for ticket 123.
 1.76.4.1 06-Nov-2008  snj Regen for ticket 19.
 1.76.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.76.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.76.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.82.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.84.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.84.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.86.2.2 05-Mar-2011  rmind sync with head
 1.86.2.1 30-May-2010  rmind sync with head
 1.97.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.97.8.2 30-Oct-2012  yamt sync with head
 1.97.8.1 17-Apr-2012  yamt sync with head
 1.98.2.2 11-Mar-2012  mrg sync to latest -current
 1.98.2.1 18-Feb-2012  mrg merge to -current.
 1.100.2.4 03-Dec-2017  jdolecek update from HEAD
 1.100.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.100.2.2 23-Jun-2013  tls resync from head
 1.100.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.102.4.1 28-Aug-2013  rmind sync with head
 1.103.4.1 10-Aug-2014  tls Rebase.
 1.104.2.1 14-Dec-2014  martin Regen for #321
 1.107.4.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.107.2.1 05-Feb-2017  skrll Sync with HEAD
 1.112.2.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.114.2.1 10-Jun-2019  christos Sync with HEAD
 1.115.4.2 11-Sep-2022  martin regen (ticket #1521)
 1.115.4.1 11-Sep-2022  martin regen (ticket #1519)
 1.116.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.17 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.16 31-Mar-2018  tsutsui Remove duplicated devices already defined in the common GENERIC.in.
 1.15 13-Dec-2016  christos branches: 1.15.14;
wildcard speaker attachments, now that we can handle many of them.
 1.14 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.13 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.12 12-Dec-2010  tsutsui branches: 1.12.18; 1.12.36; 1.12.40;
Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4).
 1.11 10-Apr-2010  tsutsui Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.10 01-Apr-2010  tsutsui Add support for the EtherNEC.

The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.

See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
 1.9 24-Jan-2009  abs branches: 1.9.6;
- Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.8 11-Dec-2005  christos branches: 1.8.78; 1.8.86; 1.8.88;
merge ktrace-lwp.
 1.7 08-Oct-2003  bouyer Add atabus.
 1.6 02-Feb-2003  thomas branches: 1.6.2;
Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.5 08-Dec-2002  leo Make things work with the new autoconf stuff:
- The pcibus is now called 'pcib' and the isabus 'isab'. Their attributes are
'pcibus' and 'isabus' respectively. This makes the underlying busses
attach again.
- Initialize the parent structure in the config_console() function.
Otherwise we end up without a console.
 1.4 10-Apr-2001  leo branches: 1.4.2; 1.4.10;
files.atari:
Defopt motherboard type and make ym2149.c dependend on 'standard' atari
boards.
Configfiles:
Add pseudo device mouse. It got dropped in the moves by accident.
 1.3 10-Apr-2001  leo Move GENERIC to GENERIC.in . This avoids confusion since GENERIC is not a
standalone config file anymore.
 1.2 06-Apr-2001  leo branches: 1.2.2;
Add a 'ser0' device to all. Add ne2000, 3Com 3c59x/3c90x and ESS Solo-1
support to the Hades.
 1.1 05-Apr-2001  leo Major overhaul in the config files. The idea is to have the major part of
the generic options in GENERIC instead of duplicated all over the place.
To generate a config file, run 'makeconf'. This script uses cpp to combine
a '.in' file and GENERIC to a real config file.
 1.2.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.10.2 11-Dec-2002  thorpej Sync with HEAD.
 1.4.10.1 10-Apr-2001  thorpej file HADES.in was added on branch nathanw_sa on 2002-12-11 05:58:19 +0000
 1.4.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.1 10-Apr-2001  bouyer file HADES.in was added on branch thorpej_scsipi on 2001-04-21 17:53:23 +0000
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.88.1 26-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #320):
sys/arch/atari/conf/ATARITT.in: file removal
sys/arch/atari/conf/FALCON.in: file removal
sys/arch/atari/conf/GENERIC.in: revision 1.78 via patch
sys/arch/atari/conf/HADES.in: revision 1.9
sys/arch/atari/conf/makeconf: revision 1.7
sys/arch/atari/conf/MILAN.in: revision 1.22
- Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.8.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.9.6.1 05-Mar-2011  rmind sync with head
 1.12.40.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.12.36.1 05-Feb-2017  skrll Sync with HEAD
 1.12.18.1 03-Dec-2017  jdolecek update from HEAD
 1.15.14.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.7 07-Jun-2001  leo Everything you always wanted to know about Atari,Milan,IDE and byteswaps...
The Milan configuration is split up in 2 parts:
- MILAN_ISAIDE
Supports the traditionally formatted IDE disks on the Milan
- MILAN_PCIIDE
Supports the byte swapped formatted IDE disks on the Milan

If you want to read more, checkout the comment in MILAN.in...
 1.6 29-May-2001  leo Regen.
 1.5 21-May-2001  leo Regen.
 1.4 16-May-2001  leo Regen.
 1.3 14-May-2001  leo Regen.
 1.2 10-Apr-2001  leo branches: 1.2.2;
Regen. again...
 1.1 10-Apr-2001  leo Initial MILAN generic config
 1.2.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.2.2.1 10-Apr-2001  bouyer file MILAN was added on branch thorpej_scsipi on 2001-04-21 17:53:23 +0000
 1.99 15-Aug-2022  tsutsui Regen from MILAN.in rev 1.30.

> Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.
 1.98 07-Aug-2022  simonb Regen.
 1.97 25-Jun-2022  tsutsui Regen from GENERIC.in rev 1.123.

> Allocalte enough reserved ST-RAM to make the old Xserver work by default.
 1.96 12-Jun-2022  tsutsui Regen from GENERIC.in rev 1.122.

> Specify -fno-unwind-tables to shrink binaries.
 1.95 26-Jan-2021  rin Regen for previous commit to GENERIC.in.
 1.94 10-Aug-2020  rin branches: 1.94.2;
regen
 1.93 04-May-2019  tsutsui branches: 1.93.2;
Regen from MILAN.in rev 1.29.

> Add pms(4), wsmouse(4), and wsmux(4) for Milan.
 1.92 13-Apr-2019  isaki Regen.
> Add drvctl to kernel which has audio device.
> audiocfg(1) requires drvctl(4).
 1.91 31-Mar-2018  tsutsui branches: 1.91.2;
Regen to denote GENERIC.in rev 1.115 in "Created from:" lines.
 1.90 20-Jan-2018  tsutsui branches: 1.90.2;
Regen from MILAN.in rev 1.28.

> Restore piixide(4) for Milan and disable other pciide devices.
 1.89 20-Jan-2018  tsutsui Regenerate config files to update RCSIds in "Created from:" lines.
 1.88 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.87 13-Dec-2016  christos branches: 1.87.8;
wildcard speaker attachments, now that we can handle many of them.
 1.86 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.85 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.84 24-Nov-2014  tsutsui branches: 1.84.2; 1.84.4;
Regen config files from GENERIC.in rev 1.109 by makeconf:

> Shrink GENERIC and enable options MODULAR instead, as other poor m68k ports.
>
> This allows all (at least ATARITT and FALCON, which have certain users)
> gzipped kernel binaries put into 1440KB 2HD floppy so that users can
> load these kernels on the native TOS using LOADBSD.TTP utility for
> installation. Note SMALL030 kernel doesn't include any Ethernet
> configuration and requires CD-ROM or other removable disks.
>
> Should be pulled up to netbsd-7.
 1.83 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.82 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.81 05-Jul-2014  tsutsui branches: 1.81.2;
Regen from MILAN.in rev 1.27 and GENERIC.in rev 1.106:

> Enable options WSDISPLAY_COMPAT_USL in template, not in generated files.

> Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.
>
> Also remove COPTS="-Os" from std.* files and specify it in
> GENERIC.in template for SMALL030_KERNEL.
 1.80 30-Jun-2013  rmind branches: 1.80.4;
G/C PFIL_HOOKS from the kernel configs.
 1.79 27-Apr-2013  christos branches: 1.79.4;
remove confusing numeric locators where they are unused.
 1.78 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.77 17-Aug-2012  abs branches: 1.77.2;
Update all kernel configs mentioning WSEMUL_* but not already including
WSDISPLAY_COMPAT_USL using the following rules:
- If WSEMUL_ is commented out, add commented out out WSDISPLAY_COMPAT_USL
- If INSTALL or obviously memory constrained, add WSDISPLAY_DEFAULTSCREENS=1
and commented out WSDISPLAY_COMPAT_USL
- Otherwise add WSDISPLAY_COMPAT_USL

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

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

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

On 5 June 2012 09:47, David Brownlee <abs@absd.org> wrote:
> wsconscfg(8) requires WSDISPLAY_COMPAT_USL in order to switch virtual
> terminals.
>
> Except when in an exceptionally memory or space constrained
> environment (INSTALL being the obvious case), is there any reason why
> all GENERIC and GENERIC-like kernels which have wscons enabled
> shouldn't also have WSDISPLAY_COMPAT_USL?
 1.76 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.75 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.74 22-Nov-2011  tls branches: 1.74.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.73 12-Dec-2010  tsutsui branches: 1.73.8;
Regen from GENERIC.in rev 1.92:
> Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
 1.72 23-Nov-2010  hannken Regen.
 1.71 08-May-2010  mrg regenerate these configurations from GENERIC.in.
 1.70 08-May-2010  tsutsui Regen from GENERIC.in rev 1.89:
> - don't enable TMPFS for SMALL030
> - remove dup PTYFS
 1.69 29-Apr-2010  chs regen
 1.68 16-Apr-2010  pooka regen
 1.67 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.66 10-Apr-2010  tsutsui Regen from GENERIC.in rev 1.86:
> Disable options SERCONSOLE (force serial console if DCD is detected)
> because now it's patchable by binpatch(8).
 1.65 10-Apr-2010  tsutsui Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
> Remove EtherNEC from HADES and MILAN.
> They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.64 01-Apr-2010  tsutsui Regen from GENERIC.in rev 1.85, HADES.in rev 1.10, and MILAN.in rev 1.24:
> Add support for the EtherNEC.
 1.63 13-Mar-2010  tsutsui branches: 1.63.2;
Regen from GENERIC.in rev 1.84:
> Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
 1.62 21-Feb-2010  tsutsui Regen from GENERIC.in rev 1.83:
> Add pseudo-device ksyms. Noticed by David Ross on port-atari.
 1.61 05-Dec-2009  pooka branches: 1.61.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.60 06-Mar-2009  abs Regenerate after shrinking kernels to fit on floppies
 1.59 24-Jan-2009  abs branches: 1.59.2;
- Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
- Regenerate everything else - only changes in comments
 1.58 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.57 15-Nov-2008  abs Regenerate: Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo
 1.56 09-Nov-2008  abs Regenerate from GENERIC.in 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.55 06-Nov-2008  abs Add the following note to README:

Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.

Then follow it. Noted by tsutsui@
 1.54 05-Nov-2008  abs Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.53 31-Jul-2008  simonb branches: 1.53.2; 1.53.4;
Regen for "options WAPBL".
 1.52 17-Oct-2007  garbled branches: 1.52.16; 1.52.20; 1.52.22; 1.52.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.51 16-Jul-2007  he branches: 1.51.10;
Regenerate configurations after adding COMPAT_40 to GENERIC.in.
 1.50 06-Jun-2007  martin regen
 1.49 03-Sep-2006  bjh21 branches: 1.49.6; 1.49.12; 1.49.14; 1.49.20; 1.49.22;
Regen
 1.48 26-Aug-2006  christos PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.47 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.46 28-Mar-2006  pavel branches: 1.46.6;
regen (added stf).
 1.45 28-Mar-2006  rpaulo regen
 1.44 05-Feb-2006  cube branches: 1.44.2; 1.44.4; 1.44.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.43 04-Feb-2006  rpaulo regen
 1.42 03-Feb-2006  reinoud branches: 1.42.2;
Regen GENERIC files
 1.41 11-Dec-2005  christos branches: 1.41.2; 1.41.4;
merge ktrace-lwp.
 1.40 03-Nov-2005  chs regen
 1.39 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.38 19-Aug-2005  christos 64 bit inode changes.
 1.37 31-Jul-2005  yamt regen.
 1.36 30-Jul-2005  yamt regen.
 1.35 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.34 25-Feb-2005  simonb branches: 1.34.2; 1.34.4;
Regen for COMPAT_20 additions.
 1.33 31-Jan-2005  hannken Regen.
 1.32 17-Jan-2005  cube branches: 1.32.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.31 24-Nov-2004  bouyer branches: 1.31.4;
Regen (initially for pdcsata(4), but it looks like the files were not
regenerated after some recent addition to kernel configs).
 1.30 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.29 28-Jun-2004  bouyer Regen, added P1003_1B_SEMAPHORE.
 1.28 26-Jun-2004  abs Regenerate from master config files
 1.27 08-Oct-2003  bouyer branches: 1.27.2;
Regen: Add new per-chip pciide drivers.
 1.26 08-Oct-2003  bouyer Regen: add atabus.
 1.25 22-Sep-2003  cl regen
 1.24 10-Apr-2003  christos branches: 1.24.2;
Bye Bye UCONSOLE
 1.23 02-Feb-2003  thomas Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.22 28-Dec-2002  leo Regen.
 1.21 08-Dec-2002  leo regen.
 1.20 22-Nov-2002  wiz regen
 1.19 21-Oct-2002  jdc Regenerate config. files from GENERIC.in rev. 1.28.
 1.18 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.17 06-Oct-2002  provos regen from GENERIC.in
 1.16 18-Sep-2002  lukem regen for: enable USERCONF
 1.15 17-Jun-2002  lukem regen for clockctl
 1.14 15-Jun-2002  leo Regen for nvr0 + keyword clash.
 1.13 23-May-2002  leo regen.
 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 16-Apr-2002  bjh21 Regen. Remove pppoe from FALCON kernels.
 1.10 12-Apr-2002  leo Regen.
 1.9 12-Apr-2002  leo Move USERCONF to GENERIC.in and trim the phy-list.
 1.8 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.7 27-Jan-2002  jdolecek regen:
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.6 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.5 26-Jul-2001  wiz branches: 1.5.6;
Various typos in comments (neccessary, sceme, choise, ...).
 1.4 09-Jul-2001  leo branches: 1.4.2;
Regen.
 1.3 08-Jul-2001  abs (Regenerated atari and amiga)
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.2 11-Jun-2001  wiz branches: 1.2.2;
Fix various misspellings of compatible/compatibility.
 1.1 07-Jun-2001  leo The newly generated config files.
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.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.4.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 03-Aug-2001  lukem update to -current
 1.5.6.9 29-Dec-2002  thorpej Sync with HEAD.
 1.5.6.8 11-Dec-2002  thorpej Sync with HEAD.
 1.5.6.7 11-Nov-2002  nathanw Catch up to -current
 1.5.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.5.6.5 20-Jun-2002  nathanw Catch up to -current.
 1.5.6.4 17-Apr-2002  nathanw Catch up to -current.
 1.5.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.5.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.6.1 26-Jul-2001  nathanw file MILAN-ISAIDE was added on branch nathanw_sa on 2002-01-08 00:23:35 +0000
 1.12.4.4 10-Jan-2003  jmc Pullup versions 1.29-1.30 of GENERIC.in and regenerate config's (requested by
leo in ticket #1062)
Since 1.6 we have 3 images (not 2\!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.12.4.3 01-Aug-2002  lukem Pull up revision 1.15 (requested by lukem in ticket #313):
regen for clockctl
 1.12.4.2 18-Jun-2002  lukem Pull up revision 1.14 (requested by leo in ticket #310):
Regen for nvr0 + keyword clash.
 1.12.4.1 28-May-2002  lukem Pull up revision 1.13 (requested by leo):
regen.
 1.12.2.2 14-Jul-2002  gehenna catch up with -current.
 1.12.2.1 30-May-2002  gehenna Catch up with -current.
 1.24.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.24.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.24.2.6 24-Jan-2005  skrll Sync with HEAD.
 1.24.2.5 29-Nov-2004  skrll Sync with HEAD.
 1.24.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.24.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.27.2.4 11-Aug-2007  bouyer Regen for ticket 11356
 1.27.2.3 15-Jul-2004  he branches: 1.27.2.3.2;
Pull up regenerated files (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.27.2.2 02-Jul-2004  he Pull up regenerated files (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.27.2.1 30-Jun-2004  jdc Pull up revision 1.28 (requested by abs in ticket #567).

Regenerate from master config files
 1.27.2.3.2.2 11-Aug-2007  bouyer regen for ticket 11356
 1.27.2.3.2.1 02-Apr-2005  he branches: 1.27.2.3.2.1.2;
Pull up regenerated files (requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx)
series of controllers.
 1.27.2.3.2.1.2.1 11-Aug-2007  bouyer Regen for ticket 11356
 1.31.4.1 29-Apr-2005  kent sync with -current
 1.32.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.32.2.1 12-Feb-2005  yamt sync with head.
 1.34.4.3 03-Sep-2007  yamt sync with head.
 1.34.4.2 30-Dec-2006  yamt sync with head.
 1.34.4.1 21-Jun-2006  yamt sync with head.
 1.34.2.2 05-Nov-2005  tron Regen for ticket #929.
 1.34.2.1 14-Aug-2005  riz Pull up revision 1.35 (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.41.4.1 09-Sep-2006  rpaulo sync with head
 1.41.2.1 18-Feb-2006  yamt sync with head.
 1.42.2.1 22-Apr-2006  simonb Sync with head.
 1.44.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.44.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.44.2.3 14-Sep-2006  yamt sync with head.
 1.44.2.2 03-Sep-2006  yamt sync with head.
 1.44.2.1 01-Apr-2006  yamt sync with head.
 1.46.6.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.49.22.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.49.20.2 03-Oct-2007  garbled Sync with HEAD
 1.49.20.1 26-Jun-2007  garbled Sync with HEAD.
 1.49.14.1 11-Jul-2007  mjf Sync with head.
 1.49.12.2 20-Aug-2007  ad Sync with HEAD.
 1.49.12.1 09-Jun-2007  ad Sync with head.
 1.49.6.3 16-Jan-2009  bouyer Regen for ticket 1264:
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory
issues. Tested by Tuomo.
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.49.6.2 18-Nov-2008  snj Regen for ticket 1227.
 1.49.6.1 06-Jun-2007  bouyer Regen for ticket 699.
 1.51.10.1 06-Nov-2007  matt sync with HEAD
 1.52.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.52.26.1 19-Oct-2008  haad Sync with HEAD.
 1.52.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.52.20.3 11-Aug-2010  yamt sync with head.
 1.52.20.2 11-Mar-2010  yamt sync with head
 1.52.20.1 04-May-2009  yamt sync with head.
 1.52.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.52.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.53.4.7 20-Nov-2010  riz Regen for ticket 1368.
 1.53.4.6 20-Nov-2010  riz Regen for ticket 1367.
 1.53.4.5 20-Nov-2010  riz Regen for ticket 1366.
 1.53.4.4 12-Mar-2009  snj Regen for ticket 553.
 1.53.4.3 26-Jan-2009  snj Regen for ticket 320.
 1.53.4.2 25-Nov-2008  snj Regen for ticket 123.
 1.53.4.1 06-Nov-2008  snj Regen for ticket 19.
 1.53.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.53.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.53.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.59.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.61.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.61.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.63.2.2 05-Mar-2011  rmind sync with head
 1.63.2.1 30-May-2010  rmind sync with head
 1.73.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.73.8.2 30-Oct-2012  yamt sync with head
 1.73.8.1 17-Apr-2012  yamt sync with head
 1.74.2.2 11-Mar-2012  mrg sync to latest -current
 1.74.2.1 18-Feb-2012  mrg merge to -current.
 1.77.2.4 03-Dec-2017  jdolecek update from HEAD
 1.77.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.77.2.2 23-Jun-2013  tls resync from head
 1.77.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.79.4.1 28-Aug-2013  rmind sync with head
 1.80.4.1 10-Aug-2014  tls Rebase.
 1.81.2.1 14-Dec-2014  martin Regen for #321
 1.84.4.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.84.2.1 05-Feb-2017  skrll Sync with HEAD
 1.87.8.1 13-Mar-2018  martin Regen for ticket #624
 1.90.2.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.91.2.1 10-Jun-2019  christos Sync with HEAD
 1.93.2.2 11-Sep-2022  martin regen (ticket #1521)
 1.93.2.1 11-Sep-2022  martin regen (ticket #1519)
 1.94.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.103 15-Aug-2022  tsutsui Regen from MILAN.in rev 1.30.

> Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.
 1.102 07-Aug-2022  simonb Regen.
 1.101 25-Jun-2022  tsutsui Regen from GENERIC.in rev 1.123.

> Allocalte enough reserved ST-RAM to make the old Xserver work by default.
 1.100 12-Jun-2022  tsutsui Regen from GENERIC.in rev 1.122.

> Specify -fno-unwind-tables to shrink binaries.
 1.99 26-Jan-2021  rin Regen for previous commit to GENERIC.in.
 1.98 10-Aug-2020  rin branches: 1.98.2;
regen
 1.97 04-May-2019  tsutsui branches: 1.97.2;
Regen from MILAN.in rev 1.29.

> Add pms(4), wsmouse(4), and wsmux(4) for Milan.
 1.96 13-Apr-2019  isaki Regen.
> Add drvctl to kernel which has audio device.
> audiocfg(1) requires drvctl(4).
 1.95 31-Mar-2018  tsutsui branches: 1.95.2;
Regen to denote GENERIC.in rev 1.115 in "Created from:" lines.
 1.94 20-Jan-2018  tsutsui branches: 1.94.2;
Regen from MILAN.in rev 1.28.

> Restore piixide(4) for Milan and disable other pciide devices.
 1.93 20-Jan-2018  tsutsui Regenerate config files to update RCSIds in "Created from:" lines.
 1.92 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.91 13-Dec-2016  christos branches: 1.91.8;
wildcard speaker attachments, now that we can handle many of them.
 1.90 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.89 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.88 24-Nov-2014  tsutsui branches: 1.88.2; 1.88.4;
Regen config files from GENERIC.in rev 1.109 by makeconf:

> Shrink GENERIC and enable options MODULAR instead, as other poor m68k ports.
>
> This allows all (at least ATARITT and FALCON, which have certain users)
> gzipped kernel binaries put into 1440KB 2HD floppy so that users can
> load these kernels on the native TOS using LOADBSD.TTP utility for
> installation. Note SMALL030 kernel doesn't include any Ethernet
> configuration and requires CD-ROM or other removable disks.
>
> Should be pulled up to netbsd-7.
 1.87 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.86 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.85 05-Jul-2014  tsutsui branches: 1.85.2;
Regen from MILAN.in rev 1.27 and GENERIC.in rev 1.106:

> Enable options WSDISPLAY_COMPAT_USL in template, not in generated files.

> Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.
>
> Also remove COPTS="-Os" from std.* files and specify it in
> GENERIC.in template for SMALL030_KERNEL.
 1.84 30-Jun-2013  rmind branches: 1.84.4;
G/C PFIL_HOOKS from the kernel configs.
 1.83 27-Apr-2013  christos branches: 1.83.4;
remove confusing numeric locators where they are unused.
 1.82 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.81 17-Aug-2012  abs branches: 1.81.2;
Update all kernel configs mentioning WSEMUL_* but not already including
WSDISPLAY_COMPAT_USL using the following rules:
- If WSEMUL_ is commented out, add commented out out WSDISPLAY_COMPAT_USL
- If INSTALL or obviously memory constrained, add WSDISPLAY_DEFAULTSCREENS=1
and commented out WSDISPLAY_COMPAT_USL
- Otherwise add WSDISPLAY_COMPAT_USL

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

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

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

On 5 June 2012 09:47, David Brownlee <abs@absd.org> wrote:
> wsconscfg(8) requires WSDISPLAY_COMPAT_USL in order to switch virtual
> terminals.
>
> Except when in an exceptionally memory or space constrained
> environment (INSTALL being the obvious case), is there any reason why
> all GENERIC and GENERIC-like kernels which have wscons enabled
> shouldn't also have WSDISPLAY_COMPAT_USL?
 1.80 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.79 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.78 22-Nov-2011  tls branches: 1.78.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.77 12-Dec-2010  tsutsui branches: 1.77.8;
Regen from GENERIC.in rev 1.92:
> Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
 1.76 23-Nov-2010  hannken Regen.
 1.75 08-May-2010  mrg regenerate these configurations from GENERIC.in.
 1.74 08-May-2010  tsutsui Regen from GENERIC.in rev 1.89:
> - don't enable TMPFS for SMALL030
> - remove dup PTYFS
 1.73 29-Apr-2010  chs regen
 1.72 16-Apr-2010  pooka regen
 1.71 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.70 10-Apr-2010  tsutsui Regen from GENERIC.in rev 1.86:
> Disable options SERCONSOLE (force serial console if DCD is detected)
> because now it's patchable by binpatch(8).
 1.69 10-Apr-2010  tsutsui Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
> Remove EtherNEC from HADES and MILAN.
> They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.68 01-Apr-2010  tsutsui Regen from GENERIC.in rev 1.85, HADES.in rev 1.10, and MILAN.in rev 1.24:
> Add support for the EtherNEC.
 1.67 13-Mar-2010  tsutsui branches: 1.67.2;
Regen from GENERIC.in rev 1.84:
> Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
 1.66 21-Feb-2010  tsutsui Regen from GENERIC.in rev 1.83:
> Add pseudo-device ksyms. Noticed by David Ross on port-atari.
 1.65 05-Dec-2009  pooka branches: 1.65.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.64 06-Mar-2009  abs Regenerate after shrinking kernels to fit on floppies
 1.63 24-Jan-2009  abs branches: 1.63.2;
- Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
- Regenerate everything else - only changes in comments
 1.62 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

Proposed on tech-kern@.
 1.61 15-Nov-2008  abs Regenerate: Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo
 1.60 09-Nov-2008  abs Regenerate from GENERIC.in 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.59 06-Nov-2008  abs Add the following note to README:

Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.

Then follow it. Noted by tsutsui@
 1.58 05-Nov-2008  abs Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
 1.57 31-Jul-2008  simonb branches: 1.57.2; 1.57.4;
Regen for "options WAPBL".
 1.56 17-Oct-2007  garbled branches: 1.56.16; 1.56.20; 1.56.22; 1.56.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.55 16-Jul-2007  he branches: 1.55.10;
Regenerate configurations after adding COMPAT_40 to GENERIC.in.
 1.54 06-Jun-2007  martin regen
 1.53 03-Sep-2006  bjh21 branches: 1.53.6; 1.53.12; 1.53.14; 1.53.20; 1.53.22;
Regen
 1.52 26-Aug-2006  christos PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.51 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.50 28-Mar-2006  pavel branches: 1.50.6;
regen (added stf).
 1.49 28-Mar-2006  rpaulo regen
 1.48 05-Feb-2006  cube branches: 1.48.2; 1.48.4; 1.48.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.47 04-Feb-2006  rpaulo regen
 1.46 03-Feb-2006  reinoud branches: 1.46.2;
Regen GENERIC files
 1.45 11-Dec-2005  christos branches: 1.45.2; 1.45.4;
merge ktrace-lwp.
 1.44 03-Nov-2005  chs regen
 1.43 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.42 19-Aug-2005  christos 64 bit inode changes.
 1.41 31-Jul-2005  yamt regen.
 1.40 30-Jul-2005  yamt regen.
 1.39 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.38 31-May-2005  tron branches: 1.38.2;
Remove attachment for the piixide(4) driver from all non-x86 kernel
configurations because Intel IDE disk controllers only exist as part
of Intel chipsets for x86 systems.
 1.37 25-Feb-2005  simonb branches: 1.37.2;
Regen for COMPAT_20 additions.
 1.36 31-Jan-2005  hannken Regen.
 1.35 17-Jan-2005  cube branches: 1.35.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.34 24-Nov-2004  bouyer branches: 1.34.4;
Regen (initially for pdcsata(4), but it looks like the files were not
regenerated after some recent addition to kernel configs).
 1.33 10-Nov-2004  christos Add COMPAT_BSDPTY to the rest of the config files.
 1.32 28-Jun-2004  bouyer Regen, added P1003_1B_SEMAPHORE.
 1.31 26-Jun-2004  abs Regenerate from master config files
 1.30 14-Dec-2003  thorpej branches: 1.30.2;
Split the Intel i31244 SATA controller ("Artisea") driver out of piixide
into its own driver (artsata).
 1.29 13-Dec-2003  thorpej Collapse the atabus declaration into "atabus* at ata? channel ?".
 1.28 13-Dec-2003  thorpej Split out the Silicon Image SATALink support into its own driver,
"satalink".
 1.27 08-Oct-2003  bouyer Regen: Add new per-chip pciide drivers.
 1.26 08-Oct-2003  bouyer Regen: add atabus.
 1.25 22-Sep-2003  cl regen
 1.24 10-Apr-2003  christos branches: 1.24.2;
Bye Bye UCONSOLE
 1.23 02-Feb-2003  thomas Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.22 28-Dec-2002  leo Regen.
 1.21 08-Dec-2002  leo regen.
 1.20 22-Nov-2002  wiz regen
 1.19 21-Oct-2002  jdc Regenerate config. files from GENERIC.in rev. 1.28.
 1.18 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.17 06-Oct-2002  provos regen from GENERIC.in
 1.16 18-Sep-2002  lukem regen for: enable USERCONF
 1.15 17-Jun-2002  lukem regen for clockctl
 1.14 15-Jun-2002  leo Regen for nvr0 + keyword clash.
 1.13 23-May-2002  leo regen.
 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 16-Apr-2002  bjh21 Regen. Remove pppoe from FALCON kernels.
 1.10 12-Apr-2002  leo Regen.
 1.9 12-Apr-2002  leo Move USERCONF to GENERIC.in and trim the phy-list.
 1.8 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.7 27-Jan-2002  jdolecek regen:
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.6 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.5 26-Jul-2001  wiz branches: 1.5.6;
Various typos in comments (neccessary, sceme, choise, ...).
 1.4 09-Jul-2001  leo branches: 1.4.2;
Regen.
 1.3 08-Jul-2001  abs (Regenerated atari and amiga)
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.2 11-Jun-2001  wiz branches: 1.2.2;
Fix various misspellings of compatible/compatibility.
 1.1 07-Jun-2001  leo The newly generated config files.
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.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.4.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 03-Aug-2001  lukem update to -current
 1.5.6.9 29-Dec-2002  thorpej Sync with HEAD.
 1.5.6.8 11-Dec-2002  thorpej Sync with HEAD.
 1.5.6.7 11-Nov-2002  nathanw Catch up to -current
 1.5.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.5.6.5 20-Jun-2002  nathanw Catch up to -current.
 1.5.6.4 17-Apr-2002  nathanw Catch up to -current.
 1.5.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.5.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.6.1 26-Jul-2001  nathanw file MILAN-PCIIDE was added on branch nathanw_sa on 2002-01-08 00:23:35 +0000
 1.12.4.4 10-Jan-2003  jmc Pullup versions 1.29-1.30 of GENERIC.in and regenerate config's (requested by
leo in ticket #1062)
Since 1.6 we have 3 images (not 2\!):
- 1Mb on HD floppy's
- 1.44Mb on HD floppy's
- 1.44Mb on a DD floppy
 1.12.4.3 01-Aug-2002  lukem Pull up revision 1.15 (requested by lukem in ticket #313):
regen for clockctl
 1.12.4.2 18-Jun-2002  lukem Pull up revision 1.14 (requested by leo in ticket #310):
Regen for nvr0 + keyword clash.
 1.12.4.1 28-May-2002  lukem Pull up revision 1.13 (requested by leo):
regen.
 1.12.2.2 14-Jul-2002  gehenna catch up with -current.
 1.12.2.1 30-May-2002  gehenna Catch up with -current.
 1.24.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.24.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.24.2.6 24-Jan-2005  skrll Sync with HEAD.
 1.24.2.5 29-Nov-2004  skrll Sync with HEAD.
 1.24.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.24.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.30.2.4 11-Aug-2007  bouyer Regen for ticket 11356
 1.30.2.3 15-Jul-2004  he branches: 1.30.2.3.2;
Pull up regenerated files (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.30.2.2 02-Jul-2004  he Pull up regenerated files (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.30.2.1 30-Jun-2004  jdc Pull up revision 1.31 (requested by abs in ticket #567).

Regenerate from master config files
 1.30.2.3.2.2 11-Aug-2007  bouyer regen for ticket 11356
 1.30.2.3.2.1 02-Apr-2005  he branches: 1.30.2.3.2.1.2;
Pull up regenerated files (requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx)
series of controllers.
 1.30.2.3.2.1.2.1 11-Aug-2007  bouyer Regen for ticket 11356
 1.34.4.1 29-Apr-2005  kent sync with -current
 1.35.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.35.2.1 12-Feb-2005  yamt sync with head.
 1.37.2.3 05-Nov-2005  tron Regen for ticket #929.
 1.37.2.2 14-Aug-2005  riz Pull up revision 1.39 (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.37.2.1 01-Jun-2005  riz Pull up revision 1.38 (requested by tron in ticket #362):
Remove attachment for the piixide(4) driver from all non-x86 kernel
configurations because Intel IDE disk controllers only exist as part
of Intel chipsets for x86 systems.
 1.38.2.3 03-Sep-2007  yamt sync with head.
 1.38.2.2 30-Dec-2006  yamt sync with head.
 1.38.2.1 21-Jun-2006  yamt sync with head.
 1.45.4.1 09-Sep-2006  rpaulo sync with head
 1.45.2.1 18-Feb-2006  yamt sync with head.
 1.46.2.1 22-Apr-2006  simonb Sync with head.
 1.48.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.48.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.48.2.3 14-Sep-2006  yamt sync with head.
 1.48.2.2 03-Sep-2006  yamt sync with head.
 1.48.2.1 01-Apr-2006  yamt sync with head.
 1.50.6.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.53.22.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.53.20.2 03-Oct-2007  garbled Sync with HEAD
 1.53.20.1 26-Jun-2007  garbled Sync with HEAD.
 1.53.14.1 11-Jul-2007  mjf Sync with head.
 1.53.12.2 20-Aug-2007  ad Sync with HEAD.
 1.53.12.1 09-Jun-2007  ad Sync with head.
 1.53.6.3 16-Jan-2009  bouyer Regen for ticket 1264:
Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory
issues. Tested by Tuomo.
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
 1.53.6.2 18-Nov-2008  snj Regen for ticket 1227.
 1.53.6.1 06-Jun-2007  bouyer Regen for ticket 699.
 1.55.10.1 06-Nov-2007  matt sync with HEAD
 1.56.26.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.56.26.1 19-Oct-2008  haad Sync with HEAD.
 1.56.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.56.20.3 11-Aug-2010  yamt sync with head.
 1.56.20.2 11-Mar-2010  yamt sync with head
 1.56.20.1 04-May-2009  yamt sync with head.
 1.56.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.56.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.57.4.7 20-Nov-2010  riz Regen for ticket 1368.
 1.57.4.6 20-Nov-2010  riz Regen for ticket 1367.
 1.57.4.5 20-Nov-2010  riz Regen for ticket 1366.
 1.57.4.4 12-Mar-2009  snj Regen for ticket 553.
 1.57.4.3 26-Jan-2009  snj Regen for ticket 320.
 1.57.4.2 25-Nov-2008  snj Regen for ticket 123.
 1.57.4.1 06-Nov-2008  snj Regen for ticket 19.
 1.57.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.57.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.57.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.63.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.65.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.65.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.67.2.2 05-Mar-2011  rmind sync with head
 1.67.2.1 30-May-2010  rmind sync with head
 1.77.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.77.8.2 30-Oct-2012  yamt sync with head
 1.77.8.1 17-Apr-2012  yamt sync with head
 1.78.2.2 11-Mar-2012  mrg sync to latest -current
 1.78.2.1 18-Feb-2012  mrg merge to -current.
 1.81.2.4 03-Dec-2017  jdolecek update from HEAD
 1.81.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.81.2.2 23-Jun-2013  tls resync from head
 1.81.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.83.4.1 28-Aug-2013  rmind sync with head
 1.84.4.1 10-Aug-2014  tls Rebase.
 1.85.2.1 14-Dec-2014  martin Regen for #321
 1.88.4.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.88.2.1 05-Feb-2017  skrll Sync with HEAD
 1.91.8.1 13-Mar-2018  martin Regen for ticket #624
 1.94.2.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.95.2.1 10-Jun-2019  christos Sync with HEAD
 1.97.2.2 11-Sep-2022  martin regen (ticket #1521)
 1.97.2.1 11-Sep-2022  martin regen (ticket #1519)
 1.98.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.30 15-Aug-2022  tsutsui Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.
 1.29 04-May-2019  tsutsui branches: 1.29.2;
Add pms(4), wsmouse(4), and wsmux(4) for Milan.
 1.28 20-Jan-2018  tsutsui branches: 1.28.4;
Restore piixide(4) for Milan and disable other pciide devices.

piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.
 1.27 05-Jul-2014  tsutsui branches: 1.27.20;
Enable options WSDISPLAY_COMPAT_USL in template, not in generated files.
 1.26 05-Jun-2012  abs branches: 1.26.2; 1.26.12;
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.25 10-Apr-2010  tsutsui branches: 1.25.8; 1.25.14;
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.24 01-Apr-2010  tsutsui Add support for the EtherNEC.

The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.

See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
 1.23 23-Dec-2009  mbalmer Fix typo in comments, no code change.
 1.22 24-Jan-2009  abs - Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.21 03-Sep-2006  bjh21 branches: 1.21.60; 1.21.68; 1.21.70;
Nothing in the kernel now tests __HAVE_NWSCONS, so stop defining it everywhere.
 1.20 19-Apr-2006  drochner adjust comments for the new location of wskbdmap_mfii.c,
addresses PR kern/33290 by henry nelson
 1.19 11-Dec-2005  christos branches: 1.19.4; 1.19.6; 1.19.8; 1.19.10; 1.19.12;
merge ktrace-lwp.
 1.18 31-May-2005  tron branches: 1.18.2;
Remove attachment for the piixide(4) driver from all non-x86 kernel
configurations because Intel IDE disk controllers only exist as part
of Intel chipsets for x86 systems.
 1.17 24-Nov-2004  bouyer branches: 1.17.10;
pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx) serie of
controllers. Tested with a PDC20375 (2 SATA, one PATA) controller on sparc64.
Added to all kernel config file which had pdcide(4).
 1.16 14-Dec-2003  thorpej branches: 1.16.4;
Split the Intel i31244 SATA controller ("Artisea") driver out of piixide
into its own driver (artsata).
 1.15 13-Dec-2003  thorpej Collapse the atabus declaration into "atabus* at ata? channel ?".
 1.14 13-Dec-2003  thorpej Split out the Silicon Image SATALink support into its own driver,
"satalink".
 1.13 08-Oct-2003  bouyer Add new per-chip pciide drivers.
 1.12 08-Oct-2003  bouyer Add atabus.
 1.11 08-Dec-2002  leo branches: 1.11.6;
Make things work with the new autoconf stuff:
- The pcibus is now called 'pcib' and the isabus 'isab'. Their attributes are
'pcibus' and 'isabus' respectively. This makes the underlying busses
attach again.
- Initialize the parent structure in the config_console() function.
Otherwise we end up without a console.
 1.10 15-Jun-2002  leo Avoid using variable names in the comments. They turn into useless '1' values
if defined.
 1.9 15-Jun-2002  leo Add the nvram device. It really is the same as on the other machines and
installboot(1M) needs it.
 1.8 20-Nov-2001  lukem branches: 1.8.8; 1.8.10;
cleanup whitespace
 1.7 26-Jul-2001  wiz branches: 1.7.6;
Various typos in comments (neccessary, sceme, choise, ...).
 1.6 07-Jun-2001  leo branches: 1.6.2; 1.6.4;
Everything you always wanted to know about Atari,Milan,IDE and byteswaps...
The Milan configuration is split up in 2 parts:
- MILAN_ISAIDE
Supports the traditionally formatted IDE disks on the Milan
- MILAN_PCIIDE
Supports the byte swapped formatted IDE disks on the Milan

If you want to read more, checkout the comment in MILAN.in...
 1.5 29-May-2001  leo Move over to pciide. My CDROM drive wouldn't work with the wdcisa attachment,
but it does work with the pciide attachment.
 1.4 21-May-2001  leo Without __HAVE_NWSCONS, the keyboard won't attach...
 1.3 16-May-2001  leo Fix errors in previous commit:
- forgot PCI bus
- forgot pckbd config
 1.2 14-May-2001  leo Add (ws)console stuff.
 1.1 10-Apr-2001  leo branches: 1.1.2;
Add a config file for the Milan. Note that you cannot build a working Milan
kernel yet. There are still quite some bits missing in the repository.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 10-Apr-2001  bouyer file MILAN.in was added on branch thorpej_scsipi on 2001-04-21 17:53:23 +0000
 1.6.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.4.1 03-Aug-2001  lukem update to -current
 1.6.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.7.6.4 11-Dec-2002  thorpej Sync with HEAD.
 1.7.6.3 20-Jun-2002  nathanw Catch up to -current.
 1.7.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.7.6.1 26-Jul-2001  nathanw file MILAN.in was added on branch nathanw_sa on 2002-01-08 00:23:35 +0000
 1.8.10.1 18-Jun-2002  lukem Pull up revisions 1.9-1.10 (requested by leo in ticket #309):
* revision 1.10
Avoid using variable names in the comments. They turn into useless '1'
values if defined.
* revision 1.9
Add the nvram device. It really is the same as on the other machines and
installboot(1M) needs it.
 1.8.8.1 14-Jul-2002  gehenna catch up with -current.
 1.11.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.6.4 29-Nov-2004  skrll Sync with HEAD.
 1.11.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.6.1 03-Aug-2004  skrll Sync with HEAD
 1.16.4.1 02-Apr-2005  he Pull up revision 1.17 (requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx) series of
controllers.
 1.17.10.1 01-Jun-2005  riz Pull up revision 1.18 (requested by tron in ticket #362):
Remove attachment for the piixide(4) driver from all non-x86 kernel
configurations because Intel IDE disk controllers only exist as part
of Intel chipsets for x86 systems.
 1.18.2.2 30-Dec-2006  yamt sync with head.
 1.18.2.1 21-Jun-2006  yamt sync with head.
 1.19.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.19.10.1 11-May-2006  elad sync with head
 1.19.8.2 14-Sep-2006  yamt sync with head.
 1.19.8.1 24-May-2006  yamt sync with head.
 1.19.6.1 22-Apr-2006  simonb Sync with head.
 1.19.4.1 09-Sep-2006  rpaulo sync with head
 1.21.70.1 26-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #320):
sys/arch/atari/conf/ATARITT.in: file removal
sys/arch/atari/conf/FALCON.in: file removal
sys/arch/atari/conf/GENERIC.in: revision 1.78 via patch
sys/arch/atari/conf/HADES.in: revision 1.9
sys/arch/atari/conf/makeconf: revision 1.7
sys/arch/atari/conf/MILAN.in: revision 1.22
- Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.21.68.1 03-Mar-2009  skrll Sync with HEAD.
 1.21.60.2 11-Mar-2010  yamt sync with head
 1.21.60.1 04-May-2009  yamt sync with head.
 1.25.14.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.25.8.1 30-Oct-2012  yamt sync with head
 1.26.12.1 10-Aug-2014  tls Rebase.
 1.26.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.27.20.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.28.4.1 10-Jun-2019  christos Sync with HEAD
 1.29.2.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1521):

sys/arch/atari/pci/pci_vga.c: revision 1.19
sys/arch/atari/conf/MILAN.in: revision 1.30

Improve VGA console settings for Milan, especially for sysinst.
- use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
(so that box drawing characters are rendered properly)
- set ATC and DAC palette settings for proper colors
(copied from MI vga_subr.c for now because HADES doesn't use mi vga(4))

Tested on Milan with S3 Trio64. (XXX: needs working HADES with ET4000)

Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.
 1.78 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.77 25-Feb-2018  mrg branches: 1.77.2; 1.77.4;
add a special rule to build m68k/fpu.c to avoid passing -msoft-float.
fixes GCC 6 kernel builds that use this file.
 1.76 06-Sep-2015  uebayasi Declare dependency on fpsp.o via newly introduced ${MD_LIBS} instead of
${MD_OBJS}.

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

${MD_LIBS} defines libraries that are built by separate makefiles, under
separate directories. `Makefile.kern.inc' doesn't know intermediate library
objects.
 1.75 21-Jan-2011  joerg branches: 1.75.14; 1.75.32;
Switch remaining platforms to modern CPP for assembler.
 1.74 19-Oct-2009  tsutsui branches: 1.74.4; 1.74.6; 1.74.8;
Switch the atari port to the common m68k/m68k/pmap_motorola.c, at last.
 1.73 25-Jan-2009  abs Abstract out setting of '-m680X0' based on -DM68020, -DM68030,
-DM68040, and -DM68060 into sys/arch/m68k/Makefile.cmachflags and
include from both atari and amiga. Other m68k ports which build
kernels that support multiple CPU types can also switch across to
this.
 1.72 25-Jan-2008  joerg branches: 1.72.10; 1.72.18;
Add some assym.h dependencies.
 1.71 11-Dec-2005  christos branches: 1.71.50; 1.71.56;
merge ktrace-lwp.
 1.70 31-May-2005  christos branches: 1.70.2;
s/GENASSYM/GENASSYM_CONF/ so we can use "GENASSYM" as the program name.
 1.69 04-Jun-2004  thorpej Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
 1.68 26-Nov-2002  thorpej branches: 1.68.6; 1.68.10;
The traditional C preprocessor is fixed in GCC 3.3 now, so no need
to skip -traditional-cpp for HAVE_GCC3.
 1.67 04-Jun-2002  thorpej Don't use -traditional-cpp if HAVE_GCC3.
 1.66 09-Dec-2001  atatat branches: 1.66.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.65 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.64 26-Oct-2001  jmc branches: 1.64.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.63 23-Oct-2001  thorpej branches: 1.63.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.62 29-May-2001  mrg branches: 1.62.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.61 17-Dec-2000  jdolecek branches: 1.61.2;
delete obsolete comment
 1.60 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.59 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.58 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.57 24-Jan-2000  tron Add "dependall" target for comfort.
 1.56 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.55 19-Jan-2000  tsutsui Change STRIPFLAGS=-g for cross-toolchains.
 1.54 26-Jul-1999  cgd branches: 1.54.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.53 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.52 06-May-1999  leo Remove dependency of vfs_conf.o, this file is no more. From Jonathan Stone.
 1.51 15-Jan-1999  thorpej branches: 1.51.4;
Some minor, mostly costmetic, changes to CPPFLAGS/CFLAGS.
 1.50 15-Jan-1999  thorpej Don't define "mc68020". Nothing uses it.
 1.49 08-Jan-1999  augustss Add -Wpointer-arith warning since `void *' arithmetic is not ANSI C.
 1.48 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.47 05-Sep-1998  lukem distclean is a synonym for cleandir
 1.46 31-May-1998  thorpej Specify a non-profiling C rule.
 1.45 24-May-1998  is Back out the defopt for M680?0. As pointed out to me, this breaks ports which
dont use the M680?0 the way Amiga, Atari, Mac68k, and X68k do. I must have
missed this in the past discussion about this project.
 1.44 23-May-1998  is Move M680[2346]0 to opt_m68kcpu.h.
XXX Some explicit dependencies could be removed now from the individual
arch/$ARCH/conf/Makefile.$ARCH files, but this is still to be done.
 1.43 12-Apr-1998  tv Add -Wno-main conditional on compiler being gcc 2.8 or egcs. (This adds
a HAVE_GCC28 check-variable that can now be used to add other gcc-2.8
flags in cases where they may be useful, or to remove gcc 2.7.2 "bug
workaround" flags.)
 1.42 01-Jan-1998  mikel use ${SIZE} instead of "size" (somehow this one got missed)
 1.41 12-Nov-1997  thorpej Make sure CPP, AR, AS, and RANLIB are defined.
 1.40 12-Nov-1997  thorpej Define LORDER, NM, and TSORT here, like we do the rest of the tools.
 1.39 09-Oct-1997  is branches: 1.39.2;
Help crosscompiling, by as -> $(AS). Define AS?= as in the calling
Makefile.$(ARCH)es. Will hopefully fix the (remaining) part or pr4010.
 1.38 07-Oct-1997  is Oops, forgot to commit this when doing the recent 060SP Makefile change.
 1.37 03-Oct-1997  lukem define SIZE?=size, and use ${SIZE} instead of size. makes cross
compilation easier
 1.36 30-Sep-1997  christos PR/4162: Chris Jones: make cleandir does not work properly; it does not
remove the object files and the .depend file in the kernel build directory.
 1.35 12-Sep-1997  mycroft Nuke Locore.c. It's way too out of date to be useful at this point.
 1.34 12-Jul-1997  leo branches: 1.34.2;
Generate assym.h dependencies when making 'depend'.
 1.33 04-Jun-1997  leo Add the 68060 Software Support Package.
 1.32 02-Jun-1997  leo Be a bit more robust when dealing with genassym failures (From mycroft).
 1.31 17-Mar-1997  leo Revert to new method of generating assym.h.
 1.30 14-Mar-1997  mycroft Define the `cleankernel' target consistently with other ports.
 1.29 16-Feb-1997  leo :: -> :
 1.28 04-Feb-1997  perry branches: 1.28.4;
Nuke some options GENERIC residue.
 1.27 04-Feb-1997  perry Nuke some GENERIC residue.
 1.26 14-Dec-1996  leo Fix type (COPT -> COPTS).
 1.25 01-Dec-1996  jonathan * Replace explicit -O2 in CFLAGS with COPTS macro. Default COPTS?= -O2.
Lets users over-ride with makeoptions COPTS="..." in kernel config files.

Leave `mandatory' flags (like -msoft-float which on m68k enforces no
FP in kernel) in CFLAGS.
 1.24 16-Oct-1996  leo Add '-Wall -Wstrict-prototypes -Wmissing-prototypes' to CFLAGS.
 1.23 09-Sep-1996  mycroft Move strip(1) flags into a separate variable, so that $STRIP can
be passed to subordinate make(1)s. Remove $TOUCH. Add HOSTED_CC,
HOSTED_CPPFLAGS, and HOSTED_CFLAGS, and use them when depending genassym.
 1.22 31-Aug-1996  mycroft Wrap the default definition of `S' in `.ifndef'.
 1.21 12-Aug-1996  mycroft Put into . Remove hooks for `config-dependent' and
`device-driver' flags.
 1.20 10-Aug-1996  mycroft * Add a HOSTED_C_C variable, which strips `-p', `-pg', and
`-nostdinc', and use it when building genassym.
* Use `-nostdinc' just to be sure we're self-contained.
 1.19 10-Aug-1996  mycroft * Define CWARNFLAGS and MKDEP in some moderately consistent fashion.
* Make S expand to an absolute path at compile time.
* Use `-S' rather than `-x' to remove debugging symbols.
* Garbage collect unused variables.
* Reverse a handful of port-specific changes that do not correspond to
the common build model and are not needed.
 1.18 18-Jun-1996  leo Use -S rather than -x for "normal" link flags.
 1.17 11-May-1996  mycroft branches: 1.17.4;
Make `make depend' work for libraries.
 1.16 29-Feb-1996  cgd Do not build vnode_if.[ch] for each kernel. Build them once, like the
various syscall sources/headers, and just compile them. From PR 2142, OK'd
by mycroft.
 1.15 26-Feb-1996  mycroft Define build programs with `?=', so they can be overridden with `makeoptions'.
 1.14 09-Feb-1996  mycroft Fix mkdep problems due to missing flags.
 1.13 03-Feb-1996  mycroft Use `-traditional-cpp' when building .s and .S files.
 1.12 02-Feb-1996  mycroft Clone these, and fix many bugs.
 1.11 02-Feb-1996  mycroft assym.s -> assym.h
(Some ports did this already.)
 1.10 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.9 14-Jan-1996  thorpej Remove vnode_if.[ch] during a "make clean", per PR#536 from
Dan Carosone <danielce@ee.mu.oz.au>.
 1.8 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.7 23-Sep-1995  leo branches: 1.7.2;
Use -msoft-float as suggested by Gordon Ross.
 1.6 19-Sep-1995  thorpej Compile the kernel with -Werror and -fno-builtin.
 1.5 11-Jul-1995  leo Use -O2
 1.4 24-Jun-1995  christos Makefile.`arch`: - Add -lcompat
- Change clean: target to be a double dep one,
so libraries can use the clean target too
- Add genassym to the clean targets
 1.3 16-May-1995  jtc Removing -DKERNEL, transition to _KERNEL has been completed
 1.2 28-Mar-1995  leo Add -D_KERNEL to preprocessor flags
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.7.2.1 22-Oct-1995  leo Remove -fno-builtin
 1.17.4.1 18-Jun-1996  leo Pull up from trunk.
 1.28.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.34.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.34.2.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.39.2.1 12-Nov-1997  thorpej Pull up "make sure tools are defined" changes from trunk.
 1.51.4.2 02-Aug-1999  thorpej Update from trunk.
 1.51.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.54.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.54.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.61.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.62.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.62.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.63.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.64.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.64.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.64.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.64.2.1 26-Oct-2001  nathanw file Makefile.atari was added on branch nathanw_sa on 2002-01-08 00:23:35 +0000
 1.66.8.1 14-Jul-2002  gehenna catch up with -current.
 1.68.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.68.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.68.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.68.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.68.6.1 03-Aug-2004  skrll Sync with HEAD
 1.70.2.1 04-Feb-2008  yamt sync with head.
 1.71.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.71.50.1 23-Mar-2008  matt sync with HEAD
 1.72.18.1 03-Mar-2009  skrll Sync with HEAD.
 1.72.10.2 11-Mar-2010  yamt sync with head
 1.72.10.1 04-May-2009  yamt sync with head.
 1.74.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.74.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.74.4.1 05-Mar-2011  rmind sync with head
 1.75.32.1 22-Sep-2015  skrll Sync with HEAD
 1.75.14.1 03-Dec-2017  jdolecek update from HEAD
 1.77.4.1 10-Jun-2019  christos Sync with HEAD
 1.77.2.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.3 06-Nov-2008  abs Add the following note to README:

Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.

Then follow it. Noted by tsutsui@
 1.2 10-Apr-2001  leo branches: 1.2.2; 1.2.10; 1.2.78; 1.2.128; 1.2.132; 1.2.138; 1.2.140; 1.2.142;
Move GENERIC to GENERIC.in . This avoids confusion since GENERIC is not a
standalone config file anymore.
 1.1 05-Apr-2001  leo branches: 1.1.2;
Major overhaul in the config files. The idea is to have the major part of
the generic options in GENERIC instead of duplicated all over the place.
To generate a config file, run 'makeconf'. This script uses cpp to combine
a '.in' file and GENERIC to a real config file.
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.2.142.1 06-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #19):
sys/arch/atari/conf/README: revision 1.3
Add the following note to README:
Please commit changes to 'GENERIC.in' and other source files *first*, then
run 'makeconf' and commit the generated files to ensure the 'Created from:'
tags are correct.
Noted by tsutsui@
 1.2.140.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.138.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.2.132.1 04-May-2009  yamt sync with head.
 1.2.128.1 17-Jan-2009  mjf Sync with HEAD.
 1.2.78.1 18-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1227):
sys/arch/atari/conf/README: revision 1.3
Add the following note to README:
Please commit changes to 'GENERIC.in' and other source files *first*,
then run 'makeconf' and commit the generated files to ensure the 'Created
from:' tags are correct.
Then follow it. Noted by tsutsui@
 1.2.10.2 10-Apr-2001  leo Move GENERIC to GENERIC.in . This avoids confusion since GENERIC is not a
standalone config file anymore.
 1.2.10.1 10-Apr-2001  leo file README was added on branch nathanw_sa on 2001-04-10 05:52:16 +0000
 1.2.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.2.2.1 10-Apr-2001  bouyer file README was added on branch thorpej_scsipi on 2001-04-21 17:53:23 +0000
 1.28 07-Aug-2022  simonb Regen.
 1.27 25-Jun-2022  tsutsui Regen from GENERIC.in rev 1.123.

> Allocalte enough reserved ST-RAM to make the old Xserver work by default.
 1.26 12-Jun-2022  tsutsui Regen from GENERIC.in rev 1.122.

> Specify -fno-unwind-tables to shrink binaries.
 1.25 26-Jan-2021  rin Regen for previous commit to GENERIC.in.
 1.24 10-Aug-2020  rin branches: 1.24.2;
regen
 1.23 31-Mar-2018  tsutsui branches: 1.23.6;
Regen to denote GENERIC.in rev 1.115 in "Created from:" lines.
 1.22 20-Jan-2018  tsutsui branches: 1.22.2;
Regenerate config files to update RCSIds in "Created from:" lines.
 1.21 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.20 24-Nov-2014  tsutsui Regen config files from GENERIC.in rev 1.109 by makeconf:

> Shrink GENERIC and enable options MODULAR instead, as other poor m68k ports.
>
> This allows all (at least ATARITT and FALCON, which have certain users)
> gzipped kernel binaries put into 1440KB 2HD floppy so that users can
> load these kernels on the native TOS using LOADBSD.TTP utility for
> installation. Note SMALL030 kernel doesn't include any Ethernet
> configuration and requires CD-ROM or other removable disks.
>
> Should be pulled up to netbsd-7.
 1.19 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.18 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.17 05-Jul-2014  tsutsui branches: 1.17.2;
Regen from GENERIC.in rev 1.106:

> Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.
>
> Also remove COPTS="-Os" from std.* files and specify it in
> GENERIC.in template for SMALL030_KERNEL.
 1.16 17-Oct-2012  apb branches: 1.16.10;
Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.15 18-Dec-2011  dholland branches: 1.15.6;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.14 17-Dec-2011  he Commit regenerated configuration file after COPTS=-Os shuffle.
 1.13 12-Dec-2010  tsutsui branches: 1.13.8; 1.13.12;
Regen from GENERIC.in rev 1.92:
> Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
 1.12 23-Nov-2010  hannken Regen.
 1.11 08-May-2010  mrg regenerate these configurations from GENERIC.in.
 1.10 08-May-2010  tsutsui Regen from GENERIC.in rev 1.89:
> - don't enable TMPFS for SMALL030
> - remove dup PTYFS
 1.9 29-Apr-2010  chs regen
 1.8 16-Apr-2010  pooka regen
 1.7 10-Apr-2010  tsutsui Regen from GENERIC.in rev 1.86:
> Disable options SERCONSOLE (force serial console if DCD is detected)
> because now it's patchable by binpatch(8).
 1.6 01-Apr-2010  tsutsui Regen from GENERIC.in rev 1.85, HADES.in rev 1.10, and MILAN.in rev 1.24:
> Add support for the EtherNEC.
 1.5 13-Mar-2010  tsutsui branches: 1.5.2;
Regen from GENERIC.in rev 1.84:
> Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
 1.4 21-Feb-2010  tsutsui Regen from GENERIC.in rev 1.83:
> Add pseudo-device ksyms. Noticed by David Ross on port-atari.
 1.3 05-Dec-2009  pooka branches: 1.3.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.2 06-Mar-2009  abs branches: 1.2.2;
Regenerate after shrinking kernels to fit on floppies
 1.1 24-Jan-2009  abs branches: 1.1.2; 1.1.4; 1.1.6;
- Rename BOOT to SMALL030 and trim some more fat
- Drop BOOTX
- Regenerate everything else - only changes in comments
 1.1.6.3 28-Apr-2009  skrll Sync with HEAD.
 1.1.6.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.6.1 24-Jan-2009  skrll file SMALL030 was added on branch nick-hppapmap on 2009-03-03 18:28:52 +0000
 1.1.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.2.6 20-Nov-2010  riz Regen for ticket 1368.
 1.1.2.5 20-Nov-2010  riz Regen for ticket 1367.
 1.1.2.4 20-Nov-2010  riz Regen for ticket 1366.
 1.1.2.3 12-Mar-2009  snj Regen for ticket 553.
 1.1.2.2 26-Jan-2009  snj Regen for ticket 320.
 1.1.2.1 24-Jan-2009  snj file SMALL030 was added on branch netbsd-5 on 2009-01-26 03:15:29 +0000
 1.2.2.4 11-Aug-2010  yamt sync with head.
 1.2.2.3 11-Mar-2010  yamt sync with head
 1.2.2.2 04-May-2009  yamt sync with head.
 1.2.2.1 06-Mar-2009  yamt file SMALL030 was added on branch yamt-nfs-mp on 2009-05-04 08:10:46 +0000
 1.3.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.3.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.5.2.2 05-Mar-2011  rmind sync with head
 1.5.2.1 30-May-2010  rmind sync with head
 1.13.12.1 18-Feb-2012  mrg merge to -current.
 1.13.8.2 30-Oct-2012  yamt sync with head
 1.13.8.1 17-Apr-2012  yamt sync with head
 1.15.6.3 03-Dec-2017  jdolecek update from HEAD
 1.15.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.16.10.1 10-Aug-2014  tls Rebase.
 1.17.2.1 14-Dec-2014  martin Regen for #321
 1.22.2.1 07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.23.6.2 11-Sep-2022  martin regen (ticket #1521)
 1.23.6.1 11-Sep-2022  martin regen (ticket #1519)
 1.24.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.125 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.124 25-Jun-2022  tsutsui Allocalte enough reserved ST-RAM to make the old Xserver work by default.

Instead, check ST-RAM size and TT-RAM size on startup and restrict
size of reserved ST memory on lower RAM machines.
Closes PR port-atari/41002 from David Ross.

While here, make options ST_POOL_SIZE defparam'ed to make sure to
reflect config(5) changes on each build.
 1.123 18-Feb-2019  thorpej branches: 1.123.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.122 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.121 25-Feb-2018  mrg branches: 1.121.2; 1.121.4;
add a special rule to build m68k/fpu.c to avoid passing -msoft-float.
fixes GCC 6 kernel builds that use this file.
 1.120 15-Nov-2011  tsutsui Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
 1.119 12-Jun-2011  rmind branches: 1.119.2;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

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

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

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

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

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

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.118 12-Dec-2010  tsutsui branches: 1.118.6;
Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
to deliver the name to recently committed newer and more common MI device,
et(4) at PCIe (Agere ET1310/ET1301 network driver) in PR kern/39094.
http://mail-index.NetBSD.org/source-changes/2010/11/13/msg014416.html

No particular reaction for a month on source-changes-d@,
no responsible person on atari port, and probably
no active user still using ET4000 on TT030 running NetBSD/atari.
 1.117 01-Apr-2010  tsutsui Add support for the EtherNEC.

The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.

See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
 1.116 13-Mar-2010  tsutsui branches: 1.116.2;
Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.

The SMC_TT is the user designed "handmade" VME-ISA bridge circuit
for 16 bit VME slot on TT030 and the SMC Elite Ultra ISA Ethernet card.
More information about SMC_TT can be found in the following archive:
ftp://ftp.funet.fi/pub/atari/net/smc_tt1.zip

Demonstrated on the NetBSD booth in Open Source Conference 2010 Kansai@Kobe.
 1.115 06-Dec-2009  tsutsui branches: 1.115.2;
Remove old MD pmap.c files for amiga and atari.
They no longer work due to reorganization of common pmap_motorola.c.
 1.114 19-Oct-2009  tsutsui Switch the atari port to the common m68k/m68k/pmap_motorola.c, at last.
 1.113 01-Jan-2009  tsutsui Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.112 20-Feb-2008  drochner branches: 1.112.6; 1.112.10; 1.112.18; 1.112.20;
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.111 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.110 10-Apr-2007  macallan branches: 1.110.12; 1.110.14; 1.110.20;
include files.wsfb
 1.109 21-Mar-2007  tsutsui Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.108 11-Dec-2005  christos branches: 1.108.24; 1.108.26; 1.108.30; 1.108.32; 1.108.34;
merge ktrace-lwp.
 1.107 07-Dec-2004  chs branches: 1.107.12;
use the m68k-common procfs_machdep.c on all m68k platforms.
 1.106 13-Mar-2004  bjh21 Abstract the interface between pckbc(4), and the pckbd(4) and pms(4)
drivers that attach to it. This allows for other host interface chips
that use the same keyboards and mice, such as the ones in the ARM
IOMD20, ARM7500, and SA-1111. The PC-compatible driver is still
called pckbc(4), and the new abstraction layer is "pckbport", so the
child devices have moved from sys/dev/pckbc to sys/dev/pckbport, which
also contains some code shared between all host controllers. To avoid
incompatibility, pckbdreg.h is still installed in
/usr/include/dev/pckbc.

In theory, this shouldn't cause any behavioural changes in the drivers
concerned. Thy just use rather more function pointers than before. Tested
on i386 and (with a new host driver) acorn32. Compiled on several other
affected architectures.
 1.105 08-Oct-2003  bouyer pciide_machdep.c depends on pciide_common, not pciide.
Pointed out and fix tested by Marc Recht.
 1.104 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.103 28-Jun-2003  he branches: 1.103.2;
Defflag M060SP and PANICBUTTON, since the corresponding include files are
now referenced from atari_init.c and machdep.c.
The PANICBUTTON implementation appears to be incomplete, compared to
the other ports which have this option implemented.
 1.102 02-Feb-2003  thomas Add support for wsdisplay and wskbd for HADES.
Add config option for et4000 with 2MB memory.
 1.101 08-Dec-2002  leo Make things work with the new autoconf stuff:
- The pcibus is now called 'pcib' and the isabus 'isab'. Their attributes are
'pcibus' and 'isabus' respectively. This makes the underlying busses
attach again.
- Initialize the parent structure in the config_console() function.
Otherwise we end up without a console.
 1.100 03-Nov-2002  chs use a merged sys_machdep.c for all the motorola-MMU m68k platforms.
 1.99 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.98 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.97 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.96 29-Aug-2002  leo defopt SERCONSOLE
 1.95 16-Apr-2002  thorpej branches: 1.95.2;
* Move the mii_bitbang attribute into dev/mii/files.mii
* Pull in dev/mii/files.mii from conf/files, rather than playing
the magic "files include order" dance in N machine-dependent
configuration definitions.
 1.94 07-Jan-2002  thorpej Pull in files.wfont.
 1.93 05-Dec-2001  atatat TRY_SCSI_LINKED_COMMANDS is a param, not a flag.
 1.92 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.91 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.90 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.89 08-Sep-2001  thomas branches: 1.89.4;
Now the default ecexutable is ELF.
Add COMPAT_AOUT_M68K to GENERIC options.
 1.88 09-Jul-2001  leo branches: 1.88.2; 1.88.4;
defopt atari scsi options.
 1.87 18-Jun-2001  christos Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.86 07-Jun-2001  leo Remove the atari specific incarnation of wdc_isa.c. We don't need it (in
fact it didn't work that well either), all could be done by simply adding the
NOSTREAM options to the flags of the generic ISA frontend.
There was probably to much byteswapping in my brain when I invented this.
 1.85 29-May-2001  leo We need the fonts for pci_vga too...
 1.84 29-May-2001  leo Move over to pciide. My CDROM drive wouldn't work with the wdcisa attachment,
but it does work with the pciide attachment.
 1.83 15-May-2001  leo Split pci_machdep into a generic/hades/milan part. There is much difference
in configspace and interrupt handling.
 1.82 14-May-2001  leo Add wscons related includes.
 1.81 24-Apr-2001  leo Both isa_hades.c and isa_milan.c are also dependent on 'isa' of course...
 1.80 24-Apr-2001  leo Split the ISA common attachment stuff and the interrupt handling.
There are too many differences between the Hades and Milan in this area.
 1.79 10-Apr-2001  leo fdisa needs-flag...
 1.78 10-Apr-2001  leo Move dma.c away from the mainbus floppy and make it a separate entity with
tag 'mbdma'.
 1.77 10-Apr-2001  leo files.atari:
Defopt motherboard type and make ym2149.c dependend on 'standard' atari
boards.
Configfiles:
Add pseudo device mouse. It got dropped in the moves by accident.
 1.76 31-Mar-2001  leo Wcd attacment code for the Milan. The Milan has the standard dual IDE port
hardware. A Milan specific attachment is needed to modify the iot so that
the streaming methods do a byteswap.
Configure like:
wdcisa0 at isa? port 0x1f0 irq 14
wdcisa1 at isa? port 0x170 irq 15
 1.75 31-Mar-2001  leo Add a tag to the fdcisa.c and isa/fd.c files. So they won't be used
unnecessary (and cause trouble).
 1.74 17-Mar-2001  leo Conditionalize inclusion of the interrupt handlers for 'kbd', 'zs' and
'ncrscsi' since they are not present on the Milan.
 1.73 16-Mar-2001  leo Atari specific stuff to implement the Milan floppy. The Milan uses standard
ISA floppy hardware. Configure as:
fdcisa0 at isa? port 0x3f0 irq 6 drq 2
 1.72 09-Mar-2001  leo Expand bus_dma implementation. It will now handle the bounce buffer
extensions needed to make the isa floppy driver on the Milan work.
 1.71 17-Jan-2001  fvdl branches: 1.71.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.70 21-Nov-2000  tsutsui Pull in dev/i2o/files.i2o, which is required by files.pci.
 1.69 09-May-2000  leo branches: 1.69.4;
The console stuff might also be needed by 'ser'. Also update the names of
the serial ports in the comments.
 1.68 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.67 11-Feb-2000  leo Oops! Both grfcc and grfet need the generic grfabs layer.
 1.66 27-Sep-1999  leo branches: 1.66.2;
Specify the major number of the md-device. Otherwise config(1) won't emit
a dev_name2blk enrty for the RAM-disk. This made the installation procedure
unusable.
 1.65 09-Jul-1999  thorpej Normalize include paths.
 1.64 07-Jul-1999  thorpej pseudo-device -> defpseudo, per grammar change in config(8).
 1.63 07-Jun-1999  thorpej Only declare block major numbers for devices which can be the root device.
 1.62 06-May-1999  leo Add .../dev/mii/files.mii. Needed for support of the 3C590.
 1.61 19-Apr-1999  kleink Add COMPAT_SVR4 for m68k.
 1.60 15-Mar-1999  leo branches: 1.60.4;
First step to a framework that can be used to initialize vga-cards on the
pci-bus. The code is called early in the bootphase and tries to initialize
a known type of card into a 'standard' text mode. Wscons should be able
to handle these cards afterwards.
 1.59 15-Dec-1998  itohy Added COMPAT_LINUX support.
 1.58 02-Sep-1998  leo mv vmebus -> avmebus to make room for MI vmebus implementation (per
reqest of Drochner).
 1.57 18-Aug-1998  leo Do not include files.isapnp, this file is now included from files.isa...
(Julian Coleman)
 1.56 18-Aug-1998  leo Circad Leonardo video driver by 'maximum entropy'.
 1.55 21-Jul-1998  drochner adapt to LANCE driver split
 1.54 23-Apr-1998  leo Crazy Dots driver by Julian Coleman.
 1.53 22-Apr-1998  leo Add the 'bus' code for a linear big endian bus (like VME).
 1.52 22-Apr-1998  leo Add isapnp stuff (Thomas Gerner)
 1.51 10-Apr-1998  leo Use MI wdc-driver.
 1.50 10-Apr-1998  leo le_bus.c is dependent on pci & isa.
 1.49 10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.48 13-Mar-1998  leo Move the bus_* functions from machdep.c to bus.c .
 1.47 16-Feb-1998  thorpej Remove "class" declarations, and add "devclass" declarations where
appropriate. Fix several inconsistencies between device class and
attributes. Mostly from Chris Demetriou.
 1.46 01-Feb-1998  is Amiga uses the common m68k/sig_machdep.c now. Also moved its definition from
the other 68k ports' files.${port} to arch/m68k/conf/files.m68k.
 1.45 12-Jan-1998  thorpej Update for changes to config.
 1.44 28-Sep-1997  is Build the 68060 support package in the kernel build dir.
XXX PCB_ONFAULT is still hardwired to 64 in netbsd060sp.S.
 1.43 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.42 27-Aug-1997  leo Add the isa-bus.
 1.41 30-Jul-1997  leo Rename lpt to lp on some places to avoid botches between files.isa and
files.atari.
 1.40 04-Jun-1997  leo branches: 1.40.2; 1.40.4;
Use m68k cacheops
 1.39 25-May-1997  leo Add serial driver for 68901 UART (modem1 port).
 1.38 09-Apr-1997  thorpej Remove redundant file directives.
 1.37 01-Apr-1997  leo Make it possible to remove the lpt device by making it 'needs-flag'.
Remove lpt-device from the BOOT kernel.
 1.36 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.35 26-Mar-1997  leo Use m68k/sig_machdep.c
 1.34 17-Mar-1997  gwr Separate bcopy and copypage stuff from copy.s
 1.33 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.32 10-Mar-1997  leo Add support for the Lance ethernet card on the VME-bus (Riebl/PAM)
 1.31 03-Mar-1997  leo Addition of VME bus code.
 1.30 26-Feb-1997  leo Use generic date conversion module.
 1.29 21-Jan-1997  thorpej branches: 1.29.4;
"md" is declared in sys/conf/files, now.
 1.28 28-Dec-1996  pk branches: 1.28.2;
rename: ramdisk => md
 1.27 26-Dec-1996  leo Add intr_establish/disestablish functions. Currently only the lpt-driver
is converted to use them...
 1.26 16-Dec-1996  leo The file hdfd_intr.s should only be included in conjunction with the
Hades floppy driver.
 1.25 09-Nov-1996  leo Add the Hades floppy driver.
 1.24 16-Oct-1996  leo Update pathnames of included files for new version of config.
 1.23 04-Oct-1996  leo Additions for the et4000 driver & pci-bus.
Note that there are still missing pieces so both et4000 & pci can not yet
be used.
 1.22 25-Sep-1996  leo More preps for et-driver.
 1.21 16-Sep-1996  leo - Add M68040 option where appropriate
- Reflect changes on the grf/ite/view system for et4000 console support
- Set timezone to 0
- Document FPSP option
 1.20 12-Apr-1996  leo misc.c ->stalloc.c
 1.19 27-Mar-1996  leo - Add printer device
- Add ym2149 files
- Make ramdisk a pseudo-device
 1.18 17-Mar-1996  cgd adjust to deal with expression support for optional file specs
 1.17 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.16 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.15 06-Mar-1996  leo Use files.scsi
 1.14 06-Jan-1996  leo Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.13 01-Dec-1995  leo Use files.fpe
 1.12 28-Aug-1995  leo Detect type and precence of an FPU in the kernel instead of relying on GEM.
 1.11 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.10 11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.9 25-Jun-1995  leo Mouse driver added.
 1.8 09-Jun-1995  leo Add our own db_memrw.c for ddb.
 1.7 28-May-1995  leo Add emulator.
 1.6 27-Apr-1995  christos Use new files.sunos
 1.5 22-Apr-1995  christos Move sunos_machdep.c to m68k
 1.4 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.3 16-Apr-1995  leo Added maxpartitions.
 1.2 11-Apr-1995  mellon Reference cninit.c as well as cons.c
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.28.2.1 30-Jan-1997  thorpej update from trunk
 1.29.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.40.4.3 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.40.4.2 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk (missed these the last time.)
 1.40.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.40.2.2 14-Aug-1997  bouyer Sync with trunk.
 1.40.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.60.4.2 02-Aug-1999  thorpej Update from trunk.
 1.60.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.66.2.6 21-Apr-2001  bouyer Sync with HEAD
 1.66.2.5 27-Mar-2001  bouyer Sync with HEAD.
 1.66.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.66.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.66.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.66.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.69.4.1 25-Oct-2001  he Pull up revision 1.70 (requested by ad):
Add Mylex DACC960, CAC-EISA, and I2O block/SCSI drivers.
 1.71.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.71.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.88.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.88.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.88.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.88.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.88.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.88.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.89.4.8 11-Dec-2002  thorpej Sync with HEAD.
 1.89.4.7 11-Nov-2002  nathanw Catch up to -current
 1.89.4.6 17-Sep-2002  nathanw Catch up to -current.
 1.89.4.5 20-Jun-2002  nathanw Catch up to -current.
 1.89.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.89.4.3 11-Jan-2002  nathanw More catchup.
 1.89.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.89.4.1 08-Sep-2001  nathanw file files.atari was added on branch nathanw_sa on 2002-01-08 00:23:35 +0000
 1.95.2.3 31-Aug-2002  gehenna catch up with -current.
 1.95.2.2 17-May-2002  gehenna Remove old block majors list.
 1.95.2.1 16-May-2002  gehenna Include the list of block/character major numbers.
 1.103.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.103.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.103.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.103.2.1 03-Aug-2004  skrll Sync with HEAD
 1.107.12.3 27-Feb-2008  yamt sync with head.
 1.107.12.2 07-Dec-2007  yamt sync with head
 1.107.12.1 03-Sep-2007  yamt sync with head.
 1.108.34.1 29-Mar-2007  reinoud Pullup to -current
 1.108.32.1 11-Jul-2007  mjf Sync with head.
 1.108.30.2 03-Dec-2007  ad Sync with HEAD.
 1.108.30.1 10-Apr-2007  ad Sync with head.
 1.108.26.2 15-Apr-2007  yamt sync with head.
 1.108.26.1 24-Mar-2007  yamt sync with head.
 1.108.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.110.20.1 08-Dec-2007  mjf Sync with HEAD.
 1.110.14.2 23-Mar-2008  matt sync with HEAD
 1.110.14.1 09-Jan-2008  matt sync with HEAD
 1.110.12.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.112.20.3 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1367):
sys/dev/ic/ne2000var.h: revision 1.25
sys/arch/atari/conf/MILAN.in: revision 1.24
sys/arch/atari/conf/MILAN.in: revision 1.25
sys/dev/ic/ne2000.c: revision 1.71
sys/dev/ic/ne2000.c: revision 1.72
sys/arch/atari/dev/if_ne_mb.c: revision 1.1
sys/arch/atari/dev/if_ne_mb.c: revision 1.2
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.69
sys/arch/atari/conf/HADES.in: revision 1.10
sys/arch/atari/conf/HADES.in: revision 1.11
sys/arch/x68k/dev/if_ne_neptune.c: revision 1.20
sys/dev/isa/if_ne_isa.c: revision 1.27
sys/arch/atari/atari/autoconf.c: revision 1.57
sys/dev/ic/ne2000.c: revision 1.62
sys/dev/isapnp/if_ne_isapnp.c: revision 1.27
sys/arch/atari/conf/files.atari: revision 1.117
sys/arch/atari/conf/HADES: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.85
sys/dev/ic/ne2000.c: revision 1.65
sys/dev/ic/ne2000.c: revision 1.66
sys/dev/ic/ne2000.c: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.65
distrib/notes/atari/hardware: revision 1.24
sys/conf/files: revision 1.980
sys/dev/ic/ne2000var.h: revision 1.21
sys/arch/x68k/dev/if_ne_intio.c: revision 1.16
sys/dev/ic/dp8390.c: revision 1.74
sys/dev/ic/dp8390.c: revision 1.75
Added NE2000 with 8bit bus width support.
reviewd by tsutsui@ at tech-kern ML.
Fix a wrong calculation bug around RX ring buffer memory address
slipped in about sixteen years ago. Fortunately, it had been working
for ages because some devices used address zero and other devices
ignored wrong higher bits.
Tested on we(4) (SMC Elite Ultra) and ne(4) (NE2000 compatible
named UL0001) on ISA.
Note FreeBSD also uses the same correct value in their ed(4) driver.
Now dp8390_config() calculates mem_ring correctly so
no longer need to override it in ne2000_attach().
Use roundup2() in <sys/param.h> rather than a conditional.
Also fix a wrong mem_ring calculation in dp8390_ipkdb_attach().
Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.
* move RTL8019 probe and attach code from each bus attachment
to MI ne2000_detect() and ne2000_attach()
* change a method for backend and attachment to specify 8 bit mode
to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
* handle more NE2000 8 bit mode specific settings, including
bus_space(9) access width and available size of buffer memory
* add a function to detect NE2000 8 bit mode
(disabled by default, but enalbed by options NE2000_DETECT_8BIT
to avoid possible regression on various ISA clones)
* fix ipkdb attachment accordingly (untested)
Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.
See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
No need to override mem_ring value in ne2000_ipkdb_attach()
since a wrong calculation in dp8390_ipkdb_attach() was fixed.
Don't warn about DMA timeout during probe.
Add support for the EtherNEC.
The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.
See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
Also note EtherNEC.
Use callout_schedule(9) rather than callout_reset(9) on polling
as callout(9) man says.
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.112.20.2 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1366):
sys/arch/atari/vme/if_we_vme.c: revision 1.1
sys/arch/atari/vme/if_we_vme.c: revision 1.2
sys/arch/atari/conf/files.atari: revision 1.116
sys/arch/atari/conf/GENERIC.in: revision 1.84
share/man/man4/we.4: revision 1.17
distrib/notes/atari/hardware: revision 1.23
Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
The SMC_TT is the user designed "handmade" VME-ISA bridge circuit
for 16 bit VME slot on TT030 and the SMC Elite Ultra ISA Ethernet card.
More information about SMC_TT can be found in the following archive:
ftp://ftp.funet.fi/pub/atari/net/smc_tt1.zip
Demonstrated on the NetBSD booth in Open Source Conference 2010 Kansai@Kobe.
Check if mapped bus_space regions are actually valid
before trying to access them.
Fixes trap panic when SMC_TT board is not installed. (oops)
Note atari SMC_TT in SYNOPSIS.
- note SMC_TT to supported VME-bus devices
- capitalize Ethernet
 1.112.20.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.69
sys/arch/atari/atari/pmap.c: revision 1.111 via patch
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.9
sys/arch/atari/include/pmap.h: revision 1.39 via patch
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and
pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.112.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.112.10.3 11-Aug-2010  yamt sync with head.
 1.112.10.2 11-Mar-2010  yamt sync with head
 1.112.10.1 04-May-2009  yamt sync with head.
 1.112.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.115.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.116.2.3 05-Mar-2011  rmind sync with head
 1.116.2.2 30-May-2010  rmind sync with head
 1.116.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.118.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.119.2.1 17-Apr-2012  yamt sync with head
 1.121.4.1 10-Jun-2019  christos Sync with HEAD
 1.121.2.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.123.4.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1519):

sys/arch/atari/conf/GENERIC.in: revision 1.123
sys/arch/atari/conf/files.atari: revision 1.124
sys/arch/atari/atari/atari_init.c: revision 1.105

Allocalte enough reserved ST-RAM to make the old Xserver work by default.

Instead, check ST-RAM size and TT-RAM size on startup and restrict
size of reserved ST memory on lower RAM machines.

Closes PR port-atari/41002 from David Ross.

While here, make options ST_POOL_SIZE defparam'ed to make sure to
reflect config(5) changes on each build.
 1.7 28-Apr-1995  cgd rename files files for new config/config.old naming
 1.6 27-Apr-1995  christos Use new files.sunos
 1.5 22-Apr-1995  christos Move sunos_machdep.c to m68k
 1.4 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.3 16-Apr-1995  leo Added maxpartitions.
 1.2 11-Apr-1995  mellon Reference cninit.c as well as cons.c
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.27 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.26 04-Apr-2020  jdolecek mark nsmb major obsolete
 1.25 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.24 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.23 23-Sep-2018  maxv Remove ISDN from the kernel. It has remained unmaintained for a long time,
is of poor quality, and is now an obstacle to MP-ification. It was removed
ten years ago from FreeBSD for the same reason.

This retires a big user of the mbuf API, and will ease maintenance of the
kernel.
 1.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 necessary majors for miscellaneous devices, such as missing
wscons/scsi/isdn 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 02-Feb-2003  thomas Define device for wskbd.
 1.3 04-Oct-2002  elric branches: 1.3.2;
assign majors for raw and cooked cgd's.
 1.2 06-Sep-2002  gehenna branches: 1.2.2;
Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.1 16-May-2002  gehenna branches: 1.1.2;
file majors.atari was initially added on branch gehenna-devsw.
 1.1.2.3 14-Jul-2002  gehenna catch up with -current.
 1.1.2.2 30-May-2002  gehenna Add $NetBSD$
 1.1.2.1 16-May-2002  gehenna Add the list of block/character majors.
 1.2.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.2.2.1 06-Sep-2002  nathanw file majors.atari was added on branch nathanw_sa on 2002-09-17 21:13:41 +0000
 1.3.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.2.1 04-Oct-2002  jdolecek file majors.atari was added on branch kqueue on 2002-10-10 18:32:00 +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.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.22.52.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.7 24-Jan-2009  abs - Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.6 20-Nov-2001  lukem branches: 1.6.122; 1.6.130; 1.6.132;
remove trailing whitespace (including in generated files)
 1.5 07-Jun-2001  leo branches: 1.5.2; 1.5.8;
Oops, we don't want 'MILAN' anymore....
 1.4 07-Jun-2001  leo Everything you always wanted to know about Atari,Milan,IDE and byteswaps...
The Milan configuration is split up in 2 parts:
- MILAN_ISAIDE
Supports the traditionally formatted IDE disks on the Milan
- MILAN_PCIIDE
Supports the byte swapped formatted IDE disks on the Milan

If you want to read more, checkout the comment in MILAN.in...
 1.3 10-Apr-2001  leo branches: 1.3.2;
Add a config file for the Milan. Note that you cannot build a working Milan
kernel yet. There are still quite some bits missing in the repository.
 1.2 10-Apr-2001  leo Move GENERIC to GENERIC.in . This avoids confusion since GENERIC is not a
standalone config file anymore.
 1.1 05-Apr-2001  leo branches: 1.1.2;
Forgot this in previous commit.
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.3.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.3.2.1 10-Apr-2001  bouyer file makeconf was added on branch thorpej_scsipi on 2001-04-21 17:53:23 +0000
 1.5.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.5.8.1 07-Jun-2001  nathanw file makeconf was added on branch nathanw_sa on 2002-01-08 00:23:36 +0000
 1.5.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.132.1 26-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #320):
sys/arch/atari/conf/ATARITT.in: file removal
sys/arch/atari/conf/FALCON.in: file removal
sys/arch/atari/conf/GENERIC.in: revision 1.78 via patch
sys/arch/atari/conf/HADES.in: revision 1.9
sys/arch/atari/conf/makeconf: revision 1.7
sys/arch/atari/conf/MILAN.in: revision 1.22
- Merge ATARITT.in and FALCON.in into GENERIC.in so we can generate
a sane kernel config which defines both of them
- Cleanup all the #if defined(FOO) entries to be consistent and have
a matching /* FOO */ on the #endif line
- No change to generated ATARITT/FALCON/HADES/MILAN-ISAIDE/MILAN-PCIIDE
- Rename BOOT to SMALL030 and trim a little more to save space.
- Drop BOOTX
 1.6.130.1 03-Mar-2009  skrll Sync with HEAD.
 1.6.122.1 04-May-2009  yamt sync with head.
 1.27 05-Jul-2014  tsutsui Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.

Also remove COPTS="-Os" from std.* files and specify it in
GENERIC.in template for SMALL030_KERNEL.
 1.26 15-Dec-2011  tsutsui branches: 1.26.6; 1.26.20;
Specify COPTS="-Os" for rich gcc 4.5 as bsd.sys.mk does for userland binaries
so that gzipped atari kernels still fit into floppies.
Noticed by David Ross.
 1.25 19-Sep-2010  tsutsui branches: 1.25.8; 1.25.12;
- 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.24 11-Dec-2005  christos branches: 1.24.78; 1.24.98; 1.24.100;
merge ktrace-lwp.
 1.23 17-Sep-2005  yamt include "conf/std".
 1.22 20-Nov-2001  lukem branches: 1.22.16; 1.22.32;
regenerate for whitespace cleanup
 1.21 08-Sep-2001  thomas branches: 1.21.4;
Now the default ecexutable is ELF.
Add COMPAT_AOUT_M68K to GENERIC options.
 1.20 05-Apr-2001  leo branches: 1.20.2; 1.20.4;
Major overhaul in the config files. The idea is to have the major part of
the generic options in GENERIC instead of duplicated all over the place.
To generate a config file, run 'makeconf'. This script uses cpp to combine
a '.in' file and GENERIC to a real config file.
 1.19 28-Sep-2000  leo branches: 1.19.2;
Move the grfbus out of std.atari. You don't want a grfbus defined on headless
and wscons setups.
 1.18 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.17 26-Jan-2000  leo branches: 1.17.4;
Restructure the ite/grf definitions:
- Make the ite<n> -> grfXX<n> relations explicit. This solves problems
with the newer autoconf code.
- Nuke the grfcc definition in std.atari. A Hades has not grfcc...
 1.16 15-Nov-1999  fvdl Add

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

to all std.* files, so that soft dependencies can be activated using
"options SOFTDEP".
 1.15 24-Mar-1999  mrg branches: 1.15.8; 1.15.14;
clean up kernel/config files files for machVM lossage.
 1.14 16-Jan-1999  chuck MNN no longer an option
 1.13 02-Sep-1998  mrg really turn UVM on on the atari...
 1.12 07-May-1998  leo Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.
 1.11 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.10 17-Nov-1996  leo Move SWAPPAGER, VNODEPAGER and DEVPAGER options to std.atari.
 1.9 08-Nov-1996  leo Move the definition for the floppy device from std.atari to the different
config files because the Hades needs another driver for it.
 1.8 06-Nov-1996  leo Add the external drive to the standard setup.
 1.7 16-Oct-1996  leo Add EXEC_SCRIPT and EXEC_AOUT options.
 1.6 16-Sep-1996  leo Sync with changes in the grf/ite/view system.
 1.5 27-Mar-1996  leo - Add printer device
- Add ym2149 files
- Make ramdisk a pseudo-device
 1.4 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.3 09-Jun-1995  leo Support & require MACHINE_NONCONTIG
 1.2 28-Apr-1995  leo CD-ROM drives added.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.15.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.8.2 21-Apr-2001  bouyer Sync with HEAD
 1.15.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.17.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.19.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.20.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.20.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.21.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.21.4.1 08-Sep-2001  nathanw file std.atari was added on branch nathanw_sa on 2002-01-08 00:23:36 +0000
 1.22.32.1 21-Jun-2006  yamt sync with head.
 1.22.16.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.100.1 05-Mar-2011  rmind sync with head
 1.24.98.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.24.78.1 09-Oct-2010  yamt sync with head
 1.25.12.1 18-Feb-2012  mrg merge to -current.
 1.25.8.1 17-Apr-2012  yamt sync with head
 1.26.20.1 10-Aug-2014  tls Rebase.
 1.26.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9 05-Jul-2014  tsutsui Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.

Also remove COPTS="-Os" from std.* files and specify it in
GENERIC.in template for SMALL030_KERNEL.
 1.8 15-Dec-2011  tsutsui branches: 1.8.6; 1.8.20;
Specify COPTS="-Os" for rich gcc 4.5 as bsd.sys.mk does for userland binaries
so that gzipped atari kernels still fit into floppies.
Noticed by David Ross.
 1.7 19-Sep-2010  tsutsui branches: 1.7.8; 1.7.12;
- 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.6 11-Dec-2005  christos branches: 1.6.78; 1.6.98; 1.6.100;
merge ktrace-lwp.
 1.5 17-Sep-2005  yamt include "conf/std".
 1.4 09-Apr-2002  leo branches: 1.4.10; 1.4.26;
Fix typo.
 1.3 20-Nov-2001  lukem regenerate for whitespace cleanup
 1.2 08-Sep-2001  thomas branches: 1.2.4;
Now the default ecexutable is ELF.
Add COMPAT_AOUT_M68K to GENERIC options.
 1.1 05-Apr-2001  leo branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Major overhaul in the config files. The idea is to have the major part of
the generic options in GENERIC instead of duplicated all over the place.
To generate a config file, run 'makeconf'. This script uses cpp to combine
a '.in' file and GENERIC to a real config file.
 1.1.8.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.4.1 05-Apr-2001  bouyer file std.hades was added on branch thorpej_scsipi on 2001-04-21 17:53:24 +0000
 1.1.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.2.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.2.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.1 08-Sep-2001  nathanw file std.hades was added on branch nathanw_sa on 2002-01-08 00:23:36 +0000
 1.4.26.1 21-Jun-2006  yamt sync with head.
 1.4.10.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.100.1 05-Mar-2011  rmind sync with head
 1.6.98.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.6.78.1 09-Oct-2010  yamt sync with head
 1.7.12.1 18-Feb-2012  mrg merge to -current.
 1.7.8.1 17-Apr-2012  yamt sync with head
 1.8.20.1 10-Aug-2014  tls Rebase.
 1.8.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8 05-Jul-2014  tsutsui Use COPTS="-O2 -fno-reorder-blocks" for kernels except SMALL030_KERNEL.

Also remove COPTS="-Os" from std.* files and specify it in
GENERIC.in template for SMALL030_KERNEL.
 1.7 15-Dec-2011  tsutsui branches: 1.7.6; 1.7.20;
Specify COPTS="-Os" for rich gcc 4.5 as bsd.sys.mk does for userland binaries
so that gzipped atari kernels still fit into floppies.
Noticed by David Ross.
 1.6 19-Sep-2010  tsutsui branches: 1.6.8; 1.6.12;
- 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.5 11-Dec-2005  christos branches: 1.5.78; 1.5.98; 1.5.100;
merge ktrace-lwp.
 1.4 17-Sep-2005  yamt include "conf/std".
 1.3 20-Nov-2001  lukem branches: 1.3.16; 1.3.32;
regenerate for whitespace cleanup
 1.2 08-Sep-2001  thomas branches: 1.2.4;
Now the default ecexutable is ELF.
Add COMPAT_AOUT_M68K to GENERIC options.
 1.1 05-Apr-2001  leo branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Major overhaul in the config files. The idea is to have the major part of
the generic options in GENERIC instead of duplicated all over the place.
To generate a config file, run 'makeconf'. This script uses cpp to combine
a '.in' file and GENERIC to a real config file.
 1.1.8.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.4.1 05-Apr-2001  bouyer file std.milan was added on branch thorpej_scsipi on 2001-04-21 17:53:24 +0000
 1.1.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.2.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.1 08-Sep-2001  nathanw file std.milan was added on branch nathanw_sa on 2002-01-08 00:23:36 +0000
 1.3.32.1 21-Jun-2006  yamt sync with head.
 1.3.16.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.100.1 05-Mar-2011  rmind sync with head
 1.5.98.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.5.78.1 09-Oct-2010  yamt sync with head
 1.6.12.1 18-Feb-2012  mrg merge to -current.
 1.6.8.1 17-Apr-2012  yamt sync with head
 1.7.20.1 10-Aug-2014  tls Rebase.
 1.7.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.2 20-Dec-1998  thomas branches: 1.2.26;
Install kbdreg.h. The Xserver needs it.
 1.1 02-Sep-1998  leo Reorganize installation if include files. Nuke some from atari/include as
they make no sense out of the kernel add some from atari/dev (ioctl's).
 1.2.26.1 11-Dec-2002  thorpej Sync with HEAD.
 1.66 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.65 04-Oct-2021  andvar follow fcambus steps by fixing typos for "unknown" in few more error messages.
 1.64 27-Dec-2019  msaitoh s/transfered/transferred/
 1.63 07-Oct-2017  jdolecek branches: 1.63.4;
Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.62 18-Oct-2014  snj branches: 1.62.8;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.61 05-Jul-2014  tsutsui Appease gcc48 -Wunused-but-set-variable warning.
 1.60 24-Mar-2014  christos branches: 1.60.2;
- remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.59 12-Feb-2012  matt branches: 1.59.6; 1.59.10;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.58 17-Jul-2011  joerg branches: 1.58.2; 1.58.6;
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.57 05-Jun-2011  tsutsui Split device_t/softc. No crash on TT030.
 1.56 17-Apr-2010  tsutsui branches: 1.56.2; 1.56.6;
extern inline -> static inline
 1.55 13-Apr-2010  tsutsui Misc KNF and cosmetics.
 1.54 10-Apr-2010  tsutsui Always schedule callback functions via add_sicallback(),
which calls softint_schedule(9).

We cannot use BASEPRI() to check recursive calls any longer
since softint(9) has been reorganized to use kernel thread.
 1.53 20-Oct-2009  snj branches: 1.53.2; 1.53.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.52 08-Jul-2009  tsutsui Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.51 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.50 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.49 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.48 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.47 24-Jan-2009  tsutsui branches: 1.47.2;
Replace multi-statement macro using GCC extension `({})' with
static inline functions to avoid possible side effects or confusion.

Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.
 1.46 29-Oct-2008  abs branches: 1.46.2;
Cleanup spelling and syntax in a comment
 1.45 20-Jul-2008  tsutsui branches: 1.45.2;
Specify volatile to some pointers to access DMA registers.
 1.44 20-Jul-2008  tsutsui No need to specify '&' to get array's address.
No binary changes.
 1.43 20-Jul-2008  tsutsui Fix pointer arithmetic botch in rev 1.37.
 1.42 04-Mar-2007  christos branches: 1.42.40; 1.42.44; 1.42.46; 1.42.48; 1.42.50;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.41 10-May-2006  skrll branches: 1.41.12; 1.41.14;
Fix a bunch of cast lvalues.
 1.40 24-Dec-2005  perry branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10; 1.40.12;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.39 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.38 11-Dec-2005  christos merge ktrace-lwp.
 1.37 04-Jun-2005  he branches: 1.37.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.36 15-Jul-2003  lukem __KERNEL_RCSID()
 1.35 03-May-2003  wiz branches: 1.35.2;
DMA, not dma nor Dma.
 1.34 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.33 16-Sep-2001  wiz branches: 1.33.4;
Spell 'occurred' with two 'r's.
 1.32 09-Jul-2001  leo branches: 1.32.2; 1.32.4;
defopt atari scsi options.
 1.31 29-Mar-2000  leo Nuke a bunch of cf_unit abuses.
 1.30 06-Aug-1999  leo branches: 1.30.2;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.29 06-Oct-1998  leo branches: 1.29.6;
Disable SCSI interrupts while polling for the transfer to finish. This
fixes spurious panics while booting my Hades. This bug could also occur
on a TT030.
 1.28 27-Aug-1997  bouyer branches: 1.28.4;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.27 27-Aug-1997  leo Don't enable the dma-interrupt while polling for dma to end. This sometimes
caused a system panic on the Hades while probing the SCSI devices.
 1.26 04-Jun-1997  leo branches: 1.26.2; 1.26.4;
Use m68k cacheops
 1.25 06-Apr-1997  leo Make Hades DMA transfers work in polling mode with all interrupts
disabled. This makes dumps to scsi work.
 1.24 30-Mar-1997  leo Remove a hardcoded interrupt handler. Now uses intr_establish() for the
SCSI-drq handler on the Hades.
 1.23 12-Jan-1997  leo Use the mask register to block the interrups, not the enable register. This
enables the interrupt to be shared (with IDE for example ;-) ).
 1.22 04-Jan-1997  leo Fix a rather nasty thinko that made the keyboard useless on the Falcon.
Thanks to Markus Kilbinger for finding it.
 1.21 17-Nov-1996  leo Make splbio really splbio. All holes now seem to be plugged. At least
on the Hades & TT030.
 1.20 13-Oct-1996  christos backout previous kprintf changes
 1.19 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.18 16-Sep-1996  leo Add support for Hades platform.
 1.17 16-Aug-1996  leo Revert to polled-DMA on Falcon.
 1.16 05-Jul-1996  leo During a rather lengthy debug session with Markus Kilbinger (Thanks again!),
we managed to kill the following SCSI-driver bugs for the Falcon:
- The Byte_Count_zero bit of the falcon DMA controller does not always
tell the truth! This caused the SCSI-driver to choke on devices that
disconnected in the middle of a DMA-transfer (mostly removables).
- Printing debug info about the 5380 on the Falcon is *only* permitted
when DMA is not active.
- Some functions forgot to remove possibly pending sofware interrupts
- Some debug options didn't allow debugging a single target while they
could easily be made to do so. This is fixed.
 1.15 18-Jun-1996  leo Pull down from release. Sorry, should have been the other way around....
 1.14 15-May-1996  leo branches: 1.14.4;
Prototype + -Wall fixes.
 1.13 26-Apr-1996  leo - Fixup the ipending function for the Falcon. This seemed to be the source
of a lot of instability problems on the Falcon. I also enabled DMA on
interrupt basis for the Falcon.
- Try to handle targets that request too much data more sanely.
- Some fixups for strict prototypes + -Wall

Thanks to Markus Kilbinger for providing the debugging support.
 1.12 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.11 12-Apr-1996  leo Prototyping.
 1.10 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9 08-Mar-1996  leo Just prototyping.
 1.8 22-Feb-1996  leo A bit of reshuffling. Also some stricter prototyping.
 1.7 14-Feb-1996  leo Oops, should have been updated in conjunction with ncr5380.c .
 1.6 02-Feb-1996  mycroft Fix #includes.
 1.5 14-Jan-1996  leo The changes frpm Paul Goyette with respect to the driver trace require
DBG_PID to be defined to an interger value....make it so.
 1.4 05-Oct-1995  leo Get in sync with the mac68k version to incorporate Allen Briggs' changes
- emit MSG_ABORT/MSG_REJECT at the right times:
- make MIN_PHYS machine dependent.
 1.3 16-Sep-1995  leo - Handle devices that do not support identify messages (Allen Briggs)
- Add pdma_ready() hook (Allen Briggs)
- Increase timeout to 1000 (Matthias Pfaller)
 1.2 19-Aug-1995  leo - Add 'restbyte' handling for TT.
- Don't _ever_ do DMA for less than 512 bytes on the Falcon
- Fix bug in autosense-handling. Now asks for the correct number of bytes.
Now it won't read ghost bytes on the tape anymore.
- Add missing braces as suggested by Matthias Pfaller
- Make it possible to debug requests on a specified number of targets
- Add debug option to show only transaction with error code != 0
 1.1 11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.14.4.4 06-Sep-1996  jtc Pulled up rev 1.17 by request from leo
 1.14.4.3 31-Jul-1996  jtc Pulled up from rev 1.16 by request from Leo Weppelman
 1.14.4.2 20-Jul-1996  jtc Pulled up from rev 1.15 by request from Leo Weppelman
 1.14.4.1 18-Jun-1996  leo Get rid of some spurious interrupts caused by pending software interrupts.
 1.26.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.26.2.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.28.4.1 30-Oct-1998  cgd pull up rev 1.29 from trunk (leo)
 1.29.6.1 16-Dec-1999  he Pull up revision 1.30 (requested by leo):
Change the way that bits are cleared in the InterruptPending
register of the 68901, avoiding a read-modify-write cycle.
Solves a "hanging keyboard" problem.
 1.30.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.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.32.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.33.4.2 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.33.4.1 16-Sep-2001  wiz file atari5380.c was added on branch nathanw_sa on 2001-09-16 16:34:29 +0000
 1.35.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.1 03-Aug-2004  skrll Sync with HEAD
 1.37.2.2 03-Sep-2007  yamt sync with head.
 1.37.2.1 21-Jun-2006  yamt sync with head.
 1.40.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.40.10.1 11-May-2006  elad sync with head
 1.40.8.1 24-May-2006  yamt sync with head.
 1.40.6.1 01-Jun-2006  kardel Sync with head.
 1.40.4.1 09-Sep-2006  rpaulo sync with head
 1.41.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.41.12.3 13-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1223):
sys/arch/atari/dev/atari5380.c: revision 1.45
Specify volatile to some pointers to access DMA registers.
 1.41.12.2 13-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1223):
sys/arch/atari/dev/atari5380.c: revision 1.44
No need to specify '&' to get array's address.
No binary changes.
 1.41.12.1 13-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1223):
sys/arch/atari/dev/atari5380.c: revision 1.43
Fix pointer arithmetic botch in rev 1.37.
 1.42.50.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.42.50.1 19-Oct-2008  haad Sync with HEAD.
 1.42.48.1 28-Jul-2008  simonb Sync with head.
 1.42.46.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.42.44.4 11-Aug-2010  yamt sync with head.
 1.42.44.3 11-Mar-2010  yamt sync with head
 1.42.44.2 18-Jul-2009  yamt sync with head.
 1.42.44.1 04-May-2009  yamt sync with head.
 1.42.40.2 17-Jan-2009  mjf Sync with HEAD.
 1.42.40.1 28-Sep-2008  mjf Sync with HEAD.
 1.45.2.3 28-Apr-2009  skrll Sync with HEAD.
 1.45.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.45.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.46.2.1 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1373):
sys/arch/atari/dev/dma.c: revision 1.25
sys/arch/atari/dev/atari5380.c: revision 1.54
Always schedule callback functions via add_sicallback(),
which calls softint_schedule(9).
We cannot use BASEPRI() to check recursive calls any longer
since softint(9) has been reorganized to use kernel thread.
 1.47.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.53.4.2 12-Jun-2011  rmind sync with head
 1.53.4.1 30-May-2010  rmind sync with head
 1.53.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.56.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.56.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.58.6.1 18-Feb-2012  mrg merge to -current.
 1.58.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.58.2.1 17-Apr-2012  yamt sync with head
 1.59.10.1 18-May-2014  rmind sync with head
 1.59.6.2 03-Dec-2017  jdolecek update from HEAD
 1.59.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.60.2.1 10-Aug-2014  tls Rebase.
 1.62.8.1 27-Sep-2017  jdolecek pass ata channel interlock to st_dmagrab() so that it can release
and reacquire it if it sleeps
 1.63.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.67 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.66 07-Sep-2025  thorpej Remove unnecessary NULL-initialization of TODR handle fields.
 1.65 07-Sep-2025  thorpej Initialize the TODR cookie. Not used now, but will be in the future.
 1.64 26-Jun-2022  tsutsui Use aprint_*(9) for device attach messages.
 1.63 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.62 03-Jul-2020  maxv hardclock_ticks -> getticks()
 1.61 29-May-2020  rin For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.60 29-Jun-2019  tsutsui Misc cosmetics and cleanup.
 1.59 25-Jul-2014  dholland branches: 1.59.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.58 26-Mar-2014  christos branches: 1.58.2;
kill sprintf
 1.57 24-Mar-2014  christos - remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.56 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.55 26-Jan-2013  apb branches: 1.55.2;
use sizeof(buffer) - 1, not sizeof(buffer - 1)
 1.54 30-Jun-2012  tsutsui branches: 1.54.2;
Fix buffer overrun (off by one). PR port-atari/42717
 1.53 05-Jun-2011  tsutsui branches: 1.53.2;
Split device_t/softc. No crash on TT030.
 1.52 08-Feb-2011  rmind branches: 1.52.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.51 13-Apr-2010  tsutsui branches: 1.51.2; 1.51.4;
Include "ioconf.h" to declare struct cfdriver foo_cd.
 1.50 23-Aug-2009  tsutsui branches: 1.50.2; 1.50.4;
Use proper pointer types and names rather than casts for readability.
 1.49 07-Jul-2009  tsutsui KNF, ANSIfy, etc.
 1.48 07-Jul-2009  tsutsui Explicitly initialize the MFP Timer-B for delay(9) from atari_hwinit()
rather than using if(!atari_realconfig) in clockmatch().
(I doubt the latter one has actually been called..)
 1.47 07-Jul-2009  tsutsui Add a workaround for annoying
"WARNING: negative runtime; monotonic clock has gone backwards"
message. Partially taken from hp300.
 1.46 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.45 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.44 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.43 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.42 04-Nov-2008  abs branches: 1.42.4;
Move tc_init(&clk_timecounter); to stop the "timecounter:" message
appearing in the middle of the clock0 attach message. Tested by
Tuomo Makinen
 1.41 11-Jun-2008  tsutsui branches: 1.41.2; 1.41.4; 1.41.6;
Use device_private() and device_lookup_privat() to get softc.
 1.40 08-Jan-2008  joerg branches: 1.40.6; 1.40.8; 1.40.10; 1.40.12; 1.40.14;
Convert Atari to generic TODR and timecounter.
 1.39 03-Jan-2008  joerg Simplify delay based on x86 version.
 1.38 04-Mar-2007  christos branches: 1.38.20; 1.38.26; 1.38.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 24-Dec-2005  perry branches: 1.37.24; 1.37.26; 1.37.34;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.36 11-Dec-2005  christos merge ktrace-lwp.
 1.35 04-Jun-2005  he branches: 1.35.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.34 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.33 15-Jul-2003  lukem __KERNEL_RCSID()
 1.32 17-Jan-2003  thorpej branches: 1.32.2;
Merge the nathanw_sa branch.
 1.31 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.30 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.29 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.28 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.27 26-Jul-2001  wiz branches: 1.27.2; 1.27.6; 1.27.14;
Various typos in comments (neccessary, sceme, choise, ...).
 1.26 18-Jun-2001  wiz branches: 1.26.2;
Symmetric has one s and two m's.
 1.25 24-Apr-2001  leo Add sanity checking on register B of the mc146818.
 1.24 29-Jan-2001  leo branches: 1.24.2;
Fix y2001 problem in the initial read of the RTC.
 1.23 07-Jun-2000  leo branches: 1.23.2;
Mark 'n' explicitely as output of the 'mulul' instruction.
 1.22 31-May-2000  leo Fix some bugs in clkread(). These bugs caused strange time leaps.
 1.21 06-Jan-2000  leo branches: 1.21.2;
Fix y2k buglet in /dev/rtc reported by Julian Coleman. Note that the input
and output format of /dev/rtc is now changed.
 1.20 06-Aug-1999  leo branches: 1.20.2;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.19 12-Jan-1998  thorpej branches: 1.19.8;
Update for changes to config.
 1.18 26-Feb-1997  leo Use generic date conversion module.
 1.17 20-Dec-1996  leo branches: 1.17.6;
Get rid of BROKEN_INDIRECT_CONFIG
 1.16 18-Dec-1996  leo Tweak the clockframe structure a bit so we are able to save a few cycles
at interrupt time. (From Gordon Ross).
 1.15 16-Dec-1996  leo Move up the initialisations for the delay routine in the initialisation
process. It's now also available to the different device probes.
 1.14 16-Dec-1996  leo Implement an rtc-device. Credits for the idea goes to Wolfgang Solfrank.
Because there is no way yet to tell init(1) to execute commands before
single user-mode is entered, the inittodr() function is still partly
functional. It retrieves the value of the RTC and sets the time as if
the RTC was running at UTC. The resettodr() function is a No-Op. The
RTC can only be changed by a write to /dev/rtc.
The TIMEZONE and DST options are no longer needed and removed from the
config files.
 1.13 13-Oct-1996  christos backout previous kprintf changes
 1.12 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.11 26-Apr-1996  leo Corrections for removed <sys/cpu.h> and some more prototypes.
 1.10 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.8 11-Feb-1996  leo Some extra range-tests on the RTC values.
 1.7 06-Jan-1996  leo Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.6 01-Dec-1995  leo Remove forgotten #endif
 1.5 30-Nov-1995  leo Add kernel option for separate {stat,prof}clock
 1.4 23-Sep-1995  leo PROF -> GPROF
 1.3 28-May-1995  leo Use <dev/ic/mc146818.h>. Change systemclock settings. Usable values for
HZ are now 48/64/96. This reduces the interrupt overhead, because we
don't need the extra division by 4 in the interrupt handler.
 1.2 05-May-1995  leo Shift system clocks from TT-mfp to ST-mfp and remove some dead-code.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.17.6.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.19.8.2 21-Jan-2000  he Pull up revision 1.21 (requested by leo):
Fix Y2K buglet in /dev/rtc. Note that the input and output format
of that device has now changed.
 1.19.8.1 16-Dec-1999  he Pull up revision 1.20 (requested by leo):
Change the way that bits are cleared in the InterruptPending
register of the 68901, avoiding a read-modify-write cycle.
Solves a "hanging keyboard" problem.
 1.20.2.2 11-Feb-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.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.23.2.1 26-Feb-2001  he Pull up revision 1.24 (requested by leo):
Fix y2k+1 problem.
 1.24.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.26.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.26.2.1 03-Aug-2001  lukem update to -current
 1.27.14.1 17-May-2002  gehenna Add device switch.
 1.27.6.7 11-Nov-2002  nathanw Catch up to -current
 1.27.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.27.6.5 17-Sep-2002  nathanw Catch up to -current.
 1.27.6.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.27.6.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.27.6.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.27.6.1 26-Jul-2001  scw file clock.c was added on branch nathanw_sa on 2001-11-17 23:18:08 +0000
 1.27.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.32.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.32.2.4 17-Jan-2005  skrll Adapt to branch.
 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.35.2.3 21-Jan-2008  yamt sync with head
 1.35.2.2 03-Sep-2007  yamt sync with head.
 1.35.2.1 21-Jun-2006  yamt sync with head.
 1.37.34.1 03-Jan-2009  jdc Pull up revisions:
1.39 sys/arch/atari/dev/clock.c
1.31 sys/arch/atari/include/param.h
(requested by tsutsui in ticket #1253).

Simplify delay based on x86 version.
 1.37.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.24.1 02-Jan-2009  jdc Pull up revisions:
1.39 sys/arch/atari/dev/clock.c
1.31 sys/arch/atari/include/param.h
(requested by tsutsui in ticket #1253).

Simplify delay based on x86 version.
 1.38.32.1 08-Jan-2008  bouyer Sync with HEAD
 1.38.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.38.20.2 23-Mar-2008  matt sync with HEAD
 1.38.20.1 09-Jan-2008  matt sync with HEAD
 1.40.14.1 18-Jun-2008  simonb Sync with head.
 1.40.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.40.10.4 11-Aug-2010  yamt sync with head.
 1.40.10.3 16-Sep-2009  yamt sync with head
 1.40.10.2 18-Jul-2009  yamt sync with head.
 1.40.10.1 04-May-2009  yamt sync with head.
 1.40.8.1 17-Jun-2008  yamt sync with head.
 1.40.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.40.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.41.6.2 04-Oct-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #1057):
sys/arch/atari/dev/clock.c: revision 1.47
Add a workaround for annoying
"WARNING: negative runtime; monotonic clock has gone backwards"
message. Partially taken from hp300.
 1.41.6.1 06-Nov-2008  snj branches: 1.41.6.1.4;
Pull up following revision(s) (requested by abs in ticket #13):
sys/arch/atari/dev/clock.c: revision 1.42
Move tc_init(&clk_timecounter); to stop the "timecounter:" message
appearing in the middle of the clock0 attach message. Tested by
Tuomo Makinen
 1.41.6.1.4.1 21-Apr-2010  matt sync to netbsd-5
 1.41.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.41.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.41.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.42.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.4.3 12-Jun-2011  rmind sync with head
 1.50.4.2 05-Mar-2011  rmind sync with head
 1.50.4.1 30-May-2010  rmind sync with head
 1.50.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.51.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.51.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.52.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.53.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.53.2.1 30-Oct-2012  yamt sync with head
 1.54.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.54.2.1 25-Feb-2013  tls resync with head
 1.55.2.1 18-May-2014  rmind sync with head
 1.58.2.1 10-Aug-2014  tls Rebase.
 1.59.28.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.4 08-Feb-2011  rmind branches: 1.4.14; 1.4.32;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.3 11-Dec-2005  christos branches: 1.3.100; 1.3.106; 1.3.108;
merge ktrace-lwp.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.66;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.3.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.100.1 05-Mar-2011  rmind sync with head
 1.4.32.1 22-Sep-2015  skrll Sync with HEAD
 1.4.14.1 03-Dec-2017  jdolecek update from HEAD
 1.7 17-Nov-2014  christos PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.
 1.6 20-Oct-2009  snj branches: 1.6.22;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.5 24-Apr-2001  leo branches: 1.5.8; 1.5.130;
The register spacing for the Milan is different.
 1.4 06-Jan-1996  leo branches: 1.4.42;
Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.3 28-Jun-1995  cgd note that most of dev/ic's contents have changed names
 1.2 28-May-1995  leo Use <dev/ic/mc146818.h>. Change systemclock settings. Usable values for
HZ are now 48/64/96. This reduces the interrupt overhead, because we
don't need the extra division by 4 in the interrupt handler.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.4.42.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.130.1 11-Mar-2010  yamt sync with head
 1.5.8.2 24-Apr-2001  leo The register spacing for the Milan is different.
 1.5.8.1 24-Apr-2001  leo file clockreg.h was added on branch nathanw_sa on 2001-04-24 06:27:59 +0000
 1.6.22.1 03-Dec-2017  jdolecek update from HEAD
 1.1 07-Jul-2009  tsutsui branches: 1.1.2;
Explicitly initialize the MFP Timer-B for delay(9) from atari_hwinit()
rather than using if(!atari_realconfig) in clockmatch().
(I doubt the latter one has actually been called..)
 1.1.2.2 18-Jul-2009  yamt sync with head.
 1.1.2.1 07-Jul-2009  yamt file clockvar.h was added on branch yamt-nfs-mp on 2009-07-18 14:52:52 +0000
 1.29 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.28 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.27 12-Apr-2010  tsutsui branches: 1.27.18; 1.27.48;
- more cosmetics
- use queue(3) macro properly
 1.26 12-Apr-2010  tsutsui KNF and cosmetics.
 1.25 10-Apr-2010  tsutsui Always schedule callback functions via add_sicallback(),
which calls softint_schedule(9).

We cannot use BASEPRI() to check recursive calls any longer
since softint(9) has been reorganized to use kernel thread.
 1.24 20-Oct-2009  snj branches: 1.24.2; 1.24.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.23 08-Jul-2009  tsutsui Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.22 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.21 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.20 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.19 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.18 04-Mar-2007  christos branches: 1.18.44; 1.18.52; 1.18.54; 1.18.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.17 11-Dec-2005  christos branches: 1.17.26;
merge ktrace-lwp.
 1.16 15-Jul-2003  lukem branches: 1.16.16;
__KERNEL_RCSID()
 1.15 27-Sep-2002  provos branches: 1.15.6;
remove trailing \n in panic(). approved perry.
 1.14 27-Jan-1997  leo branches: 1.14.40; 1.14.44;
Add option to sleep until ST_DMA becomes available.
 1.13 12-Jan-1997  leo branches: 1.13.2;
Fix return value of the interrupt function.
 1.12 01-Jan-1997  leo The ST-DMA driver now uses intr_establish.
 1.11 13-Oct-1996  christos backout previous kprintf changes
 1.10 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.9 05-Jul-1996  leo Add missing spl0() call.
 1.8 18-Jun-1996  leo Pull down from release. Sorry, should have been the other way around....
 1.7 19-Apr-1996  leo branches: 1.7.4;
Prototypes.
 1.6 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.5 06-Nov-1995  leo The Falcon needs a delay after writing the dma_data register (Thomas Gerner)
 1.4 14-May-1995  leo branches: 1.4.2;
- Remove race condition from DMA interrupt handler
- Add function to get current DMA address for Falcon SCSI.
 1.3 30-Apr-1995  leo Complete rewrite, made necessary because Falcon SCSI needs to share
NCR5380 and DMA access with floppy.
 1.2 22-Apr-1995  leo - Remove register access functions from dma.c -> fd.c and inline them
- Add write protect checking (mistereously disapeared during port)
- Make fdclose() return a sensible value
- Prefix 'dma-defines' with DMA_
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.4.2.1 06-Nov-1995  leo Update from main branch.
 1.7.4.2 19-Jul-1996  jtc Pulled up from rev 1.9 by request from Leo Weppelman
 1.7.4.1 18-Jun-1996  leo Get rid of some spurious interrupts caused by pending software interrupts.
 1.13.2.1 30-Jan-1997  thorpej update from trunk
 1.14.44.1 18-Oct-2002  nathanw Catch up to -current.
 1.14.40.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.15.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.6.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.1 03-Sep-2007  yamt sync with head.
 1.17.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.18.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.54.1 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1373):
sys/arch/atari/dev/dma.c: revision 1.25
sys/arch/atari/dev/atari5380.c: revision 1.54
Always schedule callback functions via add_sicallback(),
which calls softint_schedule(9).
We cannot use BASEPRI() to check recursive calls any longer
since softint(9) has been reorganized to use kernel thread.
 1.18.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.18.44.4 11-Aug-2010  yamt sync with head.
 1.18.44.3 11-Mar-2010  yamt sync with head
 1.18.44.2 18-Jul-2009  yamt sync with head.
 1.18.44.1 04-May-2009  yamt sync with head.
 1.24.4.1 30-May-2010  rmind sync with head
 1.24.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.27.48.1 27-Sep-2017  jdolecek pass ata channel interlock to st_dmagrab() so that it can release
and reacquire it if it sleeps
 1.27.18.1 03-Dec-2017  jdolecek update from HEAD
 1.17 26-Sep-2021  thorpej Driver "kqfilter" entry points return an error code, so if an invalid
filter is requested, return EINVAL rather than 1.
 1.16 26-Sep-2021  thorpej Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

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

NetBSD 9.99.89
 1.15 19-Dec-2020  thorpej - malloc(9) -> kmem(9)
- Use sel{record,remove}_knote().
 1.14 25-Oct-2017  maya branches: 1.14.16;
Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- { a, b, c, d
+ {
+ .f_isfd = a,
+ .f_attach = b,
+ .f_detach = c,
+ .f_event = d,
};
 1.13 14-Mar-2009  dsl branches: 1.13.22;
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.12 01-Mar-2008  rmind branches: 1.12.4; 1.12.12; 1.12.18;
Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.11 04-Mar-2007  christos branches: 1.11.20; 1.11.36; 1.11.40;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 11-Dec-2005  christos branches: 1.10.26;
merge ktrace-lwp.
 1.9 07-Aug-2003  agc branches: 1.9.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 26-Nov-2002  christos branches: 1.7.6;
si_ -> sel_
 1.6 23-Oct-2002  jdolecek merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.5 08-Oct-1996  thorpej branches: 1.5.42; 1.5.46;
Merge the netbsd-1-2 branch into the mainline.
 1.4 25-Sep-1996  leo Catchup with -current:
- Extra argument to boot()
- select -> poll
 1.3 30-May-1996  leo Add missing spl(x). (Jason Thorpe)
 1.2 25-Jun-1995  leo branches: 1.2.6;
Mouse driver added.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.6.1 18-Jun-1996  leo Pull up from trunk.
 1.5.46.2 11-Dec-2002  thorpej Sync with HEAD.
 1.5.46.1 11-Nov-2002  nathanw Catch up to -current
 1.5.42.3 02-Oct-2002  jdolecek do not need the (void *) cast for kn_hook anymore
 1.5.42.2 12-Sep-2001  thorpej Fix a past'o.
 1.5.42.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.7.6.4 17-Jan-2005  skrll Adapt to branch.
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.3 17-Mar-2008  yamt sync with head.
 1.9.16.2 03-Sep-2007  yamt sync with head.
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.10.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.36.1 24-Mar-2008  keiichi sync with head.
 1.11.20.1 23-Mar-2008  matt sync with HEAD
 1.12.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.12.4.1 04-May-2009  yamt sync with head.
 1.13.22.1 03-Dec-2017  jdolecek update from HEAD
 1.14.16.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.10 24-May-2020  hannken Change proc_lock -> &proc_lock.
 1.9 29-Mar-2014  tsutsui Make sure to acquire proc_lock mutex on calling psignal(9) in EV_WAKEUP().

Without this, Xserver could cause panic on the DIAGNOSTIC kernel as x68k:
http://mail-index.netbsd.org/source-changes/2012/08/15/msg036632.html
 1.8 14-Mar-2009  dsl branches: 1.8.12; 1.8.22; 1.8.26;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.7 01-Mar-2008  rmind branches: 1.7.4; 1.7.12; 1.7.18;
Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.6 04-Mar-2007  christos branches: 1.6.20; 1.6.36; 1.6.40;
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 07-Aug-2003  agc branches: 1.4.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 23-Oct-2002  jdolecek branches: 1.3.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.2 25-Sep-1996  leo branches: 1.2.42; 1.2.46;
Catchup with -current:
- Extra argument to boot()
- select -> poll
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.46.1 11-Nov-2002  nathanw Catch up to -current
 1.2.42.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.3.6.4 17-Jan-2005  skrll Adapt to branch.
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.3 17-Mar-2008  yamt sync with head.
 1.4.16.2 03-Sep-2007  yamt sync with head.
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.5.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.36.1 24-Mar-2008  keiichi sync with head.
 1.6.20.1 23-Mar-2008  matt sync with HEAD
 1.7.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.4.1 04-May-2009  yamt sync with head.
 1.8.26.1 18-May-2014  rmind sync with head
 1.8.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.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.99 20-Jul-2024  andvar fix typos in comments, mainly s/harware/hardware/.
 1.98 20-Dec-2023  thorpej branches: 1.98.2;
Remove unnecessary <sys/malloc.h> include.
 1.97 30-Aug-2023  andvar atari/fdc(4): fix printf format specifiers for FLP_DEBUG build.
 1.96 24-Jun-2023  msaitoh Fix typo in comment.
 1.95 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.94 26-Jun-2022  tsutsui Use aprint_*(9) for device attach messages.
 1.93 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.92 15-May-2022  andvar s/wich/which in comments.
 1.91 03-May-2022  andvar fix various typos, mainly s/trasfering/transferring/ and s/theese/these/.
 1.90 11-Apr-2022  andvar s/simular/similar/
 1.89 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.88 24-Apr-2021  thorpej branches: 1.88.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.87 03-Sep-2018  riastradh branches: 1.87.14;
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.86 08-Feb-2018  dholland branches: 1.86.2; 1.86.4;
Typos.
 1.85 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.84 26-Apr-2015  mlelstv branches: 1.84.6;
Use C99-style initializers for struct dkdriver.
 1.83 02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.82 01-Jan-2015  christos declare error
 1.81 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.80 18-Oct-2014  snj branches: 1.80.2;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.79 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

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

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.77 16-Mar-2014  dholland branches: 1.77.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.76 13-Apr-2010  tsutsui branches: 1.76.8; 1.76.18; 1.76.22;
Misc KNF.
 1.75 07-Apr-2010  tsutsui Misc KNF.
 1.74 07-Apr-2010  tsutsui - split device_t/softc
- use device_lookup_private() directly rather than via local macro
 1.73 07-Apr-2010  tsutsui extern inline -> static inline
 1.72 20-Oct-2009  snj branches: 1.72.2; 1.72.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.71 31-Jul-2009  tsutsui Read AD_CFG_SWITCH via volatile pointer so that
the default density is detected correctly.
 1.70 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.69 18-Mar-2009  cegger bcopy -> memcpy
 1.68 18-Mar-2009  cegger bzero -> memset
 1.67 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.66 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.65 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.64 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.63 13-Jan-2009  yamt branches: 1.63.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.62 11-Jun-2008  tsutsui branches: 1.62.4; 1.62.6; 1.62.12;
Use device_private() and device_lookup_privat() to get softc.
 1.61 17-Oct-2007  garbled branches: 1.61.16; 1.61.18; 1.61.20; 1.61.22; 1.61.24;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.60 17-Oct-2007  he Fix typo: in disk_init() call: fd -> sc.
 1.59 08-Oct-2007  ad branches: 1.59.2;
Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.58 29-Jul-2007  ad branches: 1.58.4; 1.58.6; 1.58.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.57 09-Jul-2007  ad branches: 1.57.2; 1.57.4;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.56 06-Mar-2007  tsutsui branches: 1.56.2; 1.56.4; 1.56.10;
Make io_data (char *) rather than adding an extra cast
since it's used only in this file to calculate buffer address.
 1.55 06-Mar-2007  he More fixes after the caddr_t removal.
Mostly cast to char* for pointer arithmetic,
but also one missing indirection, and one "void *v, x;" fix.
 1.54 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.53 24-Dec-2005  perry branches: 1.53.26;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.52 11-Dec-2005  christos merge ktrace-lwp.
 1.51 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.50 04-Jun-2005  he branches: 1.50.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.49 28-Oct-2004  yamt move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.48 04-Jan-2004  wiz Spell controller with two ls. Inspired by miod@openbsd.
 1.47 15-Jul-2003  lukem __KERNEL_RCSID()
 1.46 03-May-2003  wiz branches: 1.46.2;
DMA, not dma nor Dma.
 1.45 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.44 01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.43 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.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 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.38 10-Aug-2002  hannken Convert to new device buffer queue interface.

Approved by: Leo Weppelman <leo@netbsd.org>
 1.37 26-Jul-2001  wiz branches: 1.37.2; 1.37.6; 1.37.14;
issueing -> issuing
 1.36 29-Mar-2000  leo branches: 1.36.8;
Nuke a bunch of cf_unit abuses.
 1.35 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.34 13-Mar-2000  soren Fix doubled 'the's in comments.
 1.33 15-Feb-2000  leo Grabage collect a 'struct buf *' left over from recent disksort changes.
 1.32 07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.31 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.30 06-Jan-2000  leo Determine the default floppy type on the TT/Falcon by reading the config
switches. (Thanks to Michael Schwingen for the missing bits of information!).
 1.29 06-Aug-1999  leo branches: 1.29.2;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.28 24-Feb-1998  leo branches: 1.28.8;
Declare 'fd_cd'.
 1.27 12-Jan-1998  thorpej Update for changes to config.
 1.26 08-Oct-1997  thorpej Implement DIOCGDEFLABEL.
 1.25 28-Dec-1996  leo branches: 1.25.10;
Oops, this one was missed in the BROKEN_INDIRECT_CONFIG cruisade.
 1.24 06-Nov-1996  leo - Make it's behaviour on minor numbers identical to that of the Hades
floppy driver.
- Fixup format types in the debug-printf's
- Don't print empty lines on unconfigured drives.
- When a drive is detected, show it's default format.

---- Warning: minor numbers are shifted! ---
 1.23 13-Oct-1996  christos backout previous kprintf changes
 1.22 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.21 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.20 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.19 12-Apr-1996  leo Prototyping.
 1.18 27-Mar-1996  leo Take out direct access to the YM2149. The chip definitions are moved
from video.h to ym2149reg.h.
 1.17 20-Mar-1996  leo Another bit of prototyping...
 1.16 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.15 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.14 02-Feb-1996  mycroft Fix #includes.
 1.13 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.12 10-Dec-1995  leo Make sure that the motor will be turned off when a floppy is inserted.
 1.11 14-Oct-1995  leo Use general bound-check function.
 1.10 12-Aug-1995  mycroft branches: 1.10.2;
minphys() functions really should return void.
 1.9 24-Jul-1995  cgd fix minphys so that it actually works properly
 1.8 11-Jul-1995  leo - Change character interface as suggested by Charles
- HD floppies really have 2 sides ;-)
- Cleanup drive/density selection
 1.7 14-May-1995  leo Change of function params for Falcon SCSI.
 1.6 05-May-1995  leo Fix bug on handling HD-floppy's.
 1.5 30-Apr-1995  leo Small changes in dma locking code.
 1.4 22-Apr-1995  leo - Remove register access functions from dma.c -> fd.c and inline them
- Add write protect checking (mistereously disapeared during port)
- Make fdclose() return a sensible value
- Prefix 'dma-defines' with DMA_
 1.3 16-Apr-1995  leo Make it consistent with conf.c .
 1.2 10-Apr-1995  mycroft Fdclose --> fdclose
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.10.2.1 14-Oct-1995  leo Use general bound-check function.
 1.25.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.28.8.1 16-Dec-1999  he Pull up revision 1.29 (requested by leo):
Change the way that bits are cleared in the InterruptPending
register of the 68901, avoiding a read-modify-write cycle.
Solves a "hanging keyboard" problem.
 1.29.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.36.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.36.8.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.36.8.1 03-Aug-2001  lukem update to -current
 1.37.14.2 30-Aug-2002  gehenna catch up with -current.
 1.37.14.1 17-May-2002  gehenna Add device switch.
 1.37.6.6 03-Jan-2003  thorpej Sync with HEAD.
 1.37.6.5 11-Nov-2002  nathanw Catch up to -current
 1.37.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.37.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.37.6.2 13-Aug-2002  nathanw Catch up to -current.
 1.37.6.1 26-Jul-2001  nathanw file fd.c was added on branch nathanw_sa on 2002-08-13 02:18:01 +0000
 1.37.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.46.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.46.2.5 17-Jan-2005  skrll Adapt to branch.
 1.46.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.46.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.46.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.46.2.1 03-Aug-2004  skrll Sync with HEAD
 1.50.2.3 27-Oct-2007  yamt sync with head.
 1.50.2.2 03-Sep-2007  yamt sync with head.
 1.50.2.1 21-Jun-2006  yamt sync with head.
 1.53.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.56.10.3 17-Oct-2007  garbled Sync with HEAD
 1.56.10.2 16-Oct-2007  garbled Sync with HEAD
 1.56.10.1 03-Oct-2007  garbled Sync with HEAD
 1.56.4.1 11-Jul-2007  mjf Sync with head.
 1.56.2.4 23-Oct-2007  ad Sync with head.
 1.56.2.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.56.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.56.2.1 15-Jul-2007  ad Sync with head.
 1.57.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.57.2.1 07-Aug-2007  matt Sync with HEAD.
 1.58.8.2 18-Oct-2007  yamt sync with head.
 1.58.8.1 14-Oct-2007  yamt sync with head.
 1.58.6.1 06-Nov-2007  matt sync with HEAD
 1.58.4.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.59.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.61.24.1 18-Jun-2008  simonb Sync with head.
 1.61.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.61.20.4 11-Aug-2010  yamt sync with head.
 1.61.20.3 11-Mar-2010  yamt sync with head
 1.61.20.2 19-Aug-2009  yamt sync with head.
 1.61.20.1 04-May-2009  yamt sync with head.
 1.61.18.1 17-Jun-2008  yamt sync with head.
 1.61.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.61.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.62.12.1 21-Apr-2010  matt sync to netbsd-5
 1.62.6.1 04-Oct-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #1058):
sys/arch/atari/dev/fd.c: revision 1.71
Read AD_CFG_SWITCH via volatile pointer so that
the default density is detected correctly.
 1.62.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.62.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.63.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.72.4.1 30-May-2010  rmind sync with head
 1.72.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.76.22.1 18-May-2014  rmind sync with head
 1.76.18.2 03-Dec-2017  jdolecek update from HEAD
 1.76.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.76.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.77.2.1 10-Aug-2014  tls Rebase.
 1.80.2.2 06-Jun-2015  skrll Sync with HEAD
 1.80.2.1 06-Apr-2015  skrll Sync with HEAD
 1.84.6.1 27-Sep-2017  jdolecek pass ata channel interlock to st_dmagrab() so that it can release
and reacquire it if it sleeps
 1.86.4.1 10-Jun-2019  christos Sync with HEAD
 1.86.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.87.14.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.88.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.98.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.2 22-Apr-1995  leo branches: 1.2.172;
- Remove register access functions from dma.c -> fd.c and inline them
- Add write protect checking (mistereously disapeared during port)
- Make fdclose() return a sensible value
- Prefix 'dma-defines' with DMA_
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.172.1 11-Mar-2010  yamt sync with head
 1.2 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.172;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.172.1 11-Mar-2010  yamt sync with head
 1.7 21-Sep-2023  msaitoh s/ for for / for / in comment.
 1.6 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.5 21-Jun-2022  tsutsui Correct flipped glyph of 'N' in the "New Line" in the DEC graphics chars.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 23-Sep-1995  leo branches: 1.2.66;
Make them compliant to iso-8859-1 (Thomas Gerner).
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.6 21-Sep-2023  msaitoh s/ for for / for / in comment.
 1.5 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 23-Sep-1995  leo branches: 1.2.66;
Make them compliant to iso-8859-1 (Thomas Gerner).
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.57 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.56 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.55 26-Jun-2022  tsutsui Use aprint_*(9) for device attach messages.
 1.54 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.53 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.52 27-Apr-2021  thorpej branches: 1.52.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.51 24-Apr-2021  thorpej branches: 1.51.2;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.50 29-Jun-2019  tsutsui branches: 1.50.12;
Make local functions static.
 1.49 25-Jul-2014  dholland branches: 1.49.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.48 16-Mar-2014  dholland branches: 1.48.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.47 30-Jun-2011  wiz branches: 1.47.2; 1.47.12; 1.47.16;
dependant -> dependent
 1.46 05-Jun-2011  matt A few missed device_t, cfdata_t cleanups
 1.45 05-Jun-2011  tsutsui - use CFATTACH_DECL_NEW() (no softc)
- use device_t, cfdata_t etc.
 1.44 08-Feb-2011  rmind branches: 1.44.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.43 13-Apr-2010  tsutsui branches: 1.43.2; 1.43.4;
Misc KNF.
 1.42 13-Apr-2010  tsutsui Include "ioconf.h" to declare struct cfdriver foo_cd.
 1.41 19-Jul-2009  tsutsui branches: 1.41.2; 1.41.4;
Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.40 18-Mar-2009  cegger bcopy -> memcpy
 1.39 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.38 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.37 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.36 04-Mar-2007  christos branches: 1.36.44; 1.36.52; 1.36.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 11-Dec-2005  christos branches: 1.35.26;
merge ktrace-lwp.
 1.34 25-Mar-2004  leo branches: 1.34.16;
Licence cleanup (suggested by wiz).
 1.33 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.32 15-Jul-2003  lukem __KERNEL_RCSID()
 1.31 23-Oct-2002  jdolecek branches: 1.31.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.30 10-Oct-2002  jdolecek replace the somewhat strange poll routine with standard nopoll() (a.k.a
seltrue())
 1.29 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.28 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.27 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.26 17-Mar-2002  atatat branches: 1.26.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.25 29-Jun-2000  mrg branches: 1.25.2; 1.25.4; 1.25.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.24 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.23 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.22 20-Dec-1998  thomas branches: 1.22.8; 1.22.18;
Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.21 12-Jan-1998  thorpej Update for changes to config.
 1.20 25-Apr-1997  leo - Provide the reasonable size that can/may be mmap-ed. This might differ
from the current frame buffer size.
- The et-driver now allows for a 16Kb io-region (was 8Kb) that can be
mapped. The XFree server uses this.
 1.19 26-Feb-1997  leo Fix a kernel-dump that occurred when accessing a grf-device that was configured
in the config file but not found by the autoconfig code.
 1.18 10-Jan-1997  leo branches: 1.18.6;
Allow the control registers to be mapped too.
 1.17 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.16 13-Oct-1996  christos backout previous kprintf changes
 1.15 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.14 04-Oct-1996  leo Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.13 25-Sep-1996  leo Catchup with -current:
- Extra argument to boot()
- select -> poll
 1.12 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.11 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.10 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.9 20-Mar-1996  leo Fix typo in neew config changes.
 1.8 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.7 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.6 26-Jun-1995  leo Sync grf with underlying view on open.
 1.5 09-Jun-1995  leo Fix grfmmap()
 1.4 28-May-1995  leo Remove the pointer to view_t from the grf-structure, use viewview(dev)
to obtain the pointer instead. This removes a kernel-crash that happened
when something was written to the console while the console was being
resized.
 1.3 21-May-1995  leo Minor fixes.
 1.2 10-Apr-1995  mycroft map --> mmap
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.18.6.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.22.18.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.22.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.25.8.4 11-Nov-2002  nathanw Catch up to -current
 1.25.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.25.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.25.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.25.4.5 10-Oct-2002  jdolecek use nokqfilter (or seltrue_kqfilter()) for drivers which provide poll
routine very similar to seltrue(); the poll routines would be cleaned
up on trunk
 1.25.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.25.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.25.4.2 17-Jun-2002  jdolecek make compilable - use cdev_decl(), and remove unnecessary prototypes
from headers
 1.25.4.1 12-Sep-2001  thorpej Add noop kqueue entry points.
 1.25.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.26.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.31.6.4 17-Jan-2005  skrll Adapt to branch.
 1.31.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.31.6.1 03-Aug-2004  skrll Sync with HEAD
 1.34.16.2 03-Sep-2007  yamt sync with head.
 1.34.16.1 21-Jun-2006  yamt sync with head.
 1.35.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.36.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.36.44.3 11-Aug-2010  yamt sync with head.
 1.36.44.2 19-Aug-2009  yamt sync with head.
 1.36.44.1 04-May-2009  yamt sync with head.
 1.41.4.3 12-Jun-2011  rmind sync with head
 1.41.4.2 05-Mar-2011  rmind sync with head
 1.41.4.1 30-May-2010  rmind sync with head
 1.41.2.1 30-Apr-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.44.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.47.16.1 18-May-2014  rmind sync with head
 1.47.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.48.2.1 10-Aug-2014  tls Rebase.
 1.49.28.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.50.12.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.51.2.1 13-May-2021  thorpej Sync with HEAD.
 1.52.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.3 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.2 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.1 04-Oct-1996  leo branches: 1.1.78; 1.1.116;
Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.1.116.1 12-Mar-2007  rmind Sync with HEAD.
 1.1.78.1 03-Sep-2007  yamt sync with head.
 1.20 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.19 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.18 12-Feb-2012  matt Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.17 20-Oct-2009  snj branches: 1.17.12; 1.17.16;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.16 18-Mar-2009  cegger bzero -> memset
 1.15 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.14 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.13 11-Dec-2005  christos branches: 1.13.78; 1.13.86; 1.13.92;
merge ktrace-lwp.
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 04-Mar-2002  wiz branches: 1.11.14;
possible has two s.
 1.10 04-Oct-1996  leo branches: 1.10.42; 1.10.46;
Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.9 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console
 1.8 08-Mar-1996  leo When having a perfect match on the resolution, try to match the screen
depth as best we can.
 1.7 23-Sep-1995  leo Make sure the prototypes and inline definitions are included.
 1.6 04-Sep-1995  leo Right align color values in the bytes.
 1.5 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.4 21-May-1995  leo - Add grf_get_best_mode()
- Only update 'real' colormap when actually displaying
- Fix TT-HIGH video mode
 1.3 28-Apr-1995  leo Better way to select a display mode?
 1.2 28-Mar-1995  leo Make ite ioctl work and fixup the colormap stuff.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.10.46.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.10.42.1 16-Mar-2002  jdolecek Catch up with -current.
 1.11.14.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.14.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.14.1 03-Aug-2004  skrll Sync with HEAD
 1.13.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.13.78.2 11-Mar-2010  yamt sync with head
 1.13.78.1 04-May-2009  yamt sync with head.
 1.17.16.1 18-Feb-2012  mrg merge to -current.
 1.17.12.1 17-Apr-2012  yamt sync with head
 1.37 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.36 12-Aug-2021  andvar fix various typos in comments.
 1.35 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.34 13-Apr-2010  tsutsui branches: 1.34.58; 1.34.60;
Misc KNF.
 1.33 20-Oct-2009  snj branches: 1.33.2; 1.33.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.32 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.31 18-Mar-2009  cegger bcopy -> memcpy
 1.30 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.29 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.28 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.27 06-Mar-2007  tsutsui branches: 1.27.44; 1.27.52; 1.27.58;
- remove volatile from *regkva member in struct grfabs_et_priv
and use temporary variables on register accesses
- also remove volatile from *memkva member in struct grfabs_et_priv
because it isn't used to refer memory
XXX: I'm not sure if bm->plane should be volatile or not
but I don't think previous code treats it as volatile anyway.
(though I'm not sure how compiler handled "volatile caddr_t")
 1.26 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.25 29-Mar-2006  thomas branches: 1.25.14;
Do not disable access to tseng private registers
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10; 1.24.12;
merge ktrace-lwp.
 1.23 13-Feb-2004  wiz branches: 1.23.16;
Uppercase CPU, plural is CPUs.
 1.22 15-Jul-2003  lukem __KERNEL_RCSID()
 1.21 02-Feb-2003  thomas branches: 1.21.2;
Config option for et4000 boards with 2MB memory.
 1.20 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.19 04-Mar-2002  wiz possible has two s.
 1.18 29-Jun-2000  mrg branches: 1.18.4; 1.18.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.17 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.16 11-Apr-2000  leo Now what are we doing with the return value of splx()? (probably a pasto)
 1.15 11-Feb-2000  leo Remove redundant test.
 1.14 12-Jan-2000  leo Init the preset_row_scan register. This fixes a sometimes partly scrolled-up
console.
 1.13 26-Mar-1999  leo branches: 1.13.8;
Nuke the pieces of code obsoleted by .../pci/pci_tseng.c
 1.12 19-Feb-1999  leo More work on Tseng support. Now both my et6000 _and_ the et6100 work. I just
whish that programming MDRAM latency values came out of the BlackMagic(tm)
domain :-(
 1.11 20-Dec-1998  thomas Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.10 20-Nov-1998  leo Checkpoint my work on et6000 support.
 1.9 11-May-1998  thomas Let et4000 work with other RAMDAC than STG1703
 1.8 23-Apr-1998  leo Use NOWAIT when malloc()-ing a buffer for switching screens. It might be
running from an interrupt handler.
 1.7 25-Apr-1997  leo branches: 1.7.8;
- Provide the reasonable size that can/may be mmap-ed. This might differ
from the current frame buffer size.
- The et-driver now allows for a 16Kb io-region (was 8Kb) that can be
mapped. The XFree server uses this.
 1.6 10-Jan-1997  leo Record physical addresses in the bitmap structure instead of VA's. The
latter breaks the mmap-functions.
 1.5 17-Nov-1996  leo Shift screen a bit to the left.
 1.4 13-Oct-1996  christos backout previous kprintf changes
 1.3 11-Oct-1996  leo *** empty log message ***
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 04-Oct-1996  leo Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.7.8.1 30-Oct-1998  cgd pull up revs 1.8 and 1.9 from trunk (leo)
 1.13.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.18.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.18.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.18.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.18.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Aug-2004  skrll Sync with HEAD
 1.23.16.2 03-Sep-2007  yamt sync with head.
 1.23.16.1 21-Jun-2006  yamt sync with head.
 1.24.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.24.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.24.8.1 01-Apr-2006  yamt sync with head.
 1.24.6.1 22-Apr-2006  simonb Sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.25.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.27.44.4 11-Aug-2010  yamt sync with head.
 1.27.44.3 11-Mar-2010  yamt sync with head
 1.27.44.2 19-Aug-2009  yamt sync with head.
 1.27.44.1 04-May-2009  yamt sync with head.
 1.33.4.1 30-May-2010  rmind sync with head
 1.33.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.34.60.1 10-Jun-2019  christos Sync with HEAD
 1.34.58.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 04-Oct-2011  chs expand the attr array to hold all the bytes we store in it.
not that the code actually does anything with the extra bytes,
but at least it builds with gcc 4.5.
 1.3 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.2 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 11-Oct-1996  leo branches: 1.1.168; 1.1.176; 1.1.182;
- add a iteet_ioctl function so iteconfig(1) can be used to select the
screen geometry.
- Re-arrange et_loadmode() and et_inittextmode() to write into shadow
register set instead of writing to the card-registers directly.
- provide et_hwsave()/et_hwrest() functions to transfer the card-registers
to and from the shadow set.
 1.1.182.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.176.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.168.2 11-Mar-2010  yamt sync with head
 1.1.168.1 04-May-2009  yamt sync with head.
 1.31 08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.30 05-Jul-2024  andvar fix various typos in comments and log messages, mainly s/hight/high/
s/hight/height/ and removing double m in time(ing).
 1.29 06-Jan-2023  tsutsui branches: 1.29.6;
TAB/spaces/indents cleanup.
 1.28 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.27 13-Apr-2010  tsutsui Misc KNF.
 1.26 21-Oct-2009  snj branches: 1.26.2; 1.26.4;
Drop 3rd and 4th clause. Approved by leo@ and thomas@ (copyright holders).
 1.25 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.24 18-Mar-2009  cegger bcopy -> memcpy
 1.23 18-Mar-2009  cegger bzero -> memset
 1.22 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.21 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.20 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.19 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.18 11-Dec-2005  christos branches: 1.18.78; 1.18.86; 1.18.92;
merge ktrace-lwp.
 1.17 15-Jul-2003  lukem __KERNEL_RCSID()
 1.16 01-Apr-2003  thorpej branches: 1.16.2;
Use PAGE_SIZE rather than NBPG.
 1.15 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.14 04-Mar-2002  wiz possible has two s.
 1.13 13-Mar-2000  soren branches: 1.13.8; 1.13.12;
Fix doubled 'the's in comments.
 1.12 20-Dec-1998  thomas branches: 1.12.8;
Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.11 21-Jan-1998  leo Fix a bug in the colormap handling. (Thomas Gerner)
 1.10 10-Jun-1997  veego branches: 1.10.8;
s/atari_round_page/m68k_round_page/
 1.9 19-May-1997  leo Fix the 'shifting screens' bug on the Falcon. This solution is not perfect
since it gives a bit of flicker while switching frame buffers. From
Thomas Gerner.
 1.8 25-Apr-1997  leo - Provide the reasonable size that can/may be mmap-ed. This might differ
from the current frame buffer size.
- The et-driver now allows for a 16Kb io-region (was 8Kb) that can be
mapped. The XFree server uses this.
 1.7 04-Oct-1996  leo Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.6 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.5 23-Aug-1996  leo Don't use an absolute I/O adress.
 1.4 15-May-1996  leo Prototype + -Wall fixes.
 1.3 10-Mar-1996  leo Take the type of the attached monitor into account when selecting a
display-mode. Includes hack to make things work on non-VGA monitors.
 1.2 02-Jan-1996  leo Allow selection of Falcon (videl) video modes other than the mode selected
on startup (Thomas Gerner).
 1.1 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.10.8.1 30-Oct-1998  cgd pull up rev 1.11 from trunk (leo)
 1.12.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.13.12.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.13.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.13.8.1 16-Mar-2002  jdolecek 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.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.4 11-Aug-2010  yamt sync with head.
 1.18.78.3 11-Mar-2010  yamt sync with head
 1.18.78.2 19-Aug-2009  yamt sync with head.
 1.18.78.1 04-May-2009  yamt sync with head.
 1.26.4.1 30-May-2010  rmind sync with head
 1.26.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.29.6.1 02-Aug-2025  perseant Sync with HEAD
 1.6 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.5 21-Oct-2009  snj Drop 3rd and 4th clauses. Approved by thomas@ (copyright holder).
 1.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 16-Sep-1996  leo branches: 1.3.168; 1.3.176; 1.3.182;
Prepare for (soon to come) et4000 PCI console.
 1.2 10-Mar-1996  leo Take the type of the attached monitor into account when selecting a
display-mode. Includes hack to make things work on non-VGA monitors.
 1.1 02-Jan-1996  leo Allow selection of Falcon (videl) video modes other than the mode selected
on startup (Thomas Gerner).
 1.3.182.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.176.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.168.2 11-Mar-2010  yamt sync with head
 1.3.168.1 04-May-2009  yamt sync with head.
 1.15 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.14 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.13 11-Dec-2005  christos branches: 1.13.78; 1.13.86; 1.13.92;
merge ktrace-lwp.
 1.12 04-Jun-2005  he Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.11 20-Dec-1998  thomas branches: 1.11.42;
Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.10 13-Mar-1997  leo Add member to bitmap struct that gives the size of mappable memory.
 1.9 11-Oct-1996  leo *** empty log message ***
 1.8 04-Oct-1996  leo Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.7 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.6 10-Mar-1996  leo Take the type of the attached monitor into account when selecting a
display-mode. Includes hack to make things work on non-VGA monitors.
 1.5 04-Sep-1995  leo Right align color values in the bytes.
 1.4 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.3 21-May-1995  leo Add prototype for grf_get_best_mode()
 1.2 28-Mar-1995  leo Make ite ioctl work and fixup the colormap stuff.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.11.42.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.13.78.1 04-May-2009  yamt sync with head.
 1.25 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.24 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.23 13-Apr-2010  tsutsui Misc KNF.
 1.22 20-Oct-2009  snj branches: 1.22.2; 1.22.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.21 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.20 18-Mar-2009  cegger bcopy -> memcpy
 1.19 18-Mar-2009  cegger bzero -> memset
 1.18 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.17 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.16 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.15 11-Dec-2005  christos branches: 1.15.78; 1.15.86; 1.15.92;
merge ktrace-lwp.
 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 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.11 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.10 04-Mar-2002  wiz possible has two s.
 1.9 20-Dec-1998  thomas branches: 1.9.22; 1.9.26;
Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.8 10-Jun-1997  veego s/atari_round_page/m68k_round_page/
 1.7 25-Apr-1997  leo - Provide the reasonable size that can/may be mmap-ed. This might differ
from the current frame buffer size.
- The et-driver now allows for a 16Kb io-region (was 8Kb) that can be
mapped. The XFree server uses this.
 1.6 04-Oct-1996  leo Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.5 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.4 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.3 12-Apr-1996  leo Prototyping.
 1.2 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.1 20-Aug-1995  leo Add Falcon video support. Thanks to Thomas Gerner.
 1.9.26.2 18-Oct-2002  nathanw Catch up to -current.
 1.9.26.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.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.9.22.1 16-Mar-2002  jdolecek Catch up with -current.
 1.13.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.15.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.15.78.4 11-Aug-2010  yamt sync with head.
 1.15.78.3 11-Mar-2010  yamt sync with head
 1.15.78.2 19-Aug-2009  yamt sync with head.
 1.15.78.1 04-May-2009  yamt sync with head.
 1.22.4.1 30-May-2010  rmind sync with head
 1.22.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.3 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.2 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 16-Sep-1996  leo branches: 1.1.168; 1.1.176; 1.1.182;
Prepare for (soon to come) et4000 PCI console
 1.1.182.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.176.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.168.2 11-Mar-2010  yamt sync with head
 1.1.168.1 04-May-2009  yamt sync with head.
 1.13 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.12 24-May-2022  andvar s/changable/changeable/ in comments.
 1.11 01-Nov-2021  andvar fix typos, mainly in words minimum and maximum, but also few others.
 1.10 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.9 08-Feb-2011  rmind branches: 1.9.14; 1.9.32;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.8 04-Mar-2007  christos branches: 1.8.66; 1.8.72; 1.8.74;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 24-Nov-2006  wiz branches: 1.7.4;
s/independant/independent/, from Zafer.
 1.6 11-Dec-2005  christos branches: 1.6.20; 1.6.22;
merge ktrace-lwp.
 1.5 18-May-2004  he branches: 1.5.12;
Add some mulitple include protection.
Include kbdmap.h from iteioctl.h so that kdump compiles, otherwise
the size of struct kbdmap as used in various ioctl defines is unknown.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 20-Dec-1998  thomas branches: 1.3.42;
Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.2 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.42.1 03-Aug-2004  skrll Sync with HEAD
 1.5.12.2 03-Sep-2007  yamt sync with head.
 1.5.12.1 30-Dec-2006  yamt sync with head.
 1.6.22.1 10-Dec-2006  yamt sync with head.
 1.6.20.1 12-Jan-2007  ad Sync with head.
 1.7.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.74.1 17-Feb-2011  bouyer Sync with HEAD
 1.8.72.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.66.1 05-Mar-2011  rmind sync with head
 1.9.32.1 22-Sep-2015  skrll Sync with HEAD
 1.9.14.1 03-Dec-2017  jdolecek update from HEAD
 1.15 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.14 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.13 05-Jun-2011  tsutsui branches: 1.13.2; 1.13.12;
Split device_t/softc. Also rename some softc variables. Tested on TT030.

XXX: old ugly config_console() hack should go away...
 1.12 08-Feb-2011  rmind branches: 1.12.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.11 14-Mar-2009  dsl branches: 1.11.4; 1.11.6; 1.11.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.10 04-Mar-2007  christos branches: 1.10.44; 1.10.52; 1.10.58;
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 07-Aug-2003  agc branches: 1.8.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.7 06-Sep-2002  gehenna branches: 1.7.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.6 04-Oct-1996  leo branches: 1.6.42; 1.6.46; 1.6.54;
Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.5 25-Sep-1996  leo Catchup with -current:
- Extra argument to boot()
- select -> poll
 1.4 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.3 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.2 28-May-1995  leo Remove the pointer to view_t from the grf-structure, use viewview(dev)
to obtain the pointer instead. This removes a kernel-crash that happened
when something was written to the console while the console was being
resized.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.6.54.1 19-May-2002  gehenna Remove unnecessary prototype.
 1.6.46.1 17-Sep-2002  nathanw Catch up to -current.
 1.6.42.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.42.1 17-Jun-2002  jdolecek make compilable - use cdev_decl(), and remove unnecessary prototypes
from headers
 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.16.1 03-Sep-2007  yamt sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.10.44.1 04-May-2009  yamt sync with head.
 1.11.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.11.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.4.2 12-Jun-2011  rmind sync with head
 1.11.4.1 05-Mar-2011  rmind sync with head
 1.12.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.13.2.1 30-Oct-2012  yamt sync with head
 1.92 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.91 26-Jun-2022  tsutsui Use aprint_*(9) for device attach messages.
 1.90 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.89 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.88 24-Apr-2021  thorpej branches: 1.88.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.87 03-Jan-2021  thorpej branches: 1.87.2;
malloc(9) -> kmem(9)
 1.86 10-Nov-2019  chs branches: 1.86.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.85 29-Jun-2019  tsutsui Make local functions static.
 1.84 08-Feb-2019  mrg make *fd*.c's fd_dev_to_type() always a static inline. some
have it as a const, and have code to copy the defaults to
modify them before using them, but that probably requires a
real test to feel confident in changing.
 1.83 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.82 08-Dec-2015  christos branches: 1.82.16; 1.82.18;
Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
 1.81 26-Apr-2015  mlelstv Use C99-style initializers for struct dkdriver.
 1.80 02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.79 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.78 25-Jul-2014  dholland branches: 1.78.4;
Add d_discard to all struct cdevsw instances I could find.

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

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.76 16-Mar-2014  dholland branches: 1.76.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.75 01-Jul-2011  dyoung branches: 1.75.2; 1.75.12; 1.75.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.74 10-Jun-2011  tsutsui Split device_t/softc. Compile test only.
 1.73 13-Apr-2010  tsutsui branches: 1.73.6;
Misc KNF.
 1.72 13-Apr-2010  tsutsui Include "ioconf.h" to declare struct cfdriver foo_cd.
 1.71 08-Jul-2009  tsutsui branches: 1.71.2; 1.71.4;
Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.70 18-Mar-2009  cegger bzero -> memset
 1.69 17-Mar-2009  he Re-balance parenthesis in a couple of places.
 1.68 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.67 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.66 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.65 13-Jan-2009  yamt branches: 1.65.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.64 18-Dec-2008  he Correct two typos and remove a now-unused variable to make this
build again.
 1.63 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.62 13-Jun-2008  cegger branches: 1.62.4;
use device_lookup_private to get softc
 1.61 03-Jan-2008  he branches: 1.61.6; 1.61.8; 1.61.10; 1.61.12; 1.61.14;
Fix a cv_timedwait() usage after the vmlocking2 merge, and remove
a now-no-longer-used local variable.
 1.60 02-Jan-2008  ad Merge vmlocking2 to head.
 1.59 17-Oct-2007  garbled branches: 1.59.2; 1.59.4; 1.59.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.58 08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.57 29-Jul-2007  ad branches: 1.57.4; 1.57.6; 1.57.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.56 09-Jul-2007  ad branches: 1.56.2; 1.56.4;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.55 06-Mar-2007  tsutsui branches: 1.55.2; 1.55.4; 1.55.10;
Treat bus_space_handle_t as opaque, and use bus_space_vaddr(9) to
get device address.

XXX: This driver should be rewritten to use bus_space(9) more properly.
 1.54 06-Mar-2007  tsutsui Add (char *) cast to appease -Wpointer-arith.
 1.53 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.52 15-Feb-2007  reinoud branches: 1.52.2;
Rename the B_XXX flag to B_DEVPRIVATE flag since it was never used for
debugging and its main use is in device drivers. Its used there to signal
that the flagged buffer has a special meaning or should be handled
differently.

OK'd by Bill Sudenmund on tech-kern.
 1.51 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.50 14-Apr-2006  blymn branches: 1.50.8;
Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
 1.49 23-Feb-2006  thorpej branches: 1.49.2; 1.49.4; 1.49.6;
Use device_parent().
 1.48 24-Dec-2005  perry branches: 1.48.2; 1.48.4; 1.48.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.47 11-Dec-2005  christos merge ktrace-lwp.
 1.46 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.45 04-Jun-2005  he branches: 1.45.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.44 28-Oct-2004  yamt move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.43 25-Mar-2004  leo Licence cleanup (suggested by wiz).
 1.42 29-Sep-2003  cl Cast through (void *) to appease gcc3.
 1.41 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.40 15-Jul-2003  lukem __KERNEL_RCSID()
 1.39 18-Jun-2003  drochner branches: 1.39.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.38 03-May-2003  wiz DMA, not dma nor Dma.
 1.37 02-Feb-2003  thomas Fix printf format for typ daddr_t.
 1.36 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.35 01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.34 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.33 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 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.30 10-Aug-2002  hannken Convert to new device buffer queue interface.

Approved by: Leo Weppelman <leo@netbsd.org>
 1.29 21-Nov-2001  wiz branches: 1.29.8;
Explicitly write explicitly without a second e.
 1.28 08-Jul-2001  wiz branches: 1.28.2; 1.28.4; 1.28.8;
Correct various misspellings of 'transfer' and inflected forms.
 1.27 29-Aug-2000  leo Now that formatting works (Thanks Nathan!), it shows that spec_read() is
issueing a 'DIOCGPART' at every read. Avoid re-reading the label at
every format-verify (or read/write on the block-device) by fetching the label
at open-time and caching it until we close.
 1.26 24-Aug-2000  nathanw In fdioctl(), allocate fd_formb dynamically when needed, rather than on
the stack, and remove the no-longer-necessary PHOLD()/PRELE() calls
in fdformat().

(This eliminates 1/3 of the instances of PHOLD()/PRELE() in the kernel code.)

XXX We still have too many mostly-redundant floppy drivers.
 1.25 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.24 16-May-2000  thorpej branches: 1.24.4;
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.23 09-May-2000  leo Add some {u}vm includes for the sake of PHOLD().
 1.22 07-Apr-2000  thorpej Use separate callouts for motor-on and motor-off. Fixes a condition
where the floppy driver would wedge because a motor-on timeout would
be cancelled by another I/O operation cancelling a motor-off timeout.

From enami tsugutomo <enami@sm.sony.co.jp>.
 1.21 29-Mar-2000  leo Nuke a bunch of cf_unit abuses.
 1.20 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.19 07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.18 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.17 22-Oct-1999  leo Limit the io-region mapped by this driver to the part actually used.
Otherwise, it conflicts with the wd-driver.
 1.16 21-Oct-1999  leo implement DIOCSDINFO.
 1.15 06-Aug-1999  leo branches: 1.15.2; 1.15.4; 1.15.6;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.14 04-May-1999  leo If the floppy has no label, fake one.
 1.13 20-Nov-1998  leo branches: 1.13.4; 1.13.6;
If the disklabel on the floppy says that there are more tracks and sectors
than the hardware is capable off, believe the hardware...
 1.12 06-Oct-1998  leo Some DEBUG fixups
 1.11 04-Jul-1998  jonathan defopt DDB.
 1.10 10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.9 12-Jan-1998  thorpej Update for changes to config.
 1.8 17-Jul-1997  jtk use locator defines in "locators.h" to index cf_loc[]
 1.7 25-Apr-1997  leo Allow formatting of 360Kb floppies.
 1.6 01-Jan-1997  leo The Hades floppy driver now uses intr_establish(). Also the interrupt
accounting is fixed (ie. counted as the right interrupt).
 1.5 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.4 18-Dec-1996  leo Tweak the clockframe structure a bit so we are able to save a few cycles
at interrupt time. (From Gordon Ross).
 1.3 14-Dec-1996  leo Merge the formatting code from the i386-port.
 1.2 13-Nov-1996  thorpej Use bitmask_snprintf().
 1.1 09-Nov-1996  leo Hades floppy driver.
 1.13.6.1 21-Jun-1999  thorpej Sync w/ -current.
 1.13.4.2 16-Dec-1999  he Pull up revision 1.15 (requested by leo):
Change the way that bits are cleared in the InterruptPending
register of the 68901, avoiding a read-modify-write cycle.
Solves a "hanging keyboard" problem.
 1.13.4.1 04-Dec-1999  he Pull up revision 1.14 (requested by leo):
If the floppy has no label, fake one.
 1.15.6.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.6.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.15.4.1 15-Nov-1999  fvdl Sync with -current
 1.15.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.4.1 06-Sep-2000  leo Apply patch (requested by leo, approved by thorpej).

Fix formatting floppies on the Hades. This fix contains a bugfix
from nathanw introduced in revision 1.26 and all of the label caching
code from revision 1.27. The latter is needed to avoid a seek to track
zero after each track has been formatted.
 1.28.8.7 03-Jan-2003  thorpej Sync with HEAD.
 1.28.8.6 11-Nov-2002  nathanw Catch up to -current
 1.28.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.28.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.28.8.3 13-Aug-2002  nathanw Catch up to -current.
 1.28.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.28.8.1 08-Jul-2001  nathanw file hdfd.c was added on branch nathanw_sa on 2002-01-08 00:23:37 +0000
 1.28.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.28.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.28.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.28.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.29.8.2 30-Aug-2002  gehenna catch up with -current.
 1.29.8.1 17-May-2002  gehenna Add device switch.
 1.39.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.39.2.5 17-Jan-2005  skrll Adapt to branch.
 1.39.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.39.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.39.2.1 03-Aug-2004  skrll Sync with HEAD
 1.45.2.5 21-Jan-2008  yamt sync with head
 1.45.2.4 27-Oct-2007  yamt sync with head.
 1.45.2.3 03-Sep-2007  yamt sync with head.
 1.45.2.2 26-Feb-2007  yamt sync with head.
 1.45.2.1 21-Jun-2006  yamt sync with head.
 1.48.6.1 22-Apr-2006  simonb Sync with head.
 1.48.4.1 09-Sep-2006  rpaulo sync with head
 1.48.2.1 01-Mar-2006  yamt sync with head.
 1.49.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.49.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.49.2.1 24-May-2006  yamt sync with head.
 1.50.8.1 01-Feb-2007  ad Sync with head.
 1.52.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.55.10.2 16-Oct-2007  garbled Sync with HEAD
 1.55.10.1 03-Oct-2007  garbled Sync with HEAD
 1.55.4.1 11-Jul-2007  mjf Sync with head.
 1.55.2.3 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.55.2.2 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.55.2.1 15-Jul-2007  ad Sync with head.
 1.56.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.56.2.1 07-Aug-2007  matt Sync with HEAD.
 1.57.8.1 14-Oct-2007  yamt sync with head.
 1.57.6.2 09-Jan-2008  matt sync with HEAD
 1.57.6.1 06-Nov-2007  matt sync with HEAD
 1.57.4.1 26-Oct-2007  joerg Sync with HEAD.

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

XXX This should be largely MI, please do not make another clone of disksubr.c.
 1.59.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.61.14.1 18-Jun-2008  simonb Sync with head.
 1.61.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.61.10.3 11-Aug-2010  yamt sync with head.
 1.61.10.2 18-Jul-2009  yamt sync with head.
 1.61.10.1 04-May-2009  yamt sync with head.
 1.61.8.1 17-Jun-2008  yamt sync with head.
 1.61.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.61.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.62.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.62.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.65.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.71.4.2 12-Jun-2011  rmind sync with head
 1.71.4.1 30-May-2010  rmind sync with head
 1.71.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.73.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.75.16.1 18-May-2014  rmind sync with head
 1.75.12.2 03-Dec-2017  jdolecek update from HEAD
 1.75.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.75.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.76.2.1 10-Aug-2014  tls Rebase.
 1.78.4.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.78.4.2 06-Jun-2015  skrll Sync with HEAD
 1.78.4.1 06-Apr-2015  skrll Sync with HEAD
 1.82.18.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.82.18.1 10-Jun-2019  christos Sync with HEAD
 1.82.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.86.8.1 03-Apr-2021  thorpej Sync with HEAD.
 1.87.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.88.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.11 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.10 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.9 20-Oct-2009  snj branches: 1.9.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.8 03-May-2003  wiz branches: 1.8.108;
DMA, not dma nor Dma.
 1.7 08-Sep-2001  thomas branches: 1.7.4;
ELF abaption.
 1.6 24-Mar-1999  mrg branches: 1.6.20; 1.6.22;
completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.5 12-May-1998  leo Forgotten with last UVM check-in.
 1.4 01-Jan-1997  leo The Hades floppy driver now uses intr_establish(). Also the interrupt
accounting is fixed (ie. counted as the right interrupt).
 1.3 18-Dec-1996  leo Tweak the clockframe structure a bit so we are able to save a few cycles
at interrupt time. (From Gordon Ross).
 1.2 14-Dec-1996  leo Merge the formatting code from the i386-port.
 1.1 09-Nov-1996  leo Hades floppy driver.
 1.6.22.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.6.20.1 01-Oct-2001  fvdl Catch up with -current.
 1.7.4.2 08-Sep-2001  thomas ELF abaption.
 1.7.4.1 08-Sep-2001  thomas file hdfd_intr.s was added on branch nathanw_sa on 2001-09-08 11:15:36 +0000
 1.8.108.1 11-Mar-2010  yamt sync with head
 1.9.4.1 05-Mar-2011  rmind sync with head
 1.8 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.7 30-Jun-2011  wiz dependant -> dependent
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 09-Apr-2003  thorpej branches: 1.4.2;
Use PAGE_SIZE rather than NBPG.
 1.3 22-Oct-1999  leo Limit the io-region mapped by this driver to the part actually used.
Otherwise, it conflicts with the wd-driver.
 1.2 14-Dec-1996  leo branches: 1.2.28; 1.2.30; 1.2.32;
Merge the formatting code from the i386-port.
 1.1 09-Nov-1996  leo Hades floppy driver.
 1.2.32.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.30.1 15-Nov-1999  fvdl Sync with -current
 1.2.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.2 06-Apr-2010  tsutsui branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Use callout_schedule(9) rather than callout_reset(9) on polling
as callout(9) man says.
 1.1 01-Apr-2010  tsutsui Add support for the EtherNEC.

The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.

See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
 1.2.8.2 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1367):
sys/dev/ic/ne2000var.h: revision 1.25
sys/arch/atari/conf/MILAN.in: revision 1.24
sys/arch/atari/conf/MILAN.in: revision 1.25
sys/dev/ic/ne2000.c: revision 1.71
sys/dev/ic/ne2000.c: revision 1.72
sys/arch/atari/dev/if_ne_mb.c: revision 1.1
sys/arch/atari/dev/if_ne_mb.c: revision 1.2
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.69
sys/arch/atari/conf/HADES.in: revision 1.10
sys/arch/atari/conf/HADES.in: revision 1.11
sys/arch/x68k/dev/if_ne_neptune.c: revision 1.20
sys/dev/isa/if_ne_isa.c: revision 1.27
sys/arch/atari/atari/autoconf.c: revision 1.57
sys/dev/ic/ne2000.c: revision 1.62
sys/dev/isapnp/if_ne_isapnp.c: revision 1.27
sys/arch/atari/conf/files.atari: revision 1.117
sys/arch/atari/conf/HADES: revision 1.88
sys/arch/atari/conf/GENERIC.in: revision 1.85
sys/dev/ic/ne2000.c: revision 1.65
sys/dev/ic/ne2000.c: revision 1.66
sys/dev/ic/ne2000.c: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.65
distrib/notes/atari/hardware: revision 1.24
sys/conf/files: revision 1.980
sys/dev/ic/ne2000var.h: revision 1.21
sys/arch/x68k/dev/if_ne_intio.c: revision 1.16
sys/dev/ic/dp8390.c: revision 1.74
sys/dev/ic/dp8390.c: revision 1.75
Added NE2000 with 8bit bus width support.
reviewd by tsutsui@ at tech-kern ML.
Fix a wrong calculation bug around RX ring buffer memory address
slipped in about sixteen years ago. Fortunately, it had been working
for ages because some devices used address zero and other devices
ignored wrong higher bits.
Tested on we(4) (SMC Elite Ultra) and ne(4) (NE2000 compatible
named UL0001) on ISA.
Note FreeBSD also uses the same correct value in their ed(4) driver.
Now dp8390_config() calculates mem_ring correctly so
no longer need to override it in ne2000_attach().
Use roundup2() in <sys/param.h> rather than a conditional.
Also fix a wrong mem_ring calculation in dp8390_ipkdb_attach().
Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.
* move RTL8019 probe and attach code from each bus attachment
to MI ne2000_detect() and ne2000_attach()
* change a method for backend and attachment to specify 8 bit mode
to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
* handle more NE2000 8 bit mode specific settings, including
bus_space(9) access width and available size of buffer memory
* add a function to detect NE2000 8 bit mode
(disabled by default, but enalbed by options NE2000_DETECT_8BIT
to avoid possible regression on various ISA clones)
* fix ipkdb attachment accordingly (untested)
Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.
See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
No need to override mem_ring value in ne2000_ipkdb_attach()
since a wrong calculation in dp8390_ipkdb_attach() was fixed.
Don't warn about DMA timeout during probe.
Add support for the EtherNEC.
The EtherNEC is yet another user designed device for Atari machines,
an NE2000 based ISA board connected to Atari's ROM cartridge slot with
simple but ingenious interface and cartridge port adapter, and
it's the most available network solution for the old Atari machines.
See following pages for more details about EtherNEC:
http://hardware.atari.org/ether/
http://home.arcor.de/thomas.redelberger/prj/atari/etherne/
http://www.freemint.org/ethernec/ethernec.html
Also note EtherNEC.
Use callout_schedule(9) rather than callout_reset(9) on polling
as callout(9) man says.
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
Regen from HADES.in rev 1.11 and MILAN.in rev 1.25:
Remove EtherNEC from HADES and MILAN.
They have ISA so no one will bother to connect ISA NE2000 via EtherNEC.
 1.2.8.1 06-Apr-2010  riz file if_ne_mb.c was added on branch netbsd-5 on 2010-11-20 00:33:46 +0000
 1.2.6.2 11-Aug-2010  yamt sync with head.
 1.2.6.1 06-Apr-2010  yamt file if_ne_mb.c was added on branch yamt-nfs-mp on 2010-08-11 22:51:45 +0000
 1.2.4.2 30-May-2010  rmind sync with head
 1.2.4.1 06-Apr-2010  rmind file if_ne_mb.c was added on branch rmind-uvmplock on 2010-05-30 05:16:39 +0000
 1.2.2.2 30-Apr-2010  uebayasi Sync with HEAD.
 1.2.2.1 06-Apr-2010  uebayasi file if_ne_mb.c was added on branch uebayasi-xip on 2010-04-30 14:39:11 +0000
 1.85 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.84 26-Jun-2022  tsutsui Use aprint_*(9) for device attach messages.
 1.83 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.82 25-Jun-2022  tsutsui Add a minimum DEC special graphics character support for atari ite(4).

This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).

Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).
Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.
Discussed on port-atari@ etc.
 1.81 28-May-2022  andvar fix various typos, mainly in comments.
 1.80 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.79 29-Jun-2019  tsutsui branches: 1.79.2; 1.79.10;
Make local functions static.
 1.78 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.77 29-Feb-2016  christos branches: 1.77.16; 1.77.18;
PR/50868: David Binderman: Fix operator precedence.
 1.76 25-Jul-2014  dholland branches: 1.76.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.75 26-Mar-2014  christos branches: 1.75.2;
kill sprintf
 1.74 24-Mar-2014  christos - remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.73 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.72 19-Feb-2014  tsutsui Fix kernel crash when a user tries to switch to nonexistent terminal.

Reported by Gabor Sebestyen in PR port-atari/48599.

Should be pulled up to all netbsd-6 branches.
 1.71 05-Jun-2011  tsutsui branches: 1.71.2; 1.71.8; 1.71.12; 1.71.14; 1.71.16; 1.71.22;
Split device_t/softc. Also rename some softc variables. Tested on TT030.

XXX: old ugly config_console() hack should go away...
 1.70 24-Apr-2011  rmind branches: 1.70.2;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.69 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.68 13-Apr-2010  tsutsui branches: 1.68.2; 1.68.4;
Misc KNF.
 1.67 13-Apr-2010  tsutsui Include "ioconf.h" to declare struct cfdriver foo_cd.
 1.66 19-Jul-2009  tsutsui branches: 1.66.2; 1.66.4;
Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.65 18-Mar-2009  cegger bcopy -> memcpy
 1.64 18-Mar-2009  cegger bzero -> memset
 1.63 18-Mar-2009  cegger bcmp -> memcmp
 1.62 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.61 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.60 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.59 11-Jun-2008  tsutsui branches: 1.59.4; 1.59.10;
Use device_private() and device_lookup_privat() to get softc.
 1.58 19-Nov-2007  ad branches: 1.58.14; 1.58.16; 1.58.18; 1.58.20; 1.58.22;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.57 18-Oct-2007  joerg branches: 1.57.2;
Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
 1.56 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.55 09-Jul-2007  ad branches: 1.55.8; 1.55.10; 1.55.14;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.54 04-Mar-2007  christos branches: 1.54.2; 1.54.4; 1.54.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.53 01-Oct-2006  elad branches: 1.53.4;
Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.52 23-Jul-2006  ad branches: 1.52.4; 1.52.6;
Use the LWP cached credentials where sane.
 1.51 14-May-2006  elad integrate kauth.
 1.50 26-Mar-2006  thorpej Use device_unit().
 1.49 24-Dec-2005  perry branches: 1.49.4; 1.49.6; 1.49.8; 1.49.10; 1.49.12;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.48 11-Dec-2005  christos merge ktrace-lwp.
 1.47 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.46 04-Jun-2005  he branches: 1.46.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.45 02-Mar-2005  chs getitesp() can return NULL, so check for that in iteopen().
pointed out by Michael Hitch.
 1.44 23-Jan-2005  he branches: 1.44.2;
Adapt to the change in type of ite_on() -- don't pretend that it returns
a value anymore (return type is now void).
 1.43 19-Jan-2005  chs use a flag in the softc to indicate if an instance has been configured,
rather than a bit in 32-bit global variable indexed by unit number.
 1.42 01-Nov-2003  jdolecek branches: 1.42.8;
g/c local index() routine and switch to (libkern's) strchr()
 1.41 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.40 15-Jul-2003  lukem __KERNEL_RCSID()
 1.39 23-Oct-2002  jdolecek branches: 1.39.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.38 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 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.35 17-Mar-2002  atatat branches: 1.35.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.34 09-Jul-2001  leo branches: 1.34.2; 1.34.4; 1.34.8;
Nuke some cf_unit abuses.
 1.33 02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.32 01-Feb-2001  leo branches: 1.32.2;
Fix fallout from lastest tty changes.
 1.31 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.30 28-Sep-2000  leo Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).
 1.29 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.28 11-Feb-2000  leo Move the ite_default_* variables to ite.c. They are generic ite.
 1.27 19-Jan-2000  leo No longer abuse cf_unit. This broke with the latest autoconf changes.
 1.26 04-Jul-1998  jonathan branches: 1.26.14;
defopt DDB.
 1.25 25-Mar-1998  leo Sync with latest tty changes.
 1.24 12-Jan-1998  thorpej Update for changes to config.
 1.23 29-Jun-1997  leo Add code to set pitch and duration of the keyboard bell. (Thomas Gerner).
 1.22 10-Jan-1997  leo Handle keyboard modifiers *before* handing the keycodes to either the
console driver or the DDB keyboard functions. This prevents annoyances
with out of sync modifier stati.
 1.21 08-Jan-1997  leo Don't try to init the keyboard interrupts in cngetc(). This caused the
keyboard to hang when booting directly into the debugger.
 1.20 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.19 13-Oct-1996  christos backout previous kprintf changes
 1.18 11-Oct-1996  leo Remove grf_ite_ioctl(). Replace it by 'itexx_ioctl' that is configurable
per ite-type.
 1.17 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.16 25-Sep-1996  leo The KDASSERT macro is now defined in libkern
 1.15 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.14 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.13 18-Jun-1996  leo Add tty_attach() calls.
 1.12 18-Apr-1996  leo branches: 1.12.4;
Yet more prototyping and -Wall fixes.
 1.11 20-Mar-1996  leo Another bit of prototyping...
 1.10 19-Mar-1996  leo Debugger() prototype is in systm.h, don't define Debugger() here.
 1.9 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.8 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.7 04-Sep-1995  leo Allow chars > 0x7f to be displayed on the ite's
 1.6 24-Jul-1995  leo Change and fix the way of keyboard mapping. Each virtual console has it's
own private keymap, initialized on open from the system-keymap. Both
system and private keymaps are settable.
 1.5 21-May-1995  leo Minor fixes.
 1.4 22-Apr-1995  leo Adapt for new conf.h:
- Add xxxtty() functions
- Remove xxx_tty array
 1.3 10-Apr-1995  mycroft Add dummy itestop(), and rename a few functions.
 1.2 28-Mar-1995  leo Make ite ioctl work and fixup the colormap stuff.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.12.4.1 18-Jun-1996  leo Pull up tty_attach() changes from trunk.
 1.26.14.3 11-Feb-2001  bouyer Sync with HEAD.
 1.26.14.2 22-Nov-2000  bouyer Sync with HEAD.
 1.26.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.32.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.34.8.5 11-Nov-2002  nathanw Catch up to -current
 1.34.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.34.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.34.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.34.8.1 09-Jul-2001  nathanw file ite.c was added on branch nathanw_sa on 2002-04-01 07:39:32 +0000
 1.34.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.34.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.34.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.34.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.39.6.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.39.6.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.39.6.5 24-Jan-2005  skrll Sync with HEAD.
 1.39.6.4 17-Jan-2005  skrll Adapt to branch.
 1.39.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.39.6.1 03-Aug-2004  skrll Sync with HEAD
 1.42.8.1 29-Apr-2005  kent sync with -current
 1.44.2.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.46.2.5 07-Dec-2007  yamt sync with head
 1.46.2.4 27-Oct-2007  yamt sync with head.
 1.46.2.3 03-Sep-2007  yamt sync with head.
 1.46.2.2 30-Dec-2006  yamt sync with head.
 1.46.2.1 21-Jun-2006  yamt sync with head.
 1.49.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.49.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.49.10.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.49.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.49.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.49.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.49.8.3 11-Aug-2006  yamt sync with head
 1.49.8.2 24-May-2006  yamt sync with head.
 1.49.8.1 01-Apr-2006  yamt sync with head.
 1.49.6.2 01-Jun-2006  kardel Sync with head.
 1.49.6.1 22-Apr-2006  simonb Sync with head.
 1.49.4.1 09-Sep-2006  rpaulo sync with head
 1.52.6.1 22-Oct-2006  yamt sync with head
 1.52.4.1 18-Nov-2006  ad Sync with head.
 1.53.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.54.10.1 03-Oct-2007  garbled Sync with HEAD
 1.54.4.1 11-Jul-2007  mjf Sync with head.
 1.54.2.3 03-Dec-2007  ad Sync with HEAD.
 1.54.2.2 23-Oct-2007  ad Sync with head.
 1.54.2.1 15-Jul-2007  ad Sync with head.
 1.55.14.2 21-Nov-2007  bouyer Sync with HEAD
 1.55.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.55.10.2 09-Jan-2008  matt sync with HEAD
 1.55.10.1 06-Nov-2007  matt sync with HEAD
 1.55.8.2 21-Nov-2007  joerg Sync with HEAD.
 1.55.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.57.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.58.22.1 18-Jun-2008  simonb Sync with head.
 1.58.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.58.18.3 11-Aug-2010  yamt sync with head.
 1.58.18.2 19-Aug-2009  yamt sync with head.
 1.58.18.1 04-May-2009  yamt sync with head.
 1.58.16.1 17-Jun-2008  yamt sync with head.
 1.58.14.1 29-Jun-2008  mjf Sync with HEAD.
 1.59.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.59.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.66.4.4 12-Jun-2011  rmind sync with head
 1.66.4.3 31-May-2011  rmind sync with head
 1.66.4.2 05-Mar-2011  rmind sync with head
 1.66.4.1 30-May-2010  rmind sync with head
 1.66.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.68.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.68.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.70.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.71.22.1 21-Feb-2014  sborrill Pull up the following revisions(s) (requested by tsutsui in ticket #1033):
sys/arch/atari/dev/ite.c: revision 1.72

Fix kernel crash when a user tries to switch to nonexistent terminal.
Fixes PR/48599.
 1.71.16.1 18-May-2014  rmind sync with head
 1.71.14.1 21-Feb-2014  sborrill Pull up the following revisions(s) (requested by tsutsui in ticket #1033):
sys/arch/atari/dev/ite.c: revision 1.72

Fix kernel crash when a user tries to switch to nonexistent terminal.
Fixes PR/48599.
 1.71.12.2 03-Dec-2017  jdolecek update from HEAD
 1.71.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.71.8.1 21-Feb-2014  sborrill Pull up the following revisions(s) (requested by tsutsui in ticket #1033):
sys/arch/atari/dev/ite.c: revision 1.72

Fix kernel crash when a user tries to switch to nonexistent terminal.
Fixes PR/48599.
 1.71.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.75.2.1 10-Aug-2014  tls Rebase.
 1.76.4.1 19-Mar-2016  skrll Sync with HEAD
 1.77.18.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.77.18.1 10-Jun-2019  christos Sync with HEAD
 1.77.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.79.10.1 03-Apr-2021  thorpej Sync with HEAD.
 1.79.2.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1518):

sys/arch/atari/dev/ite.c: revision 1.82
sys/arch/atari/dev/ite_cc.c: revision 1.45
sys/arch/atari/dev/ite_et.c: revision 1.36
sys/arch/atari/dev/itevar.h: revision 1.15

Add a minimum DEC special graphics character support for atari ite(4).

This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).

Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).

Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.

Discussed on port-atari@ etc.
 1.47 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.46 26-Jun-2022  tsutsui Use aprint_*(9) for device attach messages.
 1.45 25-Jun-2022  tsutsui Add a minimum DEC special graphics character support for atari ite(4).

This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).

Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).
Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.
Discussed on port-atari@ etc.
 1.44 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.43 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42 27-Apr-2021  thorpej branches: 1.42.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.41 24-Apr-2021  thorpej branches: 1.41.2;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.40 29-Jun-2019  tsutsui branches: 1.40.2; 1.40.12;
Make local functions static.
 1.39 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.38 27-Oct-2012  chs branches: 1.38.36; 1.38.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.37 05-Jun-2011  tsutsui branches: 1.37.2; 1.37.12;
Split device_t/softc. Also rename some softc variables. Tested on TT030.

XXX: old ugly config_console() hack should go away...
 1.36 13-Apr-2010  tsutsui branches: 1.36.2; 1.36.6;
Misc KNF.
 1.35 09-Feb-2010  wiz branches: 1.35.2;
Fix typo in comment.
 1.34 19-Jul-2009  tsutsui branches: 1.34.2;
Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.33 18-Mar-2009  cegger bcopy -> memcpy
 1.32 18-Mar-2009  cegger bzero -> memset
 1.31 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.30 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.29 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.28 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.27 04-Mar-2007  christos branches: 1.27.44; 1.27.52; 1.27.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 26-Mar-2006  thorpej branches: 1.26.14;
Use device_unit().
 1.25 24-Dec-2005  perry branches: 1.25.4; 1.25.6; 1.25.8; 1.25.10; 1.25.12;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.24 24-Dec-2005  perry bare asm -> __asm
 1.23 11-Dec-2005  christos merge ktrace-lwp.
 1.22 15-Jul-2003  lukem branches: 1.22.16;
__KERNEL_RCSID()
 1.21 01-Jan-2003  thorpej branches: 1.21.2;
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 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.17 17-Mar-2002  atatat branches: 1.17.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.16 10-Jul-2001  leo branches: 1.16.6;
Nuke another cf_unit abuse.
 1.15 11-Feb-2000  leo branches: 1.15.8;
Move the ite_default_* variables to ite.c. They are generic ite.
 1.14 12-Jan-1998  thorpej branches: 1.14.14;
Update for changes to config.
 1.13 15-Jul-1997  leo Garbage collect bell-ioctl's.
 1.12 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.11 13-Oct-1996  christos backout previous kprintf changes
 1.10 11-Oct-1996  leo Remove grf_ite_ioctl(). Replace it by 'itexx_ioctl' that is configurable
per ite-type.
 1.9 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.8 04-Oct-1996  leo Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.7 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.6 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.5 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.4 28-May-1995  leo Remove the pointer to view_t from the grf-structure, use viewview(dev)
to obtain the pointer instead. This removes a kernel-crash that happened
when something was written to the console while the console was being
resized.
 1.3 21-May-1995  leo Fix UL-handling
 1.2 28-Mar-1995  leo Make ite ioctl work and fixup the colormap stuff.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.14.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.15.8.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.15.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.8.1 03-Aug-2001  lukem update to -current
 1.16.6.5 03-Jan-2003  thorpej Sync with HEAD.
 1.16.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.16.6.3 17-Sep-2002  nathanw Catch up to -current.
 1.16.6.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.16.6.1 10-Jul-2001  nathanw file ite_cc.c was added on branch nathanw_sa on 2002-04-01 07:39:32 +0000
 1.17.4.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.21.2.4 17-Jan-2005  skrll Adapt to branch.
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Aug-2004  skrll Sync with HEAD
 1.22.16.2 03-Sep-2007  yamt sync with head.
 1.22.16.1 21-Jun-2006  yamt sync with head.
 1.25.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.25.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.25.8.1 01-Apr-2006  yamt sync with head.
 1.25.6.1 22-Apr-2006  simonb Sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.26.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.27.44.4 11-Aug-2010  yamt sync with head.
 1.27.44.3 11-Mar-2010  yamt sync with head
 1.27.44.2 19-Aug-2009  yamt sync with head.
 1.27.44.1 04-May-2009  yamt sync with head.
 1.34.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.35.2.2 12-Jun-2011  rmind sync with head
 1.35.2.1 30-May-2010  rmind sync with head
 1.36.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.36.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.37.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.37.2.1 30-Oct-2012  yamt sync with head
 1.38.38.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.38.38.1 10-Jun-2019  christos Sync with HEAD
 1.38.36.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.40.12.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.40.2.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1518):

sys/arch/atari/dev/ite.c: revision 1.82
sys/arch/atari/dev/ite_cc.c: revision 1.45
sys/arch/atari/dev/ite_et.c: revision 1.36
sys/arch/atari/dev/itevar.h: revision 1.15

Add a minimum DEC special graphics character support for atari ite(4).

This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).

Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).

Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.

Discussed on port-atari@ etc.
 1.41.2.1 13-May-2021  thorpej Sync with HEAD.
 1.42.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.38 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.37 26-Jun-2022  tsutsui Use aprint_*(9) for device attach messages.
 1.36 25-Jun-2022  tsutsui Add a minimum DEC special graphics character support for atari ite(4).

This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).

Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).
Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.
Discussed on port-atari@ etc.
 1.35 28-Mar-2022  riastradh sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers
 1.34 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.33 27-Apr-2021  thorpej branches: 1.33.6;
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.
 1.32 24-Apr-2021  thorpej branches: 1.32.2;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.31 29-Jun-2019  tsutsui branches: 1.31.2; 1.31.12;
Make local functions static.
 1.30 05-Jun-2011  tsutsui branches: 1.30.54;
Split device_t/softc. Also rename some softc variables. Tested on TT030.

XXX: old ugly config_console() hack should go away...
 1.29 13-Apr-2010  tsutsui branches: 1.29.2; 1.29.6;
Misc KNF.
 1.28 09-Feb-2010  wiz branches: 1.28.2;
Fix typo in comment.
 1.27 20-Oct-2009  snj branches: 1.27.2;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.26 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.25 18-Mar-2009  cegger bcopy -> memcpy
 1.24 18-Mar-2009  cegger bzero -> memset
 1.23 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.22 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.21 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.20 04-Mar-2007  christos branches: 1.20.44; 1.20.52; 1.20.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 26-Mar-2006  thorpej branches: 1.19.14;
Use device_unit().
 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 15-Jul-2003  lukem branches: 1.17.16;
__KERNEL_RCSID()
 1.16 01-Jan-2003  thorpej branches: 1.16.2;
Use aprint_normal() for cfprint routines.
 1.15 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.12 17-Mar-2002  atatat branches: 1.12.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.11 09-Jul-2001  leo branches: 1.11.2; 1.11.8;
Nuke some cf_unit abuses.
 1.10 29-Mar-2000  leo Nuke a bunch of cf_unit abuses.
 1.9 11-Feb-2000  leo Move the ite_default_* variables to ite.c. They are generic ite.
 1.8 12-Jan-1998  thorpej branches: 1.8.14;
Update for changes to config.
 1.7 15-Jul-1997  leo Garbage collect bell-ioctl's.
 1.6 09-Jul-1997  leo Make sure the card is probed once.
 1.5 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.4 13-Oct-1996  christos backout previous kprintf changes
 1.3 11-Oct-1996  leo *** empty log message ***
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 04-Oct-1996  leo Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.8.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.11.8.5 03-Jan-2003  thorpej Sync with HEAD.
 1.11.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.11.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.11.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.11.8.1 09-Jul-2001  nathanw file ite_et.c was added on branch nathanw_sa on 2002-04-01 07:39:32 +0000
 1.11.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.4.1 19-May-2002  gehenna Replace the access to devsw table and the hard-coded majors with devsw API.
 1.16.2.4 17-Jan-2005  skrll Adapt to 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.17.16.2 03-Sep-2007  yamt sync with head.
 1.17.16.1 21-Jun-2006  yamt sync with head.
 1.18.12.1 28-Mar-2006  tron Merge 2006-03-28 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 01-Apr-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.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.20.44.4 11-Aug-2010  yamt sync with head.
 1.20.44.3 11-Mar-2010  yamt sync with head
 1.20.44.2 19-Aug-2009  yamt sync with head.
 1.20.44.1 04-May-2009  yamt sync with head.
 1.27.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.28.2.2 12-Jun-2011  rmind sync with head
 1.28.2.1 30-May-2010  rmind sync with head
 1.29.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.29.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.30.54.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.31.12.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.31.2.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1518):

sys/arch/atari/dev/ite.c: revision 1.82
sys/arch/atari/dev/ite_cc.c: revision 1.45
sys/arch/atari/dev/ite_et.c: revision 1.36
sys/arch/atari/dev/itevar.h: revision 1.15

Add a minimum DEC special graphics character support for atari ite(4).

This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).

Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).

Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.

Discussed on port-atari@ etc.
 1.32.2.1 13-May-2021  thorpej Sync with HEAD.
 1.33.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.9 01-Nov-2021  andvar fix typos, mainly in words minimum and maximum, but also few others.
 1.8 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.7 08-Feb-2011  rmind branches: 1.7.14; 1.7.32;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.6 11-Dec-2005  christos branches: 1.6.100; 1.6.106; 1.6.108;
merge ktrace-lwp.
 1.5 19-May-2004  he Include <machine/kbdmap.h> only outside the kernel, as that file
isn't present in that location in the source tree.
 1.4 18-May-2004  he Add some mulitple include protection.
Include kbdmap.h from iteioctl.h so that kdump compiles, otherwise
the size of struct kbdmap as used in various ioctl defines is unknown.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 24-Jul-1995  leo branches: 1.2.66;
Change and fix the way of keyboard mapping. Each virtual console has it's
own private keymap, initialized on open from the system-keymap. Both
system and private keymaps are settable.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.66.1 03-Aug-2004  skrll Sync with HEAD
 1.6.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.6.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.100.1 05-Mar-2011  rmind sync with head
 1.7.32.1 22-Sep-2015  skrll Sync with HEAD
 1.7.14.1 03-Dec-2017  jdolecek update from HEAD
 1.16 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.15 25-Jun-2022  tsutsui Add a minimum DEC special graphics character support for atari ite(4).

This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).

Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).
Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.
Discussed on port-atari@ etc.
 1.14 05-Jun-2011  tsutsui branches: 1.14.58;
Split device_t/softc. Also rename some softc variables. Tested on TT030.

XXX: old ugly config_console() hack should go away...
 1.13 14-Mar-2009  dsl branches: 1.13.4; 1.13.6; 1.13.10;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.12 04-Mar-2007  christos branches: 1.12.44; 1.12.52; 1.12.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 11-Dec-2005  christos branches: 1.11.26;
merge ktrace-lwp.
 1.10 19-Jan-2005  chs branches: 1.10.8;
use a flag in the softc to indicate if an instance has been configured,
rather than a bit in 32-bit global variable indexed by unit number.
 1.9 06-Sep-2002  gehenna branches: 1.9.6; 1.9.14;
Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.8 30-May-2001  leo branches: 1.8.2; 1.8.8; 1.8.16;
Add itepoll() prototype as suggested by 'maximum entropy' (pr#13047).
 1.7 27-Mar-2000  leo branches: 1.7.6;
This file was forgotten in the commit with log message:
Move the ite_default_* variables to ite.c. They are generic ite.
 1.6 11-Oct-1996  leo branches: 1.6.28;
Remove grf_ite_ioctl(). Replace it by 'itexx_ioctl' that is configurable
per ite-type.
 1.5 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.4 20-Mar-1996  leo And more proto's.....
 1.3 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.2 25-Jul-1995  leo A forgotten file for the kbdmap fixes.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.6.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.16.1 19-May-2002  gehenna Remove unnecessary prototype.
 1.8.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.8.8.1 30-May-2001  nathanw file itevar.h was added on branch nathanw_sa on 2002-09-17 21:13:46 +0000
 1.8.2.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.14.1 29-Apr-2005  kent sync with -current
 1.9.6.2 24-Jan-2005  skrll Sync with HEAD.
 1.9.6.1 17-Jan-2005  skrll Adapt to branch.
 1.10.8.2 03-Sep-2007  yamt sync with head.
 1.10.8.1 21-Jun-2006  yamt sync with head.
 1.11.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.12.44.1 04-May-2009  yamt sync with head.
 1.13.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 12-Jun-2011  rmind sync with head
 1.14.58.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1518):

sys/arch/atari/dev/ite.c: revision 1.82
sys/arch/atari/dev/ite_cc.c: revision 1.45
sys/arch/atari/dev/ite_et.c: revision 1.36
sys/arch/atari/dev/itevar.h: revision 1.15

Add a minimum DEC special graphics character support for atari ite(4).

This closes PR port-atari/46647 (Menu borders in sysinst appear as
characters with diacritical marks instead of graphics characters).

Switching encoding support by "ESC ( <F>" sequence for vt220 was
pulled from x68k ite(4) (that already supports ISO-2022-JP and EUC-JP).

Note atari's fonts already include DEC special graphics characters.
ET4000 on Hades is untested due to long-term lack of hardware.

Discussed on port-atari@ etc.
 1.59 08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.58 26-Jun-2023  andvar branches: 1.58.6;
s/privious/previous/ in comment.
 1.57 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.56 26-Jun-2022  martin gcc is not smart enough to track the equivalence of conditions used
here and warns about an unused value - initialize "code" always.
 1.55 26-Jun-2022  tsutsui Restore redundant register accesses as the original implementation did.

It looks my refactored one for entropy sometimes returns unexpected
values and they cause "kbd: Unknown packet 0xfd" errors and missing
keyboard release events.
 1.54 25-Jun-2022  tsutsui Add rnd(9) entropy source from keyboard and mouse.
 1.53 25-Jun-2022  tsutsui Use aprint_*(9) for device attach messages.
 1.52 25-Jun-2022  tsutsui Rename and reformat softc stuff for readablity, and misc more cleanups.

No binary change.
 1.51 25-Jun-2022  tsutsui Move declarations to proper places.
 1.50 25-Jun-2022  tsutsui Misc cleanup. No functional changes, no regression on TT030.

- KNF and TAB/space
- make local functions static
- avoid unnesessary __USE()
- use proper integer types
- remove a register keyword
 1.49 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.48 24-Apr-2021  thorpej branches: 1.48.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.47 08-Feb-2018  dholland branches: 1.47.18;
Typos.
 1.46 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.45 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.44 24-Mar-2014  christos branches: 1.44.2;
- remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.43 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.42 05-Jun-2011  tsutsui branches: 1.42.2; 1.42.12; 1.42.16;
- use CFATTACH_DECL_NEW() (no softc)
- use device_t, cfdata_t etc.
 1.41 13-Apr-2010  tsutsui branches: 1.41.2; 1.41.6;
Misc KNF.
 1.40 25-Nov-2009  abs branches: 1.40.2; 1.40.4;
Fix a missed proc -> lwp change, only compiled if NWSKBD
 1.39 03-Jul-2009  tsutsui Replace one traditional MD si_callback() with MI softint(9).
 1.38 03-Jul-2009  tsutsui Use more uint8_t, and constify.
 1.37 03-Jul-2009  tsutsui KNF, use uint8_t, and misc cosmetics.
 1.36 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.35 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.34 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.33 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.32 17-Jan-2009  tsutsui branches: 1.32.2;
Use firm_gettime() to retain compatibility with old firm_event. From amiga.
 1.31 08-Jan-2008  joerg branches: 1.31.6; 1.31.10; 1.31.18;
Convert Atari to generic TODR and timecounter.
 1.30 04-Mar-2007  christos branches: 1.30.20; 1.30.26; 1.30.32;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.29 11-Dec-2005  christos branches: 1.29.26;
merge ktrace-lwp.
 1.28 25-Mar-2004  leo branches: 1.28.16;
Licence cleanup (suggested by wiz).
 1.27 21-Sep-2003  jdolecek cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
the owner of descriptor, according to appropriate sematics
of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
 1.26 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.25 15-Jul-2003  lukem __KERNEL_RCSID()
 1.24 04-Feb-2003  leo branches: 1.24.2;
NUL -> NULL.
 1.23 02-Feb-2003  thomas WS keyboard support for atari native keyboards.
 1.22 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.21 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.20 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.19 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.18 06-Aug-1999  leo branches: 1.18.14; 1.18.16; 1.18.20; 1.18.28;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.17 12-Jan-1998  thorpej Update for changes to config.
 1.16 29-Jun-1997  leo Add code to set pitch and duration of the keyboard bell. (Thomas Gerner).
 1.15 10-Jan-1997  leo Handle keyboard modifiers *before* handing the keycodes to either the
console driver or the DDB keyboard functions. This prevents annoyances
with out of sync modifier stati.
 1.14 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.13 16-Oct-1996  leo select -> poll
 1.12 13-Oct-1996  christos backout previous kprintf changes
 1.11 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.10 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.9 12-Apr-1996  leo Add 3-button mouse support.
 1.8 27-Mar-1996  leo Small nits because of changes in ym2149 handling.
 1.7 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.6 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.5 26-Jun-1995  leo Fix thinko. It will now also work when no mouse is configured.
 1.4 25-Jun-1995  leo Mouse driver added.
 1.3 09-Jun-1995  leo Handle mouse and other packages received from the keyboard correctly.
The initialisation now resets the keyboard and disables all packages
that make no sense because their drivers are not activated.
 1.2 10-Apr-1995  mycroft Nuke kbdwrite().
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.18.28.1 17-May-2002  gehenna Add device switch.
 1.18.20.3 11-Nov-2002  nathanw Catch up to -current
 1.18.20.2 18-Oct-2002  nathanw Catch up to -current.
 1.18.20.1 17-Sep-2002  nathanw Catch up to -current.
 1.18.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.18.16.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.18.14.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.24.2.4 17-Jan-2005  skrll Adapt to branch.
 1.24.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.24.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.16.3 21-Jan-2008  yamt sync with head
 1.28.16.2 03-Sep-2007  yamt sync with head.
 1.28.16.1 21-Jun-2006  yamt sync with head.
 1.29.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.32.1 08-Jan-2008  bouyer Sync with HEAD
 1.30.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.30.20.1 23-Mar-2008  matt sync with HEAD
 1.31.18.2 28-Apr-2009  skrll Sync with HEAD.
 1.31.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.31.10.4 11-Aug-2010  yamt sync with head.
 1.31.10.3 11-Mar-2010  yamt sync with head
 1.31.10.2 18-Jul-2009  yamt sync with head.
 1.31.10.1 04-May-2009  yamt sync with head.
 1.31.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.32.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.40.4.2 12-Jun-2011  rmind sync with head
 1.40.4.1 30-May-2010  rmind sync with head
 1.40.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.41.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.41.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.42.16.1 18-May-2014  rmind sync with head
 1.42.12.2 03-Dec-2017  jdolecek update from HEAD
 1.42.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.42.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.44.2.1 10-Aug-2014  tls Rebase.
 1.47.18.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.48.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.58.6.1 02-Aug-2025  perseant Sync with HEAD
 1.7 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.6 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.5 11-Dec-2005  christos branches: 1.5.78;
merge ktrace-lwp.
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 15-May-1996  leo branches: 1.3.64;
Prototype + -Wall fixes.
 1.2 24-Jul-1995  leo Change and fix the way of keyboard mapping. Each virtual console has it's
own private keymap, initialized on open from the system-keymap. Both
system and private keymaps are settable.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.64.1 03-Aug-2004  skrll Sync with HEAD
 1.5.78.1 11-Mar-2010  yamt sync with head
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 18-May-2004  he Add some mulitple include protection.
Include kbdmap.h from iteioctl.h so that kdump compiles, otherwise
the size of struct kbdmap as used in various ioctl defines is unknown.
 1.4 10-Jan-1997  leo branches: 1.4.62;
Handle keyboard modifiers *before* handing the keycodes to either the
console driver or the DDB keyboard functions. This prevents annoyances
with out of sync modifier stati.
 1.3 24-Jul-1995  leo Change and fix the way of keyboard mapping. Each virtual console has it's
own private keymap, initialized on open from the system-keymap. Both
system and private keymaps are settable.
 1.2 30-Mar-1995  leo KERNEL -> _KERNEL
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.4.62.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.62.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.62.1 03-Aug-2004  skrll Sync with HEAD
 1.6 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.5 11-Dec-2005  christos branches: 1.5.122; 1.5.142;
merge ktrace-lwp.
 1.4 18-May-2004  he Add some mulitple include protection.
Include kbdmap.h from iteioctl.h so that kdump compiles, otherwise
the size of struct kbdmap as used in various ioctl defines is unknown.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 29-Jun-1997  leo branches: 1.2.56;
Add code to set pitch and duration of the keyboard bell. (Thomas Gerner).
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.56.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.56.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.56.1 03-Aug-2004  skrll Sync with HEAD
 1.5.142.1 22-Sep-2015  skrll Sync with HEAD
 1.5.122.1 03-Dec-2017  jdolecek update from HEAD
 1.11 25-Jun-2022  tsutsui Move declarations to proper places.
 1.10 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.9 20-Oct-2009  snj branches: 1.9.12; 1.9.22;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.8 03-Jul-2009  tsutsui Replace one traditional MD si_callback() with MI softint(9).
 1.7 03-Jul-2009  tsutsui Use more uint8_t, and constify.
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 02-Feb-2003  thomas branches: 1.5.108; 1.5.116; 1.5.122;
WS keyboard support for atari native keyboards.
 1.4 31-Aug-2001  simonb branches: 1.4.6;
Use comments around the token after a #endif.
 1.3 29-Jun-1997  leo branches: 1.3.36;
Add code to set pitch and duration of the keyboard bell. (Thomas Gerner).
 1.2 12-Jan-1997  leo This should have been part of the keyboard-modifier changes.
 1.1 12-Apr-1996  leo Part of restructuring done for 3-button mouse support.
 1.3.36.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.6.2 31-Aug-2001  simonb Use comments around the token after a #endif.
 1.4.6.1 31-Aug-2001  simonb file kbdvar.h was added on branch nathanw_sa on 2001-08-31 04:44:57 +0000
 1.5.122.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.116.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.108.3 11-Mar-2010  yamt sync with head
 1.5.108.2 18-Jul-2009  yamt sync with head.
 1.5.108.1 04-May-2009  yamt sync with head.
 1.9.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.12.1 30-Oct-2012  yamt sync with head
 1.40 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.39 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.38 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.37 25-Jul-2014  dholland branches: 1.37.26; 1.37.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.36 16-Mar-2014  dholland branches: 1.36.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.35 27-Oct-2012  chs branches: 1.35.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.34 13-Apr-2010  tsutsui branches: 1.34.8; 1.34.18;
Include "ioconf.h" to declare struct cfdriver foo_cd.
 1.33 12-Apr-2010  tsutsui Replace old MD sicallback functions with MI softint(9).
 1.32 23-Nov-2009  rmind branches: 1.32.2; 1.32.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.31 08-Jul-2009  tsutsui Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.30 13-Jun-2008  cegger use device_lookup_private to get softc
 1.29 07-Mar-2008  cube branches: 1.29.2; 1.29.4; 1.29.6; 1.29.8;
Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
 1.28 17-Oct-2007  garbled branches: 1.28.12; 1.28.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.27 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.26 09-Jul-2007  ad branches: 1.26.8; 1.26.10; 1.26.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.25 04-Mar-2007  christos branches: 1.25.2; 1.25.4; 1.25.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.24 11-Dec-2005  christos branches: 1.24.26;
merge ktrace-lwp.
 1.23 15-Jul-2003  lukem branches: 1.23.16;
__KERNEL_RCSID()
 1.22 23-Oct-2002  jdolecek branches: 1.22.6;
merge kqueue branch into -current

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

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

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

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.18 16-Jan-2001  thomas branches: 1.18.4; 1.18.8; 1.18.16;
Let lpmatch recognice the printer.
 1.17 29-Mar-2000  leo Nuke a bunch of cf_unit abuses.
 1.16 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.15 06-Apr-1999  pk branches: 1.15.2; 1.15.8;
Move advertisement text into a comment of its own.
 1.14 15-Aug-1998  mycroft branches: 1.14.6;
Make copyright notices with my name consistent.
 1.13 15-Jan-1998  leo Make this compile again after the latest config changes.
 1.12 12-Jan-1998  thorpej Update for changes to config.
 1.11 30-Jul-1997  leo Rename lpt to lp on some places to avoid botches between files.isa and
files.atari.
 1.10 26-Dec-1996  leo branches: 1.10.10;
Add intr_establish/disestablish functions. Currently only the lpt-driver
is converted to use them...
 1.9 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.8 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.7 17-Nov-1996  leo Plug some spl-holes in the lp-driver. Also be more strict in protecting
the register access to the psg-chip. The combination of those bugs
caused the printer to print garbage sometimes.
 1.6 13-Oct-1996  christos backout previous kprintf changes
 1.5 11-Oct-1996  leo - Fix configuration name of 'lpt'
- add 'pcibus' as a mainbus device.
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 14-May-1996  leo Remove a line of debugging code.
 1.2 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.1 27-Mar-1996  leo Add centronics printer driver.
 1.10.10.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.6.1 07-Apr-1999  pk branches: 1.14.6.1.2;
Pull up from trunk: copyright text warts.
 1.14.6.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.15.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.15.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.15.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.16.1 17-May-2002  gehenna Add device switch.
 1.18.8.3 11-Nov-2002  nathanw Catch up to -current
 1.18.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.18.8.1 17-Sep-2002  nathanw Catch up to -current.
 1.18.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.22.6.4 17-Jan-2005  skrll Adapt to branch.
 1.22.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.6.1 03-Aug-2004  skrll Sync with HEAD
 1.23.16.4 17-Mar-2008  yamt sync with head.
 1.23.16.3 27-Oct-2007  yamt sync with head.
 1.23.16.2 03-Sep-2007  yamt sync with head.
 1.23.16.1 21-Jun-2006  yamt sync with head.
 1.24.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.25.10.2 16-Oct-2007  garbled Sync with HEAD
 1.25.10.1 03-Oct-2007  garbled Sync with HEAD
 1.25.4.1 11-Jul-2007  mjf Sync with head.
 1.25.2.2 09-Oct-2007  ad Sync with head.
 1.25.2.1 15-Jul-2007  ad Sync with head.
 1.26.12.1 14-Oct-2007  yamt sync with head.
 1.26.10.2 23-Mar-2008  matt sync with HEAD
 1.26.10.1 06-Nov-2007  matt sync with HEAD
 1.26.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.28.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.28.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.28.12.1 24-Mar-2008  keiichi sync with head.
 1.29.8.1 18-Jun-2008  simonb Sync with head.
 1.29.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.29.4.4 11-Aug-2010  yamt sync with head.
 1.29.4.3 11-Mar-2010  yamt sync with head
 1.29.4.2 18-Jul-2009  yamt sync with head.
 1.29.4.1 04-May-2009  yamt sync with head.
 1.29.2.1 17-Jun-2008  yamt sync with head.
 1.32.4.1 30-May-2010  rmind sync with head
 1.32.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.34.18.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.34.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.34.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.34.8.1 30-Oct-2012  yamt sync with head
 1.35.2.1 18-May-2014  rmind sync with head
 1.36.2.1 10-Aug-2014  tls Rebase.
 1.37.28.1 10-Jun-2019  christos Sync with HEAD
 1.37.26.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.36 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.35 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.34 03-Sep-2018  riastradh branches: 1.34.12;
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.33 20-Oct-2009  snj branches: 1.33.44; 1.33.54; 1.33.62; 1.33.64;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.32 07-Jul-2009  tsutsui Some KNF and cosmetics.
 1.31 18-Mar-2009  cegger bcopy -> memcpy
 1.30 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.29 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.28 28-Dec-2008  tsutsui branches: 1.28.2;
Fix broken RCS Id.
 1.27 28-Dec-2008  tsutsui Clear bp->b_oflags (introduced on vmlocking2 merge) before read
rather than calling brelse(9) after read.
Tested by Tuomo Makinen on port-atari.

Should fix pool panics during installation reported by David Ross
on port-atari:
http://mail-index.NetBSD.org/port-atari/2008/11/13/msg000113.html
and actually close PR port-atari/39850.
 1.26 04-Nov-2008  abs Another fix from Tuomo Makinen - Use brelse() to unbusy bp buffer
to allow user to swap floppy disks when prompted.
 1.25 02-Jan-2008  ad branches: 1.25.6; 1.25.10; 1.25.16; 1.25.18; 1.25.20;
Merge vmlocking2 to head.
 1.24 17-Oct-2007  garbled branches: 1.24.2; 1.24.4; 1.24.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.23 29-Jul-2007  ad branches: 1.23.6;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.22 06-Mar-2007  tsutsui branches: 1.22.2; 1.22.10; 1.22.12; 1.22.14;
- change pointers which actually required caddr_t to calculate address
from (void *) to (char *)
- add (char *) cast to appease -Wpointer-arith
 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.24; 1.20.26;
merge ktrace-lwp.
 1.19 15-Jul-2003  lukem branches: 1.19.16;
__KERNEL_RCSID()
 1.18 06-Sep-2002  gehenna branches: 1.18.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.17 23-May-2002  leo Fix typo.
 1.16 23-May-2002  leo Update md config:
- md0 -> 1MB image on a 720KB floppy
- md1 -> 1.44MB image on a 720KB floppy
- md2 -> 1.44MB image on a 1.44MB floppy
 1.15 27-Nov-2000  chs branches: 1.15.2; 1.15.4; 1.15.8; 1.15.16; 1.15.18;
Initial integration of the Unified Buffer Cache project.
 1.14 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.13 30-Jul-1997  leo branches: 1.13.18;
Add second md device.
 1.12 30-Mar-1997  leo branches: 1.12.4;
Add a space to the attach message.
 1.11 28-Dec-1996  pk omission in last commit: ramdisk.h => md.h
 1.10 28-Dec-1996  pk rename: ramdisk => md
 1.9 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.8 08-Nov-1996  leo Adapt to the change in the floppy minor-number sceme.
 1.7 13-Oct-1996  christos backout previous kprintf changes
 1.6 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.5 16-Sep-1996  leo atari_realconfig now defined in <atari/device.h>
 1.4 26-Apr-1996  leo Corrections for removed <sys/cpu.h> and some more prototypes.
 1.3 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.2 27-Mar-1996  leo Remove rd_match_hook().
 1.1 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.12.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.18.2 08-Dec-2000  bouyer Sync with HEAD.
 1.13.18.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.15.18.1 28-May-2002  lukem Pull up revisions 1.16-1.17 (requested by leo):
Update md config:
- md0 -> 1MB image on a 720KB floppy
- md1 -> 1.44MB image on a 720KB floppy
- md2 -> 1.44MB image on a 1.44MB floppy
Fix typo.
 1.15.16.2 30-May-2002  gehenna 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.5 17-Sep-2002  nathanw Catch up to -current.
 1.15.8.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.15.8.3 24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.15.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.15.8.1 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.15.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.15.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.18.6.4 17-Jan-2005  skrll Adapt to branch.
 1.18.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.6.1 03-Aug-2004  skrll Sync with HEAD
 1.19.16.3 21-Jan-2008  yamt sync with head
 1.19.16.2 03-Sep-2007  yamt sync with head.
 1.19.16.1 21-Jun-2006  yamt sync with head.
 1.20.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.20.24.3 02-Jan-2009  jdc Back out changes 1.20.24.1 and 1.20.24.2 (requested by tsutsui in ticket
#1226).
This fix is not required on netbsd-4 branch.
 1.20.24.2 30-Nov-2008  bouyer Apply patch, requested by tsutsui as part of ticket 1226:
fix initial patch from abs to make it build (brelse() takes only one argument
on netbsd-4).
 1.20.24.1 18-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1226):
sys/arch/atari/dev/md_root.c: revision 1.26 via patch
Another fix from Tuomo Makinen - Use brelse() to unbusy bp buffer
to allow user to swap floppy disks when prompted.
 1.22.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.22.12.1 07-Aug-2007  matt Sync with HEAD.
 1.22.10.1 03-Oct-2007  garbled Sync with HEAD
 1.22.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.23.6.2 09-Jan-2008  matt sync with HEAD
 1.23.6.1 06-Nov-2007  matt sync with HEAD
 1.24.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.24.4.1 31-Dec-2007  ad Make compile with new buffer cache locking scheme.

XXX This should be largely MI, please do not make another clone of disksubr.c.
 1.24.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.25.20.3 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #220):
sys/arch/atari/dev/md_root.c: revision 1.28
Fix broken RCS Id.
 1.25.20.2 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #220):
sys/arch/atari/dev/md_root.c: revision 1.27
Clear bp->b_oflags (introduced on vmlocking2 merge) before read
rather than calling brelse(9) after read.
Tested by Tuomo Makinen on port-atari.
Should fix pool panics during installation reported by David Ross
on port-atari:
http://mail-index.NetBSD.org/port-atari/2008/11/13/msg000113.html
and actually close PR port-atari/39850.
 1.25.20.1 06-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #14):
sys/arch/atari/dev/md_root.c: revision 1.26
Another fix from Tuomo Makinen - Use brelse() to unbusy bp buffer
to allow user to swap floppy disks when prompted.
 1.25.18.2 28-Apr-2009  skrll Sync with HEAD.
 1.25.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.25.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.25.10.3 11-Mar-2010  yamt sync with head
 1.25.10.2 18-Jul-2009  yamt sync with head.
 1.25.10.1 04-May-2009  yamt sync with head.
 1.25.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.28.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.33.64.1 10-Jun-2019  christos Sync with HEAD
 1.33.62.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.33.54.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.33.44.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.34.12.1 03-Apr-2021  thorpej Sync with HEAD.
 1.28 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.27 26-Jun-2022  tsutsui Misc KNF and cleanup for readability.
 1.26 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.25 16-Mar-2014  dholland branches: 1.25.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.24 14-Mar-2009  dsl branches: 1.24.12; 1.24.22; 1.24.26;
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 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.21 17-Jan-2009  tsutsui branches: 1.21.2;
Use firm_gettime() to retain compatibility with old firm_event. From amiga.
 1.20 08-Jan-2008  joerg branches: 1.20.6; 1.20.10; 1.20.18;
Convert Atari to generic TODR and timecounter.
 1.19 17-Oct-2007  garbled branches: 1.19.2; 1.19.8;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.18 11-Jul-2007  he branches: 1.18.10;
Adapt to new signature for callout_init().
 1.17 04-Mar-2007  christos branches: 1.17.2; 1.17.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.16 11-Dec-2005  christos branches: 1.16.26;
merge ktrace-lwp.
 1.15 21-Sep-2003  jdolecek branches: 1.15.16;
cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
the owner of descriptor, according to appropriate sematics
of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
 1.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 23-Oct-2002  jdolecek branches: 1.12.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.11 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.10 23-Mar-2000  thorpej branches: 1.10.8; 1.10.12; 1.10.20;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.9 13-Oct-1996  christos branches: 1.9.28;
backout previous kprintf changes
 1.8 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.7 25-Sep-1996  leo Catchup with -current:
- Extra argument to boot()
- select -> poll
 1.6 23-Apr-1996  leo Ignore joystick packages when running in 3b. emulation mode.
 1.5 12-Apr-1996  leo Add 3-button mouse support.
 1.4 12-Apr-1996  leo Add 3-button mouse support.
 1.3 27-Jul-1995  leo Add middle button emulation.
 1.2 26-Jun-1995  leo Fix thinko. It will now also work when no mouse is configured.
 1.1 25-Jun-1995  leo Mouse driver added.
 1.9.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.20.1 17-May-2002  gehenna Add device switch.
 1.10.12.2 11-Nov-2002  nathanw Catch up to -current
 1.10.12.1 17-Sep-2002  nathanw Catch up to -current.
 1.10.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.10.8.1 09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.12.6.4 17-Jan-2005  skrll Adapt to branch.
 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.15.16.3 21-Jan-2008  yamt sync with head
 1.15.16.2 03-Sep-2007  yamt sync with head.
 1.15.16.1 21-Jun-2006  yamt sync with head.
 1.16.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.17.10.1 03-Oct-2007  garbled Sync with HEAD
 1.17.2.1 15-Jul-2007  ad Sync with head.
 1.18.10.2 23-Mar-2008  matt sync with HEAD
 1.18.10.1 06-Nov-2007  matt sync with HEAD
 1.19.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.19.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.20.18.2 28-Apr-2009  skrll Sync with HEAD.
 1.20.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.20.10.1 04-May-2009  yamt sync with head.
 1.20.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.21.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.24.26.1 18-May-2014  rmind sync with head
 1.24.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.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.25.2.1 10-Aug-2014  tls Rebase.
 1.5 26-Jun-2022  tsutsui Misc KNF and cleanup for readability.
 1.4 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.3 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.2 23-Mar-2000  thorpej branches: 1.2.134; 1.2.142; 1.2.148;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.1 12-Apr-1996  leo branches: 1.1.30;
Add 3-button mouse support.
 1.1.30.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.148.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.142.1 28-Apr-2009  skrll Sync with HEAD.
 1.2.134.2 11-Mar-2010  yamt sync with head
 1.2.134.1 04-May-2009  yamt sync with head.
 1.79 01-Aug-2023  andvar fix various typos in comments.
 1.78 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.77 07-Apr-2022  andvar fix various typos in comments.
 1.76 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.75 24-Apr-2021  thorpej branches: 1.75.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.74 29-Sep-2020  msaitoh branches: 1.74.4;
s/implicitely/implicitly/
 1.73 29-Jun-2019  tsutsui Make local functions static.
 1.72 18-Oct-2014  snj branches: 1.72.20;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.71 24-Mar-2014  christos - remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.70 27-Oct-2012  chs branches: 1.70.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.69 05-Jun-2011  tsutsui branches: 1.69.2; 1.69.12;
Split device_t/softc. No crash on TT030.
 1.68 17-Apr-2010  tsutsui branches: 1.68.2; 1.68.6;
extern inline -> static inline
 1.67 13-Apr-2010  tsutsui Misc KNF and cosmetics.
 1.66 28-Feb-2010  snj branches: 1.66.2;
Fight the ever-increasing size of src checkouts by spelling "useful"
without an extra l.
 1.65 20-Oct-2009  snj branches: 1.65.2;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.64 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.63 18-Mar-2009  cegger bcopy -> memcpy
 1.62 18-Mar-2009  cegger bzero -> memset
 1.61 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.60 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.59 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.58 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.57 15-Nov-2008  abs branches: 1.57.4;
To be safe, do not use DMA for Falcon - from Tuomo
 1.56 28-Oct-2008  abs branches: 1.56.2;
Remove unwanted 'xs->xs_status |= XS_STS_DONE' which caused scsipi_done()
to bail out early.
Found by T. Makinen, and additional confirmation by David Ross
 1.55 06-Mar-2007  tsutsui branches: 1.55.40; 1.55.44; 1.55.50; 1.55.52;
Make req_addr (char *) rather than adding an extra cast
since it's used only in this function to calculate buffer address.
 1.54 06-Mar-2007  he More fixes after the caddr_t removal.
Mostly cast to char* for pointer arithmetic,
but also one missing indirection, and one "void *v, x;" fix.
 1.53 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.52 25-Feb-2006  wiz branches: 1.52.18; 1.52.20; 1.52.28;
Fix some typos.
 1.51 24-Dec-2005  perry branches: 1.51.2; 1.51.4; 1.51.6;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.50 11-Dec-2005  christos merge ktrace-lwp.
 1.49 04-Jun-2005  he branches: 1.49.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.48 21-Feb-2005  thorpej Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding. Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes. Place items described
by the SCSI Primary Commands document into scsi_spc.h.
 1.47 07-Dec-2004  thorpej branches: 1.47.2; 1.47.4;
- Use the cmdlen specified in the scsipi_xfer structure. Keying off
the command group ID won't necessarily work for vendor-specific commands.
- Expand the storage in the SC_REQ structure to account for 16-byte commands.
 1.46 15-Jul-2003  lukem __KERNEL_RCSID()
 1.45 03-May-2003  wiz branches: 1.45.2;
DMA, not dma nor Dma.
 1.44 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.43 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.42 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.41 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.40 25-Apr-2001  bouyer branches: 1.40.2; 1.40.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.39 28-Jul-2000  tv branches: 1.39.2;
Eliminate the other %:, using vsnprintf followed by printf.
 1.38 28-Jul-2000  tv Avoid a nonstandard %: format: printf("%:", fmt, ap) -> vprintf(fmt, ap)
 1.37 30-Sep-1999  thorpej branches: 1.37.2;
Update for SCSIPI changes.
 1.36 19-Feb-1999  leo Fix type lossage reported by Julian Coleman.
 1.35 05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.34 19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.33 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.32 06-Oct-1998  leo Only return COMPLETE when polling.
 1.31 12-Jan-1998  thorpej Update for changes to config.
 1.30 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.29 20-Dec-1996  leo branches: 1.29.8; 1.29.10;
Get rid of BROKEN_INDIRECT_CONFIG
 1.28 10-Dec-1996  thorpej Fill in sc_link.max_target
 1.27 17-Nov-1996  leo Make splbio really splbio. All holes now seem to be plugged. At least
on the Hades & TT030.
 1.26 13-Oct-1996  christos backout previous kprintf changes
 1.25 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.24 16-Sep-1996  leo Add support for Hades platform.
 1.23 28-Aug-1996  cgd (1) set scsi_link channel to either the appropriate channel (if a
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
 1.22 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.21 05-Jul-1996  leo During a rather lengthy debug session with Markus Kilbinger (Thanks again!),
we managed to kill the following SCSI-driver bugs for the Falcon:
- The Byte_Count_zero bit of the falcon DMA controller does not always
tell the truth! This caused the SCSI-driver to choke on devices that
disconnected in the middle of a DMA-transfer (mostly removables).
- Printing debug info about the 5380 on the Falcon is *only* permitted
when DMA is not active.
- Some functions forgot to remove possibly pending sofware interrupts
- Some debug options didn't allow debugging a single target while they
could easily be made to do so. This is fixed.
 1.20 15-May-1996  leo branches: 1.20.4;
Get in sync with the mac68k version of the 5380 driver. Also increase
the maximum values of wait_req_xx() functions so some old (slow) scsi-1 drives
will work.
 1.19 26-Apr-1996  leo - Fixup the ipending function for the Falcon. This seemed to be the source
of a lot of instability problems on the Falcon. I also enabled DMA on
interrupt basis for the Falcon.
- Try to handle targets that request too much data more sanely.
- Some fixups for strict prototypes + -Wall

Thanks to Markus Kilbinger for providing the debugging support.
 1.18 30-Mar-1996  christos Change %r -> %: as for recursive printf's
 1.17 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.16 22-Feb-1996  leo A bit of reshuffling. Also some stricter prototyping.
 1.15 10-Feb-1996  leo Various small fixes.
 1.14 06-Jan-1996  leo Keep more debugging history (Paul Goyette). Synced with mac68k version.
 1.13 18-Dec-1995  leo Fixes for devices that don't support linked commands. (Paul Goyette)
 1.12 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.11 08-Oct-1995  leo branches: 1.11.2;
- Cleanup the arbitration
- Make sure the MON_BUSY flag is cleared after a DMA transfer. Otherwise
we might end up with a 'lost-busy' situation unexpectedly. This will
prevent the 5380 from driving the bus, which is not funny during
reselections.
 1.10 05-Oct-1995  leo Get in sync with the mac68k version to incorporate Allen Briggs' changes
- emit MSG_ABORT/MSG_REJECT at the right times:
- make MIN_PHYS machine dependent.
 1.9 16-Sep-1995  leo - Handle devices that do not support identify messages (Allen Briggs)
- Add pdma_ready() hook (Allen Briggs)
- Increase timeout to 1000 (Matthias Pfaller)
 1.8 12-Sep-1995  leo - Fix a timing bug in the loop, that was introduced in the previous version.
- Added some code to reject unsupported messages correctly.
 1.7 05-Sep-1995  leo Fix possibly endless loop (mycroft) and add fix requested by Allen Briggs.
 1.6 19-Aug-1995  leo - Add 'restbyte' handling for TT.
- Don't _ever_ do DMA for less than 512 bytes on the Falcon
- Fix bug in autosense-handling. Now asks for the correct number of bytes.
Now it won't read ghost bytes on the tape anymore.
- Add missing braces as suggested by Matthias Pfaller
- Make it possible to debug requests on a specified number of targets
- Add debug option to show only transaction with error code != 0
 1.5 12-Aug-1995  mycroft minphys() functions really should return void.
 1.4 11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.3 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.2 28-Apr-1995  leo Made no_ttram_dma patchable instead of a define.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.11.2.3 01-Nov-1995  leo Sync with Allen's version.
 1.11.2.2 27-Oct-1995  leo - Fix linked commands
- Fix reselection timeout procedure
 1.11.2.1 19-Oct-1995  leo '#ifdef notyet' the reselection timeout code in reselect(). This piece
of code causes problems on the mac/pc532 . Should be looked after.
 1.20.4.1 20-Jul-1996  jtc Pulled up from rev 1.21 by request from Leo Weppelman
 1.29.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.29.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.37.2.3 29-Mar-2001  bouyer Pass a compile test on i386
 1.37.2.2 27-Mar-2001  bouyer Convert to thorpej_scsipi (untested).
 1.37.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.39.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.40.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.40.8.1 25-Apr-2001  nathanw file ncr5380.c was added on branch nathanw_sa on 2002-10-18 02:35:55 +0000
 1.40.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.45.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.45.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.45.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.45.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.45.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.45.2.1 03-Aug-2004  skrll Sync with HEAD
 1.47.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.47.2.1 29-Apr-2005  kent sync with -current
 1.49.2.2 03-Sep-2007  yamt sync with head.
 1.49.2.1 21-Jun-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.51.2.1 01-Mar-2006  yamt sync with head.
 1.52.28.1 06-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1222):
sys/arch/atari/dev/ncr5380.c: revision 1.56
Remove unwanted 'xs->xs_status |= XS_STS_DONE' which caused scsipi_done()
to bail out early.
Found by T. Makinen, and additional confirmation by David Ross
 1.52.20.1 12-Mar-2007  rmind Sync with HEAD.
 1.52.18.2 15-Jan-2009  bouyer Pull up following revision(s) (requested by tjam in ticket #1261):
sys/arch/atari/dev/ncr5380.c: revision 1.57
To be safe, do not use DMA for Falcon - from Tuomo
 1.52.18.1 06-Nov-2008  snj Pull up following revision(s) (requested by abs in ticket #1222):
sys/arch/atari/dev/ncr5380.c: revision 1.56
Remove unwanted 'xs->xs_status |= XS_STS_DONE' which caused scsipi_done()
to bail out early.
Found by T. Makinen, and additional confirmation by David Ross
 1.55.52.2 28-Apr-2009  skrll Sync with HEAD.
 1.55.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.55.50.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.55.44.4 11-Aug-2010  yamt sync with head.
 1.55.44.3 11-Mar-2010  yamt sync with head
 1.55.44.2 19-Aug-2009  yamt sync with head.
 1.55.44.1 04-May-2009  yamt sync with head.
 1.55.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.56.2.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tjam in ticket #263):
sys/arch/atari/dev/ncr5380.c: revision 1.57
To be safe, do not use DMA for Falcon - from Tuomo
 1.57.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.65.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.66.2.2 12-Jun-2011  rmind sync with head
 1.66.2.1 30-May-2010  rmind sync with head
 1.68.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.68.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.69.12.3 03-Dec-2017  jdolecek update from HEAD
 1.69.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.69.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.69.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.69.2.1 30-Oct-2012  yamt sync with head
 1.70.2.1 18-May-2014  rmind sync with head
 1.72.20.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.74.4.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.75.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.24 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.23 05-Jun-2011  tsutsui Split device_t/softc. No crash on TT030.
 1.22 13-Apr-2010  tsutsui branches: 1.22.2; 1.22.6;
Misc KNF and cosmetics.
 1.21 20-Oct-2009  snj branches: 1.21.2; 1.21.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.20 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.19 11-Dec-2005  christos branches: 1.19.78; 1.19.86; 1.19.92;
merge ktrace-lwp.
 1.18 04-Jun-2005  he Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.17 07-Dec-2004  thorpej - Use the cmdlen specified in the scsipi_xfer structure. Keying off
the command group ID won't necessarily work for vendor-specific commands.
- Expand the storage in the SC_REQ structure to account for 16-byte commands.
 1.16 03-May-2003  wiz branches: 1.16.2;
DMA, not dma nor Dma.
 1.15 09-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.14 25-Apr-2001  bouyer branches: 1.14.8;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.13 19-Nov-1998  thorpej branches: 1.13.10; 1.13.22;
Adapt to the new scsipi_adapter interface.
 1.12 27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.11 05-Jul-1996  leo branches: 1.11.8; 1.11.10;
During a rather lengthy debug session with Markus Kilbinger (Thanks again!),
we managed to kill the following SCSI-driver bugs for the Falcon:
- The Byte_Count_zero bit of the falcon DMA controller does not always
tell the truth! This caused the SCSI-driver to choke on devices that
disconnected in the middle of a DMA-transfer (mostly removables).
- Printing debug info about the 5380 on the Falcon is *only* permitted
when DMA is not active.
- Some functions forgot to remove possibly pending sofware interrupts
- Some debug options didn't allow debugging a single target while they
could easily be made to do so. This is fixed.
 1.10 15-May-1996  leo branches: 1.10.4;
Get in sync with the mac68k version of the 5380 driver. Also increase
the maximum values of wait_req_xx() functions so some old (slow) scsi-1 drives
will work.
 1.9 08-Mar-1996  leo Just prototyping.
 1.8 22-Feb-1996  leo A bit of reshuffling. Also some stricter prototyping.
 1.7 10-Feb-1996  leo Various small fixes.
 1.6 18-Dec-1995  leo Fixes for devices that don't support linked commands. (Paul Goyette)
 1.5 05-Oct-1995  leo Get in sync with the mac68k version to incorporate Allen Briggs' changes
- emit MSG_ABORT/MSG_REJECT at the right times:
- make MIN_PHYS machine dependent.
 1.4 16-Sep-1995  leo - Handle devices that do not support identify messages (Allen Briggs)
- Add pdma_ready() hook (Allen Briggs)
- Increase timeout to 1000 (Matthias Pfaller)
 1.3 12-Sep-1995  leo - Fix a timing bug in the loop, that was introduced in the previous version.
- Added some code to reject unsupported messages correctly.
 1.2 11-Aug-1995  leo New version of NCR5380-SCSI driver. This version is far more generic than
the previous version. The machine dependent part contains the configuration
for both the TT and FALCON. The configuration files have been changed to
select SCSI-support for either TT, Falcon or both.
The configuration file for the Atari-Falcon will only get _really_ usefull
when the Falcon video part is finished.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.10.4.1 20-Jul-1996  jtc Pulled up from rev 1.11 by request from Leo Weppelman
 1.11.10.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.8.1 01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.13.22.1 21-Jun-2001  nathanw Catch up to -current.
 1.13.10.1 27-Mar-2001  bouyer Convert to thorpej_scsipi (untested).
 1.14.8.2 25-Apr-2001  bouyer Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.14.8.1 25-Apr-2001  bouyer file ncr5380reg.h was added on branch nathanw_sa on 2001-04-25 17:53:14 +0000
 1.16.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.16.2.1 18-Dec-2004  skrll Sync with HEAD.
 1.19.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.19.78.3 11-Aug-2010  yamt sync with head.
 1.19.78.2 11-Mar-2010  yamt sync with head
 1.19.78.1 04-May-2009  yamt sync with head.
 1.21.4.2 12-Jun-2011  rmind sync with head
 1.21.4.1 30-May-2010  rmind sync with head
 1.21.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.22.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.22.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10 07-Aug-2023  mrg fix indentation issues.

found by GCC 12.
 1.9 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.8 13-Apr-2010  tsutsui Misc KNF and cosmetics.
 1.7 20-Oct-2009  snj branches: 1.7.2; 1.7.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.6 11-Dec-2005  christos branches: 1.6.78;
merge ktrace-lwp.
 1.5 04-Jun-2005  he Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.4 13-Oct-1996  christos branches: 1.4.62;
backout previous kprintf changes
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 15-May-1996  leo Get in sync with the mac68k version of the 5380 driver. Also increase
the maximum values of wait_req_xx() functions so some old (slow) scsi-1 drives
will work.
 1.1 22-Feb-1996  leo A bit of reshuffling. Also some stricter prototyping.
 1.4.62.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.78.2 11-Aug-2010  yamt sync with head.
 1.6.78.1 11-Mar-2010  yamt sync with head
 1.7.4.1 30-May-2010  rmind sync with head
 1.7.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.23 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.22 02-Jul-2022  tsutsui Use aprint_*(9) for attach messages and misc KNF.
 1.21 20-Jan-2018  tsutsui Skip NVRAM checksum check and re-initialization on Milan.

Milan's firmware seems to use different check method.
 1.20 06-Mar-2015  christos branches: 1.20.10;
rename NV_DEBUG to NVRAM_DEBUG
 1.19 05-Jun-2011  tsutsui branches: 1.19.12; 1.19.30;
Split device_t/softc. No crash on TT030.
 1.18 13-Apr-2010  tsutsui branches: 1.18.2; 1.18.6;
Include "ioconf.h" to declare struct cfdriver foo_cd.
 1.17 20-Oct-2009  snj branches: 1.17.2; 1.17.4;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.16 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.15 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.14 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.13 13-Jun-2008  cegger branches: 1.13.4; 1.13.10;
use device_lookup_private to get softc
 1.12 11-Jun-2008  tsutsui Use device_private() and device_lookup_privat() to get softc.
 1.11 11-Dec-2005  christos branches: 1.11.74; 1.11.76; 1.11.78; 1.11.80; 1.11.82;
merge ktrace-lwp.
 1.10 15-Jul-2003  lukem __KERNEL_RCSID()
 1.9 02-Oct-2002  thorpej branches: 1.9.6;
Use CFATTACH_DECL().
 1.8 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.7 12-Jan-1998  thorpej branches: 1.7.28; 1.7.32;
Update for changes to config.
 1.6 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.5 13-Oct-1996  christos backout previous kprintf changes
 1.4 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.2 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.1 06-Jan-1996  leo Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.7.32.1 18-Oct-2002  nathanw Catch up to -current.
 1.7.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.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.11.82.1 18-Jun-2008  simonb Sync with head.
 1.11.80.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.11.78.3 11-Aug-2010  yamt sync with head.
 1.11.78.2 11-Mar-2010  yamt sync with head
 1.11.78.1 04-May-2009  yamt sync with head.
 1.11.76.1 17-Jun-2008  yamt sync with head.
 1.11.74.1 29-Jun-2008  mjf Sync with HEAD.
 1.13.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.17.4.2 12-Jun-2011  rmind sync with head
 1.17.4.1 30-May-2010  rmind sync with head
 1.17.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.18.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.18.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.30.1 06-Apr-2015  skrll Sync with HEAD
 1.19.12.1 03-Dec-2017  jdolecek update from HEAD
 1.20.10.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.5 02-Jul-2022  tsutsui Use aprint_*(9) for attach messages and misc KNF.
 1.4 05-Jun-2011  tsutsui Split device_t/softc. No crash on TT030.
 1.3 20-Oct-2009  snj branches: 1.3.4; 1.3.6; 1.3.10;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.2 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 06-Jan-1996  leo branches: 1.1.170; 1.1.178; 1.1.184;
Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818.
 1.1.184.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.178.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.170.2 11-Mar-2010  yamt sync with head
 1.1.170.1 04-May-2009  yamt sync with head.
 1.3.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.3.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.4.1 12-Jun-2011  rmind sync with head
 1.7 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.6 07-Jan-1996  thorpej New generic disk framework. Highlights:

- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.

- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.

- Several new functions for attaching and detaching disks, and
handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
 1.5 12-Aug-1995  mycroft minphys() functions really should return void.
 1.4 24-Jul-1995  cgd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
 1.3 12-Jul-1995  leo Update raw-io functions as suggested by Charles.
 1.2 16-Apr-1995  leo Get RAMD_NDEV in sync with definitions in rd_info.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.10 28-Dec-1996  pk rename: ramdisk => md
 1.9 20-Dec-1996  leo Get rid of BROKEN_INDIRECT_CONFIG
 1.8 08-Nov-1996  leo Adapt to the change in the floppy minor-number sceme.
 1.7 13-Oct-1996  christos backout previous kprintf changes
 1.6 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.5 16-Sep-1996  leo atari_realconfig now defined in <atari/device.h>
 1.4 26-Apr-1996  leo Corrections for removed <sys/cpu.h> and some more prototypes.
 1.3 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.2 27-Mar-1996  leo Remove rd_match_hook().
 1.1 14-Mar-1996  leo Switch to the mi ramdisk driver.
 1.60 18-Aug-2025  andvar Fix various typos, mainly in comments:
s/invaid/invalid/
s/instad/instead/
s/wich/with/
s/tranform/transform/
s/tranmist/transmit/
s/tranceiver/transceiver/
s/Tranparent/Transparent/
s/tranlated/translated/
s/tranfer/transfer/
s/tranmissions/transmissions/
s/condtions/conditions/
s/Recient/Recent/
 1.59 30-Aug-2023  andvar atari/ser(4): constify "char *str" serstatus() argument to fix SER_DEBUG build.
 1.58 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.57 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.56 15-Nov-2014  christos centralize the call unit / dialout macros
 1.55 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.54 24-Mar-2014  christos branches: 1.54.2;
- remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.53 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.52 24-Apr-2011  rmind branches: 1.52.4; 1.52.14; 1.52.18;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.51 10-Apr-2010  tsutsui branches: 1.51.2;
Make local functions static.
 1.50 09-Apr-2010  tsutsui minor constify
 1.49 09-Apr-2010  tsutsui Make options SERCONSOLE (force serial console if DCD is detected)
patchable by binpatch(8) like:
---
# binpatch -s serconsole -r 0 /netbsd
serconsole(0x23bac4): 0x00000001 (1), at offset 0x23bb44 in /netbsd
new value: 0x00000000 (0)
#
---

May work around PR port-atari/39849
(netbsd-ATARITT kernel fails with serial port connected)
and some old TT030 with early revision boards.
 1.48 09-Apr-2010  tsutsui - split device_t/softc
- verbose output on attach as well as zs serial ports
 1.47 09-Apr-2010  tsutsui Include ioconf.h for struct cfdriver.
 1.46 09-Apr-2010  tsutsui Misc KNF.
 1.45 23-Nov-2009  rmind branches: 1.45.2; 1.45.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.44 08-Jul-2009  tsutsui Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.43 03-Jul-2009  tsutsui Replace traditional MD si_callback() with MI softint(9).
 1.42 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.41 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.40 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.39 11-Jun-2008  tsutsui branches: 1.39.4; 1.39.6; 1.39.10;
Use device_private() and device_lookup_privat() to get softc.
 1.38 28-Apr-2008  martin branches: 1.38.2; 1.38.4;
Remove clause 3 and 4 from TNF licenses
 1.37 03-Dec-2007  ad branches: 1.37.14; 1.37.16; 1.37.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.36 19-Nov-2007  ad - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.35 17-Oct-2007  garbled branches: 1.35.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.34 09-Jul-2007  ad branches: 1.34.8; 1.34.10; 1.34.14;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 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 01-Oct-2006  elad branches: 1.32.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.31 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.30 23-Jul-2006  ad branches: 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.
 1.29 14-May-2006  elad integrate kauth.
 1.28 06-Mar-2006  he branches: 1.28.2; 1.28.4;
Remove another instance of the macro triplet SET/CLR/ISSET, now
found in <sys/types.h>.
 1.27 11-Dec-2005  christos branches: 1.27.4; 1.27.6; 1.27.8;
merge ktrace-lwp.
 1.26 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.25 04-Jun-2005  he branches: 1.25.2;
Remove the unused global variable "baud" because it is causing
shadowing warnings.
 1.24 11-Feb-2005  simonb White space nit- don't put a space before/after increment/decrement
operators.
 1.23 07-Aug-2003  agc branches: 1.23.8; 1.23.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.22 15-Jul-2003  lukem __KERNEL_RCSID()
 1.21 23-Oct-2002  jdolecek branches: 1.21.6;
merge kqueue branch into -current

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

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

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

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.17 29-Aug-2002  leo defopt SERCONSOLE
 1.16 30-May-2002  thorpej Don't include params on macro when #undef'ing it.
 1.15 17-Mar-2002  atatat branches: 1.15.4; 1.15.6;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.14 02-May-2001  scw branches: 1.14.2; 1.14.4; 1.14.8;
Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.13 11-Apr-2001  leo Adapt these for use on the Milan.
 1.12 02-Nov-2000  eeh branches: 1.12.2;
Adapt to new line discipline scheme.
 1.11 29-Mar-2000  leo Nuke a bunch of cf_unit abuses.
 1.10 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.9 06-Aug-1999  leo branches: 1.9.2;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.8 06-Apr-1999  pk remove duplicate line in copyright.
 1.7 06-Apr-1999  pk Fix garbled word in copyright statement.
 1.6 07-Oct-1998  leo branches: 1.6.6;
Copyright stuff.
 1.5 04-Jul-1998  jonathan defopt DDB.
 1.4 25-Mar-1998  leo Sync with latest tty changes.
 1.3 12-Jan-1998  thorpej Update for changes to config.
 1.2 27-Aug-1997  leo According to Andre Lange, the Hades has the DTR/RTS lines exchanged on
the 68901 UART-port due to a PCB error. Take care of this.
 1.1 25-May-1997  leo branches: 1.1.4;
Add serial driver for 68901 UART (modem1 port).
 1.1.4.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.6.1 07-Apr-1999  pk branches: 1.6.6.1.2;
Pull up from trunk: copyright text warts.
 1.6.6.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.9.2.2 22-Nov-2000  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.12.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.14.8.6 11-Nov-2002  nathanw Catch up to -current
 1.14.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.14.8.4 17-Sep-2002  nathanw Catch up to -current.
 1.14.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.14.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.14.8.1 02-May-2001  nathanw file ser.c was added on branch nathanw_sa on 2002-04-01 07:39:33 +0000
 1.14.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.14.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 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 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.14.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.6.1 30-May-2002  tv Pull up revision 1.16 (requested by thorpej in ticket #97):
Don't include params on macro when #undef'ing it.
 1.15.4.3 31-Aug-2002  gehenna catch up with -current.
 1.15.4.2 14-Jul-2002  gehenna catch up with -current.
 1.15.4.1 19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.21.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.6.5 15-Feb-2005  skrll Sync with HEAD.
 1.21.6.4 17-Jan-2005  skrll Adapt to branch.
 1.21.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.6.1 03-Aug-2004  skrll Sync with HEAD
 1.23.10.1 12-Feb-2005  yamt sync with head.
 1.23.8.1 29-Apr-2005  kent sync with -current
 1.25.2.4 07-Dec-2007  yamt sync with head
 1.25.2.3 03-Sep-2007  yamt sync with head.
 1.25.2.2 30-Dec-2006  yamt sync with head.
 1.25.2.1 21-Jun-2006  yamt sync with head.
 1.27.8.3 11-Aug-2006  yamt sync with head
 1.27.8.2 24-May-2006  yamt sync with head.
 1.27.8.1 13-Mar-2006  yamt sync with head.
 1.27.6.2 01-Jun-2006  kardel Sync with head.
 1.27.6.1 22-Apr-2006  simonb Sync with head.
 1.27.4.1 09-Sep-2006  rpaulo sync with head
 1.28.4.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.28.2.3 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.28.2.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.28.2.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.30.6.1 22-Oct-2006  yamt sync with head
 1.30.4.1 18-Nov-2006  ad Sync with head.
 1.32.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.33.10.1 03-Oct-2007  garbled Sync with HEAD
 1.33.4.1 11-Jul-2007  mjf Sync with head.
 1.33.2.2 03-Dec-2007  ad Sync with HEAD.
 1.33.2.1 15-Jul-2007  ad Sync with head.
 1.34.14.1 21-Nov-2007  bouyer Sync with HEAD
 1.34.10.2 09-Jan-2008  matt sync with HEAD
 1.34.10.1 06-Nov-2007  matt sync with HEAD
 1.34.8.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.34.8.1 21-Nov-2007  joerg Sync with HEAD.
 1.35.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.37.18.5 11-Aug-2010  yamt sync with head.
 1.37.18.4 11-Mar-2010  yamt sync with head
 1.37.18.3 18-Jul-2009  yamt sync with head.
 1.37.18.2 04-May-2009  yamt sync with head.
 1.37.18.1 16-May-2008  yamt sync with head.
 1.37.16.2 17-Jun-2008  yamt sync with head.
 1.37.16.1 18-May-2008  yamt sync with head.
 1.37.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.37.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.38.4.1 18-Jun-2008  simonb Sync with head.
 1.38.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.39.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.39.6.1 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1368):
sys/arch/atari/dev/ser.c: revision 1.49
sys/arch/atari/conf/GENERIC.in: revision 1.86
Make options SERCONSOLE (force serial console if DCD is detected)
patchable by binpatch(8) like:
---
serconsole(0x23bac4): 0x00000001 (1), at offset 0x23bb44 in /netbsd
new value: 0x00000000 (0)
---
May work around PR port-atari/39849
(netbsd-ATARITT kernel fails with serial port connected)
and some old TT030 with early revision boards.
Disable options SERCONSOLE (force serial console if DCD is detected)
because now it's patchable by binpatch(8).
Enabling serial console by DCD signal could be problematic
on some earlier TT030 (with revision A board), and it's also
annoying for users who connect an active device on the serial port
as mentioned in PR port-atari/39849.
XXX: Eventually serial console should be enabled by MD bootloader flags,
XXX: but I have no idea how to build bootloader binaries for TOS.
 1.39.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.45.4.2 31-May-2011  rmind sync with head
 1.45.4.1 30-May-2010  rmind sync with head
 1.45.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.51.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.52.18.1 18-May-2014  rmind sync with head
 1.52.14.2 03-Dec-2017  jdolecek update from HEAD
 1.52.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.52.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.54.2.1 10-Aug-2014  tls Rebase.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 25-May-1997  leo branches: 1.1.158; 1.1.160; 1.1.162;
Add serial driver for 68901 UART (modem1 port).
 1.1.162.1 16-May-2008  yamt sync with head.
 1.1.160.1 18-May-2008  yamt sync with head.
 1.1.158.1 02-Jun-2008  mjf Sync with HEAD.
 1.40 27-Jan-2025  andvar s/probeing/probing/ in comments.
 1.39 26-Mar-2023  andvar branches: 1.39.6;
s/dipslay/display/ in comments.
 1.38 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.37 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.36 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.35 20-Aug-2015  christos include "ioconf.h" to get the 'void <driver>attach(int count);' prototype.
 1.34 25-Jul-2014  dholland branches: 1.34.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.33 16-Mar-2014  dholland branches: 1.33.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.32 13-Apr-2010  tsutsui branches: 1.32.8; 1.32.18; 1.32.22;
Misc KNF.
 1.31 19-Jul-2009  tsutsui branches: 1.31.2; 1.31.4;
Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.30 18-Mar-2009  cegger bcopy -> memcpy
 1.29 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.28 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.27 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.26 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.25 23-Mar-2008  cube branches: 1.25.4; 1.25.12; 1.25.18;
Use M_TEMP for allocations instead of the now deceased M_IOCTLOPS.
 1.24 04-Mar-2007  christos branches: 1.24.40;
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 15-Jul-2003  lukem branches: 1.22.16;
__KERNEL_RCSID()
 1.21 23-Oct-2002  jdolecek branches: 1.21.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.20 10-Oct-2002  jdolecek replace the somewhat strange poll routine with standard nopoll() (a.k.a
seltrue())
 1.19 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.18 17-Mar-2002  atatat branches: 1.18.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.17 26-Jun-2000  simonb branches: 1.17.4; 1.17.8;
Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.16 20-Dec-1998  thomas branches: 1.16.8; 1.16.18;
Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.15 25-Apr-1997  leo - Provide the reasonable size that can/may be mmap-ed. This might differ
from the current frame buffer size.
- The et-driver now allows for a 16Kb io-region (was 8Kb) that can be
mapped. The XFree server uses this.
 1.14 10-Jan-1997  leo Allow the control registers to be mapped too.
 1.13 13-Oct-1996  christos backout previous kprintf changes
 1.12 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.11 04-Oct-1996  leo Checkpointing my et4000 work. Note that the et-console will not be
functional until the minimal pci-support is checked in.
 1.10 25-Sep-1996  leo Catchup with -current:
- Extra argument to boot()
- select -> poll
 1.9 16-Sep-1996  leo Prepare for (soon to come) et4000 PCI console.
 1.8 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.7 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.6 17-Aug-1995  leo Remove 2 wrong proto-types.
 1.5 28-May-1995  leo Remove the pointer to view_t from the grf-structure, use viewview(dev)
to obtain the pointer instead. This removes a kernel-crash that happened
when something was written to the console while the console was being
resized.
 1.4 21-May-1995  leo ite_newsize(): Do not reallocate a display when the actual display mode
will be the same. Fixes a nasty bug where ite0 and ite1 share the same
bitmap.
 1.3 10-Apr-1995  mycroft map --> mmap
 1.2 28-Mar-1995  leo Make ite ioctl work and fixup the colormap stuff.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.16.18.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.16.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.17.8.4 11-Nov-2002  nathanw Catch up to -current
 1.17.8.3 18-Oct-2002  nathanw Catch up to -current.
 1.17.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.17.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.17.4.5 10-Oct-2002  jdolecek use nokqfilter (or seltrue_kqfilter()) for drivers which provide poll
routine very similar to seltrue(); the poll routines would be cleaned
up on trunk
 1.17.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.17.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.17.4.2 17-Jun-2002  jdolecek make compilable - use cdev_decl(), and remove unnecessary prototypes
from headers
 1.17.4.1 12-Sep-2001  thorpej Add noop kqueue entry points.
 1.18.4.1 17-May-2002  gehenna Add device switch.
 1.21.6.4 17-Jan-2005  skrll Adapt to branch.
 1.21.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.6.1 03-Aug-2004  skrll Sync with HEAD
 1.22.16.3 24-Mar-2008  yamt sync with head.
 1.22.16.2 03-Sep-2007  yamt sync with head.
 1.22.16.1 21-Jun-2006  yamt sync with head.
 1.23.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.40.1 03-Apr-2008  mjf Sync with HEAD.
 1.25.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.4.3 11-Aug-2010  yamt sync with head.
 1.25.4.2 19-Aug-2009  yamt sync with head.
 1.25.4.1 04-May-2009  yamt sync with head.
 1.31.4.1 30-May-2010  rmind sync with head
 1.31.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.32.22.1 18-May-2014  rmind sync with head
 1.32.18.2 03-Dec-2017  jdolecek update from HEAD
 1.32.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.32.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.33.2.1 10-Aug-2014  tls Rebase.
 1.34.4.1 22-Sep-2015  skrll Sync with HEAD
 1.39.6.1 02-Aug-2025  perseant Sync with HEAD
 1.4 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.3 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.2 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.216; 1.1.1.1.236;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.236.1 22-Sep-2015  skrll Sync with HEAD
 1.1.1.1.216.1 03-Dec-2017  jdolecek update from HEAD
 1.9 26-Mar-2023  andvar s/dipslay/display/ in comments.
 1.8 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.7 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.6 11-Dec-2005  christos branches: 1.6.78; 1.6.86; 1.6.92;
merge ktrace-lwp.
 1.5 06-Sep-2002  gehenna branches: 1.5.6; 1.5.22;
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.4 16-Oct-1996  leo branches: 1.4.42; 1.4.46; 1.4.54;
select -> poll
 1.3 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.2 28-May-1995  leo Remove the pointer to view_t from the grf-structure, use viewview(dev)
to obtain the pointer instead. This removes a kernel-crash that happened
when something was written to the console while the console was being
resized.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.4.54.1 19-May-2002  gehenna Remove unnecessary prototype.
 1.4.46.1 17-Sep-2002  nathanw Catch up to -current.
 1.4.42.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.42.1 17-Jun-2002  jdolecek make compilable - use cdev_decl(), and remove unnecessary prototypes
from headers
 1.5.22.1 21-Jun-2006  yamt sync with head.
 1.5.6.1 17-Jan-2005  skrll Adapt to branch.
 1.6.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.6.78.1 04-May-2009  yamt sync with head.
 1.5 28-Aug-2006  he Use the common <dev/sun/vuid_event.h> header file instead of maintaining
separate copies in port-specific directories. Add duplicate include
protection. Makes the alpha and atari ports build usr.bin/kdump/ again.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 18-May-2004  he branches: 1.3.12;
Add some mulitple include protection.
Include kbdmap.h from iteioctl.h so that kdump compiles, otherwise
the size of struct kbdmap as used in various ioctl defines is unknown.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.66;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.66.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.66.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.66.1 03-Aug-2004  skrll Sync with HEAD
 1.3.12.1 30-Dec-2006  yamt sync with head.
 1.4.8.1 03-Sep-2006  yamt sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.9 10-Apr-1998  leo Use MI wdc-driver.
 1.8 12-Jan-1998  thorpej Update for changes to config.
 1.7 08-Oct-1997  thorpej Implement DIOCGDEFLABEL.
 1.6 30-Jul-1997  leo Include 'locators.h'
 1.5 17-Jul-1997  jtk branches: 1.5.2;
use locator defines in "locators.h" to index cf_loc[]
 1.4 25-Jun-1997  leo Be consistent with more pedantic bus.h.
 1.3 24-Jun-1997  thorpej In wdsize():
- If the partition is already open, skip the open/close step. (Sync with
other disk drivers).
- foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
 1.2 02-Apr-1997  leo The atari-TT really has no IDE-interface.
 1.1 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.5.2.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.2.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2 07-Jun-2001  leo Remove the atari specific incarnation of wdc_isa.c. We don't need it (in
fact it didn't work that well either), all could be done by simply adding the
NOSTREAM options to the flags of the generic ISA frontend.
There was probably to much byteswapping in my brain when I invented this.
 1.1 31-Mar-2001  leo branches: 1.1.2; 1.1.4;
Wcd attacment code for the Milan. The Milan has the standard dual IDE port
hardware. A Milan specific attachment is needed to modify the iot so that
the streaming methods do a byteswap.
Configure like:
wdcisa0 at isa? port 0x1f0 irq 14
wdcisa1 at isa? port 0x170 irq 15
 1.1.4.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.4.1 31-Mar-2001  bouyer file wdc_isa.c was added on branch thorpej_scsipi on 2001-04-21 17:53:24 +0000
 1.1.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.43 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.42 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.41 29-Jun-2019  tsutsui Make local functions static.
 1.40 20-Oct-2017  jdolecek branches: 1.40.4;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.39 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.38 31-Jul-2012  bouyer branches: 1.38.2; 1.38.28;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.37 26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.36 02-Jul-2012  bouyer Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.35 01-Jul-2011  dyoung branches: 1.35.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.34 08-Mar-2009  tsutsui ANSIfy, some KNF, misc cosmetics.
 1.33 27-Dec-2008  tsutsui branches: 1.33.2;
Sprinkle volatile to bus_space(9) access functions.
 1.32 28-Apr-2008  martin branches: 1.32.8; 1.32.10;
Remove clause 3 and 4 from TNF licenses
 1.31 18-Mar-2008  cube branches: 1.31.2; 1.31.4;
Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
 1.30 04-Dec-2007  tsutsui branches: 1.30.8; 1.30.12;
- add a missing brace in the previous
- print error message on failure to map aux register
 1.29 04-Dec-2007  tsutsui Apply missed following MI wdc changes to atari's mainbus wdc backend:
- make bus space handles an array for each command register
http://mail-index.netbsd.org/source-changes/2003/11/27/0036.html
(note we no longer have to specify stride for wdc after this change)
- add the notion of "shadow register"
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html

Problem reported by Alan Hourihane in PR port-amiga/37464.
 1.28 29-Jan-2006  dsl branches: 1.28.22; 1.28.38; 1.28.46; 1.28.48; 1.28.54; 1.28.58;
Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
 1.27 16-Jan-2006  bouyer properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.
 1.26 11-Dec-2005  christos branches: 1.26.2;
merge ktrace-lwp.
 1.25 10-May-2005  jdc branches: 1.25.2;
Add some definitions of the (Falcon) IDE register locations and use these
to initialise the wdc register array.

Doesn't make the wdc probe work on the Falcon, but at least the kernel no
longer dies at boot time.
 1.24 20-Aug-2004  thorpej branches: 1.24.10;
Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
 1.23 14-Aug-2004  thorpej - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
ata_channel. Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
maximum number of drives that can be present on the channel. For now,
this is always 2. Add an ATA_MAXDRIVES constant that places an upper
limit on this value, also currently 2.
 1.22 13-Aug-2004  thorpej Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.
 1.21 06-Jan-2004  he Make these compile again after the latest adjustments.
 1.20 03-Jan-2004  thorpej More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc
 1.19 03-Jan-2004  thorpej Rename "struct channel_softc" to "struct wdc_channel".
 1.18 01-Jan-2004  thorpej Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.
 1.17 31-Dec-2003  thorpej Simplfy allocation of the channel queue.
 1.16 16-Dec-2003  he Replace cmd_ioh with cmd_baseioh, to track changes to wdcvar.h, so
that this compiles again. Untested for now.

Reviewed by leo.
 1.15 08-Oct-2003  bouyer Adapt for wdcattach() prototype change.
 1.14 25-Sep-2003  mycroft Hide the use of config_interrupts() in one place.
 1.13 19-Sep-2003  mycroft 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
(it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
*_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
drives more quickly.
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 02-Oct-2002  thorpej branches: 1.11.6;
Use CFATTACH_DECL().
 1.10 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.9 29-Mar-2000  leo branches: 1.9.8; 1.9.12;
Nuke a bunch of cf_unit abuses.
 1.8 23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.7 06-Aug-1999  leo branches: 1.7.2;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.6 19-Feb-1999  leo Add <machine/bswap.h> in the list of include-files.
 1.5 03-Dec-1998  bouyer Rename pio_mode, etc ... to PIO_cap, etc ... for consistency with the
ata_drive_datas struct. Suggested by Soren S. Jorvan.
 1.4 22-Nov-1998  drochner oops - forget update for wdc_channels definition change
 1.3 12-Oct-1998  bouyer Merge bouyer-ide
 1.2 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.1 10-Apr-1998  leo branches: 1.1.2;
Use MI wdc-driver.
 1.1.2.6 02-Oct-1998  bouyer Cleanup a few error message, remove some dead code. Re-add a reset at end of
attach, unless we have WDC_NO_EXTRA_RESETS.
Add support for data32iot/data32ioh from -current: each controller pass
WDC_CAPABILITY_DATA32 if they can do 32bit, and WDC_CAPABILITY_DATA16 if they
can do 16bit. For controller that support both, the usual autodetect
mechanism is still used.
 1.1.2.5 21-Aug-1998  bouyer Sync with -current
 1.1.2.4 13-Aug-1998  bouyer - sync with -current
- b* -> mem*
 1.1.2.3 23-Jun-1998  leo Add necessary cruft to handle swapped byte-lanes on the data-register. It
basically boils down to the fact that there are 2 new options:
WDC_CAPABILITY_{ATA,ATAPI}_NOSTREAM with which you are able to control
the usage bus_space_read_multi_X() vs. bus_space_read_multi_stream_X().
 1.1.2.2 05-Jun-1998  bouyer Patches from Leo Weppelman for IDE on atari, with minor fixes by me
(needed the addition of a void wdcrestart __P((void*)) function).
Quoting his words:
These diffs are preliminary because it looks like the free_hw() function
does not get called. This is only a problem on the atari falcon. I have not
yet been able to track this down.
Also, KNF wdc.c.
 1.1.2.1 04-Jun-1998  bouyer Commit changes to the IDE system in a branch. This allows a better separation
between higth-level and low-level (i.e. registers read/write) and generalize
the queue for all commands. This also add supports for IDE DMA.
 1.7.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.12.1 18-Oct-2002  nathanw Catch up to -current.
 1.9.8.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.11.6.2 25-Aug-2004  skrll Sync with HEAD.
 1.11.6.1 03-Aug-2004  skrll Sync with HEAD
 1.24.10.1 12-Dec-2007  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1885):
sys/arch/atari/dev/wdc_mb.c: revisions 1.29, 1.30 via patch
Apply missed following MI wdc changes to atari's mainbus wdc backend:
- make bus space handles an array for each command register
http://mail-index.netbsd.org/source-changes/2003/11/27/0036.html
(note we no longer have to specify stride for wdc after this change)
- add the notion of "shadow register"
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html
Problem reported by Alan Hourihane in PR port-amiga/37464.
 1.25.2.3 24-Mar-2008  yamt sync with head.
 1.25.2.2 07-Dec-2007  yamt sync with head
 1.25.2.1 21-Jun-2006  yamt sync with head.
 1.26.2.1 01-Feb-2006  yamt sync with head.
 1.28.58.1 08-Dec-2007  ad Sync with head.
 1.28.54.1 08-Dec-2007  mjf Sync with HEAD.
 1.28.48.2 23-Mar-2008  matt sync with HEAD
 1.28.48.1 09-Jan-2008  matt sync with HEAD
 1.28.46.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.28.38.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.28.22.2 02-Jan-2009  jdc Pull up revisions:
1.10 src/sys/arch/atari/atari/be_bus.c
1.14 src/sys/arch/atari/atari/le_bus.c
1.8 src/sys/arch/atari/atari/mainbus.c
1.33 src/sys/arch/atari/dev/wdc_mb.c
(requested by tsutsui in ticket #1252).

Sprinkle volatile to bus_space(9) access functions.
 1.28.22.1 02-Feb-2008  riz Pull up following revision(s) (requested by tsutsui in ticket #1013):
sys/arch/atari/dev/wdc_mb.c: revision 1.30
sys/arch/atari/dev/wdc_mb.c: revision 1.29
Apply missed following MI wdc changes to atari's mainbus wdc backend:
- make bus space handles an array for each command register
http://mail-index.netbsd.org/source-changes/2003/11/27/0036.html
(note we no longer have to specify stride for wdc after this change)
- add the notion of "shadow register"
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html
Problem reported by Alan Hourihane in PR port-amiga/37464.
- add a missing brace in the previous
- print error message on failure to map aux register
 1.30.12.3 17-Jan-2009  mjf Sync with HEAD.
 1.30.12.2 02-Jun-2008  mjf Sync with HEAD.
 1.30.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.30.8.1 24-Mar-2008  keiichi 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.1 18-May-2008  yamt sync with head.
 1.32.10.1 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #218):
sys/arch/atari/dev/wdc_mb.c: revision 1.33
sys/arch/atari/atari/mainbus.c: revision 1.8
sys/arch/atari/atari/le_bus.c: revision 1.14
sys/arch/atari/atari/be_bus.c: revision 1.10
Sprinkle volatile to bus_space(9) access functions.
 1.32.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.32.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.33.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.35.2.1 30-Oct-2012  yamt sync with head
 1.38.28.4 27-Sep-2017  jdolecek pass ata channel interlock to st_dmagrab() so that it can release
and reacquire it if it sleeps
 1.38.28.3 27-Sep-2017  jdolecek g/c mistakely left over code
 1.38.28.2 27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.38.28.1 24-Apr-2017  jdolecek use ata_queue_alloc() to dynamically allocate ata_queue for ata channel
 1.38.2.1 03-Dec-2017  jdolecek update from HEAD
 1.40.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 10-Apr-1998  leo Use MI wdc-driver.
 1.1 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.2 10-Apr-1998  leo Use MI wdc-driver.
 1.1 01-Apr-1997  leo Add wd-driver. The driver is basically the driver present in the arm32
port (Thanks Mark!) with a few atari specific things and the bad block
handling disabled.
 1.6 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.5 19-Sep-2018  rin Remove unused KBD_NULLMAP entries copy-paste from sys/dev/pckbport.
 1.4 28-Apr-2008  martin branches: 1.4.86; 1.4.88;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.76; 1.3.78;
merge ktrace-lwp.
 1.2 13-Mar-2004  bjh21 Remove needless includes of <dev/pckbc/wskbdmap_mfii.h>.
 1.1 02-Feb-2003  thomas branches: 1.1.2;
WS keyboard support for atari native keyboards.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.78.1 16-May-2008  yamt sync with head.
 1.3.76.1 18-May-2008  yamt sync with head.
 1.3.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.88.1 10-Jun-2019  christos Sync with HEAD
 1.4.86.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 02-Feb-2003  thomas branches: 1.1.104; 1.1.106; 1.1.108;
WS keyboard support for atari native keyboards.
 1.1.108.1 16-May-2008  yamt sync with head.
 1.1.106.1 18-May-2008  yamt sync with head.
 1.1.104.1 02-Jun-2008  mjf Sync with HEAD.
 1.6 12-Feb-2012  matt Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.5 20-Oct-2009  snj branches: 1.5.12; 1.5.16;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.4 11-Dec-2005  christos branches: 1.4.78;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 21-Jan-1997  leo branches: 1.2.60;
Don't set the PA_SER2 bit by default, this has the nasty side effect that
it disables the IDE hardware on the Falcon (Thanks Markus ;-) ). A function
is provided to toggle the bit.
 1.1 27-Mar-1996  leo branches: 1.1.2;
Take out direct access to the YM2149. The chip definitions are moved
from video.h to ym2149reg.h.
 1.1.2.1 30-Jan-1997  thorpej update from trunk
 1.2.60.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.60.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.60.1 03-Aug-2004  skrll Sync with HEAD
 1.4.78.1 11-Mar-2010  yamt sync with head
 1.5.16.1 18-Feb-2012  mrg merge to -current.
 1.5.12.1 17-Apr-2012  yamt sync with head
 1.7 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 11-Dec-2005  christos branches: 1.5.78; 1.5.86; 1.5.92;
merge ktrace-lwp.
 1.4 04-Jun-2005  he Prefix local variables in macros with _, and add a character to
one variable name to avoid a shadowing warning.
 1.3 21-Jan-1997  leo branches: 1.3.60;
Don't set the PA_SER2 bit by default, this has the nasty side effect that
it disables the IDE hardware on the Falcon (Thanks Markus ;-) ). A function
is provided to toggle the bit.
 1.2 17-Nov-1996  leo branches: 1.2.2;
Plug some spl-holes in the lp-driver. Also be more strict in protecting
the register access to the psg-chip. The combination of those bugs
caused the printer to print garbage sometimes.
 1.1 27-Mar-1996  leo Take out direct access to the YM2149. The chip definitions are moved
from video.h to ym2149reg.h.
 1.2.2.1 30-Jan-1997  thorpej update from trunk
 1.3.60.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.78.2 11-Mar-2010  yamt sync with head
 1.5.78.1 04-May-2009  yamt sync with head.
 1.82 06-Jul-2024  andvar Fix various typos in comments:
s/defininitions/definitions/
s/ininitialise/initialise/
s/collasped/collapsed/
s/optionaly/optionally/
 1.81 06-Jan-2023  tsutsui branches: 1.81.6;
TAB/spaces/indents cleanup.
 1.80 26-Jun-2022  tsutsui Make local devsw functions static.

No visible regression on TT030.
 1.79 03-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.78 08-Feb-2018  dholland branches: 1.78.16;
Typos.
 1.77 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.76 24-Mar-2014  christos branches: 1.76.2;
- remove unused
- use cpu_{g,s}etmodel() (not committed yet)
 1.75 16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.74 30-Jun-2011  wiz branches: 1.74.2; 1.74.12; 1.74.16;
dependant -> dependent
 1.73 24-Apr-2011  rmind Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.72 09-Apr-2010  tsutsui branches: 1.72.2;
- establish zs interrupts via common intr_establish() function rather than
hardcording them in locore.s and vector.s
- also make interrupt handlers take per unit softc and put a softint cookie
into softc (though atari machines have only one zs)
- tweak some structures as per MI z8530sc driver

Tested on TT030 using sl(4) on zs.
 1.71 09-Apr-2010  tsutsui minor constify
 1.70 09-Apr-2010  tsutsui More KNF.
 1.69 09-Apr-2010  tsutsui Split device_t/softc.
 1.68 09-Apr-2010  tsutsui Rename variables and members of softc for readability.
 1.67 09-Apr-2010  tsutsui Remove unnecessary volatile keyword against struct zschan.
(volatile against structure member is enough)
 1.66 09-Apr-2010  tsutsui - misc KNF
- remove `register' keyword from variable declarations
 1.65 09-Apr-2010  tsutsui Include ioconf.h for struct cfdriver.
 1.64 19-Jul-2009  tsutsui branches: 1.64.2; 1.64.4;
Replace one missed bcopy(9) with memcpy(9).
 1.63 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.62 18-Mar-2009  cegger bcopy -> memcpy
 1.61 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.60 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.59 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.58 28-Jan-2009  tjam branches: 1.58.2;
Remove sicallback to use the MI softint(9) APIs directly - from Tsutsui
 1.57 11-Jun-2008  tsutsui branches: 1.57.4; 1.57.6;
Use device_private() and device_lookup_privat() to get softc.
 1.56 29-Apr-2008  martin branches: 1.56.2; 1.56.4;
Convert to new 2 clause license
 1.55 08-Jan-2008  joerg branches: 1.55.6; 1.55.8; 1.55.10;
Convert Atari to generic TODR and timecounter.
 1.54 19-Nov-2007  ad branches: 1.54.6;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.53 06-Mar-2007  tsutsui branches: 1.53.2; 1.53.18; 1.53.20; 1.53.24; 1.53.26;
Make TX buffer (uint8_t *) and remove an unnecessary cast.
 1.52 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.51 01-Oct-2006  elad branches: 1.51.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.50 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.49 04-Aug-2006  mhitch branches: 1.49.4; 1.49.6;
More gcc4 "uninitilized" variables.
 1.48 23-Jul-2006  ad Use the LWP cached credentials where sane.
 1.47 14-May-2006  elad integrate kauth.
 1.46 08-Mar-2006  lukem branches: 1.46.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.45 11-Dec-2005  christos branches: 1.45.4; 1.45.6; 1.45.8; 1.45.10;
merge ktrace-lwp.
 1.44 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.43 04-Jun-2005  he branches: 1.43.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.42 25-Mar-2004  leo Licence cleanup (suggested by wiz).
 1.41 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.40 15-Jul-2003  lukem __KERNEL_RCSID()
 1.39 23-Oct-2002  jdolecek branches: 1.39.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.38 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 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.35 17-Mar-2002  atatat branches: 1.35.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.34 02-May-2001  scw branches: 1.34.2; 1.34.4; 1.34.8;
Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.33 01-Feb-2001  leo branches: 1.33.2;
Fix fallout from lastest tty changes.
 1.32 02-Nov-2000  eeh Adapt to new line discipline scheme.
 1.31 29-Mar-2000  leo Nuke a bunch of cf_unit abuses.
 1.30 11-Feb-1999  mycroft branches: 1.30.8;
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.29 25-Mar-1998  leo Sync with latest tty changes.
 1.28 12-Jan-1998  thorpej Update for changes to config.
 1.27 10-Mar-1997  leo Use vme_mask, not sys_mask to enable the SCC interrupt.
 1.26 21-Jan-1997  leo branches: 1.26.4;
Don't set the PA_SER2 bit by default, this has the nasty side effect that
it disables the IDE hardware on the Falcon (Thanks Markus ;-) ). A function
is provided to toggle the bit.
 1.25 20-Dec-1996  leo branches: 1.25.2;
Get rid of BROKEN_INDIRECT_CONFIG
 1.24 10-Nov-1996  leo Add frequency table for Hades.
 1.23 13-Oct-1996  christos backout previous kprintf changes
 1.22 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.21 18-Jun-1996  leo Add tty_attach() calls.
 1.20 15-May-1996  leo branches: 1.20.4;
Prototype + -Wall fixes.
 1.19 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.18 27-Mar-1996  leo Take out direct access to the YM2149. The chip definitions are moved
from video.h to ym2149reg.h.
 1.17 17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.16 08-Mar-1996  leo Fix a bug in the DCD handling. Because the state of the DCD line was
kept in a soft-copy that wasn't initialized on open, it sometimes happend
that a change of the carrier got lost. Also fixed some prototypes.
 1.15 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.14 23-Jan-1996  leo Fixes 'hanging' problem when closing a serial port.
 1.13 25-Dec-1995  leo - Remove an unwanted interference between the 2 channels.
- Allocate the ringbuffer on a channel's first open.
 1.12 16-Dec-1995  leo Correct PCLK value.
 1.11 03-Dec-1995  leo Return a more sensible errno when someone is trying to set the unsupported
mdmbuf option.
 1.10 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.9 23-Sep-1995  leo branches: 1.9.2;
Make sure the prototypes and inline definitions are included.
 1.8 20-Aug-1995  leo - make sure that there is 1 pending software interrupt max.
- read status before character, so the status won't be lost (Thomas Gerner)
- accumulate as much interrupts as possible in zshard()
 1.7 28-Jun-1995  cgd note that most of dev/ic's contents have changed names
 1.6 28-May-1995  leo According to diffs from Waldi Raven:
Make speed/clock-source selection smarter. This makes the baudrates more
accurate and allows speeds upto 115k baud.
 1.5 14-May-1995  leo Don't mess with SCU on the Falcon.
 1.4 22-Apr-1995  leo Adapt for new conf.h:
- Add xxxtty() functions
- Remove xxx_tty array
 1.3 11-Apr-1995  mycroft Undo accidental change.
 1.2 11-Apr-1995  mycroft Use global 8530 defs.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.9.2.1 15-Nov-1995  leo - Increase ringbuffer size.
- Make sure ser02 will be connected to the 8530 when being opened.
 1.20.4.1 18-Jun-1996  leo Pull up tty_attach() changes from trunk.
 1.25.2.1 30-Jan-1997  thorpej update from trunk
 1.26.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.30.8.3 11-Feb-2001  bouyer Sync with HEAD.
 1.30.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.30.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.33.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.34.8.5 11-Nov-2002  nathanw Catch up to -current
 1.34.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.34.8.3 17-Sep-2002  nathanw Catch up to -current.
 1.34.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.34.8.1 02-May-2001  nathanw file zs.c was added on branch nathanw_sa on 2002-04-01 07:39:33 +0000
 1.34.4.1 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.34.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.34.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.4.1 17-May-2002  gehenna Add device switch.
 1.39.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.39.6.4 17-Jan-2005  skrll Adapt to branch.
 1.39.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.39.6.1 03-Aug-2004  skrll Sync with HEAD
 1.43.2.5 21-Jan-2008  yamt sync with head
 1.43.2.4 07-Dec-2007  yamt sync with head
 1.43.2.3 03-Sep-2007  yamt sync with head.
 1.43.2.2 30-Dec-2006  yamt sync with head.
 1.43.2.1 21-Jun-2006  yamt sync with head.
 1.45.10.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.45.10.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.45.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.45.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.45.8.3 11-Aug-2006  yamt sync with head
 1.45.8.2 24-May-2006  yamt sync with head.
 1.45.8.1 13-Mar-2006  yamt sync with head.
 1.45.6.2 01-Jun-2006  kardel Sync with head.
 1.45.6.1 22-Apr-2006  simonb Sync with head.
 1.45.4.1 09-Sep-2006  rpaulo sync with head
 1.46.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.49.6.1 22-Oct-2006  yamt sync with head
 1.49.4.1 18-Nov-2006  ad Sync with head.
 1.51.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.53.26.2 18-Feb-2008  mjf Sync with HEAD.
 1.53.26.1 08-Dec-2007  mjf Sync with HEAD.
 1.53.24.1 21-Nov-2007  bouyer Sync with HEAD
 1.53.20.2 23-Mar-2008  matt sync with HEAD
 1.53.20.1 09-Jan-2008  matt sync with HEAD
 1.53.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.53.2.1 03-Dec-2007  ad Sync with HEAD.
 1.54.6.1 08-Jan-2008  bouyer Sync with HEAD
 1.55.10.4 11-Aug-2010  yamt sync with head.
 1.55.10.3 19-Aug-2009  yamt sync with head.
 1.55.10.2 04-May-2009  yamt sync with head.
 1.55.10.1 16-May-2008  yamt sync with head.
 1.55.8.2 17-Jun-2008  yamt sync with head.
 1.55.8.1 18-May-2008  yamt sync with head.
 1.55.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.55.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.56.4.1 18-Jun-2008  simonb Sync with head.
 1.56.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.57.6.1 02-Feb-2009  snj Pull up following revision(s) (requested by tjam in ticket #370):
sys/arch/atari/dev/zs.c: revision 1.58
Remove sicallback to use the MI softint(9) APIs directly - from Tsutsui
 1.57.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.57.4.1 03-Mar-2009  skrll Sync with HEAD.
 1.58.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.64.4.2 31-May-2011  rmind sync with head
 1.64.4.1 30-May-2010  rmind sync with head
 1.64.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.72.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.74.16.1 18-May-2014  rmind sync with head
 1.74.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.74.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.76.2.1 10-Aug-2014  tls Rebase.
 1.78.16.1 03-Apr-2021  thorpej Sync with HEAD.
 1.81.6.1 02-Aug-2025  perseant Sync with HEAD
 1.2 11-Apr-1995  mycroft Use global 8530 defs.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.18 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.17 15-Nov-2014  christos centralize the call unit / dialout macros
 1.16 09-Apr-2010  tsutsui branches: 1.16.18;
- establish zs interrupts via common intr_establish() function rather than
hardcording them in locore.s and vector.s
- also make interrupt handlers take per unit softc and put a softint cookie
into softc (though atari machines have only one zs)
- tweak some structures as per MI z8530sc driver

Tested on TT030 using sl(4) on zs.
 1.15 09-Apr-2010  tsutsui Remove unnecessary volatile keyword against struct zschan.
(volatile against structure member is enough)
 1.14 09-Apr-2010  tsutsui - misc KNF
- remove `register' keyword from variable declarations
 1.13 28-Jan-2009  tjam branches: 1.13.4; 1.13.6;
Use 8KB buffer for ZLRB_RING_SIZE to prevent overruns
 1.12 29-Apr-2008  martin branches: 1.12.8; 1.12.10;
Convert to new 2 clause license
 1.11 06-Mar-2007  tsutsui branches: 1.11.40; 1.11.42; 1.11.44;
Make TX buffer (uint8_t *) and remove an unnecessary cast.
 1.10 04-Mar-2007  christos 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 25-Mar-2004  leo branches: 1.8.16;
Licence cleanup (suggested by wiz).
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 25-Mar-1998  leo branches: 1.6.48;
Sync with latest tty changes.
 1.5 24-Jan-1996  gwr Move struct definitions to MD code.
 1.4 25-Dec-1995  leo - Remove an unwanted interference between the 2 channels.
- Allocate the ringbuffer on a channel's first open.
 1.3 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.2 11-Apr-1995  mycroft branches: 1.2.2;
Use global 8530 defs.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.2.1 15-Nov-1995  leo - Increase ringbuffer size.
- Make sure ser02 will be connected to the 8530 when being opened.
 1.6.48.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.48.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.48.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 03-Sep-2007  yamt sync with head.
 1.9.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.44.3 11-Aug-2010  yamt sync with head.
 1.11.44.2 04-May-2009  yamt sync with head.
 1.11.44.1 16-May-2008  yamt sync with head.
 1.11.42.1 18-May-2008  yamt sync with head.
 1.11.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.10.1 02-Feb-2009  snj Pull up following revision(s) (requested by tjam in ticket #370):
sys/arch/atari/dev/zsvar.h: revision 1.13
Use 8KB buffer for ZLRB_RING_SIZE to prevent overruns
 1.12.8.1 03-Mar-2009  skrll Sync with HEAD.
 1.13.6.1 30-May-2010  rmind sync with head
 1.13.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.16.18.1 03-Dec-2017  jdolecek update from HEAD
 1.28 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.27 12-Jul-2018  maxv branches: 1.27.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.26 24-Dec-2015  christos branches: 1.26.16; 1.26.18;
fenv for m68k
 1.25 17-Jul-2011  joerg branches: 1.25.12; 1.25.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.24 09-Feb-2007  ad Merge newlock2 to head.
 1.23 26-Jul-2006  drochner branches: 1.23.4;
don't install <machine/db_machdep.h>, this is kernel only
 1.22 11-Dec-2005  christos branches: 1.22.4; 1.22.8;
merge ktrace-lwp.
 1.21 08-May-2004  kleink branches: 1.21.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.20 17-Jan-2003  thorpej branches: 1.20.2;
Merge the nathanw_sa branch.
 1.19 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.18 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.17 28-Nov-2001  kleink branches: 1.17.8;
No point in installing svr4_machdep.h.
 1.16 15-Apr-2001  kleink branches: 1.16.2; 1.16.8;
Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.15 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.14 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
 1.13 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.12 26-Jun-2000  kleink branches: 1.12.2;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.11 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.10 17-Mar-2000  tron Install "machineendian_machdep.h".
 1.9 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.8 19-Apr-1999  kleink branches: 1.8.2;
Add COMPAT_SVR4 for m68k.
 1.7 31-Mar-1999  leo branches: 1.7.4;
Export mtpr.h :-( This is because cpu.h depends on it. Probably userland
should not need cpu.h...
 1.6 15-Mar-1999  minoura Pullin m68k/ieee.h.
 1.5 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.4 24-Nov-1998  leo You also need intr.h, psl.h, pte.h and vmparam.h to build the world...
 1.3 02-Sep-1998  leo Reorganize installation if include files. Nuke some from atari/include as
they make no sense out of the kernel add some from atari/dev (ioctl's).
 1.2 12-Jul-1998  veego Add elf_machdep.h to the INCS list.
 1.1 12-Jun-1998  cgd Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.7.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.2.2 21-Apr-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.16.8.5 11-Dec-2002  thorpej Sync with HEAD.
 1.16.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.16.8.3 08-Jan-2002  nathanw Catch up to -current.
 1.16.8.2 10-Nov-2001  scw Kernel mcontext glue for Scheduler Activations on m68k from
Klaus Klein <kleink@netbsd.org>.
 1.16.8.1 15-Apr-2001  scw file Makefile was added on branch nathanw_sa on 2001-11-10 21:22:48 +0000
 1.16.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.16.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.17.8.1 30-Aug-2002  gehenna catch up with -current.
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.21.12.2 26-Feb-2007  yamt sync with head.
 1.21.12.1 30-Dec-2006  yamt sync with head.
 1.22.8.1 11-Aug-2006  yamt sync with head
 1.22.4.1 09-Sep-2006  rpaulo sync with head
 1.23.4.1 01-Feb-2007  ad Header file cleanup.
 1.25.30.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.25.12.1 03-Dec-2017  jdolecek update from HEAD
 1.26.18.1 10-Jun-2019  christos Sync with HEAD
 1.26.16.1 28-Jul-2018  pgoyette Sync with HEAD
 1.27.36.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.3 09-Jun-1995  leo branches: 1.3.172;
Make hardware locations u_char instead of char
 1.2 26-Mar-1995  leo fix some formatting nits
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.172.1 11-Mar-2010  yamt sync with head
 1.4 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.3 26-Jul-2001  wiz branches: 1.3.6; 1.3.128;
auxilary -> auxiliary
 1.2 07-Jan-2001  leo branches: 1.2.4;
Make ahdi_part and ahdi_root 'packed' so I can use this include file on
an x86 machine to analyze my atari disk.
 1.1 19-Feb-1996  leo branches: 1.1.30;
New disklabel handling code (Waldi Ravens).
These are the final (?) modifications to the layout of the NetBSD/Atari
bootblock. The bootblock handling can be made backwards compatible using
the right config options (COMPAT_11 + DISKLABEL_AHDI).
 1.1.30.1 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.2.4.1 03-Aug-2001  lukem update to -current
 1.3.128.1 11-Mar-2010  yamt sync with head
 1.3.6.2 26-Jul-2001  wiz auxilary -> auxiliary
 1.3.6.1 26-Jul-2001  wiz file ahdilabel.h was added on branch nathanw_sa on 2001-07-26 23:07:58 +0000
 1.2 07-May-2019  kamil Switch all users (except ia64) of custom machine/ansi.h to common_ansi.h

Deduplicate the code among ports and poll definitions of types
directly from a compiler.

This fixes miscompilation of certain programs that instruct compilers
to generate code for different types. This bug has been detected with
-fshort-wchar in EFI firmware.

Proposed and discussed on a mailing list (twice).

Itanium uses custom !ELF fallback switch, temporarily leave it as it is.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.256;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.256.1 10-Jun-2019  christos Sync with HEAD
 1.3 08-Oct-1996  cgd repoint at shared aout_machdep.h, not exec.h
 1.2 08-Sep-1996  thorpej Use <m68k/exec.h>.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 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.40 17-Jul-2011  dyoung Switch to new-style <sys/bus.h>.
 1.39 08-Mar-2009  tsutsui ANSIfy, some KNF, misc cosmetics.
 1.38 05-Mar-2009  tsutsui Remove __P().
 1.37 28-Apr-2008  martin branches: 1.37.8; 1.37.14;
Remove clause 3 and 4 from TNF licenses
 1.36 06-Mar-2007  tsutsui branches: 1.36.40; 1.36.42; 1.36.44;
Change bus_space_handle_t from void * (formerly caddr_t) to u_long
to make things easier.
 1.35 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.34 21-Feb-2007  mrg add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
bus_addr_t min_addr,
bus_addr_t max_addr,
bus_dma_tag_t *newtag,
int flags)
void _bus_dmatag_destroy(bus_dma_tag_t tag)

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

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

XXX: bus_dma(9) needs an update still.
 1.33 11-Dec-2005  christos branches: 1.33.26;
merge ktrace-lwp.
 1.32 09-Mar-2005  matt branches: 1.32.4;
Add a dm_maxsegsz public member to bus_dmamap_t. This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create). dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.
 1.31 10-Nov-2003  wiz branches: 1.31.8; 1.31.10;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.30 15-Jun-2003  fvdl branches: 1.30.2;
Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
 1.29 28-Jan-2003  kent Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it.
 1.28 07-Jan-2002  thorpej Implement bus_space_mmap().
 1.27 19-Jul-2001  thorpej branches: 1.27.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.26 28-May-2001  leo branches: 1.26.2;
Add bus_space_vaddr().
 1.25 09-Mar-2001  leo Expand bus_dma implementation. It will now handle the bounce buffer
extensions needed to make the isa floppy driver on the Milan work.
 1.24 07-Mar-2001  thorpej Add the BUS_DMA_STREAMING flag.
 1.23 26-Jun-2000  simonb branches: 1.23.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.22 11-Apr-2000  leo branches: 1.22.4;
Add dummies for barrier methods (copied from i386).
 1.21 25-Jan-2000  drochner define a "BUS_SPACE_MAP_PREFETCHABLE" flag which basically means that
device accesses are idempotent (but should not be cached by the CPU)
 1.20 19-Jan-2000  leo Allow storage-space to be passed to the alloc_bus_space_tag() functions. This
permits static tags to be used during early console init.
 1.19 13-Dec-1999  leo Change the copy_region function to shutup gcc's unused warnings in some
cases. Use the bus_space_tag without doing something useful... (idea from
Matthias Drochner).
 1.18 28-Oct-1999  leo Use extent maps.
 1.17 14-Aug-1999  leo branches: 1.17.2; 1.17.4; 1.17.6;
Correct the argument order for memcpy(). This tremendously improves the
behaviour of wscons.... (Why did history create both bcopy & memcpy?)
 1.16 23-Mar-1999  drochner Add a macro to check for sufficient pointer alignment in bus.h context,
"BUS_SPACE_ALIGNED_POINTER()".
Equal to the param.h "ALIGNED_POINTER()" normally, but obeys additional
requirements of the bus_space_xxx_n() macros. (BUS_SPACE_DEBUG)
 1.15 08-Jan-1999  leo Make the abs_copy functions usable. The previous implementation caused
kernel "jump to zero" panics....
 1.14 01-Dec-1998  leo Fix the __abs_copy() macro (wrong parameters to __abs_opname).
 1.13 25-May-1998  leo Add bus_space_{read,write}_region_stream_N functions.
 1.12 10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.11 10-Mar-1998  leo Bus-dma implementation for the atari. Heavily based on the i386
implementation.
 1.10 16-Jan-1998  leo Add: bus_space_{read,write}_region_N() and bus_space_set_{multi,region}_N()
functions.
 1.9 02-Sep-1997  leo Add BUS_SPACE_MAP_* macro's.
 1.8 15-Jul-1997  leo branches: 1.8.2;
Implement bus_space_subregion()
 1.7 25-Jun-1997  leo Add the types for 'bus_dma_tag_t' and 'bus_dmamap_t'. While here, be a bit
more precise in using types of the bus_space* address arguments.
 1.6 03-Mar-1997  leo Add bus_space_peek_[1248] functions. These can be used by match/probe
functions.
 1.5 27-Jan-1997  leo branches: 1.5.4;
Fix typo's in last commit.
 1.4 27-Jan-1997  leo Change the type of bus_space_tag_t.
Add the bus_space_(read|write)* functions.
 1.3 08-Nov-1996  leo branches: 1.3.2;
Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.
 1.2 06-Nov-1996  leo Prototytpe bus_mem_map/bus_mem_unmap functions.
 1.1 05-Oct-1996  leo Minimal bus.h. Together with the minimal pci implementation, we have just
enough functionality to find a VGA card....
Will be expanded when I buy more pci-cards ;-)
 1.3.2.1 30-Jan-1997  thorpej update from trunk
 1.5.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.8.2.1 04-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.17.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.4.1 15-Nov-1999  fvdl Sync with -current
 1.17.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.17.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.22.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.23.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.23.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.26.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.26.2.1 03-Aug-2001  lukem update to -current
 1.27.6.3 28-Feb-2002  nathanw Catch up to -current.
 1.27.6.2 11-Jan-2002  nathanw More catchup.
 1.27.6.1 19-Jul-2001  nathanw file bus.h was added on branch nathanw_sa on 2002-01-11 23:38:12 +0000
 1.30.2.4 01-Apr-2005  skrll Sync with HEAD.
 1.30.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.30.2.1 03-Aug-2004  skrll Sync with HEAD
 1.31.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.31.8.1 29-Apr-2005  kent sync with -current
 1.32.4.2 03-Sep-2007  yamt sync with head.
 1.32.4.1 26-Feb-2007  yamt sync with head.
 1.33.26.2 12-Mar-2007  rmind Sync with HEAD.
 1.33.26.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.36.44.2 04-May-2009  yamt sync with head.
 1.36.44.1 16-May-2008  yamt sync with head.
 1.36.42.1 18-May-2008  yamt sync with head.
 1.36.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.37.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.3 27-Jan-2023  tsutsui Remove extra tabs.
 1.2 23-Sep-2019  skrll Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
 1.1 01-Jul-2011  dyoung branches: 1.1.54;
Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet. Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
 1.1.54.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 07-Dec-2023  thorpej extent(9) -> vmem(9)
 1.2 03-Jul-2022  tsutsui Move the iomem extent stuff managed by bus_space(9) and make them static.

Inspired by MD bus_space(9) implemantation of arc.
Briefly tested on TT030.
 1.1 01-Jul-2011  dyoung Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet. Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.77 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.76 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.75 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.74 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.73 23-Nov-2019  ad cpu_need_resched():

- Remove all code that should be MI, leaving the bare minimum under arch/.
- Make the required actions very explicit.
- Pass in LWP pointer for convenience.
- When a trap is required on another CPU, have the IPI set it locally.
- Expunge cpu_did_resched().
 1.72 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.71 22-Aug-2018  msaitoh - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
- Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
use them on all m68k machines.
 1.70 19-Oct-2013  christos branches: 1.70.28; 1.70.30;
make cpu_need_resched() macros consistent; __USE flags
 1.69 02-Feb-2012  tsutsui branches: 1.69.6; 1.69.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.68 15-Nov-2011  tsutsui branches: 1.68.4;
Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
 1.67 16-May-2011  tsutsui branches: 1.67.4;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.
 1.66 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.65 22-Dec-2010  matt branches: 1.65.2; 1.65.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.64 23-Nov-2009  rmind branches: 1.64.4;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.63 21-Oct-2009  rmind Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.62 05-Mar-2009  tsutsui Remove __P().
 1.61 27-Feb-2008  xtraeme branches: 1.61.4; 1.61.12; 1.61.18;
Remove CTL_MACHDEP_NAMES, it's not used anywhere.

Ok by martin@.
 1.60 08-Jan-2008  joerg branches: 1.60.2; 1.60.6;
Convert Atari to generic TODR and timecounter.
 1.59 17-Oct-2007  garbled branches: 1.59.2; 1.59.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.58 04-Aug-2007  ad branches: 1.58.2;
Add ci_cpuid where it's missing.
 1.57 21-May-2007  tsutsui branches: 1.57.2; 1.57.4; 1.57.8;
Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
 1.56 21-May-2007  tsutsui Remove obsolete decralations of switch_exit() and switch_lwp_ext().
 1.55 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.54 20-May-2007  isaki indent fix.
 1.53 18-May-2007  he Adapt to the merge of the yamt-idlelwp branch.
curcpu()->ci_want_resched is now required, so get rid of the
want_resched global. Also, cpu_need_resched() now takes two arguments.
The l_next and l_back fields in struct lwp no longer exists, so delete
references to it from genassym.cf.
Also, m68k/m68k/proc_subr.s is no longer used, says mhitch, so remove its use.

This brings the atari BOOT kernel back to a buildable state.
 1.52 21-Mar-2007  tsutsui branches: 1.52.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.51 04-Mar-2007  christos branches: 1.51.2; 1.51.4; 1.51.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.50 16-Feb-2007  ad branches: 1.50.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.49 09-Feb-2007  ad Merge newlock2 to head.
 1.48 22-Dec-2006  jdc We don't need the cpu_startup() prototype here. It is already provided by
sys/systm.h. Pointed out by skrll@.
 1.47 11-Dec-2005  christos branches: 1.47.20;
merge ktrace-lwp.
 1.46 04-Jun-2005  he branches: 1.46.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.45 26-Sep-2004  yamt don't expose cpu_info to userland.
 1.44 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.43 04-Jan-2004  jdolecek Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
as FPU state), and is the last potentially blocking operation;
all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
 1.42 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.41 10-May-2003  thorpej branches: 1.41.2;
Remove redundant bounds_check_with_label() prototype.
 1.40 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.39 20-Oct-2002  chs merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
- use m68k/cacheops.*, remove duplicates from cpu.h.
- centralize a few declarations in (all the copies of) cpu.h.
- define M68K_VAC on platforms which have a VAC.
- switch the sun platforms to the (now common) proc_trampoline().
- do the phys_map thang on the sun platforms too, no reason not to.
 1.38 08-Sep-2001  thomas branches: 1.38.4;
ELF adaption, clockframe must be packed.
 1.37 30-May-2001  mrg branches: 1.37.2; 1.37.4;
use _KERNEL_OPT
 1.36 07-Jan-2001  leo branches: 1.36.2;
Add the Milan as a possible machine type.
 1.35 19-Dec-2000  scw Unification of the m68k syscall() function.
 1.34 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.33 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.32 10-Aug-1999  thorpej branches: 1.32.2;
Define cpu_number() as discussed on tech-smp.
 1.31 26-Feb-1999  is synchronize types, and s/curproc/p/ in one forgotten place
 1.30 25-Feb-1999  is mac68k part of pr 6152 fix, and missing bits for the others
 1.29 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.28 07-Oct-1998  thorpej Oops, back out a buglet I didn't intend to commit in the last change.
 1.27 06-Oct-1998  thorpej configure() prototype is in <sys/device.h>
 1.26 05-Oct-1998  thorpej cpu_set_kpc() prototype is already in <sys/systm.h>.
 1.25 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.24 19-Feb-1998  leo Update Hades PCI support:
- Initialize the PCI bus and hand-out mem and i/o addresses. (there is
still lots of room for improvements here...)
- Implement the interupt functions
 1.23 26-Oct-1997  is Make these compile after m68k/m68k.h 1.4->1.5.
 1.22 02-Jun-1997  leo More stuff for handling an 68060.
 1.21 09-Apr-1997  thorpej regdump() is prototyped in <m68k/cpu.h> now
 1.20 04-Feb-1997  perry Nuke some options GENERIC residue.
 1.19 21-Jan-1997  leo Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.
 1.18 03-Jan-1997  leo branches: 1.18.2;
Get rid of 'cpu040' variable. Use 'mmutype' or 'cputype' for testing
instead.
 1.17 18-Dec-1996  leo Tweak the clockframe structure a bit so we are able to save a few cycles
at interrupt time. (From Gordon Ross).
 1.16 25-Oct-1996  leo Nuke declaration of susword(). It's declared in systm.h now.
 1.15 25-Sep-1996  leo Catchup with -current:
- Extra argument to boot()
- select -> poll
 1.14 11-Sep-1996  thorpej Use <m68k/cpu.h>.
 1.13 10-Sep-1996  leo Add suline/susword prototypes for new trap.c
 1.12 23-Aug-1996  leo - Make the Hades a valid machine type
- Add some 68040 specific prototypes.
 1.11 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.10 19-Jan-1996  leo - Remove FPU defines, the FPU-type is no longer determined by the loader.
- Add some forgotten CPU-types (Waldi Ravens).
 1.9 21-Dec-1995  mycroft Remove deprecated cpu_setstack().
 1.8 28-Jun-1995  cgd remove unused cpu_exec() definitions. moved "broken swap" markers, for
ports that still need it, to types.h.
 1.7 28-May-1995  leo Add CLKBROKEN define, so GEM version that are 2 years off on the RTC can
be identified.
 1.6 14-May-1995  leo - Remove double mapping of stack
- Change to new coredump format
 1.5 05-May-1995  cgd define BROKEN_SWAP and/or cpu_swapout as appropriate.
 1.4 30-Apr-1995  leo - Move softint definitions to mtpr.h
- Add flags for TT/Falcon model for machineid, we definitely need them
 1.3 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.2 30-Mar-1995  leo KERNEL -> _KERNEL
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.18.2.1 30-Jan-1997  thorpej update from trunk
 1.32.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.32.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.32.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.36.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.37.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.37.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.38.4.5 03-Dec-2002  gmcgarry Use cpu_proc_fork().
 1.38.4.4 11-Nov-2002  nathanw Catch up to -current
 1.38.4.3 08-Dec-2001  thorpej Add a cpu_proc_fork(), called from uvm_proc_fork(), which takes care
of machine-dependent handling a fork() time (this is different from
forking the actual context in an LWP world). #define it away on
platforms which do not need it.

Problem noted by Gregory McGarry.
 1.38.4.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.38.4.1 08-Sep-2001  scw file cpu.h was added on branch nathanw_sa on 2001-11-17 23:18:08 +0000
 1.41.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.41.2.5 19-Oct-2004  skrll Sync with HEAD
 1.41.2.4 24-Sep-2004  skrll Sync with HEAD.
 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.46.2.5 17-Mar-2008  yamt sync with head.
 1.46.2.4 21-Jan-2008  yamt sync with head
 1.46.2.3 03-Sep-2007  yamt sync with head.
 1.46.2.2 26-Feb-2007  yamt sync with head.
 1.46.2.1 30-Dec-2006  yamt sync with head.
 1.47.20.2 06-Feb-2007  ad Update m68k pasteware.
 1.47.20.1 12-Jan-2007  ad Sync with head.
 1.50.2.2 24-Mar-2007  yamt sync with head.
 1.50.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.51.6.1 29-Mar-2007  reinoud Pullup to -current
 1.51.4.1 11-Jul-2007  mjf Sync with head.
 1.51.2.3 20-Aug-2007  ad Sync with HEAD.
 1.51.2.2 27-May-2007  ad Sync with head.
 1.51.2.1 10-Apr-2007  ad Sync with head.
 1.52.4.2 03-Oct-2007  garbled Sync with HEAD
 1.52.4.1 22-May-2007  matt Update to HEAD.
 1.57.8.1 04-Aug-2007  jmcneill Sync with HEAD.
 1.57.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.57.2.1 07-Aug-2007  matt Sync with HEAD.
 1.58.2.2 23-Mar-2008  matt sync with HEAD
 1.58.2.1 06-Nov-2007  matt sync with HEAD
 1.59.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.59.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.60.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.60.2.1 24-Mar-2008  keiichi sync with head.
 1.61.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.61.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.61.4.2 11-Mar-2010  yamt sync with head
 1.61.4.1 04-May-2009  yamt sync with head.
 1.64.4.2 31-May-2011  rmind sync with head
 1.64.4.1 05-Mar-2011  rmind sync with head
 1.65.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.65.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.67.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.67.4.1 17-Apr-2012  yamt sync with head
 1.68.4.1 18-Feb-2012  mrg merge to -current.
 1.69.10.1 18-May-2014  rmind sync with head
 1.69.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.70.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.70.30.1 10-Jun-2019  christos Sync with HEAD
 1.70.28.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 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 24-Sep-2001  leo branches: 1.2.4; 1.2.170;
Enable ELF symbols in ddb.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.44; 1.1.1.1.46;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.46.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.1.1.44.1 01-Oct-2001  fvdl Catch up with -current.
 1.2.170.1 03-Dec-2017  jdolecek update from HEAD
 1.2.4.2 24-Sep-2001  leo Enable ELF symbols in ddb.
 1.2.4.1 24-Sep-2001  leo file db_machdep.h was added on branch nathanw_sa on 2001-09-24 09:21:25 +0000
 1.10 01-Oct-2011  chs fix build errors with gcc 4.5.
 1.9 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.8 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.7 26-Jul-2001  wiz branches: 1.7.6; 1.7.128;
auxilary -> auxiliary
 1.6 05-Feb-2000  jdc branches: 1.6.8;
Add definition for default swap partition (libahdi uses this).
 1.5 19-Feb-1996  leo branches: 1.5.30;
New disklabel handling code (Waldi Ravens).
These are the final (?) modifications to the layout of the NetBSD/Atari
bootblock. The bootblock handling can be made backwards compatible using
the right config options (COMPAT_11 + DISKLABEL_AHDI).
 1.4 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.3 05-Aug-1995  leo branches: 1.3.2;
Add disklabel support. In addition to the 'faked' disklables NetBSD/Atari
now also supports native NetBSD labels. When a NetBSD label is found it
overrules the Atari AHDI-partitioning.
 1.2 26-Mar-1995  leo fix some formatting nits
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.2.1 27-Oct-1995  leo Fix memory leak in disklabel code when used on removables.
 1.5.30.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.8.1 03-Aug-2001  lukem update to -current
 1.7.128.1 11-Mar-2010  yamt sync with head
 1.7.6.2 26-Jul-2001  wiz auxilary -> auxiliary
 1.7.6.1 26-Jul-2001  wiz file disklabel.h was added on branch nathanw_sa on 2001-07-26 23:07:58 +0000
 1.12 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.11 20-Oct-2009  snj branches: 1.11.22; 1.11.52;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.10 05-Mar-2009  tsutsui Remove __P().
 1.9 04-Mar-2007  christos branches: 1.9.44; 1.9.52; 1.9.58;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 22-Feb-1996  leo branches: 1.8.80; 1.8.118;
First bunch of changes due to stricter prototype checking.
 1.7 11-Jul-1995  leo Make DD/HD selection do anything sensible.
 1.6 14-May-1995  leo Function proto added.
 1.5 05-May-1995  leo Define dma_drvmode correctly
 1.4 30-Apr-1995  leo Added lock status bits, update function prototypes.
 1.3 22-Apr-1995  leo - Prefix 'dma-defines' with DMA_
- Add function prototypes
 1.2 26-Mar-1995  leo fix some formatting nits
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.8.118.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.80.1 03-Sep-2007  yamt sync with head.
 1.9.58.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.52.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.44.2 11-Mar-2010  yamt sync with head
 1.9.44.1 04-May-2009  yamt sync with head.
 1.11.52.1 27-Sep-2017  jdolecek pass ata channel interlock to st_dmagrab() so that it can release
and reacquire it if it sleeps
 1.11.22.1 03-Dec-2017  jdolecek update from HEAD
 1.1 12-Jul-1998  thorpej Basic elf_machdep.h for m68k; doesn't include relocations, yet.
 1.3 17-Mar-2000  mycroft In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.2 24-Jan-1999  mycroft branches: 1.2.8;
Format consistency.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 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.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:05:28 +0000
 1.3 08-Oct-1996  cgd moved to aout_machdep.h (via repository copy)
 1.2 08-Sep-1996  thorpej Use <m68k/exec.h>.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 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:35:57 +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:32 +0000
 1.2 03-Feb-1998  mycroft Prototype __flt_rounds() consistently.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.18;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.18.1 08-May-1998  mycroft Sync with trunk, per request of mycroft.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2 30-Aug-1999  mycroft A foolish consistency.
 1.1 15-Mar-1999  minoura Pullin m68k/ieee.h.
 1.2 16-Apr-1995  jtc Fix typo: ieefp.h -> ieeefp.h.
 1.1 09-Apr-1995  mycroft Move fp_except and fp_rnd definitions to machine/include.
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 integer constant macros.
 1.1.12.2 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
 1.1.12.1 14-Apr-2001  kleink file int_const.h was added on branch nathanw_sa on 2001-04-14 22:38:36 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 14-Apr-2001  bouyer file int_const.h was added on branch thorpej_scsipi on 2001-04-21 17:53: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:08 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_fmtio.h was added on branch thorpej_scsipi on 2001-04-21 17:53:25 +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:05 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_limits.h was added on branch thorpej_scsipi on 2001-04-21 17:53:25 +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:52 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 14-Apr-2001  bouyer file int_mwgwtypes.h was added on branch thorpej_scsipi on 2001-04-21 17:53: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:05:29 +0000
 1.25 19-Jan-2024  thorpej Now that we've agreed on the name "intr_depth", let's agree on the type, too.
 1.24 19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.23 11-Jul-2023  riastradh atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).
 1.22 02-Apr-2021  rin branches: 1.22.16;
For ports with __HAVE_LEGACY_INTRCNT, turn intrcnt[] and derived
variables into u_int, to match with kern/subr_evcnt.c.
 1.21 08-Jul-2009  tsutsui branches: 1.21.76; 1.21.78;
Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.20 05-Mar-2009  tsutsui Remove __P().
 1.19 27-Dec-2008  tsutsui branches: 1.19.2;
Account idepth in all interrupt handlers in locore.s.
 1.18 28-Jun-2008  isaki branches: 1.18.4; 1.18.6;
Unify splraiseipl(9) implementation among m68k ports,
discussed with tsutsui@ on port-m68k. OK'ed by jdc@.

For atari:
- 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)
- vme/if_le_vme.c: fix a wrong usage of IPL_NET
 1.17 28-Apr-2008  martin branches: 1.17.2; 1.17.4;
Remove clause 3 and 4 from TNF licenses
 1.16 03-Dec-2007  ad branches: 1.16.14; 1.16.16; 1.16.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.15 21-Mar-2007  tsutsui branches: 1.15.12; 1.15.14; 1.15.20;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.14 11-Mar-2007  thorpej branches: 1.14.2; 1.14.4;
- 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.13 16-Feb-2007  ad branches: 1.13.2; 1.13.6;
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.12 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.11 13-Apr-2001  thorpej branches: 1.11.8; 1.11.40; 1.11.70; 1.11.72;
Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.10 14-Jan-2001  thorpej branches: 1.10.2;
Make sure everybody has an splvm() and equate it with splimp() (splimp()
is the historical name for this interrupt level, and the historical name
is going to go away in the near future).
 1.9 22-Aug-2000  thorpej Add spllock(). See spl(9) for details.
 1.8 05-Aug-1999  thorpej branches: 1.8.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.7 18-Jul-1998  is Switching dev/ic/lpt.c to use spllpt() instead of spltty(). It doesn't use
tty structures, and on some machines (namely the DraCo internal lpt, and some
multi-i/o boards for Amigas and DraCos), tying spltty to the pretty high printer
interupt level would hurt serial performance.

On all affected ports but Amiga, spllpt() has been defined in machine/intr.h
to be spltty(), thus preserving old behaviour. Portmasters are encouraged to
change is, if they feel something else is better (e.g., one of its own were
possible).
 1.6 25-May-1998  leo Fix some severe bogons in the pci and isa interrupt system.
 1.5 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.4 29-Aug-1997  leo Pull in Scott Reynolds' version of _splraise(). Also do a bit of typographic
cleanup while visting this file.
 1.3 05-Jun-1997  leo branches: 1.3.4;
Implement and use splraise().
 1.2 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.1 26-Feb-1997  leo branches: 1.1.2;
Move all spl-related stuff to the new file intr.h. The latter file also
contains some generic defines used by the drivers in dev/[pci|isa].
 1.1.2.2 12-Mar-1997  is Merge in Changes from The Trunk.
 1.1.2.1 26-Feb-1997  is file intr.h was added on branch is-newarp on 1997-03-12 14:46:52 +0000
 1.3.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.4.1 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.8.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 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.10.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.11.72.2 05-Nov-2006  yamt add IPL_VM.
 1.11.72.1 05-Nov-2006  yamt splraiseipl/makeiplcookie for atari.
 1.11.70.1 12-Jan-2007  ad Sync with head.
 1.11.40.4 07-Dec-2007  yamt sync with head
 1.11.40.3 03-Sep-2007  yamt sync with head.
 1.11.40.2 26-Feb-2007  yamt sync with head.
 1.11.40.1 30-Dec-2006  yamt sync with head.
 1.11.8.2 13-Apr-2001  thorpej Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.11.8.1 13-Apr-2001  thorpej file intr.h was added on branch nathanw_sa on 2001-04-13 23:30:00 +0000
 1.13.6.3 03-Dec-2007  ad Sync with HEAD.
 1.13.6.2 10-Apr-2007  ad Sync with head.
 1.13.6.1 13-Mar-2007  ad Sync with head.
 1.13.2.2 24-Mar-2007  yamt sync with head.
 1.13.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.4.1 29-Mar-2007  reinoud Pullup to -current
 1.14.2.1 11-Jul-2007  mjf Sync with head.
 1.15.20.1 08-Dec-2007  mjf Sync with HEAD.
 1.15.14.1 09-Jan-2008  matt sync with HEAD
 1.15.12.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.16.18.3 18-Jul-2009  yamt sync with head.
 1.16.18.2 04-May-2009  yamt sync with head.
 1.16.18.1 16-May-2008  yamt sync with head.
 1.16.16.1 18-May-2008  yamt sync with head.
 1.16.14.3 17-Jan-2009  mjf Sync with HEAD.
 1.16.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.16.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.4.1 03-Jul-2008  simonb Sync with head.
 1.17.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.18.6.1 06-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #219):
sys/arch/atari/include/intr.h: revision 1.19
sys/arch/atari/atari/locore.s: revision 1.102
sys/arch/atari/atari/intr.c: revision 1.16
Account idepth in all interrupt handlers in locore.s.
 1.18.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.18.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.21.78.1 03-Apr-2021  thorpej Sync with HEAD.
 1.21.76.1 03-Apr-2021  thorpej Sync with HEAD.
 1.22.16.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.17 08-Sep-2024  rillig fix a/an grammar in obvious cases
 1.16 18-Oct-2014  snj branches: 1.16.56;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.15 10-Aug-2012  tsutsui branches: 1.15.2;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)
 1.14 20-Oct-2009  snj branches: 1.14.12;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.13 23-Aug-2009  mrg fix atari builds in two ways:
- isa_detach_hook() was missing a parameter name (hi dyoung!)
- PCI_CONF_SIZE -> PCI_CONFIG_SIZE; pcivar.h has a PCI_CONF_SIZE now (hi jak!)
 1.12 02-Apr-2003  thorpej branches: 1.12.108;
Use PAGE_SIZE rather than NBPG.
 1.11 15-Apr-2002  bjh21 Only include opt_*.h #ifdef _KERNEL_OPT.
 1.10 28-May-2001  leo branches: 1.10.2; 1.10.8;
PCI_VGA_SIZE -> PCI_MEM_SIZE. (Plus some comments on those constants).
 1.9 12-Apr-2001  leo Update these for Milan addresses.
 1.8 06-Jan-2000  leo branches: 1.8.6;
Determine the default floppy type on the TT/Falcon by reading the config
switches. (Thanks to Michael Schwingen for the missing bits of information!).
 1.7 06-Dec-1999  leo Implement an allocator for VA-space using fixed extent maps. It is now
possible to allocate VA-space before uvm is initialized.
 1.6 22-Sep-1999  leo branches: 1.6.2; 1.6.8;
Reverse the order in which PCI cards are scanned. Now the order matches the
TOS-scan order. This causes TOS & NetBSD to use the same video card on
a system with multiple VGA cards.
 1.5 20-Dec-1998  thomas Changed grf mmap that it is closer to XFree. VGA memory on et4000/et6000
is now at offset 0xa0000.
 1.4 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.3 23-Aug-1996  leo - Make all definitions relative to 'stio_addr'
- Add the PCI areas.
 1.2 26-Mar-1995  leo fix some formatting nits
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.6.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.6.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.8.2 17-Apr-2002  nathanw Catch up to -current.
 1.10.8.1 28-May-2001  nathanw file iomap.h was added on branch nathanw_sa on 2002-04-17 00:02:41 +0000
 1.10.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.108.2 11-Mar-2010  yamt sync with head
 1.12.108.1 16-Sep-2009  yamt sync with head
 1.14.12.1 30-Oct-2012  yamt sync with head
 1.15.2.1 03-Dec-2017  jdolecek update from HEAD
 1.16.56.1 02-Aug-2025  perseant Sync with HEAD
 1.18 18-Oct-2016  jdolecek add isa_intr_establish_xname() to MD isa headers so that it can be used
by MI drivers
 1.17 27-Oct-2012  chs branches: 1.17.14; 1.17.18;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.16 01-Jul-2011  dyoung branches: 1.16.2; 1.16.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.15 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.14 19-Aug-2009  dyoung (Re-)define isa_detach_hook(), and define isa_dmadestroy(). Update
some isa_chipset_tag_t->ic_detach_hook() definitions.
 1.13 08-Jul-2009  tsutsui Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.12 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.11 09-May-2003  fvdl branches: 1.11.104; 1.11.106; 1.11.108;
A few ISA sound drivers like to share dma channels, and hence deferred
isa_dmamap_create() calls to their open/close entrypoints. This worked
with some luck, but broke on i386 when _bus_dmamap_create started
to allocate bounce buffers upfront, since memory below 16M may well
not be available when the sound devices is opened for the Nth time.

To fix this, create a new simple interface, isa_drq_alloc/isa_drq_free,
wrappers around already existing bitmask macros. These are expected
to be used before an isa_dmamap_create call, and after an
isa_dmamap_destroy call, respectively. For the sb and ad1848 drivers,
they're deferred until open/close.

All isa_dmamap_create calls can now use BUS_DMA_ALLOCNOW and be done
at attach time.
 1.10 12-Apr-2001  leo branches: 1.10.8;
Update these for Milan addresses.
 1.9 04-Jun-2000  cgd branches: 1.9.4;
Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.8 01-Jun-2000  cgd kill __P in these files. (I had to look at them anyway with an eye for
adding some protos... and adding them with __P seems wrong, but mixing
__P and not __P in the same file seems wrong too, so...)
 1.7 07-Feb-2000  thorpej branches: 1.7.2;
Add a new function call to the ISA DMA API: isa_dmamaxsize(), which returns
the maximum transfer size for the specified DMA channel. Make all clients
of ISA DMA use this call to determine their maximum transfer size.
 1.6 21-Oct-1999  leo Add prototype of isa_intr_alloc().
 1.5 19-Mar-1999  cgd branches: 1.5.8; 1.5.10; 1.5.12;
Moved from arch/atari/isa/isa_machdep.h,v
 1.4 09-Jun-1998  thorpej Add isa_dma{freeze,thaw}(), used to temporarily stop and then restart
all ISA DMA. Needed by e.g. the SmartCard reader for Sharks.
 1.3 09-Jun-1998  thorpej Change the ISA DMA API to take an isa_chipset_tag_t rather than
a struct device * corresponding to the ISA bus device. The ISA DMA
controller driver functions have been renamed and now take a struct
isa_dma_state *, and are called indirectly by machine-dependent code
which provides the DMA state.

These changes allow e.g. `ofisa' (the OpenFirmware configuration
mechanism for the ISA bus, used by e.g. Sharks) to use the MI ISA
DMA controller code.
 1.2 22-Apr-1998  leo Fix prototype of interrupt function.
 1.1 15-Jul-1997  leo branches: 1.1.1;
Initial revision
 1.1.1.1 15-Jul-1997  leo isabus support
 1.5.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.10.1 15-Nov-1999  fvdl Sync with -current
 1.5.8.2 21-Apr-2001  bouyer Sync with HEAD
 1.5.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.9.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.8.2 12-Apr-2001  leo Update these for Milan addresses.
 1.10.8.1 12-Apr-2001  leo file isa_machdep.h was added on branch nathanw_sa on 2001-04-12 07:17:31 +0000
 1.11.108.4 11-Mar-2010  yamt sync with head
 1.11.108.3 19-Aug-2009  yamt sync with head.
 1.11.108.2 18-Jul-2009  yamt sync with head.
 1.11.108.1 16-May-2008  yamt sync with head.
 1.11.106.1 18-May-2008  yamt sync with head.
 1.11.104.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.12.2 03-Dec-2017  jdolecek update from HEAD
 1.16.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.16.2.1 30-Oct-2012  yamt sync with head
 1.17.18.1 04-Nov-2016  pgoyette Sync with HEAD
 1.17.14.1 05-Dec-2016  skrll Sync with HEAD
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 01-Jun-2000  cgd branches: 1.4.128; 1.4.130; 1.4.132;
kill __P in these files. (I had to look at them anyway with an eye for
adding some protos... and adding them with __P seems wrong, but mixing
__P and not __P in the same file seems wrong too, so...)
 1.3 19-Mar-1999  cgd branches: 1.3.8; 1.3.16;
Moved from arch/atari/isa/isapnp_machdep.h,v
 1.2 05-Sep-1998  christos Assign copyright to TNF.
 1.1 22-Apr-1998  leo Add isapnp stuff (Thomas Gerner)
 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.132.1 16-May-2008  yamt sync with head.
 1.4.130.1 18-May-2008  yamt sync with head.
 1.4.128.1 02-Jun-2008  mjf Sync with HEAD.
 1.1 10-Mar-1996  leo Add the include files and the atari kernel support for new format panic
dumps.
 1.2 28-Mar-2012  christos - Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.206; 1.1.1.1.210;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.210.1 05-Apr-2012  mrg sync to latest -current.
 1.1.1.1.206.1 17-Apr-2012  yamt sync with head
 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:05:29 +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:31 +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:05:29 +0000
 1.2 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 10-Nov-2001  scw branches: 1.1.2;
file mcontext.h was initially added on branch nathanw_sa.
 1.1.2.1 10-Nov-2001  scw Kernel mcontext glue for Scheduler Activations on m68k from
Klaus Klein <kleink@netbsd.org>.
 1.6 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.5 03-May-2003  wiz branches: 1.5.108;
DMA, not dma nor Dma.
 1.4 11-Apr-2001  leo branches: 1.4.8;
Adapt these for use on the Milan.
 1.3 15-Jul-1997  leo branches: 1.3.20; 1.3.32;
Isabus support.
 1.2 26-Mar-1995  leo fix some formatting nits
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.32.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.20.1 21-Apr-2001  bouyer Sync with HEAD
 1.4.8.2 11-Apr-2001  leo Adapt these for use on the Milan.
 1.4.8.1 11-Apr-2001  leo file mfp.h was added on branch nathanw_sa on 2001-04-11 14:45:08 +0000
 1.5.108.1 11-Mar-2010  yamt sync with head
 1.5 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.4 20-Oct-2009  snj branches: 1.4.22; 1.4.40;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.3 11-Dec-2005  christos branches: 1.3.78;
merge ktrace-lwp.
 1.2 03-Sep-2004  leo Correct typo in copyright notice. (noticed by Hubert Feyrer).
 1.1 12-Apr-1996  leo branches: 1.1.64;
Add 3-button mouse support.
 1.1.64.2 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.64.1 18-Sep-2004  skrll Sync with HEAD.
 1.3.78.1 11-Mar-2010  yamt sync with head
 1.4.40.1 22-Sep-2015  skrll Sync with HEAD
 1.4.22.1 03-Dec-2017  jdolecek update from HEAD
 1.8 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

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

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 23-May-2002  leo branches: 1.5.6;
Fix the siron()/siroff() macro's. They were using a too loose contraint
that made the wd-driver fall over on kernels compiled with the latest
assembler. The macro;s now use the single_inst_*() functions so there
are less places to go wrong here next time...
 1.4 15-Sep-1997  leo branches: 1.4.30; 1.4.34; 1.4.42; 1.4.44;
Small readability update.
 1.3 04-Jul-1996  leo branches: 1.3.10;
Change accesses to 'ssir' to inline asm macro's.
 1.2 30-Apr-1995  leo branches: 1.2.6;
Moved softint definitions still in cpu.h into mtpr.h and did some minor
cleanups.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.6.1 19-Jul-1996  jtc Pulled up from rev 1.3 by request from Leo Weppelman
 1.3.10.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.44.1 28-May-2002  lukem Pull up revision 1.5 (requested by leo):
Fix the siron()/siroff() macro's. They were using a too loose contraint
that made the wd-driver fall over on kernels compiled with the latest
assembler. The macro;s now use the single_inst_*() functions so there
are less places to go wrong here next time...
 1.4.42.1 30-May-2002  gehenna Catch up with -current.
 1.4.34.1 20-Jun-2002  nathanw Catch up to -current.
 1.4.30.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.108.1 17-Feb-2011  bouyer Sync with HEAD
 1.7.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.100.1 05-Mar-2011  rmind sync with head
 1.2 09-Feb-2007  ad branches: 1.2.4;
Merge newlock2 to head.
 1.1 22-Dec-2006  ad branches: 1.1.2;
file mutex.h was initially added on branch newlock2.
 1.1.2.1 22-Dec-2006  ad Pull in CPU specific stubs.
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file mutex.h was added on branch yamt-lazymbuf on 2007-02-26 09:06:09 +0000
 1.35 10-Feb-2012  para proper sizing of kmem_arena on different ports

PR port-i386/45946: Kernel locks up in VMEM system
 1.34 08-Feb-2011  rmind branches: 1.34.4; 1.34.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.33 11-Dec-2009  tsutsui branches: 1.33.4; 1.33.6; 1.33.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.32 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.31 03-Jan-2008  joerg branches: 1.31.10;
Simplify delay based on x86 version.
 1.30 11-Dec-2005  christos branches: 1.30.24; 1.30.50; 1.30.56; 1.30.64; 1.30.68;
merge ktrace-lwp.
 1.29 07-Aug-2003  agc branches: 1.29.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.28 01-Nov-2000  leo branches: 1.28.24;
Do not pull-in machine/intr.h when _KERNEL is not defined. This fixes
compilation problems in the regression tests.
 1.27 11-Feb-2000  thorpej branches: 1.27.4;
Update for the NKMEMPAGES changes.
 1.26 04-Dec-1999  ragge CL* discarding.
 1.25 20-Sep-1997  leo branches: 1.25.16; 1.25.22;
Move the definition of MSGBUFSIZE up to the machine-arch level if
possible. Pointed out by Bernd Ernesti.
 1.24 19-Sep-1997  leo Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
 1.23 10-Jul-1997  veego branches: 1.23.2;
Restore the defines of UPAGES and NPTEPG.
 1.22 10-Jun-1997  veego The 'Mach derived conversion macros' are now in <m68k/param.h>
 1.21 10-Jun-1997  veego Use the MI <m68k/param.h> include.
 1.20 26-Feb-1997  leo Allow MCLSHIFT to be overridden by a config option.
 1.19 26-Feb-1997  leo Move all spl-related stuff to the new file intr.h. The latter file also
contains some generic defines used by the drivers in dev/[pci|isa].
 1.18 24-Feb-1997  fvdl Define ALIGNED_POINTER
 1.17 27-Jan-1997  leo branches: 1.17.4;
Make MCLBYTES 2K.
 1.16 03-Jan-1997  leo branches: 1.16.2;
Get rid of 'cpu040' variable. Use 'mmutype' or 'cputype' for testing
instead.
 1.15 13-Oct-1996  christos backout previous kprintf changes
 1.14 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13 04-Mar-1996  cgd add _MACHINE and _MACHINE_ARCH, which are like MACHINE and MACHINE_ARCH,
execpt without quotes. meant to be __CONCAT()ted for easy #includes
of machine-dependent headers for MI code (e.g. for the MI ISA/EISA/PCI/TC
bus code).
 1.12 01-Mar-1996  cgd Clean up tabbing/spacing in defns of MACHINE, MACHINE_ARCH, and MID_MACHINE.
 1.11 22-Feb-1996  leo First bunch of changes due to stricter prototype checking.
 1.10 07-Jan-1996  leo Remove a stray MAXPARTITIONS definition.
 1.9 13-Aug-1995  mycroft Replace splnet() with splsoftnet(). Add splnet(). Make splimp() > spltty().
 1.8 28-Jun-1995  cgd kill user-land DELAY macro, as suggested by gwr.
 1.7 26-Jun-1995  cgd clean up definitions of ctod(), dtoc(), ctob(), btoc(), btodb(), and
dbtob(). remove unused definitions of ctos(), stoc(), and dtob().
 1.6 30-Apr-1995  leo Get 68040 defines in line with other 68k ports so libkvm/kvm_m68k.c compiles
cleanly.
 1.5 22-Apr-1995  leo Define DELAY to call delay()
 1.4 30-Mar-1995  leo KERNEL -> _KERNEL
 1.3 26-Mar-1995  leo fix some formatting nits
 1.2 26-Mar-1995  leo cgd for leo: kill some casts; catch up with the state of the rest of the world
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.16.2.1 30-Jan-1997  thorpej update from trunk
 1.17.4.1 12-Mar-1997  is Merge in Changes from The Trunk.
 1.23.2.1 22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.25.22.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.25.16.2 22-Nov-2000  bouyer Sync with HEAD.
 1.25.16.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.27.4.1 01-Nov-2000  tv Pullup 1.28 [leo]:
Do not pull-in machine/intr.h when _KERNEL is not defined. This fixes
compilation problems in the regression tests.
 1.28.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.24.1 03-Aug-2004  skrll Sync with HEAD
 1.29.16.1 21-Jan-2008  yamt sync with head
 1.30.68.1 03-Jan-2009  jdc Pull up revisions:
1.39 sys/arch/atari/dev/clock.c
1.31 sys/arch/atari/include/param.h
(requested by tsutsui in ticket #1253).

Simplify delay based on x86 version.
 1.30.64.1 08-Jan-2008  bouyer Sync with HEAD
 1.30.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.30.50.1 09-Jan-2008  matt sync with HEAD
 1.30.24.1 02-Jan-2009  jdc Pull up revisions:
1.39 sys/arch/atari/dev/clock.c
1.31 sys/arch/atari/include/param.h
(requested by tsutsui in ticket #1253).

Simplify delay based on x86 version.
 1.31.10.1 11-Mar-2010  yamt sync with head
 1.33.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.33.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.33.4.1 05-Mar-2011  rmind sync with head
 1.34.8.1 18-Feb-2012  mrg merge to -current.
 1.34.4.1 17-Apr-2012  yamt sync with head
 1.9 01-Jan-2009  tsutsui Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.8 31-Dec-2008  tsutsui Remove quite obsolete pcb_cmap2.
 1.7 04-Mar-2007  christos branches: 1.7.40; 1.7.44; 1.7.52; 1.7.54;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 11-Dec-2005  christos branches: 1.6.24; 1.6.26;
merge ktrace-lwp.
 1.5 07-Aug-2003  agc branches: 1.5.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 30-Sep-2000  leo branches: 1.4.24;
Add PCB_REGS_* defines. This makes ddb compile again.
 1.3 06-Jan-1998  thorpej branches: 1.3.14;
The user segment table pointer is no longer kept here. Change it to
a spare field.

XXX Should be changed to use generic m68k PCB!
 1.2 14-May-1995  leo Fixup comment.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.24.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 03-Sep-2007  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.7.54.2 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.69
sys/arch/atari/atari/pmap.c: revision 1.111 via patch
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.9
sys/arch/atari/include/pmap.h: revision 1.39 via patch
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and
pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.7.54.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/include/pcb.h: revision 1.8
Remove quite obsolete pcb_cmap2.
 1.7.52.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.44.1 04-May-2009  yamt sync with head.
 1.7.40.1 17-Jan-2009  mjf Sync with HEAD.
 1.16 29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.15 27-Oct-2012  chs branches: 1.15.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.14 04-Apr-2011  dyoung branches: 1.14.4; 1.14.14;
Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.13 08-Jul-2009  tsutsui branches: 1.13.4; 1.13.6;
Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.12 11-Dec-2005  christos branches: 1.12.78;
merge ktrace-lwp.
 1.11 29-Jul-2004  drochner remove now unnecessary "pci_enumerate_bus" definitions
 1.10 15-May-2002  thorpej branches: 1.10.10;
Let machine-dependent code specify how to enumerate the bus.
Currently, everyone uses pci_enumerate_bus_generic().
 1.9 15-May-2002  thorpej Implement pci_decompose_tag().
 1.8 08-Jun-2001  simonb branches: 1.8.2; 1.8.8;
For ports that wire up pciide in compatibility mode, have
them define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
in pci_machdep.h and pciide_map_compat_intr() only calls
pciide_machdep_compat_intr_establish() if that preprocessor
define exists.

Ports that don't need to do this no longer need to supply a
dummy function.
 1.7 28-Dec-2000  sommerfeld branches: 1.7.2;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
 1.6 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.5 01-Jun-2000  cgd kill __P in these files. (I had to look at them anyway with an eye for
adding some protos... and adding them with __P seems wrong, but mixing
__P and not __P in the same file seems wrong too, so...)
 1.4 19-Mar-1999  cgd branches: 1.4.8; 1.4.16;
Moved from arch/atari/pci/pci_machdep.h,v
 1.3 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.2 19-Feb-1998  leo Update Hades PCI support:
- Initialize the PCI bus and hand-out mem and i/o addresses. (there is
still lots of room for improvements here...)
- Implement the interupt functions
 1.1 05-Oct-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 05-Oct-1996  leo minimal pci support
 1.4.16.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.8.2 05-Jan-2001  bouyer Sync with HEAD
 1.4.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 21-Jun-2001  nathanw Catch up to -current.
 1.8.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.8.8.1 08-Jun-2001  nathanw file pci_machdep.h was added on branch nathanw_sa on 2002-06-20 03:38:19 +0000
 1.8.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.10.1 03-Aug-2004  skrll Sync with HEAD
 1.12.78.1 18-Jul-2009  yamt sync with head.
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 21-Apr-2011  rmind sync with head
 1.14.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.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.14.4.1 30-Oct-2012  yamt sync with head
 1.15.2.1 18-May-2014  rmind sync with head
 1.43 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.42 21-Apr-2022  andvar s/substract/subtract/ in comments and error message.
s/obtainted/obtained/ in one comment.
 1.41 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.40 13-Mar-2009  abs Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.
 1.39 01-Jan-2009  tsutsui branches: 1.39.2;
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.38 09-Dec-2008  pooka Make pmap_kernel() a MI macro for struct pmap *kernel_pmap_ptr,
which is now the "API" provided by the pmap module. pmap_kernel()
remains as the syntactic sugar.

Bonus cosmetics round: move all the pmap_t pointer typedefs into
uvm_pmap.h.

Thanks to Greg Oster for providing cpu muscle for doing test builds.
 1.37 15-Nov-2008  abs Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
 1.36 11-Jan-2008  he branches: 1.36.6; 1.36.10; 1.36.16; 1.36.18; 1.36.20;
Include <sys/simplelock.h> to pull in appropriate definitions.
 1.35 21-Feb-2007  thorpej branches: 1.35.22; 1.35.28; 1.35.34;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.34 16-Feb-2006  perry branches: 1.34.18; 1.34.20;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.33 24-Dec-2005  perry branches: 1.33.2; 1.33.4; 1.33.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.32 11-Dec-2005  christos merge ktrace-lwp.
 1.31 07-Aug-2003  agc branches: 1.31.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.30 02-Apr-2003  thorpej branches: 1.30.2;
Use PAGE_SIZE rather than NBPG.
 1.29 22-Sep-2002  chs it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.
 1.28 22-Sep-2002  chs add pmap_remove_all() hook (empty on most platforms so far).
 1.27 10-Sep-2001  chris branches: 1.27.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.26 26-May-2001  chs branches: 1.26.2; 1.26.4;
replace vm_page_t with struct vm_page *.
 1.25 26-May-2001  chs replace {simple_,}lock{_data,}_t with struct {simple,}lock {,*}.
 1.24 22-Apr-2001  thorpej Undo a misguided previous change to the pmap_update() API.
 1.23 22-Apr-2001  thorpej Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.
 1.22 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.21 28-Sep-2000  is branches: 1.21.2;
The Atari pmap does wired page accounting; advertize it to UVM.
 1.20 25-Feb-1999  is branches: 1.20.8; 1.20.18;
Atari part of fix for pr 6152
 1.19 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.18 07-May-1998  leo Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.
 1.17 18-Feb-1998  cgd Move pmap_map() function definition to MD headers, as appropriate. It's
an internal function, and the VM system shouldn't try to prototype it.
(Note that some ports _don't_ prototype it.)
 1.16 06-Jan-1998  thorpej Garbage-collect pm_stchanged; it's not used by anything.
 1.15 06-Jan-1998  thorpej Garbage-collect use of the PCB's copy of the user segment table pointer.
 1.14 03-Jan-1998  thorpej Now that all ports have pmap_activate(), and it has an identical interface,
prototype it in <vm/pmap.h>
 1.13 01-Jan-1998  thorpej Change an argument name to PMAP_ACTIVATE() to more accurately describe the
semantics of the argument.
 1.12 01-Jan-1998  thorpej - Make pmap_activate() and pmap_deactivate() take a struct proc *.
- Define active_user_pmap() and use it in the appropriate places (from hp300
port).
 1.11 10-Jun-1997  veego s/atari_btop/m68k_btop/
 1.10 06-Nov-1996  leo pmap_changebit() no longer static.
 1.9 20-Jul-1996  leo Checkpoint integration of 68040 MMU support. Also fix oversight in allocation
of (virtual) I/O area address range.
 1.8 12-Jul-1996  leo Sync with atari_init cleanup
 1.7 18-Apr-1996  leo Yet more prototyping and -Wall fixes.
 1.6 09-Jun-1995  leo Support & require MACHINE_NONCONTIG
 1.5 16-Apr-1995  leo Changed '#endif KERNEL' -> '#endif /* _KERNEL */'.
 1.4 10-Apr-1995  mycroft Oops; finish that last change.
 1.3 10-Apr-1995  mycroft Bring back pmap_kernel(), for now always inlined as a pointer to
kernel_pmap_store.
 1.2 30-Mar-1995  leo KERNEL -> _KERNEL
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.20.18.1 28-Sep-2000  is Pullup from -current, requested by is, approved by thorpej:

sys/arch/arm32/include/pmap.h 1.18
sys/arch/atari/include/pmap.h 1.21
sys/arch/i386/include/pmap.h 1.50
sys/arch/pc532/include/pmap.h 1.29
sys/arch/sh3/include/pmap.h 1.6

These are architectures that do implemented wired page accounting;
advertize it to UVM, so that mlock() from non-root processes works.
 1.20.8.2 23-Apr-2001  bouyer Sync with HEAD.
 1.20.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.21.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.26.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.26.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.26.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.27.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.27.4.4 02-Jul-2002  nathanw Adjuct whitespace so that this matches the trunk.
 1.27.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.27.4.2 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.27.4.1 10-Sep-2001  scw file pmap.h was added on branch nathanw_sa on 2001-11-17 23:18:09 +0000
 1.30.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.30.2.1 03-Aug-2004  skrll Sync with HEAD
 1.31.16.2 21-Jan-2008  yamt sync with head
 1.31.16.1 26-Feb-2007  yamt sync with head.
 1.33.6.1 22-Apr-2006  simonb Sync with head.
 1.33.4.1 09-Sep-2006  rpaulo sync with head
 1.33.2.1 18-Feb-2006  yamt sync with head.
 1.34.20.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.34.18.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.35.34.1 11-Jan-2008  bouyer Sync with HEAD
 1.35.28.1 18-Feb-2008  mjf Sync with HEAD.
 1.35.22.1 23-Mar-2008  matt sync with HEAD
 1.36.20.3 26-Mar-2009  snj Pull up following revision(s) (requested by abs in ticket #612):
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.3
sys/arch/atari/atari/atari_init.c: revision 1.76
sys/arch/atari/include/pmap.h: revision 1.40
sys/arch/atari/include/vmparam.h: revision 1.24
Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.
 1.36.20.2 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.69
sys/arch/atari/atari/pmap.c: revision 1.111 via patch
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.9
sys/arch/atari/include/pmap.h: revision 1.39 via patch
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and
pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.36.20.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.68
sys/arch/atari/atari/pmap.c: revision 1.106
sys/arch/atari/include/pmap.h: revision 1.37
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
 1.36.18.2 28-Apr-2009  skrll Sync with HEAD.
 1.36.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.36.10.2 11-Mar-2010  yamt sync with head
 1.36.10.1 04-May-2009  yamt sync with head.
 1.36.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.39.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 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:33:27 +0000
 1.1.4.2 30-Aug-2002  gehenna catch up with -current.
 1.1.4.1 07-Aug-2002  gehenna file pmc.h was added on branch gehenna-devsw on 2002-08-30 00:19:24 +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:02 +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 11-Jun-1997  kleink branches: 1.2.36; 1.2.40; 1.2.48;
GC obsolete MDP_AST flag.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.48.1 16-Jul-2002  gehenna catch up with -current.
 1.2.40.2 01-Aug-2002  nathanw Catch up to -current.
 1.2.40.1 17-Nov-2001  scw MD Scheduler Activation bits for Atari.
Compile-tested only.
 1.2.36.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 23-Jan-2005  chs make this the same as the other m68k platforms.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.66; 1.1.1.1.74;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.74.1 29-Apr-2005  kent sync with -current
 1.1.1.1.66.1 24-Jan-2005  skrll Sync with HEAD.
 1.8 01-Jan-2009  tsutsui Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.7 11-Dec-2005  christos branches: 1.7.24; 1.7.74; 1.7.78; 1.7.86; 1.7.88;
merge ktrace-lwp.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 02-Apr-2003  thorpej branches: 1.5.2;
Use PAGE_SIZE rather than NBPG.
 1.4 10-Apr-2001  leo branches: 1.4.8;
The Milan uses the U0 pin to switch the pci-bridge between little & big
endian mode. That's why I moved the 'wired' flag to U1.
 1.3 20-Jul-1996  leo branches: 1.3.28; 1.3.40;
Checkpoint integration of 68040 MMU support. Also fix oversight in allocation
of (virtual) I/O area address range.
 1.2 30-Apr-1995  leo Get 68040 defines in line with other 68k ports so libkvm/kvm_m68k.c compiles
cleanly.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3.40.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.28.1 21-Apr-2001  bouyer Sync with HEAD
 1.4.8.2 10-Apr-2001  leo The Milan uses the U0 pin to switch the pci-bridge between little & big
endian mode. That's why I moved the 'wired' flag to U1.
 1.4.8.1 10-Apr-2001  leo file pte.h was added on branch nathanw_sa on 2001-04-10 19:51:01 +0000
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.88.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.69
sys/arch/atari/atari/pmap.c: revision 1.111 via patch
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.9
sys/arch/atari/include/pmap.h: revision 1.39 via patch
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and
pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.7.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.78.1 04-May-2009  yamt sync with head.
 1.7.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.7.24.2 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.7.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2 09-Feb-2007  ad branches: 1.2.4;
Merge newlock2 to head.
 1.1 22-Dec-2006  ad branches: 1.1.2;
file rwlock.h was initially added on branch newlock2.
 1.1.2.1 22-Dec-2006  ad Pull in CPU specific stubs.
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file rwlock.h was added on branch yamt-lazymbuf on 2007-02-26 09:06:10 +0000
 1.2 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.172;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.172.1 11-Mar-2010  yamt sync with head
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2 13-Sep-1998  mycroft Minor change.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.3 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.2 22-Jan-1999  mycroft Standardize format.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 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:55:32 +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:50:05 +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.4 19-Feb-1996  leo New disklabel handling code (Waldi Ravens).
These are the final (?) modifications to the layout of the NetBSD/Atari
bootblock. The bootblock handling can be made backwards compatible using
the right config options (COMPAT_11 + DISKLABEL_AHDI).
 1.3 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.2 05-Aug-1995  leo branches: 1.2.2;
Add disklabel support. In addition to the 'faked' disklables NetBSD/Atari
now also supports native NetBSD labels. When a NetBSD label is found it
overrules the Atari AHDI-partitioning.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.2.1 27-Oct-1995  leo Fix memory leak in disklabel code when used on removables.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.19 01-Apr-2021  simonb Define __HAVE_LEGACY_INTRCNT to indicate this port uses legacy intrcnt
interrupt accounting.
 1.18 01-Apr-2021  simonb Whitespace: #define<tab>
 1.17 23-Jan-2021  christos branches: 1.17.2;
Document via __HAVE_BUS_SPACE_8 platforms that implement bus_space_*_8
 1.16 18-Dec-2011  tsutsui branches: 1.16.60;
Restore __HAVE_MM_MD_READWRITE which was added for 5.99.53 in rev 1.14
but removed by merge botch on __HAVE_NEW_STYLE_BUS_H changes in rev 1.15.

Fixes "/dev/nvram: Device not configured" problem on installboot(8)
reported by David Ross.
 1.15 17-Jul-2011  dyoung branches: 1.15.2; 1.15.6;
Switch to new-style <sys/bus.h>.
 1.14 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.13 20-Jan-2008  joerg branches: 1.13.32; 1.13.42;
Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
 1.12 08-Jan-2008  joerg Convert Atari to generic TODR and timecounter.
 1.11 17-Oct-2007  garbled branches: 1.11.2; 1.11.8;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.10 14-Jul-2007  ad branches: 1.10.10;
Generic soft interrupts are mandatory.
 1.9 21-Mar-2007  tsutsui branches: 1.9.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
 1.8 28-Feb-2002  simonb branches: 1.8.70; 1.8.74; 1.8.76; 1.8.78;
Use "#define<tab>".
 1.7 10-Jul-2001  leo branches: 1.7.6;
Remove __BROKEN_CONFIG_UNIT_USAGE.
 1.6 05-Feb-2000  cgd branches: 1.6.8;
add __BROKEN_CONFIG_UNIT_USAGE #define, becuase these ports do very
wrong things with device configuration data "cf_unit" information.
 1.5 20-Dec-1996  leo branches: 1.5.28;
Get rid of BROKEN_INDIRECT_CONFIG
 1.4 05-Dec-1996  cgd First step inn removing config_scan() and the hacks that gave devices
on indirect-config busses a (permanent) softc that they could share
between 'match' and 'attach' routines:

Define __BROKEN_INDIRECT_CONFIG so that old autoconfiguration
interfaces are used, until drivers are converted to use the new
interfaces (actually, converted back to use the _older_ interfaces)
which prohibit indirect configuration devices from receiving a softc
in their match routine that they can share with their attach routine.
 1.3 11-Jul-1995  leo Dumping works, now if there were tools to handle it...
 1.2 26-Jun-1995  cgd define __BDEVSW_DUMP_OLD_TYPE for ports where it's true. clean up
some m68k ports inclusion of common header.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.5.28.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.6.8.1 03-Aug-2001  lukem update to -current
 1.7.6.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.6.1 10-Jul-2001  nathanw file types.h was added on branch nathanw_sa on 2002-04-01 07:39:33 +0000
 1.8.78.1 29-Mar-2007  reinoud Pullup to -current
 1.8.76.1 11-Jul-2007  mjf Sync with head.
 1.8.74.2 15-Jul-2007  ad Sync with head.
 1.8.74.1 10-Apr-2007  ad Sync with head.
 1.8.70.1 24-Mar-2007  yamt sync with head.
 1.9.4.1 03-Oct-2007  garbled Sync with HEAD
 1.10.10.1 06-Nov-2007  matt sync with HEAD
 1.11.8.2 23-Jan-2008  bouyer Sync with HEAD.
 1.11.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.11.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.13.42.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.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.15.6.1 18-Feb-2012  mrg merge to -current.
 1.15.2.1 17-Apr-2012  yamt sync with head
 1.16.60.1 03-Apr-2021  thorpej Sync with HEAD.
 1.17.2.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 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.10 25-Mar-2023  andvar s/resultion/resolution/ in comment.
 1.9 25-Mar-2023  andvar s/Predective/Predictive/ and s/dedected/detected/ in comments.
 1.8 03-Jul-2022  andvar fix various typos in comments, mainly s/pallete/palette/.
 1.7 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.6 27-Mar-1996  leo branches: 1.6.170;
Take out direct access to the YM2149. The chip definitions are moved
from video.h to ym2149reg.h.
 1.5 10-Mar-1996  leo Take the type of the attached monitor into account when selecting a
display-mode. Includes hack to make things work on non-VGA monitors.
 1.4 02-Jan-1996  leo Allow selection of Falcon (videl) video modes other than the mode selected
on startup (Thomas Gerner).
 1.3 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.2 17-Aug-1995  leo branches: 1.2.2;
Add video registers and other defines for Falcon video.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.2.1 16-Nov-1995  leo Oops, this also belongs to the ser02 selection.
 1.6.170.1 11-Mar-2010  yamt sync with head
 1.35 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.34 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.33 27-Mar-2019  christos branches: 1.33.4; 1.33.6;
- expose vmparams to userland on arm, like other archs do.
- remove unneeded includes
 1.32 26-Feb-2018  tsutsui branches: 1.32.4;
Add dumb memory probe routines for Milan to use all available memory.

Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)

No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html
 1.31 02-Feb-2017  rin branches: 1.31.6;
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.30 02-Feb-2017  rin PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos
 1.29 26-Jul-2014  tsutsui branches: 1.29.4; 1.29.8; 1.29.12;
Reorganize and bump VM related constants.

- sync VM_MAXUSER_ADDRESS and VM_MAX_ADDRESS with other hp300 derived ports
and use same definitions for USRSTACK as other m68k ports
(no worth to have sun3/sunos compat in these days)
- remove unused KUSER_AREA
- bump MAXTSIZ, MAXDSIZ, and MAXSSIZ

These changes allow my 64MB TT030 build pkgsrc/textproc/icu
which seems to require >200MB VA space.
(note our current 040/060 pmap implementation can't handle >224MB VA size)
 1.28 08-Feb-2011  rmind branches: 1.28.14; 1.28.28;
Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.27 06-Nov-2010  uebayasi branches: 1.27.2; 1.27.4;
Remove incomplete, never worked dynamic run-time memory registration
(uvm_page_physload(9)). This functionality will be re-added later.
 1.26 08-Dec-2009  tsutsui branches: 1.26.2; 1.26.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.25 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.24 13-Mar-2009  abs Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.
 1.23 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.22 01-Jan-2009  tsutsui branches: 1.22.2;
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.21 11-Dec-2005  christos branches: 1.21.24; 1.21.74; 1.21.78; 1.21.86; 1.21.88;
merge ktrace-lwp.
 1.20 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.19 02-Apr-2003  thorpej branches: 1.19.2;
Use PAGE_SIZE rather than NBPG.
 1.18 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.17 15-Nov-2001  soren MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
 1.16 01-May-2001  thorpej branches: 1.16.2; 1.16.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.15 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.14 14-Nov-2000  thorpej branches: 1.14.2;
We use 8K pages on the Atari. Make PAGE_SIZE and friends into
compile-time constants.
 1.13 11-Feb-2000  thorpej Update for the NKMEMPAGES changes.
 1.12 26-Jan-2000  tsutsui Remove obsoleted macros.
 1.11 04-Dec-1999  ragge CL* discarding.
 1.10 26-Apr-1999  thorpej branches: 1.10.2; 1.10.8;
Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.
 1.9 03-Mar-1999  leo branches: 1.9.4;
Dump max. datasize (MAXDSIZ) to 64MB and decouple the maximum stack size
(MAXSSIZ) from the MAXDSIZ.
 1.8 20-Nov-1998  leo Follow the amiga vmparam.h, from Ignatios:
Yet another workaround for pmap bugs. Several reports on the port-amiga
list claim this helps with some big-machine situations.
 1.7 02-Sep-1998  leo Get rid of vm_offset_t/vm_size_t
 1.6 08-Jul-1998  thorpej Define one page free list, and put all pages on it.
 1.5 07-May-1998  leo Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.
 1.4 10-Oct-1997  leo VM_MAX_ADDRESS is the user max address -- adjust (From Chris Hopps).
 1.3 12-Jul-1997  perry branches: 1.3.2;
update comment from 1981 on memory and disk prices -- pr-2754 from Curt Sampson
 1.2 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainilne.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo branches: 1.1.1.1.8; 1.1.1.1.12;
NetBSD/Atari, port by Leo Weppelman.
 1.1.1.1.12.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.1.1.1.8.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.3.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.4.2 06-Aug-1999  chs take an initial guess at UBC parameters.
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.10.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.10.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.16.8.3 11-Dec-2002  thorpej Sync with HEAD.
 1.16.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.16.8.1 01-May-2001  nathanw file vmparam.h was added on branch nathanw_sa on 2002-01-08 00:23:37 +0000
 1.16.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.19.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.19.2.1 03-Aug-2004  skrll Sync with HEAD
 1.21.88.2 26-Mar-2009  snj Pull up following revision(s) (requested by abs in ticket #612):
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.3
sys/arch/atari/atari/atari_init.c: revision 1.76
sys/arch/atari/include/pmap.h: revision 1.40
sys/arch/atari/include/vmparam.h: revision 1.24
Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.
 1.21.88.1 08-Jan-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #230):
sys/arch/atari/atari/atari_init.c: revision 1.69
sys/arch/atari/atari/pmap.c: revision 1.111 via patch
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.9
sys/arch/atari/include/pmap.h: revision 1.39 via patch
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and
pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
 1.21.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.21.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.21.78.3 11-Mar-2010  yamt sync with head
 1.21.78.2 16-Sep-2009  yamt sync with head
 1.21.78.1 04-May-2009  yamt sync with head.
 1.21.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.21.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1258):
sys/arch/atari/atari/atari_init.c: revision 1.68, 1.69, 1.70
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.1
sys/arch/atari/include/pte.h: revision 1.8
sys/arch/atari/include/vmparam.h: revision 1.22
sys/arch/atari/include/pmap.h: revision 1.35, 1.37, 1.39 (via patch)
sys/arch/atari/atari/pmap.c: revision 1.106, 1.111 (via patch)
sys/arch/atari/atari/genassym.cf: revision 1.28
sys/arch/atari/conf/files.atari: revision 1.113
sys/arch/atari/include/pcb.h: revision 1.7, 1.8, 1.9
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo
Remove quite obsolete pcb_cmap2.
Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c 1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c 1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c 1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga 1.137
arch/amiga/include/pcb.h 1.16
arch/amiga/include/pmap.h 1.44
arch/amiga/include/pte.h 1.19
arch/amiga/include/vmparam.h 1.35
- change kernel address space layout (i.e. move Sysmap to the end of KVA)
to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes
Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.
Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.
Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
Update one more comment which was missed in previous.
 1.22.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.26.4.1 05-Mar-2011  rmind sync with head
 1.26.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.27.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.27.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.28.28.1 10-Aug-2014  tls Rebase.
 1.28.14.2 03-Dec-2017  jdolecek update from HEAD
 1.28.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.29.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.29.4.1 05-Feb-2017  skrll Sync with HEAD
 1.31.6.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.32.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.32.4.1 10-Jun-2019  christos Sync with HEAD
 1.33.6.1 29-Feb-2020  ad Sync with head.
 1.33.4.1 10-Feb-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #682):

sys/arch/next68k/include/vmparam.h: revision 1.27
sys/arch/mac68k/include/vmparam.h: revision 1.46
sys/arch/sun3/include/vmparam.h: revision 1.38
sys/arch/m68k/include/vmparam.h: revision 1.1
sys/arch/hp300/include/vmparam.h: revision 1.41
sys/arch/m68k/include/Makefile: revision 1.32
sys/arch/amiga/include/vmparam.h: revision 1.48
distrib/sets/lists/comp/ad.m68k: revision 1.63
sys/arch/x68k/include/vmparam.h: revision 1.40
sys/arch/mvme68k/include/vmparam.h: revision 1.38
sys/arch/luna68k/include/vmparam.h: revision 1.23
sys/arch/news68k/include/vmparam.h: revision 1.23
sys/arch/atari/include/vmparam.h: revision 1.34
sys/arch/cesfic/include/vmparam.h: revision 1.19

Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).

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

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.

For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case.

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

Should be pulled up to netbsd-9.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-May-2004  kleink branches: 1.1.2;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 08-May-2004  skrll file wchar_limits.h was added on branch ktrace-lwp on 2004-08-03 10:33:26 +0000
 1.16 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.15 29-Jun-2019  tsutsui Make local functions static.
 1.14 01-Jul-2011  dyoung branches: 1.14.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.13 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.12 17-Mar-2008  yamt branches: 1.12.2; 1.12.4;
arint_normal -> aprint_normal
 1.11 16-Mar-2008  cube Split device_t and softc for the ... wait for it ... [air quotes] MI
variant of fdc(4)/fd(4). Other cosmetic changes as appropriate.
 1.10 11-Dec-2005  christos branches: 1.10.50; 1.10.70; 1.10.74;
merge ktrace-lwp.
 1.9 14-Sep-2004  drochner branches: 1.9.12;
adapt to ISA "unknown address" namespace separation (purely mechanical,
as far as "grep" reaches)
 1.8 25-Sep-2003  mycroft Modify the fdcattach() interface again, splitting it into two parts, so that
DRQ allocation is done earlier.
 1.7 25-Sep-2003  mycroft Update for new attach method.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 02-Oct-2002  thorpej branches: 1.4.6;
Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 07-Jan-2002  thorpej Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.1 16-Mar-2001  leo branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12;
Atari specific stuff to implement the Milan floppy. The Milan uses standard
ISA floppy hardware. Configure as:
fdcisa0 at isa? port 0x3f0 irq 6 drq 2
 1.1.12.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.12.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.12.2 11-Jan-2002  nathanw More catchup.
 1.1.12.1 16-Mar-2001  nathanw file fdcisa.c was added on branch nathanw_sa on 2002-01-11 23:38:12 +0000
 1.1.6.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.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.1.2.2 27-Mar-2001  bouyer Sync with HEAD.
 1.1.2.1 16-Mar-2001  bouyer file fdcisa.c was added on branch thorpej_scsipi on 2001-03-27 15:30:37 +0000
 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.9.12.1 17-Mar-2008  yamt sync with head.
 1.10.74.2 02-Jun-2008  mjf Sync with HEAD.
 1.10.74.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.70.1 24-Mar-2008  keiichi sync with head.
 1.10.50.1 23-Mar-2008  matt sync with HEAD
 1.12.4.1 16-May-2008  yamt sync with head.
 1.12.2.1 18-May-2008  yamt sync with head.
 1.14.54.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16 22-Jan-2022  skrll Ensure bus_dmatag_subregion is called with an inclusive max_addr
everywhere.
 1.15 17-Dec-2021  skrll Correct copypaste comment grammar.
 1.14 17-Dec-2021  skrll Trailing whitespace
 1.13 04-Jan-2021  thorpej malloc(9) -> kmem(9)
 1.12 26-Feb-2016  christos branches: 1.12.30;
PR/50857: David Binderman: Remove redundant code.
 1.11 13-Feb-2012  jdc branches: 1.11.6; 1.11.24;
Build fix - convert to new-style definitions.
OK by releng.
 1.10 01-Jul-2011  dyoung branches: 1.10.2; 1.10.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9 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.8 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.7 28-Apr-2008  martin branches: 1.7.8; 1.7.14;
Remove clause 3 and 4 from TNF licenses
 1.6 06-Mar-2007  tsutsui branches: 1.6.40; 1.6.42; 1.6.44;
Pass (char *) to mtod(9) on pointer arith.
 1.5 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 11-Dec-2005  christos branches: 1.4.26;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem branches: 1.3.16;
__KERNEL_RCSID()
 1.2 05-May-2003  fvdl branches: 1.2.2;
Move definition of ISA_DMA_BOUNCE_THRESHOLD to dev/isa/isareg.h.
 1.1 09-Mar-2001  leo branches: 1.1.2; 1.1.4; 1.1.12;
Expand bus_dma implementation. It will now handle the bounce buffer
extensions needed to make the isa floppy driver on the Milan work.
 1.1.12.2 09-Mar-2001  leo Expand bus_dma implementation. It will now handle the bounce buffer
extensions needed to make the isa floppy driver on the Milan work.
 1.1.12.1 09-Mar-2001  leo file isa_dma.c was added on branch nathanw_sa on 2001-03-09 20:55:48 +0000
 1.1.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.1.2.2 12-Mar-2001  bouyer Sync with HEAD.
 1.1.2.1 09-Mar-2001  bouyer file isa_dma.c was added on branch thorpej_scsipi on 2001-03-12 13:27:56 +0000
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 03-Sep-2007  yamt sync with head.
 1.4.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.6.44.2 04-May-2009  yamt sync with head.
 1.6.44.1 16-May-2008  yamt sync with head.
 1.6.42.1 18-May-2008  yamt sync with head.
 1.6.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.10.6.1 18-Feb-2012  mrg merge to -current.
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.11.24.1 19-Mar-2016  skrll Sync with HEAD
 1.11.6.1 03-Dec-2017  jdolecek update from HEAD
 1.12.30.1 03-Apr-2021  thorpej Sync with HEAD.
 1.10 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.9 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.8 16-Mar-2009  dsl ANSIfy functions with function-pointer arguments
 1.7 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 28-Apr-2008  martin branches: 1.5.8; 1.5.14;
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 27-Sep-2002  provos branches: 1.2.6;
remove trailing \n in panic(). approved perry.
 1.1 24-Apr-2001  leo branches: 1.1.2; 1.1.4; 1.1.10;
Split the ISA common attachment stuff and the interrupt handling.
There are too many differences between the Hades and Milan in this area.
 1.1.10.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.10.1 24-Apr-2001  nathanw file isa_hades.c was added on branch nathanw_sa on 2002-10-18 02:35:58 +0000
 1.1.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.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 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.4.78.2 04-May-2009  yamt 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.5.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.43 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42 24-Apr-2021  thorpej branches: 1.42.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.41 20-Jan-2018  tsutsui branches: 1.41.18;
Fix silent hang during config_console() (before consinit()) on Milan.

config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.
 1.40 13-Oct-2012  jdc branches: 1.40.30;
Adapt to the changed signature of pckbc_cnattach().
 1.39 01-Jul-2011  dyoung branches: 1.39.2; 1.39.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.38 10-Jun-2011  tsutsui Split device_t/softc. Compile test only.
 1.37 13-Apr-2010  tsutsui branches: 1.37.6;
Misc KNF.
 1.36 23-Aug-2009  mrg branches: 1.36.2; 1.36.4;
fix atari builds in two ways:
- isa_detach_hook() was missing a parameter name (hi dyoung!)
- PCI_CONF_SIZE -> PCI_CONFIG_SIZE; pcivar.h has a PCI_CONF_SIZE now (hi jak!)
 1.35 19-Aug-2009  dyoung isa_detach_hook() needs two arguments, the first an isa_chipset_tag_t.
 1.34 18-Aug-2009  dyoung These are stragglers from my last commit ("Let us safely detach
the ISA bus and devices attaching to the ISA bus"). Define
isa_detach_hook() in MD ISA implementations. Define isa_dmadestroy().
 1.33 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.32 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.31 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.30 24-Jan-2007  hubertf branches: 1.30.48; 1.30.56; 1.30.62;
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.29 11-Dec-2005  christos branches: 1.29.20;
merge ktrace-lwp.
 1.28 30-Aug-2004  drochner branches: 1.28.12;
Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.27 15-Jul-2003  lukem __KERNEL_RCSID()
 1.26 08-Dec-2002  leo branches: 1.26.6;
Make things work with the new autoconf stuff:
- The pcibus is now called 'pcib' and the isabus 'isab'. Their attributes are
'pcibus' and 'isabus' respectively. This makes the underlying busses
attach again.
- Initialize the parent structure in the config_console() function.
Otherwise we end up without a console.
 1.25 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.24 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.23 14-May-2001  leo branches: 1.23.2; 1.23.8;
Allow attachment of a pc-keyboard at console attach time.
 1.22 24-Apr-2001  leo Split the ISA common attachment stuff and the interrupt handling.
There are too many differences between the Hades and Milan in this area.
 1.21 09-Mar-2001  leo Expand bus_dma implementation. It will now handle the bounce buffer
extensions needed to make the isa floppy driver on the Milan work.
 1.20 07-Jan-2001  leo branches: 1.20.2;
Nuke a cf_unit abuse.
 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 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.16 19-Jan-2000  leo branches: 1.16.2;
Allow storage-space to be passed to the alloc_bus_space_tag() functions. This
permits static tags to be used during early console init.
 1.15 23-Nov-1999  leo Correct the test for a free-slot for isa_intr_alloc(). Also issue a warning
that should make it clear in which slot the card is expected to be in.
Isapnp is not what it seems to be on the atari (where interrupts are
hardwired to slot numbers).
 1.14 21-Oct-1999  leo Implement at least a bit of isa_intr_alloc().
 1.13 06-Aug-1999  leo branches: 1.13.2; 1.13.4; 1.13.6;
Change the way that bit's are cleared in the InterruptPending register of
the 68901. Do this now by _assigning_ ~<bit_to_clear> instead of the
previously used 'andb ~<bit_to_clear>'. The latter caused a rwm-cycle that
caused a race condition to happen when an interrupt arrived between the
Read and Modify-Write.
Anyway, this solved my hanging keyboard problem.
 1.12 08-Jan-1999  leo Return NULL when trying to establish a non-EDGE_TRIGGERED interrupt.
This can be used by drivers to choose another type. Currently used in
isnd4bsd.
 1.11 26-Nov-1998  leo Check-point work on isa-interrupt handling
 1.10 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.9 11-Jun-1998  leo Fix typo.
 1.8 09-Jun-1998  thorpej Provide an isa_chipset_tag_t to the ISA bus device.
 1.7 25-May-1998  leo Fix some severe bogons in the pci and isa interrupt system.
 1.6 22-Apr-1998  leo Fix prototype of interrupt function.
 1.5 10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.4 10-Mar-1998  leo Bus-dma implementation for the atari. Heavily based on the i386
implementation.
 1.3 12-Jan-1998  thorpej Update for changes to config.
 1.2 27-Aug-1997  leo Number the slots 0&1 instead of 1&2 .
 1.1 15-Jul-1997  leo branches: 1.1.1;
Initial revision
 1.1.1.1 15-Jul-1997  leo branches: 1.1.1.1.2;
isabus support
 1.1.1.1.2.1 27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.6.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.3 12-Mar-2001  bouyer Sync with HEAD.
 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.2 21-Jun-2001  nathanw Catch up to -current.
 1.20.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.23.8.3 11-Dec-2002  thorpej Sync with HEAD.
 1.23.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.23.8.1 14-May-2001  nathanw file isa_machdep.c was added on branch nathanw_sa on 2002-10-18 02:35:58 +0000
 1.23.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.26.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.26.6.2 03-Sep-2004  skrll Sync with HEAD
 1.26.6.1 03-Aug-2004  skrll Sync with HEAD
 1.28.12.1 26-Feb-2007  yamt sync with head.
 1.29.20.1 01-Feb-2007  ad Sync with head.
 1.30.62.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.56.1 28-Apr-2009  skrll Sync with HEAD.
 1.30.48.4 11-Aug-2010  yamt sync with head.
 1.30.48.3 16-Sep-2009  yamt sync with head
 1.30.48.2 19-Aug-2009  yamt sync with head.
 1.30.48.1 04-May-2009  yamt sync with head.
 1.36.4.2 12-Jun-2011  rmind sync with head
 1.36.4.1 30-May-2010  rmind sync with head
 1.36.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.37.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.39.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.39.2.1 30-Oct-2012  yamt sync with head
 1.40.30.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.41.18.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.42.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.5 19-Mar-1999  cgd Moved to arch/atari/include/isa_machdep.h,v
 1.4 09-Jun-1998  thorpej Add isa_dma{freeze,thaw}(), used to temporarily stop and then restart
all ISA DMA. Needed by e.g. the SmartCard reader for Sharks.
 1.3 09-Jun-1998  thorpej Change the ISA DMA API to take an isa_chipset_tag_t rather than
a struct device * corresponding to the ISA bus device. The ISA DMA
controller driver functions have been renamed and now take a struct
isa_dma_state *, and are called indirectly by machine-dependent code
which provides the DMA state.

These changes allow e.g. `ofisa' (the OpenFirmware configuration
mechanism for the ISA bus, used by e.g. Sharks) to use the MI ISA
DMA controller code.
 1.2 22-Apr-1998  leo Fix prototype of interrupt function.
 1.1 15-Jul-1997  leo branches: 1.1.1;
Initial revision
 1.1.1.1 15-Jul-1997  leo isabus support
 1.16 20-Jan-2018  tsutsui Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.

I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
 1.15 20-Jan-2018  tsutsui Use a proper PSL value to be passed to splx(9) functions.

This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.
 1.14 18-Mar-2009  cegger branches: 1.14.56;
Ansify function definitions w/o arguments. Generated with sed.
 1.13 16-Mar-2009  dsl ANSIfy functions with function-pointer arguments
 1.12 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 28-Apr-2008  martin branches: 1.9.8; 1.9.14;
Remove clause 3 and 4 from TNF licenses
 1.8 11-Dec-2005  christos branches: 1.8.74; 1.8.76; 1.8.78;
merge ktrace-lwp.
 1.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 27-Sep-2002  provos branches: 1.6.6;
remove trailing \n in panic(). approved perry.
 1.5 23-Feb-2002  leo Fixup icu-code. It now works for both ISA and PCI.
 1.4 29-May-2001  leo branches: 1.4.2; 1.4.4; 1.4.10;
Fix compile error.
 1.3 28-May-2001  leo Add 'prev_sr' argument to milan_isa_intr() so we can properly defer interrupts
that come in at the wrong time.
 1.2 16-May-2001  leo remove some debugging leftovers.
 1.1 24-Apr-2001  leo Split the ISA common attachment stuff and the interrupt handling.
There are too many differences between the Hades and Milan in this area.
 1.4.10.3 18-Oct-2002  nathanw Catch up to -current.
 1.4.10.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.10.1 29-May-2001  nathanw file isa_milan.c was added on branch nathanw_sa on 2002-02-28 04:08:26 +0000
 1.4.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.4.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.4.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.78.2 04-May-2009  yamt sync with head.
 1.8.78.1 16-May-2008  yamt sync with head.
 1.8.76.1 18-May-2008  yamt sync with head.
 1.8.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.14.56.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.11 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.10 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.9 21-Oct-2009  snj Drop 3rd and 4th clauses. Approved by thomas@ (copyright holder).
 1.8 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.7 28-Apr-2008  martin branches: 1.7.8; 1.7.14;
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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 20-Jun-2001  leo branches: 1.4.8; 1.4.24;
Make the compile with diagnostic.
 1.3 05-Sep-1998  christos Assign copyright to TNF.
 1.2 31-Jul-1998  thorpej Add a comment about why we can (and must) use bus_space_{,un}map() directly
in this file.
 1.1 22-Apr-1998  leo branches: 1.1.2;
Add isapnp stuff (Thomas Gerner)
 1.1.2.1 08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.4.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.24.1 03-Aug-2004  skrll Sync with HEAD
 1.4.8.2 20-Jun-2001  leo Make the compile with diagnostic.
 1.4.8.1 20-Jun-2001  leo file isapnp_machdep.c was added on branch nathanw_sa on 2001-06-20 10:24:23 +0000
 1.6.78.3 11-Mar-2010  yamt sync with head
 1.6.78.2 04-May-2009  yamt sync with head.
 1.6.78.1 16-May-2008  yamt sync with head.
 1.6.76.1 18-May-2008  yamt sync with head.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.3 19-Mar-1999  cgd Moved to arch/atari/include/isapnp_machdep.h,v
 1.2 05-Sep-1998  christos Assign copyright to TNF.
 1.1 22-Apr-1998  leo Add isapnp stuff (Thomas Gerner)
 1.16 04-May-2019  tsutsui Use const for register values.
 1.15 04-May-2019  tsutsui Misc KNF.

No binary changes on HADES and MILAN-PCIIDE kernels.
 1.14 02-Oct-2015  msaitoh branches: 1.14.18;
PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.13 13-Feb-2012  jdc branches: 1.13.6; 1.13.24;
Build fix - convert to new-style definitions.
OK by releng.
 1.12 01-Jul-2011  dyoung branches: 1.12.2; 1.12.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.11 16-Mar-2009  dsl ANSIfy functions with function-pointer arguments
 1.10 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.9 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.8 30-May-2008  ad branches: 1.8.6; 1.8.12;
pci_intr_setattr(), allows PCI interrupts to be marked MPSAFE on x86, and
other platforms if the code is added.

pci_intr_map(...)
pci_intr_setattr(pc, ih, PCI_INTR_MPSAFE, 1);
pci_intr_establish(...)
 1.7 29-Jan-2006  dsl branches: 1.7.72; 1.7.74; 1.7.76; 1.7.78;
Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
 1.6 11-Dec-2005  christos branches: 1.6.2;
merge ktrace-lwp.
 1.5 15-Jul-2003  lukem branches: 1.5.16;
__KERNEL_RCSID()
 1.4 01-Apr-2003  thorpej branches: 1.4.2;
Use PAGE_SIZE rather than NBPG.
 1.3 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.2 09-Jan-2002  leo Checkpointing my work on the mach64 (with help from Dave Berger). There is
still one major show stopper here. The characters are nearly to dim to read.
This is weird since the same DAC settings as on the other cards are used.
 1.1 15-May-2001  leo branches: 1.1.2; 1.1.4; 1.1.10;
Split pci_machdep into a generic/hades/milan part. There is much difference
in configspace and interrupt handling.
 1.1.10.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.10.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.10.2 11-Jan-2002  nathanw More catchup.
 1.1.10.1 15-May-2001  nathanw file pci_hades.c was added on branch nathanw_sa on 2002-01-11 23:38:12 +0000
 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 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.6.2.1 01-Feb-2006  yamt sync with head.
 1.7.78.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.7.76.1 04-May-2009  yamt sync with head.
 1.7.74.1 04-Jun-2008  yamt sync with head
 1.7.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.12.6.1 18-Feb-2012  mrg merge to -current.
 1.12.2.1 17-Apr-2012  yamt sync with head
 1.13.24.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.13.6.1 03-Dec-2017  jdolecek update from HEAD
 1.14.18.1 10-Jun-2019  christos Sync with HEAD
 1.65 07-Sep-2024  andvar spelling and grammar fixes, mainly in comments.
 1.64 01-Aug-2023  andvar branches: 1.64.6;
fix various typos in comments.
 1.63 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.62 21-Aug-2021  andvar fix some more typos in comments/log messages, improve wording as well.
 1.61 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.60 24-Apr-2021  thorpej branches: 1.60.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.59 03-Jan-2021  thorpej branches: 1.59.2;
malloc(9) -> kmem(9)
 1.58 04-May-2019  tsutsui branches: 1.58.10;
Use proper integer types for PCI configuration registers.
 1.57 04-May-2019  tsutsui Misc KNF.

No binary changes on HADES and MILAN-PCIIDE kernels.
 1.56 09-Feb-2018  tsutsui branches: 1.56.4;
On Milan, also explicitly disable MBIRQ1 on PIIX.

Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.
 1.55 31-Jan-2018  tsutsui Explicitly setup the secondary IDE interrupt of PIIX on Milan.

The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.
 1.54 29-Mar-2014  christos branches: 1.54.22;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.53 26-Mar-2014  christos kill sprintf
 1.52 01-Jul-2011  dyoung branches: 1.52.2; 1.52.12; 1.52.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.51 05-Jun-2011  tsutsui - use CFATTACH_DECL_NEW() (no softc)
- use device_t, cfdata_t etc.
 1.50 17-May-2011  dyoung branches: 1.50.2;
PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name. Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
 1.49 04-Apr-2011  dyoung Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.48 13-Apr-2010  tsutsui branches: 1.48.2;
Misc KNF.
 1.47 18-Mar-2009  cegger branches: 1.47.2; 1.47.4;
Ansify function definitions w/o arguments. Generated with sed.
 1.46 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.45 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.44 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.43 11-Dec-2005  christos branches: 1.43.78; 1.43.86; 1.43.92;
merge ktrace-lwp.
 1.42 30-Aug-2004  drochner Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.41 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.40 15-Jul-2003  lukem __KERNEL_RCSID()
 1.39 08-Dec-2002  leo branches: 1.39.6;
Make things work with the new autoconf stuff:
- The pcibus is now called 'pcib' and the isabus 'isab'. Their attributes are
'pcibus' and 'isabus' respectively. This makes the underlying busses
attach again.
- Initialize the parent structure in the config_console() function.
Otherwise we end up without a console.
 1.38 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.35 16-May-2002  thorpej * Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses. For busses behind a bridge, it points to
a persistent copy of the bridge's pcitag_t. This can be very useful
for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
uses OFW device nodes to enumerate the bus. When a PCI bus that is
behind a bridge is attached, pci_attach_hook() allocates a new PCI
chipset tag for the new bus and sets it's "curnode" to the OFW node
of the bridge. This is used as a starting point when enumerating
that bus. Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
 1.34 15-May-2002  thorpej branches: 1.34.2;
Implement pci_decompose_tag().
 1.33 09-Jan-2002  leo Fix PCI interrupt allocation on the Milan.
Note that this _seems_ to work. It can't be really tested before my board
is upgraded.
 1.32 28-May-2001  leo branches: 1.32.2; 1.32.8;
Pass iot and memt to check_for_vga()
 1.31 15-May-2001  leo Split pci_machdep into a generic/hades/milan part. There is much difference
in configspace and interrupt handling.
 1.30 09-Mar-2001  leo Expand bus_dma implementation. It will now handle the bounce buffer
extensions needed to make the isa floppy driver on the Milan work.
 1.29 07-Jan-2001  leo branches: 1.29.2;
Kill a typo.
 1.28 28-Dec-2000  sommerfeld Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
 1.27 28-Sep-2000  leo Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).
 1.26 28-Sep-2000  leo Nuke cf_unit abuse.
 1.25 28-Sep-2000  leo Correct some typos.
 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 04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.21 19-Jan-2000  leo branches: 1.21.2;
Allow storage-space to be passed to the alloc_bus_space_tag() functions. This
permits static tags to be used during early console init.
 1.20 07-Nov-1999  thomas Align IO and memory of PCI devices.
 1.19 21-Oct-1999  leo Fix pci-interrupt handling. It was broken by the latest slot numbering
changes.
 1.18 22-Sep-1999  leo branches: 1.18.2; 1.18.4; 1.18.6;
Do not enable VGA cards automatically. Since chances are high that they
claim overlapping memory areas. This causes only the 'console' VGA card
to be enabled.
 1.17 15-Mar-1999  leo First step to a framework that can be used to initialize vga-cards on the
pci-bus. The code is called early in the bootphase and tries to initialize
a known type of card into a 'standard' text mode. Wscons should be able
to handle these cards afterwards.
 1.16 19-Feb-1999  leo Add <machine/bswap.h> in the list of include-files.
 1.15 01-Jan-1999  thomas PCI I/O Start 16k because some devices allow only addresses
up to 64k.
 1.14 20-Dec-1998  thomas New code to enable PCI devices.
 1.13 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.12 25-May-1998  leo Fix some severe bogons in the pci and isa interrupt system.
 1.11 10-Apr-1998  leo Major overhaul of the atari bus_space implementation.
 1.10 10-Mar-1998  leo Bus-dma implementation for the atari. Heavily based on the i386
implementation.
 1.9 19-Feb-1998  leo Update Hades PCI support:
- Initialize the PCI bus and hand-out mem and i/o addresses. (there is
still lots of room for improvements here...)
- Implement the interupt functions
 1.8 12-Jan-1998  thorpej Update for changes to config.
 1.7 10-Apr-1997  cgd pass memory- and i/o-enabled flags down via the PCI bus and device attach
arguments, so that a device can tell if its memory and I/O spaces are
enabled. The flags are cleared, depending on the contents of devices CSR
registers, in the machine-independent PCI bus code.
 1.6 27-Jan-1997  leo Print a new-line in attach function.
 1.5 20-Dec-1996  leo branches: 1.5.2;
Get rid of BROKEN_INDIRECT_CONFIG
 1.4 08-Nov-1996  leo pba_bc -> pba_pc
 1.3 13-Oct-1996  christos backout previous kprintf changes
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 05-Oct-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 05-Oct-1996  leo minimal pci support
 1.5.2.1 30-Jan-1997  thorpej update from trunk
 1.18.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.18.4.1 15-Nov-1999  fvdl Sync with -current
 1.18.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.18.2.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.18.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.18.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.21.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.29.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.29.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.32.8.6 11-Dec-2002  thorpej Sync with HEAD.
 1.32.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.32.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.32.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.32.8.2 11-Jan-2002  nathanw More catchup.
 1.32.8.1 28-May-2001  nathanw file pci_machdep.c was added on branch nathanw_sa on 2002-01-11 23:38:12 +0000
 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 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.34.2.1 30-May-2002  gehenna Catch up with -current.
 1.39.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.39.6.2 03-Sep-2004  skrll Sync with HEAD
 1.39.6.1 03-Aug-2004  skrll Sync with HEAD
 1.43.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.43.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.43.78.2 11-Aug-2010  yamt sync with head.
 1.43.78.1 04-May-2009  yamt sync with head.
 1.47.4.4 12-Jun-2011  rmind sync with head
 1.47.4.3 31-May-2011  rmind sync with head
 1.47.4.2 21-Apr-2011  rmind sync with head
 1.47.4.1 30-May-2010  rmind sync with head
 1.47.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.48.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.50.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.52.16.1 18-May-2014  rmind sync with head
 1.52.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.52.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.54.22.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.56.4.1 10-Jun-2019  christos Sync with HEAD
 1.58.10.1 03-Apr-2021  thorpej Sync with HEAD.
 1.59.2.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.60.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.64.6.1 02-Aug-2025  perseant Sync with HEAD
 1.4 19-Mar-1999  cgd Moved to arch/atari/include/pci_machdep.h,v
 1.3 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.2 19-Feb-1998  leo Update Hades PCI support:
- Initialize the PCI bus and hand-out mem and i/o addresses. (there is
still lots of room for improvements here...)
- Implement the interupt functions
 1.1 05-Oct-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 05-Oct-1996  leo minimal pci support
 1.17 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.16 04-May-2019  tsutsui Misc KNF.

No binary changes on HADES and MILAN-PCIIDE kernels.
 1.15 28-Jan-2018  tsutsui branches: 1.15.4;
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.

This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.
 1.14 02-Oct-2015  msaitoh branches: 1.14.10;
PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.13 12-Aug-2012  martin branches: 1.13.2; 1.13.16;
Add a missing extern to apeas -fno-common.
 1.12 16-Mar-2009  dsl branches: 1.12.12;
ANSIfy functions with function-pointer arguments
 1.11 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 30-May-2008  ad branches: 1.9.6; 1.9.12;
pci_intr_setattr(), allows PCI interrupts to be marked MPSAFE on x86, and
other platforms if the code is added.

pci_intr_map(...)
pci_intr_setattr(pc, ih, PCI_INTR_MPSAFE, 1);
pci_intr_establish(...)
 1.8 28-Apr-2008  martin branches: 1.8.2;
Remove clause 3 and 4 from TNF licenses
 1.7 29-Jan-2006  dsl branches: 1.7.72; 1.7.74; 1.7.76;
Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
 1.6 11-Dec-2005  christos branches: 1.6.2;
merge ktrace-lwp.
 1.5 15-Jul-2003  lukem branches: 1.5.16;
__KERNEL_RCSID()
 1.4 27-Sep-2002  provos branches: 1.4.6;
remove trailing \n in panic(). approved perry.
 1.3 09-Jan-2002  leo Fix PCI interrupt allocation on the Milan.
Note that this _seems_ to work. It can't be really tested before my board
is upgraded.
 1.2 28-May-2001  leo branches: 1.2.2; 1.2.4; 1.2.10;
Add Milan console initialisation code.
 1.1 15-May-2001  leo Split pci_machdep into a generic/hades/milan part. There is much difference
in configspace and interrupt handling.
 1.2.10.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.10.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.10.2 11-Jan-2002  nathanw More catchup.
 1.2.10.1 28-May-2001  nathanw file pci_milan.c was added on branch nathanw_sa on 2002-01-11 23:38:13 +0000
 1.2.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.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 21-Jun-2001  nathanw Catch up to -current.
 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.16.1 21-Jun-2006  yamt sync with head.
 1.6.2.1 01-Feb-2006  yamt sync with head.
 1.7.76.2 04-May-2009  yamt sync with head.
 1.7.76.1 16-May-2008  yamt sync with head.
 1.7.74.2 04-Jun-2008  yamt sync with head
 1.7.74.1 18-May-2008  yamt sync with head.
 1.7.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.9.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.12.12.1 30-Oct-2012  yamt sync with head
 1.13.16.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.13.2.1 03-Dec-2017  jdolecek update from HEAD
 1.14.10.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.15.4.1 10-Jun-2019  christos Sync with HEAD
 1.14 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.13 04-May-2019  tsutsui Use const for register values.
 1.12 04-May-2019  tsutsui Misc KNF.

No binary changes on HADES and MILAN-PCIIDE kernels.
 1.11 20-Oct-2009  snj branches: 1.11.64;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.10 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.9 29-Apr-2007  msaitoh branches: 1.9.36; 1.9.44; 1.9.50;
fix typos
 1.8 11-Dec-2005  christos branches: 1.8.26; 1.8.30; 1.8.32;
merge ktrace-lwp.
 1.7 15-Jul-2003  lukem branches: 1.7.16;
__KERNEL_RCSID()
 1.6 02-Feb-2003  thomas branches: 1.6.2;
Config option for et4000 boards with 2MB memory.
 1.5 02-Sep-2002  leo Decrease the vertical frequency.
 1.4 21-May-2001  leo branches: 1.4.2; 1.4.8;
Initialize to CGA mode. Wscons expects this.
 1.3 03-Jun-1999  leo branches: 1.3.14;
Fix lossage with the et4000. Some of the CRT registers were incorrect.
 1.2 26-Mar-1999  leo branches: 1.2.2; 1.2.4; 1.2.6;
Add more fuzziness to the MDRAM initialisation. Seems to work on a broader
range of et6[01]00 cards now.
 1.1 15-Mar-1999  leo First step to a framework that can be used to initialize vga-cards on the
pci-bus. The code is called early in the bootphase and tries to initialize
a known type of card into a 'standard' text mode. Wscons should be able
to handle these cards afterwards.
 1.2.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.2.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.2.1 22-Jun-1999  perry pullup 1.2->1.3 (leo): fix et4000 consoles
 1.3.14.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.8.2 17-Sep-2002  nathanw Catch up to -current.
 1.4.8.1 21-May-2001  nathanw file pci_tseng.c was added on branch nathanw_sa on 2002-09-17 21:13:50 +0000
 1.4.2.1 06-Sep-2002  jdolecek sync kqueue branch 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.16.1 03-Sep-2007  yamt sync with head.
 1.8.32.1 11-Jul-2007  mjf Sync with head.
 1.8.30.1 27-May-2007  ad Sync with head.
 1.8.26.1 07-May-2007  yamt sync with head.
 1.9.50.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.44.1 28-Apr-2009  skrll Sync with HEAD.
 1.9.36.2 11-Mar-2010  yamt sync with head
 1.9.36.1 04-May-2009  yamt sync with head.
 1.11.64.1 10-Jun-2019  christos Sync with HEAD
 1.21 06-May-2023  andvar s/regster/register/ in comments and error messages.
 1.20 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.19 15-Aug-2022  tsutsui Improve VGA console settings for Milan, especially for sysinst.

- use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
(so that box drawing characters are rendered properly)
- set ATC and DAC palette settings for proper colors
(copied from MI vga_subr.c for now because HADES doesn't use mi vga(4))

Tested on Milan with S3 Trio64. (XXX: needs working HADES with ET4000)
 1.18 31-Jul-2021  andvar s/dependend/dependent/
 1.17 04-May-2019  tsutsui branches: 1.17.2; 1.17.14;
Use const for register values.
 1.16 04-May-2019  tsutsui Use proper integer types for PCI configuration registers.
 1.15 04-May-2019  tsutsui Misc KNF.

No binary changes on HADES and MILAN-PCIIDE kernels.
 1.14 20-Oct-2009  snj branches: 1.14.64;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.13 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.12 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.11 11-Dec-2005  christos branches: 1.11.78; 1.11.86; 1.11.92;
merge ktrace-lwp.
 1.10 04-Jun-2005  he Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.9 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 09-Apr-2002  leo branches: 1.8.10;
Mmmmm PCI_PRODUCT_ATI_MACH64_B -> PCI_PRODUCT_ATI_RAGE_PRO_PCI_P...
 1.7 09-Jan-2002  leo Checkpointing my work on the mach64 (with help from Dave Berger). There is
still one major show stopper here. The characters are nearly to dim to read.
This is weird since the same DAC settings as on the other cards are used.
 1.6 29-May-2001  leo branches: 1.6.2; 1.6.8;
Whoops, where did the include of vga_pci.h go?
 1.5 28-May-2001  leo Add Milan console initialisation code.
 1.4 28-May-2001  leo Add VGA console probes.
 1.3 28-May-2001  leo Pass iot and memt to check_for_vga()
 1.2 21-May-2001  leo Initialize to CGA mode. Wscons expects this.
 1.1 15-Mar-1999  leo branches: 1.1.20;
First step to a framework that can be used to initialize vga-cards on the
pci-bus. The code is called early in the bootphase and tries to initialize
a known type of card into a 'standard' text mode. Wscons should be able
to handle these cards afterwards.
 1.1.20.1 21-Jun-2001  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 11-Jan-2002  nathanw More catchup.
 1.6.8.1 29-May-2001  nathanw file pci_vga.c was added on branch nathanw_sa on 2002-01-11 23:38:13 +0000
 1.6.2.2 17-Jun-2002  jdolecek catch up kqueue with -current
 1.6.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.10.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.10.1 03-Aug-2004  skrll Sync with HEAD
 1.11.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.11.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.11.78.2 11-Mar-2010  yamt sync with head
 1.11.78.1 04-May-2009  yamt sync with head.
 1.14.64.1 10-Jun-2019  christos Sync with HEAD
 1.17.14.1 01-Aug-2021  thorpej Sync with HEAD.
 1.17.2.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1521):

sys/arch/atari/pci/pci_vga.c: revision 1.19
sys/arch/atari/conf/MILAN.in: revision 1.30

Improve VGA console settings for Milan, especially for sysinst.
- use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
(so that box drawing characters are rendered properly)
- set ATC and DAC palette settings for proper colors
(copied from MI vga_subr.c for now because HADES doesn't use mi vga(4))

Tested on Milan with S3 Trio64. (XXX: needs working HADES with ET4000)

Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.
 1.6 04-May-2019  tsutsui Misc KNF.

No binary changes on HADES and MILAN-PCIIDE kernels.
 1.5 20-Oct-2009  snj branches: 1.5.64;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.4 09-Jan-2002  leo branches: 1.4.122;
Checkpointing my work on the mach64 (with help from Dave Berger). There is
still one major show stopper here. The characters are nearly to dim to read.
This is weird since the same DAC settings as on the other cards are used.
 1.3 29-May-2001  leo branches: 1.3.2; 1.3.8;
Prototype milan_vga_init()
 1.2 28-May-2001  leo Pass iot and memt to check_for_vga()
 1.1 15-Mar-1999  leo branches: 1.1.20;
First step to a framework that can be used to initialize vga-cards on the
pci-bus. The code is called early in the bootphase and tries to initialize
a known type of card into a 'standard' text mode. Wscons should be able
to handle these cards afterwards.
 1.1.20.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.8.3 28-Feb-2002  nathanw Catch up to -current.
 1.3.8.2 11-Jan-2002  nathanw More catchup.
 1.3.8.1 29-May-2001  nathanw file pci_vga.h was added on branch nathanw_sa on 2002-01-11 23:38:13 +0000
 1.3.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.122.1 11-Mar-2010  yamt sync with head
 1.5.64.1 10-Jun-2019  christos Sync with HEAD
 1.8 04-May-2019  tsutsui Misc KNF.

No binary changes on HADES and MILAN-PCIIDE kernels.
 1.7 27-Oct-2012  chs branches: 1.7.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.6 04-Apr-2011  dyoung branches: 1.6.4; 1.6.14;
Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.5 16-Mar-2009  dsl branches: 1.5.4; 1.5.6;
ANSIfy functions with function-pointer arguments
 1.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 11-Dec-2005  christos branches: 1.3.78; 1.3.86; 1.3.92;
merge ktrace-lwp.
 1.2 15-Jul-2003  lukem __KERNEL_RCSID()
 1.1 29-May-2001  leo branches: 1.1.2; 1.1.10; 1.1.26;
Import pciide_machdep.c from i386.
 1.1.26.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.26.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.26.1 03-Aug-2004  skrll Sync with HEAD
 1.1.10.2 29-May-2001  leo Import pciide_machdep.c from i386.
 1.1.10.1 29-May-2001  leo file pciide_machdep.c was added on branch nathanw_sa on 2001-05-29 06:26:09 +0000
 1.1.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.5.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.4.1 21-Apr-2011  rmind sync with head
 1.6.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.4.1 30-Oct-2012  yamt sync with head
 1.7.38.1 10-Jun-2019  christos Sync with HEAD
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 09-Dec-2003  jmc Make libsa build first as other items depend on it (for -j builds)
 1.9 13-Oct-2001  leo branches: 1.9.4; 1.9.20;
Add bootxxx
 1.8 07-Aug-2000  leo branches: 1.8.4;
Add ahdilabel to SUBDIR.
 1.7 28-May-1998  leo branches: 1.7.14; 1.7.24;
Add bootpref subdir.
 1.6 10-Feb-1998  leo Build the library before using it.... (Thomas Gerner).
 1.5 06-Nov-1996  leo Add msconfig to SUBDIRS.
 1.4 22-Jun-1996  leo Add the subdirs: binpatch, keymaps and loadkmap.
 1.3 30-May-1996  leo Add loadkmap
 1.2 16-May-1996  leo branches: 1.2.4;
Add edahdi to the subdirs.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Added to build the bootloader stuff.
 1.1.1.1 16-May-1996  leo edahdi, an AHDI partition-id editor
 1.2.4.1 24-Jun-1996  jtc Pull up Leo's changes to atari keymap handling.
 1.7.24.1 17-Aug-2000  leo Pull up revisions 1.7-1.8 (requested by leo; approved by thorpej).

Log message:
Add ahdilabel to SUBDIR.
 1.7.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.20.1 03-Aug-2004  skrll Sync with HEAD
 1.9.4.2 13-Oct-2001  leo Add bootxxx
 1.9.4.1 13-Oct-2001  leo file Makefile was added on branch nathanw_sa on 2001-10-13 20:40:44 +0000
 1.5 17-Sep-2016  christos kill PIE/SSP
 1.4 12-Aug-2013  joerg branches: 1.4.6; 1.4.10;
Build boot loaders without unwind tables.
 1.3 18-Dec-2011  tsutsui branches: 1.3.6; 1.3.10;
Explicitly specify -m68020-60 to avoid possible 060SP instructions,
especially 64 bit integer mul/div ops in standalone bootloaders. From x68k.
 1.2 15-Mar-2009  tsutsui branches: 1.2.2; 1.2.14; 1.2.18;
Use <bsd.klinks.mk> to create MD include dir symlinks.
 1.1 06-Jan-2009  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.10;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.1.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.8.3 28-Apr-2009  skrll Sync with HEAD.
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 06-Jan-2009  skrll file Makefile.booters was added on branch nick-hppapmap on 2009-01-19 13:16:01 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 06-Jan-2009  mjf file Makefile.booters was added on branch mjf-devfs2 on 2009-01-17 13:27:55 +0000
 1.1.4.2 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.1.4.1 06-Jan-2009  bouyer file Makefile.booters was added on branch netbsd-5 on 2009-01-16 22:57:33 +0000
 1.1.2.2 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.1.2.1 06-Jan-2009  bouyer file Makefile.booters was added on branch netbsd-4 on 2009-01-15 23:20:03 +0000
 1.2.18.1 18-Feb-2012  mrg merge to -current.
 1.2.14.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.14.1 17-Apr-2012  yamt sync with head
 1.2.2.2 04-May-2009  yamt sync with head.
 1.2.2.1 15-Mar-2009  yamt file Makefile.booters was added on branch yamt-nfs-mp on 2009-05-04 08:10:48 +0000
 1.3.10.1 28-Aug-2013  rmind sync with head
 1.3.6.2 03-Dec-2017  jdolecek update from HEAD
 1.3.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.10.1 04-Nov-2016  pgoyette Sync with HEAD
 1.4.6.1 05-Oct-2016  skrll Sync with HEAD
 1.3 06-Jan-2009  tsutsui Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.2 01-Dec-2006  he branches: 1.2.2; 1.2.52; 1.2.56; 1.2.64; 1.2.66;
Add -Os to CFLAGS, so that the boot code fits within the constraints
again. Sorry, I've not traced why this fit in the past, or what
changed to make it not fit anymore.
 1.1 01-Apr-2003  he branches: 1.1.18; 1.1.48; 1.1.50;
Undo the last; adding the quad arithmetic caused the boot code to
overflow. Instead do as the mvme68k port, and use 32-bit daddr_t here.
 1.1.50.1 10-Dec-2006  yamt sync with head.
 1.1.48.1 12-Jan-2007  ad Sync with head.
 1.1.18.1 30-Dec-2006  yamt sync with head.
 1.2.66.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.2.64.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.56.1 04-May-2009  yamt sync with head.
 1.2.52.1 17-Jan-2009  mjf Sync with HEAD.
 1.2.2.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.2 16-May-1996  leo Remove files commited in the wrong directory. Sorry.
 1.1 16-May-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 16-May-1996  leo edahdi, an AHDI partition-id editor
 1.2 16-May-1996  leo Remove files commited in the wrong directory. Sorry.
 1.1 16-May-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 16-May-1996  leo edahdi, an AHDI partition-id editor
 1.5 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.4 04-Mar-2001  jdc branches: 1.4.4; 1.4.8;
Man page is now in share/man/man8/man8.atari.
 1.3 25-Feb-2001  jdc Make it easier to build with -DDEBUG.
 1.2 22-Aug-2000  leo branches: 1.2.2;
Need to specify BINDIR or the executable ends up in /
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2;
AHDI label editor
 1.1.1.1.2.4 22-Mar-2001  he Pull up revisions 1.3-1.4 (requested by jtb):
Several changes:
o make it easy to compile with -DDEBUG
o move manual page to proper place
 1.1.1.1.2.3 29-Aug-2000  leo Pull up revision 1.2 (requested by leo, approved by thorpej)
Log message:
Need to specify BINDIR or the executable ends up in /
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file Makefile was added on branch netbsd-1-5 on 2000-08-14 07:59:58 +0000
 1.2.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.2.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.2.2.1 22-Aug-2000  bouyer file Makefile was added on branch thorpej_scsipi on 2000-11-20 20:05:31 +0000
 1.4.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2 04-Mar-2001  jdc Man page moved to share/man/man8/man8.atari.
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4;
AHDI label editor
 1.1.1.1.4.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file ahdilabel.8 was added on branch thorpej_scsipi on 2000-11-20 20:05:31 +0000
 1.1.1.1.2.3 22-Mar-2001  he Pull up file removal (requested by jtb):
Several changes:
o move manual page to proper place
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file ahdilabel.8 was added on branch netbsd-1-5 on 2000-08-14 07:59:58 +0000
 1.12 05-Dec-2021  msaitoh s/partiton/partition/
 1.11 09-Oct-2016  christos PR/51540: Henning Petersen: replace , with ;
 1.10 28-Mar-2014  ozaki-r branches: 1.10.6; 1.10.10;
Fix; cts[0] => cts
 1.9 26-Mar-2014  christos kill sprintf
 1.8 14-Mar-2009  dsl branches: 1.8.12; 1.8.22; 1.8.26;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.7 28-Apr-2008  martin branches: 1.7.8; 1.7.14;
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 12-Nov-2004  he Add a cast to unsigned char for an argument to toupper().
 1.4 26-Jul-2001  wiz branches: 1.4.6; 1.4.22;
auxilliary -> auxiliary
 1.3 04-Mar-2001  jdc branches: 1.3.4;
Add enhancements :
boot sector and bad sector list are preserved by default, use 'z' to change
type NNNm to make a partition size NNN megabytes
type `-N' at `root' and `start' prompts to start after partition N
type `-N' at `size' prompt to end before partition N
type `-1' at `size' prompt to end at end of disk
display pauses if 10 or more partitions to display
 1.2 25-Feb-2001  jdc Root sector checksums are not always valid, so ignore them.
From Leo Weppelman.
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4;
AHDI label editor
 1.1.1.1.4.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file ahdilabel.c was added on branch thorpej_scsipi on 2000-11-20 20:05:31 +0000
 1.1.1.1.2.3 22-Mar-2001  he Pull up revisions 1.2-1.3 (requested by jtb):
Several changes:
o ignore sometimes-invalid root sector checksums
o by default preserve boot sector and bad sector list
o improve user interface to specify partitions
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file ahdilabel.c was added on branch netbsd-1-5 on 2000-08-14 07:59:59 +0000
 1.3.4.1 03-Aug-2001  lukem update to -current
 1.4.22.1 14-Nov-2004  skrll Sync with HEAD.
 1.4.6.2 26-Jul-2001  wiz auxilliary -> auxiliary
 1.4.6.1 26-Jul-2001  wiz file ahdilabel.c was added on branch nathanw_sa on 2001-07-26 22:53:14 +0000
 1.6.78.2 04-May-2009  yamt sync with head.
 1.6.78.1 16-May-2008  yamt sync with head.
 1.6.76.1 18-May-2008  yamt sync with head.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.26.1 18-May-2014  rmind sync with head
 1.8.22.2 03-Dec-2017  jdolecek update from HEAD
 1.8.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.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.10.10.1 04-Nov-2016  pgoyette Sync with HEAD
 1.10.6.1 05-Dec-2016  skrll Sync with HEAD
 1.3 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.2 28-Apr-2008  martin branches: 1.2.8; 1.2.14;
Remove clause 3 and 4 from TNF licenses
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.130; 1.1.1.1.132; 1.1.1.1.134;
AHDI label editor
 1.1.1.1.134.2 04-May-2009  yamt sync with head.
 1.1.1.1.134.1 16-May-2008  yamt sync with head.
 1.1.1.1.132.1 18-May-2008  yamt sync with head.
 1.1.1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file build.c was added on branch thorpej_scsipi on 2000-11-20 20:05:31 +0000
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file build.c was added on branch netbsd-1-5 on 2000-08-14 07:59:59 +0000
 1.2.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 28-Apr-2008  martin branches: 1.5.8; 1.5.14;
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 11-Feb-2005  simonb White space nit- don't put a space before/after increment/decrement
operators.
 1.2 23-Oct-2000  jdc branches: 1.2.2; 1.2.26; 1.2.34; 1.2.36;
Correct `off by one' error when testing against size of disk.
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2;
AHDI label editor
 1.1.1.1.2.3 26-Oct-2000  tv Pullup 1.2 [jdc]:
Correct `off by one' error when testing against size of disk.
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file check.c was added on branch netbsd-1-5 on 2000-08-14 07:59:59 +0000
 1.2.36.1 12-Feb-2005  yamt sync with head.
 1.2.34.1 29-Apr-2005  kent sync with -current
 1.2.26.1 15-Feb-2005  skrll Sync with HEAD.
 1.2.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.2.2.1 23-Oct-2000  bouyer file check.c was added on branch thorpej_scsipi on 2000-11-20 20:05:31 +0000
 1.4.78.2 04-May-2009  yamt 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.5.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.3 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.2 28-Apr-2008  martin branches: 1.2.8; 1.2.14;
Remove clause 3 and 4 from TNF licenses
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.130; 1.1.1.1.132; 1.1.1.1.134;
AHDI label editor
 1.1.1.1.134.2 04-May-2009  yamt sync with head.
 1.1.1.1.134.1 16-May-2008  yamt sync with head.
 1.1.1.1.132.1 18-May-2008  yamt sync with head.
 1.1.1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file cksum.c was added on branch thorpej_scsipi on 2000-11-20 20:05:31 +0000
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file cksum.c was added on branch netbsd-1-5 on 2000-08-14 07:59:59 +0000
 1.2.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.3 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.2 28-Apr-2008  martin branches: 1.2.8; 1.2.14;
Remove clause 3 and 4 from TNF licenses
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.130; 1.1.1.1.132; 1.1.1.1.134;
AHDI label editor
 1.1.1.1.134.2 04-May-2009  yamt sync with head.
 1.1.1.1.134.1 16-May-2008  yamt sync with head.
 1.1.1.1.132.1 18-May-2008  yamt sync with head.
 1.1.1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file magic.c was added on branch thorpej_scsipi on 2000-11-20 20:05:31 +0000
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file magic.c was added on branch netbsd-1-5 on 2000-08-14 07:59:59 +0000
 1.2.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.3 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.2 28-Apr-2008  martin branches: 1.2.8; 1.2.14;
Remove clause 3 and 4 from TNF licenses
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.130; 1.1.1.1.132; 1.1.1.1.134;
AHDI label editor
 1.1.1.1.134.2 04-May-2009  yamt sync with head.
 1.1.1.1.134.1 16-May-2008  yamt sync with head.
 1.1.1.1.132.1 18-May-2008  yamt sync with head.
 1.1.1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file openraw.c was added on branch thorpej_scsipi on 2000-11-20 20:05:31 +0000
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file openraw.c was added on branch netbsd-1-5 on 2000-08-14 07:59:59 +0000
 1.2.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.4 29-Sep-2020  msaitoh s/parition/partition/
 1.3 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.2 28-Apr-2008  martin branches: 1.2.8; 1.2.14;
Remove clause 3 and 4 from TNF licenses
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.130; 1.1.1.1.132; 1.1.1.1.134;
AHDI label editor
 1.1.1.1.134.2 04-May-2009  yamt sync with head.
 1.1.1.1.134.1 16-May-2008  yamt sync with head.
 1.1.1.1.132.1 18-May-2008  yamt sync with head.
 1.1.1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file privahdi.h was added on branch thorpej_scsipi on 2000-11-20 20:05:32 +0000
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file privahdi.h was added on branch netbsd-1-5 on 2000-08-14 07:59:59 +0000
 1.2.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.4 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.3 28-Apr-2008  martin branches: 1.3.8; 1.3.14;
Remove clause 3 and 4 from TNF licenses
 1.2 25-Feb-2001  jdc branches: 1.2.126; 1.2.128; 1.2.130;
Include <stdio.h> when built with -DDEBUG.
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4;
AHDI label editor
 1.1.1.1.4.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file read.c was added on branch thorpej_scsipi on 2000-11-20 20:05:32 +0000
 1.1.1.1.2.3 22-Mar-2001  he Pull up revision 1.2 (requested by jdc):
Several changes:
o make compile cleanly with -DDEBUG.
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file read.c was added on branch netbsd-1-5 on 2000-08-14 08:00:00 +0000
 1.2.130.2 04-May-2009  yamt sync with head.
 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.3.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 28-Apr-2008  martin branches: 1.5.8; 1.5.14;
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 10-Jun-2005  he Add initialization of xgmsec, the assignment to it apparently depends
on the value in one of the data structures passed as arguments.
 1.2 25-Feb-2001  jdc branches: 1.2.24;
Make sure root sector checksum is invalid if we clear it.
Set size of XGM partitions on auxilliary roots correctly.
From Leo Weppelman.
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4;
AHDI label editor
 1.1.1.1.4.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file write.c was added on branch thorpej_scsipi on 2000-11-20 20:05:32 +0000
 1.1.1.1.2.3 22-Mar-2001  he Pull up revision 1.2 (requested by jtb):
Several changes:
o if we clear root sector, make sure the checksum is invalid
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file write.c was added on branch netbsd-1-5 on 2000-08-14 08:00:00 +0000
 1.2.24.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.78.2 04-May-2009  yamt 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.5.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.5 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.4 28-Apr-2008  martin branches: 1.4.8; 1.4.14;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.76; 1.3.78;
merge ktrace-lwp.
 1.2 28-Oct-2003  he Add include of <string.h> to pick up strlen() prototype.
 1.1 07-Aug-2000  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Aug-2000  leo branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.28;
AHDI label editor
 1.1.1.1.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.28.1 03-Aug-2004  skrll Sync with HEAD
 1.1.1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.1.1.4.1 07-Aug-2000  bouyer file writedtab.c was added on branch thorpej_scsipi on 2000-11-20 20:05:32 +0000
 1.1.1.1.2.2 14-Aug-2000  leo Pullup ahdilabel. Requested by leo, approved by thorpej.

ahdilabel allows to edit AHDI (== the native Atari format) disklabels from
within NetBSD. From Julian Coleman.
 1.1.1.1.2.1 07-Aug-2000  leo file writedtab.c was added on branch netbsd-1-5 on 2000-08-14 08:00:00 +0000
 1.3.78.2 04-May-2009  yamt sync with head.
 1.3.78.1 16-May-2008  yamt sync with head.
 1.3.76.1 18-May-2008  yamt sync with head.
 1.3.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.7 10-May-2010  tsutsui Include <bsd.own.mk> before ${NETBSDSRCDIR}.
 1.6 20-Aug-2009  tsutsui branches: 1.6.2; 1.6.4;
Rewrite binpatch(8) utility to add support for ELF binaries,
using implementation of old src/usr.sbin/mdsetimage sources
which supports misc executable formats without LGPL'ed libbfd.

No particular comments on port-atari@.

XXX1: amiga also has the similar utility in amiga/stand/binpatch
but it has slightly different options.
XXX2: Is it worth to put this utility into MI src/usr.sbin to patch
rtc_offset etc. in GENERIC kernel binaries in distribution?
 1.5 12-Dec-2001  tv branches: 1.5.122; 1.5.132; 1.5.140;
MKfoo=no -> NOfoo
 1.4 13-Feb-1999  lukem branches: 1.4.22; 1.4.26;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 22-Jun-1997  mrg move man pages into share/man.
 1.2 29-Aug-1995  leo Fix rule for manual page.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.4.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.140.1 21-Apr-2010  matt sync to netbsd-5
 1.5.132.1 04-Oct-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #1056):
share/man/man8/man8.atari/binpatch.8: revision 1.6
sys/arch/atari/stand/binpatch/Makefile: revision 1.6
sys/arch/atari/stand/binpatch/binpatch.c: revision 1.5, 1.6
Rewrite binpatch(8) utility to add support for ELF binaries,
using implementation of old src/usr.sbin/mdsetimage sources
which supports misc executable formats without LGPL'ed libbfd.
No particular comments on port-atari@.
XXX1: amiga also has the similar utility in amiga/stand/binpatch
but it has slightly different options.
XXX2: Is it worth to put this utility into MI src/usr.sbin to patch
rtc_offset etc. in GENERIC kernel binaries in distribution?
 1.5.122.2 11-Aug-2010  yamt sync with head.
 1.5.122.1 16-Sep-2009  yamt sync with head
 1.6.4.1 30-May-2010  rmind sync with head
 1.6.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.7 22-Sep-2016  christos Catch up with mdsetimage changes.
 1.6 20-Aug-2009  tsutsui branches: 1.6.22; 1.6.40; 1.6.44;
Rewrite binpatch(8) utility to add support for ELF binaries,
using implementation of old src/usr.sbin/mdsetimage sources
which supports misc executable formats without LGPL'ed libbfd.

No particular comments on port-atari@.

XXX1: amiga also has the similar utility in amiga/stand/binpatch
but it has slightly different options.
XXX2: Is it worth to put this utility into MI src/usr.sbin to patch
rtc_offset etc. in GENERIC kernel binaries in distribution?
 1.5 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.4 04-Aug-2006  mhitch branches: 1.4.62; 1.4.70; 1.4.72; 1.4.76; 1.4.80;
gcc4 fixes: need to include stdlib.h; fix prototype and definition of
local error() function.
 1.3 06-Apr-1999  pk branches: 1.3.52; 1.3.66; 1.3.70;
Duplicate clause number in copyright text.
 1.2 01-Nov-1997  lukem branches: 1.2.8;
getopt returns -1 not EOF
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.2.8.1 07-Apr-1999  pk branches: 1.2.8.1.2;
Pull up from trunk: copyright text warts.
 1.2.8.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.70.1 11-Aug-2006  yamt sync with head
 1.3.66.1 09-Sep-2006  rpaulo sync with head
 1.3.52.1 30-Dec-2006  yamt sync with head.
 1.4.80.1 21-Apr-2010  matt sync to netbsd-5
 1.4.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.72.1 04-Oct-2009  snj Pull up following revision(s) (requested by tsutsui in ticket #1056):
share/man/man8/man8.atari/binpatch.8: revision 1.6
sys/arch/atari/stand/binpatch/Makefile: revision 1.6
sys/arch/atari/stand/binpatch/binpatch.c: revision 1.5, 1.6
Rewrite binpatch(8) utility to add support for ELF binaries,
using implementation of old src/usr.sbin/mdsetimage sources
which supports misc executable formats without LGPL'ed libbfd.
No particular comments on port-atari@.
XXX1: amiga also has the similar utility in amiga/stand/binpatch
but it has slightly different options.
XXX2: Is it worth to put this utility into MI src/usr.sbin to patch
rtc_offset etc. in GENERIC kernel binaries in distribution?
 1.4.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.62.2 16-Sep-2009  yamt sync with head
 1.4.62.1 04-May-2009  yamt sync with head.
 1.6.44.1 04-Nov-2016  pgoyette Sync with HEAD
 1.6.40.1 05-Oct-2016  skrll Sync with HEAD
 1.6.22.1 03-Dec-2017  jdolecek update from HEAD
 1.3 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.2 13-Feb-1999  lukem branches: 1.2.22; 1.2.26;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 28-May-1998  leo branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-1998  leo bootpref(8), set/get bootpreferences by Julian Coleman
 1.2.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2 28-May-1998  leo Moved to usr/share/man/man8/man8.atari.
 1.1 28-May-1998  leo branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-1998  leo bootpref(8), set/get bootpreferences by Julian Coleman
 1.6 17-Mar-2009  he Make a couple of functions conform to the prototype, restoring buildability.
 1.5 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.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 28-Apr-2008  martin branches: 1.3.8; 1.3.14;
Remove clause 3 and 4 from TNF licenses
 1.2 17-Jun-1998  leo branches: 1.2.150; 1.2.152; 1.2.154;
Both the values 0 & 3 denote an english language (probably 0 US, 3 GB).
Observed by Witek Wnuk.
 1.1 28-May-1998  leo branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-1998  leo bootpref(8), set/get bootpreferences by Julian Coleman
 1.2.154.2 04-May-2009  yamt sync with head.
 1.2.154.1 16-May-2008  yamt sync with head.
 1.2.152.1 18-May-2008  yamt sync with head.
 1.2.150.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 17-Jun-1998  leo branches: 1.2.150; 1.2.152; 1.2.154;
Both the values 0 & 3 denote an english language (probably 0 US, 3 GB).
Observed by Witek Wnuk.
 1.1 28-May-1998  leo branches: 1.1.1;
Initial revision
 1.1.1.1 28-May-1998  leo bootpref(8), set/get bootpreferences by Julian Coleman
 1.2.154.1 16-May-2008  yamt sync with head.
 1.2.152.1 18-May-2008  yamt sync with head.
 1.2.150.1 02-Jun-2008  mjf Sync with HEAD.
 1.15 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.14 08-Apr-2002  bjh21 Rather than grovelling around for libsa's objdir by hand, use ${PRINT_OBJDIR},
since that's what it's for.
 1.13 08-Apr-2002  bjh21 Add -Wno-uninitialized to CFLAGS, since it's overly-pessimistic.
 1.12 12-Dec-2001  lukem Set NOxxx= before <bsd.own.mk> is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
 1.11 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.10 13-Oct-2001  leo branches: 1.10.4;
Bootxx is no longer the last booting stage. It now handles only the
command line options. If NetBSD should be loaded, bootxx tries to load
the raw binary file '/boot' that resides on the same filesystem as the
kernel to be booted. This 3rd level boot is supposed to actually load the
kernel.
 1.9 22-Sep-2001  tv objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.8 08-Sep-2001  thomas Make the bootloader ELF aware.
It can load either a.out or ELF, depending on compile options.
 1.7 22-Apr-1999  leo branches: 1.7.14; 1.7.16;
Make sure that we can link against the libsa.a library. It looks like a
gross hack, but I don't know how to fix this in another way.
 1.6 19-Feb-1999  leo branches: 1.6.2;
STANDALONE -> _STANDALONE per recent discussion.
 1.5 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.4 17-Apr-1997  thorpej STRIP -> STRIPFLAG
 1.3 29-Jun-1996  leo Define LIBCRT0. This tries to defeat the attempts of bsd.prog.mk to add
${DESTDIR}/....crt0 to the link rule when $DESTDIR is set.
 1.2 14-May-1996  leo branches: 1.2.4;
Update to make this work correctly when using an obj-directory.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.4.1 30-Jun-1996  jtc Pulled up rev 1.3 by request from Leo Weppelman
 1.6.2.1 22-Apr-1999  perry branches: 1.6.2.1.2;
pullup 1.6->1.7 (leo)
 1.6.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.7.16.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.16.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.16.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.7.14.1 01-Oct-2001  fvdl Catch up with -current.
 1.10.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.10.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.10.4.1 13-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:23:39 +0000
 1.11 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.10 06-Jul-2010  mrg branches: 1.10.8; 1.10.18; 1.10.22;
remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

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

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


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.9 31-Mar-2009  tsutsui branches: 1.9.2; 1.9.4;
Switch atari standalone bootloaders to using MI libsa and libkern.

Tested by David Ross on port-atari@. Thanks!
 1.8 06-Jan-2009  tsutsui branches: 1.8.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.7 19-Oct-2008  apb branches: 1.7.2; 1.7.4;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.6 21-Nov-2006  dsl branches: 1.6.2; 1.6.52; 1.6.56; 1.6.62;
Make the install actually die when the boot code is too big (which it is).
No idea how long it has been bust for.
Other parts of this makefile are deeply sub-optimal.
 1.5 11-Dec-2005  christos branches: 1.5.20; 1.5.22;
merge ktrace-lwp.
 1.4 12-Mar-2004  jmc branches: 1.4.16;
Toolize and use install to make mdec/std so it's in METALOG. Now a make release
works once again for atari
 1.3 28-Oct-2003  he Add -ffreestanding to CFLAGS, so that libsa prototypes do not conflict
with otherwise built-in functions and prototypes in the new gcc.
 1.2 28-Jun-2003  he branches: 1.2.2;
Make sure to "mkdir -p" the destination directories under /usr/mdec.
 1.1 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 30-Dec-2006  yamt sync with head.
 1.5.22.1 10-Dec-2006  yamt sync with head.
 1.5.20.1 12-Jan-2007  ad Sync with head.
 1.6.62.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.6.56.2 11-Aug-2010  yamt sync with head.
 1.6.56.1 04-May-2009  yamt sync with head.
 1.6.52.1 17-Jan-2009  mjf Sync with HEAD.
 1.6.2.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.7.4.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.7.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.7.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.4.1 05-Mar-2011  rmind sync with head
 1.9.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.10.22.1 18-May-2014  rmind sync with head
 1.10.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17 11-Jun-2016  dholland PR 51200 gets in libsa considered harmful: use kgets
 1.16 15-Nov-2014  tsutsui branches: 1.16.2;
Expand heap to 64KB so that bootxx can load bootxxx from 32KB blocksize ffs.

Tested on TT030 with 32GB SSD via SATA->IDE->SCSI converters.
Should be pulled up to netbsd-7 and netbsd-6 branches..
 1.15 24-Aug-2009  tsutsui branches: 1.15.18; 1.15.22; 1.15.38;
KNF, ANSIfy etc.
 1.14 18-Mar-2009  cegger bzero -> memset
 1.13 06-Jan-2009  tsutsui branches: 1.13.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.12 11-Dec-2005  christos branches: 1.12.24; 1.12.74; 1.12.78; 1.12.86; 1.12.88;
merge ktrace-lwp.
 1.11 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.10 28-Jun-2005  junyoung ANSIfy, KNF, remove trailing spaces, and etc.
 1.9 18-Apr-2002  leo branches: 1.9.10;
Handle uninitialize warning.
 1.8 24-Oct-2001  leo branches: 1.8.2;
Small changes to the boot system:
- Install boot.atari in both / and /usr/mdec. It looks good to have a
spare copy soemwhere...
- Add '/boot.ata' as a last resort bootname.

All per discussion with Simon Burge, Matthew Green and Soren S. Jorvang.
 1.7 14-Oct-2001  leo branches: 1.7.2;
Change the name of the tertiary boot to /boot.atari. This was a suggestion
from Matthew Green. It would still allow multi-platform boots.
Thus, the second level loader first tries /boot.atari and uses /boot as a
fallback.
 1.6 13-Oct-2001  leo Bootxx is no longer the last booting stage. It now handles only the
command line options. If NetBSD should be loaded, bootxx tries to load
the raw binary file '/boot' that resides on the same filesystem as the
kernel to be booted. This 3rd level boot is supposed to actually load the
kernel.
 1.5 08-Sep-2001  thomas Make the bootloader ELF aware.
It can load either a.out or ELF, depending on compile options.
 1.4 24-Sep-2000  jdolecek branches: 1.4.2; 1.4.4;
add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.3 10-Feb-1998  leo branches: 1.3.14;
Accept an 68060 as cpu-type. (Thomas Gerner).
 1.2 28-Jun-1997  leo branches: 1.2.8;
Add 'libsa/atari_stand.h' that defines atari specific things. This allows
for a removal of our own copy of stand.h which was out-of-date by definition.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.8.1 30-Oct-1998  cgd pull up rev 1.3 from trunk (leo)
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.7.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.8.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.1 24-Oct-2001  nathanw file bootxx.c was added on branch nathanw_sa on 2002-06-20 03:38:19 +0000
 1.9.10.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.88.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.12.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.12.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.12.78.2 16-Sep-2009  yamt sync with head
 1.12.78.1 04-May-2009  yamt sync with head.
 1.12.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.12.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.13.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.38.1 14-Dec-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #322):
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.16
Expand heap to 64KB so that bootxx can load bootxxx from 32KB blocksize ffs.
Tested on TT030 with 32GB SSD via SATA->IDE->SCSI converters.
 1.15.22.1 03-Dec-2017  jdolecek update from HEAD
 1.15.18.1 14-Dec-2014  martin Pull up following revision(s) (requested by tsutsui in ticket #1211):
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.16
Expand heap to 64KB so that bootxx can load bootxxx from 32KB blocksize ffs.
Tested on TT030 with 32GB SSD via SATA->IDE->SCSI converters.
 1.16.2.1 09-Jul-2016  skrll Sync with HEAD
 1.2 13-Oct-2001  leo Bootxx is no longer the last booting stage. It now handles only the
command line options. If NetBSD should be loaded, bootxx tries to load
the raw binary file '/boot' that resides on the same filesystem as the
kernel to be booted. This 3rd level boot is supposed to actually load the
kernel.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo branches: 1.1.1.1.44;
NetBSD/Atari bootcode by Waldi Ravens.
 1.1.1.1.44.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8 24-Aug-2009  tsutsui Use __arraycount().
 1.7 11-Dec-2005  christos branches: 1.7.78;
merge ktrace-lwp.
 1.6 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.5 23-Jun-2005  junyoung Use FS_OPS() macro.
 1.4 23-Jun-2005  junyoung Drop trailing spaces.
 1.3 13-Oct-2001  leo branches: 1.3.4; 1.3.20;
Grr, this file shouldn't have been deleted. I thought I corrected it, in
fact the comments from the commit did not mention it to be deleted, just
'changed'...
 1.2 13-Oct-2001  leo Bootxx is no longer the last booting stage. It now handles only the
command line options. If NetBSD should be loaded, bootxx tries to load
the raw binary file '/boot' that resides on the same filesystem as the
kernel to be booted. This 3rd level boot is supposed to actually load the
kernel.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo branches: 1.1.1.1.44;
NetBSD/Atari bootcode by Waldi Ravens.
 1.1.1.1.44.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.20.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.4.2 13-Oct-2001  leo Grr, this file shouldn't have been deleted. I thought I corrected it, in
fact the comments from the commit did not mention it to be deleted, just
'changed'...
 1.3.4.1 13-Oct-2001  leo file filesystem.c was added on branch nathanw_sa on 2001-10-13 20:26:49 +0000
 1.7.78.1 16-Sep-2009  yamt sync with head
 1.1 06-Jan-2009  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.12;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 06-Jan-2009  yamt file start.S was added on branch yamt-nfs-mp on 2009-05-04 08:10:48 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 06-Jan-2009  skrll file start.S was added on branch nick-hppapmap on 2009-01-19 13:16:01 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 06-Jan-2009  mjf file start.S was added on branch mjf-devfs2 on 2009-01-17 13:27:55 +0000
 1.1.4.2 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.1.4.1 06-Jan-2009  bouyer file start.S was added on branch netbsd-5 on 2009-01-16 22:57:33 +0000
 1.1.2.2 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.1.2.1 06-Jan-2009  bouyer file start.S was added on branch netbsd-4 on 2009-01-15 23:20:02 +0000
 1.4 06-Jul-2010  mrg remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

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

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


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.3 28-Jun-2003  he branches: 1.3.108; 1.3.128; 1.3.130;
Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.3.130.1 05-Mar-2011  rmind sync with head
 1.3.128.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.3.108.1 11-Aug-2010  yamt sync with head.
 1.4 06-Jul-2010  mrg remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

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

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


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.3 28-Jun-2003  he branches: 1.3.108; 1.3.128; 1.3.130;
Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.3.130.1 05-Mar-2011  rmind sync with head
 1.3.128.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.3.108.1 11-Aug-2010  yamt sync with head.
 1.8 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.7 23-Apr-2002  tv Use ${INSTALL_FILE} to move /boot.atari into place so it is seen by an
UNPRIVED build.
 1.6 08-Apr-2002  bjh21 Use ${PRINT_OBJDIR} rather than looking for the libsa objdir manually.
 1.5 12-Dec-2001  lukem branches: 1.5.2;
Set NOxxx= before <bsd.own.mk> is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
 1.4 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.3 24-Oct-2001  leo branches: 1.3.2;
Small changes to the boot system:
- Install boot.atari in both / and /usr/mdec. It looks good to have a
spare copy soemwhere...
- Add '/boot.ata' as a last resort bootname.

All per discussion with Simon Burge, Matthew Green and Soren S. Jorvang.
 1.2 14-Oct-2001  leo branches: 1.2.2;
Change the name of the tertiary boot to /boot.atari. This was a suggestion
from Matthew Green. It would still allow multi-platform boots.
Thus, the second level loader first tries /boot.atari and uses /boot as a
fallback.
 1.1 13-Oct-2001  leo branches: 1.1.1;
Initial revision
 1.1.1.1 13-Oct-2001  leo 3rd level boot
 1.2.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.3.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.3.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.2.1 24-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:23:39 +0000
 1.5.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1 12-Dec-2001  thorpej file Makefile was added on branch kqueue on 2002-01-10 19:40:12 +0000
 1.9 01-Jul-2020  rin Correct SRCS; bsdstart.S not bsdstart.s.

Fix build with bsd.dep.mk rev 1.87, which requires more strict
filename matching.

Found by martin.
 1.8 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.7 06-Jul-2010  mrg branches: 1.7.8; 1.7.18; 1.7.22;
remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

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

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


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.6 31-Mar-2009  tsutsui branches: 1.6.2; 1.6.4;
Switch atari standalone bootloaders to using MI libsa and libkern.

Tested by David Ross on port-atari@. Thanks!
 1.5 13-Jan-2009  tsutsui branches: 1.5.2;
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.

Problem on default installation with sysinst was reported by David Ross.
 1.4 06-Jan-2009  tsutsui Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.3 11-Dec-2005  christos branches: 1.3.24; 1.3.74; 1.3.78; 1.3.86; 1.3.88;
merge ktrace-lwp.
 1.2 28-Oct-2003  he Add -ffreestanding to CFLAGS, so that libsa prototypes do not conflict
with otherwise built-in functions and prototypes in the new gcc.
 1.1 23-May-2003  leo branches: 1.1.2;
usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.88.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.3.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.3.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.3.78.2 11-Aug-2010  yamt sync with head.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.3.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.3.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.5.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.4.1 05-Mar-2011  rmind sync with head
 1.6.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.7.22.1 18-May-2014  rmind sync with head
 1.7.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10 26-Jun-2022  tsutsui Unifdef __ELF__.
 1.9 26-Jun-2022  tsutsui Consistently use "NetBSD/atari", not "NetBSD/Atari" on tertiary boot.
 1.8 24-Aug-2009  tsutsui KNF, ANSIfy etc.
 1.7 18-Mar-2009  cegger bzero -> memset
 1.6 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.5 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.4 06-Jan-2009  tsutsui branches: 1.4.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.3 11-Dec-2005  christos branches: 1.3.24; 1.3.74; 1.3.78; 1.3.86; 1.3.88;
merge ktrace-lwp.
 1.2 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.1 13-Oct-2001  leo branches: 1.1.1;
Initial revision
 1.1.1.1 13-Oct-2001  leo branches: 1.1.1.1.4; 1.1.1.1.6; 1.1.1.1.18;
3rd level boot
 1.1.1.1.18.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.1.1.6.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.1.1.6.1 13-Oct-2001  thorpej file bootxxx.c was added on branch kqueue on 2002-01-10 19:40:13 +0000
 1.1.1.1.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.1.1.4.2 11-Jan-2002  nathanw More catchup.
 1.1.1.1.4.1 13-Oct-2001  nathanw file bootxxx.c was added on branch nathanw_sa on 2002-01-11 23:38:13 +0000
 1.3.88.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.3.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.3.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.3.78.2 16-Sep-2009  yamt sync with head
 1.3.78.1 04-May-2009  yamt sync with head.
 1.3.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.3.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.4.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4 24-Aug-2009  tsutsui Use __arraycount().
 1.3 11-Dec-2005  christos branches: 1.3.78;
merge ktrace-lwp.
 1.2 28-Jun-2005  junyoung - Use FS_OPS() macro.
- #include <lib/libsa/stand.h> rather than <stand.h>. Do the same thingfor
ufs.h as well.
- Remove trailing spaces.
- Some other cosmetic changes.
 1.1 13-Oct-2001  leo branches: 1.1.1;
Initial revision
 1.1.1.1 13-Oct-2001  leo branches: 1.1.1.1.4; 1.1.1.1.6; 1.1.1.1.18;
3rd level boot
 1.1.1.1.18.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.1.1.6.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.1.1.6.1 13-Oct-2001  thorpej file filesystem.c was added on branch kqueue on 2002-01-10 19:40:14 +0000
 1.1.1.1.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.1.1.4.2 11-Jan-2002  nathanw More catchup.
 1.1.1.1.4.1 13-Oct-2001  nathanw file filesystem.c was added on branch nathanw_sa on 2002-01-11 23:38:13 +0000
 1.3.78.1 16-Sep-2009  yamt sync with head
 1.1 06-Jan-2009  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.12;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 06-Jan-2009  yamt file start.S was added on branch yamt-nfs-mp on 2009-05-04 08:10:48 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 06-Jan-2009  skrll file start.S was added on branch nick-hppapmap on 2009-01-19 13:16:01 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 06-Jan-2009  mjf file start.S was added on branch mjf-devfs2 on 2009-01-17 13:27:55 +0000
 1.1.4.2 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.1.4.1 06-Jan-2009  bouyer file start.S was added on branch netbsd-5 on 2009-01-16 22:57:33 +0000
 1.1.2.2 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.1.2.1 06-Jan-2009  bouyer file start.S was added on branch netbsd-4 on 2009-01-15 23:20:02 +0000
 1.4 06-Jul-2010  mrg remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

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

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


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.3 28-Jun-2003  he branches: 1.3.108; 1.3.128; 1.3.130;
Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.3.130.1 05-Mar-2011  rmind sync with head
 1.3.128.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.3.108.1 11-Aug-2010  yamt sync with head.
 1.4 06-Jul-2010  mrg remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

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

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


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
 1.3 28-Jun-2003  he branches: 1.3.108; 1.3.128; 1.3.130;
Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.3.130.1 05-Mar-2011  rmind sync with head
 1.3.128.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.3.108.1 11-Aug-2010  yamt sync with head.
 1.7 10-Feb-2010  roy Convert to terminfo so we compile.
 1.6 03-Feb-2010  roy branches: 1.6.2;
Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@
 1.5 12-Dec-2001  tv branches: 1.5.122;
MKfoo=no -> NOfoo
 1.4 13-Feb-1999  lukem branches: 1.4.22; 1.4.26;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 22-Jun-1997  mrg move man pages into share/man.
 1.2 06-Jun-1997  mikel nuke bad MLINKS line; fixes PR port-atari/3605.
 1.1 16-May-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 16-May-1996  leo edahdi, an AHDI partition-id editor
 1.4.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.122.1 11-Mar-2010  yamt sync with head
 1.6.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 16-May-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 16-May-1996  leo edahdi, an AHDI partition-id editor
 1.11 01-Oct-2011  chs fix build errors with gcc 4.5.
 1.10 10-Feb-2010  roy Convert to terminfo so we compile.
 1.9 18-Mar-2009  cegger branches: 1.9.2;
Ansify function definitions w/o arguments. Generated with sed.
 1.8 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.7 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 11-Dec-2005  christos branches: 1.5.78; 1.5.86; 1.5.92;
merge ktrace-lwp.
 1.4 12-Nov-2004  he Add casts to unsigned char for the arguments to the ctype.h macros/functions.
 1.3 15-Feb-2000  leo branches: 1.3.28;
Nuke the local outc() since the prototype for the second argument of tputs()
now matches putchar().
 1.2 01-Jun-1999  leo branches: 1.2.2;
Fix copyright (exchange clauses 3 & 4).
 1.1 16-May-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 16-May-1996  leo branches: 1.1.1.1.26;
edahdi, an AHDI partition-id editor
 1.1.1.1.26.1 21-Jun-1999  thorpej Sync w/ -current.
 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.28.1 14-Nov-2004  skrll Sync with HEAD.
 1.5.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.78.2 11-Mar-2010  yamt sync with head
 1.5.78.1 04-May-2009  yamt sync with head.
 1.9.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.11 03-Jul-2022  tsutsui Fix inverted logic. My fault back in 2015..
 1.10 11-May-2022  rin For atari install disk:

- Drop FD support from installboot(8). Reduce ~0.5KB.
- Drop primary boot loaders for FD (2 files, 0.5KB each).

Note that we continue to support these features in base.

OK tsutsui@
 1.9 12-Aug-2015  tsutsui Try to shrink binary size a bit.

- omit usage of options in SMALLPROG case
- use bool instead of int where appropriate
- rely on zero-initialized-bss
 1.8 24-Nov-2014  tsutsui branches: 1.8.2;
Disable "OS bootversion check" on crunched binaries for installation media.

This oscheck() function seems implemented to check compatibility
between bootloaders and /netbsd kernel, but checking /netbsd using kvm(3)
doesn't make sense on installation or even future cross builds, and
probably we will never bump bootloader version without compatibility
per recent 14 years history.

This works around overflow of 1440KB 2HD sysinst.fs, and would also be
worth to pullup to netbsd-7.
 1.7 24-Nov-2014  tsutsui Specify -fno-strict-aliasing as a temporary workaround for gcc48.

The existing abcksum() also violates strict-aliasing rule
(while current gcc48 doesn't warn it) and fixing all violations
strictly requires whole reorganization of boot sector structures.
But it won't happen soon and this MD installboot should be integrated
into MI installboot(8) in future, and it requires whole overhaul anyway.
See long discussion in source-changes-d@ for details.

Should be pulled up to netbsd-7 if we switches m68k to using gcc48.
 1.6 01-Nov-2011  chs branches: 1.6.12; 1.6.28;
use WARNS instead of mucking with CFLAGS directly.
 1.5 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.4 13-Feb-1999  lukem branches: 1.4.22; 1.4.26;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 09-Jul-1997  leo Introduce 'bootversion' in locore.s. Check this to decide if installing
a bootstrap with the running installboot makes sense.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.4.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.4.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.28.2 29-Mar-2015  snj Pull up following revision(s) (requested by martin in ticket #651):
distrib/atari/floppies/common/list.images: revision 1.10
sys/arch/atari/stand/installboot/Makefile: revision 1.8
sys/arch/atari/stand/installboot/installboot.c: revision 1.34
Disable "OS bootversion check" on crunched binaries for installation media.
This oscheck() function seems implemented to check compatibility
between bootloaders and /netbsd kernel, but checking /netbsd using kvm(3)
doesn't make sense on installation or even future cross builds, and
probably we will never bump bootloader version without compatibility
per recent 14 years history.
This works around overflow of 1440KB 2HD sysinst.fs, and would also be
worth to pullup to netbsd-7.
 1.6.28.1 04-Feb-2015  snj Pull up following revision(s) (requested by chs in ticket #482):
sys/arch/atari/stand/installboot/Makefile: revision 1.7
Specify -fno-strict-aliasing as a temporary workaround for gcc48.
The existing abcksum() also violates strict-aliasing rule
(while current gcc48 doesn't warn it) and fixing all violations
strictly requires whole reorganization of boot sector structures.
But it won't happen soon and this MD installboot should be integrated
into MI installboot(8) in future, and it requires whole overhaul anyway.
See long discussion in source-changes-d@ for details.
Should be pulled up to netbsd-7 if we switches m68k to using gcc48.
 1.6.12.1 03-Dec-2017  jdolecek update from HEAD
 1.8.2.1 22-Sep-2015  skrll Sync with HEAD
 1.7 13-Mar-2016  tsutsui Misc KNF and ANSIfy.
 1.6 01-Oct-2011  chs branches: 1.6.12; 1.6.30;
fix build errors with gcc 4.5.
 1.5 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.4 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 06-Jan-2009  tsutsui branches: 1.3.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.2 22-Jul-1998  leo branches: 1.2.100; 1.2.150; 1.2.154; 1.2.162; 1.2.164;
Add '<ufs/ufs/dinode.h>' to the include list. (Julian Coleman)
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.164.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.2.162.2 28-Apr-2009  skrll Sync with HEAD.
 1.2.162.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.154.1 04-May-2009  yamt sync with head.
 1.2.150.1 17-Jan-2009  mjf Sync with HEAD.
 1.2.100.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.3.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.30.1 19-Mar-2016  skrll Sync with HEAD
 1.6.12.1 03-Dec-2017  jdolecek update from HEAD
 1.3 22-Jun-1997  mrg move man pages into share/man.
 1.2 20-Jun-1996  leo Some minor nits.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.39 03-Jul-2022  tsutsui Fix inverted logic. My fault back in 2015..
 1.38 11-May-2022  rin Make FD support optional (intended for install media).
 1.37 11-May-2022  rin Refactor install_[sw]d() into install_hd().

Shave off ~0.5KB from install floppy, and dedup codes a lot.

Thanks tsutsui@ for kind review!
 1.36 11-Jan-2017  christos need <sys/stat.h>
 1.35 12-Aug-2015  tsutsui branches: 1.35.2;
Try to shrink binary size a bit.

- omit usage of options in SMALLPROG case
- use bool instead of int where appropriate
- rely on zero-initialized-bss
 1.34 24-Nov-2014  tsutsui branches: 1.34.2;
Disable "OS bootversion check" on crunched binaries for installation media.

This oscheck() function seems implemented to check compatibility
between bootloaders and /netbsd kernel, but checking /netbsd using kvm(3)
doesn't make sense on installation or even future cross builds, and
probably we will never bump bootloader version without compatibility
per recent 14 years history.

This works around overflow of 1440KB 2HD sysinst.fs, and would also be
worth to pullup to netbsd-7.
 1.33 24-Nov-2014  tsutsui Revert previous again.

There are claims that it still violates strict-aliasing rule and
it is no sense to just appease compiler by incorrect implementation.
 1.32 16-Nov-2014  tsutsui Appease gcc48 -Werror=strict-aliasing warning by filling cksum via union.

Discussed in source-changes-d@ thread and tested on TT030.
Should be pulled up to netbsd-7 (if NetBSD/m68k 7.0 will switch to gcc48).
 1.31 16-Nov-2014  tsutsui Revert revs 1.29 and 1.30, to make it easier to pullup an alternative fix.

Ok'ed by christos@
http://mail-index.netbsd.org/source-changes-d/2014/11/15/msg007338.html
 1.30 13-Nov-2014  christos move to the right offset
 1.29 13-Nov-2014  christos fix strict aliasing violations
 1.28 31-Mar-2014  ozaki-r branches: 1.28.4;
Fix typo
 1.27 29-Mar-2014  ozaki-r Fix typos
 1.26 26-Mar-2014  christos kill sprintf
 1.25 05-Nov-2011  christos branches: 1.25.10; 1.25.14;
make this compile again.
 1.24 14-Mar-2009  dsl branches: 1.24.12;
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 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.22 06-Jan-2009  tsutsui branches: 1.22.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.21 15-Nov-2008  abs Since dl.d_type is always "unknown" now, pick the type of bootblock to
install based on the device name: eg /dev/fd0c would be floppy
 1.20 11-Dec-2005  christos branches: 1.20.24; 1.20.68; 1.20.74; 1.20.78; 1.20.84; 1.20.86; 1.20.88;
merge ktrace-lwp.
 1.19 11-Mar-2004  jmc daddr_t is forced to int32_t in sys/arch/atari/stand/Makefile.inc so correct
the printf formats to match this
 1.18 09-Mar-2004  jdc Catch up to the bootblock split into std and milan directories.
 1.17 01-Apr-2003  he branches: 1.17.2;
Undo the last; adding the quad arithmetic caused the boot code to
overflow. Instead do as the mvme68k port, and use 32-bit daddr_t here.
 1.16 01-Apr-2003  he Adapt to daddr_t being bumped to 64 bits. This required us to add
div/mod quad operations to libsa, and adjusting a pair of format specifiers.
 1.15 09-Aug-2002  soren Remove extraneous \n's in {err,warn}{,x}.
 1.14 20-Jul-2002  grant sweep of errx/warnx, remove unnecessary trailing \n
 1.13 12-Apr-2002  leo branches: 1.13.2;
Don't bail out when /netbsd is not present. We don't really need it
anyway.
 1.12 14-Oct-2001  leo branches: 1.12.4;
Just use '_bootversion', don't use C_LABEL macros. From RTSL, I found out
that kvm_nlist adds an underscore when the binary format is ELF.
 1.11 06-Sep-2001  leo Make this finally compile again. It hasn't worked since the C_LABEL() got in.
 1.10 30-Sep-2000  leo branches: 1.10.4;
Add include of <machine/asm.h>. C_LABEL is defined there.
 1.9 08-Jul-2000  jdolecek use _C_LABEL() for bootversion, instead of hardcoding the reference as _bootversion
 1.8 01-Dec-1998  leo branches: 1.8.10;
Make this compile again... ('maximum entropy').
 1.7 09-Jul-1997  leo Introduce 'bootversion' in locore.s. Check this to decide if installing
a bootstrap with the running installboot makes sense.
 1.6 08-Jan-1997  leo Handle DTYPE_ESDI like ST506.
 1.5 08-Jan-1997  leo Bump version.
 1.4 29-Jun-1996  leo Update to match NetBSD version.
 1.3 14-May-1996  leo branches: 1.3.4;
Update to make this work correctly when using an obj-directory.
 1.2 28-Mar-1996  leo Drop in a more interlligent version check.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.3.4.1 30-Jun-1996  jtc Pulled up rev 1.4 by request from Leo Weppelman
 1.8.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.10.4.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.10.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.10.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.12.4.4 13-Aug-2002  nathanw Catch up to -current.
 1.12.4.3 01-Aug-2002  nathanw Catch up to -current.
 1.12.4.2 17-Apr-2002  nathanw Catch up to -current.
 1.12.4.1 14-Oct-2001  nathanw file installboot.c was added on branch nathanw_sa on 2002-04-17 00:02:43 +0000
 1.13.2.1 30-Aug-2002  gehenna catch up with -current.
 1.17.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.88.2 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.20.88.1 08-Jan-2009  snj Pull up following revision(s) (requested by abs in ticket #228):
sys/arch/atari/stand/installboot/installboot.c: revision 1.21
Since dl.d_type is always "unknown" now, pick the type of bootblock to
install based on the device name: eg /dev/fd0c would be floppy
 1.20.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.20.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.20.84.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.20.78.1 04-May-2009  yamt sync with head.
 1.20.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.20.68.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by abs in ticket #1257):
distrib/atari/miniroot/Makefile.inc: file removal
distrib/atari/floppies/prepare/list: revision 1.5
distrib/atari/miniroot/dot.profile: file removal
distrib/atari/miniroot/install.md: file removal
distrib/atari/floppies/install/list: revision 1.8
distrib/atari/miniroot/disktab.shadow: file removal
distrib/atari/miniroot/termcap.vt: file removal
distrib/atari/floppies/prepare/install.md: revision 1.3
sys/arch/atari/stand/installboot/installboot.c: revision 1.21
distrib/atari/floppies/common/dot.profile: revision 1.3
distrib/atari/miniroot/list: file removal
Since dl.d_type is always "unknown" now, pick the type of bootblock to
install based on the device name: eg /dev/fd0c would be floppy
Fix atari sysinst based miniroot image, and retire old (unreferenced)
miniroot.
 1.20.24.2 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.20.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by abs in ticket #1257):
distrib/atari/miniroot/Makefile.inc: file removal
distrib/atari/floppies/prepare/list: revision 1.5
distrib/atari/miniroot/dot.profile: file removal
distrib/atari/miniroot/install.md: file removal
distrib/atari/floppies/install/list: revision 1.8
distrib/atari/miniroot/disktab.shadow: file removal
distrib/atari/miniroot/termcap.vt: file removal
distrib/atari/floppies/prepare/install.md: revision 1.3
sys/arch/atari/stand/installboot/installboot.c: revision 1.21
distrib/atari/floppies/common/dot.profile: revision 1.3
distrib/atari/miniroot/list: file removal
Since dl.d_type is always "unknown" now, pick the type of bootblock to
install based on the device name: eg /dev/fd0c would be floppy
Fix atari sysinst based miniroot image, and retire old (unreferenced)
miniroot.
 1.22.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.24.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.24.12.1 10-Nov-2011  yamt sync with head
 1.25.14.1 18-May-2014  rmind sync with head
 1.25.10.2 03-Dec-2017  jdolecek update from HEAD
 1.25.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.4.1 29-Mar-2015  snj Pull up following revision(s) (requested by martin in ticket #651):
distrib/atari/floppies/common/list.images: revision 1.10
sys/arch/atari/stand/installboot/Makefile: revision 1.8
sys/arch/atari/stand/installboot/installboot.c: revision 1.34
Disable "OS bootversion check" on crunched binaries for installation media.
This oscheck() function seems implemented to check compatibility
between bootloaders and /netbsd kernel, but checking /netbsd using kvm(3)
doesn't make sense on installation or even future cross builds, and
probably we will never bump bootloader version without compatibility
per recent 14 years history.
This works around overflow of 1440KB 2HD sysinst.fs, and would also be
worth to pullup to netbsd-7.
 1.34.2.2 05-Feb-2017  skrll Sync with HEAD
 1.34.2.1 22-Sep-2015  skrll Sync with HEAD
 1.35.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.11 13-Mar-2016  tsutsui Misc KNF and ANSIfy.
 1.10 14-Mar-2009  dsl branches: 1.10.22; 1.10.40;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.9 06-Jan-2009  tsutsui branches: 1.9.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.8 11-Dec-2005  christos branches: 1.8.24; 1.8.74; 1.8.78; 1.8.86; 1.8.88;
merge ktrace-lwp.
 1.7 09-Mar-2004  jdc Catch up to the bootblock split into std and milan directories.
 1.6 24-Sep-2000  jdolecek branches: 1.6.24;
add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

as discussed on tech-kern, add new boot flags -v, -q for booting
verbosely or quietly, and corresponding AB_VERBOSE/AB_QUIET
boot flags; also add FreeBSD-compatible bootverbose macro and
NetBSD-specific bootquiet macro

for hpcmips, use new bootverbose instead of it's own hpcmips_verbose

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.5 09-Jul-1997  leo branches: 1.5.20;
Introduce 'bootversion' in locore.s. Check this to decide if installing
a bootstrap with the running installboot makes sense.
 1.4 25-Oct-1996  leo Make installboot work for 1.2 & 1.2A (should be part of 1.2 patches).
 1.3 29-Jun-1996  leo Update to match NetBSD version.
 1.2 28-Mar-1996  leo branches: 1.2.4;
Drop in a more interlligent version check.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.4.2 05-Dec-1996  rat Pullup revision 1.4 by request from Leo Weppelman <leo@wau.mis.ah.nl>

>Corrected the verions-string so it will actually work on NetBSD1.2[A]
 1.2.4.1 30-Jun-1996  jtc Pulled up rev 1.3 by request from Leo Weppelman
 1.5.20.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.24.1 03-Aug-2004  skrll Sync with HEAD
 1.8.88.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.8.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.8.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.78.1 04-May-2009  yamt sync with head.
 1.8.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.9.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.40.1 19-Mar-2016  skrll Sync with HEAD
 1.10.22.1 03-Dec-2017  jdolecek update from HEAD
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2;
Atari keyboard maps
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file Makefile was added on branch netbsd-1-2 on 1996-06-22 20:14:10 +0000
 1.8 29-May-2021  tsutsui Appease compiler warnings derived from ancient HOST files. PR/56187

Also fix misc styles and formats per KNF.
 1.7 04-May-2002  bjh21 branches: 1.7.218; 1.7.220;
<bsd.hostprog.mk> and <bsd.prog.mk> don't play nicely together. Since
<bsd.hostprog.mk> includes <bsd.files.mk> anyway, drop <bsd.prog.mk>.
 1.6 24-Apr-2002  lukem - in <bsd.files.mk>, don't clear FILES after using it, as that prevents
make -V FILES
from being useful (and given that every other variable can be
extracted using make -V, the behaviour was unusually inconsistent
given that the original reason for clearing it doesn't seem to be
relevant anymore)
- use <bsd.prog.mk> instead of directly including <bsd.files.mk>
(and possibly <bsd.man.mk> or <bsd.own.mk>)
- remove obsolete NOPROG
 1.5 15-Apr-2002  bjh21 Build the keymap-generating programs as hostprogs, since they're only run
on the host system and never installed.

Install the generated keymaps using <bsd.files.mk> rather than by hand, so
that all the UNPRIVED magic can work.
 1.4 15-Jul-1997  leo branches: 1.4.34; 1.4.38;
Install key-maps only and forget about the program generating them.
 1.3 15-Jul-1996  leo keymap -> keymaps
 1.2 22-Jun-1996  leo branches: 1.2.2;
s/keymaps/keymap/
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo Atari keyboard maps
 1.2.2.2 16-Jul-1996  jtc Pulled up from rev 1.3 by request from Leo Weppelman
 1.2.2.1 22-Jun-1996  jtc file Makefile.inc was added on branch netbsd-1-2 on 1996-07-16 01:02:18 +0000
 1.4.38.2 20-Jun-2002  nathanw Catch up to -current.
 1.4.38.1 17-Apr-2002  nathanw Catch up to -current.
 1.4.34.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.220.1 31-May-2021  cjep sync with head
 1.7.218.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.4 04-May-2018  christos remove bsd.hostinit.mk
 1.3 01-May-2018  christos Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
 1.2 15-Apr-2002  bjh21 branches: 1.2.200;
Build the keymap-generating programs as hostprogs, since they're only run
on the host system and never installed.

Install the generated keymaps using <bsd.files.mk> rather than by hand, so
that all the UNPRIVED magic can work.
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2; 1.1.1.1.44; 1.1.1.1.48;
Atari keyboard maps
 1.1.1.1.48.1 17-Apr-2002  nathanw Catch up to -current.
 1.1.1.1.44.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file Makefile was added on branch netbsd-1-2 on 1996-06-22 20:14:13 +0000
 1.2.200.2 21-May-2018  pgoyette Sync with HEAD
 1.2.200.1 02-May-2018  pgoyette Synch with HEAD
 1.4 29-May-2021  tsutsui Appease compiler warnings derived from ancient HOST files. PR/56187

Also fix misc styles and formats per KNF.
 1.3 18-Mar-2009  cegger branches: 1.3.80; 1.3.82;
Ansify function definitions w/o arguments. Generated with sed.
 1.2 07-Sep-2001  thomas branches: 1.2.4; 1.2.126; 1.2.134; 1.2.140;
Return a useful exit status.
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2; 1.1.1.1.42; 1.1.1.1.44;
Atari keyboard maps
 1.1.1.1.44.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.1.1.42.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file de-kbdmap.c was added on branch netbsd-1-2 on 1996-06-22 20:14:13 +0000
 1.2.140.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.134.1 28-Apr-2009  skrll Sync with HEAD.
 1.2.126.1 04-May-2009  yamt sync with head.
 1.2.4.2 07-Sep-2001  thomas Return a useful exit status.
 1.2.4.1 07-Sep-2001  thomas file de-kbdmap.c was added on branch nathanw_sa on 2001-09-07 23:09:37 +0000
 1.3.82.1 31-May-2021  cjep sync with head
 1.3.80.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.4 04-May-2018  christos remove bsd.hostinit.mk
 1.3 01-May-2018  christos Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
 1.2 15-Apr-2002  bjh21 branches: 1.2.200;
Build the keymap-generating programs as hostprogs, since they're only run
on the host system and never installed.

Install the generated keymaps using <bsd.files.mk> rather than by hand, so
that all the UNPRIVED magic can work.
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2; 1.1.1.1.44; 1.1.1.1.48;
Atari keyboard maps
 1.1.1.1.48.1 17-Apr-2002  nathanw Catch up to -current.
 1.1.1.1.44.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file Makefile was added on branch netbsd-1-2 on 1996-06-22 20:14:12 +0000
 1.2.200.2 21-May-2018  pgoyette Sync with HEAD
 1.2.200.1 02-May-2018  pgoyette Synch with HEAD
 1.4 29-May-2021  tsutsui Appease compiler warnings derived from ancient HOST files. PR/56187

Also fix misc styles and formats per KNF.
 1.3 18-Mar-2009  cegger branches: 1.3.80; 1.3.82;
Ansify function definitions w/o arguments. Generated with sed.
 1.2 07-Sep-2001  thomas branches: 1.2.4; 1.2.126; 1.2.134; 1.2.140;
Return a useful exit status.
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2; 1.1.1.1.42; 1.1.1.1.44;
Atari keyboard maps
 1.1.1.1.44.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.1.1.42.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file fr-kbdmap.c was added on branch netbsd-1-2 on 1996-06-22 20:14:12 +0000
 1.2.140.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.134.1 28-Apr-2009  skrll Sync with HEAD.
 1.2.126.1 04-May-2009  yamt sync with head.
 1.2.4.2 07-Sep-2001  thomas Return a useful exit status.
 1.2.4.1 07-Sep-2001  thomas file fr-kbdmap.c was added on branch nathanw_sa on 2001-09-07 23:09:38 +0000
 1.3.82.1 31-May-2021  cjep sync with head
 1.3.80.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.4 04-May-2018  christos remove bsd.hostinit.mk
 1.3 01-May-2018  christos Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
 1.2 15-Apr-2002  bjh21 branches: 1.2.200;
Build the keymap-generating programs as hostprogs, since they're only run
on the host system and never installed.

Install the generated keymaps using <bsd.files.mk> rather than by hand, so
that all the UNPRIVED magic can work.
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2; 1.1.1.1.44; 1.1.1.1.48;
Atari keyboard maps
 1.1.1.1.48.1 17-Apr-2002  nathanw Catch up to -current.
 1.1.1.1.44.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file Makefile was added on branch netbsd-1-2 on 1996-06-22 20:14:11 +0000
 1.2.200.2 21-May-2018  pgoyette Sync with HEAD
 1.2.200.1 02-May-2018  pgoyette Synch with HEAD
 1.4 29-May-2021  tsutsui Appease compiler warnings derived from ancient HOST files. PR/56187

Also fix misc styles and formats per KNF.
 1.3 18-Mar-2009  cegger branches: 1.3.80; 1.3.82;
Ansify function definitions w/o arguments. Generated with sed.
 1.2 07-Sep-2001  thomas branches: 1.2.4; 1.2.126; 1.2.134; 1.2.140;
Return a useful exit status.
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2; 1.1.1.1.42; 1.1.1.1.44;
Atari keyboard maps
 1.1.1.1.44.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.1.1.42.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file uk-kbdmap.c was added on branch netbsd-1-2 on 1996-06-22 20:14:11 +0000
 1.2.140.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.134.1 28-Apr-2009  skrll Sync with HEAD.
 1.2.126.1 04-May-2009  yamt sync with head.
 1.2.4.2 07-Sep-2001  thomas Return a useful exit status.
 1.2.4.1 07-Sep-2001  thomas file uk-kbdmap.c was added on branch nathanw_sa on 2001-09-07 23:09:38 +0000
 1.3.82.1 31-May-2021  cjep sync with head
 1.3.80.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.4 04-May-2018  christos remove bsd.hostinit.mk
 1.3 01-May-2018  christos Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
 1.2 15-Apr-2002  bjh21 branches: 1.2.200;
Build the keymap-generating programs as hostprogs, since they're only run
on the host system and never installed.

Install the generated keymaps using <bsd.files.mk> rather than by hand, so
that all the UNPRIVED magic can work.
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2; 1.1.1.1.44; 1.1.1.1.48;
Atari keyboard maps
 1.1.1.1.48.1 17-Apr-2002  nathanw Catch up to -current.
 1.1.1.1.44.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file Makefile was added on branch netbsd-1-2 on 1996-06-22 20:14:12 +0000
 1.2.200.2 21-May-2018  pgoyette Sync with HEAD
 1.2.200.1 02-May-2018  pgoyette Synch with HEAD
 1.4 29-May-2021  tsutsui Appease compiler warnings derived from ancient HOST files. PR/56187

Also fix misc styles and formats per KNF.
 1.3 18-Mar-2009  cegger branches: 1.3.80; 1.3.82;
Ansify function definitions w/o arguments. Generated with sed.
 1.2 07-Sep-2001  thomas branches: 1.2.4; 1.2.126; 1.2.134; 1.2.140;
Return a useful exit status.
 1.1 22-Jun-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 22-Jun-1996  leo branches: 1.1.1.1.2; 1.1.1.1.42; 1.1.1.1.44;
Atari keyboard maps
 1.1.1.1.44.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.1.1.42.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.1.1.2.2 22-Jun-1996  leo Atari keyboard maps
 1.1.1.1.2.1 22-Jun-1996  leo file us-kbdmap.c was added on branch netbsd-1-2 on 1996-06-22 20:14:12 +0000
 1.2.140.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.134.1 28-Apr-2009  skrll Sync with HEAD.
 1.2.126.1 04-May-2009  yamt sync with head.
 1.2.4.2 07-Sep-2001  thomas Return a useful exit status.
 1.2.4.1 07-Sep-2001  thomas file us-kbdmap.c was added on branch nathanw_sa on 2001-09-07 23:09:38 +0000
 1.3.82.1 31-May-2021  cjep sync with head
 1.3.80.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.31 27-May-2010  dholland Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.
 1.30 31-Mar-2009  tsutsui branches: 1.30.2; 1.30.4;
Switch atari standalone bootloaders to using MI libsa and libkern.

Tested by David Ross on port-atari@. Thanks!
 1.29 19-Mar-2009  tsutsui Remove bcmp() from MD libsa.

XXX: These ports should be rewritten to use MI libsa for maintainability.
 1.28 06-Jan-2009  tsutsui branches: 1.28.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.27 30-Dec-2005  he branches: 1.27.24; 1.27.74; 1.27.78; 1.27.86; 1.27.88;
Make this build again by using ${S}/../common/lib/libc/Makefile.inc.
 1.26 11-Dec-2005  christos merge ktrace-lwp.
 1.25 28-Jun-2005  junyoung branches: 1.25.2;
Sync comment with reality.
While here, remove trailing spaces.
 1.24 14-Jun-2005  jmc add memcmp. Why doesn't this use the regular libsa pullover?
 1.23 28-Oct-2003  he Add -ffreestanding to CFLAGS, so that libsa prototypes do not conflict
with otherwise built-in functions and prototypes in the new gcc.
 1.22 29-Aug-2003  dsl libsa/bcmp.c now defines both bcmp and memcmp
 1.21 24-Aug-2003  he The new ufs.o also needs memset, so add it.
 1.20 21-Aug-2003  he Add memcmp, memmove and bcmp to handle the new ufs.c.
 1.19 01-Apr-2003  he branches: 1.19.2;
Undo the last; adding the quad arithmetic caused the boot code to
overflow. Instead do as the mvme68k port, and use 32-bit daddr_t here.
 1.18 01-Apr-2003  he Adapt to daddr_t being bumped to 64 bits. This required us to add
div/mod quad operations to libsa, and adjusting a pair of format specifiers.
 1.17 05-May-2002  jdolecek also don't make the machine symlinks for 'clean' target
move the CLEANFILES update out of the .if, so that the files get removed
for 'clean' or 'cleandir'
 1.16 05-May-2002  jdolecek Don't make the machine symlinks for 'cleandir' target either. This
should fix read-only source builds.

XXX Perhaps the condition should be changed to
XXX .if make(depend) || make(all) || make(dependall)
XXX similarily to bsd.kmod.mk?
 1.15 08-Apr-2002  bjh21 Add files.c to SRCS, since other bits of libsa want it.
 1.14 11-Mar-2002  leo Take care of the 'machine' and 'm68k' include paths.
Copied verbatim from the x68k/stand/libsa/Makefile.
 1.13 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.12 14-Nov-2001  tv Work around <bsd.lib.mk> used for kernel libs in other places. Clean up
include paths.
 1.11 13-Oct-2001  leo branches: 1.11.4;
We need a configurable heap now (that implies we need panic.c too....).
 1.10 02-Oct-2001  chs add ashldi3.c, needed by ufs.c due to added cast in lblktosize().
 1.9 08-Sep-2001  thomas ELF adaption.
 1.8 15-Mar-1999  leo branches: 1.8.20; 1.8.22;
We need more 'stand' functions (From Julian Coleman).
 1.7 19-Feb-1999  leo STANDALONE -> _STANDALONE per recent discussion.
 1.6 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.5 31-May-1997  cjs Back out BUILDDIR and NOINSTALL changes.
 1.4 30-May-1997  cjs Remove empty libinstall target and add NOINSTALL=1.
 1.3 07-May-1997  mycroft Use libinstall::, not install:, to prevent instaling LIB.
 1.2 14-May-1996  leo Update to make this work correctly when using an obj-directory.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.8.22.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.22.3 16-Mar-2002  jdolecek Catch up with -current.
 1.8.22.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.22.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.8.20.2 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.8.20.1 01-Oct-2001  fvdl Catch up with -current.
 1.11.4.5 20-Jun-2002  nathanw Catch up to -current.
 1.11.4.4 17-Apr-2002  nathanw Catch up to -current.
 1.11.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.11.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.11.4.1 13-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:23:40 +0000
 1.19.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.25.2.1 21-Jun-2006  yamt sync with head.
 1.27.88.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.27.86.2 28-Apr-2009  skrll Sync with HEAD.
 1.27.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.27.78.2 11-Aug-2010  yamt sync with head.
 1.27.78.1 04-May-2009  yamt sync with head.
 1.27.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.27.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.28.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.4.1 30-May-2010  rmind sync with head
 1.30.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.3 12-Aug-2015  tsutsui No need to have errno in a MD file. It's in MI src/sys/lib/libsa/errno.c.
 1.2 30-Jun-2011  wiz branches: 1.2.12; 1.2.30;
dependant -> dependent
 1.1 31-Mar-2009  tsutsui branches: 1.1.2; 1.1.4; 1.1.6;
Switch atari standalone bootloaders to using MI libsa and libkern.

Tested by David Ross on port-atari@. Thanks!
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 31-Mar-2009  jym file Makefile.inc was added on branch jym-xensuspend on 2009-05-13 17:16:32 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 31-Mar-2009  yamt file Makefile.inc was added on branch yamt-nfs-mp on 2009-05-04 08:10:49 +0000
 1.1.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.1.2.1 31-Mar-2009  skrll file Makefile.inc was added on branch nick-hppapmap on 2009-04-28 07:33:54 +0000
 1.2.30.1 22-Sep-2015  skrll Sync with HEAD
 1.2.12.1 03-Dec-2017  jdolecek update from HEAD
 1.3 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.2 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.1 28-Jun-1997  leo branches: 1.1.162; 1.1.170; 1.1.176;
Add 'libsa/atari_stand.h' that defines atari specific things. This allows
for a removal of our own copy of stand.h which was out-of-date by definition.
 1.1.176.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.170.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.162.2 11-Mar-2010  yamt sync with head
 1.1.162.1 04-May-2009  yamt sync with head.
 1.1 08-Sep-2001  thomas branches: 1.1.2; 1.1.4; 1.1.8;
ELF adaption.
 1.1.8.2 08-Sep-2001  thomas ELF adaption.
 1.1.8.1 08-Sep-2001  thomas file consio.S was added on branch nathanw_sa on 2001-09-08 11:21:03 +0000
 1.1.4.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.4.1 08-Sep-2001  fvdl file consio.S was added on branch thorpej-devvp on 2001-10-01 12:38:17 +0000
 1.1.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.2.1 08-Sep-2001  thorpej file consio.S was added on branch kqueue on 2001-09-13 01:13:22 +0000
 1.2 08-Sep-2001  thomas ELF adaption.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo branches: 1.1.1.1.42; 1.1.1.1.44;
NetBSD/Atari bootcode by Waldi Ravens.
 1.1.1.1.44.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.1.1.42.1 01-Oct-2001  fvdl Catch up with -current.
 1.5 12-Aug-2015  tsutsui No need to have errno in a MD file. It's in MI src/sys/lib/libsa/errno.c.
 1.4 11-Dec-2005  christos branches: 1.4.122; 1.4.142;
merge ktrace-lwp.
 1.3 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo branches: 1.1.1.1.64;
NetBSD/Atari bootcode by Waldi Ravens.
 1.1.1.1.64.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.1.1.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.1.1.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.1.1.64.1 03-Aug-2004  skrll Sync with HEAD
 1.4.142.1 22-Sep-2015  skrll Sync with HEAD
 1.4.122.1 03-Dec-2017  jdolecek update from HEAD
 1.9 17-May-2021  mrg include libkern.h to get moved dkcksum() definition.
 1.8 17-Mar-2009  he branches: 1.8.80; 1.8.82;
Make a couple of functions conform to the prototype, restoring buildability.
 1.7 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.6 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.5 04-Aug-2006  mhitch branches: 1.5.62; 1.5.70; 1.5.76;
gcc4 fix: static devsw didn't match the prototype.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.8;
merge ktrace-lwp.
 1.3 28-Jun-2005  junyoung branches: 1.3.2;
#include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.2 28-Jun-1997  leo branches: 1.2.56;
Add 'libsa/atari_stand.h' that defines atari specific things. This allows
for a removal of our own copy of stand.h which was out-of-date by definition.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.56.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.1 30-Dec-2006  yamt sync with head.
 1.4.8.1 11-Aug-2006  yamt sync with head
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.62.1 04-May-2009  yamt sync with head.
 1.8.82.1 31-May-2021  cjep sync with head
 1.8.80.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.2 28-Jun-1997  leo Add 'libsa/atari_stand.h' that defines atari specific things. This allows
for a removal of our own copy of stand.h which was out-of-date by definition.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.3 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.2 13-Feb-1999  lukem branches: 1.2.22; 1.2.26;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 22-Jun-1996  leo branches: 1.1.2;
Install loadkmap in the default distribution. The keymap files are moved
to ..../stand/keymaps and have their own Makefiles there.
 1.1.2.2 22-Jun-1996  leo Install loadkmap in the default distribution. The keymap files are moved
to ..../stand/keymaps and have their own Makefiles there.
 1.1.2.1 22-Jun-1996  leo file Makefile was added on branch netbsd-1-2 on 1996-06-22 20:21:56 +0000
 1.2.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2 22-Jun-1996  leo Install loadkmap in the default distribution. The keymap files are moved
to ..../stand/keymaps and have their own Makefiles there.
 1.1 15-May-1996  leo branches: 1.1.4;
French keyboard map (Cedric Moreau).
 1.1.4.1 24-Jun-1996  jtc Pull up Leo's changes to atari keymap handling.
 1.3 22-Jun-1996  leo Install loadkmap in the default distribution. The keymap files are moved
to ..../stand/keymaps and have their own Makefiles there.
 1.2 23-Sep-1995  leo branches: 1.2.6;
Correct mapping for new (iso-8859-1) fontsets (Thomas Gerner).
 1.1 19-Jul-1995  leo The mappings for the german keyboard layout.
 1.2.6.1 24-Jun-1996  jtc Pull up Leo's changes to atari keymap handling.
 1.12 29-Jun-2019  tsutsui Misc KNF and cleanup.
 1.11 12-Aug-2015  tsutsui branches: 1.11.18;
Make local functions static.
 1.10 20-May-2011  christos branches: 1.10.14; 1.10.32;
add missing include
 1.9 19-May-2011  christos include missing includes
 1.8 18-Mar-2009  cegger branches: 1.8.4; 1.8.6;
Ansify function definitions w/o arguments. Generated with sed.
 1.7 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.6 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.5 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.4 04-Aug-2006  mhitch branches: 1.4.62; 1.4.70; 1.4.76;
gcc4 fix: needs stdlib.h
 1.3 12-Apr-2002  leo branches: 1.3.26; 1.3.40; 1.3.44;
Make the exitcode != 0 when the ioctl fails.
 1.2 24-Jul-1995  leo branches: 1.2.46; 1.2.50;
Added -f option to reload system-wide keymap (instead of current screen one).
 1.1 03-Jul-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 03-Jul-1995  leo NetBSD/Atari keyboard mappings
 1.2.50.1 17-Apr-2002  nathanw Catch up to -current.
 1.2.46.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.44.1 11-Aug-2006  yamt sync with head
 1.3.40.1 09-Sep-2006  rpaulo sync with head
 1.3.26.1 30-Dec-2006  yamt sync with head.
 1.4.76.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.70.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.62.1 04-May-2009  yamt sync with head.
 1.8.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.4.1 31-May-2011  rmind sync with head
 1.10.32.1 22-Sep-2015  skrll Sync with HEAD
 1.10.14.1 03-Dec-2017  jdolecek update from HEAD
 1.11.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 22-Jun-1996  leo Install loadkmap in the default distribution. The keymap files are moved
to ..../stand/keymaps and have their own Makefiles there.
 1.1 03-Jul-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 03-Jul-1995  leo branches: 1.1.1.1.6;
NetBSD/Atari keyboard mappings
 1.1.1.1.6.1 24-Jun-1996  jtc Pull up Leo's changes to atari keymap handling.
 1.3 22-Jun-1996  leo Install loadkmap in the default distribution. The keymap files are moved
to ..../stand/keymaps and have their own Makefiles there.
 1.2 24-Jul-1995  leo branches: 1.2.6;
Use the right includes
 1.1 03-Jul-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 03-Jul-1995  leo NetBSD/Atari keyboard mappings
 1.2.6.1 24-Jun-1996  jtc Pull up Leo's changes to atari keymap handling.
 1.4 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.3 13-Feb-1999  lukem branches: 1.3.22; 1.3.26;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 06-Nov-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Nov-1996  leo mouse configuration, by Thomas Gerner.
 1.3.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.3.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2 06-Nov-1996  leo These shouldn't have been imported...
 1.1 06-Nov-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Nov-1996  leo mouse configuration, by Thomas Gerner.
 1.2 22-Jun-1997  mrg move man pages into share/man.
 1.1 06-Nov-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Nov-1996  leo mouse configuration, by Thomas Gerner.
 1.6 21-Oct-2009  snj Drop 3rd and 4th clauses. Approved by thomas@ (copyright holder).
 1.5 11-Dec-2005  christos branches: 1.5.78;
merge ktrace-lwp.
 1.4 28-Oct-2003  he Include <stdlib.h> to pick up exit() prototype.
 1.3 11-Jan-1999  kleink branches: 1.3.42;
Pull in <errno.h> instead of <sys/errno.h> for declaration of errno.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 06-Nov-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Nov-1996  leo mouse configuration, by Thomas Gerner.
 1.3.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.42.1 03-Aug-2004  skrll Sync with HEAD
 1.5.78.1 11-Mar-2010  yamt sync with head
 1.3 27-Feb-2002  leo Also visit the file2swp subdir.
 1.2 30-Aug-2000  jhawk branches: 1.2.4; 1.2.8;
Use
${MAKE}
instead of
make
 1.1 07-Jan-1996  leo branches: 1.1.30;
Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.1.30.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.8.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.3 25-Oct-2008  apb Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.2 11-Oct-2001  leo branches: 1.2.4; 1.2.122; 1.2.126; 1.2.132;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.1 07-Jan-1996  leo branches: 1.1.44;
Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.1.44.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.132.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.2.126.1 04-May-2009  yamt sync with head.
 1.2.122.1 17-Jan-2009  mjf Sync with HEAD.
 1.2.4.2 11-Oct-2001  leo Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.2.4.1 11-Oct-2001  leo file Makefile.inc was added on branch nathanw_sa on 2001-10-11 07:07:42 +0000
 1.4 19-Oct-2008  apb Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.3 24-Feb-2002  leo branches: 1.3.118; 1.3.122; 1.3.128;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.2 16-Jan-1996  leo branches: 1.2.44; 1.2.48;
Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Atari partion table checker. Checks the validity of AHDI and/or NetBSD/Atari
partition tables. (Waldi Ravens)
 1.2.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.2.44.1 16-Mar-2002  jdolecek Catch up with -current.
 1.3.128.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.3.122.1 04-May-2009  yamt sync with head.
 1.3.118.1 17-Jan-2009  mjf Sync with HEAD.
 1.5 01-Oct-2011  chs fix build errors with gcc 4.5.
 1.4 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.3 26-Jul-2001  wiz branches: 1.3.6; 1.3.128;
auxilary -> auxiliary
 1.2 09-Feb-1996  leo branches: 1.2.44;
Catchup with the future.
 1.1 16-Jan-1996  leo Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.2.44.1 03-Aug-2001  lukem update to -current
 1.3.128.1 11-Mar-2010  yamt sync with head
 1.3.6.2 26-Jul-2001  wiz auxilary -> auxiliary
 1.3.6.1 26-Jul-2001  wiz file ahdilbl.h was added on branch nathanw_sa on 2001-07-26 23:07:58 +0000
 1.3 24-Feb-2002  leo Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.2 26-Jul-2001  wiz branches: 1.2.6;
auxilary -> auxiliary
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.44;
Atari partion table checker. Checks the validity of AHDI and/or NetBSD/Atari
partition tables. (Waldi Ravens)
 1.1.1.1.44.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.1.1.44.1 03-Aug-2001  lukem update to -current
 1.2.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.6.1 26-Jul-2001  nathanw file aptck.h was added on branch nathanw_sa on 2002-02-28 04:08:30 +0000
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Atari partion table checker. Checks the validity of AHDI and/or NetBSD/Atari
partition tables. (Waldi Ravens)
 1.2 24-Feb-2002  leo Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.44; 1.1.1.1.48;
Atari partion table checker. Checks the validity of AHDI and/or NetBSD/Atari
partition tables. (Waldi Ravens)
 1.1.1.1.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.1.1.44.1 16-Mar-2002  jdolecek Catch up with -current.
 1.6 26-Mar-2014  christos kill sprintf
 1.5 18-Mar-2009  cegger branches: 1.5.12; 1.5.22; 1.5.26;
Ansify function definitions w/o arguments. Generated with sed.
 1.4 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.3 09-Feb-1996  leo branches: 1.3.170; 1.3.178; 1.3.184;
Catchup with the future.
 1.2 16-Jan-1996  leo Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Atari partion table checker. Checks the validity of AHDI and/or NetBSD/Atari
partition tables. (Waldi Ravens)
 1.3.184.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.178.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.170.1 04-May-2009  yamt sync with head.
 1.5.26.1 18-May-2014  rmind sync with head
 1.5.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.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.2 16-Jan-1996  leo Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Atari partion table checker. Checks the validity of AHDI and/or NetBSD/Atari
partition tables. (Waldi Ravens)
 1.2 16-Jan-1996  leo Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Atari partion table checker. Checks the validity of AHDI and/or NetBSD/Atari
partition tables. (Waldi Ravens)
 1.6 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.5 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.4 26-Jul-2001  wiz branches: 1.4.6; 1.4.128; 1.4.136; 1.4.142;
auxilary -> auxiliary
 1.3 09-Feb-1996  leo branches: 1.3.44;
Catchup with the future.
 1.2 20-Jan-1996  leo BBSIZE -> BBMINSIZE
 1.1 16-Jan-1996  leo Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.3.44.1 03-Aug-2001  lukem update to -current
 1.4.142.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.136.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.128.1 04-May-2009  yamt sync with head.
 1.4.6.2 26-Jul-2001  wiz auxilary -> auxiliary
 1.4.6.1 26-Jul-2001  wiz file disklbl.c was added on branch nathanw_sa on 2001-07-26 23:07:58 +0000
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 16-Jan-1996  leo branches: 1.1.64;
Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.1.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.64.1 03-Aug-2004  skrll Sync with HEAD
 1.1 16-Jan-1996  leo Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.2 16-Jan-1996  leo Move things around a bit to make all names fit into the [8.3] namespace
of msdosfs.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Atari partion table checker. Checks the validity of AHDI and/or NetBSD/Atari
partition tables. (Waldi Ravens)
 1.1 07-Jan-1996  leo Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.9 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.8 31-Mar-2009  tsutsui Remove extra whitespace added by a dumb tool.
 1.7 18-Mar-2009  cegger bcopy -> memcpy
 1.6 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.5 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.4 01-Nov-1997  lukem branches: 1.4.154; 1.4.162; 1.4.168;
getopt returns -1 not EOF
 1.3 09-Jan-1996  leo Fix the same typo in all files. Yanking is soooo beautiful....
 1.2 07-Jan-1996  leo Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.4.168.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.162.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.154.2 11-Mar-2010  yamt sync with head
 1.4.154.1 04-May-2009  yamt sync with head.
 1.1 27-Feb-2002  leo branches: 1.1.1;
Initial revision
 1.1.1.1 27-Feb-2002  leo branches: 1.1.1.1.2; 1.1.1.1.14;
copy a file to a 'SWP' partition
 1.1.1.1.14.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.1.1.14.1 27-Feb-2002  jdolecek file Makefile was added on branch kqueue on 2002-06-23 17:35:21 +0000
 1.1.1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.1.1.2.1 27-Feb-2002  nathanw file Makefile was added on branch nathanw_sa on 2002-02-28 04:08:31 +0000
 1.9 12-Mar-2016  dholland Remove unused variable, found by gcc.
 1.8 12-Mar-2016  dholland Fix syntax error in previous. Hi christos :-)
(PR 50944)
 1.7 11-Mar-2016  christos PR/50944: David Binderman: sprinkle parens
 1.6 18-Mar-2009  cegger branches: 1.6.22; 1.6.40;
Ansify function definitions w/o arguments. Generated with sed.
 1.5 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.4 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.3 28-Apr-2008  martin branches: 1.3.8; 1.3.14;
Remove clause 3 and 4 from TNF licenses
 1.2 22-Mar-2002  leo branches: 1.2.6; 1.2.114; 1.2.116; 1.2.118;
Also find swap partitions in a (possibly embedded in AHDI) NetBSD label on
the disk.
 1.1 27-Feb-2002  leo branches: 1.1.1;
Initial revision
 1.1.1.1 27-Feb-2002  leo branches: 1.1.1.1.2;
copy a file to a 'SWP' partition
 1.1.1.1.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.1.1.2.1 27-Feb-2002  nathanw file file2swp.c was added on branch nathanw_sa on 2002-02-28 04:08:31 +0000
 1.2.118.2 04-May-2009  yamt sync with head.
 1.2.118.1 16-May-2008  yamt sync with head.
 1.2.116.1 18-May-2008  yamt sync with head.
 1.2.114.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 22-Mar-2002  jdolecek file file2swp.c was added on branch kqueue on 2002-06-23 17:35:21 +0000
 1.3.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.6.40.1 19-Mar-2016  skrll Sync with HEAD
 1.6.22.1 03-Dec-2017  jdolecek update from HEAD
 1.7 25-Sep-2024  rin atari/stand: Rework sysinfo.c v.s. GCC12 -Warray-bounds

sysinfo.c is also used for bootxxx. Convert `-Wno-error=...` into
`#pragma gcc diagnostic ...` to the source file, although this
does not narrow down scope of hack.

Fix atari build this time for sure ;)
 1.6 24-Sep-2024  rin atari: libtos: Silence GCC12 -Warray-bounds for sysinfo.c

ADDR_* defined in tosdefs.h are in the 0-th page, even if 4KB page,
i.e., [0, 0x1000). This causes -Warray-bounds for GCC12 and later.

Fix atari build with GCC12.
 1.5 22-Mar-2002  leo branches: 1.5.238;
Add code for reading NetBSD disklabels.
 1.4 24-Feb-2002  leo Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.3 11-Oct-2001  leo branches: 1.3.4;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.2 10-Oct-2001  leo Check-point my work on the bootcode.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.44;
Common library for all tostools. (Waldi Ravens and myself)
 1.1.1.1.44.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.1.1.44.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.1.1.44.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 11-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-02-28 04:08:31 +0000
 1.5.238.1 02-Aug-2025  perseant Sync with HEAD
 1.1 24-Feb-2002  leo branches: 1.1.2; 1.1.8;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file ahdi.c was added on branch kqueue on 2002-03-16 15:56:56 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file ahdi.c was added on branch nathanw_sa on 2002-02-28 04:08:31 +0000
 1.2 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.1 24-Feb-2002  leo branches: 1.1.2; 1.1.8; 1.1.126;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1.126.1 11-Mar-2010  yamt sync with head
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file ahdi.h was added on branch kqueue on 2002-03-16 15:56:56 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file ahdi.h was added on branch nathanw_sa on 2002-02-28 04:08:32 +0000
 1.4 01-Oct-2011  chs fix build errors with gcc 4.5.
 1.3 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.2 22-Mar-2002  leo branches: 1.2.116;
Add code for reading NetBSD disklabels.
 1.1 24-Feb-2002  leo branches: 1.1.2; 1.1.8;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1.8.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file ahdilbl.h was added on branch kqueue on 2002-03-16 15:56:57 +0000
 1.1.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file ahdilbl.h was added on branch nathanw_sa on 2002-02-28 04:08:32 +0000
 1.2.116.1 11-Mar-2010  yamt sync with head
 1.12 18-Mar-2009  cegger bzero -> memset
 1.11 06-Jan-2009  tsutsui branches: 1.11.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.10 28-Apr-2008  martin branches: 1.10.8; 1.10.10;
Remove clause 3 and 4 from TNF licenses
 1.9 11-Dec-2005  christos branches: 1.9.24; 1.9.74; 1.9.76; 1.9.78;
merge ktrace-lwp.
 1.8 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.7 28-Jun-2005  junyoung ANSI & KNF.
 1.6 10-Dec-2002  thorpej branches: 1.6.6;
Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.5 24-Feb-2002  leo Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.4 14-Oct-2001  leo branches: 1.4.4; 1.4.6;
TOS/MiNT needs unistd.h.
 1.3 13-Oct-2001  leo Arrange include files section in such a way that we can use this code in
the MiNT and NetBSD/libsa environment.
 1.2 11-Oct-2001  leo Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.1 10-Oct-2001  leo Check-point my work on the bootcode.
 1.4.6.3 16-Mar-2002  jdolecek Catch up with -current.
 1.4.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.6.1 14-Oct-2001  thorpej file aout.c was added on branch kqueue on 2002-01-10 19:40:22 +0000
 1.4.4.3 11-Dec-2002  thorpej Sync with HEAD.
 1.4.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.1 14-Oct-2001  nathanw file aout.c was added on branch nathanw_sa on 2002-02-28 04:08:32 +0000
 1.6.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.78.2 04-May-2009  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.2 17-Jan-2009  mjf Sync with HEAD.
 1.9.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.10.10.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.10.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.10.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.11.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1 24-Feb-2002  leo branches: 1.1.2; 1.1.8;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file biosrw.s was added on branch kqueue on 2002-03-16 15:56:57 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file biosrw.s was added on branch nathanw_sa on 2002-02-28 04:08:32 +0000
 1.4 31-Mar-2009  tsutsui Remove extra whitespace added by a dumb tool.
 1.3 18-Mar-2009  cegger bcopy -> memcpy
 1.2 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.1 22-Mar-2002  leo branches: 1.1.2; 1.1.8; 1.1.120; 1.1.128; 1.1.134;
Add code for reading NetBSD disklabels.
 1.1.134.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.128.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.120.1 04-May-2009  yamt sync with head.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 22-Mar-2002  jdolecek file bsdlabel.c was added on branch kqueue on 2002-06-23 17:35:22 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 22-Mar-2002  nathanw file bsdlabel.c was added on branch nathanw_sa on 2002-04-01 07:39:35 +0000
 1.3 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.2 11-Dec-2005  christos branches: 1.2.78;
merge ktrace-lwp.
 1.1 28-Oct-2003  he branches: 1.1.4;
Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 28-Oct-2003  skrll file bsdstart.S was added on branch ktrace-lwp on 2004-08-03 10:33:26 +0000
 1.2.78.1 11-Mar-2010  yamt sync with head
 1.8 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.7 10-Oct-2001  leo branches: 1.7.4; 1.7.20;
Check-point my work on the bootcode.
 1.6 08-Sep-2001  thomas ELF adaption.
 1.5 04-Dec-1997  leo branches: 1.5.26; 1.5.28;
Preserve the bootflags in the processor-type test (== make the loader
work again for the TT030).
 1.4 27-May-1997  leo branches: 1.4.8;
Make the bootloader 68060 aware.
 1.3 26-Dec-1996  leo Make sure that the caches are pushed and turned off before jumping into
the kernel image. This makes booting a 040 kernel finally reliable.
 1.2 23-Jan-1996  leo STANDALONE -> TOSTOOLS
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Common library for all tostools. (Waldi Ravens and myself)
 1.4.8.1 15-Dec-1997  mellon Pull rev 1.5 up from trunk (leo)
 1.5.28.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.28.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.5.26.1 01-Oct-2001  fvdl Catch up with -current.
 1.7.20.1 03-Aug-2004  skrll Sync with HEAD
 1.7.4.2 10-Oct-2001  leo Check-point my work on the bootcode.
 1.7.4.1 10-Oct-2001  leo file bsdstart.s was added on branch nathanw_sa on 2001-10-10 14:19:51 +0000
 1.10 31-Mar-2009  tsutsui Remove extra whitespace added by a dumb tool.
 1.9 18-Mar-2009  cegger bcopy -> memcpy
 1.8 18-Mar-2009  cegger bzero -> memset
 1.7 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.6 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.5 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.4 11-Dec-2005  christos branches: 1.4.78; 1.4.86; 1.4.92;
merge ktrace-lwp.
 1.3 24-Mar-2004  drochner remove license clauses 3 and 4 from my cpoyright notices
 1.2 24-Feb-2002  leo branches: 1.2.16;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1 11-Oct-2001  leo branches: 1.1.4; 1.1.6;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.1.6.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 11-Oct-2001  thorpej file cread.c was added on branch kqueue on 2002-01-10 19:40:24 +0000
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 11-Oct-2001  nathanw file cread.c was added on branch nathanw_sa on 2002-02-28 04:08:32 +0000
 1.2.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.16.1 03-Aug-2004  skrll Sync with HEAD
 1.4.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 24-Feb-2002  leo branches: 1.2.118; 1.2.120; 1.2.122;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1 11-Oct-2001  leo branches: 1.1.4; 1.1.6;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.1.6.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 11-Oct-2001  thorpej file cread.h was added on branch kqueue on 2002-01-10 19:40:24 +0000
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 11-Oct-2001  nathanw file cread.h was added on branch nathanw_sa on 2002-02-28 04:08:33 +0000
 1.2.122.1 16-May-2008  yamt sync with head.
 1.2.120.1 18-May-2008  yamt sync with head.
 1.2.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.4 26-Mar-2014  christos kill sprintf
 1.3 18-Mar-2009  cegger branches: 1.3.12; 1.3.22; 1.3.26;
Ansify function definitions w/o arguments. Generated with sed.
 1.2 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.1 24-Feb-2002  leo branches: 1.1.2; 1.1.8; 1.1.126; 1.1.134; 1.1.140;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1.140.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.134.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.126.1 04-May-2009  yamt sync with head.
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file diskio.c was added on branch kqueue on 2002-03-16 15:56:58 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file diskio.c was added on branch nathanw_sa on 2002-02-28 04:08:33 +0000
 1.3.26.1 18-May-2014  rmind sync with head
 1.3.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.1 24-Feb-2002  leo branches: 1.1.2; 1.1.8;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1.8.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.8.1 24-Feb-2002  jdolecek file diskio.h was added on branch kqueue on 2002-03-16 15:56:58 +0000
 1.1.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1 24-Feb-2002  nathanw file diskio.h was added on branch nathanw_sa on 2002-02-28 04:08:33 +0000
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 22-Mar-2002  leo branches: 1.1.2; 1.1.8; 1.1.14;
Add code for reading NetBSD disklabels.
 1.1.14.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.14.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.14.1 03-Aug-2004  skrll Sync with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 22-Mar-2002  jdolecek file disklbl.h was added on branch kqueue on 2002-06-23 17:35:22 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 22-Mar-2002  nathanw file disklbl.h was added on branch nathanw_sa on 2002-04-01 07:39:36 +0000
 1.14 01-Oct-2011  chs fix build errors with gcc 4.5.
 1.13 31-Mar-2009  tsutsui Remove extra whitespace added by a dumb tool.
 1.12 18-Mar-2009  cegger bcopy -> memcpy
 1.11 18-Mar-2009  cegger bzero -> memset
 1.10 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.9 06-Jan-2009  tsutsui branches: 1.9.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.8 28-Apr-2008  martin branches: 1.8.8; 1.8.10;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.24; 1.7.74; 1.7.76; 1.7.78;
merge ktrace-lwp.
 1.6 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.5 24-Feb-2002  leo branches: 1.5.16;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.4 14-Oct-2001  leo branches: 1.4.4; 1.4.6;
TOS/MiNT needs unistd.h.
 1.3 13-Oct-2001  leo Arrange include files section in such a way that we can use this code in
the MiNT and NetBSD/libsa environment.
 1.2 11-Oct-2001  leo Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.1 10-Oct-2001  leo Check-point my work on the bootcode.
 1.4.6.3 16-Mar-2002  jdolecek Catch up with -current.
 1.4.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.6.1 14-Oct-2001  thorpej file elf.c was added on branch kqueue on 2002-01-10 19:40:25 +0000
 1.4.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.1 14-Oct-2001  nathanw file elf.c was added on branch nathanw_sa on 2002-02-28 04:08:33 +0000
 1.5.16.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.78.2 04-May-2009  yamt sync with head.
 1.7.78.1 16-May-2008  yamt sync with head.
 1.7.76.1 18-May-2008  yamt sync with head.
 1.7.74.2 17-Jan-2009  mjf Sync with HEAD.
 1.7.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.8.10.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.8.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.8.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2 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.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.170; 1.1.1.1.178; 1.1.1.1.184;
Common library for all tostools. (Waldi Ravens and myself)
 1.1.1.1.184.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.1.1.178.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.1.1.170.1 04-May-2009  yamt sync with head.
 1.3 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.2 24-Feb-2002  leo branches: 1.2.122; 1.2.130; 1.2.136;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.44; 1.1.1.1.48;
Common library for all tostools. (Waldi Ravens and myself)
 1.1.1.1.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.1.1.44.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.136.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.130.1 28-Apr-2009  skrll Sync with HEAD.
 1.2.122.1 04-May-2009  yamt sync with head.
 1.8 10-Oct-2020  thorpej Rename:
- EM_ALPHA (41) -> EM_OLD_ALPHA
- EM_ALPHA_EXP (36902) -> EM_ALPHA

36902 has been the value in common usage for a long time, and this naming
aligns with binutils, etc.

PR port-alpha/51926
 1.7 03-Jan-2014  dsl Remove the _KERNEL part of these two clones of sys/exec_elf.h
Remove the incorrect (and completely unused everywhere) Elf64_Shalf.
Put a better include guard on arch/epoc32/stand/e32boot/include/elf.h
Should be ok because I can't find any references to KERNEL in these
source trees.
 1.6 28-Aug-2010  joerg branches: 1.6.8; 1.6.18; 1.6.22;
Replace the current usage of Elf64_Half with Elf64_Word and rename
NetBSD specific Elf64_Quarter to Elf64_Half. This restores compatibility
with the common ELF specifications.
 1.5 28-Apr-2008  martin branches: 1.5.20; 1.5.22;
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 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.2 11-Oct-2001  leo branches: 1.2.4; 1.2.6; 1.2.22;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.1 10-Oct-2001  leo Check-point my work on the bootcode.
 1.2.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.22.1 03-Aug-2004  skrll Sync with HEAD
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 11-Oct-2001  thorpej file exec_elf.h was added on branch kqueue on 2002-01-10 19:40:27 +0000
 1.2.4.2 11-Oct-2001  leo Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.2.4.1 11-Oct-2001  leo file exec_elf.h was added on branch nathanw_sa on 2001-10-11 07:07:43 +0000
 1.4.78.2 09-Oct-2010  yamt 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.5.22.1 05-Mar-2011  rmind sync with head
 1.5.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.6.22.1 18-May-2014  rmind sync with head
 1.6.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2 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.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.170; 1.1.1.1.178; 1.1.1.1.184;
Common library for all tostools. (Waldi Ravens and myself)
 1.1.1.1.184.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.1.1.178.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.1.1.170.1 04-May-2009  yamt sync with head.
 1.8 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.7 11-Oct-2001  leo branches: 1.7.4; 1.7.126;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.6 10-Oct-2001  leo Check-point my work on the bootcode.
 1.5 07-Jan-2001  leo branches: 1.5.4;
Sync machine types with atari/include/cpu.h
 1.4 19-Feb-1999  leo branches: 1.4.8;
STANDALONE -> _STANDALONE per recent discussion.
 1.3 27-May-1997  leo Make the bootloader 68060 aware.
 1.2 19-Jan-1996  leo Use symbolic constants for ATARI_ANYCPU instead of dropping in a hex-value.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Common library for all tostools. (Waldi Ravens and myself)
 1.4.8.1 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.126.1 11-Mar-2010  yamt sync with head
 1.7.4.2 11-Oct-2001  leo Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.7.4.1 11-Oct-2001  leo file kparamb.h was added on branch nathanw_sa on 2001-10-11 07:07:43 +0000
 1.7 07-Nov-2018  maya Don't provide these definitions on netbsd as before, but without relying
on int8_t being a macro.
 1.6 17-Jul-2011  joerg branches: 1.6.52; 1.6.54;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.5 06-Jan-2009  tsutsui Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.4 24-Feb-2002  leo branches: 1.4.68; 1.4.118; 1.4.122; 1.4.130; 1.4.132;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.3 11-Oct-2001  leo branches: 1.3.4;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.2 10-Oct-2001  leo Check-point my work on the bootcode.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.44;
Common library for all tostools. (Waldi Ravens and myself)
 1.1.1.1.44.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.1.1.44.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 11-Oct-2001  nathanw file libtos.h was added on branch nathanw_sa on 2002-02-28 04:08:34 +0000
 1.4.132.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.4.130.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.122.1 04-May-2009  yamt sync with head.
 1.4.118.1 17-Jan-2009  mjf Sync with HEAD.
 1.4.68.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.6.54.1 10-Jun-2019  christos Sync with HEAD
 1.6.52.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.10 25-Sep-2024  rin atari/stand: Rework sysinfo.c v.s. GCC12 -Warray-bounds

sysinfo.c is also used for bootxxx. Convert `-Wno-error=...` into
`#pragma gcc diagnostic ...` to the source file, although this
does not narrow down scope of hack.

Fix atari build this time for sure ;)
 1.9 14-Mar-2009  dsl branches: 1.9.100;
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.8 06-Jan-2009  tsutsui branches: 1.8.2;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.7 28-Apr-2008  martin branches: 1.7.8; 1.7.10;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.24; 1.6.74; 1.6.76; 1.6.78;
merge ktrace-lwp.
 1.5 28-Jun-2005  junyoung #include <lib/libsa/stand.h> rather than <stand.h> or "stand.h"
 1.4 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.3 24-Feb-2002  leo branches: 1.3.16;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.2 13-Oct-2001  leo branches: 1.2.4; 1.2.6;
Arrange include files section in such a way that we can use this code in
the MiNT and NetBSD/libsa environment.
 1.1 10-Oct-2001  leo Check-point my work on the bootcode.
 1.2.6.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 13-Oct-2001  thorpej file sysinfo.c was added on branch kqueue on 2002-01-10 19:40:29 +0000
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 13-Oct-2001  nathanw file sysinfo.c was added on branch nathanw_sa on 2002-02-28 04:08:34 +0000
 1.3.16.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.16.1 03-Aug-2004  skrll Sync with HEAD
 1.6.78.2 04-May-2009  yamt 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.2 17-Jan-2009  mjf Sync with HEAD.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.7.10.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.7.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.7.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.100.1 02-Aug-2025  perseant Sync with HEAD
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 24-Feb-2002  leo branches: 1.3.118; 1.3.120; 1.3.122;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.2 11-Oct-2001  leo branches: 1.2.4; 1.2.6;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.1 10-Oct-2001  leo Check-point my work on the bootcode.
 1.2.6.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 11-Oct-2001  thorpej file tosdefs.h was added on branch kqueue on 2002-01-10 19:40:30 +0000
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 11-Oct-2001  nathanw file tosdefs.h was added on branch nathanw_sa on 2002-02-28 04:08:34 +0000
 1.3.122.1 16-May-2008  yamt sync with head.
 1.3.120.1 18-May-2008  yamt sync with head.
 1.3.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.3 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.2 24-Feb-2002  leo branches: 1.2.122; 1.2.130; 1.2.136;
Move some disk I/O and disklabel functions into the library. The code
mostly originated from aptck. Need an extra pass over aptck to cut out all
functionality now moved to the library...
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.44; 1.1.1.1.48;
Common library for all tostools. (Waldi Ravens and myself)
 1.1.1.1.48.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.1.1.44.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.136.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.130.1 28-Apr-2009  skrll Sync with HEAD.
 1.2.122.1 04-May-2009  yamt sync with head.
 1.3 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.2 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.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo branches: 1.1.1.1.170; 1.1.1.1.178; 1.1.1.1.184;
Common library for all tostools. (Waldi Ravens and myself)
 1.1.1.1.184.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.1.1.178.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.1.1.170.1 04-May-2009  yamt sync with head.
 1.4 14-Oct-2001  leo branches: 1.4.4;
cread.o now comes from libtos.a
 1.3 10-Oct-2001  leo Check-point my work on the bootcode.
 1.2 23-Jun-1999  leo branches: 1.2.16;
Allow the loading of compressed kernels. This makes it again possible
to make a 'system disk' on a 720KB floppy that is usable.
 1.1 07-Jan-1996  leo branches: 1.1.26;
Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.1.26.1 01-Jul-1999  thorpej Sync w/ -current.
 1.2.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.4.2 14-Oct-2001  leo cread.o now comes from libtos.a
 1.4.4.1 14-Oct-2001  leo file Makefile was added on branch nathanw_sa on 2001-10-14 19:47:59 +0000
 1.2 11-Oct-2001  leo Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.1 23-Jun-1999  leo branches: 1.1.2; 1.1.18;
Allow the loading of compressed kernels. This makes it again possible
to make a 'system disk' on a 720KB floppy that is usable.
 1.1.18.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 23-Jun-1999  thorpej file cread.c was added on branch chs-ubc2 on 1999-07-01 23:03:49 +0000
 1.22 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.21 20-Oct-2009  snj branches: 1.21.22;
Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.20 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.19 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.18 11-Oct-2001  leo branches: 1.18.4; 1.18.126; 1.18.134; 1.18.140;
Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.17 10-Oct-2001  leo Check-point my work on the bootcode.
 1.16 27-Sep-2001  leo Add ELF stuff to loader. This is a combined effort from Thomas Gerner and
myself.
 1.15 23-Jun-1999  leo branches: 1.15.14; 1.15.16;
Allow the loading of compressed kernels. This makes it again possible
to make a 'system disk' on a 720KB floppy that is usable.
 1.14 27-May-1999  leo Add support for the memory on the CT2 board. Info from Thomas Goirand.
 1.13 01-Nov-1997  lukem branches: 1.13.10;
getopt returns -1 not EOF
 1.12 27-May-1997  leo Make the bootloader 68060 aware.
 1.11 09-Jan-1996  leo Fix the same typo in all files. Yanking is soooo beautiful....
 1.10 07-Jan-1996  leo Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.9 23-Sep-1995  leo Add support for the FX-card - Falcon mem. extension - (Nat!)
 1.8 29-Aug-1995  leo Remove FPU detection and report on stdout instead of stderr.
 1.7 28-May-1995  leo Check for a different year-base in the RTC.
 1.6 05-May-1995  leo Fix error in handling FPU types.
 1.5 02-May-1995  leo Added -T option.
 1.4 16-Apr-1995  leo Get TT-RAM sizes right, some more debug output added with -D option.
 1.3 08-Apr-1995  leo Added '\r' chars in printf, so output under TOS becomes readable. Also
added some extra options for debugging.
 1.2 28-Mar-1995  leo Capitalisation of NetBSD fixed.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.13.10.2 01-Jul-1999  thorpej Sync w/ -current.
 1.13.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.15.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.14.1 01-Oct-2001  fvdl Catch up with -current.
 1.18.140.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.134.1 28-Apr-2009  skrll Sync with HEAD.
 1.18.126.2 11-Mar-2010  yamt sync with head
 1.18.126.1 04-May-2009  yamt sync with head.
 1.18.4.2 11-Oct-2001  leo Second pass of the bootloader reworking. Everything works from the
TOS/MiNT side now.
 1.18.4.1 11-Oct-2001  leo file loadbsd.c was added on branch nathanw_sa on 2001-10-11 07:07:44 +0000
 1.21.22.1 03-Dec-2017  jdolecek update from HEAD
 1.8 10-Oct-2001  leo Check-point my work on the bootcode.
 1.7 27-May-1999  leo branches: 1.7.16;
Add support for the memory on the CT2 board. Info from Thomas Goirand.
 1.6 07-Jan-1996  leo branches: 1.6.26;
Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.5 29-Aug-1995  leo Remove FPU detection and report on stdout instead of stderr.
 1.4 28-May-1995  leo Check for a different year-base in the RTC.
 1.3 16-Apr-1995  leo Get TT-RAM sizes right, some more debug output added with -D option.
 1.2 28-Mar-1995  leo Capitalisation of NetBSD fixed.
 1.1 26-Mar-1995  leo branches: 1.1.1;
Initial revision
 1.1.1.1 26-Mar-1995  leo NetBSD/Atari, port by Leo Weppelman.
 1.6.26.1 21-Jun-1999  thorpej Sync w/ -current.
 1.7.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1 07-Jan-1996  leo Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.11 20-Oct-2009  snj Remove 3rd and 4th clause on Leo Weppelman's license. OK leo@.
 1.10 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.9 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.8 26-Mar-1999  leo branches: 1.8.148; 1.8.156; 1.8.162;
Fix typo noticed by James Boulton.
 1.7 16-Jan-1998  leo Be more accurate with errors on read(2) (as suggested by Ted Lemon).
 1.6 15-Dec-1997  leo Correct size of brwrite():trbuf[] (Mellon).
 1.5 10-Dec-1997  leo Add '-H' option for writing High density floppies.
 1.4 01-Nov-1997  lukem getopt returns -1 not EOF
 1.3 09-Jan-1996  leo branches: 1.3.16;
Fix the same typo in all files. Yanking is soooo beautiful....
 1.2 07-Jan-1996  leo Part of the tostools reorganization. All directories now contain a Makefile
and the user interface to the various tools has been standarized.
 1.1 07-Jan-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 07-Jan-1996  leo Reorganization of the stand-directory. All tools that are TOS specific and
can (probably) only be compiled under TOS are now being grouped in the
sub-directory 'tostools'.
 1.3.16.1 15-Dec-1997  mellon Pull revs 1.3, 1.4 and 1.5 up from trunk (leo)
 1.8.162.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.156.1 28-Apr-2009  skrll Sync with HEAD.
 1.8.148.2 11-Mar-2010  yamt sync with head
 1.8.148.1 04-May-2009  yamt sync with head.
 1.3 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.2 13-Oct-2001  leo branches: 1.2.4;
Add an address for the 3rd level boot.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo branches: 1.1.1.1.44;
NetBSD/Atari bootcode by Waldi Ravens.
 1.1.1.1.44.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 13-Oct-2001  leo Add an address for the 3rd level boot.
 1.2.4.1 13-Oct-2001  leo file LOADADDR was added on branch nathanw_sa on 2001-10-13 19:55:08 +0000
 1.1 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.8 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.7 13-Aug-2002  leo For some reason, things stopped working without explicitely adding a rule
to link the bootblocks... Found and fix provided by Thomas Gerner.
 1.6 15-Apr-2002  leo branches: 1.6.2; 1.6.4;
Fix PR-16305. Make the 'end' symbol local.
 1.5 22-Sep-2001  tv branches: 1.5.4;
objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.4 05-Sep-2001  thomas branches: 1.4.2;
Make the bootblocks build with ELF assembler.
 1.3 09-May-1997  mycroft branches: 1.3.36;
Eliminate bogus redefinitions of standard targets.
 1.2 17-Apr-1997  thorpej STRIP -> STRIPFLAG
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.3.36.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.36.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.36.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.36.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.5.4.3 27-Aug-2002  nathanw Catch up to -current.
 1.5.4.2 17-Apr-2002  nathanw Catch up to -current.
 1.5.4.1 22-Sep-2001  nathanw file Makefile.inc was added on branch nathanw_sa on 2002-04-17 00:02:46 +0000
 1.6.4.1 17-Aug-2002  lukem Pull up revision 1.7 (requested by leo in ticket #672):
For some reason, things stopped working without explicitely adding a rule
to link the bootblocks... Found and fix provided by Thomas Gerner.
 1.6.2.1 30-Aug-2002  gehenna catch up with -current.
 1.6 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.5 06-Jan-2009  tsutsui branches: 1.5.14; 1.5.24; 1.5.28;
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
 1.4 11-Dec-2005  christos branches: 1.4.24; 1.4.74; 1.4.78; 1.4.86; 1.4.88;
merge ktrace-lwp.
 1.3 12-Mar-2004  jmc Toolize and use install to make mdec/std so it's in METALOG. Now a make release
works once again for atari
 1.2 28-Jun-2003  he branches: 1.2.2;
Use ${.CURDIR} when referring to source tree include directories.
 1.1 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.88.1 16-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #274):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4, 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
sys/arch/atari/stand/Makefile.inc: file removal
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.4.86.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.78.1 04-May-2009  yamt sync with head.
 1.4.74.1 17-Jan-2009  mjf Sync with HEAD.
 1.4.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1263):
sys/arch/atari/stand/xxboot/Makefile.xxboot: revision 1.5
sys/arch/atari/stand/tostools/libtos/libtos.h: revision 1.5
sys/arch/atari/stand/installboot/disklabel.c: revision 1.3
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.4
sys/arch/atari/stand/bootxxx/Makefile.bootxxx: revision 1.5
sys/arch/atari/stand/libsa/Makefile: revision 1.28
sys/arch/atari/stand/bootxx/start.S: revision 1.1
distrib/utils/sysinst/arch/atari/md.c: revision 1.23
sys/arch/atari/stand/bootxx/Makefile.bootxx: revision 1.8
sys/arch/atari/stand/tostools/libtos/aout.c: revision 1.11
sys/arch/atari/stand/installboot/installboot.h: revision 1.9
sys/arch/atari/stand/bootxxx/bootxxx.c: revision 1.4
distrib/sets/lists/base/md.atari: revision 1.50
sys/arch/atari/stand/Makefile.booters: revision 1.1
sys/arch/atari/stand/bootxx/bootxx.c: revision 1.13
sys/arch/atari/stand/installboot/installboot.c: revision 1.22
sys/arch/atari/stand/tostools/libtos/elf.c: revision 1.9
sys/arch/atari/stand/tostools/libtos/sysinfo.c: revision 1.8
sys/arch/atari/stand/bootxxx/start.S: revision 1.1
Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
because modern aggressive gcc4 may reorder functions in the same source
and the first function in a C source won't always appear at the beginning
in its object.
Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
explicitly include it from each Makefile because the stand
directory contains non standalone programs like installboot and
Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
- create machine and m68k symlinks in ${.OBJDIR} in all boot programs
- set appropriate make environments to suppress errors and warnings
- <string.h> isn't there in _STANDALONE case
- put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
to some files in stand/tostools
- use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
in all boot programs
(XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
support 64 bit block numbers
Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.
Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.
Problem on default installation with sysinst was reported by David Ross.
Remove /boot.atari, which is no longer installed during build
and removed from base.tgz.
Note we must not mark this obsolete because this tertiary bootloader
will be copied into / during installation and it shouldn't be removed
by postinstall(8).
Before installboot(8), check running machine types (milan or others)
via sysctl(3) and copy appropriate tertiary boot.atari loader
from /usr/mdec/{std,milan} into targetroot.
Full fresh installations of 5.0_BETA and 4.0_STABLE with the same change
have been tested by David Ross on port-atari.
Fixes the final portion of PR port-atari/40315, and
pullup requests to both netbsd-4 and netbsd-5 will be sent shortly.
 1.5.28.1 18-May-2014  rmind sync with head
 1.5.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.14.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.5 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.4 28-Dec-1996  leo - The Hades bios does not pass a 'bootpreference' in d5. Deal with it by
getting the 'bootpreference' ourselves when it is not set to any legal
value.
- Because the relation between memtop/membot and the video base does not
hold on the Hades, skip testing on it.
 1.3 26-Dec-1996  leo Correct the IDE port-addresses and data transfer method so this will work
both Hades & Falcon.
 1.2 20-Mar-1996  leo Belongs to the last changes made to the ??boot/??boot.s files I did
yesterday.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.7 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.6 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.5 23-Jul-2000  jdc branches: 1.5.4; 1.5.8;
Make these work with obj directories.
 1.4 13-Feb-1999  lukem branches: 1.4.8; 1.4.18;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 29-Jun-1996  leo Define LIBCRT0. This tries to defeat the attempts of bsd.prog.mk to add
${DESTDIR}/....crt0 to the link rule when $DESTDIR is set.
 1.2 14-May-1996  leo branches: 1.2.4;
Update to make this work correctly when using an obj-directory.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.4.1 30-Jun-1996  jtc Pulled up rev 1.3 by request from Leo Weppelman
 1.4.18.1 24-Jul-2000  jdc Make these work with obj directories.
Agreed with Leo Weppelman.
Approved by Jason R Thorpe.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.3 11-Dec-2005  christos branches: 1.3.112; 1.3.122; 1.3.128;
merge ktrace-lwp.
 1.2 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1 23-May-2003  leo branches: 1.1.2;
usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.128.1 18-May-2014  rmind sync with head
 1.3.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.3 26-Jun-2022  tsutsui Unifdef __ELF__.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 28-Oct-2003  he branches: 1.1.4;
Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 28-Oct-2003  skrll file sdb00t.ahdi.S was added on branch ktrace-lwp on 2004-08-03 10:33:27 +0000
 1.6 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.5 23-May-2003  leo branches: 1.5.2;
usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.4 15-Apr-2002  leo Fix PR-16305. Make the 'end' symbol local.
 1.3 05-Sep-2001  thomas branches: 1.3.6;
Make the bootblocks build with ELF assembler.
 1.2 28-Dec-1996  leo branches: 1.2.42;
- The Hades bios does not pass a 'bootpreference' in d5. Deal with it by
getting the 'bootpreference' ourselves when it is not set to any legal
value.
- Because the relation between memtop/membot and the video base does not
hold on the Hades, skip testing on it.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.42.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.42.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.3.6.2 17-Apr-2002  nathanw Catch up to -current.
 1.3.6.1 05-Sep-2001  nathanw file sdb00t.ahdi.s was added on branch nathanw_sa on 2002-04-17 00:02:46 +0000
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3 28-Jun-2003  he Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.3 28-Jun-2003  he Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.10 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.9 11-Dec-2005  christos branches: 1.9.112; 1.9.122; 1.9.128;
merge ktrace-lwp.
 1.8 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.7 23-May-2003  leo branches: 1.7.2;
usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.6 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.5 23-Jul-2000  jdc branches: 1.5.4; 1.5.8;
Make these work with obj directories.
 1.4 13-Feb-1999  lukem branches: 1.4.8; 1.4.18;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 29-Jun-1996  leo Define LIBCRT0. This tries to defeat the attempts of bsd.prog.mk to add
${DESTDIR}/....crt0 to the link rule when $DESTDIR is set.
 1.2 14-May-1996  leo branches: 1.2.4;
Update to make this work correctly when using an obj-directory.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.4.1 30-Jun-1996  jtc Pulled up rev 1.3 by request from Leo Weppelman
 1.4.18.1 24-Jul-2000  jdc Make these work with obj directories.
Agreed with Leo Weppelman.
Approved by Jason R Thorpe.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.128.1 18-May-2014  rmind sync with head
 1.9.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.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.3 26-Jun-2022  tsutsui Unifdef __ELF__.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 28-Oct-2003  he branches: 1.1.4;
Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 28-Oct-2003  skrll file wdb00t.ahdi.S was added on branch ktrace-lwp on 2004-08-03 10:33:27 +0000
 1.6 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.5 15-Apr-2002  leo branches: 1.5.10;
Fix PR-16305. Make the 'end' symbol local.
 1.4 05-Sep-2001  thomas branches: 1.4.6;
Make the bootblocks build with ELF assembler.
 1.3 28-Dec-1996  leo branches: 1.3.42;
- The Hades bios does not pass a 'bootpreference' in d5. Deal with it by
getting the 'bootpreference' ourselves when it is not set to any legal
value.
- Because the relation between memtop/membot and the video base does not
hold on the Hades, skip testing on it.
 1.2 26-Dec-1996  leo Correct the IDE port-addresses and data transfer method so this will work
both Hades & Falcon.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.3.42.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.42.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.6.2 17-Apr-2002  nathanw Catch up to -current.
 1.4.6.1 05-Sep-2001  nathanw file wdb00t.ahdi.s was added on branch nathanw_sa on 2002-04-17 00:02:46 +0000
 1.5.10.1 03-Aug-2004  skrll Sync with HEAD
 1.7 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.6 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.5 23-Jul-2000  jdc branches: 1.5.4; 1.5.8;
Make these work with obj directories.
 1.4 13-Feb-1999  lukem branches: 1.4.8; 1.4.18;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 29-Jun-1996  leo Define LIBCRT0. This tries to defeat the attempts of bsd.prog.mk to add
${DESTDIR}/....crt0 to the link rule when $DESTDIR is set.
 1.2 14-May-1996  leo branches: 1.2.4;
Update to make this work correctly when using an obj-directory.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.4.1 30-Jun-1996  jtc Pulled up rev 1.3 by request from Leo Weppelman
 1.4.18.1 24-Jul-2000  jdc Make these work with obj directories.
Agreed with Leo Weppelman.
Approved by Jason R Thorpe.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.3 11-Dec-2005  christos branches: 1.3.112; 1.3.122; 1.3.128;
merge ktrace-lwp.
 1.2 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1 23-May-2003  leo branches: 1.1.2;
usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.128.1 18-May-2014  rmind sync with head
 1.3.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.3 26-Jun-2022  tsutsui Unifdef __ELF__.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 28-Oct-2003  he branches: 1.1.4;
Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 28-Oct-2003  skrll file xxboot.ahdi.S was added on branch ktrace-lwp on 2004-08-03 10:33:27 +0000
 1.7 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.6 15-Apr-2002  leo branches: 1.6.10;
Fix PR-16305. Make the 'end' symbol local.
 1.5 05-Sep-2001  thomas branches: 1.5.6;
Make the bootblocks build with ELF assembler.
 1.4 08-Jan-1997  leo branches: 1.4.42;
Adjust 'fill'.
 1.3 28-Dec-1996  leo - The Hades bios does not pass a 'bootpreference' in d5. Deal with it by
getting the 'bootpreference' ourselves when it is not set to any legal
value.
- Because the relation between memtop/membot and the video base does not
hold on the Hades, skip testing on it.
 1.2 18-Mar-1996  leo Take care of the case that <start_of_video> < <memtop>
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.4.42.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.42.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.5.6.2 17-Apr-2002  nathanw Catch up to -current.
 1.5.6.1 05-Sep-2001  nathanw file xxboot.ahdi.s was added on branch nathanw_sa on 2002-04-17 00:02:47 +0000
 1.6.10.1 03-Aug-2004  skrll Sync with HEAD
 1.4 04-Mar-2018  tsutsui Provide wdboot as a copy of sdboot for Milan.

It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.
 1.3 28-Jun-2003  he branches: 1.3.188;
Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.3.188.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.3 28-Jun-2003  he Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.7 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.6 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.5 23-Jul-2000  jdc branches: 1.5.4; 1.5.8;
Make these work with obj directories.
 1.4 13-Feb-1999  lukem branches: 1.4.8; 1.4.18;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 29-Jun-1996  leo Define LIBCRT0. This tries to defeat the attempts of bsd.prog.mk to add
${DESTDIR}/....crt0 to the link rule when $DESTDIR is set.
 1.2 14-May-1996  leo branches: 1.2.4;
Update to make this work correctly when using an obj-directory.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.4.1 30-Jun-1996  jtc Pulled up rev 1.3 by request from Leo Weppelman
 1.4.18.1 24-Jul-2000  jdc Make these work with obj directories.
Agreed with Leo Weppelman.
Approved by Jason R Thorpe.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.3 11-Dec-2005  christos branches: 1.3.112; 1.3.122; 1.3.128;
merge ktrace-lwp.
 1.2 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1 23-May-2003  leo branches: 1.1.2;
usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.128.1 18-May-2014  rmind sync with head
 1.3.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.3 26-Jun-2022  tsutsui Unifdef __ELF__.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 28-Oct-2003  he branches: 1.1.4;
Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 28-Oct-2003  skrll file fdboot.S was added on branch ktrace-lwp on 2004-08-03 10:33:27 +0000
 1.6 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.5 15-Apr-2002  leo branches: 1.5.10;
Fix PR-16305. Make the 'end' symbol local.
 1.4 05-Sep-2001  thomas branches: 1.4.6;
Make the bootblocks build with ELF assembler.
 1.3 28-Dec-1996  leo branches: 1.3.42;
- The Hades bios does not pass a 'bootpreference' in d5. Deal with it by
getting the 'bootpreference' ourselves when it is not set to any legal
value.
- Because the relation between memtop/membot and the video base does not
hold on the Hades, skip testing on it.
 1.2 18-Mar-1996  leo Take care of the case that <start_of_video> < <memtop>
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.3.42.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.42.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.6.2 17-Apr-2002  nathanw Catch up to -current.
 1.4.6.1 05-Sep-2001  nathanw file fdboot.s was added on branch nathanw_sa on 2002-04-17 00:02:47 +0000
 1.5.10.1 03-Aug-2004  skrll Sync with HEAD
 1.3 28-Jun-2003  he Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.3 28-Jun-2003  he Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.7 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.6 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.5 23-Jul-2000  jdc branches: 1.5.4; 1.5.8;
Make these work with obj directories.
 1.4 13-Feb-1999  lukem branches: 1.4.8; 1.4.18;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 29-Jun-1996  leo Define LIBCRT0. This tries to defeat the attempts of bsd.prog.mk to add
${DESTDIR}/....crt0 to the link rule when $DESTDIR is set.
 1.2 14-May-1996  leo branches: 1.2.4;
Update to make this work correctly when using an obj-directory.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.4.1 30-Jun-1996  jtc Pulled up rev 1.3 by request from Leo Weppelman
 1.4.18.1 24-Jul-2000  jdc Make these work with obj directories.
Agreed with Leo Weppelman.
Approved by Jason R Thorpe.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.3 11-Dec-2005  christos branches: 1.3.112; 1.3.122; 1.3.128;
merge ktrace-lwp.
 1.2 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1 23-May-2003  leo branches: 1.1.2;
usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.128.1 18-May-2014  rmind sync with head
 1.3.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.3 26-Jun-2022  tsutsui Unifdef __ELF__.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 28-Oct-2003  he branches: 1.1.4;
Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 28-Oct-2003  skrll file sdboot.S was added on branch ktrace-lwp on 2004-08-03 10:33:27 +0000
 1.6 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.5 15-Apr-2002  leo branches: 1.5.10;
Fix PR-16305. Make the 'end' symbol local.
 1.4 05-Sep-2001  thomas branches: 1.4.6;
Make the bootblocks build with ELF assembler.
 1.3 28-Dec-1996  leo branches: 1.3.42;
- The Hades bios does not pass a 'bootpreference' in d5. Deal with it by
getting the 'bootpreference' ourselves when it is not set to any legal
value.
- Because the relation between memtop/membot and the video base does not
hold on the Hades, skip testing on it.
 1.2 18-Mar-1996  leo Take care of the case that <start_of_video> < <memtop>
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.3.42.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.42.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.6.2 17-Apr-2002  nathanw Catch up to -current.
 1.4.6.1 05-Sep-2001  nathanw file sdboot.s was added on branch nathanw_sa on 2002-04-17 00:02:47 +0000
 1.5.10.1 03-Aug-2004  skrll Sync with HEAD
 1.4 04-Mar-2018  tsutsui Provide wdboot as a copy of sdboot for Milan.

It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.
 1.3 28-Jun-2003  he branches: 1.3.188;
Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.3.188.1 13-Mar-2018  martin Pull up following revision(s) (requested by tsutsui in ticket #624):
sys/arch/atari/stand/xxboot/sdboot/milan/Makefile: revision 1.4
sys/arch/atari/dev/nvram.c: revision 1.21
sys/arch/atari/conf/MILAN.in: revision 1.28
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.9
sys/dev/isa/fd.c: revision 1.111
sys/arch/atari/atari/bus.c: revision 1.60
sys/arch/atari/stand/xxboot/ahdi-xxboot/milan/Makefile: revision 1.4
sys/arch/atari/atari/locore.s: revision 1.111
sys/arch/atari/isa/isa_machdep.c: revision 1.41
distrib/sets/lists/base/md.atari: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.55
sys/arch/atari/pci/pci_machdep.c: revision 1.56
sys/arch/atari/include/vmparam.h: revision 1.32
sys/arch/atari/isa/isa_milan.c: revision 1.15
sys/arch/atari/isa/isa_milan.c: revision 1.16
sys/arch/atari/atari/bus.c: revision 1.59
sys/arch/atari/atari/atari_init.c: revision 1.101
sys/arch/atari/pci/pci_milan.c: revision 1.15
Fix I/O access failures for regions allocated by bus_space_map(9) on Milan.

Passing to PMAP_WIRED against I/O spaces seems problematic,
probably after yamt-km branch merge, which was committed
between NetBSD 3.0 and NetBSD 4.0.
(i.e. ISA and PCI devices on Milan didn't work after 4.0 release)

XXX:
According to pmap(9) man page, the "flags" arg for pmap_enter(9)
doesn't take VM_PROT_READ and VM_PROT_WRITE, but pmap_enter()
implementation in sys/arch/m68k/m68k/pmap_motolora.c historically
checks them.

Fix silent hang during config_console() (before consinit()) on Milan.
config_console() was a dirty hack used by ancient m68k ports
to probe and initialize console devices before "real" configure(9),
using subset of configure(9) functions.

In that case, most device specific data (except I/O access method)
are not initialized so we must not access device specific device_t and
softc structures in config_console() cases.

Fix silent hang after isa_intr_establish() on Milan.
The problems (wrong macro replacements) were slipped in rev 1.107:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/atari/locore.s#rev1.107
Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.
atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.

Use a proper PSL value to be passed to splx(9) functions.
This should have been changed on yamt-splraiseipl branch merge
back in 2006, which made MI IPL_xxx values independent from
m68k MD PSL values for the %sr register.

Restore piixide(4) for Milan and disable other pciide devices.
piixide was removed in rev 1.18 and the log message said
"because Intel IDE disk controllers only exist as part of
Intel chipsets for x86 systems" but the Milan actually has
the Intel 82371FB southbridge on its board.
Other pciide devices are unlikely necessary for the default
kernel for such a rare machine.
Also fix pasto in comment.

Skip NVRAM checksum check and re-initialization on Milan.
Milan's firmware seems to use different check method.

Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.
I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.
Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.

Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but
the Milan's ROM bootloader (at least version 0.99.7) doesn't seem
to setup the MBIRQ0 register to route it to IRQ15.

On Milan, also explicitly disable MBIRQ1 on PIIX.
Milan's ROM bootloader v1.2 and v1.4 incorrectly set MBIRQ0 connected
to the secondary IDE to IRQ14 (not 15) and unused MBIRQ1 to IRQ15,
so both IDE channels don't work properly.

Add dumb memory probe routines for Milan to use all available memory.
Tested on Milan with 32Mx1, 32Mx4, 128MBx1, and 128MBx3.
(bootloader ROM fails to load TOS with 128MBx4)
No particular comment on port-atari@:
http://mail-index.netbsd.org/port-atari/2018/02/09/msg000580.html

Provide wdboot as a copy of sdboot for Milan.
It looks Milan's bootloader ROM emulates IDE disks as SCSI disks
so sdboot works for them, but atari's installboot checks a specified
device name and requires wdboot for wd(4) devices.

Fix another possible out of bounds.

Replace bus_dmamap_sync(9) op with a newer one taken from m68k/bus_dma.c.
This could fix memory corruption issue caused by PREREAD ops with regions
whose boundaries are not aligned at cacheline size.
 1.3 28-Jun-2003  he Somehow all these tiny Makefiles had their contents replicated.
Pare back down to just one copy.
 1.2 23-May-2003  leo usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.1 23-May-2003  leo branches: 1.1.1;
Initial revision
 1.1.1.1 23-May-2003  leo usr/mdec reorg for Milan support
 1.10 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.9 11-Dec-2005  christos branches: 1.9.112; 1.9.122; 1.9.128;
merge ktrace-lwp.
 1.8 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.7 23-May-2003  leo branches: 1.7.2;
usr/mdec reorg for Milan support.
Note that installboot needs reworking too. Installing bootblocks on -current
is no longer possible until this is done.
nolonger
 1.6 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.5 23-Jul-2000  jdc branches: 1.5.4; 1.5.8;
Make these work with obj directories.
 1.4 13-Feb-1999  lukem branches: 1.4.8; 1.4.18;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.3 29-Jun-1996  leo Define LIBCRT0. This tries to defeat the attempts of bsd.prog.mk to add
${DESTDIR}/....crt0 to the link rule when $DESTDIR is set.
 1.2 14-May-1996  leo branches: 1.2.4;
Update to make this work correctly when using an obj-directory.
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.2.4.1 30-Jun-1996  jtc Pulled up rev 1.3 by request from Leo Weppelman
 1.4.18.1 24-Jul-2000  jdc Make these work with obj directories.
Agreed with Leo Weppelman.
Approved by Jason R Thorpe.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.128.1 18-May-2014  rmind sync with head
 1.9.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.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.3 26-Jun-2022  tsutsui Unifdef __ELF__.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 28-Oct-2003  he branches: 1.1.4;
Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 28-Oct-2003  skrll file wdboot.S was added on branch ktrace-lwp on 2004-08-03 10:33:35 +0000
 1.7 28-Oct-2003  he Rename those assembly files which should be passed through the C
preprocessor from .s to .S to pick up CPPFLAGS.
 1.6 15-Apr-2002  leo branches: 1.6.10;
Fix PR-16305. Make the 'end' symbol local.
 1.5 05-Sep-2001  thomas branches: 1.5.6;
Make the bootblocks build with ELF assembler.
 1.4 28-Dec-1996  leo branches: 1.4.42;
- The Hades bios does not pass a 'bootpreference' in d5. Deal with it by
getting the 'bootpreference' ourselves when it is not set to any legal
value.
- Because the relation between memtop/membot and the video base does not
hold on the Hades, skip testing on it.
 1.3 26-Dec-1996  leo Correct the IDE port-addresses and data transfer method so this will work
both Hades & Falcon.
 1.2 18-Mar-1996  leo Take care of the case that <start_of_video> < <memtop>
 1.1 29-Feb-1996  leo branches: 1.1.1;
Initial revision
 1.1.1.1 29-Feb-1996  leo NetBSD/Atari bootcode by Waldi Ravens.
 1.4.42.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.42.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.5.6.2 17-Apr-2002  nathanw Catch up to -current.
 1.5.6.1 05-Sep-2001  nathanw file wdboot.s was added on branch nathanw_sa on 2002-04-17 00:02:48 +0000
 1.6.10.1 03-Aug-2004  skrll Sync with HEAD
 1.29 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.28 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.27 03-Jul-2022  tsutsui Make local cdevsw functions static.

XXX: there is no config file that has leo(4) (though it still compiles)
 1.26 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.25 16-Mar-2014  dholland branches: 1.25.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.24 10-Jun-2011  tsutsui branches: 1.24.2; 1.24.12; 1.24.16;
Split device_t/softc. Compile test only.
 1.23 12-Dec-2010  tsutsui branches: 1.23.6;
Rename device name of Crazy Dots II ET4000 video from et(4) to et4k(4)
to deliver the name to recently committed newer and more common MI device,
et(4) at PCIe (Agere ET1310/ET1301 network driver) in PR kern/39094.
http://mail-index.NetBSD.org/source-changes/2010/11/13/msg014416.html

No particular reaction for a month on source-changes-d@,
no responsible person on atari port, and probably
no active user still using ET4000 on TT030 running NetBSD/atari.
 1.22 13-Apr-2010  tsutsui Misc KNF.
 1.21 13-Apr-2010  tsutsui Include "ioconf.h" to declare struct cfdriver foo_cd.
 1.20 19-Jul-2009  tsutsui branches: 1.20.2; 1.20.4;
Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.19 18-Mar-2009  cegger bcopy -> memcpy
 1.18 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.17 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.16 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.15 11-Jun-2008  tsutsui branches: 1.15.4; 1.15.10;
Use device_private() and device_lookup_privat() to get softc.
 1.14 28-Apr-2008  martin branches: 1.14.2; 1.14.4;
Remove clause 3 and 4 from TNF licenses
 1.13 04-Mar-2007  christos branches: 1.13.40; 1.13.42; 1.13.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.12 11-Dec-2005  christos branches: 1.12.26;
merge ktrace-lwp.
 1.11 15-Jul-2003  lukem branches: 1.11.16;
__KERNEL_RCSID()
 1.10 23-Oct-2002  jdolecek branches: 1.10.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.9 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.8 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.7 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.6 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.5 26-Jun-2000  simonb branches: 1.5.2; 1.5.4; 1.5.8; 1.5.16;
Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.4 21-Oct-1999  leo branches: 1.4.6;
Ouch! Correct bus_space_unmap() call parameter usage.
 1.3 31-Mar-1999  leo branches: 1.3.2; 1.3.8; 1.3.10; 1.3.12;
From Julian Coleman:
- there are a couple of registers that are reset after the X server finishes,
which do not have the same values as they do when the machine is powered
on. If the two are mismatched you can't write to the video memory.
- video memory is mapped at offset 4MB to keep the X server happy
- there is now a VGA memory mapping
- DEBUG_ET4000 is now a bit more useful for debugging!
 1.2 14-Sep-1998  leo Improve initialisation of the Crazy Dots card. (Julian Coleman)
 1.1 23-Apr-1998  leo Crazy Dots driver by Julian Coleman.
 1.3.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.10.1 15-Nov-1999  fvdl Sync with -current
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.2.1 04-Dec-1999  he Pull up revision 1.4 (requested by leo):
Fix arguments of bus_space_unmap().
 1.4.6.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.5.16.1 17-May-2002  gehenna Add device switch.
 1.5.8.3 11-Nov-2002  nathanw Catch up to -current
 1.5.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.5.8.1 17-Sep-2002  nathanw Catch up to -current.
 1.5.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.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.10.6.4 17-Jan-2005  skrll Adapt to branch.
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.2 03-Sep-2007  yamt sync with head.
 1.11.16.1 21-Jun-2006  yamt sync with head.
 1.12.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.13.44.4 11-Aug-2010  yamt sync with head.
 1.13.44.3 19-Aug-2009  yamt sync with head.
 1.13.44.2 04-May-2009  yamt sync with head.
 1.13.44.1 16-May-2008  yamt sync with head.
 1.13.42.2 17-Jun-2008  yamt sync with head.
 1.13.42.1 18-May-2008  yamt sync with head.
 1.13.40.2 29-Jun-2008  mjf Sync with HEAD.
 1.13.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.4.1 18-Jun-2008  simonb Sync with head.
 1.14.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.15.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.20.4.3 12-Jun-2011  rmind sync with head
 1.20.4.2 05-Mar-2011  rmind 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.23.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.24.16.1 18-May-2014  rmind sync with head
 1.24.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.25.2.1 10-Aug-2014  tls Rebase.
 1.35 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.34 26-Jun-2022  tsutsui Misc cleanup.

- KNF and TAB/space
- make local function static
- make readonly values const
- remove ancient "hide" and "integrate" macro
(just use static for modern compliers that perform inline properly)
- remove (probably) an old gcc's warning hack
- use __func__ to print function names properly
- fix attach messages in an error path
- use proper integer types
 1.33 25-Jun-2022  tsutsui No need to print errors via aprint_error(9) in probe/match function.

Note aprint_error(9) triggers "WARNING: 1 error while detecting hardware"
message after device configuration, so it's a bit confusing for users.
Also check all possible variants even if bus_space_map(9) fails
(though now it shouldn't fail).
 1.32 25-Jun-2022  tsutsui Fix a long-standing "leprobe: cannot map memory-area" error during probe.

PAM and ROTHRON VME LANCE seem to have 64KB RAM, but the register
address region are overwrapped, so we cannot map both of them via
bus_space_map(9) that checks regions using extent(9).
To work around this, just use only 32KB RAM for buffers.
XXX: not sure if anyone tried these VME LANCE variants
 1.31 01-Jul-2011  dyoung branches: 1.31.58;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.30 13-Apr-2010  tsutsui Misc KNF.
 1.29 16-Mar-2010  tsutsui Fix register and memory addresses for PAM, per MintNet driver.

XXX: In le_vme_match(), probably we should not return even if
XXX: bus_space_map(9) fails unless all le_addresses have been checked.
 1.28 19-Jan-2010  pooka branches: 1.28.2; 1.28.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.27 19-Jul-2009  tsutsui Remove extra whitespace added by a dumb tool which replaced bcopy with memcpy.
 1.26 08-Jul-2009  tsutsui Merge local <atari/atari/intr.h> into common <machine/intr.h>.
 1.25 18-Mar-2009  cegger bcopy -> memcpy
 1.24 28-Jun-2008  isaki branches: 1.24.4; 1.24.10;
Unify splraiseipl(9) implementation among m68k ports,
discussed with tsutsui@ on port-m68k. OK'ed by jdc@.

For atari:
- 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)
- vme/if_le_vme.c: fix a wrong usage of IPL_NET
 1.23 04-Apr-2008  tsutsui branches: 1.23.4; 1.23.6; 1.23.8;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.22 24-Dec-2005  perry branches: 1.22.74;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.21 11-Dec-2005  christos merge ktrace-lwp.
 1.20 12-May-2004  wiz branches: 1.20.12;
Remove UCB ad clause from maximum entropy's license.
Ok'd by maximum entropy and board.
 1.19 25-Mar-2004  leo Licence cleanup (suggested by wiz).
 1.18 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.17 15-Jul-2003  lukem __KERNEL_RCSID()
 1.16 02-Oct-2002  thorpej branches: 1.16.6;
Use CFATTACH_DECL().
 1.15 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.14 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.13 26-Jul-2001  wiz branches: 1.13.6;
Various typos in comments (neccessary, sceme, choise, ...).
 1.12 30-May-2001  mrg branches: 1.12.2;
use _KERNEL_OPT
 1.11 25-Oct-1999  leo branches: 1.11.8;
correct second argument of bus_space_unmap().
 1.10 15-Apr-1999  leo branches: 1.10.2; 1.10.4; 1.10.6;
Fix the IPL comparison. The previous version was plain wrong and caused
random panics in the pool allocator.
 1.9 10-Dec-1998  leo branches: 1.9.2;
Another patch from 'maximum entropy':
* Add to copyright notice.
* Replace the bad probe that caused your problem in the first place
with a better one. This probably means we could do away with the
type hints you added, but it won't hurt to leave them.
* Improve performance by not wasting a memory access in the buffer
copy/zero routines.
 1.8 09-Dec-1998  leo Make sure that my Riebl card (with empty battery) is not detected
as an BVME410...
 1.7 09-Dec-1998  leo BVME410 ethernet driver by 'maximum entropy'.
 1.6 21-Jul-1998  drochner adapt to LANCE driver split
 1.5 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.4 17-Mar-1997  leo Catchup with arp changes.
 1.3 17-Mar-1997  thorpej #include <net/if_media.h>
 1.2 10-Mar-1997  leo $NetBSD -> $NetBSD$ Sigh.
 1.1 10-Mar-1997  leo Add support for the Lance ethernet card on the VME-bus (Riebl/PAM)
 1.9.2.2 04-Dec-1999  he Pull up revision 1.11 (requested by leo):
Fix arguments of bus_space_unmap().
 1.9.2.1 15-Apr-1999  leo branches: 1.9.2.1.2;
Pull-up 1.9-1.10:
Fix the IPL comparison. The previous version was plain wrong and caused
random panics in the pool allocator.
 1.9.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.10.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.4.1 15-Nov-1999  fvdl Sync with -current
 1.10.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.8.1 21-Jun-2001  nathanw Catch up to -current.
 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 03-Aug-2001  lukem update to -current
 1.13.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.13.6.1 26-Jul-2001  nathanw file if_le_vme.c was added on branch nathanw_sa on 2002-10-18 02:35:59 +0000
 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.12.1 21-Jun-2006  yamt sync with head.
 1.22.74.2 29-Jun-2008  mjf Sync with HEAD.
 1.22.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.8.1 03-Jul-2008  simonb Sync with head.
 1.23.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.23.4.5 11-Aug-2010  yamt sync with head.
 1.23.4.4 11-Mar-2010  yamt sync with head
 1.23.4.3 19-Aug-2009  yamt sync with head.
 1.23.4.2 18-Jul-2009  yamt sync with head.
 1.23.4.1 04-May-2009  yamt sync with head.
 1.24.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.24.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.28.4.1 30-May-2010  rmind sync with head
 1.28.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.31.58.1 11-Sep-2022  martin Pull up following revision(s) (requested by tsutsui in ticket #1520):

sys/arch/atari/vme/if_le_vme.c: revision 1.32
sys/arch/atari/vme/if_le_vme.c: revision 1.33

Fix a long-standing "leprobe: cannot map memory-area" error during probe.

PAM and ROTHRON VME LANCE seem to have 64KB RAM, but the register
address region are overwrapped, so we cannot map both of them via
bus_space_map(9) that checks regions using extent(9).

To work around this, just use only 32KB RAM for buffers.

XXX: not sure if anyone tried these VME LANCE variants

No need to print errors via aprint_error(9) in probe/match function.

Note aprint_error(9) triggers "WARNING: 1 error while detecting hardware"
message after device configuration, so it's a bit confusing for users.

Also check all possible variants even if bus_space_map(9) fails
(though now it shouldn't fail).
 1.7 16-Mar-2010  tsutsui Renumber board type for LE_PAM.
We can't use 0x00 if we also use the value as bitmap.
 1.6 28-Apr-2008  martin branches: 1.6.20; 1.6.22;
Remove clause 3 and 4 from TNF licenses
 1.5 09-Dec-1998  leo branches: 1.5.146; 1.5.148; 1.5.150;
Make sure that my Riebl card (with empty battery) is not detected
as an BVME410...
 1.4 09-Dec-1998  leo BVME410 ethernet driver by 'maximum entropy'.
 1.3 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.2 10-Mar-1997  leo branches: 1.2.4;
$NetBSD -> $NetBSD$ Sigh.
 1.1 10-Mar-1997  leo Add support for the Lance ethernet card on the VME-bus (Riebl/PAM)
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.150.2 11-Aug-2010  yamt sync with head.
 1.5.150.1 16-May-2008  yamt sync with head.
 1.5.148.1 18-May-2008  yamt sync with head.
 1.5.146.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.22.1 30-May-2010  rmind sync with head
 1.6.20.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.4 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.3 01-Oct-2011  chs branches: 1.3.12;
fix build errors with gcc 4.5.
 1.2 16-Mar-2010  tsutsui branches: 1.2.2; 1.2.4; 1.2.6;
Check if mapped bus_space regions are actually valid
before trying to access them.

Fixes trap panic when SMC_TT board is not installed. (oops)
 1.1 13-Mar-2010  tsutsui branches: 1.1.2;
Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.

The SMC_TT is the user designed "handmade" VME-ISA bridge circuit
for 16 bit VME slot on TT030 and the SMC Elite Ultra ISA Ethernet card.
More information about SMC_TT can be found in the following archive:
ftp://ftp.funet.fi/pub/atari/net/smc_tt1.zip

Demonstrated on the NetBSD booth in Open Source Conference 2010 Kansai@Kobe.
 1.1.2.1 30-May-2010  rmind sync with head
 1.2.6.2 20-Nov-2010  riz Pull up following revision(s) (requested by tsutsui in ticket #1366):
sys/arch/atari/vme/if_we_vme.c: revision 1.1
sys/arch/atari/vme/if_we_vme.c: revision 1.2
sys/arch/atari/conf/files.atari: revision 1.116
sys/arch/atari/conf/GENERIC.in: revision 1.84
share/man/man4/we.4: revision 1.17
distrib/notes/atari/hardware: revision 1.23
Add support for the SMC Elite Ultra Ethernet with the SMC_TT VME-ISA bridge.
The SMC_TT is the user designed "handmade" VME-ISA bridge circuit
for 16 bit VME slot on TT030 and the SMC Elite Ultra ISA Ethernet card.
More information about SMC_TT can be found in the following archive:
ftp://ftp.funet.fi/pub/atari/net/smc_tt1.zip
Demonstrated on the NetBSD booth in Open Source Conference 2010 Kansai@Kobe.
Check if mapped bus_space regions are actually valid
before trying to access them.
Fixes trap panic when SMC_TT board is not installed. (oops)
Note atari SMC_TT in SYNOPSIS.
- note SMC_TT to supported VME-bus devices
- capitalize Ethernet
 1.2.6.1 16-Mar-2010  riz file if_we_vme.c was added on branch netbsd-5 on 2010-11-20 00:26:51 +0000
 1.2.4.2 11-Aug-2010  yamt sync with head.
 1.2.4.1 16-Mar-2010  yamt file if_we_vme.c was added on branch yamt-nfs-mp on 2010-08-11 22:51:47 +0000
 1.2.2.2 30-Apr-2010  uebayasi Sync with HEAD.
 1.2.2.1 16-Mar-2010  uebayasi file if_we_vme.c was added on branch uebayasi-xip on 2010-04-30 14:39:13 +0000
 1.3.12.1 03-Dec-2017  jdolecek update from HEAD
 1.24 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.23 03-Jul-2022  tsutsui Make local cdevsw functions static.

XXX: there is no config file that has leo(4) (though it still compiles)
 1.22 01-Feb-2017  christos PR/51933: David Binderman: Boolean confusion
 1.21 25-Jul-2014  dholland branches: 1.21.4; 1.21.8; 1.21.12;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.20 16-Mar-2014  dholland branches: 1.20.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.19 01-Jul-2011  dyoung branches: 1.19.2; 1.19.12; 1.19.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.18 10-Jun-2011  tsutsui - split device_t/softc
- struct proc -> struct lwp

XXX: this driver is not in the default kernels.
 1.17 13-Apr-2010  tsutsui branches: 1.17.6;
Include "ioconf.h" to declare struct cfdriver foo_cd.
 1.16 14-Mar-2009  dsl branches: 1.16.2; 1.16.4;
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.15 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.14 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.13 13-Jun-2008  cegger branches: 1.13.4; 1.13.10;
use device_lookup_private to get softc
 1.12 28-Apr-2008  martin branches: 1.12.2; 1.12.4;
Remove clause 3 and 4 from TNF licenses
 1.11 04-Mar-2007  christos branches: 1.11.40; 1.11.42; 1.11.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 11-Dec-2005  christos branches: 1.10.26;
merge ktrace-lwp.
 1.9 15-Jul-2003  lukem branches: 1.9.16;
__KERNEL_RCSID()
 1.8 23-Oct-2002  jdolecek branches: 1.8.6;
merge kqueue branch into -current

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

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

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.7 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.4 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.3 26-Jun-2000  simonb branches: 1.3.2; 1.3.4; 1.3.8; 1.3.16;
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.2 25-Oct-1999  leo branches: 1.2.6;
correct second argument of bus_space_unmap().
 1.1 18-Aug-1998  leo branches: 1.1.6; 1.1.12; 1.1.14; 1.1.16;
Circad Leonardo video driver by 'maximum entropy'.
 1.1.16.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.14.1 15-Nov-1999  fvdl Sync with -current
 1.1.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 04-Dec-1999  he Pull up revision 1.2 (requested by leo):
Fix arguments of bus_space_unmap().
 1.2.6.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.3.16.1 17-May-2002  gehenna Add device switch.
 1.3.8.3 11-Nov-2002  nathanw Catch up to -current
 1.3.8.2 18-Oct-2002  nathanw Catch up to -current.
 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.3.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 03-Sep-2007  yamt sync with head.
 1.10.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.44.3 11-Aug-2010  yamt sync with head.
 1.11.44.2 04-May-2009  yamt sync with head.
 1.11.44.1 16-May-2008  yamt sync with head.
 1.11.42.2 17-Jun-2008  yamt sync with head.
 1.11.42.1 18-May-2008  yamt sync with head.
 1.11.40.2 29-Jun-2008  mjf Sync with HEAD.
 1.11.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.4.1 18-Jun-2008  simonb Sync with head.
 1.12.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.13.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.16.4.2 12-Jun-2011  rmind sync with head
 1.16.4.1 30-May-2010  rmind sync with head
 1.16.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.17.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.19.16.1 18-May-2014  rmind sync with head
 1.19.12.2 03-Dec-2017  jdolecek update from HEAD
 1.19.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.20.2.1 10-Aug-2014  tls Rebase.
 1.21.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.21.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.21.4.1 05-Feb-2017  skrll Sync with HEAD
 1.3 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
 1.2 28-Apr-2008  martin branches: 1.2.44; 1.2.64;
Remove clause 3 and 4 from TNF licenses
 1.1 03-Nov-1998  leo branches: 1.1.148; 1.1.150; 1.1.152;
These should have been added together with leo.c a long while ago :-( Thanks
to 'entropy' for keeping an eye on me...
 1.1.152.1 16-May-2008  yamt sync with head.
 1.1.150.1 18-May-2008  yamt sync with head.
 1.1.148.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.64.1 22-Sep-2015  skrll Sync with HEAD
 1.2.44.1 03-Dec-2017  jdolecek update from HEAD
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 03-Nov-1998  leo branches: 1.1.148; 1.1.150; 1.1.152;
These should have been added together with leo.c a long while ago :-( Thanks
to 'entropy' for keeping an eye on me...
 1.1.152.1 16-May-2008  yamt sync with head.
 1.1.150.1 18-May-2008  yamt sync with head.
 1.1.148.1 02-Jun-2008  mjf Sync with HEAD.
 1.21 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h> include.
 1.20 26-Jun-2022  tsutsui Misc cleanup.

- make local functions static
- use aprint_normal(9) for attach message
- KNF
 1.19 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.18 24-Apr-2021  thorpej branches: 1.18.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.17 05-Jun-2011  tsutsui branches: 1.17.68;
Split device_t/softc. No crash on TT030.
 1.16 14-Mar-2009  dsl branches: 1.16.4; 1.16.6; 1.16.10;
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.15 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.14 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.13 28-Apr-2008  martin branches: 1.13.8; 1.13.14;
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 15-Jul-2003  lukem __KERNEL_RCSID()
 1.8 01-Jan-2003  thorpej branches: 1.8.2;
Use aprint_normal() for cfprint routines.
 1.7 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.4 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.3 12-Jan-1998  thorpej branches: 1.3.28; 1.3.32;
Update for changes to config.
 1.2 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.1 03-Mar-1997  leo branches: 1.1.1;
Initial revision
 1.1.1.1 03-Mar-1997  leo branches: 1.1.1.1.4;
VME bus code
 1.1.1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.32.2 03-Jan-2003  thorpej Sync with HEAD.
 1.3.32.1 18-Oct-2002  nathanw Catch up to -current.
 1.3.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.8.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.2.1 21-Jun-2006  yamt sync with head.
 1.12.78.2 04-May-2009  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.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.16.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.16.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.16.4.1 12-Jun-2011  rmind sync with head
 1.17.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.17.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.17.68.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.17.68.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.17.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.17.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.18.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.24 26-Jun-2022  tsutsui Misc cleanup.

- use a local variable static
- use aprint_*(9) for attach messages
- KNF
 1.23 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.22 24-Apr-2021  thorpej branches: 1.22.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.21 01-Jul-2011  dyoung branches: 1.21.68;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.20 05-Jun-2011  tsutsui - use CFATTACH_DECL_NEW() (no softc)
- use device_t, cfdata_t etc.
 1.19 13-Apr-2010  tsutsui branches: 1.19.2; 1.19.6;
Misc KNF.
 1.18 14-Mar-2009  dsl branches: 1.18.2; 1.18.4;
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.17 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.16 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.15 28-Apr-2008  martin branches: 1.15.8; 1.15.14;
Remove clause 3 and 4 from TNF licenses
 1.14 11-Dec-2005  christos branches: 1.14.74; 1.14.76; 1.14.78;
merge ktrace-lwp.
 1.13 13-Dec-2004  chs for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 02-Oct-2002  thorpej branches: 1.11.6;
Use CFATTACH_DECL().
 1.10 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.9 29-Jun-2000  mrg branches: 1.9.4; 1.9.8;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.8 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.7 19-Jan-2000  leo Allow storage-space to be passed to the alloc_bus_space_tag() functions. This
permits static tags to be used during early console init.
 1.6 15-Sep-1998  leo branches: 1.6.12;
Oops, forgot this one in the vmebus renaming (Julian Coleman).
 1.5 02-Sep-1998  leo mv vmebus -> avmebus to make room for MI vmebus implementation (per
reqest of Drochner).
 1.4 22-Apr-1998  leo Add the 'bus' code for a linear big endian bus (like VME).
 1.3 12-Jan-1998  thorpej Update for changes to config.
 1.2 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.1 03-Mar-1997  leo branches: 1.1.1;
Initial revision
 1.1.1.1 03-Mar-1997  leo branches: 1.1.1.1.4;
VME bus code
 1.1.1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.8.1 18-Oct-2002  nathanw Catch up to -current.
 1.9.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.11.6.4 18-Dec-2004  skrll Sync with HEAD.
 1.11.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14.78.3 11-Aug-2010  yamt sync with head.
 1.14.78.2 04-May-2009  yamt sync with head.
 1.14.78.1 16-May-2008  yamt sync with head.
 1.14.76.1 18-May-2008  yamt sync with head.
 1.14.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.18.4.2 12-Jun-2011  rmind sync with head
 1.18.4.1 30-May-2010  rmind sync with head
 1.18.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.19.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.19.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.21.68.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.22.8.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 09-Oct-1997  jtc branches: 1.3.152; 1.3.154; 1.3.156;
Fix tipo inherited from old version of TNF copyright template.
 1.2 03-Mar-1997  leo branches: 1.2.4;
Ooops. Add cvs-id + copyright.
 1.1 03-Mar-1997  leo branches: 1.1.1;
Initial revision
 1.1.1.1 03-Mar-1997  leo VME bus code
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.156.1 16-May-2008  yamt sync with head.
 1.3.154.1 18-May-2008  yamt sync with head.
 1.3.152.1 02-Jun-2008  mjf Sync with HEAD.
 1.9 06-Jan-2023  tsutsui TAB/spaces/indents cleanup.
 1.8 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.7 05-Jun-2011  tsutsui Split device_t/softc. No crash on TT030.
 1.6 28-Apr-2008  martin branches: 1.6.22; 1.6.28; 1.6.32;
Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.76; 1.5.78;
merge ktrace-lwp.
 1.4 04-Jun-2005  he Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
 1.3 09-Oct-1997  jtc branches: 1.3.50;
Fix tipo inherited from old version of TNF copyright template.
 1.2 17-Jul-1997  jtk branches: 1.2.2;
use locator defines in "locators.h" to index cf_loc[]

still to be done and/or decided not to be done: replace all *UNK uses in
vme code with the native names from locators.h
 1.1 03-Mar-1997  leo branches: 1.1.1;
Initial revision
 1.1.1.1 03-Mar-1997  leo VME bus code
 1.2.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.50.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.78.1 16-May-2008  yamt sync with head.
 1.5.76.1 18-May-2008  yamt sync with head.
 1.5.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.32.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.6.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.22.1 12-Jun-2011  rmind sync with head

RSS XML Feed