Home | History | Annotate | only in /src/sys/arch/luna68k/include
History log of /src/sys/arch/luna68k/include
RevisionDateAuthorComments
 1.22 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.21 12-Jul-2018  maxv branches: 1.21.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.20 09-Mar-2017  tsutsui branches: 1.20.12; 1.20.14;
Add a driver for LUNA's front panel LCD. Ported from OpenBSD/luna88k.

Reviewed by enami@. Tested by Naruaki Etomi and me.

A 68k LUNA with this driver will be demonstrated at AsiaBSDCon NetBSD booth
by Etomi-san, with LUNA-88K2 running OpenBSD/luna88k by Kenji Aoyama.
 1.19 03-Dec-2016  tsutsui branches: 1.19.2;
Preliminary support for LUNA's HD647180X I/O processor (a.k.a. XP).

Demonstrated as "PSG tunes / PCM wav player on LUNA"
(using Z80 PSG/PCM drivers ported from NEC PC-6001)
at OSC2016 Kyoto and OSC2016 Hiroshima:
http://mail-index.netbsd.org/netbsd-advocacy/2016/08/01/msg000712.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/29/msg000724.html
 1.18 24-Dec-2015  christos branches: 1.18.2;
fenv for m68k
 1.17 17-Jul-2011  joerg branches: 1.17.12; 1.17.28; 1.17.30; 1.17.34;
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.16 09-Feb-2007  ad Merge newlock2 to head.
 1.15 26-Jul-2006  drochner branches: 1.15.4;
don't install <machine/db_machdep.h>, this is kernel only
 1.14 11-Dec-2005  christos branches: 1.14.4; 1.14.8;
merge ktrace-lwp.
 1.13 08-May-2004  kleink branches: 1.13.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.12 17-Jan-2003  thorpej branches: 1.12.2;
Merge the nathanw_sa branch.
 1.11 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.10 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.9 04-Apr-2002  bjh21 branches: 1.9.2;
Install elf_machdep.h.
 1.8 15-Apr-2001  kleink branches: 1.8.2; 1.8.8;
Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.7 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.6 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
 1.5 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.4 26-Jun-2000  kleink branches: 1.4.2; 1.4.4;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.3 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.2 17-Mar-2000  tron Install "machineendian_machdep.h".
 1.1 05-Jan-2000  nisimura Introduce NetBSD/luna68k port into CVS repository.
 1.4.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.4.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.4.2.1 26-Jun-2000  bouyer file Makefile was added on branch thorpej_scsipi on 2000-11-20 20:10:27 +0000
 1.8.8.5 11-Dec-2002  thorpej Sync with HEAD.
 1.8.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.8.8.3 17-Apr-2002  nathanw Catch up to -current.
 1.8.8.2 10-Nov-2001  scw Kernel mcontext glue for Scheduler Activations on m68k from
Klaus Klein <kleink@netbsd.org>.
 1.8.8.1 15-Apr-2001  scw file Makefile was added on branch nathanw_sa on 2001-11-10 21:22:50 +0000
 1.8.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.8.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.1 31-Aug-2002  gehenna catch up with -current.
 1.12.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.12.2 26-Feb-2007  yamt sync with head.
 1.13.12.1 30-Dec-2006  yamt sync with head.
 1.14.8.1 11-Aug-2006  yamt sync with head
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.15.4.1 01-Feb-2007  ad Header file cleanup.
 1.17.34.1 18-Jan-2017  skrll Sync with netbsd-5
 1.17.30.3 28-Aug-2017  skrll Sync with HEAD
 1.17.30.2 05-Dec-2016  skrll Sync with HEAD
 1.17.30.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.17.28.1 06-Dec-2016  snj Pull up following revision(s) (requested by tsutsui in ticket #1283):
distrib/sets/lists/comp/md.luna68k: revision 1.21
etc/etc.luna68k/MAKEDEV.conf: revision 1.9
sys/arch/luna68k/conf/GENERIC: revision 1.120
sys/arch/luna68k/conf/files.luna68k: revision 1.25
sys/arch/luna68k/conf/majors.luna68k: revision 1.21
sys/arch/luna68k/dev/xp.c: revision 1.1
sys/arch/luna68k/include/Makefile: revision 1.19
sys/arch/luna68k/include/xpio.h: revision 1.1
sys/arch/luna68k/luna68k/mainbus.c: revision 1.14
Preliminary support for LUNA's HD647180X I/O processor (a.k.a. XP).
Demonstrated as "PSG tunes / PCM wav player on LUNA"
(using Z80 PSG/PCM drivers ported from NEC PC-6001)
at OSC2016 Kyoto and OSC2016 Hiroshima:
http://mail-index.netbsd.org/netbsd-advocacy/2016/08/01/msg000712.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/29/msg000724.html
 1.17.12.1 03-Dec-2017  jdolecek update from HEAD
 1.18.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.18.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.19.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.20.14.1 10-Jun-2019  christos Sync with HEAD
 1.20.12.1 28-Jul-2018  pgoyette Sync with HEAD
 1.21.36.1 02-Aug-2025  perseant Sync with HEAD
 1.2 07-May-2019  kamil Switch all users (except ia64) of custom machine/ansi.h to common_ansi.h

Deduplicate the code among ports and poll definitions of types
directly from a compiler.

This fixes miscompilation of certain programs that instruct compilers
to generate code for different types. This bug has been detected with
-fshort-wchar in EFI firmware.

Proposed and discussed on a mailing list (twice).

Itanium uses custom !ELF fallback switch, temporarily leave it as it is.
 1.1 05-Jan-2000  nisimura branches: 1.1.6; 1.1.220;
Introduce NetBSD/luna68k port into CVS repository.
 1.1.220.1 10-Jun-2019  christos Sync with HEAD
 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 05-Jan-2000  bouyer file ansi.h was added on branch thorpej_scsipi on 2000-11-20 20:10:27 +0000
 1.2 05-Jul-2022  tsutsui Remove unnecessary and incorrect mulitple inclusion protection.
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file aout_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:10:27 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file asm.h was added on branch thorpej_scsipi on 2000-11-20 20:10:28 +0000
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 05-Jan-2000  nisimura branches: 1.1.6; 1.1.132; 1.1.134; 1.1.136;
Introduce NetBSD/luna68k port into CVS repository.
 1.1.136.1 16-May-2008  yamt sync with head.
 1.1.134.1 18-May-2008  yamt sync with head.
 1.1.132.1 02-Jun-2008  mjf Sync with HEAD.
 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 05-Jan-2000  bouyer file autoconf.h was added on branch thorpej_scsipi on 2000-11-20 20:10:28 +0000
 1.2 26-Sep-2021  tsutsui TAB/space cleanup.
 1.1 30-Jun-2019  tsutsui branches: 1.1.10;
Pull OpenBSD/luna88k board.h to define SX9100 board device addresses.

Also replace magic addresses with macro where appropriate.
 1.1.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.10.1 30-Jun-2019  martin file board.h was added on branch phil-wifi on 2020-04-13 08:03:56 +0000
 1.1 11-Jan-2014  tsutsui branches: 1.1.4; 1.1.6; 1.1.10;
Add support to pass boothowto and bootdev info from bootloader to kernel.

Kernel side changes:
- use %d7 (boothowto) and %d6 (bootdev) to pass info and also use
old macro in <sys/reboot.h> as ancient 4.4BSD did for simplicity
- add <machine/bootinfo.h> to define values as API to pass these info
- save boothowto and bootdev in registers right after zero'ing bss
- add MD device_register(9) to check booted_device per passed bootdev info
- merge old bootarg checks in rootconf() and luna68k_init() with
tweaks for backward compatibility
(direct boot a.out kernel from ROM monitor without bootloader still works)
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 11-Jan-2014  tls file bootinfo.h was added on branch tls-maxphys on 2014-08-20 00:03:10 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 11-Jan-2014  yamt file bootinfo.h was added on branch yamt-pagecache on 2014-05-22 11:39:55 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 11-Jan-2014  rmind file bootinfo.h was added on branch rmind-smpnet on 2014-05-18 17:45:15 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file bswap.h was added on branch thorpej_scsipi on 2000-11-20 20:10:28 +0000
 1.18 27-Jan-2023  tsutsui luna68k: Specify proper constraints for bus_space_read region and multi ops.

Sync with next68k.
 1.17 15-Jan-2023  tsutsui TAB/space/indent cleanup.
 1.16 23-Jan-2021  christos Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.
 1.15 02-Apr-2020  msaitoh branches: 1.15.4;
s/impliment/implement/ in comment.
 1.14 23-Sep-2019  skrll Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
 1.13 07-May-2012  tsutsui branches: 1.13.40;
Add dummy bus_dma(9) typedefs (enabled by __HAVE_NO_BUS_DMA) in <sys/bus.h>
for ports which don't bother to have unnecessary bus_dma(9) implementation
to appease MI driver modules that require bus_dma_tag_t.

For amiga, move <m68k/bus_dma.h> inclusion from <machine/pci_machdep.h>
to <machine/bus.h> since amiga will want actual bus_dma(9) in future
for PCI devices.

Fixes builds on sys/modules/if_axe etc on ancient ports.

"Sounds good" from martin@ on port-m68k@.
 1.12 12-Feb-2012  matt Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.11 16-Jul-2011  tsutsui branches: 1.11.2; 1.11.6;
Revive NetBSD/luna68k.

Even after almost a lost decade since NetBSD/luna68k was
switched to using ELF format by default back in 2001,
actually only one fix (bus.h) is required for a GENERIC kernel itself
to get multiuser login: prompt on a real hardware. Hurrahhh!!!

Demonstrated with a working Xorg mono server on the NetBSD booth
at Open Source Conference 2011 Kansai @ Kyoto:
http://www.ospn.jp/osc2011-kyoto/

"Very impressed," commented by Tomoko YOSHIDA,
Program Committee Chair of the Conference,
and some other OMRON guys.

Special Thanks to Tadashi Okamura, for providing
a working SX-9100/DT "LUNA" for this mission.


Changes details:

sys/arch/luna68k/include/bus.h
- handle stride properly even on multi and region ops for MI spc(4)
- also fix stride handling of (currently unused) 2 and 4 byte ops

sys/arch/luna68k/conf/Makefile.luna68k
sys/arch/luna68k/conf/kern.ldscript.head
sys/arch/luna68k/conf/kern.ldscript.tail
- build a faked a.out kernel using elf2aout(8) tool
and a linker script derived from cats and shark
for the LUNA firmware that loads a.out binary directly
via network or from a UNIOS partition on a local disk

sys/arch/luna68k/dev/omrasops.c
sys/arch/luna68k/dev/omron_rfont.h
- use the original OMRON font derived from 4.4BSD-Lite/luna68k
rather than gallant19 which is used on Sun workstations
(XXX omrasops.c should be rewritten to use generic wsfont(4))

distrib/luna68k/*
distrib/utils/sysinst/arch/luna68k/*
etc/etc.luna68k/MAKEDEV.conf
etc/etc.luna68k/Makefile.inc
sys/arch/luna68k/conf/INSTALL
- build a ramdisk based INSTALL kernel with sysinst(8) for luna68k
- also build an installation iso image for luna68k

sys/arch/luna68k/conf/GENERIC
- enable SYSVSHM (and other SYSV*) options for Xorg server

More Xorg changes (which need some more cleanup) and
isiboot.c fixes will come soon.
 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 16-Feb-2006  perry branches: 1.8.68; 1.8.70; 1.8.72;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.7 24-Dec-2005  perry branches: 1.7.2; 1.7.4; 1.7.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 05-Jul-2003  tsutsui branches: 1.5.16;
Add some missing register prefixes.
 1.4 25-Aug-2001  chs branches: 1.4.6; 1.4.22;
add register prefixes. no change in generated .o files.
 1.3 25-Jan-2000  drochner branches: 1.3.6; 1.3.10;
define a "BUS_SPACE_MAP_PREFETCHABLE" flag which basically means that
device accesses are idempotent (but should not be cached by the CPU)
 1.2 07-Jan-2000  nisimura - Make SCSI work; by kludges of machine/bus.h. TEAC streamer tape drive
found to be tweaked. Need extensive verifications.
- Add wsmouse node under ws; not useful this moment.
 1.1 05-Jan-2000  nisimura Introduce NetBSD/luna68k port into CVS repository.
 1.3.10.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.3.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.3.6.1 25-Jan-2000  bouyer file bus.h was added on branch thorpej_scsipi on 2000-11-20 20:10:28 +0000
 1.4.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.22.1 03-Aug-2004  skrll Sync with HEAD
 1.4.6.2 25-Aug-2001  chs add register prefixes. no change in generated .o files.
 1.4.6.1 25-Aug-2001  chs file bus.h was added on branch nathanw_sa on 2001-08-25 23:08:40 +0000
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.7.6.1 22-Apr-2006  simonb Sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.7.2.1 18-Feb-2006  yamt sync with head.
 1.8.72.2 04-May-2009  yamt sync with head.
 1.8.72.1 16-May-2008  yamt sync with head.
 1.8.70.1 18-May-2008  yamt sync with head.
 1.8.68.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.11.6.2 02-Jun-2012  mrg sync to latest -current.
 1.11.6.1 18-Feb-2012  mrg merge to -current.
 1.11.2.2 23-May-2012  yamt sync with head.
 1.11.2.1 17-Apr-2012  yamt sync with head
 1.13.40.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.13.40.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.15.4.1 03-Apr-2021  thorpej Sync with HEAD.
 1.2 05-Jul-2022  tsutsui Remove unnecessary multiple inclusion protections.
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file cdefs.h was added on branch thorpej_scsipi on 2000-11-20 20:10:28 +0000
 1.42 20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.41 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.40 15-Jan-2024  thorpej Switch luna68k over to the common interrupt dispatch code.
 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 15-Jan-2023  tsutsui TAB/space/indent cleanup.
 1.37 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.36 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.35 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.34 16-Jun-2017  jdolecek branches: 1.34.4; 1.34.6;
dumpconf(void) long doesn't exist, remove the prototype

PR kern/39714 by Henning Petersen
 1.33 17-Dec-2016  flxd Fix typo "one the" and architecture where appropriate.
 1.32 19-Oct-2013  christos branches: 1.32.6; 1.32.10;
make cpu_need_resched() macros consistent; __USE flags
 1.31 02-Feb-2012  tsutsui branches: 1.31.6; 1.31.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.30 16-May-2011  tsutsui branches: 1.30.4; 1.30.8;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.
 1.29 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.28 22-Dec-2010  matt branches: 1.28.2; 1.28.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.27 21-Oct-2009  rmind branches: 1.27.4;
Remove uarea swap-out functionality:

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

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

Discussed on <tech-kern>, reviewed by <ad>.
 1.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 27-Feb-2008  xtraeme branches: 1.25.4; 1.25.12; 1.25.18;
Remove CTL_MACHDEP_NAMES, it's not used anywhere.

Ok by martin@.
 1.24 17-Oct-2007  garbled branches: 1.24.12; 1.24.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.23 04-Aug-2007  ad branches: 1.23.2;
Add ci_cpuid where it's missing.
 1.22 21-May-2007  tsutsui branches: 1.22.2; 1.22.4; 1.22.8;
Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
 1.21 21-May-2007  tsutsui Remove an obsolete "extern int want_resched" decl.
 1.20 21-May-2007  tsutsui Remove obsolete decralations of switch_exit() and switch_lwp_ext().
 1.19 21-May-2007  he Remove proc_trampoline() declaration that I added, we use
lwp_trampoline() now instead.
 1.18 20-May-2007  he Patterned after the changes to atari, restore the luna68k port to a
buildable state after the yamt-idlelwp merge.
Struct cpu_info now must contain ci_want_resched, so get rid of the
global want_resched.
The cpu_need_resched macro now takes two arguments.
We need to declare proc_trampoline() from for the new m68k vm_machdep.c.
The fields l_back and l_forw no longer exists in struct lwp, so excise
their definition from genassym.cf.
Remove the use of the apparently now obsolete m68k/proc_subr.s.
 1.17 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.16 04-Mar-2007  christos branches: 1.16.2; 1.16.4; 1.16.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 04-Mar-2007  tsutsui Add MI softintr(9) support for luna68k with common m68k/softintr.c.
Compile test only.
 1.14 16-Feb-2007  ad branches: 1.14.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.13 09-Feb-2007  ad Merge newlock2 to head.
 1.12 24-Dec-2005  perry branches: 1.12.20;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 26-Sep-2004  yamt branches: 1.10.12;
don't expose cpu_info to userland.
 1.9 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.8 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.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 17-Jan-2003  thorpej branches: 1.6.2;
Merge the nathanw_sa branch.
 1.5 30-May-2001  mrg branches: 1.5.8;
use _KERNEL_OPT
 1.4 19-Dec-2000  scw branches: 1.4.2;
Unification of the m68k syscall() function.
 1.3 25-Aug-2000  thorpej branches: 1.3.2;
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.2 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.1 05-Jan-2000  nisimura Introduce NetBSD/luna68k port into CVS repository.
 1.3.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.3.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.2.1 25-Aug-2000  bouyer file cpu.h was added on branch thorpej_scsipi on 2000-11-20 20:10:29 +0000
 1.4.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.8.4 03-Dec-2002  gmcgarry Use cpu_proc_fork().
 1.5.8.3 08-Dec-2001  thorpej Add a cpu_proc_fork(), called from uvm_proc_fork(), which takes care
of machine-dependent handling a fork() time (this is different from
forking the actual context in an LWP world). #define it away on
platforms which do not need it.

Problem noted by Gregory McGarry.
 1.5.8.2 18-Nov-2001  scw MD Scheduler Activation bits for Luna68k.
Compile-tested only.
 1.5.8.1 30-May-2001  scw file cpu.h was added on branch nathanw_sa on 2001-11-18 18:10:19 +0000
 1.6.2.5 19-Oct-2004  skrll Sync with HEAD
 1.6.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.12.4 17-Mar-2008  yamt sync with head.
 1.10.12.3 03-Sep-2007  yamt sync with head.
 1.10.12.2 26-Feb-2007  yamt sync with head.
 1.10.12.1 21-Jun-2006  yamt sync with head.
 1.12.20.1 06-Feb-2007  ad Update m68k pasteware.
 1.14.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.10.2 03-Oct-2007  garbled Sync with HEAD
 1.16.10.1 22-May-2007  matt Update to HEAD.
 1.16.4.1 11-Jul-2007  mjf Sync with head.
 1.16.2.2 20-Aug-2007  ad Sync with HEAD.
 1.16.2.1 27-May-2007  ad Sync with head.
 1.22.8.1 04-Aug-2007  jmcneill Sync with HEAD.
 1.22.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.22.2.1 07-Aug-2007  matt Sync with HEAD.
 1.23.2.2 23-Mar-2008  matt sync with HEAD
 1.23.2.1 06-Nov-2007  matt sync with HEAD
 1.24.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.24.12.1 24-Mar-2008  keiichi 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.2 11-Mar-2010  yamt sync with head
 1.25.4.1 04-May-2009  yamt sync with head.
 1.27.4.2 31-May-2011  rmind sync with head
 1.27.4.1 05-Mar-2011  rmind sync with head
 1.28.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.28.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.30.8.1 18-Feb-2012  mrg merge to -current.
 1.30.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.30.4.1 17-Apr-2012  yamt sync with head
 1.31.10.1 18-May-2014  rmind sync with head
 1.31.6.2 03-Dec-2017  jdolecek update from HEAD
 1.31.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.32.10.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.32.6.2 28-Aug-2017  skrll Sync with HEAD
 1.32.6.1 05-Feb-2017  skrll Sync with HEAD
 1.34.6.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.34.6.1 10-Jun-2019  christos Sync with HEAD
 1.34.4.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 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.3 11-Apr-2011  mrg branches: 1.3.14;
obsolete DB_AOUT_SYMBOLS. however, we need to leave most of the code
in db_sym.[ch] as it is used by the elf version of crash(8).

i will be cleaning up the db_sym.c code in a follow up commit to avoid
having dead code compiled.
 1.2 24-Dec-2001  chs branches: 1.2.144; 1.2.150;
use ELF instead of a.out symbols now.
 1.1 05-Jan-2000  nisimura branches: 1.1.6; 1.1.10; 1.1.14;
Introduce NetBSD/luna68k port into CVS repository.
 1.1.14.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.10.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 05-Jan-2000  bouyer file db_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:10:29 +0000
 1.2.150.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.144.1 21-Apr-2011  rmind sync with head
 1.3.14.1 03-Dec-2017  jdolecek update from HEAD
 1.3 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.2 28-Jan-2000  nisimura branches: 1.2.6;
Nuke isbad(), and fix typos.
 1.1 05-Jan-2000  nisimura Introduce NetBSD/luna68k port into CVS repository.
 1.2.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.2.6.1 28-Jan-2000  bouyer file disklabel.h was added on branch thorpej_scsipi on 2000-11-20 20:10:29 +0000
 1.2 05-Jul-2022  tsutsui Remove unnecessary multiple inclusion protections.
 1.1 24-Dec-2001  chs branches: 1.1.2; 1.1.4;
needed for ELF, just include the m68k common header.
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 24-Dec-2001  thorpej file elf_machdep.h was added on branch kqueue on 2002-01-10 19:45:18 +0000
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 24-Dec-2001  nathanw file elf_machdep.h was added on branch nathanw_sa on 2002-01-08 00:25:51 +0000
 1.3 17-Mar-2000  mycroft branches: 1.3.6;
In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.2 16-Mar-2000  mycroft Foolish consistency. Mainly, always use underscores and sys/endian.h.
 1.1 05-Jan-2000  nisimura Introduce NetBSD/luna68k port into CVS repository.
 1.3.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.3.6.1 17-Mar-2000  bouyer file endian.h was added on branch thorpej_scsipi on 2000-11-20 20:10:29 +0000
 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:10:29 +0000
 1.1 27-Dec-2023  thorpej Re-factor the 680x0 Function Code definitions into their own
separate file (as was done on the sun2/sun3 ports ages ago)
and switch everyone to the common header.
 1.1 24-Dec-2015  christos branches: 1.1.2; 1.1.18;
fenv for m68k
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 24-Dec-2015  jdolecek file fenv.h was added on branch tls-maxphys on 2017-12-03 11:36:23 +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:37 +0000
 1.2 19-Apr-2003  christos PR/3012: Greg A. Woods: Write all float.h files [except the vax of course]
in terms of float_ieee.h
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file float.h was added on branch thorpej_scsipi on 2000-11-20 20:10:29 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file frame.h was added on branch thorpej_scsipi on 2000-11-20 20:10:29 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file ieee.h was added on branch thorpej_scsipi on 2000-11-20 20:10:30 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file ieeefp.h was added on branch thorpej_scsipi on 2000-11-20 20:10:30 +0000
 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:39 +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:55 +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:12 +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:55 +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: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_limits.h was added on branch thorpej_scsipi on 2001-04-21 17:53:55 +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:55 +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:55 +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:10:30 +0000
 1.19 19-Jan-2024  thorpej Add _KERNEL guards around most of the definitions in these files.
 1.18 15-Jan-2024  thorpej G/C __HAVE_LEGACY_INTRCNT from luna68k.
 1.17 15-Jan-2024  thorpej Switch luna68k over to the common interrupt dispatch code.
 1.16 11-Jul-2023  riastradh luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
 1.15 22-Mar-2014  tsutsui branches: 1.15.60;
Remove obsolete ssir stuff which was used for pre-5.0 softintr(9).
 1.14 26-Nov-2011  tsutsui branches: 1.14.8; 1.14.12;
Reorganize IPL for devices.
 1.13 10-Jul-2008  tsutsui branches: 1.13.28;
Cosmetic changes to sync with other m68k ports:
- rename ipl2spl_table[] to ipl2psl_table[] and make it uint16_t
- rename _spl member in ipl_cookie_t to _psl
- sort some splbio entries
 1.12 10-Jul-2008  tsutsui Remove __P().
 1.11 28-Apr-2008  martin branches: 1.11.2; 1.11.4; 1.11.6;
Remove clause 3 and 4 from TNF licenses
 1.10 03-Dec-2007  ad branches: 1.10.14; 1.10.16; 1.10.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.9 11-Mar-2007  thorpej branches: 1.9.16; 1.9.18; 1.9.24;
- Shrink ipl_cookie_t from 32-bits to 16-bits (large enough to hold
an SR value or an IPL_* constant).
- Take advange of the smaller ipl_cookie_t to shrink kmutex_t from
16 bytes to 8 bytes by overlapping storage where possible.
- Implement a RAS-based _lock_cas() for mc68010 systems (Sun2). See
sun68k/sun68k/isr.c.

Tested on various m68k platforms, but NOT Sun2. In any case, at least
Sun2 compiles now.
 1.8 04-Mar-2007  tsutsui branches: 1.8.2;
Hide #include <m68k/softintr.h> inside #ifdef _KERNEL in <machine/intr.h>
to avoid exporting unnecessary files to userland.
Should fix build.sh failure, which was pointed out by isaki@.

XXX: which userland program would require contents of <machine/intr.h>?
 1.7 04-Mar-2007  tsutsui Add MI softintr(9) support for luna68k with common m68k/softintr.c.
Compile test only.
 1.6 16-Feb-2007  ad branches: 1.6.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.5 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.4 05-May-2002  jdolecek branches: 1.4.26; 1.4.56; 1.4.58;
Put the contents inside #ifdef _KERNEL, similarily to mac68k one,
so that the innards are not exposed to userland.
 1.3 13-Apr-2001  thorpej branches: 1.3.2; 1.3.8;
Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.2 22-Aug-2000  thorpej branches: 1.2.2; 1.2.4;
Add spllock(). See spl(9) for details.
 1.1 05-Jan-2000  nisimura Introduce NetBSD/luna68k port into CVS repository.
 1.2.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.3 21-Apr-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 intr.h was added on branch thorpej_scsipi on 2000-11-20 20:10:30 +0000
 1.3.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.3.8.1 13-Apr-2001  nathanw file intr.h was added on branch nathanw_sa on 2002-06-20 03:39:18 +0000
 1.3.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.58.1 22-Sep-2006  yamt implement splraiseipl for luna68k.
 1.4.56.1 12-Jan-2007  ad Sync with head.
 1.4.26.4 07-Dec-2007  yamt sync with head
 1.4.26.3 03-Sep-2007  yamt sync with head.
 1.4.26.2 26-Feb-2007  yamt sync with head.
 1.4.26.1 30-Dec-2006  yamt sync with head.
 1.6.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.2.2 03-Dec-2007  ad Sync with HEAD.
 1.8.2.1 13-Mar-2007  ad Sync with head.
 1.9.24.1 08-Dec-2007  mjf Sync with HEAD.
 1.9.18.1 09-Jan-2008  matt sync with HEAD
 1.9.16.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.10.18.2 04-May-2009  yamt sync with head.
 1.10.18.1 16-May-2008  yamt sync with head.
 1.10.16.1 18-May-2008  yamt sync with head.
 1.10.14.2 28-Sep-2008  mjf Sync with HEAD.
 1.10.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.6.1 19-Oct-2008  haad Sync with HEAD.
 1.11.4.1 18-Jul-2008  simonb Sync with head.
 1.11.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.13.28.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.28.1 17-Apr-2012  yamt sync with head
 1.14.12.1 18-May-2014  rmind sync with head
 1.14.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.60.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.
 1.2 05-Jul-2022  tsutsui Remove unnecessary multiple inclusion protections.
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file kcore.h was added on branch thorpej_scsipi on 2000-11-20 20:10:30 +0000
 1.2 15-Jan-2023  tsutsui TAB/space/indent cleanup.
 1.1 09-Mar-2017  tsutsui branches: 1.1.2; 1.1.6; 1.1.14; 1.1.18;
Add a driver for LUNA's front panel LCD. Ported from OpenBSD/luna88k.

Reviewed by enami@. Tested by Naruaki Etomi and me.

A 68k LUNA with this driver will be demonstrated at AsiaBSDCon NetBSD booth
by Etomi-san, with LUNA-88K2 running OpenBSD/luna88k by Kenji Aoyama.
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 09-Mar-2017  jdolecek file lcd.h was added on branch tls-maxphys on 2017-12-03 11:36:23 +0000
 1.1.14.2 28-Aug-2017  skrll Sync with HEAD
 1.1.14.1 09-Mar-2017  skrll file lcd.h was added on branch nick-nhusb on 2017-08-28 17:51:43 +0000
 1.1.6.2 21-Apr-2017  bouyer Sync with HEAD
 1.1.6.1 09-Mar-2017  bouyer file lcd.h was added on branch bouyer-socketcan on 2017-04-21 16:53:30 +0000
 1.1.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.2.1 09-Mar-2017  pgoyette file lcd.h was added on branch pgoyette-localcount on 2017-03-20 06:57:16 +0000
 1.2 28-Mar-2012  christos - Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
 1.1 05-Jan-2000  nisimura branches: 1.1.6; 1.1.170; 1.1.174;
Introduce NetBSD/luna68k port into CVS repository.
 1.1.174.1 05-Apr-2012  mrg sync to latest -current.
 1.1.170.1 17-Apr-2012  yamt sync with head
 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 05-Jan-2000  bouyer file limits.h was added on branch thorpej_scsipi on 2000-11-20 20:10:30 +0000
 1.3 06-Aug-2014  joerg Consistently define WARN in a way that passes format string checks, i.e.
always uses the same number of arguments as given in the format string.
 1.2 17-Jan-2013  tsutsui branches: 1.2.2; 1.2.6; 1.2.14;
Make loadfile() accept OMAGIC a.out binary.
LUNA's ROM monitor assumes it.
 1.1 05-Jan-2013  tsutsui First cut at NetBSD/luna68k native bootloader.

Based on 4.4BSD-Lite2/luna68k "Stinger" loader revision "Phase-31"
http://svnweb.freebsd.org/csrg/sys/luna68k/stand/
and MI libsa glue stuff are taken from hp300 etc.

Tested on LUNA-I and old DK315C SCSI disk drive.

LUNA's monitor PROM can load only an a.out binary in 4.3BSD FFS partition
(i.e. created by "newfs -O 0") on disks with OMRON's UniOS disklabel,
but now we can load an ELF kernel in root partition via this bootloader.
(See luna68k/disksubr.c for details of UniOS label)

TODO:
- LUNA-II support (check 68040 to adjust cpuspeed for DELAY())
- secondary SCSI support for LUNA-II
- netboot via le(4) (should be trivial)
- support boot options on bootloader prompt
- bootinfo (passing info about booted device and kernel symbols)
- support "press return to boot now, any other key for boot menu" method
like x86 bootloader (needs cnscan() like functions)
- tapeboot (anyone wants it?)
 1.2.14.1 10-Aug-2014  tls Rebase.
 1.2.6.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.2 25-Feb-2013  tls resync with head
 1.2.6.1 17-Jan-2013  tls file loadfile_machdep.h was added on branch tls-maxphys on 2013-02-25 00:28:47 +0000
 1.2.2.2 23-Jan-2013  yamt sync with head
 1.2.2.1 17-Jan-2013  yamt file loadfile_machdep.h was added on branch yamt-pagecache on 2013-01-23 00:05:52 +0000
 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:10:30 +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:47 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file math.h was added on branch thorpej_scsipi on 2000-11-20 20:10:31 +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.2 09-Feb-2007  ad branches: 1.2.4;
Merge newlock2 to head.
 1.1 22-Dec-2006  ad branches: 1.1.2;
file mutex.h was initially added on branch newlock2.
 1.1.2.1 22-Dec-2006  ad Pull in CPU specific stubs.
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file mutex.h was added on branch yamt-lazymbuf on 2007-02-26 09:07:10 +0000
 1.15 15-Jan-2023  tsutsui TAB/space/indent cleanup.
 1.14 28-Dec-2019  isaki Remove a pointless MSGBUFSIZE definition.
The same operation is already done in <m68k/param.h>.
luna68k is not imported yet in 1997 but see also:
http://mail-index.netbsd.org/source-changes/1997/09/20/0021.html
 1.13 10-Feb-2012  para branches: 1.13.48;
proper sizing of kmem_arena on different ports

PR port-i386/45946: Kernel locks up in VMEM system
 1.12 05-Nov-2011  tsutsui branches: 1.12.4;
Sync _delay() with hp300:
- unsigned -> u_int
- use ENTRY_NOPROFILE()
- align main delay loop with 8 byte cacheline boundary
 1.11 08-Feb-2011  rmind branches: 1.11.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.10 11-Dec-2009  tsutsui branches: 1.10.4; 1.10.6; 1.10.8;
Refactoring MD segment related definitions on m68k ports:
- move macro SEGSHIFT, NBSEG, and SEGOFSET from <machine/param.h>
to <m68k/pmap_motorola.h> where they should belong
- also simplify NBSEG macro for both 020/030 and 040/060 cases
- also move m68k_trunc_seg(), m68k_round_seg(), and m68k_seg_offset()
(that use SEGOFSET) from <m68k/param.h> to <m68k/pmap_motorola.h>
- add comments about each segment size value used on pmap_motorola
implementation
- add TIA_SIZE, TIA_SHIFT, TIB_SIZE, and TIB_SHIFT macro which can be
used for ste/pte index sizes
- use proper vaddr_t cast instead of unsigned for SEGOFSET/PGOFSET macro

Tested on atari, hp300, and news68k.
 1.9 09-Dec-2009  tsutsui Fix wrong NBSEG values for all hp300 pmap derived m68k ports.
They were incorrect since 1997 on amiga and atari, and since 2002
on other ports, but fortunately they don't look so fatal.

Anyway, these values will be moved into <m68k/pmap_motorola.h> soon
since they are quite pmap implementation dependent.
 1.8 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 11-Dec-2005  christos branches: 1.7.78; 1.7.86; 1.7.92;
merge ktrace-lwp.
 1.6 24-Oct-2004  skrll s/Id/NetBSD/
 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 03-Nov-2002  chs branches: 1.4.6;
merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.3 30-Nov-2000  nisimura branches: 1.3.8;
Reduce UPAGES from 3 to 2.
 1.2 11-Feb-2000  thorpej branches: 1.2.6;
Update for the NKMEMPAGES changes.
 1.1 05-Jan-2000  nisimura Introduce NetBSD/luna68k port into CVS repository.
 1.2.6.3 08-Dec-2000  bouyer Sync with HEAD.
 1.2.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.2.6.1 11-Feb-2000  bouyer file param.h was added on branch thorpej_scsipi on 2000-11-20 20:10:31 +0000
 1.3.8.1 11-Nov-2002  nathanw Catch up to -current
 1.4.6.4 02-Nov-2004  skrll Sync with HEAD.
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.78.2 11-Mar-2010  yamt sync with head
 1.7.78.1 04-May-2009  yamt sync with head.
 1.10.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.10.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.4.1 05-Mar-2011  rmind sync with head
 1.11.4.2 17-Apr-2012  yamt sync with head
 1.11.4.1 10-Nov-2011  yamt sync with head
 1.12.4.1 18-Feb-2012  mrg merge to -current.
 1.13.48.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file pcb.h was added on branch thorpej_scsipi on 2000-11-20 20:10:31 +0000
 1.11 29-Dec-2023  tsutsui Use proper macro for the 030/040 TT registers to map LUNA's I/O spaces.

No binary change.
 1.10 03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.9 22-Sep-2002  chs it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.
 1.8 22-Sep-2002  chs add pmap_remove_all() hook (empty on most platforms so far).
 1.7 10-Sep-2001  chris branches: 1.7.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.6 26-May-2001  chs branches: 1.6.2; 1.6.4;
replace vm_page_t with struct vm_page *.
 1.5 26-May-2001  chs replace {simple_,}lock{_data,}_t with struct {simple,}lock {,*}.
 1.4 22-Apr-2001  thorpej Undo a misguided previous change to the pmap_update() API.
 1.3 22-Apr-2001  thorpej Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.
 1.2 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.1 05-Jan-2000  nisimura branches: 1.1.6; 1.1.8;
Introduce NetBSD/luna68k port into CVS repository.
 1.1.8.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.6.3 23-Apr-2001  bouyer Sync with HEAD.
 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 05-Jan-2000  bouyer file pmap.h was added on branch thorpej_scsipi on 2000-11-20 20:10:31 +0000
 1.6.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.6.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.7.4.6 11-Nov-2002  nathanw Catch up to -current
 1.7.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.7.4.4 02-Jul-2002  nathanw Adjust whitespace so that this matches the trunk.
 1.7.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.7.4.2 18-Nov-2001  scw MD Scheduler Activation bits for Luna68k.
Compile-tested only.
 1.7.4.1 10-Sep-2001  scw file pmap.h was added on branch nathanw_sa on 2001-11-18 18:10:19 +0000
 1.2 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.1 07-Aug-2002  briggs branches: 1.1.2; 1.1.4; 1.1.6; 1.1.202; 1.1.204;
Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.1.204.1 10-Jun-2019  christos Sync with HEAD
 1.1.202.1 28-Jul-2018  pgoyette Sync with HEAD
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 07-Aug-2002  jdolecek file pmc.h was added on branch kqueue on 2002-09-06 08:36:43 +0000
 1.1.4.2 31-Aug-2002  gehenna catch up with -current.
 1.1.4.1 07-Aug-2002  gehenna file pmc.h was added on branch gehenna-devsw on 2002-08-31 13:45:00 +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:26 +0000
 1.2 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.1 05-Jan-2000  nisimura branches: 1.1.6; 1.1.10; 1.1.14; 1.1.22;
Introduce NetBSD/luna68k port into CVS repository.
 1.1.22.1 16-Jul-2002  gehenna catch up with -current.
 1.1.14.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.14.1 18-Nov-2001  scw MD Scheduler Activation bits for Luna68k.
Compile-tested only.
 1.1.10.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 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 05-Jan-2000  bouyer file proc.h was added on branch thorpej_scsipi on 2000-11-20 20:10:31 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file profile.h was added on branch thorpej_scsipi on 2000-11-20 20:10:31 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file psl.h was added on branch thorpej_scsipi on 2000-11-20 20:10:32 +0000
 1.2 14-Oct-2002  chs merge pte.h for m68k w/ motorola or compatible MMU
(only 4k-page platforms so far).
 1.1 05-Jan-2000  nisimura branches: 1.1.6; 1.1.14;
Introduce NetBSD/luna68k port into CVS repository.
 1.1.14.1 18-Oct-2002  nathanw Catch up to -current.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 05-Jan-2000  bouyer file pte.h was added on branch thorpej_scsipi on 2000-11-20 20:10:32 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file ptrace.h was added on branch thorpej_scsipi on 2000-11-20 20:10:32 +0000
 1.2 05-Jul-2022  tsutsui Remove unnecessary multiple inclusion protections.
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file reg.h was added on branch thorpej_scsipi on 2000-11-20 20:10:32 +0000
 1.2 09-Feb-2007  ad branches: 1.2.4;
Merge newlock2 to head.
 1.1 22-Dec-2006  ad branches: 1.1.2;
file rwlock.h was initially added on branch newlock2.
 1.1.2.1 22-Dec-2006  ad Pull in CPU specific stubs.
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file rwlock.h was added on branch yamt-lazymbuf on 2007-02-26 09:07:10 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file setjmp.h was added on branch thorpej_scsipi on 2000-11-20 20:10:32 +0000
 1.2 27-Oct-2021  thorpej Remove a superflouous comment.
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file signal.h was added on branch thorpej_scsipi on 2000-11-20 20:10:32 +0000
 1.2 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file stdarg.h was added on branch thorpej_scsipi on 2000-11-20 20:10:32 +0000
 1.2 11-Dec-2005  christos branches: 1.2.18;
merge ktrace-lwp.
 1.1 12-Jul-2005  he branches: 1.1.6;
This port also needs it's own sunos_machdep.h.
 1.1.6.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.6.1 12-Jul-2005  skrll file sunos_machdep.h was added on branch ktrace-lwp on 2005-11-10 13:57:09 +0000
 1.2.18.2 21-Jun-2006  yamt sync with head.
 1.2.18.1 11-Dec-2005  yamt file sunos_machdep.h was added on branch yamt-lazymbuf on 2006-06-21 14:52:58 +0000
 1.2 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.1 12-Apr-2002  bjh21 branches: 1.1.2; 1.1.8; 1.1.204; 1.1.206;
Add <luna68k/svr4_machdep.h>, since that seems to be necessary to get
things to compile.
 1.1.206.1 10-Jun-2019  christos Sync with HEAD
 1.1.204.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 12-Apr-2002  jdolecek file svr4_machdep.h was added on branch kqueue on 2002-06-23 17:37:38 +0000
 1.1.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.1 12-Apr-2002  nathanw file svr4_machdep.h was added on branch nathanw_sa on 2002-04-17 00:03:28 +0000
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file trap.h was added on branch thorpej_scsipi on 2000-11-20 20:10:33 +0000
 1.10 15-Jan-2024  thorpej G/C __HAVE_LEGACY_INTRCNT from luna68k.
 1.9 05-Jul-2022  tsutsui Remove unnecessary multiple inclusion protections.
 1.8 01-Apr-2021  simonb Define __HAVE_LEGACY_INTRCNT to indicate this port uses legacy intrcnt
interrupt accounting.
 1.7 20-Jan-2008  joerg branches: 1.7.110; 1.7.112;
Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
 1.6 17-Oct-2007  garbled branches: 1.6.2; 1.6.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.5 14-Jul-2007  ad branches: 1.5.10;
Generic soft interrupts are mandatory.
 1.4 04-Mar-2007  tsutsui branches: 1.4.2; 1.4.10;
Add MI softintr(9) support for luna68k with common m68k/softintr.c.
Compile test only.
 1.3 14-Sep-2006  gdamore branches: 1.3.6;
Update luna68k to MI todr and timecounters.
 1.2 28-Feb-2002  simonb branches: 1.2.32; 1.2.62;
Use "#define<tab>".
 1.1 05-Jan-2000  nisimura branches: 1.1.6; 1.1.10; 1.1.14;
Introduce NetBSD/luna68k port into CVS repository.
 1.1.14.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.10.1 16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 05-Jan-2000  bouyer file types.h was added on branch thorpej_scsipi on 2000-11-20 20:10:33 +0000
 1.2.62.1 18-Nov-2006  ad Sync with head.
 1.2.32.2 21-Jan-2008  yamt sync with head
 1.2.32.1 30-Dec-2006  yamt sync with head.
 1.3.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.4.10.1 03-Oct-2007  garbled Sync with HEAD
 1.4.2.1 15-Jul-2007  ad Sync with head.
 1.5.10.2 23-Mar-2008  matt sync with HEAD
 1.5.10.1 06-Nov-2007  matt sync with HEAD
 1.6.8.1 23-Jan-2008  bouyer Sync with HEAD.
 1.6.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.7.112.1 03-Apr-2021  thorpej Sync with HEAD.
 1.7.110.1 03-Apr-2021  thorpej Sync with HEAD.
 1.2 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.1 05-Jan-2000  nisimura branches: 1.1.6;
Introduce NetBSD/luna68k port into CVS repository.
 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 05-Jan-2000  bouyer file varargs.h was added on branch thorpej_scsipi on 2000-11-20 20:10:33 +0000
 1.3 15-Jan-2024  thorpej No need for our own spurious interrupt handler now that m68k_intr.c
handles them for us.
 1.2 15-Jan-2024  thorpej Switch luna68k over to the common interrupt dispatch code.
 1.1 14-Jan-2024  thorpej Switch luna68k over to the common m68k vector table.
 1.26 08-Feb-2025  tsutsui Bump DFLSSIZ from 512KB to 2MB on all hp300 pmap m68k ports.

Some modern applications could require 512KB buffer on stack and
no particular comment on port-m68k@:
https://mail-index.netbsd.org/port-m68k/2025/02/02/msg000893.html
 1.25 14-May-2024  andvar branches: 1.25.2;
fix recently committed typos by msaitoh in few more places, as well as few more.
mainly s/contigous/contiguous/ and s/miliseconds/milliseconds/ in comments.
 1.24 15-Jan-2023  tsutsui TAB/space/indent cleanup.
 1.23 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.22 28-Jun-2019  tsutsui branches: 1.22.2; 1.22.4;
Fix lingering page size comments.

Pointed out by christos@ on port-m68k@:
http://mail-index.netbsd.org/port-m68k/2019/06/06/msg000726.html

XXX: we also need MAX_PAGE_SIZE in somewhere for newer jemalloc?
 1.21 02-Feb-2017  rin branches: 1.21.14;
PR port-mac68k/51923
Bump default MAXTSIZ to 32MB for m68k ports, which allos us to use GCC 5.4 on
GENERIC kernels.
Ok jklos
 1.20 02-Feb-2017  rin PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos
 1.19 26-Jul-2014  tsutsui branches: 1.19.4; 1.19.8; 1.19.12;
Sync VM_MAXUSER_ADDRESS and VM_MAX_ADDRESS with other hp300 derived ports.

There is no particular reason to have different values among m68k ports.
Briefly checked on LUNA-II.
 1.18 08-Feb-2011  rmind branches: 1.18.14; 1.18.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.17 06-Nov-2010  uebayasi branches: 1.17.2; 1.17.4;
Remove incomplete, never worked dynamic run-time memory registration
(uvm_page_physload(9)). This functionality will be re-added later.
 1.16 08-Feb-2010  joerg branches: 1.16.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.15 11-Dec-2009  tsutsui branches: 1.15.2;
Define SYSMAP_VA in <m68k/pmap_motorola.h>
where the Sysmap pointer is declared.
 1.14 08-Dec-2009  tsutsui 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.13 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.12 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.11 11-Dec-2005  christos branches: 1.11.78; 1.11.86; 1.11.92;
merge ktrace-lwp.
 1.10 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.9 07-Aug-2003  agc branches: 1.9.8; 1.9.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.8 02-Apr-2003  thorpej branches: 1.8.2;
Use PAGE_SIZE rather than NBPG.
 1.7 02-Apr-2003  thorpej Make PAGE_SIZE, PAGE_SHIFT, and PAGE_MASK compile-time constants on
luna68k.
 1.6 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.5 15-Nov-2001  soren MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
 1.4 01-May-2001  thorpej branches: 1.4.2; 1.4.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.3 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.2 11-Feb-2000  thorpej branches: 1.2.6; 1.2.8;
Update for the NKMEMPAGES changes.
 1.1 05-Jan-2000  nisimura Introduce NetBSD/luna68k port into CVS repository.
 1.2.8.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.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.2.6.1 11-Feb-2000  bouyer file vmparam.h was added on branch thorpej_scsipi on 2000-11-20 20:10:33 +0000
 1.4.8.3 11-Dec-2002  thorpej Sync with HEAD.
 1.4.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.8.1 01-May-2001  nathanw file vmparam.h was added on branch nathanw_sa on 2002-01-08 00:25:51 +0000
 1.4.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.4 01-Apr-2005  skrll Sync with HEAD.
 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.9.10.2 19-Mar-2005  yamt move Sysmap to avoid TTR ranges.
 1.9.10.1 24-Feb-2005  yamt - remove stale(?) references to lkptpa in #if defined(M68040) block.
- change kernel va layout, following mac68k.
 1.9.8.1 29-Apr-2005  kent sync with -current
 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.3 11-Mar-2010  yamt sync with head
 1.11.78.2 16-Sep-2009  yamt sync with head
 1.11.78.1 04-May-2009  yamt sync with head.
 1.15.2.2 30-Apr-2010  uebayasi Sync with HEAD.
 1.15.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.16.2.1 05-Mar-2011  rmind sync with head
 1.17.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.17.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.18.28.1 10-Aug-2014  tls Rebase.
 1.18.14.2 03-Dec-2017  jdolecek update from HEAD
 1.18.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.19.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.19.4.1 05-Feb-2017  skrll Sync with HEAD
 1.21.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.22.4.1 29-Feb-2020  ad Sync with head.
 1.22.2.1 10-Feb-2020  martin Pull up following revision(s) (requested by tsutsui in ticket #682):

sys/arch/next68k/include/vmparam.h: revision 1.27
sys/arch/mac68k/include/vmparam.h: revision 1.46
sys/arch/sun3/include/vmparam.h: revision 1.38
sys/arch/m68k/include/vmparam.h: revision 1.1
sys/arch/hp300/include/vmparam.h: revision 1.41
sys/arch/m68k/include/Makefile: revision 1.32
sys/arch/amiga/include/vmparam.h: revision 1.48
distrib/sets/lists/comp/ad.m68k: revision 1.63
sys/arch/x68k/include/vmparam.h: revision 1.40
sys/arch/mvme68k/include/vmparam.h: revision 1.38
sys/arch/luna68k/include/vmparam.h: revision 1.23
sys/arch/news68k/include/vmparam.h: revision 1.23
sys/arch/atari/include/vmparam.h: revision 1.34
sys/arch/cesfic/include/vmparam.h: revision 1.19

Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).

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

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.

For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case.

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

Should be pulled up to netbsd-9.
 1.25.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-May-2004  kleink branches: 1.1.2;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 08-May-2004  skrll file wchar_limits.h was added on branch ktrace-lwp on 2004-08-03 10:36:30 +0000
 1.1 03-Dec-2016  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10; 1.1.22;
Preliminary support for LUNA's HD647180X I/O processor (a.k.a. XP).

Demonstrated as "PSG tunes / PCM wav player on LUNA"
(using Z80 PSG/PCM drivers ported from NEC PC-6001)
at OSC2016 Kyoto and OSC2016 Hiroshima:
http://mail-index.netbsd.org/netbsd-advocacy/2016/08/01/msg000712.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/29/msg000724.html
 1.1.22.2 03-Dec-2017  jdolecek update from HEAD
 1.1.22.1 03-Dec-2016  jdolecek file xpio.h was added on branch tls-maxphys on 2017-12-03 11:36:23 +0000
 1.1.10.2 18-Jan-2017  skrll Sync with netbsd-5
 1.1.10.1 03-Dec-2016  skrll file xpio.h was added on branch netbsd-7-nhusb on 2017-01-18 08:46:25 +0000
 1.1.6.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.6.1 03-Dec-2016  pgoyette file xpio.h was added on branch pgoyette-localcount on 2017-01-07 08:56:20 +0000
 1.1.4.2 06-Dec-2016  snj Pull up following revision(s) (requested by tsutsui in ticket #1283):
distrib/sets/lists/comp/md.luna68k: revision 1.21
etc/etc.luna68k/MAKEDEV.conf: revision 1.9
sys/arch/luna68k/conf/GENERIC: revision 1.120
sys/arch/luna68k/conf/files.luna68k: revision 1.25
sys/arch/luna68k/conf/majors.luna68k: revision 1.21
sys/arch/luna68k/dev/xp.c: revision 1.1
sys/arch/luna68k/include/Makefile: revision 1.19
sys/arch/luna68k/include/xpio.h: revision 1.1
sys/arch/luna68k/luna68k/mainbus.c: revision 1.14
Preliminary support for LUNA's HD647180X I/O processor (a.k.a. XP).
Demonstrated as "PSG tunes / PCM wav player on LUNA"
(using Z80 PSG/PCM drivers ported from NEC PC-6001)
at OSC2016 Kyoto and OSC2016 Hiroshima:
http://mail-index.netbsd.org/netbsd-advocacy/2016/08/01/msg000712.html
http://mail-index.netbsd.org/netbsd-advocacy/2016/11/29/msg000724.html
 1.1.4.1 03-Dec-2016  snj file xpio.h was added on branch netbsd-7 on 2016-12-06 06:50:23 +0000
 1.1.2.2 05-Dec-2016  skrll Sync with HEAD
 1.1.2.1 03-Dec-2016  skrll file xpio.h was added on branch nick-nhusb on 2016-12-05 10:54:54 +0000

RSS XML Feed