Home | History | Annotate | only in /src/sys/arch/ofppc
History log of /src/sys/arch/ofppc
RevisionDateAuthorComments
 1.7 04-Apr-2011  dyoung Fix target 'tags'.
 1.6 06-Jan-2003  lukem branches: 1.6.130; 1.6.136;
Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

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

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

Per lengthy discussion with Andrew Brown.
 1.5 12-Jun-1998  cgd branches: 1.5.32;
Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.4 11-Oct-1997  mycroft Nuke NOOBJ.
 1.3 11-Oct-1997  mycroft Update all the tags goo, and use bsd.subdir.mk.
 1.2 07-May-1997  mycroft branches: 1.2.4;
Don't use _SUBDIRUSE outside of bsd.subdir.mk.
 1.1 30-Sep-1996  ws PowerPC port
 1.2.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.32.1 07-Jan-2003  thorpej Sync with HEAD.
 1.6.136.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.130.1 21-Apr-2011  rmind sync with head
 1.2 06-Jan-2003  lukem Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

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

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

Per lengthy discussion with Andrew Brown.
 1.1 28-May-1998  sakamoto branches: 1.1.32;
Keep compile directory.
 1.1.32.1 07-Jan-2003  thorpej Sync with HEAD.
 1.1 06-Jan-2003  lukem branches: 1.1.2;
Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

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

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

Per lengthy discussion with Andrew Brown.
 1.1.2.2 07-Jan-2003  thorpej Sync with HEAD.
 1.1.2.1 06-Jan-2003  thorpej file Makefile was added on branch nathanw_sa on 2003-01-07 21:12:27 +0000
 1.31 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.30 10-Jul-2007  tsutsui branches: 1.30.8; 1.30.10; 1.30.12; 1.30.14;
Fix more pesudo.
 1.29 27-Sep-2006  manu branches: 1.29.8; 1.29.10; 1.29.16;
- Document COMPAT_15 as doing nothing
- Add COMPAT_15 to all the kernel that had COMPAT_14, for the sake of coherency
- Remove the only occurences of #ifdef COMPAT_15 in the tree: for the ARM
ports, COMPAT_15 was always used in conjunction with EXEC_AOUT. Only EXEC_AOUT
matters here.

This address kern/18407
 1.28 26-Aug-2006  christos branches: 1.28.2; 1.28.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.27 28-Mar-2006  pavel Add stf to all kernel configs which have INET6 and gif, except the INSTALL
ones and those for specific machines of developers. PR 32304.

OK'ed by rpaulo.

N.B. stf is a cloning device, so it still must be enabled by
"ifconfig stf0 create".
 1.26 05-Feb-2006  cube branches: 1.26.2; 1.26.4; 1.26.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.25 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.24 07-Dec-2005  tsutsui branches: 1.24.2; 1.24.4; 1.24.6;
Adjust comments for options FFS_NO_SNAPSHOT.

XXX: This option should be mentioned in options(4).
 1.23 19-Aug-2005  christos Enable ptyfs by default on the non-install and non small/tiny/ramdisk kernels
 1.22 19-Aug-2005  christos 64 bit inode changes.
 1.21 31-Jul-2005  yamt revert "defflag VMSWAP" changes for now.
there seems to be far more people who don't want to edit
their kernel config files than i thought.
 1.20 30-Jul-2005  yamt add "options VMSWAP" to non INSTALL kernels.
 1.19 07-Jul-2005  tron Add (commented out) IPSEC_NAT_T option.
 1.18 25-Feb-2005  simonb branches: 1.18.2; 1.18.4;
Add COMPAT_20 (and COMPAT_16 in some cases) to kernel config files
that didn't have those options but had other earlier compat options.
 1.17 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.16 11-Feb-2005  dsl Add 'option FFS_SNAPSHOT' to most of the config files.
Commented out for kernels that appear to hace space constraints.
 1.15 31-Jan-2005  hannken Add file system snapshots to kernel configs.

- Ffs internal snapshots get compiled in unconditionally.

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

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
 1.14 17-Jan-2005  cube branches: 1.14.2;
Add tap(4) support to a random^Wcarefully chosen set of kernel configs.
All those kernels have a line for both tun and bridge, and if either is
commented out, tap is commented out also. With the exception of i386's
GENERIC_TINY.

XXX: we _need_ some way of making this more simple.
 1.13 10-Nov-2004  christos branches: 1.13.4;
Add COMPAT_BSDPTY to the rest of the config files.
 1.12 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.11 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.10 10-Apr-2003  christos branches: 1.10.2; 1.10.4;
Bye Bye UCONSOLE
 1.9 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.8 17-Jun-2002  lukem Enable "pseudo-device clockctl" in all kernels, except
installation related kernels (INSTALL* and RAMDISK*).
This enables rc.conf(5) $ntpd_chroot to be used "out of the box"
 1.7 25-Apr-2002  atatat branches: 1.7.2; 1.7.4;
Add the INCLUDE_CONFIG_FILE option to all config files. In config
files that are generic (ie, GENERIC, GENERICSBC, GENERIC32, ALL, or
ALPHA), it is uncommented.
 1.6 12-Apr-2002  gmcgarry Add commented-out USERCONF option. Mainly useful for install media
and can be optionally enabled based on miniroot and ramdisk size
requirements.
 1.5 09-Mar-2002  chs switch all mpc6xx powerpc ports to NEWPMAP by default.
the old pmap is still available with the OLDPMAP option.
 1.4 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.3 20-Nov-2001  lukem branches: 1.3.2;
cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.2 22-Oct-2001  thorpej branches: 1.2.4;
CPUs attach to mainbus now.
 1.1 20-Oct-2001  billc Total Impact BRIQ kernel config
 1.2.4.7 18-Oct-2002  nathanw Catch up to -current.
 1.2.4.6 20-Jun-2002  nathanw Catch up to -current.
 1.2.4.5 17-Apr-2002  nathanw Catch up to -current.
 1.2.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.1 22-Oct-2001  nathanw file BRIQ was added on branch nathanw_sa on 2002-01-08 00:27:00 +0000
 1.3.2.7 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.2.6 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.3.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 20-Nov-2001  thorpej file BRIQ was added on branch kqueue on 2002-01-10 19:47:07 +0000
 1.7.4.1 01-Aug-2002  lukem Pull up revision 1.8 (requested by lukem in ticket #312):
Enable "pseudo-device clockctl" in all kernels, except
installation related kernels (INSTALL* and RAMDISK*).
This enables rc.conf(5) $ntpd_chroot to be used "out of the box"
 1.7.2.1 15-Jul-2002  gehenna catch up with -current.
 1.10.4.1 15-Jul-2004  he Pull up revision 1.11 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.10.2.10 11-Dec-2005  christos Sync with head.
 1.10.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.2.7 15-Feb-2005  skrll Sync with HEAD.
 1.10.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.10.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.10.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.10.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.4.1 29-Apr-2005  kent sync with -current
 1.14.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.14.2.1 12-Feb-2005  yamt sync with head.
 1.18.4.4 27-Oct-2007  yamt sync with head.
 1.18.4.3 03-Sep-2007  yamt sync with head.
 1.18.4.2 30-Dec-2006  yamt sync with head.
 1.18.4.1 21-Jun-2006  yamt sync with head.
 1.18.2.1 18-Jul-2005  riz Pull up revision 1.19 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.24.6.1 22-Apr-2006  simonb Sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.24.2.1 18-Feb-2006  yamt sync with head.
 1.26.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.26.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.26.2.2 03-Sep-2006  yamt sync with head.
 1.26.2.1 01-Apr-2006  yamt sync with head.
 1.28.4.1 22-Oct-2006  yamt sync with head
 1.28.2.1 18-Nov-2006  ad Sync with head.
 1.29.16.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.29.10.1 11-Jul-2007  mjf Sync with head.
 1.29.8.2 23-Oct-2007  ad Sync with head.
 1.29.8.1 15-Jul-2007  ad Sync with head.
 1.30.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.30.12.1 18-Oct-2007  yamt sync with head.
 1.30.10.1 06-Nov-2007  matt sync with HEAD
 1.30.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.181 02-Apr-2024  charlotte Mention DKWEDGE_METHOD_TOS in several kernel config files
 1.180 29-Jan-2024  christos PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
 1.179 12-Feb-2023  abs Add optoion GENERIC.local include to the end of ~all GENERIC configs

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

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

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

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

PR kern/29702
 1.177 07-Aug-2022  simonb UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.
 1.176 29-Jun-2021  nia Remove uscanner(4) driver

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

requested by mrg
 1.174 29-Nov-2020  phx Message buffer is too small, since timestamps were enforced.
 1.173 27-Sep-2020  roy branches: 1.173.2;
vether: Add to kernel configurations

It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
 1.172 01-Aug-2020  maxv Remove references to BRIDGE_IPF, it is now compiled in by default.
 1.171 16-May-2020  maya Remove uyap, USB YAP phone firmware loader.

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

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

Proposed with no objections on netbsd-users on 13 April 2020
 1.170 26-Apr-2019  sevan Enable BUFQ_PRIOCSCAN, CARP, Veriexec by default in GENERIC kernel configs.
On ports without a GENERIC kernel config enable in individul files, e.g evbmips.
Omit on:
atari, dreamcast, emips, epoc32, evbppc/VIRTEX*, ia64, luna68x, mvme68k,
mvmeppc, playstation2, riscv, sun2, sun3, x68k, zaurus due to resource
constraints or port infancy.
 1.169 06-Feb-2019  rin Add ure(4) to kernel config files. Also add PHY drivers where necessary.
 1.168 23-Oct-2018  jdolecek remove the 'wd* at umass?' for the non-standardized and rare (extinct?)
In-System Design ATA protocol over Bulk-Only devices from most kernels,
leave only in i386/amd64 ALL; it's unmaintained and likely currently broken,
lack of test hardware makes it impossible to support
 1.167 25-Aug-2018  rin Add (commented out) mue(4) to where appropriate.
Also add MII/PHY drivers for USB NICs if missing.
 1.166 01-Aug-2018  maxv Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
 1.165 14-Sep-2017  mrg branches: 1.165.2; 1.165.4;
clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
many redundant options.

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

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

ok riastradh
 1.163 29-Jul-2017  maxv Remove TCP_COMPAT_42 from the config files. Pass 3.
 1.162 26-Feb-2017  rin Add DKWEDGE_METHOD_RDB option, which is enabled for x86, commented out for
other platforms by default.
 1.161 13-Dec-2016  christos branches: 1.161.2;
wildcard speaker attachments, now that we can handle many of them.
 1.160 10-Dec-2016  christos remove VAUDIOSPEAKER for now, will be done differently.
 1.159 08-Dec-2016  nat Add a synthesized pc beeper and keyboard bell for platforms with an audio
device.
 1.158 26-Sep-2015  maxv branches: 1.158.2;
Remove KMEMSTATS. Normally it's ok now.
 1.157 16-Nov-2014  manu branches: 1.157.2;
Remove unused extended attributes kernel options

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

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

Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
 1.155 19-Sep-2014  christos Disable BSDLABEL and MBR DKWEDGE methods again since sysinst does not work
with wedges.
 1.154 23-Aug-2014  dholland Systematize (and in many cases, fix) the comments on options COMPAT_NN.

There are quite a few configs that are missing some COMPAT_NN options
in ways that don't make sense; this should probably get cleaned up
too, but for the time being I've not added or removed anything.
 1.153 18-Aug-2014  christos - Enable Wedge support for MBR/BSDLABEL where it was commented out.
- Add apple partition support where it was missing
- Add comments where missing
 1.152 16-Aug-2014  apb Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
 1.151 30-Jun-2013  rmind branches: 1.151.6;
G/C PFIL_HOOKS from the kernel configs.
 1.150 05-Jun-2013  christos branches: 1.150.2;
remove obsolete networking options
 1.149 27-Apr-2013  christos the bogus number police
 1.148 27-Apr-2013  christos remove confusing numeric locators where they are unused.
 1.147 02-Mar-2013  christos Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it.
 1.146 01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.145 09-Nov-2012  rkujawa Add tdvfb - tested and works. Also add commented out TDVFB_CONSOLE option.
 1.144 17-Oct-2012  apb Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
 1.143 01-Sep-2012  jakllsch branches: 1.143.2;
Rename RT2500USB driver to ural(4) as it was originally in OpenBSD,
as ural(4) and ral(4) do not actually share any code.

Enable ural(4) in hpcarm WZERO3 kernel too, as it will now build.

Fixes PR#43520.
 1.142 17-Aug-2012  abs Update all kernel configs mentioning WSEMUL_* but not already including
WSDISPLAY_COMPAT_USL using the following rules:
- If WSEMUL_ is commented out, add commented out out WSDISPLAY_COMPAT_USL
- If INSTALL or obviously memory constrained, add WSDISPLAY_DEFAULTSCREENS=1
and commented out WSDISPLAY_COMPAT_USL
- Otherwise add WSDISPLAY_COMPAT_USL

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

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

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

On 5 June 2012 09:47, David Brownlee <abs@absd.org> wrote:
> wsconscfg(8) requires WSDISPLAY_COMPAT_USL in order to switch virtual
> terminals.
>
> Except when in an exceptionally memory or space constrained
> environment (INSTALL being the obvious case), is there any reason why
> all GENERIC and GENERIC-like kernels which have wscons enabled
> shouldn't also have WSDISPLAY_COMPAT_USL?
 1.141 10-Mar-2012  joerg P1003_1B_SEMAPHORE is no longer optional.
 1.140 08-Mar-2012  phx When detecting a new USB device on the bus ofppc panics in usb_allocmem().
Although the problem doesn't seem to affect other PPC ports, it causes big
trouble for my Pegasos2.
So as long as there is no real solution we should add the option
USB_FRAG_DMA_WORKAROUND to the GENERIC config file.
 1.139 18-Dec-2011  dholland branches: 1.139.2;
WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.138 22-Nov-2011  tls branches: 1.138.2;

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

This fixes build breaks on several ports. Thanks to Havard Eidnes for
pointing them out.
 1.137 08-Oct-2011  kiyohara branches: 1.137.2;
Add voodoofb with comment-outed. tested on PegasosII only.
 1.136 06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.135 02-Jan-2011  mrg branches: 1.135.2; 1.135.4;
add the normal DKWEDGE* options, and enable drvctl.
 1.134 31-Dec-2010  phx Support for reading disklabels from RDB partitions in the kernel.
The code will check for a raw disklabel first, then tries to find the
disklabel in an MBR partition and finally constructs it from RDB
partitions.
RDB is probably only needed for the Pegasos platform, so it can be
disabled in the config file (RDB_PART).
 1.133 20-Dec-2010  matt Add siisata (but make sure wd0 is still on viaide)
 1.132 10-Dec-2010  phx Added viaenv(4), which no longer crashes the system during attachment since
todays bug fix in the driver.
 1.131 23-Nov-2010  hannken Remove unused count from pseudo-device md.
 1.130 09-Jun-2010  kiyohara Support MV64361 on PegasosII by gt(4).
+ Support gtpci@gt instead of pegasospci more smartly.
+ Support Gigabit Ethernet by mvgbe@gt.
 1.129 08-May-2010  mrg enable IPFILTER_COMPAT in all kernels that have ipfilter already.
canonicalise several of the ipf option segments in various files
(this mostly means adding commented out IPFILTER_DEFAULT_BLOCK,
or adding commented or uncommented IPFILTER_LOG or IPFILTER_LOOKUP
option statements.)

i built about 20 of these kernels to check, but not all of them.
 1.128 29-Apr-2010  chs enable TMPFS in all GENERICs that have MFS enabled.
 1.127 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.126 29-Mar-2010  kiyohara Add scsibus@sbp.
 1.125 14-Mar-2010  kiyohara branches: 1.125.2;
Add fdc@isa.
tested on PegasosII.
 1.124 07-Mar-2010  plunky add uhso(4) device where appropriate
- follow the lead of other USB driver declarations wrt commented out
- (cross-)build tested all these kernels
 1.123 08-Feb-2010  joerg 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.122 05-Dec-2009  pooka branches: 1.122.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.121 24-Jan-2009  mrg add COMPAT_50 to all the configs with COMPAT_40.
 1.120 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

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

Proposed on tech-kern@.
 1.118 10-Aug-2008  tls branches: 1.118.2; 1.118.12;
Add accept filters to GENERIC kernels where they exist.
 1.117 31-Jul-2008  simonb Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.116 29-Mar-2008  phx branches: 1.116.4; 1.116.6; 1.116.10;
Activate genfb, pckbc, pckbd, pms, wskbd, wsmouse and wsdisplay.
Those devices work reliable on a Pegasos2 system with serial console and
with a real keyboard/monitor.
 1.115 08-Mar-2008  phx INSECURE option is required for the Xserver to access /dev/mem.
Approved by garbled.
 1.114 23-Feb-2008  phx Added scsibus at umass for USB keys and ADOSFS for mounting Amiga file systems
on Pegasos computers.
Approved by garbled.
 1.113 15-Feb-2008  tsutsui branches: 1.113.2; 1.113.6;
Remove obsolete platform support options.
 1.112 13-Feb-2008  tsutsui Use options<space><tab>.

XXX FIREPOWER options are obsolete?
 1.111 05-Feb-2008  garbled Rewrite a big chunk of the pmap and locore code for powerpc to better
deal with the 64bit bridge mode. pmap changes by Matt Thomas, rest by myself.

Change pmap.c to work similar to exec_elf.c to allow us to compile in
multiple pmaps to a single kernel. This allows the pmap for bridge64 to
co-exist with the 32bit pmap.

Yank __HAVE_PMAP_PHYSSEG from all the oea code.

Add a new global, "oeacpufeat", which is used early in locore to determine
certain cpu features. This allows us to conditionalize code early in the boot
for certain CPUs that have special needs.

Yank most of the ifdef PPC_OEA_BRIDGE64 code from almost every file it was
found in. Some of it seemed incorrect, and my 7044 booted just fine
without it. It would appear that the bridge cpus treat BAT instructions
as nops, so they seem to be safe.

In ofppc, check the oeacpufeat, and if we are on a 64bit proc, clear
MSR[SF], and ASR[V].

With all of these changes, a kernel with both PPC_OEA and PPC_OEA_BRIDGE64
will boot on the POWERIII-2 cpu. However, it will not yet boot on a 32bit
cpu, because of CACHELINESIZE. Work remains to be done there to fix that.
 1.110 02-Jan-2008  mrg add COMPAT_40, raid and RAID_AUTOCONFIG options.
 1.109 31-Dec-2007  ad Remove systrace. Ok core@.
 1.108 24-Dec-2007  phx Make USB, IEEE1394 and viaaudio attach to the Pegasos2.
USB works fine. IEEE1394 is untested. Audio doesn't work (playing white noise).
Need to set IO/MEM-enable for IEEE1394 and audio, as the firmware (Smart
Firmware 1.2) doesn't do it.
Patch approved by Tim Rightnour.
 1.107 15-Dec-2007  phx wsmux was missing.
Switched to a smaller default font.
 1.106 06-Nov-2007  garbled branches: 1.106.2; 1.106.6;
Add a bunch of devices to GENERIC. Fix interrupts on the PegasosII with
a nasty little hack. Getting closer to a working system.
 1.105 05-Nov-2007  garbled branches: 1.105.2;
Lots of small changes for ofppc:

Remove the ofb driver. I'm not interested in trying to make this work.
It should be replaced with the genfb driver, which I have added,
commented out because that driver needs work before it will function on
ofppc. (it's too panic-happy, and ofppc needs a working autoconf.c)

Change the way we do isa_inb/outb. The new way is a slightly nastier
hack, but won't run afoul of the other isa drivers as much.

Fix ofw_consinit.c to remove the dependency on ofb.
 1.104 04-Nov-2007  garbled Get rid of the ofppc use of the ofbus completely, for the last time.

Write a complete OF boot console into ofw_consinit.c and rewire a bunch
of the ifdef logic in that file to use it when appropriate on both macppc
and ofppc. Get rid of the attempt to wire up the serial console early,
as that is extremely difficult on ofppc. Yank all the console code out
of ofppc/machdep.c. (This is a boot console only, not a full blown
console like ofcons.c)

Delete all the ofbus references out of the config files, and pull in
dev/ofw/openfirmio.c and dev/ofw/ofw_subr.c directly rather than pulling
in files.ofw. It might be worth going back and adding a files.ofw-nobus
to that directory to allow pulling in the openfirmware driver without
pulling in the whole ofbus mess.

Change rtas driver to connect directly to mainbus, like the PCI bus nodes do.
 1.103 04-Nov-2007  xtraeme Remove System V semaphores and share memory options to set the limits:
SEMMNI, SEMMNS, SEMUME and SHMMAXPGS.

They can be tweaked via sysctl now. Ports that were setting values on
them weren't touched, I only removed the ones that were commented out.
 1.102 25-Oct-2007  garbled Add some basic options from i386 GENERIC.
 1.101 25-Oct-2007  garbled Add a bunch of fixes and minor rewrites to ofppc to bring it closer to
working properly. This is still a work in progress, and all work so far
has been based on the PegasosII machne.

1) Rewrite how the ISA memory and IO space maps are found. More work
will still need to be done in this area.
2) Add a new OFW method of pci configuration. So far I can only get this
to work on the primary PCI bus on the Pegasos. Unsure if this is a
pegasos bug or a code bug.
3) Add the rtas device to ofppc, and add an "rtas_reboot" function to
rtas to allow me to reboot the PegasosII. The rtas driver works, and is
a great start but needs to be changed slightly to allow easier access to
the functions from outside the driver.
4) Fix a number of bugs that existed in the shared PCI code for ofw that
probably weren't tickled by macppc.

There is much much more left to do here, this is all still a work in
progress, but this commit will allow other people to play around with the
code if they want to.
 1.100 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.99 10-Jul-2007  tsutsui branches: 1.99.8; 1.99.10; 1.99.12; 1.99.14;
Fix more pesudo.
 1.98 04-Jun-2007  martin Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.97 11-Nov-2006  jmmv branches: 1.97.2; 1.97.8; 1.97.10; 1.97.16; 1.97.18;
Remove tmpfs's experimental status. OK'ed by core@.
 1.96 27-Sep-2006  manu - Document COMPAT_15 as doing nothing
- Add COMPAT_15 to all the kernel that had COMPAT_14, for the sake of coherency
- Remove the only occurences of #ifdef COMPAT_15 in the tree: for the ARM
ports, COMPAT_15 was always used in conjunction with EXEC_AOUT. Only EXEC_AOUT
matters here.

This address kern/18407
 1.95 26-Aug-2006  christos branches: 1.95.2; 1.95.4;
PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
 1.94 26-Aug-2006  tsutsui Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.93 12-Aug-2006  christos Disable SYSTRACE by default on all kernels (discussed with core)
 1.92 28-Jun-2006  liamjfoy branches: 1.92.2;
Add CARP to GENERIC kernel configs. CARP is not enabled by default.

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

OK'ed by rpaulo.

N.B. stf is a cloning device, so it still must be enabled by
"ifconfig stf0 create".
 1.90 05-Feb-2006  cube branches: 1.90.2; 1.90.4; 1.90.6;
Remove 'count' argument for pseudo-devices that ignore it
(vnd, bpfilter, ppp, gif, gre, tun, sl, strip, faith, stf).
 1.89 04-Feb-2006  rpaulo bpfilter doesn't accept count anymore.
 1.88 02-Feb-2006  reinoud branches: 1.88.2;
Add commented out UDF file-system entry in all GENERIC configurations.
 1.87 09-Dec-2005  elad branches: 1.87.2; 1.87.4;
Add (commented out) Veriexec options and pseudo-device to GENERIC kernels,
and remove the i386 GENERIC_VERIEXEC config.
 1.86 07-Dec-2005  tsutsui Adjust comments for options FFS_NO_SNAPSHOT.

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

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

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

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

Ok'ed by Christos Zoulas and Hubert Feyrer.
 1.76 25-Feb-2005  simonb branches: 1.76.2;
Add COMPAT_20 (and COMPAT_16 in some cases) to kernel config files
that didn't have those options but had other earlier compat options.
 1.75 18-Feb-2005  dsl Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT
 1.74 11-Feb-2005  dsl Add 'option FFS_SNAPSHOT' to most of the config files.
Commented out for kernels that appear to hace space constraints.
 1.73 31-Jan-2005  hannken Add file system snapshots to kernel configs.

- Ffs internal snapshots get compiled in unconditionally.

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

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

XXX: we _need_ some way of making this more simple.
 1.70 10-Nov-2004  christos branches: 1.70.4;
Add COMPAT_BSDPTY to the rest of the config files.
 1.69 04-Sep-2004  manu IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
 1.68 15-Jul-2004  atatat Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
 1.67 28-Jun-2004  bouyer Add options P1003_1B_SEMAPHORE
to all GENERIC-like kernel config files where SYSV* options were already
present (commented out if the SYSV* options are commented out).
Fix lib/25897 and lib/25898.
 1.66 26-Jun-2004  abs Add (commented out) ALTQ options to all GENERIC-like files
 1.65 22-Jun-2004  itojun have pf and pflog pseudo-device (commented out).
reviewed by matt, perry, christos
 1.64 18-Jun-2004  christos ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM
 1.63 16-Jun-2004  christos Add pseudo-device ptm on all the generic flavored kernels.
 1.62 26-Apr-2003  ragge branches: 1.62.2; 1.62.4;
Add pseudo-device ksyms.
 1.61 10-Apr-2003  christos Bye Bye UCONSOLE
 1.60 27-Feb-2003  perseant Make BRIDGE_IPF an option, and document it. Add it (commented) to GENERIC.
Let brconfig tell whether the bridge is using the ipfilter hook, or not.
 1.59 14-Oct-2002  elric Added commented out cgd(4)s to GENERIC configs.
 1.58 06-Oct-2002  provos add SYSTRACE; approved perry.
 1.57 25-Sep-2002  martti Add one space between "#option" and "<tab>IPFILTER_DEFAULT_BLOCK"
 1.56 20-Sep-2002  martti Added (commented out) IPFILTER_DEFAULT_BLOCK.
 1.55 18-Sep-2002  lukem enable USERCONF by default; it's small and extremely useful to have available.
 1.54 18-Sep-2002  chs add the options for all the FirePower models.
add the "openfirm" device, since we're got openfirmware.
 1.53 17-Jun-2002  lukem Enable "pseudo-device clockctl" in all kernels, except
installation related kernels (INSTALL* and RAMDISK*).
This enables rc.conf(5) $ntpd_chroot to be used "out of the box"
 1.52 25-Apr-2002  atatat branches: 1.52.2; 1.52.4;
Add the INCLUDE_CONFIG_FILE option to all config files. In config
files that are generic (ie, GENERIC, GENERICSBC, GENERIC32, ALL, or
ALPHA), it is uncommented.
 1.51 12-Apr-2002  gmcgarry Add commented-out USERCONF option. Mainly useful for install media
and can be optionally enabled based on miniroot and ramdisk size
requirements.
 1.50 27-Jan-2002  jdolecek add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
 1.49 19-Jan-2002  oster Add new RF_* options for RAIDframe bits that are no longer built by default.

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

Also: bump the number of 'raid' devices from 4 to 8, since 4 seems to
be insufficient in practise.
 1.48 28-Dec-2001  martin Add PPPoE to all generic kernels that should be able to use it.
XXX TODO: do this for INSTALL kernels too, add sysinst support and make the
XXX needed binaries available on the ramdisk root fs.
 1.47 14-Dec-2001  gmcgarry Add a blurb to the top of all GENERIC files. This serves three purposes:
- to clarify some terminology
- to clarify the intention of the GENERIC file
- to cross-reference some useful man pages
 1.46 23-Nov-2001  atatat The bridge(4) pseudo-device no longer requires the port to
__HAVE_GENERIC_SOFT_INTERRUPTS, so add it back to all GENERIC configs.
 1.45 20-Nov-2001  lukem cleanup:
options SPACE TAB
makeoptions TAB
psuedo-device TAB
remove trailing whitespace
replace multiple spaces -> tabs
options "FOO" -> options FOO
options "FOO=bar" -> options FOO=bar
options "FOO=\"bar\"" -> options FOO="\"bar\""
 1.44 22-Oct-2001  thorpej branches: 1.44.4;
Various things that make OFW-driver kernels work on my Firepower LX MP
again:
- Special-case the attachment of CPUs, and logically attach them to
"mainbus", attaching them before any other devices. Otherwise,
CPUs would be found very late in the game on my Firepower.
- Sanity check the timebase-frequency property, printing a warning if
it's not the same on each CPU.
- Pass the correct CPU ID to cpu_attach_subr().
- Fetch the platform name from the OFW root node. We can key off this
later when we implement support for native drivers in the ofppc port.
- Use a table of "special" toplevel OFW nodes ... we skip these nodes
during the device configuration phase. This generally includes the
"options", "packages", etc. nodes. Inspired by sparc & sparc64 ports.
 1.43 12-Sep-2001  manu Linux emulation is no longer experimental, removed comment
 1.42 01-Sep-2001  atatat branches: 1.42.2;
Comment out bridge pseudo devices from ports that don't
__HAVE_GENERIC_SOFT_INTERRUPTS. bridge(4) doesn't compile there.
 1.41 01-Sep-2001  atatat Add bridge pseudo devices to GENERIC configs
 1.40 26-Aug-2001  matt Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.39 08-Jul-2001  abs branches: 1.39.2;
Standardise TCP_COMPAT_42 as commented out, grouped with other COMPAT options,
and with the comment '4.2BSD TCP/IP bug compat. Not recommended'
Add commented out 'TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG'
(All hail amiga and atari which make some attempt to automate the
multiplicity of config files...)
 1.38 30-Jun-2001  darcy Add System V semaphore resource limits to each GENERIC file that has an
option for System V semaphores. It appears that there are no overrides
in the code and each file has the following added.

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

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

Note - the i386 port was not forgotten. It was done separately.
 1.37 04-Apr-2001  manu Cosmetic change
 1.36 03-Apr-2001  manu Added a comented out COMPAT_LINUX option in GENERIC kernels of PowerPC ports
 1.35 19-Dec-2000  bouyer branches: 1.35.2;
Add pseudo-device vlan
 1.34 14-Nov-2000  thorpej A respectable GENERIC, loosely based on the macppc GENERIC.
 1.33 04-Oct-2000  itojun enable rnd device. they are now mandatory for ssh/sshd support,
so it makes more sense to enable it.
please disable them if there's any issues, but in that case, in-tree
ssh/sshd won't work.
 1.32 24-Sep-2000  jdolecek don't specify number of ptys if >= 16 (current default initial number)
pty comments: normalize and g/c what is no longer relevant
 1.31 13-Aug-2000  itojun move "options PULLDOWN_TEST" into sys/sys/mbuf.h (in #ifdef _KERNEL),
as it is no wthe default setting for everyone.

the reason we still use the name "PULLDOWN_TEST" while it is now default:
kame code sharing.
 1.30 27-Jul-2000  mason Moving to a default of 64 PTYs.
 1.29 30-Jun-2000  itojun add PULLDOWN_TEST for all the platforms.
XXX should be moved to somewhere else when stabilized
 1.28 22-Jun-2000  fvdl Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.27 14-Jun-2000  veego branches: 1.27.2;
Remove the obsolete config fragments for kernel crypto, because the IPsec
crypto code is now in the kernel source tree.
 1.26 19-Apr-2000  itojun branches: 1.26.2;
add stf pseudo interface (commented out due to possible security risks)
 1.25 29-Feb-2000  simonb Do the "<space><tab>" thing with the RAID_AUTOCONFIG option.
 1.24 26-Feb-2000  oster Defopt 'RAID_AUTOCONFIG'. Adding 'options RAID_AUTOCONFIG' turns on
the component auto-detection and auto-configuration of RAID sets.
Also, add "#options RAID_AUTOCONFIG" to the GENERIC config files.
 1.23 23-Jan-2000  hubertf Add commented out "ident"-command
 1.22 20-Jan-2000  wrstuden Add overlay to kernel configs.
 1.21 21-Nov-1999  itojun bring in content of GENERIC.v6 into GENERIC.
remove GENERIC.v6 file (as it is part of GENERIC now).

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

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

XXX what to do with arch/arm32/SHARK{,.v6}?
 1.20 15-Nov-1999  fvdl Add commented out option SOFTDEP to all GENERIC kernels.
 1.19 29-Jul-1999  augustss branches: 1.19.2; 1.19.8;
It's time to be COMPAT_14.
 1.18 25-Nov-1998  hwr branches: 1.18.4; 1.18.6;
Add (commented out) 'gre' pseudo device line. Feedback is welcome.
Inspired by Klaus Klein.
 1.17 16-Nov-1998  oster Added a (commented out) configuration line for the RAIDframe device driver.
 1.16 03-Sep-1998  sakamoto Use UVM by default.
 1.15 26-Jun-1998  lukem remove options FIFO; it's now the default
 1.14 05-Jun-1998  sakamoto Merge in MACHINE_NEW_NONCONTIG support and some fix from Tsubai-San.
UVM support.
 1.13 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.12 18-Mar-1998  bouyer Add commented out "options FFS_EI"
 1.11 02-Mar-1998  drochner Change MBR partition type for NetBSD to 0xa9, like the i386 port.
Provide compatibility via COMPAT_386BSD_MBRPART.
 1.10 24-Feb-1998  mycroft Catch up with changes in dev/ofw. Add mainbus.
 1.9 27-Jan-1998  sakamoto Import DDB from OpenBSD/powerpc.
 1.8 01-Dec-1997  kleink Add COMPAT_13.
 1.7 20-Nov-1997  fair add pseudo-device rnd, commented out
 1.6 17-Nov-1997  lukem * add commented out DDB_HISTORY_SIZE=100 if DDB exists in config file
* fix up use of 'options<SPACE><TAB>'
 1.5 16-Apr-1997  thorpej branches: 1.5.8;
Update for current PowerPC code, some from Wolfgang.
 1.4 31-Jan-1997  thorpej Adopt for new file system and root spec grammar.
 1.3 16-Oct-1996  ws branches: 1.3.2;
Rename recently checked in KGDB to IPKDB to resolve conflicts with older KGDB
 1.2 16-Oct-1996  ws Add EXEC_ stuff
 1.1 30-Sep-1996  ws PowerPC port
 1.3.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.5.8.1 20-Nov-1997  mellon Pull rev 1.7 up from trunk (fair)
 1.18.6.1 02-Aug-1999  thorpej Update from trunk.
 1.18.4.1 03-Jun-2000  he Apply patch (requested by he):
Disable the UNION file system, to avoid a repeat of the 1.4.1
and 1.4.2 LAST_MINUTE changes. It is reportedly buggy, and can
be used by ordinary users to crash the system.
 1.19.8.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.8.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

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

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

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

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

cvs rdiff -r1.166 -r1.167 syssrc/sys/arch/alpha/conf/GENERIC
cvs rdiff -r1.149 -r1.150 syssrc/sys/arch/amiga/conf/GENERIC
cvs rdiff -r1.11 -r1.12 syssrc/sys/arch/arm26/conf/GENERIC
cvs rdiff -r1.72 -r1.73 syssrc/sys/arch/atari/conf/GENERIC
cvs rdiff -r1.60 -r1.61 syssrc/sys/arch/hp300/conf/GENERIC
cvs rdiff -r1.10 -r1.11 syssrc/sys/arch/luna68k/conf/GENERIC
cvs rdiff -r1.35 -r1.36 syssrc/sys/arch/next68k/conf/GENERIC
cvs rdiff -r1.32 -r1.33 syssrc/sys/arch/ofppc/conf/GENERIC
cvs rdiff -r1.73 -r1.74 syssrc/sys/arch/sun3/conf/GENERIC
cvs rdiff -r1.80 -r1.81 syssrc/sys/arch/vax/conf/GENERIC
cvs rdiff -r1.52 -r1.53 syssrc/sys/arch/x68k/conf/GENERIC
 1.27.2.2 11-Aug-2000  mason Move to default of 64 PTYs in GENERIC kernel config.
Requested by mason, approved by jhawk.
 1.27.2.1 23-Jun-2000  fvdl As on the trunk, update these for the move of ffs_softdep.c into the
kernel source itself. Remove prefix construction, and add the SOFTDEP
option to GENERIC kernels.
 1.35.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.39.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.39.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.39.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.39.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.39.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.39.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.42.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.44.4.6 18-Oct-2002  nathanw Catch up to -current.
 1.44.4.5 20-Jun-2002  nathanw Catch up to -current.
 1.44.4.4 17-Apr-2002  nathanw Catch up to -current.
 1.44.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.44.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.44.4.1 22-Oct-2001  nathanw file GENERIC was added on branch nathanw_sa on 2002-01-08 00:27:00 +0000
 1.52.4.2 24-Oct-2002  lukem Pull up upgrade to IPfilter 3.4.29 (requested by martti in ticket #905).
Affected files & revisions:

dist/ipf/HISTORY 1.14
dist/ipf/fils.c 1.17-1.21
dist/ipf/ipf.c 1.11-1.13
dist/ipf/ipfs.c 1.8-1.10
dist/ipf/ipft_ef.c 1.6-1.7
dist/ipf/ipft_td.c 1.6-1.7
dist/ipf/ipft_tx.c 1.7-1.8
dist/ipf/ipmon.c 1.12-1.17
dist/ipf/ipnat.c 1.11-1.12
dist/ipf/ipsend/ip_var.h 1.2
dist/ipf/ipsend/ipsend.c 1.8
dist/ipf/ipsend/iptests.c 1.5
dist/ipf/ipt.c 1.8-1.10
dist/ipf/kmem.c 1.8-1.10
dist/ipf/man/ipf.4 1.10
dist/ipf/man/ipf.5 1.8
dist/ipf/man/ipftest.1 1.3
dist/ipf/man/ipmon.8 1.10
dist/ipf/man/ipnat.5 1.9-1.10
dist/ipf/man/ipnat.8 1.4
dist/ipf/misc.c 1.7
dist/ipf/natparse.c 1.10
dist/ipf/parse.c 1.13
dist/ipf/printnat.c 1.8-1.10
dist/ipf/relay.c 1.5-1.6
dist/ipf/rules/example.9 1.2
etc/rc.d/ipnat 1.8
regress/sys/kern/ipf/Makefile 1.3-1.4
regress/sys/kern/ipf/dotest6 1.2
regress/sys/kern/ipf/expected/f13 1.1.1.2
regress/sys/kern/ipf/expected/i12 1.1.1.1
regress/sys/kern/ipf/expected/ni3 1.1.1.1
regress/sys/kern/ipf/expected/ni5 1.2
regress/sys/kern/ipf/input/f13 1.1.1.2
regress/sys/kern/ipf/input/ipv6.1 1.1.1.1
regress/sys/kern/ipf/input/ni3 1.1.1.1
regress/sys/kern/ipf/regress/i12 1.1.1.1
regress/sys/kern/ipf/regress/ipv6.1 1.1.1.1
regress/sys/kern/ipf/regress/ni3.ipf 1.1.1.1
regress/sys/kern/ipf/regress/ni3.nat 1.1.1.1
sys/arch/alpha/conf/ALPHA 1.169,1.171
sys/arch/amiga/conf/GENERIC 1.185-1.186
sys/arch/arc/conf/GENERIC 1.71-1.72
sys/arch/atari/conf/GENERIC.in 1.24-1.25
sys/arch/cats/conf/GENERIC 1.31-1.32
sys/arch/cobalt/conf/GENERIC 1.34-1.35
sys/arch/hp300/conf/GENERIC 1.83-1.84
sys/arch/i386/conf/CARDBUS 1.66-1.67
sys/arch/i386/conf/GENERIC 1.510,1.512
sys/arch/i386/conf/GENERIC_LAPTOP 1.58-1.59
sys/arch/i386/conf/GENERIC_PS2TINY 1.19-1.20
sys/arch/i386/conf/GENERIC_TINY 1.47-1.48
sys/arch/luna68k/conf/GENERIC 1.33-1.33
sys/arch/mac68k/conf/GENERIC 1.130-1.131
sys/arch/mac68k/conf/GENERICSBC 1.21-1.22
sys/arch/mac68k/conf/SMALLRAM 1.4-1.5
sys/arch/macppc/conf/GENERIC 1.142-1.143
sys/arch/mipsco/conf/GENERIC 1.21-1.22
sys/arch/mmeye/conf/GENERIC 1.44-1.45
sys/arch/news68k/conf/GENERIC 1.36-1.37
sys/arch/news68k/conf/GENERIC_TINY 1.18-1.19
sys/arch/newsmips/conf/GENERIC 1.50-1.51
sys/arch/ofppc/conf/GENERIC 1.56-1.57
sys/arch/pmax/conf/GENERIC 1.103-1.104
sys/arch/prep/conf/GENERIC 1.55-1.56
sys/arch/sbmips/conf/GENERIC 1.11-1.12
sys/arch/sgimips/conf/GENERIC 1.7-1.8
sys/arch/sparc/conf/GENERIC 1.138-1.139
sys/arch/sparc64/conf/GENERIC32 1.46-1.47
sys/arch/vax/conf/GENERIC 1.102-1.103
sys/arch/x68k/conf/ALL 1.55-1.56
sys/arch/x68k/conf/GENERIC 1.80-1.81
sys/lkm/netinet/if_ipl/mln_ipl.c 1.29
sys/netinet/fil.c 1.57-1.58
sys/netinet/ip_auth.c 1.29-1.30
sys/netinet/ip_compat.h 1.30-1.31
sys/netinet/ip_fil.c 1.81-1.86
sys/netinet/ip_fil.h 1.46-1.49
sys/netinet/ip_frag.c 1.33-1.34
sys/netinet/ip_frag.h 1.18
sys/netinet/ip_ftp_pxy.c 1.25-1.26
sys/netinet/ip_h323_pxy.c 1.5-1.6
sys/netinet/ip_log.c 1.22-1.23
sys/netinet/ip_nat.c 1.51-1.53
sys/netinet/ip_nat.h 1.27
sys/netinet/ip_netbios_pxy.c 1.4
sys/netinet/ip_proxy.c 1.35-1.36
sys/netinet/ip_proxy.h 1.18
sys/netinet/ip_state.c 1.41-1.42
sys/netinet/ip_state.h 1.23
sys/netinet/ipl.h 1.14
 1.52.4.1 01-Aug-2002  lukem Pull up revision 1.53 (requested by lukem in ticket #312):
Enable "pseudo-device clockctl" in all kernels, except
installation related kernels (INSTALL* and RAMDISK*).
This enables rc.conf(5) $ntpd_chroot to be used "out of the box"
 1.52.2.1 15-Jul-2002  gehenna catch up with -current.
 1.62.4.3 15-Jul-2004  he Pull up revision 1.68 (requested by atatat in ticket #663):
Add "options SYSCTL_INCLUDE_DESCR" to a lot of configurations,
but commented out in most of them.
 1.62.4.2 02-Jul-2004  he Pull up revision 1.67 (requested by bouyer in ticket #573):
Add options P1003_1B_SEMAPHORE to all GENERIC-like kernel
config files where SYSV* options were already present
(commented out if the SYSV* options are commented out).
Fixes PR#25897 and PR#25898.
 1.62.4.1 30-Jun-2004  jdc Pull up revision 1.66 (requested by abs in ticket #567).

Add (commented out) ALTQ options to all GENERIC-like files
 1.62.2.10 11-Dec-2005  christos Sync with head.
 1.62.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.62.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.62.2.7 15-Feb-2005  skrll Sync with HEAD.
 1.62.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.62.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.62.2.4 14-Nov-2004  skrll Sync with HEAD.
 1.62.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.62.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.62.2.1 03-Aug-2004  skrll Sync with HEAD
 1.70.4.1 29-Apr-2005  kent sync with -current
 1.71.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.71.2.1 12-Feb-2005  yamt sync with head.
 1.76.2.3 05-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #929):
sys/arch/hp300/conf/GENERIC: revision 1.124
sys/arch/acorn32/conf/GENERIC: revision 1.62
sys/arch/pdp10/conf/GENERIC: revision 1.19
sys/arch/mvme68k/conf/GENERIC: revision 1.61
sys/arch/netwinder/conf/GENERIC: revision 1.70
sys/arch/sbmips/conf/GENERIC: revision 1.46
sys/arch/macppc/conf/GENERIC: revision 1.214
sys/arch/bebox/conf/GENERIC: revision 1.89
sys/arch/cobalt/conf/GENERIC: revision 1.83
sys/arch/cats/conf/GENERIC: revision 1.92
sys/arch/shark/conf/GENERIC: revision 1.53
sys/arch/amiga/conf/GENERIC.in: revision 1.45
sys/arch/acorn26/conf/GENERIC: revision 1.37
sys/arch/cesfic/conf/GENERIC: revision 1.38
sys/arch/iyonix/conf/GENERIC: revision 1.21
sys/arch/alpha/conf/GENERIC: revision 1.277
sys/arch/vax/conf/GENERIC: revision 1.143
sys/arch/atari/conf/GENERIC.in: revision 1.56
sys/arch/mipsco/conf/GENERIC: revision 1.53
sys/arch/ofppc/conf/GENERIC: revision 1.85
sys/arch/next68k/conf/GENERIC: revision 1.96
sys/arch/arc/conf/GENERIC: revision 1.125
sys/arch/dreamcast/conf/GENERIC: revision 1.62
turn off DEBUG and DIAGNOSTIC in GENERIC kernels so that they
are compatible with the LKMs that are part of the release.
 1.76.2.2 14-Aug-2005  riz Pull up revision 1.79 (requested by hubertf in ticket #625):
Add support for reading cloop2 compressed filesystem images,
enable by putting VND_COMPRESSION into kernel config file.
Written by Cliff Wright, polished up slightly by me.
 1.76.2.1 18-Jul-2005  riz Pull up revision 1.78 (requested by tron in ticket #566):
Add (commented out) IPSEC_NAT_T option.
 1.77.2.9 17-Mar-2008  yamt sync with head.
 1.77.2.8 27-Feb-2008  yamt sync with head.
 1.77.2.7 11-Feb-2008  yamt sync with head.
 1.77.2.6 21-Jan-2008  yamt sync with head
 1.77.2.5 15-Nov-2007  yamt sync with head.
 1.77.2.4 27-Oct-2007  yamt sync with head.
 1.77.2.3 03-Sep-2007  yamt sync with head.
 1.77.2.2 30-Dec-2006  yamt sync with head.
 1.77.2.1 21-Jun-2006  yamt sync with head.
 1.87.4.1 09-Sep-2006  rpaulo sync with head
 1.87.2.1 18-Feb-2006  yamt sync with head.
 1.88.2.1 22-Apr-2006  simonb Sync with head.
 1.90.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.90.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.90.2.3 03-Sep-2006  yamt sync with head.
 1.90.2.2 11-Aug-2006  yamt sync with head
 1.90.2.1 01-Apr-2006  yamt sync with head.
 1.91.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.92.2.2 22-Sep-2006  riz Pull up following revision(s) (requested by tsutsui in ticket #170):
sys/arch/sparc64/conf/GENERIC: revision 1.63
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.55
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.54
sys/arch/next68k/conf/GENERIC: revision 1.105
sys/arch/ews4800mips/conf/GENERIC: revision 1.12
sys/arch/arc/conf/GENERIC: revision 1.142
sys/arch/sun3/conf/GENERIC3X: revision 1.91
sys/arch/amd64/conf/GENERIC: revision 1.105
sys/arch/sun2/conf/GENERIC: revision 1.58
sys/arch/amiga/conf/GENERIC.in: revision 1.55
sys/arch/mac68k/conf/GENERIC: revision 1.175
sys/arch/acorn26/conf/GENERIC: revision 1.46
sys/arch/shark/conf/GENERIC: revision 1.65
sys/arch/cesfic/conf/GENERIC: revision 1.45
sys/arch/sandpoint/conf/GENERIC: revision 1.36
sys/arch/iyonix/conf/GENERIC: revision 1.32
sys/arch/mvme68k/conf/GENERIC: revision 1.69
sys/arch/evbarm/conf/ARMADILLO210: revision 1.3
sys/arch/vax/conf/GENERIC: revision 1.154
sys/arch/mipsco/conf/GENERIC: revision 1.61
sys/arch/evbarm/conf/ARMADILLO9: revision 1.14
sys/arch/cobalt/conf/GENERIC: revision 1.103
sys/arch/ofppc/conf/GENERIC: revision 1.94
sys/arch/hp700/conf/GENERIC: revision 1.69
sys/arch/playstation2/conf/GENERIC: revision 1.8
sys/arch/dreamcast/conf/GENERIC: revision 1.73
sys/arch/news68k/conf/GENERIC: revision 1.81
sys/arch/macppc/conf/GENERIC: revision 1.234
sys/arch/hp300/conf/GENERIC: revision 1.134
sys/arch/mmeye/conf/GENERIC: revision 1.83
sys/arch/ibmnws/conf/GENERIC: revision 1.26
sys/arch/cats/conf/GENERIC: revision 1.109
sys/arch/sparc/conf/GENERIC: revision 1.191
sys/arch/pdp10/conf/GENERIC: revision 1.27
sys/arch/acorn32/conf/GENERIC: revision 1.75
sys/arch/luna68k/conf/GENERIC: revision 1.74
sys/arch/bebox/conf/GENERIC: revision 1.101
sys/arch/pmax/conf/GENERIC: revision 1.148
sys/arch/x68k/conf/GENERIC: revision 1.130
sys/arch/sun3/conf/GENERIC: revision 1.134
sys/arch/prep/conf/GENERIC: revision 1.126
sys/arch/alpha/conf/GENERIC: revision 1.293
sys/arch/newsmips/conf/GENERIC: revision 1.94
sys/arch/netwinder/conf/GENERIC: revision 1.83
sys/arch/hpcsh/conf/GENERIC: revision 1.69
sys/arch/sbmips/conf/GENERIC: revision 1.55
sys/arch/pc532/conf/GENERIC: revision 1.65
sys/arch/hpcmips/conf/GENERIC: revision 1.192
Remove obsolete #options VERIFIED_EXEC, found by grep(1).
 1.92.2.1 14-Aug-2006  tron Pull up following revision(s) (requested by elad in ticket #17):
sys/arch/sparc/conf/KRUPS: revision 1.38
sys/arch/i386/conf/XEN2_DOMU: revision 1.2
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.197
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.53
sys/arch/evbsh5/conf/SIMULATOR: revision 1.12
sys/arch/sparc/conf/MRCOFFEE: revision 1.17
sys/arch/next68k/conf/GENERIC: revision 1.104
sys/arch/i386/conf/VIRTUALPC: revision 1.44
sys/arch/ews4800mips/conf/GENERIC: revision 1.11
sys/arch/evbsh5/conf/CAYMAN: revision 1.23
sys/arch/arc/conf/GENERIC: revision 1.141
sys/arch/amd64/conf/GENERIC: revision 1.103
sys/arch/sun3/conf/GENERIC3X: revision 1.90
sys/arch/evbarm/conf/HDL_G: revision 1.3
sys/arch/sun2/conf/GENERIC: revision 1.57
sys/arch/news68k/conf/GENERIC_TINY: revision 1.51
sys/arch/evbppc/conf/EXPLORA451: revision 1.27
sys/arch/amiga/conf/GENERIC.in: revision 1.54
sys/arch/mac68k/conf/GENERIC: revision 1.174
sys/arch/acorn26/conf/GENERIC: revision 1.45
sys/arch/shark/conf/GENERIC: revision 1.64
sys/arch/cesfic/conf/GENERIC: revision 1.44
sys/arch/mvme68k/conf/GENERIC: revision 1.68
sys/arch/i386/conf/XEN2_DOM0: revision 1.4
sys/arch/atari/conf/GENERIC.in: revision 1.63
sys/arch/amiga/conf/GENERIC: revision 1.240
sys/arch/i386/conf/LAMB: revision 1.65
sys/arch/i386/conf/GENERIC: revision 1.773
sys/arch/acorn32/conf/EB7500ATX: revision 1.26
sys/arch/x68k/conf/GENERIC: revision 1.128
sys/arch/vax/conf/GENERIC: revision 1.153
sys/arch/atari/conf/ATARITT: revision 1.81
sys/arch/mipsco/conf/GENERIC: revision 1.60
sys/arch/cobalt/conf/GENERIC: revision 1.101
sys/arch/evbarm/conf/ARMADILLO9: revision 1.13
sys/arch/ofppc/conf/GENERIC: revision 1.93
sys/arch/atari/conf/MILAN-PCIIDE: revision 1.51
sys/arch/arc/conf/RPC44: revision 1.26
sys/arch/sparc64/conf/GENERIC: revision 1.59
sys/arch/i386/conf/XEN3_DOMU: revision 1.2
sys/arch/hp700/conf/GENERIC: revision 1.68
sys/arch/atari/conf/MILAN-ISAIDE: revision 1.47
sys/arch/macppc/conf/GENERIC: revision 1.231
sys/arch/dreamcast/conf/GENERIC: revision 1.72
sys/arch/news68k/conf/GENERIC: revision 1.80
sys/arch/hp300/conf/GENERIC: revision 1.133
sys/arch/mmeye/conf/GENERIC: revision 1.82
sys/arch/macppc/conf/MAMBO: revision 1.2
sys/arch/cats/conf/GENERIC: revision 1.107
sys/arch/atari/conf/FALCON: revision 1.79
sys/arch/acorn32/conf/GENERIC: revision 1.71
sys/arch/sparc/conf/GENERIC: revision 1.190
sys/arch/news68k/conf/LIBERO: revision 1.40
sys/arch/amiga/conf/DRACO: revision 1.114
sys/arch/cobalt/conf/INSTALL: revision 1.23
sys/arch/luna68k/conf/GENERIC: revision 1.73
sys/arch/bebox/conf/GENERIC: revision 1.100
sys/arch/pmax/conf/GENERIC: revision 1.147
sys/arch/amiga/conf/WSCONS: revision 1.52
sys/arch/macppc/conf/POWERMAC_G5: revision 1.2
sys/arch/alpha/conf/ALPHA: revision 1.218
sys/arch/sun3/conf/GENERIC: revision 1.133
sys/arch/prep/conf/GENERIC: revision 1.124
sys/arch/alpha/conf/GENERIC: revision 1.291
sys/arch/atari/conf/HADES: revision 1.71
sys/arch/newsmips/conf/GENERIC: revision 1.93
sys/arch/netwinder/conf/GENERIC: revision 1.82
sys/arch/hpcmips/conf/GENERIC: revision 1.190
sys/arch/amiga/conf/AMIGA: revision 1.98
sys/arch/sbmips/conf/GENERIC: revision 1.54
sys/arch/pc532/conf/GENERIC: revision 1.64
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.53
Disable SYSTRACE by default on all kernels (discussed with core)
 1.95.4.2 10-Dec-2006  yamt sync with head.
 1.95.4.1 22-Oct-2006  yamt sync with head
 1.95.2.1 18-Nov-2006  ad Sync with head.
 1.97.18.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.97.16.4 17-Oct-2007  garbled Via a patch from jkunz, put back the ofbus and ofcons code for now, until
we write a better way to handle the console.
 1.97.16.3 03-Oct-2007  garbled Sync with HEAD
 1.97.16.2 26-Jun-2007  garbled Sync with HEAD.
 1.97.16.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.97.10.1 11-Jul-2007  mjf Sync with head.
 1.97.8.5 03-Dec-2007  ad Sync with HEAD.
 1.97.8.4 03-Dec-2007  ad Sync with HEAD.
 1.97.8.3 23-Oct-2007  ad Sync with head.
 1.97.8.2 15-Jul-2007  ad Sync with head.
 1.97.8.1 09-Jun-2007  ad Sync with head.
 1.97.2.1 05-Jun-2007  bouyer Pull up following revision(s) (requested by martin in ticket #699):
sys/arch/hpcmips/conf/GENERIC: revision 1.196
sys/arch/hp700/conf/GENERIC: revision 1.74
sys/arch/i386/conf/GENERIC: revision 1.831
sys/arch/next68k/conf/GENERIC: revision 1.108
sys/arch/alpha/conf/GENERIC: revision 1.313
sys/arch/arc/conf/GENERIC: revision 1.146
sys/arch/cats/conf/GENERIC: revision 1.115
sys/arch/ews4800mips/conf/GENERIC: revision 1.18
sys/arch/landisk/conf/GENERIC: revision 1.8 via patch
sys/arch/sparc64/conf/GENERIC: revision 1.85
sys/arch/pmax/conf/GENERIC: revision 1.152
sys/arch/iyonix/conf/GENERIC: revision 1.38 via patch
sys/arch/amiga/conf/GENERIC: revision 1.245
sys/arch/vax/conf/GENERIC: revision 1.157
sys/arch/prep/conf/GENERIC: revision 1.135
sys/arch/pc532/conf/GENERIC: revision 1.70
sys/arch/sbmips/conf/GENERIC: revision 1.61
sys/arch/mipsco/conf/GENERIC: revision 1.65
sys/arch/cobalt/conf/GENERIC: revision 1.108
sys/arch/ofppc/conf/GENERIC: revision 1.98
sys/arch/amd64/conf/GENERIC: revision 1.148
sys/arch/acorn26/conf/GENERIC: revision 1.50
sys/arch/dreamcast/conf/GENERIC: revision 1.78
sys/arch/mac68k/conf/GENERIC: revision 1.181
sys/arch/hp300/conf/GENERIC: revision 1.139
sys/arch/mmeye/conf/GENERIC: revision 1.88
sys/arch/news68k/conf/GENERIC: revision 1.88
sys/arch/mvme68k/conf/GENERIC: revision 1.71
sys/arch/acorn32/conf/GENERIC: revision 1.79
sys/arch/sparc/conf/GENERIC: revision 1.199
sys/arch/luna68k/conf/GENERIC: revision 1.78
sys/arch/bebox/conf/GENERIC: revision 1.105
sys/arch/macppc/conf/GENERIC: revision 1.256 via patch
sys/arch/x68k/conf/GENERIC: revision 1.134
sys/arch/sun3/conf/GENERIC: revision 1.138
sys/arch/newsmips/conf/GENERIC: revision 1.98
Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
 1.99.14.2 13-Nov-2007  bouyer Sync with HEAD
 1.99.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.99.12.1 18-Oct-2007  yamt sync with head.
 1.99.10.4 23-Mar-2008  matt sync with HEAD
 1.99.10.3 09-Jan-2008  matt sync with HEAD
 1.99.10.2 08-Nov-2007  matt sync with -HEAD
 1.99.10.1 06-Nov-2007  matt sync with HEAD
 1.99.8.5 06-Nov-2007  joerg Sync with HEAD.
 1.99.8.4 06-Nov-2007  joerg Sync with HEAD.
 1.99.8.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.99.8.2 28-Oct-2007  joerg Sync with HEAD.
 1.99.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.105.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.105.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.105.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.106.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.106.2.1 26-Dec-2007  ad Sync with head.
 1.113.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.113.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.113.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.113.2.1 24-Mar-2008  keiichi sync with head.
 1.116.10.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.116.10.1 19-Oct-2008  haad Sync with HEAD.
 1.116.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.116.4.3 11-Aug-2010  yamt sync with head.
 1.116.4.2 11-Mar-2010  yamt sync with head
 1.116.4.1 04-May-2009  yamt sync with head.
 1.118.12.1 07-Jan-2011  matt Deal with split <spr.h> (and a few other misc fixes).
 1.118.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.118.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.122.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.122.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.125.2.4 21-Apr-2011  rmind sync with head
 1.125.2.3 05-Mar-2011  rmind sync with head
 1.125.2.2 03-Jul-2010  rmind sync with head
 1.125.2.1 30-May-2010  rmind sync with head
 1.135.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.135.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.137.2.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.137.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.137.2.2 30-Oct-2012  yamt sync with head
 1.137.2.1 17-Apr-2012  yamt sync with head
 1.138.2.2 11-Mar-2012  mrg sync to latest -current
 1.138.2.1 18-Feb-2012  mrg merge to -current.
 1.139.2.1 08-Mar-2012  riz Pull up following revision(s) (requested by phx in ticket #103):
sys/arch/ofppc/conf/GENERIC: revision 1.140
When detecting a new USB device on the bus ofppc panics in usb_allocmem().
Although the problem doesn't seem to affect other PPC ports, it causes big
trouble for my Pegasos2.
So as long as there is no real solution we should add the option
USB_FRAG_DMA_WORKAROUND to the GENERIC config file.
 1.143.2.4 03-Dec-2017  jdolecek update from HEAD
 1.143.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.143.2.2 23-Jun-2013  tls resync from head
 1.143.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.150.2.1 28-Aug-2013  rmind sync with head
 1.151.6.2 18-Nov-2014  snj Pull up following revision(s) (requested by manu in ticket #251):
sys/arch/acorn26/conf/GENERIC: revision 1.81
sys/arch/acorn32/conf/GENERIC: revision 1.116
sys/arch/alpha/conf/GENERIC: revision 1.362
sys/arch/amd64/conf/ALL: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.404
sys/arch/amd64/conf/XEN3_DOM0: revision 1.112
sys/arch/amd64/conf/XEN3_DOMU: revision 1.60
sys/arch/amiga/conf/GENERIC.in: revision 1.129
sys/arch/amiga/conf/GENERIC: revision 1.311
sys/arch/amigappc/conf/GENERIC: revision 1.24
sys/arch/arc/conf/GENERIC: revision 1.184
sys/arch/bebox/conf/GENERIC: revision 1.145
sys/arch/cats/conf/GENERIC: revision 1.155
sys/arch/cesfic/conf/GENERIC: revision 1.65
sys/arch/cobalt/conf/GENERIC: revision 1.147
sys/arch/dreamcast/conf/GENERIC: revision 1.121
sys/arch/emips/conf/GENERIC: revision 1.15
sys/arch/epoc32/conf/GENERIC: revision 1.8
sys/arch/ews4800mips/conf/GENERIC: revision 1.51
sys/arch/hp300/conf/GENERIC: revision 1.190
sys/arch/hpcmips/conf/GENERIC: revision 1.229
sys/arch/hpcsh/conf/GENERIC: revision 1.106
sys/arch/hppa/conf/GENERIC: revision 1.6
sys/arch/i386/conf/ALL: revision 1.389
sys/arch/i386/conf/GENERIC: revision 1.1118
sys/arch/i386/conf/XEN3_DOM0: revision 1.93
sys/arch/i386/conf/XEN3_DOMU: revision 1.65
sys/arch/ibmnws/conf/GENERIC: revision 1.46
sys/arch/iyonix/conf/GENERIC: revision 1.88
sys/arch/landisk/conf/GENERIC: revision 1.45
sys/arch/luna68k/conf/GENERIC: revision 1.119
sys/arch/mac68k/conf/GENERIC: revision 1.220
sys/arch/macppc/conf/GENERIC: revision 1.320
sys/arch/macppc/conf/MAMBO: revision 1.24
sys/arch/macppc/conf/POWERMAC_G5: revision 1.25
sys/arch/mipsco/conf/GENERIC: revision 1.88
sys/arch/mmeye/conf/GENERIC: revision 1.120
sys/arch/mvme68k/conf/GENERIC: revision 1.94
sys/arch/mvmeppc/conf/GENERIC: revision 1.24
sys/arch/netwinder/conf/GENERIC: revision 1.126
sys/arch/news68k/conf/GENERIC: revision 1.125
sys/arch/newsmips/conf/GENERIC: revision 1.129
sys/arch/next68k/conf/GENERIC: revision 1.139
sys/arch/ofppc/conf/GENERIC: revision 1.157
sys/arch/pmax/conf/GENERIC64: revision 1.21
sys/arch/pmax/conf/GENERIC: revision 1.185
sys/arch/prep/conf/GENERIC: revision 1.174
sys/arch/rs6000/conf/GENERIC: revision 1.33
sys/arch/sandpoint/conf/GENERIC: revision 1.88
sys/arch/sbmips/conf/GENERIC: revision 1.101
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.28
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.104
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.106
sys/arch/shark/conf/GENERIC: revision 1.121
sys/arch/sparc/conf/GENERIC: revision 1.248
sys/arch/sparc/conf/TADPOLE3GX: revision 1.65
sys/arch/sparc64/conf/GENERIC: revision 1.177
sys/arch/sparc64/conf/NONPLUS64: revision 1.44
sys/arch/sun2/conf/GENERIC: revision 1.94
sys/arch/sun3/conf/GENERIC: revision 1.171
sys/arch/vax/conf/GENERIC: revision 1.193
sys/arch/vax/conf/VAX780: revision 1.19
sys/arch/x68k/conf/GENERIC: revision 1.179
sys/arch/zaurus/conf/GENERIC: revision 1.65
sys/ufs/files.ufs: revision 1.38
Remove unused extended attributes kernel options

As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate
 1.151.6.1 14-Nov-2014  martin Pull up following revision(s) (requested by manu in ticket #232):
sys/arch/next68k/conf/GENERIC: revision 1.138
sys/arch/cobalt/conf/GENERIC: revision 1.146
sys/arch/mvme68k/conf/GENERIC: revision 1.93
sys/arch/vax/conf/VAX780: revision 1.18
sys/arch/newsmips/conf/GENERIC: revision 1.128
sys/arch/luna68k/conf/GENERIC: revision 1.118
sys/arch/sbmips/conf/GENERIC: revision 1.100
sys/arch/pmax/conf/GENERIC: revision 1.184
sys/arch/alpha/conf/GENERIC: revision 1.361
sys/arch/sparc64/conf/GENERIC: revision 1.176
sys/arch/sun3/conf/GENERIC: revision 1.170
sys/arch/shark/conf/GENERIC: revision 1.120
sys/arch/landisk/conf/GENERIC: revision 1.44
sys/arch/bebox/conf/GENERIC: revision 1.144
sys/arch/sparc64/conf/NONPLUS64: revision 1.43
sys/arch/sandpoint/conf/GENERIC: revision 1.87
sys/arch/emips/conf/GENERIC: revision 1.14
sys/arch/amd64/conf/XEN3_DOM0: revision 1.111
sys/arch/dreamcast/conf/GENERIC: revision 1.120
sys/arch/cesfic/conf/GENERIC: revision 1.64
sys/arch/mmeye/conf/GENERIC: revision 1.119
sys/arch/epoc32/conf/GENERIC: revision 1.7
sys/arch/x68k/conf/GENERIC: revision 1.178
sys/arch/iyonix/conf/GENERIC: revision 1.87
sys/arch/sun2/conf/GENERIC: revision 1.93
sys/arch/ews4800mips/conf/GENERIC: revision 1.50
sys/arch/amd64/conf/XEN3_DOMU: revision 1.59
sys/arch/acorn26/conf/GENERIC: revision 1.80
sys/arch/acorn32/conf/GENERIC: revision 1.115
sys/arch/macppc/conf/POWERMAC_G5: revision 1.24
sys/arch/i386/conf/GENERIC: revision 1.1117
sys/arch/arc/conf/GENERIC: revision 1.183
sys/arch/cats/conf/GENERIC: revision 1.154
sys/arch/amiga/conf/GENERIC.in: revision 1.128
sys/arch/zaurus/conf/GENERIC: revision 1.64
sys/arch/netwinder/conf/GENERIC: revision 1.125
sys/arch/hppa/conf/GENERIC: revision 1.5
sys/arch/mvmeppc/conf/GENERIC: revision 1.23
sys/arch/macppc/conf/GENERIC: revision 1.319
sys/arch/amiga/conf/GENERIC: revision 1.310
sys/arch/pmax/conf/GENERIC64: revision 1.20
sys/arch/macppc/conf/MAMBO: revision 1.23
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.27
sys/arch/amigappc/conf/GENERIC: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.403
sys/arch/ofppc/conf/GENERIC: revision 1.156
sys/arch/mac68k/conf/GENERIC: revision 1.219
sys/arch/i386/conf/XEN3_DOMU: revision 1.64
sys/arch/mipsco/conf/GENERIC: revision 1.87
sys/arch/hp300/conf/GENERIC: revision 1.189
sys/arch/vax/conf/GENERIC: revision 1.192
sys/arch/news68k/conf/GENERIC: revision 1.124
sys/arch/ibmnws/conf/GENERIC: revision 1.45
sys/arch/hpcsh/conf/GENERIC: revision 1.105
sys/arch/sparc/conf/TADPOLE3GX: revision 1.64
sys/arch/i386/conf/XEN3_DOM0: revision 1.92
sys/arch/sparc/conf/GENERIC: revision 1.247
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.105
sys/arch/prep/conf/GENERIC: revision 1.173
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.103
sys/arch/rs6000/conf/GENERIC: revision 1.32
sys/arch/hpcmips/conf/GENERIC: revision 1.228
Support for UFS1 extended attributes in GENERIC and GENERIC-like kernels
This change just brings UFS1 extended attribute *support* in the kernel,
extended attributes are not enabled unless three conditions are met:
1) filesystem is UFS1 (newfs -O1)
2) .attribute/system and .attribute/user directories are created at fs root
3) filesystem is mounted with -o extattr
Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
 1.157.2.3 28-Aug-2017  skrll Sync with HEAD
 1.157.2.2 05-Feb-2017  skrll Sync with HEAD
 1.157.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.158.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.158.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.161.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.165.4.1 10-Jun-2019  christos Sync with HEAD
 1.165.2.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.165.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.173.2.2 03-Apr-2021  thorpej Sync with HEAD.
 1.173.2.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.175.4.1 01-Aug-2021  thorpej Sync with HEAD.
 1.19 05-Mar-2021  thorpej Don't include mvgbe in this kernel config; that driver has an explicit
warning for the MULTIPROCESSOR case.
 1.18 09-Feb-2012  matt branches: 1.18.60;
Change this to include GENERIC and add options MULTIPROCESSOR.
(old GENERIC.MP was woefully out-of-date)
 1.17 18-Dec-2011  dholland WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
 1.16 22-Nov-2011  tls branches: 1.16.2;

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

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

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.14 31-Dec-2010  phx branches: 1.14.2; 1.14.4;
Support for reading disklabels from RDB partitions in the kernel.
The code will check for a raw disklabel first, then tries to find the
disklabel in an MBR partition and finally constructs it from RDB
partitions.
RDB is probably only needed for the Pegasos platform, so it can be
disabled in the config file (RDB_PART).
 1.13 10-Dec-2010  phx Added viaenv(4), which no longer crashes the system during attachment since
todays bug fix in the driver.
 1.12 23-Nov-2010  hannken Remove unused count from pseudo-device md.
 1.11 08-May-2010  mrg enable IPFILTER_COMPAT in all kernels that have ipfilter already.
canonicalise several of the ipf option segments in various files
(this mostly means adding commented out IPFILTER_DEFAULT_BLOCK,
or adding commented or uncommented IPFILTER_LOG or IPFILTER_LOOKUP
option statements.)

i built about 20 of these kernels to check, but not all of them.
 1.10 29-Apr-2010  chs enable TMPFS in all GENERICs that have MFS enabled.
 1.9 16-Apr-2010  pooka Remove unused count (invariably "4") from pseudo-device fss.
 1.8 07-Mar-2010  plunky branches: 1.8.2;
add uhso(4) device where appropriate
- follow the lead of other USB driver declarations wrt commented out
- (cross-)build tested all these kernels
 1.7 08-Feb-2010  joerg 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.6 05-Dec-2009  pooka branches: 1.6.2;
Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs. User functionality remains the same.
 1.5 24-Jan-2009  mrg add COMPAT_50 to all the configs with COMPAT_40.
 1.4 24-Nov-2008  ad Remove softdep, pass 1. We are focused on improving journalling.

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

Proposed on tech-kern@.
 1.2 31-Jul-2008  simonb branches: 1.2.2;
Add "options WAPBL" to standard GENERIC/INSTALL type configs.
 1.1 08-Apr-2008  garbled branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12;
SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc. Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000. Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
 1.1.12.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.12.1 19-Oct-2008  haad Sync with HEAD.
 1.1.8.4 17-Jan-2009  mjf Sync with HEAD.
 1.1.8.3 28-Sep-2008  mjf Sync with HEAD.
 1.1.8.2 02-Jun-2008  mjf Sync with HEAD.
 1.1.8.1 08-Apr-2008  mjf file GENERIC.MP was added on branch mjf-devfs2 on 2008-06-02 13:22:30 +0000
 1.1.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.4.3 11-Aug-2010  yamt sync with head.
 1.1.4.2 11-Mar-2010  yamt sync with head
 1.1.4.1 04-May-2009  yamt sync with head.
 1.2.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.2.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.6.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.6.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.8.2.3 21-Apr-2011  rmind sync with head
 1.8.2.2 05-Mar-2011  rmind sync with head
 1.8.2.1 30-May-2010  rmind sync with head
 1.14.4.1 08-Feb-2011  bouyer Add QUOTA2 where QUOTA is enabled (and QUOTA2 commented out where QUOTA
is commented out)
 1.14.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.15.4.1 17-Apr-2012  yamt sync with head
 1.16.2.1 18-Feb-2012  mrg merge to -current.
 1.18.60.1 03-Apr-2021  thorpej Sync with HEAD.
 1.3 21-Nov-1999  itojun bring in content of GENERIC.v6 into GENERIC.
remove GENERIC.v6 file (as it is part of GENERIC now).

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

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

XXX what to do with arch/arm32/SHARK{,.v6}?
 1.2 09-Jul-1999  thorpej branches: 1.2.2; 1.2.8;
Add examples for including the kernel crypto bits from either crypto-us
or crypto-intl, commented out, with instructions to use only one, and
adjust the prefix as necessary.
 1.1 01-Jul-1999  itojun branches: 1.1.2;
kernel configuration for IPv6/IPsec. should be in GENERIC in the future.
(source code will be committed soon)
 1.1.2.3 02-Aug-1999  thorpej Update from trunk.
 1.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1 01-Jul-1999  thorpej file GENERIC.v6 was added on branch chs-ubc2 on 1999-07-01 23:16:56 +0000
 1.2.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.2.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.1 28-Feb-2014  matt branches: 1.1.4; 1.1.6; 1.1.10;
Add a PPC64 kernel for testing
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 28-Feb-2014  tls file GENERIC64 was added on branch tls-maxphys on 2014-08-20 00:03:17 +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 28-Feb-2014  yamt file GENERIC64 was added on branch yamt-pagecache on 2014-05-22 11:40:02 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 28-Feb-2014  rmind file GENERIC64 was added on branch rmind-smpnet on 2014-05-18 17:45:20 +0000
 1.3 05-Feb-2008  garbled Nevermind, just yank the bridge64 kernels entirely. I don't want to end
up like i386 here.
 1.2 05-Feb-2008  garbled Rewrite a big chunk of the pmap and locore code for powerpc to better
deal with the 64bit bridge mode. pmap changes by Matt Thomas, rest by myself.

Change pmap.c to work similar to exec_elf.c to allow us to compile in
multiple pmaps to a single kernel. This allows the pmap for bridge64 to
co-exist with the 32bit pmap.

Yank __HAVE_PMAP_PHYSSEG from all the oea code.

Add a new global, "oeacpufeat", which is used early in locore to determine
certain cpu features. This allows us to conditionalize code early in the boot
for certain CPUs that have special needs.

Yank most of the ifdef PPC_OEA_BRIDGE64 code from almost every file it was
found in. Some of it seemed incorrect, and my 7044 booted just fine
without it. It would appear that the bridge cpus treat BAT instructions
as nops, so they seem to be safe.

In ofppc, check the oeacpufeat, and if we are on a 64bit proc, clear
MSR[SF], and ASR[V].

With all of these changes, a kernel with both PPC_OEA and PPC_OEA_BRIDGE64
will boot on the POWERIII-2 cpu. However, it will not yet boot on a 32bit
cpu, because of CACHELINESIZE. Work remains to be done there to fix that.
 1.1 17-Jan-2008  garbled branches: 1.1.2; 1.1.4;
Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.1.4.3 11-Feb-2008  yamt sync with head.
 1.1.4.2 21-Jan-2008  yamt sync with head
 1.1.4.1 17-Jan-2008  yamt file GENERIC_B64 was added on branch yamt-lazymbuf on 2008-01-21 09:38:01 +0000
 1.1.2.2 19-Jan-2008  bouyer Sync with HEAD
 1.1.2.1 17-Jan-2008  bouyer file GENERIC_B64 was added on branch bouyer-xeni386 on 2008-01-19 12:14:38 +0000
 1.2 06-Feb-2009  jym Changes to MEMORY_RBFLAGS option:
- renamed to MEMORY_DISK_RBFLAGS to better fit the rest of the
MEMORY_DISK options(4)
- change default value to RB_AUTOBOOT instead of RB_SINGLE, and adapt
the config(5) files accordingly
- document this option inside options(4)

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

Reviewed by abs@ in private mail.
 1.1 02-Jan-2008  mrg branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.18; 1.1.26;
build an INSTALL kernel. it's just GENERIC with md(4) root space.
 1.1.26.1 03-Mar-2009  skrll Sync with HEAD.
 1.1.18.1 04-May-2009  yamt sync with head.
 1.1.8.2 18-Feb-2008  mjf Sync with HEAD.
 1.1.8.1 02-Jan-2008  mjf file INSTALL was added on branch mjf-devfs on 2008-02-18 21:04:53 +0000
 1.1.6.2 21-Jan-2008  yamt sync with head
 1.1.6.1 02-Jan-2008  yamt file INSTALL was added on branch yamt-lazymbuf on 2008-01-21 09:37:51 +0000
 1.1.4.2 09-Jan-2008  matt sync with HEAD
 1.1.4.1 02-Jan-2008  matt file INSTALL was added on branch matt-armv6 on 2008-01-09 01:47:36 +0000
 1.1.2.2 02-Jan-2008  bouyer Sync with HEAD
 1.1.2.1 02-Jan-2008  bouyer file INSTALL was added on branch bouyer-xeni386 on 2008-01-02 21:48:56 +0000
 1.2 05-Feb-2008  garbled Make bridge mode standard in GENERIC, yank INSTALL_B64
 1.1 23-Jan-2008  garbled branches: 1.1.2;
Add an install kernel for 64bit bridge mode cpus. This will hopefully go
away in the next few months.
 1.1.2.3 11-Feb-2008  yamt sync with head.
 1.1.2.2 04-Feb-2008  yamt sync with head.
 1.1.2.1 23-Jan-2008  yamt file INSTALL_B64 was added on branch yamt-lazymbuf on 2008-02-04 09:22:18 +0000
 1.28 26-Aug-2001  matt Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.27 29-May-2001  mrg branches: 1.27.2;
define _KERNEL_OPT as well as _KERNEL. we will use this in the future to
get kernel "opt_foo.h" headers, rather than _KERNEL && !_LKM.
 1.26 17-Dec-2000  jdolecek branches: 1.26.2;
delete obsolete comment
 1.25 09-May-2000  hubertf Add "install" target, so "make install" after building the kernel
does something useful. The target can be redefined by putting a
install-kernel-${MACHINE_NAME} target that fits your needs into
/etc/mk.conf.
 1.24 09-May-2000  thorpej HAVE_GCC28 -> HAVE_EGCS, and make it match gcc 2.9 as well. Also,
make the use of -Wno-uninitialized explicit, don't rely on a compiler
hack to do it for us.
 1.23 01-Feb-2000  tsutsui Revert STRIPPROG -> STRIP
 1.22 24-Jan-2000  tron Add "dependall" target for comfort.
 1.21 19-Jan-2000  tsutsui STRIP -> STRIPPROG
 1.20 26-Jul-1999  cgd branches: 1.20.2;
be more efficient when doing the SYSTEM_LD_TAIL for -g kernels: don't
copy them just to strip them, use strip -o.
 1.19 09-Jul-1999  mrg clean up a bit after jason :)

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

this makes "prefix" actually work in a usable manner, and now i can move
on to fixing compiler warnings (errors) in the ESP code. :)
 1.18 15-Jan-1999  thorpej branches: 1.18.4;
Some minor, mostly costmetic, changes to CPPFLAGS/CFLAGS.
 1.17 08-Jan-1999  augustss Add -Wpointer-arith warning since `void *' arithmetic is not ANSI C.
 1.16 15-Oct-1998  drochner change handling of libkern:
-sys/lib/libkern builds as library per default (as it was documented all
the time)
-ports able to LKM set "KERN_AS=obj" explicitely in their Makefiles
(for now; should depend on actual "option LKM" or -better- functions
included for LKM use should be pulled in by a stub)
-always link libcompat before libkern - libkern stuff can be referred to
by libcompat, but not the other way
 1.15 05-Sep-1998  lukem distclean is a synonym for cleandir
 1.14 31-May-1998  thorpej Specify a non-profiling C rule.
 1.13 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.12 12-Apr-1998  tv Add -Wno-main conditional on compiler being gcc 2.8 or egcs. (This adds
a HAVE_GCC28 check-variable that can now be used to add other gcc-2.8
flags in cases where they may be useful, or to remove gcc 2.7.2 "bug
workaround" flags.)
 1.11 12-Nov-1997  thorpej Make sure CPP, AR, AS, and RANLIB are defined.
 1.10 12-Nov-1997  thorpej Define LORDER, NM, and TSORT here, like we do the rest of the tools.
 1.9 30-Sep-1997  christos branches: 1.9.2;
PR/4162: Chris Jones: make cleandir does not work properly; it does not
remove the object files and the .depend file in the kernel build directory.
 1.8 12-Jul-1997  leo branches: 1.8.2;
Generate assym.h dependencies when making 'depend'.
 1.7 19-Apr-1997  thorpej Fix a pasto
 1.6 16-Apr-1997  thorpej - Use genassym.sh to facilitate cross-compiling.
- Various clean/catch-up.
 1.5 14-Mar-1997  mycroft Define the `cleankernel' target consistently with other ports.
 1.4 04-Feb-1997  perry Nuke some options GENERIC residue.
 1.3 04-Feb-1997  perry Nuke some GENERIC residue.
 1.2 01-Dec-1996  jonathan * Replace explicit -O2 in CFLAGS with COPTS macro. Default COPTS?= -O2.
Lets users over-ride with makeoptions COPTS="..." in kernel config files.

Leave `mandatory' flags (like -msoft-float which on m68k enforces no
FP in kernel) in CFLAGS.
 1.1 30-Sep-1996  ws PowerPC port
 1.8.2.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.2.1 12-Nov-1997  thorpej Pull up "make sure tools are defined" changes from trunk.
 1.18.4.1 02-Aug-1999  thorpej Update from trunk.
 1.20.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.20.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.26.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.27.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.49 21-Sep-2025  thorpej Give each PowerPC OFW platform its own device_register(), which calls
into the common ofw_device_register(). ofppc's is a simple wrapper.

macppc's, on the other hand, takes care of looking up environmental
sensor descriptive information in the OFW device tree and adds those
properties directly to the sensor device property dictionaries. This
single implementation will replace the duplicated code that's scattered
across multiple macppc i2c controller drivers.
 1.48 12-May-2021  thorpej - Define a device call for PCI bus instances to fetch a direct child's
device handle given the device's device/function #s (extracted from
a pcitag_t). Use it to associate the handle with the child device
at config_found() time.
- Implement this device call for ACPI and OpenFirmware.
- Enable the OpenFirmware variant for evbarm FDT, macppc, ofppc, sparc64.
- Obsolete acpi_device_register(); it is no longer needed.
- Obsolete setting the OpenFirmware handle in PCI devices in the
sparc64 device_register(); it is no longer needed.
 1.47 18-Dec-2017  skrll branches: 1.47.20; 1.47.22;
Generalise FDT and OFW
 1.46 04-Aug-2011  phx Do not overwrite ukbd.h with NO_UKBD_DEVICE.
 1.45 22-Jun-2011  matt Add support pci_intr_setattr.
Export non-inline version of pci api for modules (_MODULE is defined).
Fix definition of pc_conf_hook and pc_conf_interrupt.
Switch to using inlines instead of macros.
Switch ibm4xx to use <powerpc/pci_machdep.h>
 1.44 31-Dec-2010  phx Support for reading disklabels from RDB partitions in the kernel.
The code will check for a raw disklabel first, then tries to find the
disklabel in an MBR partition and finally constructs it from RDB
partitions.
RDB is probably only needed for the Pegasos platform, so it can be
disabled in the config file (RDB_PART).
 1.43 09-Jun-2010  kiyohara Indent.
 1.42 09-Jun-2010  kiyohara Support MV64361 on PegasosII by gt(4).
+ Support gtpci@gt instead of pegasospci more smartly.
+ Support Gigabit Ethernet by mvgbe@gt.
 1.41 14-Mar-2010  kiyohara branches: 1.41.2;
Add fdc@isa.
tested on PegasosII.
 1.40 08-Apr-2008  garbled branches: 1.40.4; 1.40.24;
SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc. Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000. Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
 1.39 20-Feb-2008  drochner branches: 1.39.6;
Since files.wscons et al. are included by ~all ports anyway, include
them in the mi "files" file, and remove include statements from md files.
These shouldn't pull in additional kernel code when not in use, so it
shouldn't do any harm except a risk of namespace collisions which
should be easy to fix.
 1.38 15-Feb-2008  tsutsui Remove obsolete platform support options.
 1.37 24-Dec-2007  phx Make USB, IEEE1394 and viaaudio attach to the Pegasos2.
USB works fine. IEEE1394 is untested. Audio doesn't work (playing white noise).
Need to set IO/MEM-enable for IEEE1394 and audio, as the firmware (Smart
Firmware 1.2) doesn't do it.
Patch approved by Tim Rightnour.
 1.36 10-Dec-2007  garbled Switch ofppc to the unified powerpc majors file. This should make single
user mode work.
 1.35 03-Dec-2007  ad branches: 1.35.2; 1.35.4; 1.35.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.34 26-Nov-2007  garbled Apply a set of patches from Frank Wille to make the genfb attachment work
better on ofppc. In doing so, we also move a few functions around in
macppc and the generic ofw powerpc stuff to allow better sharing of code.
Also, introduce a model_init function.

move ofb_cons.c from macppc/dev to powerpc/oea and rename it to rascons.
This gets rid of some naming confusion, and makes it OFW-MI rather than
macppc specific.
 1.33 07-Nov-2007  garbled Convert ofppc to the shared ofw_autoconf.c
 1.32 06-Nov-2007  garbled Add a bunch of devices to GENERIC. Fix interrupts on the PegasosII with
a nasty little hack. Getting closer to a working system.
 1.31 05-Nov-2007  garbled branches: 1.31.2;
Lots of small changes for ofppc:

Remove the ofb driver. I'm not interested in trying to make this work.
It should be replaced with the genfb driver, which I have added,
commented out because that driver needs work before it will function on
ofppc. (it's too panic-happy, and ofppc needs a working autoconf.c)

Change the way we do isa_inb/outb. The new way is a slightly nastier
hack, but won't run afoul of the other isa drivers as much.

Fix ofw_consinit.c to remove the dependency on ofb.
 1.30 04-Nov-2007  garbled Get rid of the ofppc use of the ofbus completely, for the last time.

Write a complete OF boot console into ofw_consinit.c and rewire a bunch
of the ifdef logic in that file to use it when appropriate on both macppc
and ofppc. Get rid of the attempt to wire up the serial console early,
as that is extremely difficult on ofppc. Yank all the console code out
of ofppc/machdep.c. (This is a boot console only, not a full blown
console like ofcons.c)

Delete all the ofbus references out of the config files, and pull in
dev/ofw/openfirmio.c and dev/ofw/ofw_subr.c directly rather than pulling
in files.ofw. It might be worth going back and adding a files.ofw-nobus
to that directory to allow pulling in the openfirmware driver without
pulling in the whole ofbus mess.

Change rtas driver to connect directly to mainbus, like the PCI bus nodes do.
 1.29 25-Oct-2007  garbled Add a bunch of fixes and minor rewrites to ofppc to bring it closer to
working properly. This is still a work in progress, and all work so far
has been based on the PegasosII machne.

1) Rewrite how the ISA memory and IO space maps are found. More work
will still need to be done in this area.
2) Add a new OFW method of pci configuration. So far I can only get this
to work on the primary PCI bus on the Pegasos. Unsure if this is a
pegasos bug or a code bug.
3) Add the rtas device to ofppc, and add an "rtas_reboot" function to
rtas to allow me to reboot the PegasosII. The rtas driver works, and is
a great start but needs to be changed slightly to allow easier access to
the functions from outside the driver.
4) Fix a number of bugs that existed in the shared PCI code for ofw that
probably weren't tickled by macppc.

There is much much more left to do here, this is all still a work in
progress, but this commit will allow other people to play around with the
code if they want to.
 1.28 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.27 21-May-2007  tsutsui branches: 1.27.8; 1.27.10; 1.27.12; 1.27.14;
- include "dev/pci/files.pci" rather than pulling only dev/pci/pcibusprint.c
- also include "dev/wsfb/files.wsfb" which is required by files.pci
 1.26 10-Mar-2007  jmmv branches: 1.26.2; 1.26.4; 1.26.10;
Implement support for softintrs.
Reviewed, corrected and tested by aymeric@.
 1.25 14-Jan-2007  aymeric branches: 1.25.2;
Basic support for RTAS (CHRP's Run-Time Abstraction Services).
Tested on the Efika; now it knows what time it is.
rtas can attach to mainbus. Not added to any kernel config file yet.
 1.24 11-Dec-2005  christos branches: 1.24.20;
merge ktrace-lwp.
 1.23 28-Nov-2004  jmc branches: 1.23.12;
Reduce pci pullin's to just pcibusprint.c. This doesn't attach pci in a way
config will include any of the generic pci code and all the current code
needs is pcibusprint for now. XXX this really needs more careful looking over
but does allow ofppc to build clean again.
 1.22 05-Mar-2003  matt branches: 1.22.2;
Remove port-specific procfs_machdep.c (since they are all identical and
a better one resides in powerpc/powerpc/).
 1.21 30-Oct-2002  manu Moved binary compatibility options from arch directory to cpu directory
 1.20 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.19 16-Apr-2002  thorpej branches: 1.19.2;
* Move the mii_bitbang attribute into dev/mii/files.mii
* Pull in dev/mii/files.mii from conf/files, rather than playing
the magic "files include order" dance in N machine-dependent
configuration definitions.
 1.18 28-Nov-2001  lukem - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
"options FOO=xxx"). options that take a value were converted to
defparam recently.
- minor whitespace & formatting cleanups
 1.17 29-Oct-2001  thorpej branches: 1.17.2;
Add/rework infrastructure that will allow us to support native
device drivers:
- Various native device entries in cdevsw/bdevsw.
- Rework the interrupt infrastructure to provide more flexibility to
the platform-dependent back-end. Rewrite the "ofwgen" simulated
interrupt routines to reflect the changes.
- Clear out the BAT registers and set the fixed battable entries before
calling the platform init routine. The platform init routine is allowed
to set entries in the battable.
- Don't call the platform cons_init routine until after translation is
enabled -- we might need translation to work in order to access bus
space.
 1.16 22-Oct-2001  thorpej branches: 1.16.2;
Begin the task of splitting up the ofppc port into common code
and platform-specific code, similar to how the Alpha port is
split up.
 1.15 22-Oct-2001  thorpej Various things that make OFW-driver kernels work on my Firepower LX MP
again:
- Special-case the attachment of CPUs, and logically attach them to
"mainbus", attaching them before any other devices. Otherwise,
CPUs would be found very late in the game on my Firepower.
- Sanity check the timebase-frequency property, printing a warning if
it's not the same on each CPU.
- Pass the correct CPU ID to cpu_attach_subr().
- Fetch the platform name from the OFW root node. We can key off this
later when we implement support for native drivers in the ofppc port.
- Use a table of "special" toplevel OFW nodes ... we skip these nodes
during the device configuration phase. This generally includes the
"options", "packages", etc. nodes. Inspired by sparc & sparc64 ports.
 1.14 26-Aug-2001  matt Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.13 18-Jun-2001  christos branches: 1.13.2;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.12 19-Jan-2001  manu branches: 1.12.2;
Added previously created files for powerpc Linux compatibility to the kernel
config system
 1.11 17-Jan-2001  fvdl Add machdep file for procfs. Currently only used for linux-style
/proc/cpuinfo (only active when procfs is mounted with -o linux).
For ports other than the i386 this currently produces an empty
string.
 1.10 14-Mar-2000  oster Add the RAIDframe device major to the machine-dependent config files
so that the right entries get added to dev_name2blk[]. Needed for / on RAID.
(Whoops! I missed checking these in when adding the RAID_AUTOCONFIG stuff.)
 1.9 29-May-1998  sakamoto branches: 1.9.14;
Revert OpenFirmware files to powerpc directory.
OpenFirmware files are used by ofppc/macppc.
 1.8 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.7 24-Feb-1998  mycroft Catch up with changes in dev/ofw. Add mainbus.
 1.6 23-Feb-1998  mycroft Slight rearrangement.
 1.5 27-Jan-1998  sakamoto Import DDB from OpenBSD/powerpc.
 1.4 05-Jan-1998  perry RCSID Police.
 1.3 16-Apr-1997  thorpej - Pull in new ofwmagic.S and soft_spl.c files
- firepowerbugs -> firmworksbugs
 1.2 16-Oct-1996  ws Rename recently checked in KGDB to IPKDB to resolve conflicts with older KGDB
 1.1 30-Sep-1996  ws PowerPC port
 1.9.14.3 11-Feb-2001  bouyer Sync with HEAD.
 1.9.14.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.9.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.13.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.13.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.13.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.16.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.17.2.5 11-Nov-2002  nathanw Catch up to -current
 1.17.2.4 17-Sep-2002  nathanw Catch up to -current.
 1.17.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.17.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.17.2.1 29-Oct-2001  nathanw file files.ofppc was added on branch nathanw_sa on 2002-01-08 00:27:00 +0000
 1.19.2.2 17-May-2002  gehenna Remove old block majors list.
 1.19.2.1 16-May-2002  gehenna Include the list of block/character major numbers.
 1.22.2.1 29-Nov-2004  skrll Sync with HEAD.
 1.23.12.7 27-Feb-2008  yamt sync with head.
 1.23.12.6 21-Jan-2008  yamt sync with head
 1.23.12.5 07-Dec-2007  yamt sync with head
 1.23.12.4 15-Nov-2007  yamt sync with head.
 1.23.12.3 27-Oct-2007  yamt sync with head.
 1.23.12.2 03-Sep-2007  yamt sync with head.
 1.23.12.1 26-Feb-2007  yamt sync with head.
 1.24.20.1 01-Feb-2007  ad Sync with head.
 1.25.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.10.3 17-Oct-2007  garbled Via a patch from jkunz, put back the ofbus and ofcons code for now, until
we write a better way to handle the console.
 1.26.10.2 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.26.10.1 22-May-2007  matt Update to HEAD.
 1.26.4.1 11-Jul-2007  mjf Sync with head.
 1.26.2.4 03-Dec-2007  ad Sync with HEAD.
 1.26.2.3 03-Dec-2007  ad Sync with HEAD.
 1.26.2.2 23-Oct-2007  ad Sync with head.
 1.26.2.1 27-May-2007  ad Sync with head.
 1.27.14.2 13-Nov-2007  bouyer Sync with HEAD
 1.27.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.27.12.1 18-Oct-2007  yamt sync with head.
 1.27.10.4 23-Mar-2008  matt sync with HEAD
 1.27.10.3 09-Jan-2008  matt sync with HEAD
 1.27.10.2 08-Nov-2007  matt sync with -HEAD
 1.27.10.1 06-Nov-2007  matt sync with HEAD
 1.27.8.8 09-Dec-2007  jmcneill Sync with HEAD.
 1.27.8.7 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.27.8.6 11-Nov-2007  joerg Sync with HEAD.
 1.27.8.5 06-Nov-2007  joerg Sync with HEAD.
 1.27.8.4 06-Nov-2007  joerg Sync with HEAD.
 1.27.8.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.27.8.2 28-Oct-2007  joerg Sync with HEAD.
 1.27.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.31.2.4 18-Feb-2008  mjf Sync with HEAD.
 1.31.2.3 27-Dec-2007  mjf Sync with HEAD.
 1.31.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.31.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.35.6.2 02-Jan-2008  bouyer Sync with HEAD
 1.35.6.1 13-Dec-2007  bouyer Sync with HEAD
 1.35.4.1 11-Dec-2007  yamt sync with head.
 1.35.2.1 26-Dec-2007  ad Sync with head.
 1.39.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.40.24.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.40.24.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.40.4.1 11-Aug-2010  yamt sync with head.
 1.41.2.2 05-Mar-2011  rmind sync with head
 1.41.2.1 03-Jul-2010  rmind sync with head
 1.47.22.1 31-May-2021  cjep sync with head
 1.47.20.1 13-May-2021  thorpej Sync with HEAD.
 1.22 10-Dec-2007  garbled Switch ofppc to the unified powerpc majors file. This should make single
user mode work.
 1.21 24-Nov-2006  wiz branches: 1.21.28; 1.21.34; 1.21.38; 1.21.40; 1.21.42;
s/independant/independent/, from Zafer.
 1.20 13-Sep-2006  gdamore branches: 1.20.2;
Convert shark and ofppc to new common ofrtc and MI todr code. Tested
on shark. Ok christos@, martin@.
 1.19 11-Dec-2005  christos branches: 1.19.8; 1.19.20;
merge ktrace-lwp.
 1.18 17-Sep-2005  yamt make VMSWAP optional again.
 1.17 31-Jul-2005  yamt revert "defflag VMSWAP" changes for now.
there seems to be far more people who don't want to edit
their kernel config files than i thought.
 1.16 30-Jul-2005  yamt defflag VMSWAP.
 1.15 10-May-2005  jdolecek branches: 1.15.2;
assign major for nsmb(4)
 1.14 10-Dec-2003  jmc Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
 1.13 24-Oct-2003  jdolecek add necessary majors for miscellaneous devices, such as missing
wscons/scsi/isdn devices
 1.12 24-Oct-2003  matt Remove redunant raid entry.
 1.11 15-Oct-2003  jdolecek add majors for ipfilter, lkm, vnd, tun, raid, cgd, ccd, and md
where missing
 1.10 11-Oct-2003  jdolecek add major for 'filedesc', which is needed for /dev/stdin et. al.
 1.9 10-Oct-2003  jdolecek reassing majors for crypto and pf to use the newly defined MI major
range
 1.8 10-Oct-2003  jdolecek update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
 1.7 05-Oct-2003  jdolecek Add some framework for MI assignment of device majors - add sys/dev/majors
which is automatically included during kernel config, and add comments
to individual machine-dependant majors.* files to assign new MI majors
in MI file.

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

Follows recent discussion on tech-kern@
 1.6 22-Aug-2003  itojun create /dev/crypto
 1.5 27-Jul-2003  itojun reserve cdev major # for PF. ok'ed by technical-exec
 1.4 25-Apr-2003  ragge branches: 1.4.2;
Add ksyms device major.
 1.3 04-Oct-2002  elric branches: 1.3.2;
assign majors for raw and cooked cgd's.
 1.2 06-Sep-2002  gehenna branches: 1.2.2;
Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.1 16-May-2002  gehenna branches: 1.1.2;
file majors.ofppc was initially added on branch gehenna-devsw.
 1.1.2.3 15-Jul-2002  gehenna catch up with -current.
 1.1.2.2 30-May-2002  gehenna Add $NetBSD$
 1.1.2.1 16-May-2002  gehenna Add the list of block/character majors.
 1.2.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.2.2.1 06-Sep-2002  nathanw file majors.ofppc was added on branch nathanw_sa on 2002-09-17 21:16:49 +0000
 1.3.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.2.1 04-Oct-2002  jdolecek file majors.ofppc was added on branch kqueue on 2002-10-10 18:34:47 +0000
 1.4.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.15.2.3 21-Jan-2008  yamt sync with head
 1.15.2.2 30-Dec-2006  yamt sync with head.
 1.15.2.1 21-Jun-2006  yamt sync with head.
 1.19.20.2 12-Jan-2007  ad Sync with head.
 1.19.20.1 18-Nov-2006  ad Sync with head.
 1.19.8.1 14-Sep-2006  yamt sync with head.
 1.20.2.1 10-Dec-2006  yamt sync with head.
 1.21.42.1 13-Dec-2007  bouyer Sync with HEAD
 1.21.40.1 11-Dec-2007  yamt sync with head.
 1.21.38.1 26-Dec-2007  ad Sync with head.
 1.21.34.1 27-Dec-2007  mjf Sync with HEAD.
 1.21.28.1 23-Mar-2008  matt sync with HEAD
 1.15 02-Jun-2012  mrg enable building with ath* at pci?. it worked but my pci atheros card
seems to make netbsd lock up when you try to use it, on at least
ofppc, macppc, amd64 platofrms and last i tried on sparc64, causes
alignment faults. oh well.
 1.14 05-Feb-2008  garbled branches: 1.14.44;
Make bridge mode standard in GENERIC, yank INSTALL_B64
 1.13 11-Jan-2008  mrg enable PCI_NETBSD_CONFIGURE for ofppc.

the call to pci_configure_bus(9) and it's supporting code is
copied verbatim from the prep port.

this allows us to completely remove the really gross pegasos
specific pegasospci_indirect_attach_hook() that set various
pci command regs, since all those devices (mostly work now,
see below) and additionally PCI plugin cards work now too.

it also makes the pegasos onboard vr(4) ethernet work with
disk boot (it previously only worked with netboot.)

in the generic macppc ofw pci conf hook and for pegasos,
don't configure the viaide(4) device, and don't configure
memory space on the fwohci(4) device.


with this, and my other recent ofppc/ppc changes the pegasos
port is mostly functional. the marvell gige is not working,
and my 512mb appears as only about 256mb, but otherwise
this port is almost done!
 1.12 11-Dec-2005  christos branches: 1.12.50; 1.12.56; 1.12.64;
merge ktrace-lwp.
 1.11 17-Sep-2005  yamt include "conf/std".
 1.10 12-Aug-2003  matt branches: 1.10.16;
Remove SPILLSTK leftovers.
 1.9 03-Feb-2003  matt branches: 1.9.2;
Rename PPC_MPC6XX to PPC_OEA (and any mpc6xx reference to oea).
 1.8 02-Feb-2003  matt Perform a rototill of the powerpc code. Mandate use of SPRG0 to store
a pointer to current cpu's cpu_info structure. Use cpu_info for
intstk,intr_depth,still_stk,idle_pcb,curpcb,curlwp,etal even on
non-MULTIPROCESSOR machines. Add common macros GET_CPUINFO and
INIT_CPUINFO to get and initialize the cpu_info struct on startup. Make
ibm4xx use the standard <powerpc/frame.h>. Use IFRAME_xx in ibm4xx
trap_subr.S instead of explicit magic offsets. Move INTSTK and SPILLSTK
to std.<platform>. Change faultbuf to a struct instead of an array.

On MPC6XX cpus, stop using the vector page for temporary space and use
reserved space in cpu_info.
 1.7 25-Apr-2002  nonaka Added PPCDIR
 1.6 12-Jun-2001  tsubai branches: 1.6.2; 1.6.8;
Move "file .../bus_dma.c" line to MD place.
Add options PPC_MPC6XX on missed ports.
XXX I think PPC_OEA is better name.
 1.5 22-Jun-2000  fvdl branches: 1.5.2;
Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC.
 1.4 15-Nov-1999  fvdl branches: 1.4.4;
Add

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

to all std.* files, so that soft dependencies can be activated using
"options SOFTDEP".
 1.3 24-Mar-1999  mrg branches: 1.3.8; 1.3.14;
clean up kernel/config files files for machVM lossage.
 1.2 03-Sep-1998  sakamoto Use UVM by default.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.4.1 23-Jun-2000  fvdl As on the trunk, update these for the move of ffs_softdep.c into the
kernel source itself. Remove prefix construction, and add the SOFTDEP
option to GENERIC kernels.
 1.5.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.6.8.1 12-Jun-2001  nathanw file std.ofppc was added on branch nathanw_sa on 2002-06-20 03:40:25 +0000
 1.6.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.3 11-Feb-2008  yamt sync with head.
 1.10.16.2 21-Jan-2008  yamt sync with head
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.12.64.1 11-Jan-2008  bouyer Sync with HEAD
 1.12.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.12.50.1 23-Mar-2008  matt sync with HEAD
 1.14.44.1 30-Oct-2012  yamt sync with head
 1.2 05-Feb-2008  garbled Nevermind, just yank the bridge64 kernels entirely. I don't want to end
up like i386 here.
 1.1 17-Jan-2008  garbled branches: 1.1.2; 1.1.4;
Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.1.4.3 11-Feb-2008  yamt sync with head.
 1.1.4.2 21-Jan-2008  yamt sync with head
 1.1.4.1 17-Jan-2008  yamt file std.ofppc.bridge was added on branch yamt-lazymbuf on 2008-01-21 09:37:52 +0000
 1.1.2.2 19-Jan-2008  bouyer Sync with HEAD
 1.1.2.1 17-Jan-2008  bouyer file std.ofppc.bridge was added on branch bouyer-xeni386 on 2008-01-19 12:14:38 +0000
 1.1 28-Feb-2014  matt branches: 1.1.4; 1.1.6; 1.1.10;
Add a PPC64 kernel for testing
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 28-Feb-2014  tls file std.ofppc64 was added on branch tls-maxphys on 2014-08-20 00:03:17 +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 28-Feb-2014  yamt file std.ofppc64 was added on branch yamt-pagecache on 2014-05-22 11:40:02 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 28-Feb-2014  rmind file std.ofppc64 was added on branch rmind-smpnet on 2014-05-18 17:45:20 +0000
 1.22 21-Dec-2015  christos Add mips fenv.h (From FreeBSD)
 1.21 23-Jul-2014  alnsn branches: 1.21.4;
Rename sljitarch.h to sljit_machdep.h.
 1.20 17-Nov-2013  alnsn branches: 1.20.2;
Enable sljit and bpfjit on powerpc.
 1.19 11-Dec-2005  christos branches: 1.19.112; 1.19.122; 1.19.128;
merge ktrace-lwp.
 1.18 20-Oct-2003  matt Reorganize the way powerpc port install machine specific headers.
Use <powerpc/oea/bat.h> exclusively and remove <machine/bat.h> and
<powerpc/bat.h>. Remove unneeded <machine/cpufunc.h>. To insure
1:1 correspondence of <powerpc/FOO.h> to <machine/FOO.h> include
"../../powerpc/include/Makefile" in "arch/FOO/include/Makefile".
Incororpate <byte_swap.h> into <bswap.h> and then byte_swap.h
 1.17 18-Jan-2003  thorpej branches: 1.17.2;
Merge the nathanw_sa branch.
 1.16 26-Nov-2002  lukem Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.15 21-Sep-2002  chs don't install a couple headers that are of no use in userland.
 1.14 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.13 24-Oct-2001  thorpej branches: 1.13.2; 1.13.10;
Need to install intr.h.
 1.12 03-May-2001  soren branches: 1.12.2; 1.12.6;
PPC machine type tags haven't been used for a while.
 1.11 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.10 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.9 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
 1.8 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.7 26-Jun-2000  kleink branches: 1.7.2;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.6 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.5 17-Mar-2000  tron Install "machineendian_machdep.h".
 1.4 23-Dec-1999  kleink C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
 1.3 15-Jan-1999  bouyer branches: 1.3.8;
Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
 1.2 04-Dec-1998  sakamoto Not used.
 1.1 12-Jun-1998  cgd Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.3.8.2 21-Apr-2001  bouyer Sync with HEAD
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.12.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.12.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.12.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.10.1 31-Aug-2002  gehenna catch up with -current.
 1.13.2.5 11-Dec-2002  thorpej Sync with HEAD.
 1.13.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.13.2.3 13-Aug-2002  nathanw Catch up to -current.
 1.13.2.2 05-Nov-2001  briggs Initial SA support for ppc. Test-booted on sandpoint, macppc, & walnut.
mcontext and cpu_getmcontext()/cpu_setmcontext() from Klaus Klein
<kleink@netbsd.org>.
 1.13.2.1 24-Oct-2001  briggs file Makefile was added on branch nathanw_sa on 2001-11-05 19:46:14 +0000
 1.17.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.128.1 18-May-2014  rmind sync with head
 1.19.122.2 03-Dec-2017  jdolecek update from HEAD
 1.19.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.112.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.20.2.1 10-Aug-2014  tls Rebase.
 1.21.4.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.3 05-Jun-2011  matt Remove <machine/atomic.h>; use <sys/atomic.h> instead.
Add <powerpc/cpuset.h> (for mpc85xx pmap).
Add some initial MP code for mpc85xx
Rework ipi code to be common across all ppcs
Change PPC to keep curlwp in %r13 while in the kernel.
Move astpending from cpu_info to mdlwp
Improve cpu_need_resched to be more MP friendly.
 1.2 11-Dec-2005  christos branches: 1.2.100; 1.2.106; 1.2.110;
merge ktrace-lwp.
 1.1 20-Oct-2003  matt branches: 1.1.4;
Reorganize the way powerpc port install machine specific headers.
Use <powerpc/oea/bat.h> exclusively and remove <machine/bat.h> and
<powerpc/bat.h>. Remove unneeded <machine/cpufunc.h>. To insure
1:1 correspondence of <powerpc/FOO.h> to <machine/FOO.h> include
"../../powerpc/include/Makefile" in "arch/FOO/include/Makefile".
Incororpate <byte_swap.h> into <bswap.h> and then byte_swap.h
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 20-Oct-2003  skrll file atomic.h was added on branch ktrace-lwp on 2004-08-03 10:38:40 +0000
 1.2.110.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.2.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.100.1 12-Jun-2011  rmind sync with head
 1.19 05-Mar-2024  thorpej Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().

It's a small step, but it's a step.
 1.18 27-Feb-2021  thorpej Un-do a bunch of misguided code sharing. It's not really shared if it's
full of platform-specific #ifdefs:
- ofwoea_batinit() is gone; just do what's needed early in macppc / ofppc
initppc() functions.
- Get a bunch of Mac-specific stuff out of ofwoea_initppc().
 1.17 07-Jul-2020  rin branches: 1.17.2;
It turned out that using some Open Firmware routines causes the system
freeze after calling OF_quiesce().

This is why setting color palette crash the system for some Power Mac G5
models, like PowerMac11,2.

Therefore, stop using color-palette and backlight callbacks for genfb(4)
in this case.

Also, postpone OF_quiesce() after rascons_init_rasops(), and initialize
color palette there if OF is going to be quiesced and color depth is 8.

Now, color palette for wscons is initialized correctly for PowerMac11,2.
 1.16 08-Jan-2019  mrg workaround a problem with the pegasos firmware interface:
attempting to use /dev/openfirm on this machine hangs hard.

this isn't a new problem, and i've been meaning to try to
figure it out for years, but it's become a problem since
the xf86-video-radeon driver gained code to look for the
macppc model using this interface.

this is why xorg-server 1.18 and 1.20 hang recently on the
pegasosII.


this change is fairly ugly but i couldn't think of a less
ugly method to avoid /dev/openfirm working just on this
one platform. introduce new __OPENFIRMIO_OPEN_CHECK_BROKEN
macro and associated __openfirmio_open_check_broken(), and
use them in the new openfirmopen() to fail opens.

include proplib.h in macppc and ofppc autoconf.h since they
use it.
 1.15 01-Jul-2011  dyoung branches: 1.15.52; 1.15.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 18-Jun-2011  matt struct device * -> device_t
struct cfdata * -> cfdata_t
use device accessors, use device_private.
some softc/device_t splits (macppc needs a bunch more)
aprint*_dev used considerably more
 1.13 08-Apr-2008  garbled branches: 1.13.36;
SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc. Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000. Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
 1.12 11-Feb-2008  garbled branches: 1.12.6;
Use model_init to clean up how we decide the ranges for
PCI_NETBSD_CONFIGURE. Add some code to hopefully better handle the
firepower and powerstackII, based on the OFW dumps from those machines.
Untested on those machines, but doesn't break anything on pegasos/7044.
 1.11 17-Jan-2008  garbled Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.10 26-Nov-2007  garbled branches: 1.10.6;
Apply a set of patches from Frank Wille to make the genfb attachment work
better on ofppc. In doing so, we also move a few functions around in
macppc and the generic ofw powerpc stuff to allow better sharing of code.
Also, introduce a model_init function.

move ofb_cons.c from macppc/dev to powerpc/oea and rename it to rascons.
This gets rid of some naming confusion, and makes it OFW-MI rather than
macppc specific.
 1.9 13-Nov-2007  garbled Add code to detect and initialize the com port correctly, so that we have an
actual real console when booting.
 1.8 07-Nov-2007  garbled Convert ofppc to the shared ofw_autoconf.c
 1.7 25-Oct-2007  garbled branches: 1.7.2;
Add a bunch of fixes and minor rewrites to ofppc to bring it closer to
working properly. This is still a work in progress, and all work so far
has been based on the PegasosII machne.

1) Rewrite how the ISA memory and IO space maps are found. More work
will still need to be done in this area.
2) Add a new OFW method of pci configuration. So far I can only get this
to work on the primary PCI bus on the Pegasos. Unsure if this is a
pegasos bug or a code bug.
3) Add the rtas device to ofppc, and add an "rtas_reboot" function to
rtas to allow me to reboot the PegasosII. The rtas driver works, and is
a great start but needs to be changed slightly to allow easier access to
the functions from outside the driver.
4) Fix a number of bugs that existed in the shared PCI code for ofw that
probably weren't tickled by macppc.

There is much much more left to do here, this is all still a work in
progress, but this commit will allow other people to play around with the
code if they want to.
 1.6 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.5 18-Sep-2002  chs branches: 1.5.22; 1.5.64; 1.5.72; 1.5.82; 1.5.84; 1.5.86; 1.5.88;
implement device_register() for ofppc.
use ofcons_cnprobe().
 1.4 05-Jul-2002  matt Peform a rototill over the powerpc-based ports.

Move the trap/vector initialization for MPC6xx ports to mpc6xx_machdep.c
Also move softnet, install_extintr, mapiodev, kvtop. Add common BAT
initialization code.

Add user Altivec support.

Fix calls to OF_call_method in macppc/macppc/machdep.c.

Use ci_fpuproc in cpu_info instead of separate fpuproc.

Add separate syscall.c and defined __HAVE_SYSCALL_INTERN.
 1.3 22-Oct-2001  thorpej branches: 1.3.4; 1.3.12;
Begin the task of splitting up the ofppc port into common code
and platform-specific code, similar to how the Alpha port is
split up.
 1.2 22-Oct-2001  thorpej Fetch the platform name earlier, so we can determine what kind of
system we're running on earlier.
 1.1 26-Aug-2001  matt branches: 1.1.4;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.1.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 26-Aug-2001  thorpej file autoconf.h was added on branch kqueue on 2001-09-13 01:14:12 +0000
 1.3.12.1 16-Jul-2002  gehenna catch up with -current.
 1.3.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.2 01-Aug-2002  nathanw Catch up to -current.
 1.3.4.1 22-Oct-2001  nathanw file autoconf.h was added on branch nathanw_sa on 2002-08-01 02:42:54 +0000
 1.5.88.3 18-Nov-2007  bouyer Sync with HEAD
 1.5.88.2 13-Nov-2007  bouyer Sync with HEAD
 1.5.88.1 25-Oct-2007  bouyer Sync with HEAD.
 1.5.86.1 18-Oct-2007  yamt sync with head.
 1.5.84.4 23-Mar-2008  matt sync with HEAD
 1.5.84.3 09-Jan-2008  matt sync with HEAD
 1.5.84.2 08-Nov-2007  matt sync with -HEAD
 1.5.84.1 06-Nov-2007  matt sync with HEAD
 1.5.82.5 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.5.82.4 14-Nov-2007  joerg Sync with HEAD.
 1.5.82.3 11-Nov-2007  joerg Sync with HEAD.
 1.5.82.2 28-Oct-2007  joerg Sync with HEAD.
 1.5.82.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.5.72.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.5.64.2 03-Dec-2007  ad Sync with HEAD.
 1.5.64.1 23-Oct-2007  ad Sync with head.
 1.5.22.5 27-Feb-2008  yamt sync with head.
 1.5.22.4 21-Jan-2008  yamt sync with head
 1.5.22.3 07-Dec-2007  yamt sync with head
 1.5.22.2 15-Nov-2007  yamt sync with head.
 1.5.22.1 27-Oct-2007  yamt sync with head.
 1.7.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.7.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.7.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.10.6.1 19-Jan-2008  bouyer Sync with HEAD
 1.12.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.36.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.15.54.1 10-Jun-2019  christos Sync with HEAD
 1.15.52.1 18-Jan-2019  pgoyette Synch with HEAD
 1.17.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.2 20-Oct-2003  matt Reorganize the way powerpc port install machine specific headers.
Use <powerpc/oea/bat.h> exclusively and remove <machine/bat.h> and
<powerpc/bat.h>. Remove unneeded <machine/cpufunc.h>. To insure
1:1 correspondence of <powerpc/FOO.h> to <machine/FOO.h> include
"../../powerpc/include/Makefile" in "arch/FOO/include/Makefile".
Incororpate <byte_swap.h> into <bswap.h> and then byte_swap.h
 1.1 28-May-1998  sakamoto branches: 1.1.48;
Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1.48.1 03-Aug-2004  skrll Sync with HEAD
 1.2 21-Aug-1999  simonb Include <sys/bswap.h> for function prototypes. i386, pc532 and vax
still include <machine/byte_swap.h> and define macros for some of
the bswap*() functions.
 1.1 15-Jan-1999  bouyer Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
 1.13 17-Jul-2011  dyoung Enable new-style <sys/bus.h> on several PowerPC ports supporting PCI
buses. Make non-inline implementations of bus_space(9) and bus_dma(9)
routines and move them to appropriate .c files.

This may leave amigappc in a bad state, sorry. Fortunately, it will be
easy to repair by imitating the bus.h -> bus_{defs,funcs}.h split in
some other PowerPC port.
 1.12 04-Nov-2007  garbled Reorder the includes in bus.h to be correct, and add the missing defines for
PHYS_TO_BUS_MEM and BUS_MEM_TO_PHYS. Noticed by Frank Wille.
 1.11 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.10 04-Mar-2007  christos branches: 1.10.2; 1.10.10; 1.10.18; 1.10.20; 1.10.22; 1.10.24;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 21-Feb-2007  mrg add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
bus_addr_t min_addr,
bus_addr_t max_addr,
bus_dma_tag_t *newtag,
int flags)
void _bus_dmatag_destroy(bus_dma_tag_t tag)

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

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

XXX: bus_dma(9) needs an update still.
 1.8 11-Dec-2005  christos branches: 1.8.26;
merge ktrace-lwp.
 1.7 09-Mar-2005  matt branches: 1.7.4;
Add a dm_maxsegsz public member to bus_dmamap_t. This allows a user of the API
to select the maximum segment size for each bus_dmamap_load (up to the maxsegsz
supplied to bus_dmamap_create). dm_maxsegsz is reset to the value supplied to
bus_dmamap_create when the dmamap is unloaded.
 1.6 24-Oct-2003  matt branches: 1.6.8; 1.6.10;
Add _bus_dma_phys_to_bus_mem_generic and _bus_dma_bus_mem_to_phys_generic.
 1.5 23-Jun-2003  aymeric branches: 1.5.2;
s/PHYS_TO_PCI_MEM/PHYS_TO_BUS_MEM/
s/PCI_MEM_TO_PHYS/BUS_MEM_TO_PHYS/
to match generic PPC code

Noticed by Nicolas Ollinger
 1.4 15-Jun-2003  fvdl Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
 1.3 28-Jan-2003  kent Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it.
 1.2 16-Sep-2002  chs fix printf format string.
 1.1 29-Oct-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Check in of work-in-progress of Firepower native device support.
We can find devices in PCI configuration space, but not much else.
 1.1.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 29-Oct-2001  thorpej file bus.h was added on branch kqueue on 2002-01-10 19:47:10 +0000
 1.1.4.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.4.1 29-Oct-2001  thorpej file bus.h was added on branch thorpej-mips-cache on 2001-11-12 21:17:23 +0000
 1.1.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.1 29-Oct-2001  nathanw file bus.h was added on branch nathanw_sa on 2002-09-17 21:16:50 +0000
 1.5.2.4 01-Apr-2005  skrll Sync with HEAD.
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.7.4.4 15-Nov-2007  yamt sync with head.
 1.7.4.3 27-Oct-2007  yamt sync with head.
 1.7.4.2 03-Sep-2007  yamt sync with head.
 1.7.4.1 26-Feb-2007  yamt sync with head.
 1.8.26.2 12-Mar-2007  rmind Sync with HEAD.
 1.8.26.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.10.24.2 13-Nov-2007  bouyer Sync with HEAD
 1.10.24.1 25-Oct-2007  bouyer Sync with HEAD.
 1.10.22.1 18-Oct-2007  yamt sync with head.
 1.10.20.1 06-Nov-2007  matt sync with HEAD
 1.10.18.2 04-Nov-2007  jmcneill Sync with HEAD.
 1.10.18.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.10.10.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.10.2.3 03-Dec-2007  ad Sync with HEAD.
 1.10.2.2 03-Dec-2007  ad Sync with HEAD.
 1.10.2.1 23-Oct-2007  ad Sync with head.
 1.1 01-Jul-2011  dyoung Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet. Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
 1.1 01-Jul-2011  dyoung Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet. Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.24 20-Jun-2011  matt Don't expose port-specific if _MODULE is defined.
Don't _MACHINE_CPU_H_, _<PORT>_CPU_H_
 1.23 08-Apr-2008  garbled branches: 1.23.36;
SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc. Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000. Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
 1.22 07-Feb-2008  garbled branches: 1.22.6;
Add some simple code to print out what the OFW thinks the cache
configuration of the machine is. Amusingly, the OFW on the pegasos is
dead wrong.

Bump CPU_MAXNUM to 8, because, thats probably a reasonable number for now.
 1.21 17-Oct-2007  garbled branches: 1.21.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.20 01-Sep-2007  pavel branches: 1.20.2; 1.20.4;
Put the declaration of cpu_softc and #include of sys/device.h inside
#ifdef _KERNEL to reduce the namespace pollution from proplib which
causes build failure in libexec/ld.elf_so.
 1.19 18-Sep-2002  chs branches: 1.19.22; 1.19.64; 1.19.72; 1.19.78; 1.19.82; 1.19.84;
implement device_register() for ofppc.
use ofcons_cnprobe().
 1.18 22-Oct-2001  thorpej branches: 1.18.4;
Begin the task of splitting up the ofppc port into common code
and platform-specific code, similar to how the Alpha port is
split up.
 1.17 26-Aug-2001  matt Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.16 30-May-2001  mrg branches: 1.16.2;
use _KERNEL_OPT
 1.15 13-Apr-2001  thorpej Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.14 12-Apr-2001  thorpej splimp -> splvm
 1.13 14-Jan-2001  thorpej branches: 1.13.2;
Make sure everybody has an splvm() and equate it with splimp() (splimp()
is the historical name for this interrupt level, and the historical name
is going to go away in the near future).
 1.12 14-Dec-2000  mycroft Partial syscall cleanup, as per other ports.
 1.11 16-Nov-2000  thorpej Need to provide CACHELINESIZE in _STANDALONE environments, too.
 1.10 25-Aug-2000  thorpej Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity. Its use in
roundrobin() still needs some work.
 1.9 22-Aug-2000  thorpej Add spllock(). See spl(9) for details.
 1.8 21-Aug-2000  thorpej Make sure we provide splsched() as described in spl(9).
 1.7 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.6 10-Aug-1999  thorpej branches: 1.6.2;
Define cpu_number() as discussed on tech-smp.
 1.5 05-Aug-1999  thorpej Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied. Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

This fixes a problem with using the "rnd" pseudo-device from within
interrupt context to extract random data (e.g. from within the softnet
interrupt) where doing so would incorrectly unblock interrupts (causing
all sorts of lossage).

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX. This platforms still have this bug until their
XXX spl*() functions are fixed.
 1.4 17-Apr-1999  ws Modify syncicache on PowerPC from an inline to a real function.
Support different cache line sizes with the same object code in userland.
While here, move the function to implementation name space.
 1.3 05-Nov-1997  thorpej branches: 1.3.10;
asm -> __asm__, volatile -> __volatile
 1.2 16-Apr-1997  thorpej branches: 1.2.8;
Definitions for machine_vec interface, from Wolfgang Solfrank.
 1.1 30-Sep-1996  ws PowerPC port
 1.2.8.1 05-Nov-1997  thorpej Update from trunk: asm -> __asm__, volatile -> __volatile
 1.3.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.6.2.5 21-Apr-2001  bouyer Sync with HEAD
 1.6.2.4 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.6.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.6.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.6.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.16.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.16.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.18.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.18.4.1 22-Oct-2001  nathanw file cpu.h was added on branch nathanw_sa on 2002-10-18 02:39:18 +0000
 1.19.84.2 23-Mar-2008  matt sync with HEAD
 1.19.84.1 06-Nov-2007  matt sync with HEAD
 1.19.82.2 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.19.82.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.19.78.1 03-Sep-2007  skrll Sync with HEAD.
 1.19.72.2 03-Oct-2007  garbled Sync with HEAD
 1.19.72.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.19.64.2 23-Oct-2007  ad Sync with head.
 1.19.64.1 09-Oct-2007  ad Sync with head.
 1.19.22.3 11-Feb-2008  yamt sync with head.
 1.19.22.2 27-Oct-2007  yamt sync with head.
 1.19.22.1 03-Sep-2007  yamt sync with head.
 1.20.4.1 25-Oct-2007  bouyer Sync with HEAD.
 1.20.2.1 18-Oct-2007  yamt sync with head.
 1.21.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.22.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.36.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.1 05-Feb-2003  nakayama Replace machine/rnd.h with more appropriate name to share it
with cycle counter based microtime in kern/kern_microtime.c.
 1.2 26-Apr-2011  joerg Remove Darwin, MACH and Mach-O support.
 1.1 08-Dec-2002  manu branches: 1.1.2; 1.1.136; 1.1.142;
A working fork/vfork implementation. Darwin fork differs from our fork by
two ways:
- the child gets its pid as retval[0] (userland stub will turn it into a 0),
retval[1] is 1 and it is 0 in the parent.
- in the child, the fork syscall is successful, hence we must skip the next
instruction.
 1.1.142.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.136.1 31-May-2011  rmind sync with head
 1.1.2.2 11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 08-Dec-2002  thorpej file darwin_machdep.h was added on branch nathanw_sa on 2002-12-11 06:11:32 +0000
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.11 02-Feb-2012  phx Fixed writing of MBR disklabel. It was written by disklabel(8) -r directly
into sector 0, corrupting the MBR. Moved to sector 1.
Removed MBR_LABELSECTOR, which is no longer needed.
 1.10 30-Aug-2011  bouyer branches: 1.10.2; 1.10.6;
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.9 31-Dec-2010  phx Support for reading disklabels from RDB partitions in the kernel.
The code will check for a raw disklabel first, then tries to find the
disklabel in an MBR partition and finally constructs it from RDB
partitions.
RDB is probably only needed for the Pegasos platform, so it can be
disabled in the config file (RDB_PART).
 1.8 23-Nov-2009  pooka branches: 1.8.4;
If cpu_disklabel includes struct dkbad, define __HAVE_DISKLABEL_DKBAD.
This allows use of subr_disk_mbr on all archs. Default to it for
the rump disk component. No functional change for regular kernels.
(The other option would've been to include dkbad in disklabels
everywhere, but arguably this approach has less possible side-effects,
especially given that wedges and related magic will take over the
world any second now).
 1.7 17-Oct-2007  garbled branches: 1.7.20;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.6 10-May-2003  thorpej branches: 1.6.18; 1.6.60; 1.6.68; 1.6.78; 1.6.80; 1.6.82; 1.6.84;
Remove redundant bounds_check_with_label() prototype.
 1.5 27-Jan-1999  thorpej Use <sys/disklabel_mbr.h>
 1.4 07-Jul-1998  thorpej Use fixed-size types.
 1.3 02-Mar-1998  drochner Change MBR partition type for NetBSD to 0xa9, like the i386 port.
Provide compatibility via COMPAT_386BSD_MBRPART.
 1.2 16-Apr-1997  thorpej Don't define two partition types for NetBSD - just use the standard 0xa5.
(Eww, DOS MBR)
 1.1 30-Sep-1996  ws PowerPC port
 1.6.84.1 25-Oct-2007  bouyer Sync with HEAD.
 1.6.82.1 18-Oct-2007  yamt sync with head.
 1.6.80.1 06-Nov-2007  matt sync with HEAD
 1.6.78.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.6.68.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.6.60.1 23-Oct-2007  ad Sync with head.
 1.6.18.1 27-Oct-2007  yamt sync with head.
 1.7.20.1 11-Mar-2010  yamt sync with head
 1.8.4.1 05-Mar-2011  rmind sync with head
 1.10.6.1 18-Feb-2012  mrg merge to -current.
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.2 17-Mar-2000  mycroft In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.1 28-May-1998  sakamoto branches: 1.1.14;
Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1 17-Mar-2000  mycroft branches: 1.1.6;
In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 17-Mar-2000  bouyer file endian_machdep.h was added on branch thorpej_scsipi on 2000-11-20 20:18:40 +0000
 1.1 20-Dec-2015  christos branches: 1.1.2; 1.1.18;
new powerpc fenv.h
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 20-Dec-2015  jdolecek file fenv.h was added on branch tls-maxphys on 2017-12-03 11:36:34 +0000
 1.1.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.1.2.1 20-Dec-2015  skrll file fenv.h was added on branch nick-nhusb on 2015-12-27 12:09:40 +0000
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.4 07-Sep-2015  dholland Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

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

Extra verification by snj@.
 1.2 17-Oct-2007  garbled branches: 1.2.2; 1.2.4; 1.2.8; 1.2.48; 1.2.54; 1.2.56;
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.1 21-Jun-2007  garbled branches: 1.1.2; 1.1.6; 1.1.8; 1.1.10;
file grfioctl.h was initially added on branch ppcoea-renovation.
 1.1.10.1 25-Oct-2007  bouyer Sync with HEAD.
 1.1.8.1 18-Oct-2007  yamt sync with head.
 1.1.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.1.2.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.2.56.1 17-Feb-2011  bouyer Sync with HEAD
 1.2.54.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.48.1 05-Mar-2011  rmind sync with head
 1.2.8.2 06-Nov-2007  matt sync with HEAD
 1.2.8.1 17-Oct-2007  matt file grfioctl.h was added on branch matt-armv6 on 2007-11-06 23:19:57 +0000
 1.2.4.2 27-Oct-2007  yamt sync with head.
 1.2.4.1 17-Oct-2007  yamt file grfioctl.h was added on branch yamt-lazymbuf on 2007-10-27 11:27:26 +0000
 1.2.2.2 23-Oct-2007  ad Sync with head.
 1.2.2.1 17-Oct-2007  ad file grfioctl.h was added on branch vmlocking on 2007-10-23 20:35:58 +0000
 1.3.32.1 22-Sep-2015  skrll Sync with HEAD
 1.3.14.1 03-Dec-2017  jdolecek update from HEAD
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 integer constant macros.
 1.1.12.2 14-Apr-2001  kleink Add definitions of C99 integer constant macros.
 1.1.12.1 14-Apr-2001  kleink file int_const.h was added on branch nathanw_sa on 2001-04-14 22:38:41 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 14-Apr-2001  bouyer file int_const.h was added on branch thorpej_scsipi on 2001-04-21 17:54:26 +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:16 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_fmtio.h was added on branch thorpej_scsipi on 2001-04-21 17:54:26 +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:11 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 15-Apr-2001  bouyer file int_limits.h was added on branch thorpej_scsipi on 2001-04-21 17:54:26 +0000
 1.1 14-Apr-2001  kleink branches: 1.1.2; 1.1.4; 1.1.12;
Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.2 14-Apr-2001  kleink Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
 1.1.12.1 14-Apr-2001  kleink file int_mwgwtypes.h was added on branch nathanw_sa on 2001-04-14 12:20:00 +0000
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.1 14-Apr-2001  bouyer file int_mwgwtypes.h was added on branch thorpej_scsipi on 2001-04-21 17:54:26 +0000
 1.1 26-Jun-2000  kleink branches: 1.1.2;
Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.2.1 26-Jun-2000  bouyer file int_types.h was added on branch thorpej_scsipi on 2000-11-20 20:18:41 +0000
 1.16 17-Jun-2011  matt intr.h must not include cpu due to deadly embrace with SOFTINT_COUNT.
Cleanup intr.h so MD definitions can overload common definitions.
Rototill pic/intr.c. Virtual IRQs can now be reclaimed. separate virq
from hwirq from picirq. Redo intr mask calculations.
tested on pmppc and macppc (MP).
 1.15 05-Jun-2011  matt Remove <machine/atomic.h>; use <sys/atomic.h> instead.
Add <powerpc/cpuset.h> (for mpc85xx pmap).
Add some initial MP code for mpc85xx
Rework ipi code to be common across all ppcs
Change PPC to keep curlwp in %r13 while in the kernel.
Move astpending from cpu_info to mdlwp
Improve cpu_need_resched to be more MP friendly.
 1.14 13-Nov-2010  uebayasi branches: 1.14.2; 1.14.6;
sys/device.h is not suitable for such low-level definitions.
 1.13 24-Apr-2010  kiyohara Support 64-bit imask for powerpc/pic.
 1.12 28-Apr-2008  martin branches: 1.12.20; 1.12.22;
Remove clause 3 and 4 from TNF licenses
 1.11 17-Oct-2007  garbled branches: 1.11.16; 1.11.18; 1.11.20;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.10 14-Jul-2007  ad branches: 1.10.8; 1.10.10; 1.10.12; 1.10.14;
Generic soft interrupts are mandatory.
 1.9 10-Mar-2007  jmmv branches: 1.9.2; 1.9.10;
Implement support for softintrs.
Reviewed, corrected and tested by aymeric@.
 1.8 16-Feb-2007  ad branches: 1.8.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.7 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.6 23-Nov-2005  nonaka branches: 1.6.20; 1.6.22;
In decr_intr(), update lasttb only when clock interrupt is not masked.
(sync with macppc/macppc/clock.c: rev.1.11 -> 1.12)
 1.5 03-Sep-2003  matt branches: 1.5.16; 1.5.24;
Move CLKF_BASEPRI to machine specific <intr.h> file since it depends on
the encoding of the spl for the port.
 1.4 16-Jun-2003  thorpej branches: 1.4.2;
Rename IPL_IMP -> IPL_VM.
 1.3 18-Sep-2002  chs fix the ofppc interrupt code to work at all. the previous code was
confusing an IPL number with an IRQ mask. now we do like the x86 code.
 1.2 29-Oct-2001  thorpej branches: 1.2.2; 1.2.6;
Add/rework infrastructure that will allow us to support native
device drivers:
- Various native device entries in cdevsw/bdevsw.
- Rework the interrupt infrastructure to provide more flexibility to
the platform-dependent back-end. Rewrite the "ofwgen" simulated
interrupt routines to reflect the changes.
- Clear out the BAT registers and set the fixed battable entries before
calling the platform init routine. The platform init routine is allowed
to set entries in the battable.
- Don't call the platform cons_init routine until after translation is
enabled -- we might need translation to work in order to access bus
space.
 1.1 26-Aug-2001  matt branches: 1.1.4; 1.1.6;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.1.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 26-Aug-2001  thorpej file intr.h was added on branch kqueue on 2001-09-13 01:14:12 +0000
 1.2.6.1 17-Mar-2002  thorpej IPL_IMP -> IPL_VM
 1.2.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.1 29-Oct-2001  nathanw file intr.h was added on branch nathanw_sa on 2002-10-18 02:39:18 +0000
 1.4.2.4 11-Dec-2005  christos Sync with head.
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.24.1 29-Nov-2005  yamt sync with head.
 1.5.16.5 27-Oct-2007  yamt sync with head.
 1.5.16.4 03-Sep-2007  yamt sync with head.
 1.5.16.3 26-Feb-2007  yamt sync with head.
 1.5.16.2 30-Dec-2006  yamt sync with head.
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.6.22.2 02-Dec-2006  yamt - revive setsoftnet and setsoftclock which were mistakenly removed
in the previous.
- move splraiseipl/makeiplcookie to a correct #ifdef section.
 1.6.22.1 02-Dec-2006  yamt implement splraiseipl/makeiplcookie for ofppc.
 1.6.20.1 12-Jan-2007  ad Sync with head.
 1.8.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.10.2 03-Oct-2007  garbled Sync with HEAD
 1.9.10.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.9.2.2 23-Oct-2007  ad Sync with head.
 1.9.2.1 15-Jul-2007  ad Sync with head.
 1.10.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.10.12.1 18-Oct-2007  yamt sync with head.
 1.10.10.1 06-Nov-2007  matt sync with HEAD
 1.10.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.11.20.2 11-Aug-2010  yamt sync with head.
 1.11.20.1 16-May-2008  yamt sync with head.
 1.11.18.1 18-May-2008  yamt sync with head.
 1.11.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.22.3 12-Jun-2011  rmind sync with head
 1.12.22.2 05-Mar-2011  rmind sync with head
 1.12.22.1 30-May-2010  rmind sync with head
 1.12.20.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.14.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.14.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2 15-Jul-2018  maxv Retire ipkdb entirely. The option was removed from the config files
yesterday.

ok kamil christos
 1.1 28-May-1998  sakamoto branches: 1.1.60; 1.1.238;
Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1.238.1 10-Jun-2019  christos Sync with HEAD
 1.1.60.1 28-Jul-2018  pgoyette Sync with HEAD
 1.2 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.1 30-Sep-1996  ws branches: 1.1.64; 1.1.106; 1.1.114; 1.1.124; 1.1.126; 1.1.128; 1.1.130;
PowerPC port
 1.1.130.1 25-Oct-2007  bouyer Sync with HEAD.
 1.1.128.1 18-Oct-2007  yamt sync with head.
 1.1.126.1 06-Nov-2007  matt sync with HEAD
 1.1.124.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.1.114.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.1.106.1 23-Oct-2007  ad Sync with head.
 1.1.64.1 27-Oct-2007  yamt sync with head.
 1.9 12-Dec-2021  andvar s/Miscellanous/Miscellaneous/ in copypasta comments.
 1.8 18-Oct-2016  jdolecek add isa_intr_establish_xname() to MD isa headers so that it can be used
by MI drivers
 1.7 19-Aug-2009  dyoung branches: 1.7.22; 1.7.40; 1.7.44;
isa_detach_hook() needs two arguments, the first an isa_chipset_tag_t.
 1.6 19-Aug-2009  dyoung Define isa_detach_hook().
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 17-Jan-2008  garbled branches: 1.4.6; 1.4.8; 1.4.10;
Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.3 05-Nov-2007  garbled branches: 1.3.2; 1.3.4; 1.3.10;
Lots of small changes for ofppc:

Remove the ofb driver. I'm not interested in trying to make this work.
It should be replaced with the genfb driver, which I have added,
commented out because that driver needs work before it will function on
ofppc. (it's too panic-happy, and ofppc needs a working autoconf.c)

Change the way we do isa_inb/outb. The new way is a slightly nastier
hack, but won't run afoul of the other isa drivers as much.

Fix ofw_consinit.c to remove the dependency on ofb.
 1.2 17-Oct-2007  garbled branches: 1.2.2; 1.2.4;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.1 21-Jun-2007  garbled branches: 1.1.2; 1.1.6; 1.1.8; 1.1.10;
file isa_machdep.h was initially added on branch ppcoea-renovation.
 1.1.10.2 13-Nov-2007  bouyer Sync with HEAD
 1.1.10.1 25-Oct-2007  bouyer Sync with HEAD.
 1.1.8.1 18-Oct-2007  yamt sync with head.
 1.1.6.2 06-Nov-2007  joerg Sync with HEAD.
 1.1.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.1.2.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.2.4.4 21-Jan-2008  yamt sync with head
 1.2.4.3 15-Nov-2007  yamt sync with head.
 1.2.4.2 27-Oct-2007  yamt sync with head.
 1.2.4.1 17-Oct-2007  yamt file isa_machdep.h was added on branch yamt-lazymbuf on 2007-10-27 11:27:26 +0000
 1.2.2.3 03-Dec-2007  ad Sync with HEAD.
 1.2.2.2 23-Oct-2007  ad Sync with head.
 1.2.2.1 17-Oct-2007  ad file isa_machdep.h was added on branch vmlocking on 2007-10-23 20:35:58 +0000
 1.3.10.1 19-Jan-2008  bouyer Sync with HEAD
 1.3.4.3 23-Mar-2008  matt sync with HEAD
 1.3.4.2 06-Nov-2007  matt sync with HEAD
 1.3.4.1 05-Nov-2007  matt file isa_machdep.h was added on branch matt-armv6 on 2007-11-06 23:19:58 +0000
 1.3.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.10.2 19-Aug-2009  yamt sync with head.
 1.4.10.1 16-May-2008  yamt sync with head.
 1.4.8.1 18-May-2008  yamt sync with head.
 1.4.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.44.1 04-Nov-2016  pgoyette Sync with HEAD
 1.7.40.1 05-Dec-2016  skrll Sync with HEAD
 1.7.22.1 03-Dec-2017  jdolecek update from HEAD
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.6 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.5 28-Apr-2008  martin branches: 1.5.44; 1.5.60;
Remove clause 3 and 4 from TNF licenses
 1.4 09-Jan-2008  garbled branches: 1.4.6; 1.4.8; 1.4.10;
Changes to the ofppc ofwboot to make it boot on an IBM CHRP RS/6000.
Tested on a pegasos II and a 7044-270. Also, switch away from the hacked
up alloc.c we were using, and use the stock libsa one.
 1.3 25-Jan-2006  christos branches: 1.3.48; 1.3.54; 1.3.62;
free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.2 31-Oct-2001  thorpej branches: 1.2.2; 1.2.4; 1.2.36; 1.2.48;
Split elf32 vs. elf64 handling in loadfile(), including support for
each separately and explicitly. BOOT_ELF is now BOOT_ELF32 and
BOOT_ELF64, and ELFSIZE should no longer be defined in loadfile_machdep.h.
 1.1 23-Oct-2001  thorpej branches: 1.1.2;
Add machine-dependent defns for libsa's loadfile().
 1.1.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.48.1 01-Feb-2006  yamt sync with head.
 1.2.36.2 21-Jan-2008  yamt sync with head
 1.2.36.1 21-Jun-2006  yamt sync with head.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 31-Oct-2001  thorpej file loadfile_machdep.h was added on branch kqueue on 2002-01-10 19:47:11 +0000
 1.2.2.2 31-Oct-2001  thorpej Split elf32 vs. elf64 handling in loadfile(), including support for
each separately and explicitly. BOOT_ELF is now BOOT_ELF32 and
BOOT_ELF64, and ELFSIZE should no longer be defined in loadfile_machdep.h.
 1.2.2.1 31-Oct-2001  thorpej file loadfile_machdep.h was added on branch nathanw_sa on 2001-10-31 17:20:49 +0000
 1.3.62.1 10-Jan-2008  bouyer Sync with HEAD
 1.3.54.1 18-Feb-2008  mjf Sync with HEAD.
 1.3.48.1 23-Mar-2008  matt sync with HEAD
 1.4.10.1 16-May-2008  yamt sync with head.
 1.4.8.1 18-May-2008  yamt sync with head.
 1.4.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.60.1 10-Aug-2014  tls Rebase.
 1.5.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1 29-Apr-2000  thorpej branches: 1.1.6;
Require that each each MACHINE/MACHINE_ARCH supply a lock.h. This file
contains the values __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED, which
replace the old SIMPLELOCK_LOCKED and SIMPLELOCK_UNLOCKED. These files
are also required to supply inline functions __cpu_simple_lock(),
__cpu_simple_lock_try(), and __cpu_simple_unlock() if locking is to be
supported on that platform (i.e. if MULTIPROCESSOR is defined in the
_KERNEL case). Change these functions to take an int * (&alp->lock_data)
rather than the struct simplelock * itself.

These changes make it possible for userland to use the locking primitives
by including <machine/lock.h>.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 29-Apr-2000  bouyer file lock.h was added on branch thorpej_scsipi on 2000-11-20 20:18:41 +0000
 1.1 30-Nov-2024  christos branches: 1.1.4;
Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 30-Nov-2024  perseant file lwp_private.h was added on branch perseant-exfatfs on 2025-08-02 05:55:58 +0000
 1.2 18-May-2008  phx No longer used.
 1.1 28-May-1998  sakamoto branches: 1.1.150; 1.1.152; 1.1.154; 1.1.156;
Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1.156.2 23-Jun-2008  wrstuden Remove files removed on branch. Updating using patch has its
drawbacks. :-)
 1.1.156.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.1.154.1 04-May-2009  yamt sync with head.
 1.1.152.1 04-Jun-2008  yamt sync with head
 1.1.150.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 26-Apr-2011  joerg Remove Darwin, MACH and Mach-O support.
 1.1 30-Oct-2002  matt branches: 1.1.2; 1.1.136; 1.1.142;
Add missing file.
 1.1.142.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.136.1 31-May-2011  rmind sync with head
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 30-Oct-2002  nathanw file macho_machdep.h was added on branch nathanw_sa on 2002-11-11 22:02:21 +0000
 1.1 23-Dec-1999  kleink branches: 1.1.6;
C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
 1.1.6.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.6.1 23-Dec-1999  bouyer file math.h was added on branch thorpej_scsipi on 2000-11-20 20:18:41 +0000
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 05-Nov-2001  briggs branches: 1.1.2;
file mcontext.h was initially added on branch nathanw_sa.
 1.1.2.1 05-Nov-2001  briggs Initial SA support for ppc. Test-booted on sandpoint, macppc, & walnut.
mcontext and cpu_getmcontext()/cpu_setmcontext() 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:42 +0000
 1.1 28-Feb-2014  matt branches: 1.1.4; 1.1.6; 1.1.10;
Needed for COMPAT_NETBSD32
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 28-Feb-2014  tls file netbsd32_machdep.h was added on branch tls-maxphys on 2014-08-20 00:03:17 +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 28-Feb-2014  yamt file netbsd32_machdep.h was added on branch yamt-pagecache on 2014-05-22 11:40:02 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 28-Feb-2014  rmind file netbsd32_machdep.h was added on branch rmind-smpnet on 2014-05-18 17:45:20 +0000
 1.2 17-Oct-2007  garbled branches: 1.2.2; 1.2.4; 1.2.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.1 21-Jun-2007  garbled branches: 1.1.2; 1.1.6; 1.1.8; 1.1.10;
file openpicreg.h was initially added on branch ppcoea-renovation.
 1.1.10.1 25-Oct-2007  bouyer Sync with HEAD.
 1.1.8.1 18-Oct-2007  yamt sync with head.
 1.1.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.1.2.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.2.8.2 06-Nov-2007  matt sync with HEAD
 1.2.8.1 17-Oct-2007  matt file openpicreg.h was added on branch matt-armv6 on 2007-11-06 23:19:59 +0000
 1.2.4.2 27-Oct-2007  yamt sync with head.
 1.2.4.1 17-Oct-2007  yamt file openpicreg.h was added on branch yamt-lazymbuf on 2007-10-27 11:27:27 +0000
 1.2.2.2 23-Oct-2007  ad Sync with head.
 1.2.2.1 17-Oct-2007  ad file openpicreg.h was added on branch vmlocking on 2007-10-23 20:35:59 +0000
 1.13 28-Jul-2011  macallan userland needs to see PCI_MAGIC_IO_RANGE
 1.12 20-Jun-2011  matt Cleanup powerpc param.h. If compiling a MODULE, ignore port-specific stuff.
Only include <machine/cpu.h> in <powerpc/param.h> at the end.
 1.11 07-Mar-2008  phx branches: 1.11.36;
Define PCI_MAGIC_IO_RANGE for X11 server. The address chosen may change.
Approved by garbled.
 1.10 20-Oct-2001  billc branches: 1.10.4; 1.10.36; 1.10.98; 1.10.118; 1.10.122;
just set MACHINE and include powerpc/param.h - non-NEWPMAP ofppc kernels boot now.
 1.9 30-May-2001  mrg branches: 1.9.2;
use _KERNEL_OPT
 1.8 30-Jun-2000  itojun branches: 1.8.2;
raise MSIZE from 128 to 256.
- for sizeof(void *) == 8 arch, this is mandatory. MHLEN is too small
already (less than 80) and there are chances for unwanted packet loss due
to m_pullup restriction.
- for other cases, the change should avoid allocating clusters in most cases
(even when you have IPv4 IPsec tunnel, or IPv6 with moderate amount of
extension header)

portmasters: if your arch chokes with the change (high memory usage or
whatever), please backout the change for your arch.
 1.7 11-Feb-2000  thorpej branches: 1.7.4;
Update for the NKMEMPAGES changes.
 1.6 04-Dec-1999  ragge CL* discarding.
 1.5 01-Sep-1998  sakamoto branches: 1.5.12; 1.5.18;
Eliminate ovbcopy define.
 1.4 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.3 29-Apr-1998  thorpej Pull in opt_gateway.h as appropriate.
 1.2 24-Feb-1997  fvdl Define ALIGNED_POINTER
 1.1 30-Sep-1996  ws branches: 1.1.6;
PowerPC port
 1.1.6.1 12-Mar-1997  is Merge in changes from Trunk
 1.5.18.2 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.18.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

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

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

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.5.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.7.4.1 23-Jul-2000  itojun pullup from main trunc (approved by releng-1-5)

raise MSIZE from 128 to 256.
- for sizeof(void *) == 8 arch, this is mandatory. MHLEN is too small
already (less than 80) and there are chances for unwanted packet loss due
to m_pullup restriction.
- for other cases, the change should avoid allocating clusters in most cases
(even when you have IPv4 IPsec tunnel, or IPv6 with moderate amount of
extension header)

portmasters: if your arch chokes with the change (high memory usage or
whatever), please backout the change for your arch.

1.1 -> 1.2 syssrc/sys/arch/amigappc/include/param.h
1.13 -> 1.14 syssrc/sys/arch/arc/include/param.h
1.1 -> 1.2 syssrc/sys/arch/arm26/include/param.h
1.17 -> 1.18 syssrc/sys/arch/arm32/include/param.h
1.6 -> 1.7 syssrc/sys/arch/bebox/include/param.h
1.4 -> 1.5 syssrc/sys/arch/cobalt/include/param.h
1.4 -> 1.5 syssrc/sys/arch/evbsh3/include/param.h
1.2 -> 1.3 syssrc/sys/arch/hpcmips/include/param.h
1.40 -> 1.41 syssrc/sys/arch/i386/include/param.h
1.7 -> 1.8 syssrc/sys/arch/m68k/include/param.h
1.9 -> 1.10 syssrc/sys/arch/macppc/include/param.h
1.4 -> 1.5 syssrc/sys/arch/mmeye/include/param.h
1.6 -> 1.7 syssrc/sys/arch/newsmips/include/param.h
1.7 -> 1.8 syssrc/sys/arch/ofppc/include/param.h
1.23 -> 1.24 syssrc/sys/arch/pc532/include/param.h
1.32 -> 1.33 syssrc/sys/arch/pmax/include/param.h
1.7 -> 1.8 syssrc/sys/arch/powerpc/include/param.h
1.1 -> 1.2 syssrc/sys/arch/prep/include/param.h
1.1 -> 1.2 syssrc/sys/arch/sgimips/include/param.h
1.3 -> 1.4 syssrc/sys/arch/sh3/include/param.h
1.44 -> 1.45 syssrc/sys/arch/sparc/include/param.h
1.21 -> 1.22 syssrc/sys/arch/sparc64/include/param.h
1.43 -> 1.44 syssrc/sys/arch/vax/include/param.h
 1.8.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.9.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.122.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.118.1 24-Mar-2008  keiichi sync with head.
 1.10.98.1 23-Mar-2008  matt sync with HEAD
 1.10.36.1 17-Mar-2008  yamt sync with head.
 1.10.4.2 20-Oct-2001  billc just set MACHINE and include powerpc/param.h - non-NEWPMAP ofppc kernels boot now.
 1.10.4.1 20-Oct-2001  billc file param.h was added on branch nathanw_sa on 2001-10-20 08:27:13 +0000
 1.11.36.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.6 20-Dec-2007  phx VT8231 IDE workaround for native mode with "compatibility" interrupts 14/15.
This time done right by calling pciide_machdep_compat_intr_establish() to
get a MD interrupt handler.
Verified that it compiles for XEN again.
 1.5 17-Oct-2007  garbled branches: 1.5.4; 1.5.8;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.4 11-Dec-2005  christos branches: 1.4.30; 1.4.38; 1.4.48; 1.4.50; 1.4.52; 1.4.54;
merge ktrace-lwp.
 1.3 29-Jul-2004  drochner branches: 1.3.12;
remove now unnecessary "pci_enumerate_bus" definitions
 1.2 15-May-2002  thorpej branches: 1.2.10;
Let machine-dependent code specify how to enumerate the bus.
Currently, everyone uses pci_enumerate_bus_generic().
 1.1 29-Oct-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Check in of work-in-progress of Firepower native device support.
We can find devices in PCI configuration space, but not much else.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 29-Oct-2001  thorpej file pci_machdep.h was added on branch kqueue on 2002-01-10 19:47:12 +0000
 1.1.4.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.4.1 29-Oct-2001  thorpej file pci_machdep.h was added on branch thorpej-mips-cache on 2001-11-12 21:17:23 +0000
 1.1.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.2.1 29-Oct-2001  nathanw file pci_machdep.h was added on branch nathanw_sa on 2002-06-20 03:40:25 +0000
 1.2.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.10.1 03-Aug-2004  skrll Sync with HEAD
 1.3.12.2 21-Jan-2008  yamt sync with head
 1.3.12.1 27-Oct-2007  yamt sync with head.
 1.4.54.1 25-Oct-2007  bouyer Sync with HEAD.
 1.4.52.1 18-Oct-2007  yamt sync with head.
 1.4.50.2 09-Jan-2008  matt sync with HEAD
 1.4.50.1 06-Nov-2007  matt sync with HEAD
 1.4.48.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.4.38.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.4.30.1 23-Oct-2007  ad Sync with head.
 1.5.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.5.4.1 26-Dec-2007  ad Sync with head.
 1.3 17-Dec-2010  phx Set the GPIO to enable AGP configuration space access when attaching gtpci0
and do not reset it again. This keeps AGP devices visible after configure().
Improved the match-function to look for a Discovery controller on the PCI
bus.
 1.2 09-Jun-2010  kiyohara Support MV64361 on PegasosII by gt(4).
+ Support gtpci@gt instead of pegasospci more smartly.
+ Support Gigabit Ethernet by mvgbe@gt.
 1.1 04-Nov-2007  garbled branches: 1.1.2; 1.1.6; 1.1.8; 1.1.10; 1.1.12; 1.1.30; 1.1.50; 1.1.52;
Apply patch from Frank Wille to make the pegasos2 pci scan work
properly. Modified slightly by me to add the pegasosreg.h file.

With this change, the pegasos correctly scans both primary and secondary
PCI busses.
 1.1.52.2 05-Mar-2011  rmind sync with head
 1.1.52.1 03-Jul-2010  rmind sync with head
 1.1.50.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.1.30.1 11-Aug-2010  yamt sync with head.
 1.1.12.2 03-Dec-2007  ad Sync with HEAD.
 1.1.12.1 04-Nov-2007  ad file pegasosreg.h was added on branch vmlocking on 2007-12-03 19:03:49 +0000
 1.1.10.2 15-Nov-2007  yamt sync with head.
 1.1.10.1 04-Nov-2007  yamt file pegasosreg.h was added on branch yamt-lazymbuf on 2007-11-15 11:43:14 +0000
 1.1.8.2 13-Nov-2007  bouyer Sync with HEAD
 1.1.8.1 04-Nov-2007  bouyer file pegasosreg.h was added on branch bouyer-xenamd64 on 2007-11-13 15:58:59 +0000
 1.1.6.2 06-Nov-2007  matt sync with HEAD
 1.1.6.1 04-Nov-2007  matt file pegasosreg.h was added on branch matt-armv6 on 2007-11-06 23:19:59 +0000
 1.1.2.2 04-Nov-2007  jmcneill Sync with HEAD.
 1.1.2.1 04-Nov-2007  jmcneill file pegasosreg.h was added on branch jmcneill-pm on 2007-11-04 21:03:06 +0000
 1.2 17-Oct-2007  garbled branches: 1.2.2; 1.2.4; 1.2.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.1 21-Jun-2007  garbled branches: 1.1.2; 1.1.6; 1.1.8; 1.1.10;
file pio.h was initially added on branch ppcoea-renovation.
 1.1.10.1 25-Oct-2007  bouyer Sync with HEAD.
 1.1.8.1 18-Oct-2007  yamt sync with head.
 1.1.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.1.2.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.2.8.2 06-Nov-2007  matt sync with HEAD
 1.2.8.1 17-Oct-2007  matt file pio.h was added on branch matt-armv6 on 2007-11-06 23:20:00 +0000
 1.2.4.2 27-Oct-2007  yamt sync with head.
 1.2.4.1 17-Oct-2007  yamt file pio.h was added on branch yamt-lazymbuf on 2007-10-27 11:27:27 +0000
 1.2.2.2 23-Oct-2007  ad Sync with head.
 1.2.2.1 17-Oct-2007  ad file pio.h was added on branch vmlocking on 2007-10-23 20:36:00 +0000
 1.3 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.2 18-Sep-2002  chs branches: 1.2.22; 1.2.64; 1.2.72; 1.2.82; 1.2.84; 1.2.86; 1.2.88;
fix the ofppc interrupt code to work at all. the previous code was
confusing an IPL number with an IRQ mask. now we do like the x86 code.
 1.1 22-Oct-2001  thorpej branches: 1.1.4; 1.1.6;
Begin the task of splitting up the ofppc port into common code
and platform-specific code, similar to how the Alpha port is
split up.
 1.1.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 22-Oct-2001  thorpej file platform.h was added on branch kqueue on 2002-01-10 19:47:12 +0000
 1.1.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.1 22-Oct-2001  nathanw file platform.h was added on branch nathanw_sa on 2002-10-18 02:39:19 +0000
 1.2.88.1 25-Oct-2007  bouyer Sync with HEAD.
 1.2.86.1 18-Oct-2007  yamt sync with head.
 1.2.84.1 06-Nov-2007  matt sync with HEAD
 1.2.82.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.2.72.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.2.64.1 23-Oct-2007  ad Sync with head.
 1.2.22.1 27-Oct-2007  yamt sync with head.
 1.12 03-Feb-2003  matt Rename PPC_MPC6XX to PPC_OEA (and any mpc6xx reference to oea).
 1.11 03-Feb-2003  matt More cleanup for OLDPMAP.
 1.10 09-Mar-2002  chs switch all mpc6xx powerpc ports to NEWPMAP by default.
the old pmap is still available with the OLDPMAP option.
 1.9 24-Oct-2001  billc branches: 1.9.2;
NEWPMAP fixes that I missed committing.
 1.8 04-May-1999  thorpej branches: 1.8.16; 1.8.18;
Toss contents, and just pull in <powerpc/pmap.h>.
 1.7 26-Aug-1998  sakamoto branches: 1.7.8;
vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.6 27-Jan-1998  sakamoto Import DDB from OpenBSD/powerpc.
 1.5 06-Jan-1998  thorpej Don't need __VM_PMAP_HACK anymore.
 1.4 03-Jan-1998  thorpej Now that all ports have pmap_activate(), and it has an identical interface,
prototype it in <vm/pmap.h>
 1.3 02-Jan-1998  thorpej Implement pmap_activate().
 1.2 16-May-1997  gwr Add #define __VM_PMAP_HACK as a temporary measure.
 1.1 30-Sep-1996  ws PowerPC port
 1.7.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.18.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.8.16.2 16-Mar-2002  jdolecek Catch up with -current.
 1.8.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.2.1 24-Oct-2001  nathanw file pmap.h was added on branch nathanw_sa on 2002-04-01 07:41:48 +0000
 1.2 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

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

* Removes the PMC code of ARM XSCALE.

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

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

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

* Removes the pmc_evid_t and pmc_ctr_t types.

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

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.1.204.1 10-Jun-2019  christos Sync with HEAD
 1.1.202.1 28-Jul-2018  pgoyette Sync with HEAD
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 07-Aug-2002  jdolecek file pmc.h was added on branch kqueue on 2002-09-06 08:38:34 +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:33 +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:38 +0000
 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 23-Oct-2004  thorpej Centralize the declaration of booted_device and booted_partition.
 1.5 21-Sep-2002  chs branches: 1.5.6;
remove protos for non-existant functions.
 1.4 01-Jun-2000  matt branches: 1.4.6; 1.4.10;
Make booted_device global (and booted_parition for consitency).
Eliminate it from header files and other extern definitions.
 1.3 26-Aug-1998  sakamoto branches: 1.3.12; 1.3.20;
vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.2 31-Jan-1997  thorpej Declare booted_device and booted_partition as "extern".
 1.1 30-Sep-1996  ws branches: 1.1.2;
PowerPC port
 1.1.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.3.20.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.10.1 18-Oct-2002  nathanw Catch up to -current.
 1.4.6.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.6.1 02-Nov-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.1 04-May-2009  yamt sync with head.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.3 18-Jan-2001  thorpej Use <powerpc/psl.h>
 1.2 16-Apr-1997  thorpej branches: 1.2.14;
Garbage collect stuff now hidden my machine_vec.
 1.1 30-Sep-1996  ws PowerPC port
 1.2.14.1 11-Feb-2001  bouyer Sync with HEAD.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.3 26-Aug-2001  matt branches: 1.3.6;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.2 05-Jan-1998  perry branches: 1.2.28;
RCSID Police.
 1.1 01-Oct-1996  ws Add some files that CVS missed somehow
These are empty for now, but are needed by MI code
 1.2.28.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.3.6.2 26-Aug-2001  matt Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.3.6.1 26-Aug-2001  matt file ptrace.h was added on branch nathanw_sa on 2001-08-26 02:47:41 +0000
 1.3 04-May-1999  thorpej Pull in <powerpc/reg.h>.
 1.2 05-Jan-1998  perry branches: 1.2.10;
RCSID Police.
 1.1 01-Oct-1996  ws Add some files that CVS missed somehow
These are empty for now, but are needed by MI code
 1.2.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.2 05-Feb-2003  nakayama Replace machine/rnd.h with more appropriate name to share it
with cycle counter based microtime in kern/kern_microtime.c.
 1.1 11-Jun-2000  tsubai branches: 1.1.4; 1.1.6;
Add cpu_counter().
 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 11-Jun-2000  bouyer file rnd.h was added on branch thorpej_scsipi on 2000-11-20 20:18:42 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 11-Jun-2000  minoura file rnd.h was added on branch minoura-xpg4dl on 2000-06-22 17:02:07 +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:42 +0000
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 23-Jul-2014  alnsn branches: 1.1.2; 1.1.6;
Rename sljitarch.h to sljit_machdep.h.
 1.1.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.6.1 23-Jul-2014  tls file sljit_machdep.h was added on branch tls-maxphys on 2014-08-20 00:03:17 +0000
 1.1.2.2 10-Aug-2014  tls Rebase.
 1.1.2.1 23-Jul-2014  tls file sljit_machdep.h was added on branch tls-earlyentropy on 2014-08-10 06:54:04 +0000
 1.2 23-Jul-2014  alnsn Rename sljitarch.h to sljit_machdep.h.
 1.1 17-Nov-2013  alnsn branches: 1.1.2; 1.1.4; 1.1.6;
Enable sljit and bpfjit on powerpc.
 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 17-Nov-2013  yamt file sljitarch.h was added on branch yamt-pagecache on 2014-05-22 11:40:02 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 17-Nov-2013  rmind file sljitarch.h was added on branch rmind-smpnet on 2014-05-18 17:45:20 +0000
 1.1.2.1 10-Aug-2014  tls Rebase.
 1.5 02-Mar-2010  matt Add missing <powerpc/FOO/spr.h> to a few files missed on the first pass.
Don't export <machine/spr.h> to userland, only <powerpc/spr.h>
 1.4 11-Dec-2005  christos branches: 1.4.78; 1.4.92; 1.4.98;
merge ktrace-lwp.
 1.3 17-Feb-2005  briggs branches: 1.3.2;
Install spr.h
 1.2 02-Mar-2004  kleink branches: 1.2.2; 1.2.4;
Pull in SPRs via <powerpc/spr.h> in this single instance, and dispose of
<machine/spr.h> again.
 1.1 30-Dec-2003  manu Fix PowerPC ports build with KGDB.
 1.2.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.2.1 29-Apr-2005  kent sync with -current
 1.3.2.2 17-Feb-2005  skrll Sync with HEAD.
 1.3.2.1 17-Feb-2005  skrll file spr.h was added on branch ktrace-lwp on 2005-02-17 07:10:37 +0000
 1.4.98.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.4.92.1 24-Oct-2010  jym Sync with HEAD
 1.4.78.1 11-Mar-2010  yamt 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 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.13 23-Jan-2021  christos Document via __HAVE_BUS_SPACE_8 platforms that implement bus_space_*_8
 1.12 26-Jan-2017  christos branches: 1.12.26;
provide __HAVE_COMPAT_NETBSD32 and fix multiple include protection consistently.
 1.11 17-Jul-2011  dyoung branches: 1.11.12; 1.11.30; 1.11.34; 1.11.38;
Enable new-style <sys/bus.h> on several PowerPC ports supporting PCI
buses. Make non-inline implementations of bus_space(9) and bus_dma(9)
routines and move them to appropriate .c files.

This may leave amigappc in a bad state, sorry. Fortunately, it will be
easy to repair by imitating the bus.h -> bus_{defs,funcs}.h split in
some other PowerPC port.
 1.10 20-Jan-2008  joerg Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
 1.9 17-Oct-2007  garbled branches: 1.9.2; 1.9.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.8 14-Jul-2007  ad branches: 1.8.8; 1.8.10; 1.8.12; 1.8.14;
Generic soft interrupts are mandatory.
 1.7 10-Mar-2007  jmmv branches: 1.7.2; 1.7.10;
Implement support for softintrs.
Reviewed, corrected and tested by aymeric@.
 1.6 13-Sep-2006  gdamore branches: 1.6.6;
Convert shark and ofppc to new common ofrtc and MI todr code. Tested
on shark. Ok christos@, martin@.
 1.5 22-Sep-2002  simonb branches: 1.5.22; 1.5.40; 1.5.52;
Use "#define\t" instead of "#define ".
 1.4 18-Sep-2002  chs implement device_register() for ofppc.
use ofcons_cnprobe().
 1.3 16-May-2000  thorpej branches: 1.3.8; 1.3.12;
Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
 1.2 02-Oct-1998  sakamoto branches: 1.2.12;
Oops, ofppc don't have wscons.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.2.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.12.1 18-Oct-2002  nathanw Catch up to -current.
 1.3.8.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.52.1 18-Nov-2006  ad Sync with head.
 1.5.40.1 14-Sep-2006  yamt sync with head.
 1.5.22.3 21-Jan-2008  yamt sync with head
 1.5.22.2 27-Oct-2007  yamt sync with head.
 1.5.22.1 30-Dec-2006  yamt sync with head.
 1.6.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.10.2 03-Oct-2007  garbled Sync with HEAD
 1.7.10.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.7.2.2 23-Oct-2007  ad Sync with head.
 1.7.2.1 15-Jul-2007  ad Sync with head.
 1.8.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.8.12.1 18-Oct-2007  yamt sync with head.
 1.8.10.2 23-Mar-2008  matt sync with HEAD
 1.8.10.1 06-Nov-2007  matt sync with HEAD
 1.8.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.9.8.1 23-Jan-2008  bouyer Sync with HEAD.
 1.9.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.11.38.1 21-Apr-2017  bouyer Sync with HEAD
 1.11.34.1 20-Mar-2017  pgoyette Sync with HEAD
 1.11.30.1 05-Feb-2017  skrll Sync with HEAD
 1.11.12.1 03-Dec-2017  jdolecek update from HEAD
 1.12.26.1 03-Apr-2021  thorpej Sync with HEAD.
 1.2 04-Dec-1998  sakamoto Not used.
 1.1 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 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 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.23 20-Jun-2011  matt Don't export USER_SR if _MODULE is defined.
Add a common <powerpc/vmparam.h> like we have for <powerpc/pmap.h>
 1.22 14-Nov-2007  garbled branches: 1.22.50;
Commit a fix for the _SR regions that are needed by ofppc. Because this
platform tends to just declare anything from 0x8 to 0xf as mem or io
regions willy-nilly, we need to avoid batmapping a few of those in order
to save space for USER_SR, KERNEL_SR and KERNEL2_SR. I picked values for
these three that are least-commonly used or used for non-vital things.
 1.21 03-Feb-2003  matt branches: 1.21.18; 1.21.60; 1.21.78; 1.21.80; 1.21.84; 1.21.86;
Rename PPC_MPC6XX to PPC_OEA (and any mpc6xx reference to oea).
 1.20 02-Feb-2003  matt Remove OLDPMAP support.
 1.19 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.18 07-Jul-2002  matt Use SR 11 as USER_SR. (12 is used as an I/O BAT).
 1.17 09-Mar-2002  chs branches: 1.17.6;
switch all mpc6xx powerpc ports to NEWPMAP by default.
the old pmap is still available with the OLDPMAP option.
 1.16 15-Nov-2001  soren MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
 1.15 24-Oct-2001  billc branches: 1.15.2;
NEWPMAP fixes that I missed committing.
 1.14 05-Aug-2001  tsutsui branches: 1.14.4;
Define VM_MAX_KERNEL_BUF and PAGER_MAP_SIZE to save KVA space.
 1.13 01-May-2001  thorpej branches: 1.13.2;
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.12 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.11 11-Feb-2000  thorpej branches: 1.11.6;
Update for the NKMEMPAGES changes.
 1.10 04-Dec-1999  ragge CL* discarding.
 1.9 16-Apr-1999  thorpej branches: 1.9.2; 1.9.8;
Now that we have direct-mapped pool pages, we can garbage-collect VM_MBUF_SIZE
and don't need to allocate mb_map.
 1.8 23-Mar-1999  thorpej branches: 1.8.4;
VM_MBUF_SIZE is in terms of MCLBYTES, not CLBYTES.
 1.7 16-Jan-1999  chuck MNN is no longer optional
 1.6 26-Aug-1998  sakamoto vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.5 05-Jun-1998  sakamoto Merge in MACHINE_NEW_NONCONTIG support and some fix from Tsubai-San.
UVM support.
 1.4 18-Feb-1998  mycroft Fix typo.
 1.3 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainilne.
 1.2 16-Apr-1997  thorpej branches: 1.2.2;
Always define MACHINE_NONCONTIG.
 1.1 30-Sep-1996  ws branches: 1.1.4;
PowerPC port
 1.1.4.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.2.2.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.8.4.2 06-Aug-1999  chs take an initial guess at UBC parameters.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.13.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.13.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.13.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.14.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.15.2.5 11-Dec-2002  thorpej Sync with HEAD.
 1.15.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.15.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.15.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.15.2.1 24-Oct-2001  nathanw file vmparam.h was added on branch nathanw_sa on 2002-01-08 00:27:00 +0000
 1.17.6.1 16-Jul-2002  gehenna catch up with -current.
 1.21.86.1 19-Nov-2007  mjf Sync with HEAD.
 1.21.84.1 18-Nov-2007  bouyer Sync with HEAD
 1.21.80.1 09-Jan-2008  matt sync with HEAD
 1.21.78.1 21-Nov-2007  joerg Sync with HEAD.
 1.21.60.2 03-Dec-2007  ad Sync with HEAD.
 1.21.60.1 03-Dec-2007  ad Sync with HEAD.
 1.21.18.1 15-Nov-2007  yamt sync with head.
 1.22.50.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-May-2004  kleink branches: 1.1.2;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 08-May-2004  skrll file wchar_limits.h was added on branch ktrace-lwp on 2004-08-03 10:38:40 +0000
 1.6 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 17-Jan-2008  garbled branches: 1.4.6; 1.4.8; 1.4.10;
Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.3 05-Nov-2007  garbled branches: 1.3.2; 1.3.4; 1.3.10;
Lots of small changes for ofppc:

Remove the ofb driver. I'm not interested in trying to make this work.
It should be replaced with the genfb driver, which I have added,
commented out because that driver needs work before it will function on
ofppc. (it's too panic-happy, and ofppc needs a working autoconf.c)

Change the way we do isa_inb/outb. The new way is a slightly nastier
hack, but won't run afoul of the other isa drivers as much.

Fix ofw_consinit.c to remove the dependency on ofb.
 1.2 17-Oct-2007  garbled branches: 1.2.2; 1.2.4;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.1 21-Jun-2007  garbled branches: 1.1.2; 1.1.6; 1.1.8;
file isa_machdep.c was initially added on branch ppcoea-renovation.
 1.1.8.1 18-Oct-2007  yamt sync with head.
 1.1.6.2 06-Nov-2007  joerg Sync with HEAD.
 1.1.6.1 02-Nov-2007  joerg More diff reduce to HEAD due to botched up merging.
 1.1.2.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.2.4.4 21-Jan-2008  yamt sync with head
 1.2.4.3 15-Nov-2007  yamt sync with head.
 1.2.4.2 27-Oct-2007  yamt sync with head.
 1.2.4.1 17-Oct-2007  yamt file isa_machdep.c was added on branch yamt-lazymbuf on 2007-10-27 11:27:28 +0000
 1.2.2.3 03-Dec-2007  ad Sync with HEAD.
 1.2.2.2 23-Oct-2007  ad Sync with head.
 1.2.2.1 17-Oct-2007  ad file isa_machdep.c was added on branch vmlocking on 2007-10-23 20:36:01 +0000
 1.3.10.1 19-Jan-2008  bouyer Sync with HEAD
 1.3.4.3 23-Mar-2008  matt sync with HEAD
 1.3.4.2 06-Nov-2007  matt sync with HEAD
 1.3.4.1 05-Nov-2007  matt file isa_machdep.c was added on branch matt-armv6 on 2007-11-06 23:20:01 +0000
 1.3.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.10.1 16-May-2008  yamt sync with head.
 1.4.8.1 18-May-2008  yamt sync with head.
 1.4.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.18 21-Sep-2025  thorpej Give each PowerPC OFW platform its own device_register(), which calls
into the common ofw_device_register(). ofppc's is a simple wrapper.

macppc's, on the other hand, takes care of looking up environmental
sensor descriptive information in the OFW device tree and adds those
properties directly to the sensor device property dictionaries. This
single implementation will replace the duplicated code that's scattered
across multiple macppc i2c controller drivers.
 1.17 07-Nov-2007  garbled Convert ofppc to the shared ofw_autoconf.c
 1.16 17-Oct-2007  garbled branches: 1.16.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.15 11-Dec-2005  christos branches: 1.15.30; 1.15.38; 1.15.48; 1.15.50; 1.15.52; 1.15.54;
merge ktrace-lwp.
 1.14 23-Oct-2004  thorpej branches: 1.14.12;
Centralize the declaration of booted_device and booted_partition.
 1.13 15-Jul-2003  lukem __KERNEL_RCSID()
 1.12 18-Sep-2002  chs branches: 1.12.6;
fix the ofppc interrupt code to work at all. the previous code was
confusing an IPL number with an IRQ mask. now we do like the x86 code.
 1.11 26-Aug-2001  matt branches: 1.11.6;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.10 05-Aug-2001  tsutsui Avoid NULL pointer dereference.
 1.9 01-Jun-2000  matt branches: 1.9.6;
Don't pass booted_* to findroot/getdevice, access them via the globals.
Also, make findroot static. This eliminates unneeded clearing of them
and make their use consistent among the ports.
 1.8 17-Sep-1999  thorpej branches: 1.8.2; 1.8.10;
Centralize the declaration and clearing of `cold'.
 1.7 15-Sep-1999  thorpej Rename the machine-dependent autoconfiguration entry point `cpu_configure()',
and rename config_init() to configure() and call cpu_configure() from there.
 1.6 07-Jun-1999  thorpej Don't pass a nam2blk around at all; just have setroot() and friends reference
dev_name2blk[] directly. Addresses PR #7622 (ITOH Yasufumi), although
in a different way.
 1.5 24-Feb-1998  mycroft branches: 1.5.10;
ofd -> ofdisk
 1.4 24-Feb-1998  mycroft Catch up with changes in dev/ofw. Add mainbus.
 1.3 26-Mar-1997  gwr Move findroot/setroot stuff from configure() to cpu_rootconf().
 1.2 31-Jan-1997  thorpej branches: 1.2.2;
Use the new machine-independent setroot().
 1.1 30-Sep-1996  ws branches: 1.1.2;
PowerPC port
 1.1.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.2.2.1 02-Mar-1997  mrg swapconf() is no more.
 1.5.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.8.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.6.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.9.6.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.11.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.11.6.1 26-Aug-2001  nathanw file autoconf.c was added on branch nathanw_sa on 2002-10-18 02:39:19 +0000
 1.12.6.4 02-Nov-2004  skrll Sync with HEAD.
 1.12.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14.12.2 15-Nov-2007  yamt sync with head.
 1.14.12.1 27-Oct-2007  yamt sync with head.
 1.15.54.2 13-Nov-2007  bouyer Sync with HEAD
 1.15.54.1 25-Oct-2007  bouyer Sync with HEAD.
 1.15.52.1 18-Oct-2007  yamt sync with head.
 1.15.50.2 08-Nov-2007  matt sync with -HEAD
 1.15.50.1 06-Nov-2007  matt sync with HEAD
 1.15.48.2 11-Nov-2007  joerg Sync with HEAD.
 1.15.48.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.15.38.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.15.30.1 23-Oct-2007  ad Sync with head.
 1.16.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.14 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.13 13-Sep-2006  gdamore branches: 1.13.10; 1.13.18; 1.13.28; 1.13.30; 1.13.32; 1.13.34;
Convert shark and ofppc to new common ofrtc and MI todr code. Tested
on shark. Ok christos@, martin@.
 1.12 24-Dec-2005  perry branches: 1.12.8; 1.12.20;
bare asm -> __asm
 1.11 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.10 23-Nov-2005  nonaka In decr_intr(), update lasttb only when clock interrupt is not masked.
(sync with macppc/macppc/clock.c: rev.1.11 -> 1.12)
 1.9 09-Jun-2005  he branches: 1.9.2; 1.9.8;
Rename local variable `tick' to `ticks' to make this build with -Wshadow.
 1.8 29-Jun-2004  kleink In the delay loop, mark the scratch register as earlyclobber.
 1.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 07-Aug-2002  chs branches: 1.6.6;
mftb() has moved to cpu.h.
 1.5 26-Aug-2001  matt branches: 1.5.6; 1.5.14;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.4 19-Jun-2001  simonb branches: 1.4.2;
Make all the ppc delay() functions the same - formating change only, no
code changes. Step one of a unified ppc clock.c.
 1.3 19-Jan-2000  msaitoh branches: 1.3.6;
check whether tv_usec >= 1000000
 1.2 16-Apr-1997  thorpej branches: 1.2.14;
Adjust for new machine_vec-based interrupt, from Wolfgang Solfrank.
 1.1 30-Sep-1996  ws PowerPC port
 1.2.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.3.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.5.14.1 31-Aug-2002  gehenna catch up with -current.
 1.5.6.2 13-Aug-2002  nathanw Catch up to -current.
 1.5.6.1 26-Aug-2001  nathanw file clock.c was added on branch nathanw_sa on 2002-08-13 02:18:38 +0000
 1.6.6.5 11-Dec-2005  christos Sync with head.
 1.6.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.8.1 29-Nov-2005  yamt sync with head.
 1.9.2.3 27-Oct-2007  yamt sync with head.
 1.9.2.2 30-Dec-2006  yamt sync with head.
 1.9.2.1 21-Jun-2006  yamt sync with head.
 1.12.20.1 18-Nov-2006  ad Sync with head.
 1.12.8.1 14-Sep-2006  yamt sync with head.
 1.13.34.1 25-Oct-2007  bouyer Sync with HEAD.
 1.13.32.1 18-Oct-2007  yamt sync with head.
 1.13.30.1 06-Nov-2007  matt sync with HEAD
 1.13.28.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.13.18.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.13.10.1 23-Oct-2007  ad Sync with head.
 1.18 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.17 11-Dec-2005  christos branches: 1.17.30; 1.17.38; 1.17.48; 1.17.50; 1.17.52; 1.17.54;
merge ktrace-lwp.
 1.16 15-Jul-2003  lukem branches: 1.16.16;
__KERNEL_RCSID()
 1.15 26-Oct-2002  jdolecek branches: 1.15.6;
now that mem_no is emitted by config(8), there is no reason to keep
copy of more or less identical iskmemdev() for every arch; move the function
to spec_vnop.c, and g/c machine-dependant copies
 1.14 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.13 19-Jul-2002  thorpej Rename cdev_systrace_init() to cdev_clonemisc_init(), so it can
be properly used by any misc. cloning device. While here, correct
a comment to indicate that "open" is the only entry point and that
everything else is handled with fileops.
 1.12 17-Jun-2002  christos MD systrace gluons.
 1.11 12-Jan-2002  manu branches: 1.11.8;
Added clockctl
 1.10 29-Oct-2001  thorpej branches: 1.10.2;
Add/rework infrastructure that will allow us to support native
device drivers:
- Various native device entries in cdevsw/bdevsw.
- Rework the interrupt infrastructure to provide more flexibility to
the platform-dependent back-end. Rewrite the "ofwgen" simulated
interrupt routines to reflect the changes.
- Clear out the BAT registers and set the fixed battable entries before
calling the platform init routine. The platform init routine is allowed
to set entries in the battable.
- Don't call the platform cons_init routine until after translation is
enabled -- we might need translation to work in order to access bus
space.
 1.9 26-Mar-2001  lukem branches: 1.9.2; 1.9.6;
- add dev_noimpl(xxx,yyy) macro to replace "(dev_type_xxx((*))) yyy",
and use appropriately

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

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

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

- ensure that the comments are accurate WRT the behaviour of a given entry
 1.8 15-Nov-2000  matt branches: 1.8.2;
back out my change powerpc/conf/files.ofw. Enable the inclusion of
dev/ofw/files.ofw on macppc. Add openfirm to ofppc/conf.c
 1.7 13-Nov-1998  oster branches: 1.7.10;
Updating of bdev's and cdev's to support RAIDframe.
 1.6 24-Feb-1998  mycroft Catch up with changes in dev/ofw. Add mainbus.
 1.5 16-Oct-1997  christos fix chrtoblk declaration
 1.4 13-Oct-1997  explorer o Make usage of /dev/random dependant on
pseudo-device rnd # /dev/random and in-kernel generator
in config files.

o Add declaration to all architectures.

o Clean up copyright message in rnd.c, rnd.h, and rndpool.c to include
that this code is derived in part from Ted Tyso's linux code.
 1.3 16-Apr-1997  thorpej branches: 1.3.4;
Add hooks for berkeley packet filter.
 1.2 16-Oct-1996  ws Indent properly
 1.1 30-Sep-1996  ws PowerPC port
 1.3.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.7.10.2 27-Mar-2001  bouyer Sync with HEAD.
 1.7.10.1 22-Nov-2000  bouyer Sync with HEAD.
 1.8.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.9.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.9.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.9.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.2.6 11-Nov-2002  nathanw Catch up to -current
 1.10.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.10.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.10.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.10.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.10.2.1 29-Oct-2001  nathanw file conf.c was added on branch nathanw_sa on 2002-02-28 04:11:19 +0000
 1.11.8.3 21-Jul-2002  gehenna catch up with -current.
 1.11.8.2 15-Jul-2002  gehenna catch up with -current.
 1.11.8.1 16-May-2002  gehenna Bye block/character device swicth tables.
 1.15.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.6.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.1 27-Oct-2007  yamt sync with head.
 1.17.54.1 25-Oct-2007  bouyer Sync with HEAD.
 1.17.52.1 18-Oct-2007  yamt sync with head.
 1.17.50.1 06-Nov-2007  matt sync with HEAD
 1.17.48.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.17.38.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.17.30.1 23-Oct-2007  ad Sync with head.
 1.17 03-Nov-2023  andvar Remove unused msr definition.

Fixes ofppc GENERIC.MP build.
 1.16 29-Jun-2011  matt Adapt to cpu_hatch_data changes
 1.15 05-Jun-2011  matt struct device * -> device_t, struct cfdata * -> cfdata_t
CFATTACH_DECL(*, sizeof(struct device), -> CFATTACH_DECL_NEW(&, 0
 1.14 05-Jun-2011  matt Remove <machine/atomic.h>; use <sys/atomic.h> instead.
Add <powerpc/cpuset.h> (for mpc85xx pmap).
Add some initial MP code for mpc85xx
Rework ipi code to be common across all ppcs
Change PPC to keep curlwp in %r13 while in the kernel.
Move astpending from cpu_info to mdlwp
Improve cpu_need_resched to be more MP friendly.
 1.13 20-Dec-2010  matt branches: 1.13.2; 1.13.6;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.12 02-Mar-2010  matt branches: 1.12.2;
Add missing <powerpc/FOO/spr.h> to a few files missed on the first pass.
Don't export <machine/spr.h> to userland, only <powerpc/spr.h>
 1.11 28-Apr-2008  martin branches: 1.11.20; 1.11.24;
Remove clause 3 and 4 from TNF licenses
 1.10 08-Apr-2008  garbled branches: 1.10.2; 1.10.4;
SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc. Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000. Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
 1.9 07-Feb-2008  garbled branches: 1.9.6;
Add some simple code to print out what the OFW thinks the cache
configuration of the machine is. Amusingly, the OFW on the pegasos is
dead wrong.

Bump CPU_MAXNUM to 8, because, thats probably a reasonable number for now.
 1.8 17-Oct-2007  garbled branches: 1.8.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.7 11-Dec-2005  christos branches: 1.7.30; 1.7.38; 1.7.48; 1.7.50; 1.7.52; 1.7.54;
merge ktrace-lwp.
 1.6 15-Jul-2003  lukem branches: 1.6.16;
__KERNEL_RCSID()
 1.5 02-Oct-2002  thorpej branches: 1.5.6;
Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 22-Oct-2001  thorpej branches: 1.3.4;
Various things that make OFW-driver kernels work on my Firepower LX MP
again:
- Special-case the attachment of CPUs, and logically attach them to
"mainbus", attaching them before any other devices. Otherwise,
CPUs would be found very late in the game on my Firepower.
- Sanity check the timebase-frequency property, printing a warning if
it's not the same on each CPU.
- Pass the correct CPU ID to cpu_attach_subr().
- Fetch the platform name from the OFW root node. We can key off this
later when we implement support for native drivers in the ofppc port.
- Use a table of "special" toplevel OFW nodes ... we skip these nodes
during the device configuration phase. This generally includes the
"options", "packages", etc. nodes. Inspired by sparc & sparc64 ports.
 1.2 20-Oct-2001  billc Fix cpu check to actually work.
 1.1 26-Aug-2001  matt branches: 1.1.4;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.1.4.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 26-Aug-2001  thorpej file cpu.c was added on branch kqueue on 2001-09-13 01:14:13 +0000
 1.3.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.1 22-Oct-2001  nathanw file cpu.c was added on branch nathanw_sa on 2002-10-18 02:39:19 +0000
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.2 11-Feb-2008  yamt sync with head.
 1.6.16.1 27-Oct-2007  yamt sync with head.
 1.7.54.1 25-Oct-2007  bouyer Sync with HEAD.
 1.7.52.1 18-Oct-2007  yamt sync with head.
 1.7.50.2 23-Mar-2008  matt sync with HEAD
 1.7.50.1 06-Nov-2007  matt sync with HEAD
 1.7.48.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.7.38.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.7.30.1 23-Oct-2007  ad Sync with head.
 1.8.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.4.2 11-Mar-2010  yamt sync with head
 1.10.4.1 16-May-2008  yamt sync with head.
 1.10.2.1 18-May-2008  yamt sync with head.
 1.11.24.1 07-Jan-2011  matt Deal with split <spr.h> (and a few other misc fixes).
 1.11.20.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.12.2.2 12-Jun-2011  rmind sync with head
 1.12.2.1 05-Mar-2011  rmind sync with head
 1.13.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.31 05-Jul-2022  andvar s/odly/oddly/ in comments.
 1.30 24-May-2022  andvar fix various typos in comments, docs and log messages.
 1.29 03-Apr-2019  christos centralize setdisklabel(9)
 1.28 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.27 05-Mar-2017  mrg branches: 1.27.12; 1.27.14;
fix some printf formats in DIAGNOSTIC code.
 1.26 04-Jul-2015  maxv branches: 1.26.2; 1.26.4;
Remove a dead continue.

Harmless, found by Brainy
 1.25 02-Feb-2012  phx branches: 1.25.6; 1.25.24;
Fixed writing of MBR disklabel. It was written by disklabel(8) -r directly
into sector 0, corrupting the MBR. Moved to sector 1.
Removed MBR_LABELSECTOR, which is no longer needed.
 1.24 08-Oct-2011  kiyohara branches: 1.24.2; 1.24.6;
Support FAT filesystem on RDB partition.
 1.23 18-Aug-2011  phx First check whether an MBR is present. Then use it for locating the disklabel.
Otherwise try to construct a disklabel from RDB partitions, and when
everything fails, look for a raw NetBSD disklabel in LABELSECTOR.
This is the same sequence as in ofwboot now.
Also fixed some typos in the comments.
 1.22 31-Dec-2010  phx Support for reading disklabels from RDB partitions in the kernel.
The code will check for a raw disklabel first, then tries to find the
disklabel in an MBR partition and finally constructs it from RDB
partitions.
RDB is probably only needed for the Pegasos platform, so it can be
disabled in the config file (RDB_PART).
 1.21 17-Oct-2007  garbled branches: 1.21.28; 1.21.34;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.20 08-Oct-2007  ad branches: 1.20.2;
Merge brelse() changes from the vmlocking branch.
 1.19 06-Mar-2007  he branches: 1.19.2; 1.19.10; 1.19.18; 1.19.20; 1.19.22;
More fixes after the caddr_t removal.
Mostly cast to char* for pointer arithmetic,
but also one missing indirection, and one "void *v, x;" fix.
 1.18 25-Nov-2006  scw branches: 1.18.4;
Replace the myriad copies of bounds_check_with_label() with a single MI
version.

Add disk_blocksize(9) so that disk drivers can record the physical
block size of a disk if it is different to DEV_BSIZE. Right now this
simply initialises dk_blkshift and dk_byteshift according to the
supplied block size. This information is used in the MI version of
bounds_check_with_label().
 1.17 11-Dec-2005  christos branches: 1.17.20; 1.17.22;
merge ktrace-lwp.
 1.16 08-Oct-2003  lukem branches: 1.16.16;
Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
 1.15 15-Jul-2003  lukem __KERNEL_RCSID()
 1.14 10-May-2003  thorpej branches: 1.14.2;
Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.13 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.12 16-Apr-2003  bouyer Nake return values from bounds_check_with_label() conform to the man
page: -1 for error, 0 for EOF, 1 otherwise. Inspired by an OpenBSD commit
message, pointed out by Miod Vallat in private mail.
vax/mba/hp.c: check return value <= 0, not < 0 to be concistent with how
other places handle return values from bounds_check_with_label().
 1.11 18-Sep-2002  chs reformat for readability.
 1.10 26-Aug-2001  matt branches: 1.10.2; 1.10.6;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.9 22-Jul-2001  wiz bcopy -> memcpy, bzero -> memset
 1.8 12-Jun-2001  tsubai branches: 1.8.2;
Remove cpu_dumpconf(); it's in powerpc_machdep.
 1.7 20-Nov-2000  chs branches: 1.7.2;
rationalize the use of b_flags for geteblk() buffers.
rather than assigning to the whole field, set or clear individual flags,
which implies that the B_BUSY and B_INVAL flags will remain set.
this allows us to make the assertion in brelse() that B_BUSY is set,
which is the purpose of all this.
 1.6 04-May-1999  thorpej branches: 1.6.2; 1.6.8;
Make this compile again.
 1.5 27-Jan-1999  thorpej branches: 1.5.4;
Use <sys/disklabel_mbr.h>
 1.4 22-Jun-1998  sommerfe defopt COMPAT_386BSD_MBRPART into opt_mbr.h
 1.3 02-Mar-1998  drochner Change MBR partition type for NetBSD to 0xa9, like the i386 port.
Provide compatibility via COMPAT_386BSD_MBRPART.
 1.2 26-Mar-1997  gwr Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/
 1.1 30-Sep-1996  ws PowerPC port
 1.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.6.8.1 21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

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

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

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.6.2.1 22-Nov-2000  bouyer Sync with HEAD.
 1.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.8.2.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.8.2.1 03-Aug-2001  lukem update to -current
 1.10.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.10.6.1 26-Aug-2001  nathanw file disksubr.c was added on branch nathanw_sa on 2002-10-18 02:39:19 +0000
 1.10.2.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.16.3 27-Oct-2007  yamt sync with head.
 1.16.16.2 03-Sep-2007  yamt sync with head.
 1.16.16.1 30-Dec-2006  yamt sync with head.
 1.17.22.1 10-Dec-2006  yamt sync with head.
 1.17.20.1 12-Jan-2007  ad Sync with head.
 1.18.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.22.2 18-Oct-2007  yamt sync with head.
 1.19.22.1 14-Oct-2007  yamt sync with head.
 1.19.20.1 06-Nov-2007  matt sync with HEAD
 1.19.18.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.19.10.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.19.2.2 23-Oct-2007  ad Sync with head.
 1.19.2.1 09-Oct-2007  ad Sync with head.
 1.20.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.21.34.1 05-Mar-2011  rmind sync with head
 1.21.28.1 10-Jan-2011  jym Sync with HEAD
 1.24.6.1 18-Feb-2012  mrg merge to -current.
 1.24.2.1 17-Apr-2012  yamt sync with head
 1.25.24.2 28-Aug-2017  skrll Sync with HEAD
 1.25.24.1 22-Sep-2015  skrll Sync with HEAD
 1.25.6.1 03-Dec-2017  jdolecek update from HEAD
 1.26.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.26.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.27.14.1 10-Jun-2019  christos Sync with HEAD
 1.27.12.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.7 25-Apr-2002  nonaka Use powerpc/mpc6xx/genassym.cf
 1.6 29-Oct-2001  thorpej branches: 1.6.2;
Add/rework infrastructure that will allow us to support native
device drivers:
- Various native device entries in cdevsw/bdevsw.
- Rework the interrupt infrastructure to provide more flexibility to
the platform-dependent back-end. Rewrite the "ofwgen" simulated
interrupt routines to reflect the changes.
- Clear out the BAT registers and set the fixed battable entries before
calling the platform init routine. The platform init routine is allowed
to set entries in the battable.
- Don't call the platform cons_init routine until after translation is
enabled -- we might need translation to work in order to access bus
space.
 1.5 05-Aug-2001  tsutsui branches: 1.5.4;
Add PM_SR
 1.4 29-Jun-2000  mrg branches: 1.4.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.3 20-Jun-2000  tsubai branches: 1.3.2;
Need include <vm/vm.h>.
 1.2 26-May-2000  thorpej branches: 1.2.2;
Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor. Test against SONPROC as appropriate rather than
combinations of SRUN and curproc. Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
 1.1 16-Apr-1997  thorpej branches: 1.1.14;
Use genassym.sh to facilitate cross-compiling.
 1.1.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.2.2 20-Jun-2000  tsubai Need include <vm/vm.h>.
 1.3.2.1 20-Jun-2000  tsubai file genassym.cf was added on branch netbsd-1-5 on 2000-06-20 08:04:36 +0000
 1.4.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.4.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.5.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.6.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.6.2.3 13-Nov-2001  briggs Define L_CPU.
 1.6.2.2 05-Nov-2001  briggs Initial SA support for ppc. Test-booted on sandpoint, macppc, & walnut.
mcontext and cpu_getmcontext()/cpu_setmcontext() from Klaus Klein
<kleink@netbsd.org>.
 1.6.2.1 29-Oct-2001  briggs file genassym.cf was added on branch nathanw_sa on 2001-11-05 19:46:15 +0000
 1.52 26-Feb-2021  thorpej Declare oeacpufeat once, in powerpc/oea/cpu_subr.c, rather than in
N different locore.S files.
 1.51 17-Feb-2021  thorpej Document the register state on entry per the OpenFirmware PowerPC CPU
bindings. Ensure we save off %r6 and %r7 before calling any other
functions.
 1.50 15-Jul-2018  maxv branches: 1.50.12;
Retire ipkdb entirely. The option was removed from the config files
yesterday.

ok kamil christos
 1.49 09-Nov-2014  chs branches: 1.49.18; 1.49.20;
in the initial asm code, save the interesting caller-saved registers
(containing "arg" and "len") across function calls to C code.
fixes kernels built with gcc 4.8.
 1.48 20-Jun-2011  matt branches: 1.48.12; 1.48.28;
Don't include *pmap.h in assembly files. Get the needed definitions
from "assym.h".
 1.47 18-Jun-2011  matt Make a common genassym.cf (powerpc/genassym.cf) and then
only put specific stuff in foo/genassym.cf
 1.46 17-Jan-2011  matt branches: 1.46.4;
Kill _NOREGNAMES. Everything should be using %rX now. If it doesn't it
soon will.
 1.45 17-Jan-2011  matt Use %rX instead of X. (no function change).
 1.44 10-Mar-2010  kiyohara branches: 1.44.2; 1.44.4;
Remove white-spaces.
Indent.
 1.43 25-Feb-2010  matt Adapt to <spr.h> breakup.
 1.42 26-Nov-2009  matt branches: 1.42.2;
Kill proc0paddr. Use lwp0.l_addr instead.
 1.41 13-Feb-2009  apb Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
 1.40 13-Nov-2008  ad branches: 1.40.4;
LKM -> MODULAR
 1.39 08-Apr-2008  garbled branches: 1.39.4; 1.39.10; 1.39.12; 1.39.22;
SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc. Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000. Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
 1.38 05-Feb-2008  garbled branches: 1.38.6;
Rewrite a big chunk of the pmap and locore code for powerpc to better
deal with the 64bit bridge mode. pmap changes by Matt Thomas, rest by myself.

Change pmap.c to work similar to exec_elf.c to allow us to compile in
multiple pmaps to a single kernel. This allows the pmap for bridge64 to
co-exist with the 32bit pmap.

Yank __HAVE_PMAP_PHYSSEG from all the oea code.

Add a new global, "oeacpufeat", which is used early in locore to determine
certain cpu features. This allows us to conditionalize code early in the boot
for certain CPUs that have special needs.

Yank most of the ifdef PPC_OEA_BRIDGE64 code from almost every file it was
found in. Some of it seemed incorrect, and my 7044 booted just fine
without it. It would appear that the bridge cpus treat BAT instructions
as nops, so they seem to be safe.

In ofppc, check the oeacpufeat, and if we are on a 64bit proc, clear
MSR[SF], and ASR[V].

With all of these changes, a kernel with both PPC_OEA and PPC_OEA_BRIDGE64
will boot on the POWERIII-2 cpu. However, it will not yet boot on a 32bit
cpu, because of CACHELINESIZE. Work remains to be done there to fix that.
 1.37 18-Oct-2007  garbled branches: 1.37.2;
Fix some minor issues in ofppc to make it complete ofwoea_initppc() and
sync up with 1.6 of ofwboot.
 1.36 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.35 11-Dec-2005  christos branches: 1.35.30; 1.35.38; 1.35.48; 1.35.50; 1.35.52; 1.35.54;
merge ktrace-lwp.
 1.34 31-May-2005  chs branches: 1.34.2;
remove vestigal {,e}intr{names,cnt} symbols now that vmstat doesn't need them.
 1.33 31-Jul-2003  matt Add #define _NOREGNAMES (to suppress asm.h from #define r1 1 ...)
 1.32 27-Apr-2003  ragge branches: 1.32.2;
Preserve the symbol table in the LKM || KSYMS cases also.
 1.31 03-Feb-2003  matt Rename PPC_MPC6XX to PPC_OEA (and any mpc6xx reference to oea).
 1.30 03-Feb-2003  matt More cleanup for OLDPMAP.
 1.29 02-Feb-2003  matt Perform a rototill of the powerpc code. Mandate use of SPRG0 to store
a pointer to current cpu's cpu_info structure. Use cpu_info for
intstk,intr_depth,still_stk,idle_pcb,curpcb,curlwp,etal even on
non-MULTIPROCESSOR machines. Add common macros GET_CPUINFO and
INIT_CPUINFO to get and initialize the cpu_info struct on startup. Make
ibm4xx use the standard <powerpc/frame.h>. Use IFRAME_xx in ibm4xx
trap_subr.S instead of explicit magic offsets. Move INTSTK and SPILLSTK
to std.<platform>. Change faultbuf to a struct instead of an array.

On MPC6XX cpus, stop using the vector page for temporary space and use
reserved space in cpu_info.
 1.28 14-Jul-2002  chs put the OF buffer page in the BSS rather than allocate it at runtime.
from PR 14497.
 1.27 09-Jul-2002  matt Common OFW code has been moved to powerpc/mpc6xx/ofw_subr.S. Now use it.
 1.26 09-Mar-2002  chs branches: 1.26.6;
switch all mpc6xx powerpc ports to NEWPMAP by default.
the old pmap is still available with the OLDPMAP option.
 1.25 23-Oct-2001  thorpej branches: 1.25.4;
Add support for fetching DDB symbols from the boot loader. This requires
changes to the boot loader (forthcoming).
 1.24 20-Oct-2001  billc update for NEWPMAP
 1.23 23-Jun-2001  matt branches: 1.23.2;
#include <powerpc/spr.h>
 1.22 25-Feb-2001  matt Use common switch / setfault / trampoline code. (except amigappc because
it doesn't use trap_subr.S either).
 1.21 04-Dec-2000  tsubai Move INTSTK and SPILLSTK definitions to locore.[Ss] to allow allocation of
them in early startup.
 1.20 16-Nov-2000  thorpej Use <powerpc/powerpc/trap_subr.S>
 1.19 21-Aug-2000  tsubai Scheduler locking changes.
 1.18 31-May-2000  thorpej Add a comment about needing to initialize p_cpu when multiple
processors are supported.
 1.17 26-May-2000  thorpej branches: 1.17.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

- Global state: sched_qs (run queues), sched_whichqs (bitmap
of non-empty run queues), sched_slpque (sleep queues).
NOTE: These may collectively move into a struct schedstate
at some point in the future.

- Per-CPU state, struct schedstate_percpu: spc_runtime
(time process on this CPU started running), spc_flags
(replaces struct proc's p_schedflags), and
spc_curpriority (usrpri of processes on this CPU).

- Every platform must now supply a struct cpu_info and
a curcpu() macro. Simplify existing cpu_info declarations
where appropriate.

- All references to per-CPU scheduler state now made through
curcpu(). NOTE: this will likely be adjusted in the future
after further changes to struct proc are made.

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
 1.16 26-May-2000  thorpej Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor. Test against SONPROC as appropriate rather than
combinations of SRUN and curproc. Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
 1.15 24-Mar-2000  ws Update several ports to at least work again without IPKDB
after the update of that.
Sorry for breaking this with my last changes :-(.
Fixes PR#9671 by Lennart Augustsson.
 1.14 19-Jan-2000  danw Add a special trap handler for EXC_ALI that saves dsisr and dar
 1.13 07-Dec-1999  danw synchronize various changes to comments between these files to make it
even more obvious that they're 90% identical and really ought to be
using common code in arch/powerpc for a most of this...
 1.12 17-Nov-1999  kleink Move signal management code common to all PowerPC platforms (sendsig(),
sigreturn(), sigcode) to a single place in the shared powerpc directory.
(The struct sigcontext etc. definitions were already being shared.)
 1.11 25-Mar-1999  mrg branches: 1.11.2; 1.11.8; 1.11.14;
remove opt_uvm.h
 1.10 13-Sep-1998  thorpej Make signal delivery work again.
 1.9 09-Sep-1998  thorpej Adjust for the new "reaper" kernel thread: do not free the vmspace and
u-area in machine-dependent code. Instead, call exit2() to schedule
the reaper to free them for us, once it is safe to do so (i.e. we are
no longer running on the dead proc's vmspace and stack).
 1.8 04-Jul-1998  jonathan defopt DDB.
 1.7 05-Jun-1998  sakamoto Merge in MACHINE_NEW_NONCONTIG support and some fix from Tsubai-San.
UVM support.
 1.6 27-Jan-1998  sakamoto Import DDB from OpenBSD/powerpc.
 1.5 08-Oct-1997  thorpej Fix a typo.
 1.4 29-Aug-1997  thorpej Fix typo(?) in dlmiss handler ("store" bit erronenously set). From
Kazuki Sakamoto <sakamoto@cec.co.jp>, PR #3583.
 1.3 16-Apr-1997  thorpej branches: 1.3.4;
Several changes from Wolfgang Solfrank, Charles Hannum, and myself:
- Clean up symbol goop - use macros in asm.h where appropriate.
- Add, correct, and generally clean up comments.
- Properly align save areas and temporary stacks.
- Fix the 603 tlb reload code.
- Fix several bogus constants and modifiers.
- Some stylistic changes.
 1.2 16-Oct-1996  ws Rename recently checked in KGDB to IPKDB to resolve conflicts with older KGDB
 1.1 30-Sep-1996  ws PowerPC port
 1.3.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.4.1 01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.8.6 23-Mar-2001  bouyer Make sure files that shouldn't change are identical to HEAD.
 1.11.8.5 12-Mar-2001  bouyer Sync with HEAD.
 1.11.8.4 15-Feb-2001  bouyer Re-sync with HEAD files which were out of sync.
 1.11.8.3 08-Dec-2000  bouyer Sync with HEAD.
 1.11.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.11.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.11.2.1 20-Jan-2000  he Pull up revision 1.14 (requested by danw):
Add (the beginnings of) an unaligned access handler for the
powerpc, to get around the fact that gcc currently generates bad
floating point copies sometimes, which breaks various things,
 1.17.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.23.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.23.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.23.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.25.4.3 01-Aug-2002  nathanw Catch up to -current.
 1.25.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.25.4.1 23-Oct-2001  nathanw file locore.S was added on branch nathanw_sa on 2002-04-01 07:41:49 +0000
 1.26.6.1 16-Jul-2002  gehenna catch up with -current.
 1.32.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.32.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.2.1 03-Aug-2004  skrll Sync with HEAD
 1.34.2.2 11-Feb-2008  yamt sync with head.
 1.34.2.1 27-Oct-2007  yamt sync with head.
 1.35.54.1 25-Oct-2007  bouyer Sync with HEAD.
 1.35.52.1 18-Oct-2007  yamt sync with head.
 1.35.50.2 23-Mar-2008  matt sync with HEAD
 1.35.50.1 06-Nov-2007  matt sync with HEAD
 1.35.48.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.35.38.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.35.30.1 23-Oct-2007  ad Sync with head.
 1.37.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.38.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.38.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.39.22.1 07-Jan-2011  matt Deal with split <spr.h> (and a few other misc fixes).
 1.39.12.2 03-Mar-2009  skrll Sync with HEAD.
 1.39.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.39.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.39.4.3 11-Aug-2010  yamt sync with head.
 1.39.4.2 11-Mar-2010  yamt sync with head
 1.39.4.1 04-May-2009  yamt sync with head.
 1.40.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.42.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.44.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.44.2.1 05-Mar-2011  rmind sync with head
 1.46.4.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.48.28.1 03-Dec-2014  snj Pull up following revision(s) (requested by chs in ticket #291):
sys/arch/ofppc/ofppc/locore.S: revision 1.49
sys/arch/macppc/macppc/locore.S: revision 1.72
in the initial asm code, save the interesting caller-saved registers
(containing "arg" and "len") across function calls to C code.
fixes kernels built with gcc 4.8.
 1.48.12.1 03-Dec-2017  jdolecek update from HEAD
 1.49.20.1 10-Jun-2019  christos Sync with HEAD
 1.49.18.1 28-Jul-2018  pgoyette Sync with HEAD
 1.50.12.1 03-Apr-2021  thorpej Sync with HEAD.
 1.121 16-Dec-2024  martin PR 58909: call model_init() always, even if we could not fetch a "model"
or "name" property.
 1.120 05-Mar-2024  thorpej branches: 1.120.2;
Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().

It's a small step, but it's a step.
 1.119 05-Mar-2021  thorpej branches: 1.119.18;
Move ofppc-specific CPU spinup code to ofppc/machdep.c
 1.118 27-Feb-2021  thorpej Un-do a bunch of misguided code sharing. It's not really shared if it's
full of platform-specific #ifdefs:
- ofwoea_batinit() is gone; just do what's needed early in macppc / ofppc
initppc() functions.
- Get a bunch of Mac-specific stuff out of ofwoea_initppc().
 1.117 26-Mar-2014  christos branches: 1.117.42;
kill sprintf.
 1.116 28-Jul-2012  matt branches: 1.116.2; 1.116.4;
Fix -fno-common fallout.
 1.115 01-Jul-2011  dyoung branches: 1.115.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.114 18-Jun-2011  matt struct device * -> device_t
struct cfdata * -> cfdata_t
use device accessors, use device_private.
some softc/device_t splits (macppc needs a bunch more)
aprint*_dev used considerably more
 1.113 02-Nov-2010  phx branches: 1.113.6;
Default vesa mode for Pegasos is 0x103, not 0x102.
 1.112 10-Mar-2010  kiyohara branches: 1.112.2;
Remove unnecessary function declarations.
 1.111 10-Mar-2010  kiyohara Remove white-spaces.
Indent.
 1.110 25-Feb-2010  matt Adapt to <spr.h> breakup.
 1.109 20-Jan-2010  phx branches: 1.109.2;
Have to include rtas.h for NRTAS definition.
 1.108 16-Jan-2010  phx Allow compilation without rtas device being configured.
 1.107 11-Nov-2008  dyoung It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
 1.106 28-Apr-2008  martin branches: 1.106.6; 1.106.8; 1.106.18;
Remove clause 3 and 4 from TNF licenses
 1.105 11-Feb-2008  garbled branches: 1.105.6; 1.105.8; 1.105.10;
Use model_init to clean up how we decide the ranges for
PCI_NETBSD_CONFIGURE. Add some code to hopefully better handle the
firepower and powerstackII, based on the OFW dumps from those machines.
Untested on those machines, but doesn't break anything on pegasos/7044.
 1.104 17-Jan-2008  garbled Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.103 28-Dec-2007  garbled Add one more convenience function to rtas, rtas_has_func, and add a
global int machine_has_rtas that can be used to decide if a machine has
rtas functionality or not. Take a crack at power off support for the
pegasos, which doesn't work right, probably due to a firmware bug.
 1.102 28-Dec-2007  garbled Take advantage of the new rtas_call function and get rid of the uneeded
rtas_reboot() function. Still reboots even.
 1.101 27-Dec-2007  garbled change some printf's to aprint_normal.
 1.100 27-Dec-2007  garbled Add an infinate loop after the reboot call so we don't somehow drop past
it if it fails.
 1.99 27-Dec-2007  garbled Enable l2 cache on the pegasos
 1.98 26-Nov-2007  garbled branches: 1.98.6;
Apply a set of patches from Frank Wille to make the genfb attachment work
better on ofppc. In doing so, we also move a few functions around in
macppc and the generic ofw powerpc stuff to allow better sharing of code.
Also, introduce a model_init function.

move ofb_cons.c from macppc/dev to powerpc/oea and rename it to rascons.
This gets rid of some naming confusion, and makes it OFW-MI rather than
macppc specific.
 1.97 13-Nov-2007  garbled Add code to detect and initialize the com port correctly, so that we have an
actual real console when booting.
 1.96 04-Nov-2007  garbled branches: 1.96.2;
Get rid of the ofppc use of the ofbus completely, for the last time.

Write a complete OF boot console into ofw_consinit.c and rewire a bunch
of the ifdef logic in that file to use it when appropriate on both macppc
and ofppc. Get rid of the attempt to wire up the serial console early,
as that is extremely difficult on ofppc. Yank all the console code out
of ofppc/machdep.c. (This is a boot console only, not a full blown
console like ofcons.c)

Delete all the ofbus references out of the config files, and pull in
dev/ofw/openfirmio.c and dev/ofw/ofw_subr.c directly rather than pulling
in files.ofw. It might be worth going back and adding a files.ofw-nobus
to that directory to allow pulling in the openfirmware driver without
pulling in the whole ofbus mess.

Change rtas driver to connect directly to mainbus, like the PCI bus nodes do.
 1.95 25-Oct-2007  garbled Add a bunch of fixes and minor rewrites to ofppc to bring it closer to
working properly. This is still a work in progress, and all work so far
has been based on the PegasosII machne.

1) Rewrite how the ISA memory and IO space maps are found. More work
will still need to be done in this area.
2) Add a new OFW method of pci configuration. So far I can only get this
to work on the primary PCI bus on the Pegasos. Unsure if this is a
pegasos bug or a code bug.
3) Add the rtas device to ofppc, and add an "rtas_reboot" function to
rtas to allow me to reboot the PegasosII. The rtas driver works, and is
a great start but needs to be changed slightly to allow easier access to
the functions from outside the driver.
4) Fix a number of bugs that existed in the shared PCI code for ofw that
probably weren't tickled by macppc.

There is much much more left to do here, this is all still a work in
progress, but this commit will allow other people to play around with the
code if they want to.
 1.94 18-Oct-2007  garbled Fix some minor issues in ofppc to make it complete ofwoea_initppc() and
sync up with 1.6 of ofwboot.
 1.93 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.92 14-Jul-2007  ad branches: 1.92.8; 1.92.10; 1.92.12; 1.92.14;
Generic soft interrupts are mandatory.
 1.91 10-Mar-2007  jmmv branches: 1.91.2; 1.91.10;
Implement support for softintrs.
Reviewed, corrected and tested by aymeric@.
 1.90 09-Feb-2007  ad branches: 1.90.2;
Merge newlock2 to head.
 1.89 24-Dec-2005  perry branches: 1.89.20;
bare asm -> __asm
 1.88 23-Nov-2005  nonaka In decr_intr(), update lasttb only when clock interrupt is not masked.
(sync with macppc/macppc/clock.c: rev.1.11 -> 1.12)
 1.87 20-Oct-2003  matt branches: 1.87.16; 1.87.24;
Reorganize the way powerpc port install machine specific headers.
Use <powerpc/oea/bat.h> exclusively and remove <machine/bat.h> and
<powerpc/bat.h>. Remove unneeded <machine/cpufunc.h>. To insure
1:1 correspondence of <powerpc/FOO.h> to <machine/FOO.h> include
"../../powerpc/include/Makefile" in "arch/FOO/include/Makefile".
Incororpate <byte_swap.h> into <bswap.h> and then byte_swap.h
 1.86 15-Jul-2003  lukem __KERNEL_RCSID()
 1.85 23-Jun-2003  aymeric branches: 1.85.2;
call platform.softintr_init() only if it is non-NULL.
This allows NetBSD/ofppc to boot up to userland (i.e. to the point where init
will not launch properly) under psim.
 1.84 26-Apr-2003  ragge Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.83 19-Apr-2003  bjh21 Add NULL cn_halt and cn_flush members to ofppc_bootcons.
 1.82 03-Feb-2003  matt Rename PPC_MPC6XX to PPC_OEA (and any mpc6xx reference to oea).
 1.81 22-Jan-2003  kleink G/c the pmap_bootstrap() segtab interface again. Silly me.
 1.80 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.79 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.78 18-Sep-2002  chs implement device_register() for ofppc.
use ofcons_cnprobe().
 1.77 09-Jul-2002  matt Common OFW code has been moved to powerpc/mpc6xx/ofw_subr.S. Now use it.
 1.76 05-Jul-2002  matt Peform a rototill over the powerpc-based ports.

Move the trap/vector initialization for MPC6xx ports to mpc6xx_machdep.c
Also move softnet, install_extintr, mapiodev, kvtop. Add common BAT
initialization code.

Add user Altivec support.

Fix calls to OF_call_method in macppc/macppc/machdep.c.

Use ci_fpuproc in cpu_info instead of separate fpuproc.

Add separate syscall.c and defined __HAVE_SYSCALL_INTERN.
 1.75 13-May-2002  matt branches: 1.75.2;
Remove redundant declarations.
 1.74 23-Apr-2002  kleink Add a third argument to pmap_bootstrap() which platform-specific
initialization can use to specify additional segment registers to be set
up in the kernel pmap.
 1.73 29-Oct-2001  thorpej branches: 1.73.2;
Add/rework infrastructure that will allow us to support native
device drivers:
- Various native device entries in cdevsw/bdevsw.
- Rework the interrupt infrastructure to provide more flexibility to
the platform-dependent back-end. Rewrite the "ofwgen" simulated
interrupt routines to reflect the changes.
- Clear out the BAT registers and set the fixed battable entries before
calling the platform init routine. The platform init routine is allowed
to set entries in the battable.
- Don't call the platform cons_init routine until after translation is
enabled -- we might need translation to work in order to access bus
space.
 1.72 23-Oct-2001  thorpej branches: 1.72.2;
Add support for fetching DDB symbols from the boot loader. This requires
changes to the boot loader (forthcoming).
 1.71 22-Oct-2001  thorpej Begin the task of splitting up the ofppc port into common code
and platform-specific code, similar to how the Alpha port is
split up.
 1.70 22-Oct-2001  thorpej Fetch the platform name earlier, so we can determine what kind of
system we're running on earlier.
 1.69 10-Sep-2001  chris Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.68 26-Aug-2001  matt branches: 1.68.2;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.67 24-Aug-2001  chs use pmap_k* for buffer cache pages.
 1.66 22-Jul-2001  wiz bcopy -> memcpy, bzero -> memset
 1.65 02-Jun-2001  chs branches: 1.65.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.64 24-Apr-2001  thorpej Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.63 15-Mar-2001  chs eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>
 1.62 24-Feb-2001  matt branches: 1.62.2;
Move cpu_sysct and dump{mag,lo,siz} & cpu_dumpconf to powerpc_machdep.c.
dumpsys is still port-specific for now. XXX dumpsys is still a stub
on all powerpc ports.
 1.61 24-Feb-2001  matt Remove setregs since it now lives in powerpc/powerpc/powerpc_machdep.c
 1.60 16-Nov-2000  thorpej Add an lcsplx() ("splx for locore") like the other PowerPC ports
have. This will allow us to share locore code with them.
 1.59 24-Sep-2000  jdolecek add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

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

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

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.58 13-Sep-2000  thorpej Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.
 1.57 02-Jul-2000  cgd Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.
 1.56 29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.55 26-Jun-2000  mrg remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.54 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.53 24-Mar-2000  ws Update several ports to at least work again without IPKDB
after the update of that.
Sorry for breaking this with my last changes :-(.
Fixes PR#9671 by Lennart Augustsson.
 1.52 21-Feb-2000  erh Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.
 1.51 19-Jan-2000  thorpej Move callout initialization to a single location; no need to duplicate
that code all over the place.
 1.50 19-Jan-2000  danw Add a special trap handler for EXC_ALI that saves dsisr and dar
 1.49 18-Dec-1999  thorpej Update for BATU()/BATL() changes.
 1.48 04-Dec-1999  ragge CL* discarding.
 1.47 17-Nov-1999  kleink Move signal management code common to all PowerPC platforms (sendsig(),
sigreturn(), sigcode) to a single place in the shared powerpc directory.
(The struct sigcontext etc. definitions were already being shared.)
 1.46 17-Nov-1999  kleink One more pmap_enter() catch-up.
 1.45 13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.44 12-Oct-1999  wrstuden branches: 1.44.2; 1.44.4;
Catch up with rev. 1.5 of ../include/cpu.h where we added a new routine
w/o adding a fake_ initializer for it. :-(
 1.43 17-Sep-1999  thorpej branches: 1.43.2;
Centralize the declaration and clearing of `cold'.
 1.42 28-Jun-1999  itojun - Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.
 1.41 26-May-1999  thorpej Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.
 1.40 20-May-1999  lukem * convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes
 1.39 05-May-1999  thorpej Fix msgbuf handling.
 1.38 17-Apr-1999  ws Modify syncicache on PowerPC from an inline to a real function.
Support different cache line sizes with the same object code in userland.
While here, move the function to implementation name space.
 1.37 16-Apr-1999  thorpej Now that we have direct-mapped pool pages, we can garbage-collect VM_MBUF_SIZE
and don't need to allocate mb_map.
 1.36 11-Apr-1999  chs add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.
 1.35 01-Apr-1999  thorpej branches: 1.35.2;
Don't call configure() from cpu_startup().
 1.34 26-Mar-1999  mycroft Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.33 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.32 09-Jan-1999  thorpej Garbage-collect `mbutl'.
 1.31 04-Dec-1998  thorpej Pass the symbol table size, like a.out.
 1.30 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.29 06-Oct-1998  sakamoto Fix unassigned minaddr for uvm_km_suballoc.
Eliminate space at end of line, and so on.
 1.28 13-Sep-1998  mycroft Fix omission in previous; remember to record that we're on the signal stack.
 1.27 13-Sep-1998  thorpej Make signal delivery work again.
 1.26 26-Aug-1998  sakamoto vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t
 1.25 05-Jul-1998  jonathan defopt NS, NSIP.
 1.24 05-Jul-1998  jonathan defopt ISO TPIP.
 1.23 05-Jul-1998  jonathan defopt CCITT.
 1.22 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.21 04-Jul-1998  jonathan defopt DDB.
 1.20 11-Jun-1998  sakamoto Remove unused message.
 1.19 05-Jun-1998  sakamoto Merge in MACHINE_NEW_NONCONTIG support and some fix from Tsubai-San.
UVM support.
 1.18 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.17 08-May-1998  kleink Fix some arithmetics lossage on typeless pointers.
 1.16 19-Feb-1998  thorpej Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.
 1.15 02-Feb-1998  thorpej Rearrange slightly the way the debugger exception vectors are initialized.
 1.14 27-Jan-1998  sakamoto Import DDB from OpenBSD/powerpc.
 1.13 13-Nov-1997  veego s/NETHER/NARP/ and s/ether.h/arp.h/ for the 'new' arp system.
 1.12 12-Sep-1997  mycroft branches: 1.12.2;
Oops; didn't delete two retval[] usages in setregs().
 1.11 11-Sep-1997  mycroft Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)
 1.10 12-Jun-1997  mrg branches: 1.10.4; 1.10.6;
bring mrg-vm-swap2 onto mainilne.
 1.9 09-Jun-1997  veego Initialize machine from MACHINE and machine_arch from MACHINE_ARCH.
 1.8 06-Jun-1997  veego Add 'char machine_arch[] = "xxx";' for the new sysctl hw.machine_arch.
 1.7 16-Apr-1997  thorpej branches: 1.7.2;
Several changes from Wolfgang Solfrank, Charles Hannum, and myself:
- Make setregs() conform to the PowerPC SVR4 ABI, plus one NetBSD
extention (for ps_strings).
- machine == powerpc, not PowerPC.
- Set up machine vector for OpenFirmware.
- Nuke the msgbuf for now; it's not mapped correctly.
- Add missing casts in some asm() directives.
- Enable PSL_RI earlier, and do *not* disable it in fake_spl(), since it
is needed for page faults.
- Some general cleanup.
 1.6 27-Mar-1997  thorpej Don't allocate mclrefcnt[]; it's dead and gone.
 1.5 26-Mar-1997  gwr Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/
 1.4 16-Oct-1996  ws branches: 1.4.4;
Rename recently checked in KGDB to IPKDB to resolve conflicts with older KGDB
 1.3 13-Oct-1996  christos backout previous kprintf change
 1.2 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1 30-Sep-1996  ws PowerPC port
 1.4.4.1 12-Feb-1997  mrg don't allocate swap map in allocsys.
 1.7.2.1 04-May-1997  mrg re-merge mrg-vm-swap into -current, and call it mrg-vm-swap2.
 1.10.6.1 08-Sep-1997  thorpej Significantly restructure the way signal state for a process is stored.
Rather than using bitmasks to redundantly store the information kept
in the process's sigacts (because the sigacts was kept in the u-area),
hang sigacts directly off the process, and access it directly.

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

Make sigacts sharable by adding reference counting.
 1.10.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.2.1 15-Nov-1997  mellon Pull rev 1.13 up from trunk (veego)
 1.35.2.2 20-Jan-2000  he Pull up revision 1.50 (requested by danw):
Add (the beginnings of) an unaligned access handler for the
powerpc, to get around the fact that gcc currently generates bad
floating point copies sometimes, which breaks various things,
 1.35.2.1 16-Apr-1999  chs branches: 1.35.2.1.2; 1.35.2.1.4;
pull up 1.35 -> 1.36:
add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.
 1.35.2.1.4.2 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

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

synchronization to latest KAME will take place on HEAD branch soon.
 1.35.2.1.4.1 06-Jul-1999  itojun KAME/NetBSD 1.4, SNAP kit 1999/07/05.
NOTE: this branch is just for reference purposes (i.e. for taking cvs diff).
do not touch anything on the branch. actual work must be done on HEAD branch.
 1.35.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.35.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.43.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.44.4.1 15-Nov-1999  fvdl Sync with -current
 1.44.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.44.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.44.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.44.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.62.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.62.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.65.2.7 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.65.2.6 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.65.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.65.2.4 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.65.2.3 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.65.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.65.2.1 03-Aug-2001  lukem update to -current
 1.68.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.72.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.73.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.73.2.5 01-Aug-2002  nathanw Catch up to -current.
 1.73.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.73.2.3 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.73.2.2 05-Nov-2001  briggs Initial SA support for ppc. Test-booted on sandpoint, macppc, & walnut.
mcontext and cpu_getmcontext()/cpu_setmcontext() from Klaus Klein
<kleink@netbsd.org>.
 1.73.2.1 29-Oct-2001  briggs file machdep.c was added on branch nathanw_sa on 2001-11-05 19:46:15 +0000
 1.75.2.1 16-Jul-2002  gehenna catch up with -current.
 1.85.2.4 11-Dec-2005  christos Sync with head.
 1.85.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.85.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.85.2.1 03-Aug-2004  skrll Sync with HEAD
 1.87.24.1 29-Nov-2005  yamt sync with head.
 1.87.16.8 27-Feb-2008  yamt sync with head.
 1.87.16.7 21-Jan-2008  yamt sync with head
 1.87.16.6 07-Dec-2007  yamt sync with head
 1.87.16.5 15-Nov-2007  yamt sync with head.
 1.87.16.4 27-Oct-2007  yamt sync with head.
 1.87.16.3 03-Sep-2007  yamt sync with head.
 1.87.16.2 26-Feb-2007  yamt sync with head.
 1.87.16.1 21-Jun-2006  yamt sync with head.
 1.89.20.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.90.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.91.10.4 17-Oct-2007  garbled Via a patch from jkunz, put back the ofbus and ofcons code for now, until
we write a better way to handle the console.
 1.91.10.3 03-Oct-2007  garbled Fix a merge bogon
 1.91.10.2 03-Oct-2007  garbled Sync with HEAD
 1.91.10.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.91.2.4 03-Dec-2007  ad Sync with HEAD.
 1.91.2.3 03-Dec-2007  ad Sync with HEAD.
 1.91.2.2 23-Oct-2007  ad Sync with head.
 1.91.2.1 15-Jul-2007  ad Sync with head.
 1.92.14.3 18-Nov-2007  bouyer Sync with HEAD
 1.92.14.2 13-Nov-2007  bouyer Sync with HEAD
 1.92.14.1 25-Oct-2007  bouyer Sync with HEAD.
 1.92.12.1 18-Oct-2007  yamt sync with head.
 1.92.10.3 23-Mar-2008  matt sync with HEAD
 1.92.10.2 09-Jan-2008  matt sync with HEAD
 1.92.10.1 06-Nov-2007  matt sync with HEAD
 1.92.8.5 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.92.8.4 14-Nov-2007  joerg Sync with HEAD.
 1.92.8.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.92.8.2 28-Oct-2007  joerg Sync with HEAD.
 1.92.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.96.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.96.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.96.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.98.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.98.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.105.10.4 11-Aug-2010  yamt sync with head.
 1.105.10.3 11-Mar-2010  yamt sync with head
 1.105.10.2 04-May-2009  yamt sync with head.
 1.105.10.1 16-May-2008  yamt sync with head.
 1.105.8.1 18-May-2008  yamt sync with head.
 1.105.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.105.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.106.18.1 07-Jan-2011  matt Deal with split <spr.h> (and a few other misc fixes).
 1.106.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.106.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.109.2.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.109.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.112.2.1 05-Mar-2011  rmind sync with head
 1.113.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.115.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.115.2.1 30-Oct-2012  yamt sync with head
 1.116.4.1 18-May-2014  rmind sync with head
 1.116.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.117.42.1 03-Apr-2021  thorpej Sync with HEAD.
 1.119.18.1 31-Dec-2024  snj Pull up following revision(s) (requested by martin in ticket #1030):
sys/arch/ofppc/ofppc/machdep.c: 1.121
PR 58909: call model_init() always, even if we could not fetch a "model"
or "name" property.
 1.120.2.1 02-Aug-2025  perseant Sync with HEAD
 1.32 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.31 24-Apr-2021  thorpej branches: 1.31.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.30 31-Dec-2014  phx branches: 1.30.32;
Make it compile with GCC48.
 1.29 21-Apr-2013  kiyohara branches: 1.29.10; 1.29.12;
Fix hangup to interrupt on cascading PIC.
tested on bebox and evbppc/OPENBLOCKS600.
 1.28 30-Jun-2011  matt branches: 1.28.2; 1.28.12;
Modify mapiodev to take a third argument indicating whether the space
should be prefetchable (true) or not (false).
 1.27 05-Jun-2011  matt struct device * -> device_t, struct cfdata * -> cfdata_t
CFATTACH_DECL(*, sizeof(struct device), -> CFATTACH_DECL_NEW(&, 0
 1.26 09-Jun-2010  kiyohara branches: 1.26.2; 1.26.6;
Support MV64361 on PegasosII by gt(4).
+ Support gtpci@gt instead of pegasospci more smartly.
+ Support Gigabit Ethernet by mvgbe@gt.
 1.25 10-Mar-2010  kiyohara branches: 1.25.2;
Remove white-spaces.
Indent.
 1.24 15-Jan-2010  phx branches: 1.24.2;
Fixed crash, when /rtas was not found: OF_finddevice() returns -1 when
the device is not found.
 1.23 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.22 08-Apr-2008  garbled branches: 1.22.2; 1.22.4;
SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc. Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000. Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
 1.21 13-Feb-2008  garbled branches: 1.21.6;
Fix a botch in the comparison of two addresses, where I forgot to add in
the offset of a range. With this fix to the openpic initialization,
ofppc now boots single user on a 7046-B50. Thanks to Jochen Kunz for
giving me remote access to a B50 to hack on it.
 1.20 07-Feb-2008  garbled Add some simple code to print out what the OFW thinks the cache
configuration of the machine is. Amusingly, the OFW on the pegasos is
dead wrong.

Bump CPU_MAXNUM to 8, because, thats probably a reasonable number for now.
 1.19 17-Jan-2008  garbled Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.18 11-Dec-2007  garbled Fix the endless stream of 7's problem on i8259-like interrupt controllers
once and for all. The i8259 does not like to be read in a loop, when an
interrupt comes in, it will return a valid value, however, if you keep
reading it until there are no outstanding interrupts, it will return 7
(which is the lpt interrupt). Change the pic handler to give an argument
to the get_irq functions of mode, which indicates if this is the first
time we are asking, or if we are just rechecking in a loop. Non-i8259
handlers can safely ignore this argument.

Tested to fix the stream of 7's problem on prep and ofppc. Got rid of
the nasty hack in ofppc with this too, and the prep machine seems to take
less interrupts now, which is a good thing.
 1.17 07-Nov-2007  garbled branches: 1.17.2; 1.17.4; 1.17.6;
Convert ofppc to the shared ofw_autoconf.c
 1.16 06-Nov-2007  garbled Add a bunch of devices to GENERIC. Fix interrupts on the PegasosII with
a nasty little hack. Getting closer to a working system.
 1.15 25-Oct-2007  garbled branches: 1.15.2;
Add a bunch of fixes and minor rewrites to ofppc to bring it closer to
working properly. This is still a work in progress, and all work so far
has been based on the PegasosII machne.

1) Rewrite how the ISA memory and IO space maps are found. More work
will still need to be done in this area.
2) Add a new OFW method of pci configuration. So far I can only get this
to work on the primary PCI bus on the Pegasos. Unsure if this is a
pegasos bug or a code bug.
3) Add the rtas device to ofppc, and add an "rtas_reboot" function to
rtas to allow me to reboot the PegasosII. The rtas driver works, and is
a great start but needs to be changed slightly to allow easier access to
the functions from outside the driver.
4) Fix a number of bugs that existed in the shared PCI code for ofw that
probably weren't tickled by macppc.

There is much much more left to do here, this is all still a work in
progress, but this commit will allow other people to play around with the
code if they want to.
 1.14 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.13 11-Dec-2005  christos branches: 1.13.30; 1.13.38; 1.13.48; 1.13.50; 1.13.52; 1.13.54;
merge ktrace-lwp.
 1.12 15-Jul-2003  lukem branches: 1.12.16;
__KERNEL_RCSID()
 1.11 01-Jan-2003  thorpej branches: 1.11.2;
Use aprint_normal() for cfprint routines.
 1.10 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 18-Sep-2002  chs implement device_register() for ofppc.
use ofcons_cnprobe().
 1.7 23-Oct-2001  thorpej branches: 1.7.4;
For systems (like the briQ) that don't have a "/cpus", look for
CPUs in the OFW top-level.
 1.6 22-Oct-2001  thorpej Begin the task of splitting up the ofppc port into common code
and platform-specific code, similar to how the Alpha port is
split up.
 1.5 22-Oct-2001  thorpej Fetch the platform name earlier, so we can determine what kind of
system we're running on earlier.
 1.4 22-Oct-2001  thorpej Various things that make OFW-driver kernels work on my Firepower LX MP
again:
- Special-case the attachment of CPUs, and logically attach them to
"mainbus", attaching them before any other devices. Otherwise,
CPUs would be found very late in the game on my Firepower.
- Sanity check the timebase-frequency property, printing a warning if
it's not the same on each CPU.
- Pass the correct CPU ID to cpu_attach_subr().
- Fetch the platform name from the OFW root node. We can key off this
later when we implement support for native drivers in the ofppc port.
- Use a table of "special" toplevel OFW nodes ... we skip these nodes
during the device configuration phase. This generally includes the
"options", "packages", etc. nodes. Inspired by sparc & sparc64 ports.
 1.3 26-Aug-2001  matt Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.2 15-Aug-1998  mycroft branches: 1.2.26;
Assign my copyrights to TNF.
 1.1 24-Feb-1998  mycroft Catch up with changes in dev/ofw. Add mainbus.
 1.2.26.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.26.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.26.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.7.4.3 03-Jan-2003  thorpej Sync with HEAD.
 1.7.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.7.4.1 23-Oct-2001  nathanw file mainbus.c was added on branch nathanw_sa on 2002-10-18 02:39:20 +0000
 1.11.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.16.5 27-Feb-2008  yamt sync with head.
 1.12.16.4 11-Feb-2008  yamt sync with head.
 1.12.16.3 21-Jan-2008  yamt sync with head
 1.12.16.2 15-Nov-2007  yamt sync with head.
 1.12.16.1 27-Oct-2007  yamt sync with head.
 1.13.54.2 13-Nov-2007  bouyer Sync with HEAD
 1.13.54.1 25-Oct-2007  bouyer Sync with HEAD.
 1.13.52.1 18-Oct-2007  yamt sync with head.
 1.13.50.4 23-Mar-2008  matt sync with HEAD
 1.13.50.3 09-Jan-2008  matt sync with HEAD
 1.13.50.2 08-Nov-2007  matt sync with -HEAD
 1.13.50.1 06-Nov-2007  matt sync with HEAD
 1.13.48.4 11-Nov-2007  joerg Sync with HEAD.
 1.13.48.3 06-Nov-2007  joerg Sync with HEAD.
 1.13.48.2 28-Oct-2007  joerg Sync with HEAD.
 1.13.48.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.13.38.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.13.30.2 03-Dec-2007  ad Sync with HEAD.
 1.13.30.1 23-Oct-2007  ad Sync with head.
 1.15.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.15.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.15.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.17.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.17.6.1 13-Dec-2007  bouyer Sync with HEAD
 1.17.4.1 13-Dec-2007  yamt sync with head.
 1.17.2.1 26-Dec-2007  ad Sync with head.
 1.21.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.22.4.3 11-Aug-2010  yamt sync with head.
 1.22.4.2 11-Mar-2010  yamt sync with head
 1.22.4.1 16-May-2008  yamt sync with head.
 1.22.2.1 18-May-2008  yamt sync with head.
 1.24.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.24.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.25.2.2 12-Jun-2011  rmind sync with head
 1.25.2.1 03-Jul-2010  rmind sync with head
 1.26.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.26.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.28.12.2 03-Dec-2017  jdolecek update from HEAD
 1.28.12.1 23-Jun-2013  tls resync from head
 1.28.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.29.12.1 06-Apr-2015  skrll Sync with HEAD
 1.29.10.1 04-Jan-2015  martin Pull up following revision(s) (requested by phx in ticket #380):
sys/arch/ofppc/ofppc/mainbus.c: revision 1.30
Make it compile with GCC48.
 1.30.32.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.31.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 29-May-1998  sakamoto Revert OpenFirmware files to powerpc directory.
OpenFirmware files are used by ofppc/macppc.
 1.4 24-Feb-1998  mycroft Catch up with changes in dev/ofw. Add mainbus.
 1.3 16-Apr-1997  thorpej Fix some bogons in boot path parsing code.
 1.2 31-Jan-1997  thorpej Find the root device in a much more sane way. Also, remove all of the
code that determines the root file system type. This is now done in
machine-independent code, much differently.
 1.1 30-Sep-1996  ws branches: 1.1.2;
PowerPC port
 1.1.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

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

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

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

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

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

config netbsd root on cd0a type cd9660

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

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

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

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

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

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.3 29-May-1998  sakamoto Revert OpenFirmware files to powerpc directory.
OpenFirmware files are used by ofppc/macppc.
 1.2 09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.1 16-Apr-1997  thorpej branches: 1.1.4;
Special Magick note section interpreted by OpenFirmware to set various
parameters. Shared by kernel and OpenFirmware boot program.
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3 29-May-1998  sakamoto Revert OpenFirmware files to powerpc directory.
OpenFirmware files are used by ofppc/macppc.
 1.2 16-Apr-1997  thorpej - Symbol cleanup, a'la locore.S
- Fix a 16-bit botch when disabling MMU
- Properly align save areas and temporary stacks.
 1.1 30-Sep-1996  ws PowerPC port
 1.3 29-May-1998  sakamoto Revert OpenFirmware files to powerpc directory.
OpenFirmware files are used by ofppc/macppc.
 1.2 02-Feb-1998  thorpej Implement OF_getproplen().
 1.1 30-Sep-1996  ws PowerPC port
 1.7 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.6 11-Dec-2005  christos branches: 1.6.30; 1.6.38; 1.6.48; 1.6.50; 1.6.52; 1.6.54;
merge ktrace-lwp.
 1.5 15-Oct-2005  tsutsui All of FIREPOWER_ES, FIREPOWER_MX and FIREPOWER_LX require
the same platinit function, so don't check them separately.
 1.4 15-Jul-2003  lukem branches: 1.4.16;
__KERNEL_RCSID()
 1.3 29-Oct-2001  thorpej branches: 1.3.2; 1.3.4; 1.3.20;
Check in of work-in-progress of Firepower native device support.
We can find devices in PCI configuration space, but not much else.
 1.2 23-Oct-2001  thorpej branches: 1.2.2;
Add the correct model string for the Total Impact briQ.
 1.1 22-Oct-2001  thorpej Begin the task of splitting up the ofppc port into common code
and platform-specific code, similar to how the Alpha port is
split up.
 1.2.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.20.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.20.1 03-Aug-2004  skrll Sync with HEAD
 1.3.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.1 29-Oct-2001  thorpej file platform.c was added on branch kqueue on 2002-01-10 19:47:14 +0000
 1.3.2.2 29-Oct-2001  thorpej Check in of work-in-progress of Firepower native device support.
We can find devices in PCI configuration space, but not much else.
 1.3.2.1 29-Oct-2001  thorpej file platform.c was added on branch nathanw_sa on 2001-10-29 22:28:39 +0000
 1.4.16.2 27-Oct-2007  yamt sync with head.
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.6.54.1 25-Oct-2007  bouyer Sync with HEAD.
 1.6.52.1 18-Oct-2007  yamt sync with head.
 1.6.50.1 06-Nov-2007  matt sync with HEAD
 1.6.48.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.6.38.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.6.30.1 23-Oct-2007  ad Sync with head.
 1.3 05-Mar-2003  matt Remove port-specific procfs_machdep.c (since they are all identical and
a better one resides in powerpc/powerpc/).
 1.2 18-Jan-2001  tv No-op commit to force update to a non-"-kk" revision.
 1.1 17-Jan-2001  fvdl branches: 1.1.2;
Add machdep file for procfs. Currently only used for linux-style
/proc/cpuinfo (only active when procfs is mounted with -o linux).
For ports other than the i386 this currently produces an empty
string.
 1.1.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.1.2.1 17-Jan-2001  bouyer file procfs_machdep.c was added on branch thorpej_scsipi on 2001-01-18 09:22:53 +0000
 1.7 22-Oct-2001  thorpej Begin the task of splitting up the ofppc port into common code
and platform-specific code, similar to how the Alpha port is
split up.
 1.6 06-Oct-2001  thorpej soft_splvm() - "block" SPLBIO, SPLNET, and SPLTTY in addition to SPLIMP
and the soft interrupts. Probably doesn't matter for an all OFW kernel,
since all devices are polling, but done for correctness.

soft_splsoftnet() - make sure to block softclock, as well. While
you're in the network code at splsoftnet(), you don't want a soft
clock interrupt tripping some network-related timeout and reentering
the network code.
 1.5 26-Aug-2001  matt branches: 1.5.2;
Make all powerpc ports use a common Makefile.powerpc (except walnut)
Enforce -Wmissing-prototypes -Wstrict-prototypes for all ppc ports.
Split out macppc cpu support and make common to mpc6xx ports. Make
other mpc6xx ports use it. Add evcnts for mpc6xx traps.
 1.4 12-Apr-2001  thorpej branches: 1.4.2;
splimp -> splvm
 1.3 15-Jan-2001  thorpej branches: 1.3.2;
Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
 1.2 05-Aug-1999  thorpej branches: 1.2.2;
Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied. Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

This fixes a problem with using the "rnd" pseudo-device from within
interrupt context to extract random data (e.g. from within the softnet
interrupt) where doing so would incorrectly unblock interrupts (causing
all sorts of lossage).

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX. This platforms still have this bug until their
XXX spl*() functions are fixed.
 1.1 16-Apr-1997  thorpej "Simulated" software-spl handling, for use on OpenFirmware systems.
These are for a generalized "machine vector" designed to hide
differences between various PowerPC systems.
From Wolfgang Solfrank <ws@tools.de>
 1.2.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.2.2.1 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.3.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.5.2.1 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.6 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.5 10-Nov-2019  chs branches: 1.5.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.4 01-Jul-2011  dyoung branches: 1.4.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 17-Dec-2010  phx Set the GPIO to enable AGP configuration space access when attaching gtpci0
and do not reset it again. This keeps AGP devices visible after configure().
Improved the match-function to look for a Discovery controller on the PCI
bus.
 1.2 20-Jun-2010  matt branches: 1.2.2; 1.2.4; 1.2.6;
My pegasos2 doesn't have an ethernet node at the top level.
Deal with it.
 1.1 09-Jun-2010  kiyohara Support MV64361 on PegasosII by gt(4).
+ Support gtpci@gt instead of pegasospci more smartly.
+ Support Gigabit Ethernet by mvgbe@gt.
 1.2.6.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.2.6.1 20-Jun-2010  uebayasi file gt_mainbus.c was added on branch uebayasi-xip on 2010-08-17 06:45:01 +0000
 1.2.4.2 11-Aug-2010  yamt sync with head.
 1.2.4.1 20-Jun-2010  yamt file gt_mainbus.c was added on branch yamt-nfs-mp on 2010-08-11 22:52:31 +0000
 1.2.2.3 05-Mar-2011  rmind sync with head
 1.2.2.2 03-Jul-2010  rmind sync with head
 1.2.2.1 20-Jun-2010  rmind file gt_mainbus.c was added on branch rmind-uvmplock on 2010-07-03 01:19:25 +0000
 1.4.54.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.21 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.20 12-May-2021  thorpej branches: 1.20.4;
Pass along our device handle to the PCI bus instance we attach.
 1.19 24-Apr-2021  thorpej branches: 1.19.2; 1.19.4;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.18 21-Nov-2020  thorpej branches: 1.18.2;
malloc(9) -> kmem(9)
 1.17 07-Jul-2020  thorpej branches: 1.17.2;
Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
Provide a new resource provider API:

==> pciconf_resource_init() -- Initialize a PCI configuration resources
container.
==> pciconf_resource_add() -- Add a PCI configuration resource to the
container (I/O, MEM, or prefetchable MEM). Multiple resources of
each type may be added.
==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
container once the bus has been configured.

This is much easier to use than the previous method of providing an
extent map for each kind of resource, and works better for e.g. ACPI
platforms that provide potentially multiple PCI resources in tables
provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
rather than extent maps.
 1.16 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.15 10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.14 11-Jan-2017  christos branches: 1.14.16;
PR/51827: David Binderman: delete pointless local variable
 1.13 19-Oct-2016  nonaka Added MSI/MSI-X and interrupt_distribute(9) support for powerpc.
 1.12 28-Feb-2014  matt branches: 1.12.6; 1.12.10;
Use PRIxPTR
 1.11 27-Jan-2012  para branches: 1.11.6; 1.11.10;
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.10 18-Jun-2011  matt branches: 1.10.2; 1.10.6;
struct device * -> device_t
struct cfdata * -> cfdata_t
use device accessors, use device_private.
some softc/device_t splits (macppc needs a bunch more)
aprint*_dev used considerably more
 1.9 17-May-2011  dyoung branches: 1.9.2;
PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name. Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
 1.8 28-Apr-2008  martin branches: 1.8.22; 1.8.28;
Remove clause 3 and 4 from TNF licenses
 1.7 08-Apr-2008  garbled branches: 1.7.2; 1.7.4;
SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc. Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000. Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
 1.6 11-Feb-2008  garbled branches: 1.6.6;
Use model_init to clean up how we decide the ranges for
PCI_NETBSD_CONFIGURE. Add some code to hopefully better handle the
firepower and powerstackII, based on the OFW dumps from those machines.
Untested on those machines, but doesn't break anything on pegasos/7044.
 1.5 17-Jan-2008  garbled Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.4 26-Oct-2007  garbled branches: 1.4.2; 1.4.4; 1.4.6; 1.4.12;
Add code to properly detect the interrupt mapping on the PegasosII, and any
other OFW machine that fails our first two methods.
 1.3 25-Oct-2007  garbled Add a bunch of fixes and minor rewrites to ofppc to bring it closer to
working properly. This is still a work in progress, and all work so far
has been based on the PegasosII machne.

1) Rewrite how the ISA memory and IO space maps are found. More work
will still need to be done in this area.
2) Add a new OFW method of pci configuration. So far I can only get this
to work on the primary PCI bus on the Pegasos. Unsure if this is a
pegasos bug or a code bug.
3) Add the rtas device to ofppc, and add an "rtas_reboot" function to
rtas to allow me to reboot the PegasosII. The rtas driver works, and is
a great start but needs to be changed slightly to allow easier access to
the functions from outside the driver.
4) Fix a number of bugs that existed in the shared PCI code for ofw that
probably weren't tickled by macppc.

There is much much more left to do here, this is all still a work in
progress, but this commit will allow other people to play around with the
code if they want to.
 1.2 17-Oct-2007  garbled branches: 1.2.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.1 21-Jun-2007  garbled branches: 1.1.2; 1.1.6; 1.1.8; 1.1.10;
file ofwpci.c was initially added on branch ppcoea-renovation.
 1.1.10.2 13-Nov-2007  bouyer Sync with HEAD
 1.1.10.1 25-Oct-2007  bouyer Sync with HEAD.
 1.1.8.1 18-Oct-2007  yamt sync with head.
 1.1.6.2 28-Oct-2007  joerg Sync with HEAD.
 1.1.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.1.2.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.2.2.3 03-Dec-2007  ad Sync with HEAD.
 1.2.2.2 23-Oct-2007  ad Sync with head.
 1.2.2.1 17-Oct-2007  ad file ofwpci.c was added on branch vmlocking on 2007-10-23 20:36:01 +0000
 1.4.12.1 19-Jan-2008  bouyer Sync with HEAD
 1.4.6.3 23-Mar-2008  matt sync with HEAD
 1.4.6.2 06-Nov-2007  matt sync with HEAD
 1.4.6.1 26-Oct-2007  matt file ofwpci.c was added on branch matt-armv6 on 2007-11-06 23:20:04 +0000
 1.4.4.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.2.4 27-Feb-2008  yamt sync with head.
 1.4.2.3 21-Jan-2008  yamt sync with head
 1.4.2.2 27-Oct-2007  yamt sync with head.
 1.4.2.1 26-Oct-2007  yamt file ofwpci.c was added on branch yamt-lazymbuf on 2007-10-27 11:27:31 +0000
 1.6.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.4.1 16-May-2008  yamt sync with head.
 1.7.2.1 18-May-2008  yamt sync with head.
 1.8.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.22.1 31-May-2011  rmind sync with head
 1.9.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.10.6.1 18-Feb-2012  mrg merge to -current.
 1.10.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.11.10.1 18-May-2014  rmind sync with head
 1.11.6.2 03-Dec-2017  jdolecek update from HEAD
 1.11.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.10.2 20-Mar-2017  pgoyette Sync with HEAD
 1.12.10.1 04-Nov-2016  pgoyette Sync with HEAD
 1.12.6.2 05-Feb-2017  skrll Sync with HEAD
 1.12.6.1 05-Dec-2016  skrll Sync with HEAD
 1.14.16.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.17.2.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.18.2.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.19.4.1 31-May-2021  cjep sync with head
 1.19.2.1 13-May-2021  thorpej Sync with HEAD.
 1.20.4.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.5 04-Mar-2007  christos branches: 1.5.2; 1.5.10; 1.5.18; 1.5.20; 1.5.22; 1.5.24;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 24-Dec-2005  perry branches: 1.4.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 15-Jul-2003  lukem branches: 1.2.16;
__KERNEL_RCSID()
 1.1 29-Oct-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.20;
Check in of work-in-progress of Firepower native device support.
We can find devices in PCI configuration space, but not much else.
 1.1.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.20.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 29-Oct-2001  thorpej file pci_bus_io_chipdep.c was added on branch kqueue on 2002-01-10 19:47:15 +0000
 1.1.2.2 29-Oct-2001  thorpej Check in of work-in-progress of Firepower native device support.
We can find devices in PCI configuration space, but not much else.
 1.1.2.1 29-Oct-2001  thorpej file pci_bus_io_chipdep.c was added on branch nathanw_sa on 2001-10-29 22:28:40 +0000
 1.2.16.3 27-Oct-2007  yamt sync with head.
 1.2.16.2 03-Sep-2007  yamt sync with head.
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.24.1 25-Oct-2007  bouyer Sync with HEAD.
 1.5.22.1 18-Oct-2007  yamt sync with head.
 1.5.20.1 06-Nov-2007  matt sync with HEAD
 1.5.18.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.5.10.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.5.2.1 23-Oct-2007  ad Sync with head.
 1.6 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.5 04-Mar-2007  christos branches: 1.5.2; 1.5.10; 1.5.18; 1.5.20; 1.5.22; 1.5.24;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 24-Dec-2005  perry branches: 1.4.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 15-Jul-2003  lukem branches: 1.2.16;
__KERNEL_RCSID()
 1.1 29-Oct-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.20;
Check in of work-in-progress of Firepower native device support.
We can find devices in PCI configuration space, but not much else.
 1.1.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.20.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 29-Oct-2001  thorpej file pci_bus_mem_chipdep.c was added on branch kqueue on 2002-01-10 19:47:16 +0000
 1.1.2.2 29-Oct-2001  thorpej Check in of work-in-progress of Firepower native device support.
We can find devices in PCI configuration space, but not much else.
 1.1.2.1 29-Oct-2001  thorpej file pci_bus_mem_chipdep.c was added on branch nathanw_sa on 2001-10-29 22:28:40 +0000
 1.2.16.3 27-Oct-2007  yamt sync with head.
 1.2.16.2 03-Sep-2007  yamt sync with head.
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.4.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.24.1 25-Oct-2007  bouyer Sync with HEAD.
 1.5.22.1 18-Oct-2007  yamt sync with head.
 1.5.20.1 06-Nov-2007  matt sync with HEAD
 1.5.18.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.5.10.1 21-Jun-2007  garbled Completely rewrite ofppc from scratch.

1) Change it to be like the other ppc ports, and directly interface with
hardware, rather than trying to be slick and access everything through
the OFW. Instead, we gather configuration information from OFW, and use
that to discover hardware.

2) Change it over to powerpc bus_space and bus_dma.

3) Timecounters, generic soft interrupts.

4) Make use of the shared code in powerpc. (pic code, oea, bat code, etc)

5) Probably other stuff.. almost nothing remains of the original port.

It is assumed that in it's present state this will not run on any
machines. However, it should be pretty close, and will just need some
massaging and care from someone with access to hardware to make it work.
The code is written to target a CHRP compatible machine, but there is no
reason it cannot be ported to other machines like the Pegasos or Efika.
I simply don't have the knowledge of those machines to structure the code
for them, but I have attempted to keep it generic enough that such work
could still be done.

If anyone with access to hardware would like to take this on, I will
gladly assist as much as possible.
 1.5.2.1 23-Oct-2007  ad Sync with head.
 1.15 09-Jun-2010  kiyohara Support MV64361 on PegasosII by gt(4).
+ Support gtpci@gt instead of pegasospci more smartly.
+ Support Gigabit Ethernet by mvgbe@gt.
 1.14 28-Apr-2008  martin branches: 1.14.14; 1.14.20; 1.14.22;
Remove clause 3 and 4 from TNF licenses
 1.13 28-Jan-2008  garbled branches: 1.13.6; 1.13.8; 1.13.10;
Apparently BRIDGE mode allows BAT registers, so re-enable that code.
Change the pegasos PCI_NETBSD_CONFIGURE arguments around to wire up mem
space into the correct area, and move the io regs a little to make it
work properly. Just avoid the secondary PCI entirely.
Change the list of things that we fiddle with in pci_conf_hook. Map mem
on the fwohci, avoid display cards, avoid IO on the auvia.
Change some printf's to aprint_*
Yank a call to genppc_pci_indirect_make_tag and change it to the
bus-independant pci call instead. (in pci_conf_hook)
 1.12 17-Jan-2008  garbled Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine. Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
 1.11 11-Jan-2008  mrg enable PCI_NETBSD_CONFIGURE for ofppc.

the call to pci_configure_bus(9) and it's supporting code is
copied verbatim from the prep port.

this allows us to completely remove the really gross pegasos
specific pegasospci_indirect_attach_hook() that set various
pci command regs, since all those devices (mostly work now,
see below) and additionally PCI plugin cards work now too.

it also makes the pegasos onboard vr(4) ethernet work with
disk boot (it previously only worked with netboot.)

in the generic macppc ofw pci conf hook and for pegasos,
don't configure the viaide(4) device, and don't configure
memory space on the fwohci(4) device.


with this, and my other recent ofppc/ppc changes the pegasos
port is mostly functional. the marvell gige is not working,
and my 512mb appears as only about 256mb, but otherwise
this port is almost done!
 1.10 09-Jan-2008  mrg extend the grossness that is pegasospci_indirect_attach_hook() a little
further and enable the vr(4) located at pci 0 dev 13 fn 0.

now my vr(4) works from disk boot.
 1.9 27-Dec-2007  garbled change some printf's to aprint_normal.
 1.8 24-Dec-2007  phx Make USB, IEEE1394 and viaaudio attach to the Pegasos2.
USB works fine. IEEE1394 is untested. Audio doesn't work (playing white noise).
Need to set IO/MEM-enable for IEEE1394 and audio, as the firmware (Smart
Firmware 1.2) doesn't do it.
Patch approved by Tim Rightnour.
 1.7 26-Nov-2007  garbled branches: 1.7.2; 1.7.4; 1.7.8;
Apply a set of patches from Frank Wille to make the genfb attachment work
better on ofppc. In doing so, we also move a few functions around in
macppc and the generic ofw powerpc stuff to allow better sharing of code.
Also, introduce a model_init function.

move ofb_cons.c from macppc/dev to powerpc/oea and rename it to rascons.
This gets rid of some naming confusion, and makes it OFW-MI rather than
macppc specific.
 1.6 13-Nov-2007  garbled Add code to detect and initialize the com port correctly, so that we have an
actual real console when booting.
 1.5 07-Nov-2007  garbled branches: 1.5.2;
Convert ofppc to the shared ofw_autoconf.c
 1.4 05-Nov-2007  garbled branches: 1.4.2; 1.4.4;
Lots of small changes for ofppc:

Remove the ofb driver. I'm not interested in trying to make this work.
It should be replaced with the genfb driver, which I have added,
commented out because that driver needs work before it will function on
ofppc. (it's too panic-happy, and ofppc needs a working autoconf.c)

Change the way we do isa_inb/outb. The new way is a slightly nastier
hack, but won't run afoul of the other isa drivers as much.

Fix ofw_consinit.c to remove the dependency on ofb.
 1.3 04-Nov-2007  garbled Apply patch from Frank Wille to make the pegasos2 pci scan work
properly. Modified slightly by me to add the pegasosreg.h file.

With this change, the pegasos correctly scans both primary and secondary
PCI busses.
 1.2 26-Oct-2007  garbled branches: 1.2.2; 1.2.4;
Add code to properly detect the interrupt mapping on the PegasosII, and any
other OFW machine that fails our first two methods.
 1.1 25-Oct-2007  garbled Add a bunch of fixes and minor rewrites to ofppc to bring it closer to
working properly. This is still a work in progress, and all work so far
has been based on the PegasosII machne.

1) Rewrite how the ISA memory and IO space maps are found. More work
will still need to be done in this area.
2) Add a new OFW method of pci configuration. So far I can only get this
to work on the primary PCI bus on the Pegasos. Unsure if this is a
pegasos bug or a code bug.
3) Add the rtas device to ofppc, and add an "rtas_reboot" function to
rtas to allow me to reboot the PegasosII. The rtas driver works, and is
a great start but needs to be changed slightly to allow easier access to
the functions from outside the driver.
4) Fix a number of bugs that existed in the shared PCI code for ofw that
probably weren't tickled by macppc.

There is much much more left to do here, this is all still a work in
progress, but this commit will allow other people to play around with the
code if they want to.
 1.2.4.7 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.2.4.6 14-Nov-2007  joerg Sync with HEAD.
 1.2.4.5 11-Nov-2007  joerg Sync with HEAD.
 1.2.4.4 06-Nov-2007  joerg Sync with HEAD.
 1.2.4.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.2.4.2 28-Oct-2007  joerg Sync with HEAD.
 1.2.4.1 26-Oct-2007  joerg file pegasospci.c was added on branch jmcneill-pm on 2007-10-28 20:10:45 +0000
 1.2.2.6 04-Feb-2008  yamt sync with head.
 1.2.2.5 21-Jan-2008  yamt sync with head
 1.2.2.4 07-Dec-2007  yamt sync with head
 1.2.2.3 15-Nov-2007  yamt sync with head.
 1.2.2.2 27-Oct-2007  yamt sync with head.
 1.2.2.1 26-Oct-2007  yamt file pegasospci.c was added on branch yamt-lazymbuf on 2007-10-27 11:27:31 +0000
 1.4.4.5 23-Mar-2008  matt sync with HEAD
 1.4.4.4 09-Jan-2008  matt sync with HEAD
 1.4.4.3 08-Nov-2007  matt sync with -HEAD
 1.4.4.2 06-Nov-2007  matt sync with HEAD
 1.4.4.1 05-Nov-2007  matt file pegasospci.c was added on branch matt-armv6 on 2007-11-06 23:20:05 +0000
 1.4.2.4 18-Feb-2008  mjf Sync with HEAD.
 1.4.2.3 27-Dec-2007  mjf Sync with HEAD.
 1.4.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.4.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.5.2.3 18-Nov-2007  bouyer Sync with HEAD
 1.5.2.2 13-Nov-2007  bouyer Sync with HEAD
 1.5.2.1 07-Nov-2007  bouyer file pegasospci.c was added on branch bouyer-xenamd64 on 2007-11-13 15:59:01 +0000
 1.7.8.4 19-Jan-2008  bouyer Sync with HEAD
 1.7.8.3 11-Jan-2008  bouyer Sync with HEAD
 1.7.8.2 10-Jan-2008  bouyer Sync with HEAD
 1.7.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.7.4.1 26-Dec-2007  ad Sync with head.
 1.7.2.2 03-Dec-2007  ad Sync with HEAD.
 1.7.2.1 26-Nov-2007  ad file pegasospci.c was added on branch vmlocking on 2007-12-03 19:03:52 +0000
 1.13.10.2 11-Aug-2010  yamt sync with head.
 1.13.10.1 16-May-2008  yamt sync with head.
 1.13.8.1 18-May-2008  yamt sync with head.
 1.13.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.22.1 03-Jul-2010  rmind sync with head
 1.14.20.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.14.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.14.14.1 24-Oct-2010  jym Sync with HEAD
 1.3 23-Jan-2008  garbled Add a new mkbootinfo.sh script that builds a bootinfo.txt file. Remove a
printf in ofwboot.
 1.2 16-Apr-1997  thorpej branches: 1.2.64; 1.2.126; 1.2.132;
New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.1 30-Sep-1996  ws PowerPC port
 1.2.132.1 18-Feb-2008  mjf Sync with HEAD.
 1.2.126.1 23-Mar-2008  matt sync with HEAD
 1.2.64.1 04-Feb-2008  yamt sync with head.
 1.5 14-Apr-2021  mrg more -fcommon.
 1.4 10-Aug-2014  joerg branches: 1.4.42;
Put GCC/GAS specific options under ACTIVE_CC == "gcc".
 1.3 22-May-1998  drochner branches: 1.3.198;
STANDALONE->_STANDALONE (cpp definition)
closes PR kern/5481 (Erik Bertelsen <erik@q610.ebe.uni-c.dk>)
 1.2 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.1 30-Sep-1996  ws PowerPC port
 1.3.198.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.42.1 17-Apr-2021  thorpej Sync with HEAD.
 1.3 07-Aug-2000  jdolecek convert to use conf/newvers_stand.sh, minor Makefile adjustments
 1.2 28-May-1998  sakamoto branches: 1.2.14;
Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.1 17-Apr-1997  thorpej oops, forgot to commit this yesterday - newvers.sh script for boot
program.
 1.2.14.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.1 23-Jan-2008  garbled branches: 1.1.2; 1.1.4; 1.1.12;
Add a new mkbootinfo.sh script that builds a bootinfo.txt file. Remove a
printf in ofwboot.
 1.1.12.2 23-Mar-2008  matt sync with HEAD
 1.1.12.1 23-Jan-2008  matt file Makefile was added on branch matt-armv6 on 2008-03-23 02:04:15 +0000
 1.1.4.2 18-Feb-2008  mjf Sync with HEAD.
 1.1.4.1 23-Jan-2008  mjf file Makefile was added on branch mjf-devfs on 2008-02-18 21:04:54 +0000
 1.1.2.2 04-Feb-2008  yamt sync with head.
 1.1.2.1 23-Jan-2008  yamt file Makefile was added on branch yamt-lazymbuf on 2008-02-04 09:22:19 +0000
 1.2 24-Jan-2008  garbled branches: 1.2.2; 1.2.4; 1.2.12;
Add another optional argument to mkbootinfo.sh, the location of the bitmap.
 1.1 23-Jan-2008  garbled Add a new mkbootinfo.sh script that builds a bootinfo.txt file. Remove a
printf in ofwboot.
 1.2.12.2 23-Mar-2008  matt sync with HEAD
 1.2.12.1 24-Jan-2008  matt file mkbootinfo.sh was added on branch matt-armv6 on 2008-03-23 02:04:15 +0000
 1.2.4.2 18-Feb-2008  mjf Sync with HEAD.
 1.2.4.1 24-Jan-2008  mjf file mkbootinfo.sh was added on branch mjf-devfs on 2008-02-18 21:04:54 +0000
 1.2.2.2 04-Feb-2008  yamt sync with head.
 1.2.2.1 24-Jan-2008  yamt file mkbootinfo.sh was added on branch yamt-lazymbuf on 2008-02-04 09:22:19 +0000
 1.1 23-Jan-2008  garbled branches: 1.1.2; 1.1.4; 1.1.12;
Add a new mkbootinfo.sh script that builds a bootinfo.txt file. Remove a
printf in ofwboot.
 1.1.12.2 23-Mar-2008  matt sync with HEAD
 1.1.12.1 23-Jan-2008  matt file netbsd.chrp was added on branch matt-armv6 on 2008-03-23 02:04:15 +0000
 1.1.4.2 18-Feb-2008  mjf Sync with HEAD.
 1.1.4.1 23-Jan-2008  mjf file netbsd.chrp was added on branch mjf-devfs on 2008-02-18 21:04:54 +0000
 1.1.2.2 04-Feb-2008  yamt sync with head.
 1.1.2.1 23-Jan-2008  yamt file netbsd.chrp was added on branch yamt-lazymbuf on 2008-02-04 09:22:20 +0000
 1.23 20-Sep-2014  phx A stack size of 8K is too small for a block buffer of 65536 bytes.
Increased the stack size to 128K. This makes ofwboot work with FirmWorks
OpenFirmware systems again (tested with Motorola PowerStack II).
 1.22 12-Jan-2009  tsutsui branches: 1.22.24; 1.22.40;
WARNSfy
 1.21 12-Feb-2008  garbled branches: 1.21.6; 1.21.10; 1.21.18;
Add a very quick and simple hack to allow ofwboot to be compiled into a
program that dumps the entire ofw device tree automatically. I needed
this functionality to collect ofw dumps from users, and it doesn't hurt
to just commit it, as it's all protected inside a #ifdef OFWDUMP.
 1.20 24-Jan-2008  garbled Add padding to align the rodata section. This fixes a strange bug
where the bootloader would freak out if various printfs were enabled or
disabled.

Add code to autodetect a 64bit cpu, and attempt to load a different set
of kernels if they exist.

Bump version to 1.9
 1.19 23-Jan-2008  garbled Add a new mkbootinfo.sh script that builds a bootinfo.txt file. Remove a
printf in ofwboot.
 1.18 09-Jan-2008  garbled Changes to the ofppc ofwboot to make it boot on an IBM CHRP RS/6000.
Tested on a pegasos II and a 7044-270. Also, switch away from the hacked
up alloc.c we were using, and use the stock libsa one.
 1.17 24-Nov-2007  jmmv branches: 1.17.6;
Fix a typo in a comment, and while here also drop trailing whitespace.
 1.16 17-Oct-2007  garbled branches: 1.16.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.15 21-May-2007  tsutsui branches: 1.15.8; 1.15.10;
- convert to register prefixes
- zero out BSS before we start calling into C code instead of memset()
(pulled from macppc/stand/ofwboot/Locore.c rev 1.16)
 1.14 27-Jan-2006  uwe branches: 1.14.28; 1.14.30; 1.14.36;
Tell gcc that startup and stack are used.
 1.13 24-Dec-2005  perry branches: 1.13.2;
bare asm -> __asm
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 08-Oct-2003  simonb branches: 1.11.16;
Don't use multi-line strings (keeps gcc331 happy).
 1.10 14-Jul-2003  aymeric . ANSIfy a bit more
. use the boot_entry_t type for the entry point

Makes ofwboot compile with -Wmissing-prototypes -Wstrict-prototypes, as
suggested by Chuck Silvers in a private e-mail.
 1.9 26-Jun-2003  aymeric branches: 1.9.2;
. ANSIfy
. Fix a missing return
. replace %x by %p to print pointers in OFW_DEBUG printf's
 1.8 25-Oct-2002  briggs Double the amount of stack space for ofwboot.
 1.7 18-Sep-2002  chs add OF_boot(), call it if the user says "reboot".
try loading "netbsd.ofppc" first, to allow sharing root fs.
 1.6 23-Oct-2001  thorpej branches: 1.6.4;
Clean up the NetBSD/ofppc boot loader:
- Garbage collect some cruft that doesn't apply to the ofppc port.
- Make our OFW-friendly alloc.c more like the libsa alloc.c
- Generally reduce some differences where we can between this
boot loader and the NetBSD/macppc boot loader.
- Use libsa's loadfile().
- Fix DDB symbol loading -- Add a magic number after the args string
so the kernel knows the symbols are there, provide both ssym and
esym, and make sure all these values are aligned to a 4-byte boundary.
- Add support for MS-DOS file systems.
 1.5 17-Jan-2001  ws branches: 1.5.4;
Increase stack size to make this work again.
 1.4 22-Feb-1998  mycroft branches: 1.4.14;
Clean up #include paths.
Copy prom2boot() from kernel source.
rename _rtt() to OF_exit(), and add a _rtt() that calls it.
 1.3 28-Apr-1997  mycroft A handle of 0 means the open failed...
 1.2 28-Apr-1997  mycroft DTRT if OF_read() returns 0 when no data is available.
 1.1 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.4.14.1 11-Feb-2001  bouyer Sync with HEAD.
 1.5.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.4.3 11-Nov-2002  nathanw Catch up to -current
 1.6.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.6.4.1 23-Oct-2001  nathanw file Locore.c was added on branch nathanw_sa on 2002-10-18 02:39:20 +0000
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.6 27-Feb-2008  yamt sync with head.
 1.11.16.5 04-Feb-2008  yamt sync with head.
 1.11.16.4 21-Jan-2008  yamt sync with head
 1.11.16.3 07-Dec-2007  yamt sync with head
 1.11.16.2 03-Sep-2007  yamt sync with head.
 1.11.16.1 21-Jun-2006  yamt sync with head.
 1.13.2.1 01-Feb-2006  yamt sync with head.
 1.14.36.1 22-May-2007  matt Update to HEAD.
 1.14.30.1 11-Jul-2007  mjf Sync with head.
 1.14.28.2 03-Dec-2007  ad Sync with HEAD.
 1.14.28.1 27-May-2007  ad Sync with head.
 1.15.10.3 23-Mar-2008  matt sync with HEAD
 1.15.10.2 09-Jan-2008  matt sync with HEAD
 1.15.10.1 06-Nov-2007  matt sync with HEAD
 1.15.8.1 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.16.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.16.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.17.6.1 10-Jan-2008  bouyer Sync with HEAD
 1.21.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.21.10.1 04-May-2009  yamt sync with head.
 1.21.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.22.40.1 22-Sep-2014  martin Pull up following revision(s) (requested by phx in ticket #114):
sys/arch/ofppc/stand/ofwboot/ofwstart.S: revision 1.4
sys/arch/ofppc/stand/ofwboot/Locore.c: revision 1.23
sys/arch/ofppc/stand/ofwboot/version: revision 1.13
A stack size of 8K is too small for a block buffer of 65536 bytes.
Increased the stack size to 128K. This makes ofwboot work with FirmWorks
OpenFirmware systems again (tested with Motorola PowerStack II).
 1.22.24.1 03-Dec-2017  jdolecek update from HEAD
 1.32 08-Apr-2017  christos centralize vers.c building for standalone programs.
 1.31 10-Aug-2014  joerg branches: 1.31.4; 1.31.8; 1.31.12;
Put GCC/GAS specific options under ACTIVE_CC == "gcc".
 1.30 08-Aug-2014  joerg Don't set -mmultiple or -mno-string for PowerPC, the difference is too
small to really matter and it sometimes even increases the size.
 1.29 12-Jan-2014  tsutsui branches: 1.29.2;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.28 21-Aug-2013  matt Use <bsd.klinks.mk>
Add ${_MKTARGET_LINK}
 1.27 24-Jan-2011  joerg branches: 1.27.4; 1.27.14; 1.27.18;
Ensure that NOMAN is defined earlier.
 1.26 22-Jan-2011  joerg Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
 1.25 11-Sep-2009  phx branches: 1.25.4; 1.25.6; 1.25.8;
Added support for RDB partitions.
Moved MBR parition code out of ofdev.c into mbr.c.
Tested on Pegasos2 (RDB and MBR) and RS6000.
 1.24 12-Jan-2009  tsutsui WARNSfy
 1.23 13-Feb-2008  garbled branches: 1.23.6; 1.23.10; 1.23.18;
Add support to ofwboot for booting on the 7046-B50. Also likely to work
on the 7043-150. The B50 wants not only a note at the head of the
binary, like the 7044 did, but it also wants a PHDR that points at it.
Because the IBM firmware doesn't like the real note section that ld
generates (it puts it at the end of the file), we instead point PT_NOTE
at the text section. This works, because at the top of the text section,
there is a note hacked in, which was required for the 7044.

Also, change the mode from virtual mode to real mode in the note, because
the B50 hangs if you load it in virtual. Tested to work on a B50, 7044,
and Pegasos2.

Yay IBM.
 1.22 12-Feb-2008  garbled Add a very quick and simple hack to allow ofwboot to be compiled into a
program that dumps the entire ofw device tree automatically. I needed
this functionality to collect ofw dumps from users, and it doesn't hurt
to just commit it, as it's all protected inside a #ifdef OFWDUMP.
 1.21 09-Jan-2008  garbled Changes to the ofppc ofwboot to make it boot on an IBM CHRP RS/6000.
Tested on a pegasos II and a 7044-270. Also, switch away from the hacked
up alloc.c we were using, and use the stock libsa one.
 1.20 17-Oct-2007  garbled branches: 1.20.2; 1.20.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.19 21-May-2007  tsutsui branches: 1.19.10;
Add src/common/include to -I include path so that ofwboot build
without installed headers in DESTDIR.
 1.18 11-Dec-2005  christos branches: 1.18.30; 1.18.32; 1.18.38;
merge ktrace-lwp.
 1.17 26-Oct-2003  lukem branches: 1.17.16;
Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.16 24-Oct-2003  matt Make this work with R/O source trees.
 1.15 08-Oct-2003  simonb Use -ffreestanding.
Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
 1.14 21-Sep-2002  chs branches: 1.14.6;
tidy a bit.
 1.13 18-Sep-2002  chs build ofwboot as an ELF binary.
 1.12 18-Jun-2002  itojun avoid hardcoding MBR_MAGICOFF and MBR_MAGIC.
 1.11 12-Dec-2001  tv branches: 1.11.8;
MKfoo=no -> NOfoo
 1.10 23-Oct-2001  thorpej branches: 1.10.4;
Clean up the NetBSD/ofppc boot loader:
- Garbage collect some cruft that doesn't apply to the ofppc port.
- Make our OFW-friendly alloc.c more like the libsa alloc.c
- Generally reduce some differences where we can between this
boot loader and the NetBSD/macppc boot loader.
- Use libsa's loadfile().
- Fix DDB symbol loading -- Add a magic number after the args string
so the kernel knows the symbols are there, provide both ssym and
esym, and make sure all these values are aligned to a 4-byte boundary.
- Add support for MS-DOS file systems.
 1.9 07-Aug-2000  jdolecek branches: 1.9.4;
convert to use conf/newvers_stand.sh, minor Makefile adjustments
 1.8 23-Jan-2000  mycroft Clean up the machine symlink stuff ever so slightly. Needs to be
standardized between files.
 1.7 12-Oct-1999  wrstuden branches: 1.7.2;
Make symlink for powerpc@.
 1.6 13-Feb-1999  lukem branches: 1.6.8;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.5 09-Jun-1998  sakamoto Use PowerPC-generic stuff and eliminate the powermac portion.
 1.4 28-May-1998  sakamoto Rename NetBSD/powerpc to NetBSD/ofppc.
New sys/arch/powerpc with PowerPC-generic stuff.
 1.3 02-Mar-1998  drochner enable compatibility for old partition ID per default
 1.2 17-Apr-1997  thorpej STRIP -> STRIPFLAG
 1.1 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.6.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.10.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.10.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.10.4.1 23-Oct-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:27:01 +0000
 1.11.8.1 16-Jul-2002  gehenna catch up with -current.
 1.14.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.6.1 03-Aug-2004  skrll Sync with HEAD
 1.17.16.3 27-Feb-2008  yamt sync with head.
 1.17.16.2 21-Jan-2008  yamt sync with head
 1.17.16.1 03-Sep-2007  yamt sync with head.
 1.18.38.1 22-May-2007  matt Update to HEAD.
 1.18.32.1 11-Jul-2007  mjf Sync with head.
 1.18.30.1 27-May-2007  ad Sync with head.
 1.19.10.2 23-Mar-2008  matt sync with HEAD
 1.19.10.1 06-Nov-2007  matt sync with HEAD
 1.20.8.1 10-Jan-2008  bouyer Sync with HEAD
 1.20.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.23.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.23.10.2 16-Sep-2009  yamt sync with head
 1.23.10.1 04-May-2009  yamt sync with head.
 1.23.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.25.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.25.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.25.4.1 05-Mar-2011  rmind sync with head
 1.27.18.2 18-May-2014  rmind sync with head
 1.27.18.1 28-Aug-2013  rmind sync with head
 1.27.14.2 03-Dec-2017  jdolecek update from HEAD
 1.27.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.27.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.29.2.1 10-Aug-2014  tls Rebase.
 1.31.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.31.8.1 26-Apr-2017  pgoyette Sync with HEAD
 1.31.4.1 28-Aug-2017  skrll Sync with HEAD
 1.8 09-Jan-2008  garbled Changes to the ofppc ofwboot to make it boot on an IBM CHRP RS/6000.
Tested on a pegasos II and a 7044-270. Also, switch away from the hacked
up alloc.c we were using, and use the stock libsa one.
 1.7 27-Jan-2006  uwe branches: 1.7.48; 1.7.54; 1.7.62;
Sync with macppc version. Cosmetic changes mostly.
 1.6 25-Jan-2006  christos free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.5 26-Jun-2003  aymeric branches: 1.5.18; 1.5.30;
ANSIfy
 1.4 23-Oct-2001  thorpej branches: 1.4.4;
Clean up the NetBSD/ofppc boot loader:
- Garbage collect some cruft that doesn't apply to the ofppc port.
- Make our OFW-friendly alloc.c more like the libsa alloc.c
- Generally reduce some differences where we can between this
boot loader and the NetBSD/macppc boot loader.
- Use libsa's loadfile().
- Fix DDB symbol loading -- Add a magic number after the args string
so the kernel knows the symbols are there, provide both ssym and
esym, and make sure all these values are aligned to a 4-byte boundary.
- Add support for MS-DOS file systems.
 1.3 22-Feb-1998  mycroft branches: 1.3.28;
Clean up #include paths.
Copy prom2boot() from kernel source.
rename _rtt() to OF_exit(), and add a _rtt() that calls it.
 1.2 05-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 16-Apr-1997  thorpej branches: 1.1.4;
New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.3.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.4.2 23-Oct-2001  thorpej Clean up the NetBSD/ofppc boot loader:
- Garbage collect some cruft that doesn't apply to the ofppc port.
- Make our OFW-friendly alloc.c more like the libsa alloc.c
- Generally reduce some differences where we can between this
boot loader and the NetBSD/macppc boot loader.
- Use libsa's loadfile().
- Fix DDB symbol loading -- Add a magic number after the args string
so the kernel knows the symbols are there, provide both ssym and
esym, and make sure all these values are aligned to a 4-byte boundary.
- Add support for MS-DOS file systems.
 1.4.4.1 23-Oct-2001  thorpej file alloc.c was added on branch nathanw_sa on 2001-10-23 03:31:27 +0000
 1.5.30.1 01-Feb-2006  yamt sync with head.
 1.5.18.2 21-Jan-2008  yamt sync with head
 1.5.18.1 21-Jun-2006  yamt sync with head.
 1.7.62.1 10-Jan-2008  bouyer Sync with HEAD
 1.7.54.1 18-Feb-2008  mjf Sync with HEAD.
 1.7.48.1 23-Mar-2008  matt sync with HEAD
 1.2 09-Jan-2008  garbled Remove alloc.h too, no longer needed.
 1.1 26-Jun-2003  aymeric branches: 1.1.18; 1.1.80; 1.1.86; 1.1.94;
declare functions from corresponding C file
 1.1.94.1 10-Jan-2008  bouyer Sync with HEAD
 1.1.86.1 18-Feb-2008  mjf Sync with HEAD.
 1.1.80.1 23-Mar-2008  matt sync with HEAD
 1.1.18.1 21-Jan-2008  yamt sync with head
 1.25 15-Sep-2020  mrg partial port to powerpc64.
 1.24 11-Jun-2016  dholland PR 51200 gets in libsa considered harmful: use kgets
 1.23 22-Jan-2011  joerg branches: 1.23.14; 1.23.32;
Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
 1.22 12-Jan-2009  tsutsui branches: 1.22.6; 1.22.8; 1.22.10;
WARNSfy
 1.21 28-Apr-2008  martin branches: 1.21.8;
Remove clause 3 and 4 from TNF licenses
 1.20 12-Feb-2008  garbled branches: 1.20.6; 1.20.8; 1.20.10;
Add a very quick and simple hack to allow ofwboot to be compiled into a
program that dumps the entire ofw device tree automatically. I needed
this functionality to collect ofw dumps from users, and it doesn't hurt
to just commit it, as it's all protected inside a #ifdef OFWDUMP.
 1.19 24-Jan-2008  garbled Add padding to align the rodata section. This fixes a strange bug
where the bootloader would freak out if various printfs were enabled or
disabled.

Add code to autodetect a 64bit cpu, and attempt to load a different set
of kernels if they exist.

Bump version to 1.9
 1.18 09-Jan-2008  garbled Remove alloc.h too, no longer needed.
 1.17 09-Jan-2008  garbled Changes to the ofppc ofwboot to make it boot on an IBM CHRP RS/6000.
Tested on a pegasos II and a 7044-270. Also, switch away from the hacked
up alloc.c we were using, and use the stock libsa one.
 1.16 18-Oct-2007  garbled branches: 1.16.2; 1.16.8;
Update the bootloader to work with the ofwoea_initppc code used by macppc
 1.15 11-Dec-2005  christos branches: 1.15.30; 1.15.48; 1.15.50; 1.15.54;
merge ktrace-lwp.
 1.14 14-Jul-2003  aymeric branches: 1.14.16;
. ANSIfy a bit more
. use the boot_entry_t type for the entry point

Makes ofwboot compile with -Wmissing-prototypes -Wstrict-prototypes, as
suggested by Chuck Silvers in a private e-mail.
 1.13 26-Jun-2003  aymeric branches: 1.13.2;
. ANSIfy
. include alloc.h
. while there, fix a bug in prom2boot() introduced in rev. 1.11
 1.12 18-Sep-2002  chs add OF_boot(), call it if the user says "reboot".
try loading "netbsd.ofppc" first, to allow sharing root fs.
 1.11 23-Oct-2001  thorpej branches: 1.11.4;
Clean up the NetBSD/ofppc boot loader:
- Garbage collect some cruft that doesn't apply to the ofppc port.
- Make our OFW-friendly alloc.c more like the libsa alloc.c
- Generally reduce some differences where we can between this
boot loader and the NetBSD/macppc boot loader.
- Use libsa's loadfile().
- Fix DDB symbol loading -- Add a magic number after the args string
so the kernel knows the symbols are there, provide both ssym and
esym, and make sure all these values are aligned to a 4-byte boundary.
- Add support for MS-DOS file systems.
 1.10 22-Jul-2001  wiz bcopy -> memcpy, bzero -> memset
 1.9 03-May-2001  soren branches: 1.9.2;
PPC machine type tags haven't been used for a while.
 1.8 17-Jan-2001  ws branches: 1.8.2;
Don't claim the memory for the executable from the firmware.
Some implementations seemed to do strange mappings as a result of it.
 1.7 24-Sep-2000  jdolecek add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

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

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

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.6 25-Oct-1999  kleink Update to match new SVR4-style definition names in <sys/exec_elf.h>.
 1.5 17-Apr-1999  ws branches: 1.5.2; 1.5.4; 1.5.6;
Modify syncicache on PowerPC from an inline to a real function.
Support different cache line sizes with the same object code in userland.
While here, move the function to implementation name space.
 1.4 22-Feb-1998  mycroft branches: 1.4.10;
Clean up #include paths.
Copy prom2boot() from kernel source.
rename _rtt() to OF_exit(), and add a _rtt() that calls it.
 1.3 27-Jan-1998  sakamoto Fix PR/4679:missing cast, from SUNAGAWA Keiki.
 1.2 05-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 16-Apr-1997  thorpej branches: 1.1.4;
New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.1.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.4.1 15-Nov-1999  fvdl Sync with -current
 1.5.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.8.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.9.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 03-Aug-2001  lukem update to -current
 1.11.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.11.4.1 23-Oct-2001  nathanw file boot.c was added on branch nathanw_sa on 2002-10-18 02:39:20 +0000
 1.13.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.14.16.4 27-Feb-2008  yamt sync with head.
 1.14.16.3 04-Feb-2008  yamt sync with head.
 1.14.16.2 21-Jan-2008  yamt sync with head
 1.14.16.1 27-Oct-2007  yamt sync with head.
 1.15.54.1 25-Oct-2007  bouyer Sync with HEAD.
 1.15.50.2 23-Mar-2008  matt sync with HEAD
 1.15.50.1 06-Nov-2007  matt sync with HEAD
 1.15.48.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.15.30.1 23-Oct-2007  ad Sync with head.
 1.16.8.1 10-Jan-2008  bouyer Sync with HEAD
 1.16.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.20.10.2 04-May-2009  yamt sync with head.
 1.20.10.1 16-May-2008  yamt sync with head.
 1.20.8.1 18-May-2008  yamt sync with head.
 1.20.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.20.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.21.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.22.10.1 08-Feb-2011  bouyer Sync with HEAD
 1.22.8.1 06-Jun-2011  jruoho Sync with HEAD.
 1.22.6.1 05-Mar-2011  rmind sync with head
 1.23.32.1 09-Jul-2016  skrll Sync with HEAD
 1.23.14.1 03-Dec-2017  jdolecek update from HEAD
 1.1 14-Jul-2003  aymeric branches: 1.1.4;
. prototype for main()
. typedef boot_entry_t to be the prototype of the kernel entry point
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 14-Jul-2003  skrll file boot.h was added on branch ktrace-lwp on 2004-08-03 10:38:46 +0000
 1.1 13-Feb-2008  garbled branches: 1.1.2; 1.1.10; 1.1.12;
Add support to ofwboot for booting on the 7046-B50. Also likely to work
on the 7043-150. The B50 wants not only a note at the head of the
binary, like the 7044 did, but it also wants a PHDR that points at it.
Because the IBM firmware doesn't like the real note section that ld
generates (it puts it at the end of the file), we instead point PT_NOTE
at the text section. This works, because at the top of the text section,
there is a note hacked in, which was required for the 7044.

Also, change the mode from virtual mode to real mode in the note, because
the B50 hangs if you load it in virtual. Tested to work on a B50, 7044,
and Pegasos2.

Yay IBM.
 1.1.12.2 23-Mar-2008  matt sync with HEAD
 1.1.12.1 13-Feb-2008  matt file ldscript was added on branch matt-armv6 on 2008-03-23 02:04:15 +0000
 1.1.10.2 27-Feb-2008  yamt sync with head.
 1.1.10.1 13-Feb-2008  yamt file ldscript was added on branch yamt-lazymbuf on 2008-02-27 08:36:23 +0000
 1.1.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.1.2.1 13-Feb-2008  mjf file ldscript was added on branch mjf-devfs on 2008-02-18 21:04:54 +0000
 1.6 17-May-2021  mrg include libkern.h for moved dkcksum().
 1.5 30-Mar-2016  christos branches: 1.5.34; 1.5.36;
PR/51015: David Binderman: remove useless code
 1.4 02-Feb-2012  phx branches: 1.4.6; 1.4.24;
Fixed writing of MBR disklabel. It was written by disklabel(8) -r directly
into sector 0, corrupting the MBR. Moved to sector 1.
Removed MBR_LABELSECTOR, which is no longer needed.
 1.3 21-Aug-2011  phx branches: 1.3.2; 1.3.6;
When there is no NetBSD MBR partition with a valid disklabel, look for
the first FAT partition and construct a disklabel with an MSDOS filesystem
in partition 'a'.
 1.2 18-Aug-2011  phx Finding the disklabel on MBR partitioned disks did no longer work since RDB
support was added. Fixed that and bumped the version to 1.12.
 1.1 11-Sep-2009  phx branches: 1.1.2;
Added support for RDB partitions.
Moved MBR parition code out of ofdev.c into mbr.c.
Tested on Pegasos2 (RDB and MBR) and RS6000.
 1.1.2.2 16-Sep-2009  yamt sync with head
 1.1.2.1 11-Sep-2009  yamt file mbr.c was added on branch yamt-nfs-mp on 2009-09-16 13:37:41 +0000
 1.3.6.1 18-Feb-2012  mrg merge to -current.
 1.3.2.1 17-Apr-2012  yamt sync with head
 1.4.24.1 22-Apr-2016  skrll Sync with HEAD
 1.4.6.1 03-Dec-2017  jdolecek update from HEAD
 1.5.36.1 31-May-2021  cjep sync with head
 1.5.34.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.1 11-Sep-2009  phx branches: 1.1.2;
Added support for RDB partitions.
Moved MBR parition code out of ofdev.c into mbr.c.
Tested on Pegasos2 (RDB and MBR) and RS6000.
 1.1.2.2 16-Sep-2009  yamt sync with head
 1.1.2.1 11-Sep-2009  yamt file mbr.h was added on branch yamt-nfs-mp on 2009-09-16 13:37:41 +0000
 1.7 12-Apr-2021  mrg remove shadowed (common) declarations of various libsa variables
from various boot programs. for macppc and zaurus, avoid building
with -fcommon any more.
 1.6 26-Jun-2003  aymeric branches: 1.6.208;
. ANSIfy
. include the needed headers
. net_mountroot() becomes static
 1.5 13-Mar-2003  drochner Remove remaining uses of libsa/netif -- the "netif" structure was only
used to lookup a "struct of_dev", everything else was ballast.
Do it straightforward now and assign the ofdev directly to io_netif.
 1.4 07-May-1999  drochner include <lib/libkern/libkern.h> for intoa()/inet_ntoa()
 1.3 22-Feb-1998  mycroft branches: 1.3.10;
Clean up #include paths.
Copy prom2boot() from kernel source.
rename _rtt() to OF_exit(), and add a _rtt() that calls it.
 1.2 22-Jul-1997  drochner Don't use <lib/libsa/if_ether.h> anymore. This was a copy of the
old (before ARP changes) <netinet/if_ether.h>, intended for
temporary use.
 1.1 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.3.10.1 21-Jun-1999  thorpej Sync w/ -current.
 1.6.208.1 17-Apr-2021  thorpej Sync with HEAD.
 1.1 26-Jun-2003  aymeric declare functions from corresponding C file
 1.9 17-Jan-2009  he Follow up the time_t -> saseconds_t or satime_t type changes by
changing the signatures of netif_get() and getsecs() appropriately.
 1.8 12-Jan-2009  tsutsui WARNSfy
 1.7 26-Jun-2003  aymeric branches: 1.7.104; 1.7.108; 1.7.116;
ANSIfy
 1.6 13-Mar-2003  drochner Remove remaining uses of libsa/netif -- the "netif" structure was only
used to lookup a "struct of_dev", everything else was ballast.
Do it straightforward now and assign the ofdev directly to io_netif.
 1.5 22-Jul-2001  wiz branches: 1.5.6;
bcopy -> memcpy, bzero -> memset
 1.4 22-Feb-1998  mycroft branches: 1.4.28;
Clean up #include paths.
Copy prom2boot() from kernel source.
rename _rtt() to OF_exit(), and add a _rtt() that calls it.
 1.3 22-Jul-1997  drochner Don't use <lib/libsa/if_ether.h> anymore. This was a copy of the
old (before ARP changes) <netinet/if_ether.h>, intended for
temporary use.
 1.2 28-Apr-1997  mycroft DTRT if OF_read() returns 0 when no data is available.
 1.1 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.4.28.1 03-Aug-2001  lukem update to -current
 1.5.6.2 22-Jul-2001  wiz bcopy -> memcpy, bzero -> memset
 1.5.6.1 22-Jul-2001  wiz file netif_of.c was added on branch nathanw_sa on 2001-07-22 14:43:16 +0000
 1.7.116.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.108.1 04-May-2009  yamt sync with head.
 1.7.104.1 17-Jan-2009  mjf Sync with HEAD.
 1.1 13-Mar-2003  drochner Remove remaining uses of libsa/netif -- the "netif" structure was only
used to lookup a "struct of_dev", everything else was ballast.
Do it straightforward now and assign the ofdev directly to io_netif.
 1.19 21-Aug-2011  phx Fixed booting from disks without a valid disklabel (e.g. CDROM). This
became broken with my last changes in rev.1.18..
 1.18 18-Aug-2011  phx Finding the disklabel on MBR partitioned disks did no longer work since RDB
support was added. Fixed that and bumped the version to 1.12.
 1.17 11-Sep-2009  phx Added support for RDB partitions.
Moved MBR parition code out of ofdev.c into mbr.c.
Tested on Pegasos2 (RDB and MBR) and RS6000.
 1.16 12-Jan-2009  tsutsui WARNSfy
 1.15 03-Jan-2008  mrg branches: 1.15.6; 1.15.10; 1.15.18;
support FS_RAID partitions, and increase the offset by
RF_PROTECTED_SECTORS (64) if so.
 1.14 28-Jun-2006  he branches: 1.14.34; 1.14.40; 1.14.48;
Make devsw non-static to match libsa/stand.h.
 1.13 11-Dec-2005  christos branches: 1.13.4; 1.13.8; 1.13.16;
merge ktrace-lwp.
 1.12 23-Jun-2005  junyoung branches: 1.12.2;
Use FS_OPS() macro.
 1.11 08-Oct-2003  lukem Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
 1.10 08-Oct-2003  simonb Use <lib/libkern/libkern.h> for str*() prototypes instead of the userland
header <string.h>.
 1.9 26-Jun-2003  aymeric branches: 1.9.2;
. ANSIfy
. include needed headers
. fix a couple of warnings
 1.8 18-Sep-2002  chs fix parsing of pathnames with a partition specifier.
reformat for readability.
 1.7 18-Jun-2002  itojun avoid hardcoding MBR_MAGICOFF and MBR_MAGIC.
 1.6 23-Oct-2001  thorpej branches: 1.6.4; 1.6.12;
Clean up the NetBSD/ofppc boot loader:
- Garbage collect some cruft that doesn't apply to the ofppc port.
- Make our OFW-friendly alloc.c more like the libsa alloc.c
- Generally reduce some differences where we can between this
boot loader and the NetBSD/macppc boot loader.
- Use libsa's loadfile().
- Fix DDB symbol loading -- Add a magic number after the args string
so the kernel knows the symbols are there, provide both ssym and
esym, and make sure all these values are aligned to a 4-byte boundary.
- Add support for MS-DOS file systems.
 1.5 22-Jul-2001  wiz bcopy -> memcpy, bzero -> memset
 1.4 12-Oct-1999  wrstuden branches: 1.4.14;
Catch up with sys/disklabel_mbr.h.
 1.3 02-Mar-1998  drochner branches: 1.3.14;
Change MBR partition type for NetBSD to 0xa9, like the i386 port.
Provide compatibility via COMPAT_386BSD_MBRPART.
 1.2 22-Feb-1998  mycroft Clean up #include paths.
Copy prom2boot() from kernel source.
rename _rtt() to OF_exit(), and add a _rtt() that calls it.
 1.1 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.14.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.4.14.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.14.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.14.1 03-Aug-2001  lukem update to -current
 1.6.12.1 16-Jul-2002  gehenna catch up with -current.
 1.6.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.6.4.2 20-Jun-2002  nathanw Catch up to -current.
 1.6.4.1 23-Oct-2001  nathanw file ofdev.c was added on branch nathanw_sa on 2002-06-20 03:40:26 +0000
 1.9.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.2.2 21-Jan-2008  yamt sync with head
 1.12.2.1 30-Dec-2006  yamt sync with head.
 1.13.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.13.8.1 11-Aug-2006  yamt sync with head
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.14.48.1 08-Jan-2008  bouyer Sync with HEAD
 1.14.40.1 18-Feb-2008  mjf Sync with HEAD.
 1.14.34.1 09-Jan-2008  matt sync with HEAD
 1.15.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.15.10.2 16-Sep-2009  yamt sync with head
 1.15.10.1 04-May-2009  yamt sync with head.
 1.15.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.3 11-Sep-2009  phx Added support for RDB partitions.
Moved MBR parition code out of ofdev.c into mbr.c.
Tested on Pegasos2 (RDB and MBR) and RS6000.
 1.2 26-Jun-2003  aymeric branches: 1.2.108;
include <sys/types.h> so that this file can be included first/alone
 1.1 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.2.108.1 16-Sep-2009  yamt sync with head
 1.4 20-Sep-2014  phx A stack size of 8K is too small for a block buffer of 65536 bytes.
Increased the stack size to 128K. This makes ofwboot work with FirmWorks
OpenFirmware systems again (tested with Motorola PowerStack II).
 1.3 28-Apr-2008  martin branches: 1.3.44; 1.3.62;
Remove clause 3 and 4 from TNF licenses
 1.2 13-Feb-2008  garbled branches: 1.2.2; 1.2.8; 1.2.10; 1.2.12; 1.2.14;
Add support to ofwboot for booting on the 7046-B50. Also likely to work
on the 7043-150. The B50 wants not only a note at the head of the
binary, like the 7044 did, but it also wants a PHDR that points at it.
Because the IBM firmware doesn't like the real note section that ld
generates (it puts it at the end of the file), we instead point PT_NOTE
at the text section. This works, because at the top of the text section,
there is a note hacked in, which was required for the 7044.

Also, change the mode from virtual mode to real mode in the note, because
the B50 hangs if you load it in virtual. Tested to work on a B50, 7044,
and Pegasos2.

Yay IBM.
 1.1 09-Jan-2008  garbled branches: 1.1.2; 1.1.4;
Changes to the ofppc ofwboot to make it boot on an IBM CHRP RS/6000.
Tested on a pegasos II and a 7044-270. Also, switch away from the hacked
up alloc.c we were using, and use the stock libsa one.
 1.1.4.3 27-Feb-2008  yamt sync with head.
 1.1.4.2 21-Jan-2008  yamt sync with head
 1.1.4.1 09-Jan-2008  yamt file ofwstart.S was added on branch yamt-lazymbuf on 2008-01-21 09:37:56 +0000
 1.1.2.2 10-Jan-2008  bouyer Sync with HEAD
 1.1.2.1 09-Jan-2008  bouyer file ofwstart.S was added on branch bouyer-xeni386 on 2008-01-10 23:43:32 +0000
 1.2.14.1 16-May-2008  yamt sync with head.
 1.2.12.1 18-May-2008  yamt sync with head.
 1.2.10.2 23-Mar-2008  matt sync with HEAD
 1.2.10.1 13-Feb-2008  matt file ofwstart.S was added on branch matt-armv6 on 2008-03-23 02:04:15 +0000
 1.2.8.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.2.2 18-Feb-2008  mjf Sync with HEAD.
 1.2.2.1 13-Feb-2008  mjf file ofwstart.S was added on branch mjf-devfs on 2008-02-18 21:04:54 +0000
 1.3.62.1 22-Sep-2014  martin Pull up following revision(s) (requested by phx in ticket #114):
sys/arch/ofppc/stand/ofwboot/ofwstart.S: revision 1.4
sys/arch/ofppc/stand/ofwboot/Locore.c: revision 1.23
sys/arch/ofppc/stand/ofwboot/version: revision 1.13
A stack size of 8K is too small for a block buffer of 65536 bytes.
Increased the stack size to 128K. This makes ofwboot work with FirmWorks
OpenFirmware systems again (tested with Motorola PowerStack II).
 1.3.44.1 03-Dec-2017  jdolecek update from HEAD
 1.6 24-Dec-2007  perry Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
 1.5 11-Dec-2005  christos branches: 1.5.50; 1.5.60; 1.5.64;
merge ktrace-lwp.
 1.4 14-Jul-2003  aymeric branches: 1.4.16;
. ANSIfy a bit more
. use the boot_entry_t type for the entry point

Makes ofwboot compile with -Wmissing-prototypes -Wstrict-prototypes, as
suggested by Chuck Silvers in a private e-mail.
 1.3 18-Sep-2002  chs branches: 1.3.6;
add OF_boot(), call it if the user says "reboot".
try loading "netbsd.ofppc" first, to allow sharing root fs.
 1.2 22-Feb-1998  mycroft branches: 1.2.28; 1.2.32;
Clean up #include paths.
Copy prom2boot() from kernel source.
rename _rtt() to OF_exit(), and add a _rtt() that calls it.
 1.1 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.2.32.1 18-Oct-2002  nathanw Catch up to -current.
 1.2.28.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 21-Jan-2008  yamt sync with head
 1.5.64.1 02-Jan-2008  bouyer Sync with HEAD
 1.5.60.1 26-Dec-2007  ad Sync with head.
 1.5.50.1 09-Jan-2008  matt sync with HEAD
 1.3 17-May-2021  mrg include libkern.h for moved dkcksum().
 1.2 19-Jun-2010  kiyohara branches: 1.2.76; 1.2.78;
Support load from FAT.
 1.1 11-Sep-2009  phx branches: 1.1.2; 1.1.4; 1.1.6;
Added support for RDB partitions.
Moved MBR parition code out of ofdev.c into mbr.c.
Tested on Pegasos2 (RDB and MBR) and RS6000.
 1.1.6.1 03-Jul-2010  rmind sync with head
 1.1.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.1.2.3 11-Aug-2010  yamt sync with head.
 1.1.2.2 16-Sep-2009  yamt sync with head
 1.1.2.1 11-Sep-2009  yamt file rdb.c was added on branch yamt-nfs-mp on 2009-09-16 13:37:41 +0000
 1.2.78.1 31-May-2021  cjep sync with head
 1.2.76.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.1 11-Sep-2009  phx branches: 1.1.2;
Added support for RDB partitions.
Moved MBR parition code out of ofdev.c into mbr.c.
Tested on Pegasos2 (RDB and MBR) and RS6000.
 1.1.2.2 16-Sep-2009  yamt sync with head
 1.1.2.1 11-Sep-2009  yamt file rdb.h was added on branch yamt-nfs-mp on 2009-09-16 13:37:41 +0000
 1.13 20-Sep-2014  phx A stack size of 8K is too small for a block buffer of 65536 bytes.
Increased the stack size to 128K. This makes ofwboot work with FirmWorks
OpenFirmware systems again (tested with Motorola PowerStack II).
 1.12 18-Aug-2011  phx branches: 1.12.12; 1.12.28;
Finding the disklabel on MBR partitioned disks did no longer work since RDB
support was added. Fixed that and bumped the version to 1.12.
 1.11 11-Sep-2009  phx Added support for RDB partitions.
Moved MBR parition code out of ofdev.c into mbr.c.
Tested on Pegasos2 (RDB and MBR) and RS6000.
 1.10 13-Feb-2008  garbled branches: 1.10.10;
Add support to ofwboot for booting on the 7046-B50. Also likely to work
on the 7043-150. The B50 wants not only a note at the head of the
binary, like the 7044 did, but it also wants a PHDR that points at it.
Because the IBM firmware doesn't like the real note section that ld
generates (it puts it at the end of the file), we instead point PT_NOTE
at the text section. This works, because at the top of the text section,
there is a note hacked in, which was required for the 7044.

Also, change the mode from virtual mode to real mode in the note, because
the B50 hangs if you load it in virtual. Tested to work on a B50, 7044,
and Pegasos2.

Yay IBM.
 1.9 24-Jan-2008  garbled Add padding to align the rodata section. This fixes a strange bug
where the bootloader would freak out if various printfs were enabled or
disabled.

Add code to autodetect a 64bit cpu, and attempt to load a different set
of kernels if they exist.

Bump version to 1.9
 1.8 09-Jan-2008  garbled Changes to the ofppc ofwboot to make it boot on an IBM CHRP RS/6000.
Tested on a pegasos II and a 7044-270. Also, switch away from the hacked
up alloc.c we were using, and use the stock libsa one.
 1.7 03-Jan-2008  mrg support FS_RAID partitions, and increase the offset by
RF_PROTECTED_SECTORS (64) if so.
 1.6 18-Oct-2007  garbled branches: 1.6.2; 1.6.8;
Bump version
 1.5 23-Oct-2001  thorpej branches: 1.5.4; 1.5.36; 1.5.78; 1.5.96; 1.5.98; 1.5.102;
Clean up the NetBSD/ofppc boot loader:
- Garbage collect some cruft that doesn't apply to the ofppc port.
- Make our OFW-friendly alloc.c more like the libsa alloc.c
- Generally reduce some differences where we can between this
boot loader and the NetBSD/macppc boot loader.
- Use libsa's loadfile().
- Fix DDB symbol loading -- Add a magic number after the args string
so the kernel knows the symbols are there, provide both ssym and
esym, and make sure all these values are aligned to a 4-byte boundary.
- Add support for MS-DOS file systems.
 1.4 24-Sep-2000  jdolecek branches: 1.4.4;
add new macro BOOT_FLAG() (defined in <sys/boot_flag.h>) - this
maps standard boot flags to corresponding RB_* values
use BOOT_FLAG() in port's MD code as appropriate

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

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

Tested on i386, and to limited extend (compile of affected files) also for
mvme68k, hp300, luna68k, sun3.
 1.3 19-Apr-1997  thorpej branches: 1.3.14;
...and again.
 1.2 19-Apr-1997  thorpej Replay history....
 1.1 16-Apr-1997  thorpej New OpenFirmware boot code for NetBSD/powerpc, based on Wolfgang's original
NetBSD/powerpc boot program. Highligts:
- Rearrange a bit so that we can sanely add boot programs for
non-OpenFirmware systems.
- Add support for loading compressed kernels (for booting from
1.44M floppies).
- Add support for loading Elf kernels (Elf is the new standard format
for NetBSD/powerpc). (XXX Don't load symbols right now - the code
to do it is there, but I don't particularly like how space for the
symbol table is allocated; I will revisit this soon'ish).
 1.3.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.102.1 25-Oct-2007  bouyer Sync with HEAD.
 1.5.98.3 23-Mar-2008  matt sync with HEAD
 1.5.98.2 09-Jan-2008  matt sync with HEAD
 1.5.98.1 06-Nov-2007  matt sync with HEAD
 1.5.96.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.5.78.1 23-Oct-2007  ad Sync with head.
 1.5.36.4 27-Feb-2008  yamt sync with head.
 1.5.36.3 04-Feb-2008  yamt sync with head.
 1.5.36.2 21-Jan-2008  yamt sync with head
 1.5.36.1 27-Oct-2007  yamt sync with head.
 1.5.4.2 23-Oct-2001  thorpej Clean up the NetBSD/ofppc boot loader:
- Garbage collect some cruft that doesn't apply to the ofppc port.
- Make our OFW-friendly alloc.c more like the libsa alloc.c
- Generally reduce some differences where we can between this
boot loader and the NetBSD/macppc boot loader.
- Use libsa's loadfile().
- Fix DDB symbol loading -- Add a magic number after the args string
so the kernel knows the symbols are there, provide both ssym and
esym, and make sure all these values are aligned to a 4-byte boundary.
- Add support for MS-DOS file systems.
 1.5.4.1 23-Oct-2001  thorpej file version was added on branch nathanw_sa on 2001-10-23 03:31:27 +0000
 1.6.8.2 10-Jan-2008  bouyer Sync with HEAD
 1.6.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.6.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.10.10.1 16-Sep-2009  yamt sync with head
 1.12.28.1 22-Sep-2014  martin Pull up following revision(s) (requested by phx in ticket #114):
sys/arch/ofppc/stand/ofwboot/ofwstart.S: revision 1.4
sys/arch/ofppc/stand/ofwboot/Locore.c: revision 1.23
sys/arch/ofppc/stand/ofwboot/version: revision 1.13
A stack size of 8K is too small for a block buffer of 65536 bytes.
Increased the stack size to 128K. This makes ofwboot work with FirmWorks
OpenFirmware systems again (tested with Motorola PowerStack II).
 1.12.12.1 03-Dec-2017  jdolecek update from HEAD

RSS XML Feed