Home | History | Annotate | only in /src/sys/arch/sparc/stand
History log of /src/sys/arch/sparc/stand
RevisionDateAuthorComments
 1.22 13-Dec-2009  nakayama System utilities, boot programs and kernel modules are machine
(port) specific not CPU, so use MACHINE not MACHINE_ARCH.
 1.21 14-Feb-2009  abs Convert more MACHINE tests to MACHINE_ARCH
 1.20 11-Dec-2005  christos branches: 1.20.78; 1.20.86; 1.20.92;
merge ktrace-lwp.
 1.19 07-Dec-2003  mrg merge ultrasparc ofwboot / ofwboot.net.
 1.18 17-May-2003  nakayama branches: 1.18.2;
Don't traverse here in case of sparc64 32-bit environment.
 1.17 07-May-2002  lukem decommission old installboot; it doesn't work on bootxx anymore anyway.
 1.16 04-Mar-2001  mrg branches: 1.16.4; 1.16.8;
build sparc64 bootblk, ofwboot, & ofwboot.net on sparc
 1.15 01-Jun-1997  mrg branches: 1.15.22;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.14 07-May-1997  mycroft Don't use _SUBDIRUSE outside of bsd.subdir.mk.
 1.13 24-Jan-1997  pk Adapt to sys/lib/lib{sa,kern}/Makefile.inc changes
 1.12 18-Oct-1996  thorpej Use ${INSTALL}.
 1.11 05-Oct-1996  mrg update for kern/sa lib Makefile.inc changes.
 1.10 09-Oct-1995  pk Brr.. libkern.o is way too big for our bootxx..
 1.9 05-Oct-1995  pk Script to assist installing second-stage boot programs.
 1.8 30-Sep-1995  pk Make this work with OBJ dirs.
 1.7 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.6 26-Jun-1995  pk Adapt to new lib{sa,kern} regime.
 1.5 25-Nov-1994  deraadt support obj directory
 1.4 20-Nov-1994  deraadt copyright/Id cleanup
 1.3 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.2 01-Jul-1994  pk Adapt to current libsa.
 1.1 26-Feb-1994  pk Sparc bootblocks (a tight fit)
 1.15.22.1 12-Mar-2001  bouyer Sync with HEAD.
 1.16.8.1 20-Jun-2002  nathanw Catch up to -current.
 1.16.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.18.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.20.78.2 11-Mar-2010  yamt sync with head
 1.20.78.1 04-May-2009  yamt sync with head.
 1.32 01-Oct-2016  christos deal with PIE and SSP
 1.31 10-Mar-2016  martin branches: 1.31.2;
Add a few includes of bsd.own.mk to avoid broken test conditions
on ACTIVE_CC - this might not be the correct fix for PR 50930,
but it avoids the issue.
 1.30 27-Feb-2016  joerg When building with clang, optimise for minimal size and skip frame
pointers when possible.
 1.29 12-Aug-2013  joerg branches: 1.29.6;
Build boot loaders without unwind tables.
 1.28 25-Aug-2010  christos branches: 1.28.8; 1.28.18; 1.28.22;
factor out the floppy detection code.
 1.27 27-May-2010  dholland Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.
 1.26 27-Nov-2009  tsutsui branches: 1.26.2; 1.26.4;
Add src/common/include to -Ipath for proplib(3) so that build works
even without installed DESTDIR.
 1.25 29-Mar-2009  tsutsui Use <bsd.klinks.mk> to create machine and ${MACHINE_ARCH} symlinks.
 1.24 23-Mar-2009  tsutsui - use -Os to shrink bianries
- remove local shrinked memcpy() from bootxx.c bacause
now it's identical with __OPTIMIZE_SIZE__ libsa one
derived from src/common/lib/libc/string/bcopy.c.

Tested netboot from le0 and bootxx + boot from sd0 on SS1+.
 1.23 11-Dec-2005  christos branches: 1.23.78; 1.23.86; 1.23.92;
merge ktrace-lwp.
 1.22 21-Jun-2004  jmc Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
 1.21 30-Jul-2003  mrg branches: 1.21.2;
sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
 1.20 17-May-2003  nakayama branches: 1.20.2;
Make sure to remove lib directories.
 1.19 01-Mar-2003  pk Add support for large kernels by searching for a physical memory segment
to fit it in. As a bonus, the kernel is now also mapped to the virtual
address (i.e. KERNBASE) it is linked at.
 1.18 20-Jul-2002  mrg make sparc64 friendly.
 1.17 12-Dec-2001  tv branches: 1.17.8;
MKfoo=no -> NOfoo
 1.16 22-Nov-2001  jmc Don't make the symlinks on clean rules as well as obj rules. Breaks r/o source
trees that haven't gotten to the make obj recursion part of make build
otherwise.
 1.15 31-Oct-2000  pk branches: 1.15.4; 1.15.8;
Change the relocation address of `boot' once again to steer clear of
memory used by the PROM on sun4 and early sun4c machines.
 1.14 20-Oct-2000  pk Change to relocation addresses that currently work on all machines.
boot programs at alternative addresses no longer built and installed
by default.
 1.13 28-Aug-2000  pk Pull down from 1.4 branch: default relocation address = 3E0000
 1.12 21-Feb-2000  pk branches: 1.12.4;
SUN_BOOTPARAM compile-time option is no longer used.
 1.11 21-Feb-2000  pk bootxx links at 0x340000
2nd-stage boot programs choices: 0x200000,0x300000,0x400000,0x700000 (default: 0x300000)
 1.10 21-Feb-2000  pk Build several versions of the second-stage boot program, each linked
to run at a different base address. Boot image build procedures can
pick one which is least likely to fail..

The default boot program is again build to run at 0x340000.
 1.9 23-Jan-2000  mycroft Clean up the machine symlink stuff ever so slightly. Needs to be
standardized between files.
 1.8 25-Nov-1999  pk Suppress the `machine' symlink when making target `obj'.
Also add it to the clean target list.
 1.7 12-Jun-1999  pk branches: 1.7.2; 1.7.8;
Initialize the heap (for alloc()) explicitly, since the `end' symbol
is not necessarily double-word aligned.
 1.6 28-Apr-1999  christos Checkpoint of elf boot stuff:
- Use loadfile for both boot and installboot
- Fix problems with linking in bootxx
- Make installboot work with both a.out and ELF bootxx
- *WILL NOT BOOT YET ELF KERNELS* (a.out kernels work) I am working on it.
 1.5 15-Feb-1999  pk branches: 1.5.2; 1.5.4;
Install the `machine' link again; it went missing a while ago.
Add `-I.' to CPPFLAGS to use it.
 1.4 15-Feb-1999  pk * Add promlib.c to common sources.
* Compile with prototype warnings turned on.
 1.3 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.2 06-Feb-1999  hannken Define _STANDALONE instead of STANDALONE.
 1.1 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.2.2 09-Jul-2000  he Apply patch (requested by he, approved by pk):
Move the sparc boot loader close to the 4M limit, so that we
can boot the sysinst kernel without bumping into the boot
loader, and without exceeding the first 4M physical memory
bank. Fixes PR#10059.
 1.5.2.1 22-Feb-2000  he Apply patch (requested by pk):
Make several sparc boot programs to run at different relocated
addresses. The boot build procedures can then pick the one which
is least likely to fail.
 1.7.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.2.2 22-Nov-2000  bouyer Sync with HEAD.
 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.12.4.2 01-Nov-2000  tv Pullup 1.15 [pk]:
Change the relocation address of `boot' once again to steer clear of
memory used by the PROM on sun4 and early sun4c machines.
 1.12.4.1 19-Oct-2000  tv Commit by patch [pk]:
- boot floppy image out of space: use a two disk system
- update INSTALL kernel
- updates/fixes to miniroot image
- support for building CD image
- update installation doc
 1.15.8.2 01-Aug-2002  nathanw Catch up to -current.
 1.15.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.15.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.17.8.1 31-Aug-2002  gehenna catch up with -current.
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.21.2.1 22-Jun-2004  tron Pull up revision 1.22 (requested by jmc in ticket #531):
Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
 1.23.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.23.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.23.78.4 09-Oct-2010  yamt sync with head
 1.23.78.3 11-Aug-2010  yamt sync with head.
 1.23.78.2 11-Mar-2010  yamt sync with head
 1.23.78.1 04-May-2009  yamt sync with head.
 1.26.4.2 05-Mar-2011  rmind sync with head
 1.26.4.1 30-May-2010  rmind sync with head
 1.26.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.26.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.28.22.1 28-Aug-2013  rmind sync with head
 1.28.18.2 03-Dec-2017  jdolecek update from HEAD
 1.28.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.29.6.2 05-Oct-2016  skrll Sync with HEAD
 1.29.6.1 19-Mar-2016  skrll Sync with HEAD
 1.31.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.14 01-Oct-2016  christos deal with PIE and SSP
 1.13 19-May-2016  christos branches: 1.13.2;
We don't want PIE!
 1.12 10-Mar-2016  martin Add a few includes of bsd.own.mk to avoid broken test conditions
on ACTIVE_CC - this might not be the correct fix for PR 50930,
but it avoids the issue.
 1.11 27-Feb-2016  joerg Ignore unused arguments for clang as we pass assembler flags and the
like to the preprocessor-only mode. Conditionalize GCC flags that are
not known to clang accordingly.
 1.10 11-Dec-2005  christos branches: 1.10.122; 1.10.142;
merge ktrace-lwp.
 1.9 30-Oct-2005  sekiya sparc needs mostly the same compilation flags for standalone build as does
sparc64. Move them out of the sparc64 conditional.

Okayed by martin@
 1.8 30-Jul-2003  mrg branches: 1.8.16; 1.8.18;
sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
 1.7 20-Aug-2000  mrg branches: 1.7.24;
add/merge sparc64 support.
 1.6 01-Jun-1997  mrg branches: 1.6.22; 1.6.32;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.5 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.4 09-Oct-1995  pk Brr.. libkern.o is way too big for our bootxx..
 1.3 30-Sep-1995  pk Make this work with OBJ dirs.
 1.2 18-Sep-1995  chuck Fixed RELOC's to be hex numbers (as expected) rather than decimal.
(e.g. s/340000/0x340000/). Fixes DVMA panic on my sun-4/280 when
booted diskless.
 1.1 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.6.32.1 26-Aug-2000  mrg pull up 1.7. approved by thorpej:
>add/merge sparc64 support.
 1.6.22.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.24.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.7.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.24.1 03-Aug-2004  skrll Sync with HEAD
 1.8.18.1 02-Nov-2005  yamt sync with head.
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.10.142.3 05-Oct-2016  skrll Sync with HEAD
 1.10.142.2 29-May-2016  skrll Sync with HEAD
 1.10.142.1 19-Mar-2016  skrll Sync with HEAD
 1.10.122.1 03-Dec-2017  jdolecek update from HEAD
 1.13.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.6 30-Sep-1995  pk Refer to installboot(8)
 1.5 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.4 20-Nov-1994  deraadt copyright/Id cleanup
 1.3 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.2 27-Feb-1994  pk bootblocks must be stripped.
 1.1 26-Feb-1994  pk A one liner for now.
 1.5 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.4 29-Nov-1996  pk ffs bootblock install can be simplified since installboot(8) handles that now.
To install a TFTPable boot image, we have to play the header tricks here.
 1.3 07-Apr-1996  thorpej Fix typo that caused sun4 machines to be misidentified as sun4c-class.
Fixes reported problem of binstall not stripping the a.out header from
the boot block on sun4 machines.
 1.2 11-Oct-1995  pk Sync filesystem before running installboot.
 1.1 05-Oct-1995  pk branches: 1.1.2;
Script to assist installing second-stage boot programs.
 1.1.2.1 13-Oct-1995  pk Update from trunk: sync filesystem.
 1.14 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.13 17-Sep-1995  pk Correct some prototypes.
 1.12 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.11 25-Jun-1995  pk Reserve arguments 2-4 for SunOS loaders; pass DDB stuff in args 5 and 6.
 1.10 22-Feb-1995  mycroft Use the twiddle() from libsa.
 1.9 11-Dec-1994  pk Follow prototype changes in libsa.
 1.8 06-Dec-1994  pk cosmetic change.
 1.7 25-Nov-1994  deraadt round text segment to __LDPGSZ
 1.6 20-Nov-1994  deraadt copyright/Id cleanup
 1.5 30-Jul-1994  pk Use PROM node properties to determine device type.
 1.4 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.3 01-Jul-1994  pk Adapt to current libsa.
 1.2 20-Mar-1994  pk DDB support
 1.1 26-Feb-1994  pk Sparc bootblocks (a tight fit)
 1.8 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.7 27-Sep-1995  pk Avoid reading the filesystem superblock in bootxx; all info now prepared
by installboot (per Gordon Ross).
 1.6 18-Sep-1995  pk Adapt to libsa changes & some other minor nits.
 1.5 18-Sep-1995  chuck read superblock into &sblock rather than LOADADDR. we can't read
into LOADADDR because it can't be mapped into DVMA space. this fixes
a dvma panic on a sun4 boot from an xd disk.
 1.4 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.3 22-Feb-1995  mycroft Use the twiddle() from libsa.
 1.2 20-Nov-1994  deraadt copyright/Id cleanup
 1.1 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.3 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.2 18-Sep-1995  pk Adapt to libsa changes & some other minor nits.
 1.1 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.4 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.3 26-Jun-1995  pk Do away with ROM printf.
 1.2 20-Nov-1994  deraadt copyright/Id cleanup
 1.1 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.3 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.2 17-Sep-1995  pk Correct some prototypes.
 1.1 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.3 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.2 20-Nov-1994  deraadt copyright/Id cleanup
 1.1 01-Jul-1994  pk Adapt to current libsa.
 1.3 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.2 20-Nov-1994  deraadt copyright/Id cleanup
 1.1 26-Feb-1994  pk Sparc bootblocks (a tight fit)
 1.3 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.2 20-Oct-1996  pk Document `-a karch' option.
Fix a formatting nit.
 1.1 30-Sep-1995  pk Manual page for installboot(8).
 1.14 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.13 29-Nov-1996  pk installboot(8) now handles required a.out header munging.
Also, the munging is extended by inserting an instruction that branches
past the header, so the same boot image can be used on all supported
sun platforms.
 1.12 20-Oct-1996  pk Add `-a <arch>' switch to force the target architecture. Retain `-h' for
compatibility.
 1.11 08-Nov-1995  pk UFS => FFS conversion.
 1.10 07-Nov-1995  pk Correct test for sun4 machines (thanks Chuck).
Since uname currently does not allow to discriminate different sparc
models, we use `sysctl.hw.cpumodel' to do this somewhat heuristicly:
if the returned strings starts with "SUN4-" a sun4 architecture is
assumed. This information is used to determine whether or not to strip
the a.out header off the 1st-stage bootblocks.
 1.9 27-Sep-1995  pk branches: 1.9.2;
Avoid reading the filesystem superblock in bootxx; all info now prepared
by installboot (per Gordon Ross).
 1.8 18-Sep-1995  pk sync filesystems just prior to writing the bootblocks to the raw device.
 1.7 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.6 18-Aug-1995  pk Include exec header in length computation.
 1.5 18-Jun-1995  cgd don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN
 1.4 16-May-1995  pk Prototype internal function.
 1.3 20-Nov-1994  deraadt copyright/Id cleanup
 1.2 13-Aug-1994  pk Remove bogus fsstat().
 1.1 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.9.2.1 08-Nov-1995  pk Update from trunk: SUN4 detection & FFS conversion.
 1.5 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.4 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.3 04-May-1996  pk branches: 1.3.8;
mountroot: return error code to caller, not -1.
 1.2 18-Sep-1995  pk Adapt to libsa changes & some other minor nits.
 1.1 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.3.8.1 07-Mar-1997  is Use libsa copy of oldstyle if_ether.h for now
 1.4 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.3 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.2 18-Sep-1995  pk branches: 1.2.10;
Adapt to libsa changes & some other minor nits.
 1.1 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.2.10.1 07-Mar-1997  is Use libsa copy of oldstyle if_ether.h for now
 1.17 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.16 14-Nov-1995  pk Not all v2 proms understand the `mac-address' word (from Theo).
 1.15 10-Oct-1995  pk Check input channel in gettick(); for `L1-A' processing.
 1.14 26-Sep-1995  chuck branches: 1.14.2;
make sure devopen() sets pd->devtype properly when BOOTXX is defined
(should be DT_BLOCK). otherwise the bootxx boot block will fail if
you are on a system with a v2 openprom [because it will not do the
v2_seek in obp_strategy()]. fixes the problem recently noted on
the port-sparc list by matthew green <mrg@eterna.com.au>. i tested
fix on a ss2 with a v2 prom.
 1.13 18-Sep-1995  pk Adapt to libsa changes & some other minor nits.
 1.12 17-Sep-1995  pk Correct some prototypes.
 1.11 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.10 08-May-1995  pk Adapt declaration to stand.h; PR #1036
 1.9 22-Feb-1995  mycroft Use the twiddle() from libsa.
 1.8 11-Dec-1994  pk Follow prototype changes in libsa.
 1.7 25-Nov-1994  deraadt putchar is void
 1.6 20-Nov-1994  deraadt copyright/Id cleanup
 1.5 13-Aug-1994  pk Keep those pointers moving.
 1.4 30-Jul-1994  pk Use PROM node properties to determine device type.
 1.3 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.2 01-Jul-1994  pk Adapt to current libsa.
 1.1 26-Feb-1994  pk Sparc bootblocks (a tight fit)
 1.14.2.2 14-Nov-1995  pk Update from trunk: the `mac-address' word and v2 proms.
 1.14.2.1 13-Oct-1995  pk Update from trunk: check for L1-A more often.
 1.4 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.3 18-Sep-1995  pk Adapt to libsa changes & some other minor nits.
 1.2 17-Sep-1995  pk Correct some prototypes.
 1.1 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.8 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.7 18-Oct-1996  thorpej Clarify the comment about enabling interrupts above level 11, suggested
by Andrew Gillham.
 1.6 23-May-1996  pk Enable just enough interrupts to get "L1-A" through. Patch from Jason to
avoid spurious floppy interrupts on Jason's machine...
 1.5 13-Dec-1995  pk branches: 1.5.4;
Enable interrupts; some ROM versions apparently turn them off.
 1.4 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.3 20-Nov-1994  deraadt copyright/Id cleanup
 1.2 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.1 26-Feb-1994  pk Sparc bootblocks (a tight fit)
 1.5.4.2 17-Jul-1996  jtc Patch from PK to repair previous patch
 1.5.4.1 03-Jul-1996  jtc Patch from PK:
* Enable interrupts above level 11. This enables "L1-A", but
* avoids spurious interrupt bites from most other devices.
 1.6 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.5 04-May-1997  pk Bump version number to celebrate the fact that the bootblocks can be used
unmodified across all platforms.
 1.4 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.3 20-Nov-1994  deraadt copyright/Id cleanup
 1.2 20-Jul-1994  pk Make it work for V0 proms.
First cut at two stage bootstrap.
 1.1 26-Feb-1994  pk Sparc bootblocks (a tight fit)
 1.3 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.2 13-Feb-1999  lukem branches: 1.2.22; 1.2.26;
convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.1 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.2.26.1 08-Jan-2002  nathanw Catch up to -current.
 1.2.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.18 22-Sep-2018  kre Convert from getopt to getopts (script is slightly smaller as a
result, but not enough to save a block ... but if /usr/bin/getopt is
not used elsewhere, and it should not be, it will no longer be required.)
 1.17 16-Sep-2018  kre General cleanups...
Better quote usage
No more need for sed
(should be no need for getopt either, but did not do that one)
 1.16 16-Sep-2018  kre PR install/53610

Remove use of -a in test(1) - deprecated in standard, and no
longer supported in SMALL (install media) versions of test in /bin/sh
 1.15 12-Jul-2006  he branches: 1.15.148; 1.15.150;
Omit specifying the secondary bootloader on the installboot command line
for sparc64 systems. This should fix PR#33987.

Also adapt to the way sparc64 32-bit kernels now report its CPU
architecture -- these still need the sparc64 boot loader, but now
report hw.machine = sparc. Adapt by testing machdep.cpu_arch
instead.

Hints from martin and mrg.
 1.14 11-Dec-2005  christos branches: 1.14.4; 1.14.8; 1.14.16;
merge ktrace-lwp.
 1.13 07-Dec-2003  mrg branches: 1.13.16;
ofwboot.net is gone. from hannken@
 1.12 10-Jul-2003  lukem shell coding tweaks
 1.11 07-May-2002  pk branches: 1.11.10;
Patch up to work with MI installboot(8).
 1.10 02-Jan-2002  mrg - add a -i path-to-installboot option
- also recognise $INSTALLBOOT from the environment
- update Usage & share the option list with Help.
 1.9 31-Dec-2001  mrg clarify usage. idea from david obrien.
 1.8 19-Feb-2001  jmc branches: 1.8.4; 1.8.8;
Add -f option. If used it will perform the low level block operations on the
file rather than requiring a raw device. Useful when dealing with vnd's
images and building snapshots. Also allows snapshots to be built in
securelevel > 0.
 1.7 20-Aug-2000  mrg fix ultrasparc support.
 1.6 10-Aug-2000  mrg remove some ".sparc64" file suffixes that are not necessary.
 1.5 10-Aug-2000  mrg add sparc64 support.
 1.4 15-Feb-2000  pk branches: 1.4.4;
Allow second-stage boot program to be specified on the command line.
 1.3 01-Mar-1999  kim branches: 1.3.2; 1.3.8;
Try not to run when kernel is in secure mode.
 1.2 31-Oct-1997  pk Header magic is now done in stand/boot/Makefile.
 1.1 01-Jun-1997  mrg branches: 1.1.8;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.1.8.1 04-Nov-1997  mellon Pull rev 1.2 up from trunk (pk)
 1.3.8.2 12-Mar-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.3.2.1 22-Feb-2000  he Pull up revision 1.4 (requested by pk):
Make several sparc boot programs to run at different relocated
addresses. The boot build procedures can then pick the one which
is least likely to fail.
 1.4.4.2 20-Mar-2002  he Pull up revision 1.8 (requested by he):
Add ``-f'' option to binstall.sh and use it. This is allows boot
media construction when securelevel > 0.
 1.4.4.1 26-Aug-2000  mrg pull up 1.5, 1.6, 1.7. approved by thorpej:
1.5
>add sparc64 support.
1.6
>remove some ".sparc64" file suffixes that are not necessary.
1.7
>fix ultrasparc support.
 1.8.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.8.8.1 08-Jan-2002  nathanw Catch up to -current.
 1.8.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.10.1 03-Aug-2004  skrll Sync with HEAD
 1.13.16.1 30-Dec-2006  yamt sync with head.
 1.14.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.14.8.1 11-Aug-2006  yamt sync with head
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.15.150.1 10-Jun-2019  christos Sync with HEAD
 1.15.148.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.46 03-Jun-2023  lukem adapt to ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

Simplify CWARNFLAGS to use ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
which works for both clang and gcc, and remove compiler-specific
equivalents.
 1.45 03-Jun-2023  lukem bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER

Provide a single variable
CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
CLANG_NO_ADDR_OF_PACKED_MEMBER
CC_NO_ADDR_OF_PACKED_MEMBER
GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.44 06-Sep-2020  mrg add support for new GCC 9 warnings that may be too much to fix
right now. new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree. mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it. (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.) clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
 1.43 03-Jun-2020  rin Appease clang -Waddress-of-packed-member for <ufs/lfs/lfs_accessors.h>,
in the same manner as done for sparc64; pointer substitution is just for
sanity check and harmless there.
 1.42 28-Apr-2017  christos Also move bootjs.net after we've evaluated $OBJS (thanks gson@)
 1.41 09-Apr-2017  christos branches: 1.41.4;
move .for generated rules after OBJS have been set.
 1.40 08-Apr-2017  christos centralize vers.c building for standalone programs.
 1.39 10-Mar-2016  martin branches: 1.39.2; 1.39.4;
Strip debug symbols from boot code
 1.38 28-Aug-2011  mrg branches: 1.38.12; 1.38.30;
emit some linker -Map files so that we can figure out what symbols
in the boot loaders are.
 1.37 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.36 13-Dec-2009  nakayama branches: 1.36.4; 1.36.6; 1.36.8;
System utilities, boot programs and kernel modules are machine
(port) specific not CPU, so use MACHINE not MACHINE_ARCH.
 1.35 14-Feb-2009  abs Convert more MACHINE tests to MACHINE_ARCH
 1.34 11-Dec-2005  christos branches: 1.34.78; 1.34.86; 1.34.92;
merge ktrace-lwp.
 1.33 10-Jul-2005  martin Add SUPPORT_DHCP - otherwise bootp does not work (packet is too short for
root-path). From Christos.
 1.32 15-Dec-2003  martin branches: 1.32.14; 1.32.16;
Rename the JavaStation network boot loader: bootjs.elf -> bootjs.net.
 1.31 12-Dec-2003  martin Add support to build bootjs.elf - the secondary bootstrap used to netboot
JavaStations. Based on patches from Valeriy E. Ushakov.
 1.30 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.29 30-Jul-2003  mrg sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
 1.28 01-Mar-2003  pk branches: 1.28.2;
Add support for large kernels by searching for a physical memory segment
to fit it in. As a bonus, the kernel is now also mapped to the virtual
address (i.e. KERNBASE) it is linked at.
 1.27 04-Dec-2001  thorpej Don't declare which exec formats to support in loadfile_machdep.h.
Instead, give each user of loadfile() control over which exec formats
it wants to support.
 1.26 22-Sep-2001  tv branches: 1.26.4;
objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.25 22-Sep-2001  mrg use the 32-bit compiler on sparc64 (but not yet enabled.)
 1.24 21-Jun-2001  uwe branches: 1.24.2; 1.24.4;
Add PROM patches (forth code) as a table indexed with root node name
and prom version. Little tweaks to prom during secondary boot are
much easier then fragile work-arounds in the kernel. Currently this
is used for JavaStation 1 with OBP3.
 1.23 31-Oct-2000  pk Dispose of `boot.net.big'.
 1.22 21-Jul-2000  jdolecek switch to sys/conf/newvers_stand.sh for generation of version file
sync the message in boot/version with other ports using newvers_stand.sh
 1.21 03-Jul-2000  sommerfeld Build a boot_big.net (based at 700000) in addition to boot.net,
allowing you to netboot a kernel with a ramdisk inside on systems
where memory is laid out to allow this.
 1.20 13-Mar-2000  mycroft branches: 1.20.4;
Make dependall work.
 1.19 26-Feb-2000  pk Revert to using <bsd.prog.mk> again, so we support all targets that may
be presented when building the system (noticed by Juergen Hannken-Illjes).
 1.18 25-Feb-2000  pk We need <bsd.obj.mk>.
 1.17 21-Feb-2000  pk Build several versions of the second-stage boot program, each linked
to run at a different base address. Boot image build procedures can
pick one which is least likely to fail..

The default boot program is again build to run at 0x340000.
 1.16 09-Nov-1999  mycroft branches: 1.16.2;
Move the boot block load address from 3MB to 7MB. The INSTALL kernel is
already too large, and GENERIC won't be far behind.
 1.15 21-Aug-1999  sommerfeld branches: 1.15.2; 1.15.4; 1.15.6;
Use ${SIZE}, ${OBJCOPY} rather than size and objcopy.
 1.14 03-May-1999  pk Better pad the artificial header to exactly 32 bytes.
 1.13 30-Apr-1999  christos Add bootinfo struct to pass symtab arguments.
XXX: This does not work with ELF yet, but I don't understand why...
 1.12 28-Apr-1999  christos Checkpoint of elf boot stuff:
- Use loadfile for both boot and installboot
- Fix problems with linking in bootxx
- Make installboot work with both a.out and ELF bootxx
- *WILL NOT BOOT YET ELF KERNELS* (a.out kernels work) I am working on it.
 1.11 05-Mar-1999  pk branches: 1.11.2; 1.11.4;
Use `-Ttext' switch & collect ld options in LINKFLAGS.
 1.10 15-Feb-1999  pk Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.9 18-Dec-1997  pk Clean vers.c & vers.o.
 1.8 15-Nov-1997  pk Use DESTDIR consistently when constructing `boot.net'.
 1.7 12-Nov-1997  pk Change load address to avoid cache-aliasing on machines with Harvard-style
cache implementations (notably the Hypersparcs).
 1.6 31-Oct-1997  pk Install a version of the secondary boot block in /usr/mdec that is
suitable for use on a server for diskless booting. Done mostly to
simplify the installation notes and avoid questions ...
 1.5 01-Jun-1997  mrg branches: 1.5.8;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.4 29-Nov-1996  pk remove header munging hack.
 1.3 05-Oct-1996  mrg update for kern/sa lib Makefile.inc changes.
 1.2 30-Sep-1995  pk Make this work with OBJ dirs.
 1.1 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.5.8.3 15-Nov-1997  mellon Pull rev 1.8 up from trunk (pk)
 1.5.8.2 14-Nov-1997  mellon Pull rev 1.7 up from trunk (pk)
 1.5.8.1 04-Nov-1997  mellon Pull rev 1.6 up from trunk (pk)
 1.11.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11.2.3 28-Feb-2000  he Apply patch (requested by toddpw):
Add an include target so that ``make build'' works.
 1.11.2.2 28-Feb-2000  he Pull up revision 1.18 (requested by pk):
Make sure ``make obj'' works.
 1.11.2.1 22-Feb-2000  he Apply patch (requested by pk):
Make several sparc boot programs to run at different relocated
addresses. The boot build procedures can then pick the one which
is least likely to fail.
 1.15.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.4.1 15-Nov-1999  fvdl Sync with -current
 1.15.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.15.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.16.2.2 09-Nov-1999  mycroft Move the boot block load address from 3MB to 7MB. The INSTALL kernel is
already too large, and GENERIC won't be far behind.
 1.16.2.1 09-Nov-1999  mycroft file Makefile was added on branch comdex-fall-1999 on 1999-11-09 18:39:42 +0000
 1.20.4.1 26-Aug-2000  mrg "pull up" (via patch) fixes for sparc64 vs sparc boot blocks. (this is
resolved on the trunk with newvers_stand.sh). approved by thorpej.
 1.24.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.24.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.26.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.26.4.1 22-Sep-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:27:54 +0000
 1.28.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.28.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.2.1 03-Aug-2004  skrll Sync with HEAD
 1.32.16.1 21-Jun-2006  yamt sync with head.
 1.32.14.1 10-Jul-2005  tron Pull up revision 1.33 (requested by christos in ticket #567):
Add SUPPORT_DHCP - otherwise bootp does not work (packet is too short for
root-path). From Christos.
 1.34.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.34.86.1 03-Mar-2009  skrll Sync with HEAD.
 1.34.78.2 11-Mar-2010  yamt sync with head
 1.34.78.1 04-May-2009  yamt sync with head.
 1.36.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.36.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.36.4.1 05-Mar-2011  rmind sync with head
 1.38.30.2 28-Aug-2017  skrll Sync with HEAD
 1.38.30.1 19-Mar-2016  skrll Sync with HEAD
 1.38.12.1 03-Dec-2017  jdolecek update from HEAD
 1.39.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.39.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.41.4.1 02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.30 11-Jun-2016  dholland PR 51200 gets in libsa considered harmful: use kgets
 1.29 27-Nov-2015  joerg Don't use dynamically sized unions, they are a horrible GNUism. Just use
the existing upper limit all the time.
 1.28 28-May-2012  martin branches: 1.28.2; 1.28.16;
Pass the "boothowto" from the bootloader to the kernel.
If (an old) bootloader did not pass the flags, check explicitly if we
missed RB_USERCONF and invoke userconf_prompt() in MD code, as MI code
already missed it.
This fixes PR 46466.
 1.27 22-Jan-2011  joerg branches: 1.27.4; 1.27.8; 1.27.10;
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.26 25-Aug-2010  christos branches: 1.26.2; 1.26.4;
factor out the floppy detection code.
 1.25 25-Aug-2010  christos Don't LOAD_BACKWARDS for floppies.
 1.24 04-Mar-2007  christos branches: 1.24.44; 1.24.64; 1.24.66;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.23 13-Jul-2006  uwe branches: 1.23.10;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.22 11-Dec-2005  christos branches: 1.22.4; 1.22.8;
merge ktrace-lwp.
 1.21 03-Jun-2005  martin branches: 1.21.2;
constify
 1.20 27-Apr-2005  martin Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.19 08-Apr-2004  pk branches: 1.19.4; 1.19.10;
compat mode: skip double map at VA 0 if the physical load address is 0.
This allows a much wider range of historic kernels to be booted (w/ `-C').
 1.18 07-Aug-2003  agc branches: 1.18.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.17 30-Jul-2003  mrg sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
 1.16 10-Jul-2003  pk compat mode:
* print warning if kernel image is too large.
* adjust `required space' computation to be more compatible to
what it was before.
* since there's still no code to recognise `old kernels', provide
a way to turn on `compatmode' manually, using the `-C' boot option.
 1.15 01-Mar-2003  pk branches: 1.15.2;
Add support for large kernels by searching for a physical memory segment
to fit it in. As a bonus, the kernel is now also mapped to the virtual
address (i.e. KERNBASE) it is linked at.
 1.14 25-Feb-2003  pk * Use fdloadfile() to avoid opening the the underlying device twice.
* Cleanup old stuff.
 1.13 11-Dec-2002  pk * loadfile() return a file descriptor that must be closed.
* check the kernel size before loading
 1.12 09-Nov-2002  uwe Use BOOT_FLAG() macro to process flags.
 1.11 28-Mar-2002  pk Pass actual loaded kernel file in bootinfo[].
 1.10 21-Jun-2001  uwe branches: 1.10.2; 1.10.8;
Add PROM patches (forth code) as a table indexed with root node name
and prom version. Little tweaks to prom during secondary boot are
much easier then fragile work-arounds in the kernel. Currently this
is used for JavaStation 1 with OBP3.
 1.9 08-Nov-1999  pk Include <sys/exec.h> instead of <a.out.h>/
 1.8 12-Jun-1999  pk branches: 1.8.2; 1.8.4; 1.8.8;
Initialize the heap (for alloc()) explicitly, since the `end' symbol
is not necessarily double-word aligned.
 1.7 03-May-1999  christos Casts for PROM_LOADADDR which is not casted anymore.
 1.6 30-Apr-1999  christos Add bootinfo struct to pass symtab arguments.
XXX: This does not work with ELF yet, but I don't understand why...
 1.5 28-Apr-1999  christos Checkpoint of elf boot stuff:
- Use loadfile for both boot and installboot
- Fix problems with linking in bootxx
- Make installboot work with both a.out and ELF bootxx
- *WILL NOT BOOT YET ELF KERNELS* (a.out kernels work) I am working on it.
 1.4 15-Feb-1999  pk branches: 1.4.4;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.3 29-Aug-1998  mrg add support for finding kernels other than `netbsd'. the list is:
netbsd, netbsd.gz, netbsd.old, netbsd.old.gz, onetbsd, onetbsd.gz
and vmunix, in that order. this is used by the bootable `bootfs'
image (suitable for floppies and cdroms), which contains a netbsd.gz
by default.
while i'm here, fix up `boot [device] -s' which got broke when
booting kernels with a - in their name was fixed..
 1.2 14-Sep-1997  pk branches: 1.2.2;
Do not use KERNBASE to calculate the `end of symbols' location. Instead
use the `a_entry' field from the kernel's header as a base.

Pass on a new DDB magic number to the kernel, so kernels linked for a
different KERNBASE value can apply a correction when booted from old
bootblocks.
 1.1 01-Jun-1997  mrg branches: 1.1.4;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.1.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.2.1 19-Jan-1999  cgd pull up rev 1.3 from trunk (mrg)
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.1 15-Nov-1999  fvdl Sync with -current
 1.8.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.10.8.4 11-Dec-2002  thorpej Sync with HEAD.
 1.10.8.3 11-Nov-2002  nathanw Catch up to -current
 1.10.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.10.8.1 21-Jun-2001  nathanw file boot.c was added on branch nathanw_sa on 2002-04-01 07:42:56 +0000
 1.10.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.18.2.1 08-Apr-2004  jdc branches: 1.18.2.1.2;
Pull up revision 1.19 (requested by pk in ticket #95)

compat mode: skip double map at VA 0 if the physical load address is 0.
This allows a much wider range of historic kernels to be booted (w/ `-C').
 1.18.2.1.2.1 12-May-2005  riz Pull up revision 1.20 (requested by martin in ticket #1484):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.19.10.1 28-Apr-2005  tron Pull up revision 1.20 (requested by martin in ticket #210):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.19.4.1 29-Apr-2005  kent sync with -current
 1.21.2.2 03-Sep-2007  yamt sync with head.
 1.21.2.1 30-Dec-2006  yamt sync with head.
 1.22.8.1 11-Aug-2006  yamt sync with head
 1.22.4.1 09-Sep-2006  rpaulo sync with head
 1.23.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.66.1 05-Mar-2011  rmind sync with head
 1.24.64.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.24.44.1 09-Oct-2010  yamt sync with head
 1.26.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.26.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.27.10.1 05-Jun-2012  jdc Pull up revisions:
src/sys/arch/sparc/include/bootinfo.h revision 1.6
src/sys/arch/sparc/sparc/autoconf.c revision 1.243
src/sys/arch/sparc/stand/boot/boot.c revision 1.28
src/sys/arch/sparc/stand/ofwboot/boot.c revision 1.29
src/sys/arch/sparc64/include/bootinfo.h revision 1.6-1.7
src/sys/arch/sparc64/sparc64/autoconf.c revision 1.186
(requested by martin in ticket #289).

Pass the "boothowto" from the bootloader to the kernel.
If (an old) bootloader did not pass the flags, check explicitly if we
missed RB_USERCONF and invoke userconf_prompt() in MD code, as MI code
already missed it.
This fixes PR 46466.

Ooops, remove definitions duplicated in <sparc/bootinfo.h>
 1.27.8.1 02-Jun-2012  mrg sync to latest -current.
 1.27.4.1 30-Oct-2012  yamt sync with head
 1.28.16.2 09-Jul-2016  skrll Sync with HEAD
 1.28.16.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.28.2.1 03-Dec-2017  jdolecek update from HEAD
 1.3 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.2 28-Apr-2008  martin branches: 1.2.8; 1.2.14;
Remove clause 3 and 4 from TNF licenses
 1.1 30-Apr-1999  christos branches: 1.1.2; 1.1.140; 1.1.142; 1.1.144;
Add bootinfo struct to pass symtab arguments.
XXX: This does not work with ELF yet, but I don't understand why...
 1.1.144.2 04-May-2009  yamt sync with head.
 1.1.144.1 16-May-2008  yamt sync with head.
 1.1.142.1 18-May-2008  yamt sync with head.
 1.1.140.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 13-Jul-2006  uwe branches: 1.2.58; 1.2.60; 1.2.62;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.1 30-Apr-1999  christos branches: 1.1.2; 1.1.54; 1.1.68; 1.1.72;
Add bootinfo struct to pass symtab arguments.
XXX: This does not work with ELF yet, but I don't understand why...
 1.1.72.1 11-Aug-2006  yamt sync with head
 1.1.68.1 09-Sep-2006  rpaulo sync with head
 1.1.54.1 30-Dec-2006  yamt sync with head.
 1.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.62.1 16-May-2008  yamt sync with head.
 1.2.60.1 18-May-2008  yamt sync with head.
 1.2.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 14-Aug-2005  uwe Constify. Make (the only) submatch function static.
Prettify some comments.
 1.10 14-Aug-2005  macallan add a prom patch that creates a device node for the Krups' audio chip
in case it's missing ( like with OF 3.11.10 ) - makes audiocs at ebus work
on these machines.
 1.9 18-Mar-2004  hannken branches: 1.9.14; 1.9.16;
Rename PROM_getpropstring* => prom_getpropstring*
 1.8 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.7 30-Jul-2003  mrg sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
 1.6 16-Dec-2002  jdc branches: 1.6.6;
Extend the matching routine to take a function pointer, so that additional
(arbitrary) matching can be done.
Add match function and patch for Cycle 5 IP (Sparc 5 clone).

Reviewed by Uwe.
 1.5 11-Jan-2002  uwe OBP 2.30 in JS1 is romvec version 3, so g/c PROM_OBP_V2 entry.
Add bare-bones "8042" (pckbc) node and rename bogus zs nodes out of
the way to prevent them from matching.
 1.4 11-Dec-2001  aymeric add support for OBP 3.x as seen on some JavaStation 1's
 1.3 22-Nov-2001  uwe Add patches for Mr.Coffee with OBP2.
Miscellaneous cosmetic changes.
 1.2 26-Sep-2001  eeh branches: 1.2.4;
getprop* -> PROM_getprop*
 1.1 21-Jun-2001  uwe branches: 1.1.2; 1.1.4;
Add PROM patches (forth code) as a table indexed with root node name
and prom version. Little tweaks to prom during secondary boot are
much easier then fragile work-arounds in the kernel. Currently this
is used for JavaStation 1 with OBP3.
 1.1.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.5 19-Dec-2002  thorpej Sync with HEAD.
 1.2.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.3 11-Jan-2002  nathanw More catchup.
 1.2.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.1 26-Sep-2001  nathanw file prompatch.c was added on branch nathanw_sa on 2002-01-08 00:27:54 +0000
 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.16.1 21-Jun-2006  yamt sync with head.
 1.9.14.1 15-Aug-2005  tron Pull up revision 1.10 (requested by macallan in ticket #664):
add a prom patch that creates a device node for the Krups' audio chip
in case it's missing ( like with OF 3.11.10 ) - makes audiocs at ebus work
on these machines.
 1.19 11-Dec-2005  christos merge ktrace-lwp.
 1.18 14-Aug-2005  macallan add a prom patch that creates a device node for the Krups' audio chip
in case it's missing ( like with OF 3.11.10 ) - makes audiocs at ebus work
on these machines.
 1.17 01-Mar-2003  pk branches: 1.17.2; 1.17.16; 1.17.18;
Add support for large kernels by searching for a physical memory segment
to fit it in. As a bonus, the kernel is now also mapped to the virtual
address (i.e. KERNBASE) it is linked at.
 1.16 16-Dec-2002  jdc Increment version number for match function and Cycle 5 IP changes.
 1.15 21-Mar-2002  uwe PROM patches for JavaStation-1.
 1.14 09-Nov-2001  scw Bump the version numbers of all bootloaders which use loadfile_elfXX() now
that it tries hard to avoid backwards seeks.
 1.13 02-Aug-2001  bjh21 branches: 1.13.4; 1.13.6;
Bump version numbers of all bootloaders that use loadfile/ELF, to account for
my changes to symbol loading. I should probably have done this at the time,
but it's better late than never.
 1.12 21-Jul-2000  jdolecek branches: 1.12.4;
switch to sys/conf/newvers_stand.sh for generation of version file
sync the message in boot/version with other ports using newvers_stand.sh
 1.11 30-Apr-1999  christos branches: 1.11.2;
Add bootinfo struct to pass symtab arguments.
XXX: This does not work with ELF yet, but I don't understand why...
 1.10 28-Apr-1999  christos Checkpoint of elf boot stuff:
- Use loadfile for both boot and installboot
- Fix problems with linking in bootxx
- Make installboot work with both a.out and ELF bootxx
- *WILL NOT BOOT YET ELF KERNELS* (a.out kernels work) I am working on it.
 1.9 15-Jan-1999  mrg branches: 1.9.4;
look for /^Version:/ to find the boot block version, rather than using
the "version" file's RCS id (which is useless for branches).
 1.8 29-Aug-1998  mrg add support for finding kernels other than `netbsd'. the list is:
netbsd, netbsd.gz, netbsd.old, netbsd.old.gz, onetbsd, onetbsd.gz
and vmunix, in that order. this is used by the bootable `bootfs'
image (suitable for floppies and cdroms), which contains a netbsd.gz
by default.
while i'm here, fix up `boot [device] -s' which got broke when
booting kernels with a - in their name was fixed..
 1.7 01-Jun-1997  mrg branches: 1.7.8;
need to bump this back to version 1.7 (last one).
 1.6 01-Jun-1997  mrg need to bump this back to version 1.7.
 1.5 01-Jun-1997  mrg need to bump this back to version 1.7.
 1.4 01-Jun-1997  mrg need to bump this back to version 1.7.
 1.3 01-Jun-1997  mrg need to bump this back to version 1.7.
 1.2 01-Jun-1997  mrg need to bump this back to version 1.7.
 1.1 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.7.8.1 19-Jan-1999  cgd pull up revs 1.8-1.9 from trunk (mrg)
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.4.1 03-Aug-2001  lukem update to -current
 1.13.6.4 19-Dec-2002  thorpej Sync with HEAD.
 1.13.6.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.13.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.13.6.1 02-Aug-2001  nathanw file version was added on branch nathanw_sa on 2002-01-08 00:27:54 +0000
 1.13.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.17.18.1 21-Jun-2006  yamt sync with head.
 1.17.16.1 15-Aug-2005  tron Pull up revision 1.18 (requested by macallan in ticket #664):
add a prom patch that creates a device node for the Krups' audio chip
in case it's missing ( like with OF 3.11.10 ) - makes audiocs at ebus work
on these machines.
 1.17.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17 29-Mar-2019  christos no more _LKM -> _MODULE
 1.16 01-Oct-2016  christos branches: 1.16.16;
deal with PIE and SSP
 1.15 04-Mar-2014  joerg branches: 1.15.6; 1.15.10;
Add GENASSYM_CPPFLAGS in two more places.
 1.14 21-Aug-2013  matt Use <bsd.klinks.mk>
 1.13 13-Feb-2010  eeh branches: 1.13.10; 1.13.20; 1.13.24;
Major overhaul:

1) Add support for multiple filesystems including ffsv1, ffsv2, lfsv1 and lfsv2.
(ffsv1 and lfsv2 are known to work. ffv2 support needs more work. lfsv1 is
probably untested.)

2) Only 32-bit Fcodes are used. All 64-bit math uses two cells. This means it
should work on 32-bit machines.

Additional work to consider:

1) Rename genfth.cf to genffs.cf, or keep it and move the ffs symbols to genffs.cf

2) Move the ffs code and the lfs code to different source files so you can
selectively fload the just the filesystems you want.

3) Add code to load ELF files directly instead of relying on the host firmware
ELF support. But, since the binary is now 7250 bytes there may not be room.
 1.12 06-Apr-2009  tsutsui branches: 1.12.2;
assym.fth.h also requires sparc symlink. Fix build without DESTDIR.
 1.11 19-Oct-2008  apb branches: 1.11.2; 1.11.8;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.10 28-Aug-2006  tsutsui branches: 1.10.56; 1.10.60; 1.10.66;
Add src/common/include to include header search path since
<sys/device.h> includes <prop/proplib.h>.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.8;
merge ktrace-lwp.
 1.8 30-May-2005  thorpej branches: 1.8.2;
Use TOOL_GENASSYM. Part of PR toolchain/30350
 1.7 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.6 30-Jul-2003  mrg sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
 1.5 10-Jul-2003  lukem Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO". The new variables are:
TOOL_ASN1_COMPILE TOOL_CAP_MKDB TOOL_CAT TOOL_CKSUM TOOL_COMPILE_ET
TOOL_CONFIG TOOL_CRUNCHGEN TOOL_CTAGS TOOL_DB TOOL_EQN TOOL_FGEN
TOOL_GENCAT TOOL_GROFF TOOL_HEXDUMP TOOL_INDXBIB TOOL_INSTALLBOOT
TOOL_INSTALL_INFO TOOL_M4 TOOL_MAKEFS TOOL_MAKEINFO TOOL_MAKEWHATIS
TOOL_MDSETIMAGE TOOL_MENUC TOOL_MKCSMAPPER TOOL_MKESDB
TOOL_MKLOCALE TOOL_MKMAGIC TOOL_MKTEMP TOOL_MSGC TOOL_MTREE
TOOL_PAX TOOL_PIC TOOL_PREPMKBOOTIMAGE TOOL_PWD_MKDB TOOL_REFER
TOOL_ROFF_ASCII TOOL_ROFF_DVI TOOL_ROFF_HTML TOOL_ROFF_PS
TOOL_ROFF_RAW TOOL_RPCGEN TOOL_SOELIM TOOL_SUNLABEL TOOL_TBL
TOOL_UUDECODE TOOL_VGRIND TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
TOOL_FOO?= foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
TOOL_FOO= ${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
 1.4 28-May-2002  bjh21 branches: 1.4.6;
Use ${FGEN} rather than fgen.
 1.3 13-Dec-2001  tv branches: 1.3.8;
Fix problem introduced with the MKMAN->NOMAN conversion.
 1.2 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.8; 1.1.12;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.12.2 20-Jun-2002  nathanw Catch up to -current.
 1.1.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file Makefile was added on branch thorpej_scsipi on 2000-11-20 20:35:38 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file Makefile was added on branch netbsd-1-5 on 2000-08-26 00:05:22 +0000
 1.3.8.1 30-May-2002  gehenna Catch up with -current.
 1.4.6.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.6.1 03-Aug-2004  skrll Sync with HEAD
 1.8.2.1 30-Dec-2006  yamt sync with head.
 1.9.8.1 03-Sep-2006  yamt sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.66.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.10.60.2 11-Mar-2010  yamt sync with head
 1.10.60.1 04-May-2009  yamt sync with head.
 1.10.56.1 17-Jan-2009  mjf Sync with HEAD.
 1.11.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.11.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.12.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.13.24.2 18-May-2014  rmind sync with head
 1.13.24.1 28-Aug-2013  rmind sync with head
 1.13.20.2 03-Dec-2017  jdolecek update from HEAD
 1.13.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.10.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.15.10.1 04-Nov-2016  pgoyette Sync with HEAD
 1.15.6.1 05-Oct-2016  skrll Sync with HEAD
 1.16.16.1 10-Jun-2019  christos Sync with HEAD
 1.18 28-Feb-2025  andvar Fix various typos in comments.
 1.17 17-Nov-2022  chs branches: 1.17.8;
Restore backward compatibility of UFS2 with previous NetBSD releases by
disabling support in UFS2 for extended attributes (including ACLs).
Add a new variant of UFS2 called "UFS2ea" that does support extended attributes.
Add new fsck_ffs operations "-c ea" and "-c no-ea" to convert file systems
from UFS2 to UFS2ea and vice-versa (both of which delete all existing extended
attributes in the process).
 1.16 24-Jul-2021  andvar Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
 1.15 20-Aug-2015  dholland branches: 1.15.34;
Use lfs32_dinode_SIZEOF instead of ufs1_dinode_SIZEOF for lfs. These
are the same so it doesn't make any difference, but technically one
should use lfs parts with lfs.
 1.14 16-Aug-2015  jdc Make these compile again after changes to LFS.
 1.13 24-Jun-2010  eeh branches: 1.13.18; 1.13.36;
indir-block needs to be the size of a filesystem block or bad things can happen.
 1.12 11-Mar-2010  eeh branches: 1.12.2;
Fix shifting by zero.
 1.11 17-Feb-2010  eeh Fix ffsv2 support.
 1.10 13-Feb-2010  eeh Major overhaul:

1) Add support for multiple filesystems including ffsv1, ffsv2, lfsv1 and lfsv2.
(ffsv1 and lfsv2 are known to work. ffv2 support needs more work. lfsv1 is
probably untested.)

2) Only 32-bit Fcodes are used. All 64-bit math uses two cells. This means it
should work on 32-bit machines.

Additional work to consider:

1) Rename genfth.cf to genffs.cf, or keep it and move the ffs symbols to genffs.cf

2) Move the ffs code and the lfs code to different source files so you can
selectively fload the just the filesystems you want.

3) Add code to load ELF files directly instead of relying on the host firmware
ELF support. But, since the binary is now 7250 bytes there may not be room.
 1.9 19-Oct-2009  snj branches: 1.9.2;
Move Eduardo Horvath's license to 2 clause. OK eeh@.
 1.8 29-Jun-2008  jdc Instead of bailing out with "Inode not directory", assume that the disk is
a RAIDframe mirror, apply the RAID boot offset, and try to boot again.

Fixes the problem where disks would be unbootable if partitioned normally
and then converted to RAID 1 without being zeroed first.
 1.7 11-Dec-2005  christos branches: 1.7.24; 1.7.68; 1.7.74; 1.7.78; 1.7.80; 1.7.82;
merge ktrace-lwp.
 1.6 18-Jun-2004  martin branches: 1.6.10; 1.6.20; 1.6.22;
Use RF_PROTECTED_SECTORS instead of a (wrong) magic value.
The bootblock now is able to load ofwboot from a raid1 root.
 1.5 05-Apr-2003  he branches: 1.5.2; 1.5.4;
Track changes introduced when UFS2 was merged, so that this builds again.
 1.4 12-Jun-2002  eeh Dynamically allocate the buffer we use for filesystem deblocking based on
the filesystem blocksize in the super block. Allows us to read filesystems
with block sizes > 8KB.
 1.3 15-Aug-2001  eeh branches: 1.3.6; 1.3.14; 1.3.16;
Support for raidframe roots. I hope. (Someone needs to test this.)
 1.2 13-Jun-2001  wiz branches: 1.2.2;
withough -> without
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.6;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file bootblk.fth was added on branch thorpej_scsipi on 2000-11-20 20:35:39 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file bootblk.fth was added on branch netbsd-1-5 on 2000-08-26 00:05:22 +0000
 1.2.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.3.16.1 13-Jun-2002  lukem Pull up revision 1.4 (requested by eeh in ticket #259):
Dynamically allocate the buffer we use for filesystem deblocking based on
the filesystem blocksize in the super block. Allows us to read filesystems
with block sizes > 8KB.
 1.3.14.1 15-Jul-2002  gehenna catch up with -current.
 1.3.6.2 20-Jun-2002  nathanw Catch up to -current.
 1.3.6.1 15-Aug-2001  nathanw file bootblk.fth was added on branch nathanw_sa on 2002-06-20 03:41:13 +0000
 1.5.4.1 19-Jun-2004  grant Pull up revision 1.6 (requested by martin in ticket #510):

Use RF_PROTECTED_SECTORS instead of a (wrong) magic value.
The bootblock now is able to load ofwboot from a raid1 root.
 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.22.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by jdc in ticket #1986):
sys/arch/sparc/stand/bootblk/bootblk.fth: revision 1.8
Instead of bailing out with "Inode not directory", assume that the disk is
a RAIDframe mirror, apply the RAID boot offset, and try to boot again.
Fixes the problem where disks would be unbootable if partitioned normally
and then converted to RAID 1 without being zeroed first.
 1.6.20.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by jdc in ticket #1986):
sys/arch/sparc/stand/bootblk/bootblk.fth: revision 1.8
Instead of bailing out with "Inode not directory", assume that the disk is
a RAIDframe mirror, apply the RAID boot offset, and try to boot again.
Fixes the problem where disks would be unbootable if partitioned normally
and then converted to RAID 1 without being zeroed first.
 1.6.10.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by jdc in ticket #1986):
sys/arch/sparc/stand/bootblk/bootblk.fth: revision 1.8
Instead of bailing out with "Inode not directory", assume that the disk is
a RAIDframe mirror, apply the RAID boot offset, and try to boot again.
Fixes the problem where disks would be unbootable if partitioned normally
and then converted to RAID 1 without being zeroed first.
 1.7.82.1 03-Jul-2008  simonb Sync with head.
 1.7.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.7.78.3 11-Aug-2010  yamt sync with head.
 1.7.78.2 11-Mar-2010  yamt sync with head
 1.7.78.1 04-May-2009  yamt sync with head.
 1.7.74.1 02-Jul-2008  mjf Sync with HEAD.
 1.7.68.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by jdc in ticket #1251):
sys/arch/sparc/stand/bootblk/bootblk.fth: revision 1.8
Instead of bailing out with "Inode not directory", assume that the disk is
a RAIDframe mirror, apply the RAID boot offset, and try to boot again.
Fixes the problem where disks would be unbootable if partitioned normally
and then converted to RAID 1 without being zeroed first.
 1.7.24.1 15-Jan-2009  bouyer Pull up following revision(s) (requested by jdc in ticket #1251):
sys/arch/sparc/stand/bootblk/bootblk.fth: revision 1.8
Instead of bailing out with "Inode not directory", assume that the disk is
a RAIDframe mirror, apply the RAID boot offset, and try to boot again.
Fixes the problem where disks would be unbootable if partitioned normally
and then converted to RAID 1 without being zeroed first.
 1.9.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.9.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.12.2.1 03-Jul-2010  rmind sync with head
 1.13.36.1 22-Sep-2015  skrll Sync with HEAD
 1.13.18.1 03-Dec-2017  jdolecek update from HEAD
 1.15.34.1 01-Aug-2021  thorpej Sync with HEAD.
 1.17.8.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-May-2005  thorpej Use TOOL_GENASSYM. Part of PR toolchain/30350
 1.2 15-Dec-2003  jmc Clean up tmp files on exit. Fixes PR#23723
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.28;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.28.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.28.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file genassym.sh was added on branch thorpej_scsipi on 2000-11-20 20:35:39 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file genassym.sh was added on branch netbsd-1-5 on 2000-08-26 00:05:23 +0000
 1.10 17-Nov-2022  chs Restore backward compatibility of UFS2 with previous NetBSD releases by
disabling support in UFS2 for extended attributes (including ACLs).
Add a new variant of UFS2 called "UFS2ea" that does support extended attributes.
Add new fsck_ffs operations "-c ea" and "-c no-ea" to convert file systems
from UFS2 to UFS2ea and vice-versa (both of which delete all existing extended
attributes in the process).
 1.9 10-Jun-2013  hannken Move member di_inumber from ufs1_dinode to ulfs1_dinode.

No functional change intended. Tested on sparc64.
 1.8 22-Jan-2013  dholland Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
ROOTINO -> UFS_ROOTINO
WINO -> UFS_WINO
NXADDR -> UFS_NXADDR
NDADDR -> UFS_NDADDR
NIADDR -> UFS_NIADDR
MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

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

No functional change intended.
 1.7 13-Feb-2010  eeh branches: 1.7.10; 1.7.20;
Major overhaul:

1) Add support for multiple filesystems including ffsv1, ffsv2, lfsv1 and lfsv2.
(ffsv1 and lfsv2 are known to work. ffv2 support needs more work. lfsv1 is
probably untested.)

2) Only 32-bit Fcodes are used. All 64-bit math uses two cells. This means it
should work on 32-bit machines.

Additional work to consider:

1) Rename genfth.cf to genffs.cf, or keep it and move the ffs symbols to genffs.cf

2) Move the ffs code and the lfs code to different source files so you can
selectively fload the just the filesystems you want.

3) Add code to load ELF files directly instead of relying on the host firmware
ELF support. But, since the binary is now 7250 bytes there may not be room.
 1.6 02-May-2008  martin branches: 1.6.20;
Move TNF licenses to 2 clause form
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.76; 1.5.78;
merge ktrace-lwp.
 1.4 18-Jun-2004  martin Use RF_PROTECTED_SECTORS instead of a (wrong) magic value.
The bootblock now is able to load ofwboot from a raid1 root.
 1.3 05-Apr-2003  he branches: 1.3.2; 1.3.4;
Track changes introduced when UFS2 was merged, so that this builds again.
 1.2 03-Apr-2003  christos try to make this work with ufs1 only.
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file genfth.cf was added on branch thorpej_scsipi on 2000-11-20 20:35:40 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file genfth.cf was added on branch netbsd-1-5 on 2000-08-26 00:05:23 +0000
 1.3.4.1 19-Jun-2004  grant Pull up revision 1.4 (requested by martin in ticket #510):

Use RF_PROTECTED_SECTORS instead of a (wrong) magic value.
The bootblock now is able to load ofwboot from a raid1 root.
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.78.2 11-Mar-2010  yamt sync with head
 1.5.78.1 16-May-2008  yamt sync with head.
 1.5.76.1 18-May-2008  yamt sync with head.
 1.5.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.20.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.7.20.2 23-Jun-2013  tls resync from head
 1.7.20.1 25-Feb-2013  tls resync with head
 1.7.10.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.7.10.1 23-Jan-2013  yamt sync with head
 1.4 20-Aug-2015  dholland adjust comments slightly
 1.3 16-Aug-2015  jdc Make these compile again after changes to LFS.
 1.2 10-Jun-2013  hannken branches: 1.2.10;
Move member di_inumber from ufs1_dinode to ulfs1_dinode.

No functional change intended. Tested on sparc64.
 1.1 13-Feb-2010  eeh branches: 1.1.2; 1.1.6; 1.1.14; 1.1.24;
Major overhaul:

1) Add support for multiple filesystems including ffsv1, ffsv2, lfsv1 and lfsv2.
(ffsv1 and lfsv2 are known to work. ffv2 support needs more work. lfsv1 is
probably untested.)

2) Only 32-bit Fcodes are used. All 64-bit math uses two cells. This means it
should work on 32-bit machines.

Additional work to consider:

1) Rename genfth.cf to genffs.cf, or keep it and move the ffs symbols to genffs.cf

2) Move the ffs code and the lfs code to different source files so you can
selectively fload the just the filesystems you want.

3) Add code to load ELF files directly instead of relying on the host firmware
ELF support. But, since the binary is now 7250 bytes there may not be room.
 1.1.24.2 03-Dec-2017  jdolecek update from HEAD
 1.1.24.1 23-Jun-2013  tls resync from head
 1.1.14.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.2 30-Apr-2010  uebayasi Sync with HEAD.
 1.1.6.1 13-Feb-2010  uebayasi file genlfs.cf was added on branch uebayasi-xip on 2010-04-30 14:39:50 +0000
 1.1.2.2 11-Mar-2010  yamt sync with head
 1.1.2.1 13-Feb-2010  yamt file genlfs.cf was added on branch yamt-nfs-mp on 2010-03-11 15:02:59 +0000
 1.2.10.1 22-Sep-2015  skrll Sync with HEAD
 1.21 03-Jun-2023  lukem adapt to ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

Simplify CWARNFLAGS to use ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
which works for both clang and gcc, and remove compiler-specific
equivalents.
 1.20 03-Jun-2023  lukem bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER

Provide a single variable
CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
CLANG_NO_ADDR_OF_PACKED_MEMBER
CC_NO_ADDR_OF_PACKED_MEMBER
GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.19 06-Sep-2020  mrg add support for new GCC 9 warnings that may be too much to fix
right now. new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree. mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it. (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.) clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
 1.18 23-Apr-2020  joerg Uses LFS boot code
 1.17 12-Jan-2014  tsutsui branches: 1.17.40;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.16 11-Dec-2005  christos branches: 1.16.112; 1.16.122; 1.16.128;
merge ktrace-lwp.
 1.15 28-Jul-2004  simonb Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
 1.14 07-May-2002  pk branches: 1.14.10;
Convert `bootxx' to raw binary format which is what the MI installboot(8)
program needs.
 1.13 21-Feb-2000  pk branches: 1.13.8; 1.13.12;
bootxx links at 0x340000
2nd-stage boot programs choices: 0x200000,0x300000,0x400000,0x700000 (default: 0x300000)
 1.12 21-Feb-2000  pk RELOC -> RELOC_DEFAULT
 1.11 21-Aug-1999  sommerfeld branches: 1.11.2;
Use ${SIZE}, ${OBJCOPY} rather than size and objcopy.
 1.10 28-Apr-1999  christos Add -DLIBSA_NO_CLOSE
 1.9 05-Mar-1999  pk branches: 1.9.2; 1.9.4;
Use `-Ttext' switch & collect ld options in LINKFLAGS.
 1.8 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.7 17-Apr-1997  thorpej STRIP -> STRIPFLAG
 1.6 29-Nov-1996  pk remove header munging hack.
 1.5 10-Oct-1995  pk We don't need `rem.o'.
 1.4 09-Oct-1995  pk branches: 1.4.2;
Brr.. libkern.o is way too big for our bootxx..
 1.3 30-Sep-1995  pk Make this work with OBJ dirs.
 1.2 18-Sep-1995  pk Don't strip bootxx on installation.
 1.1 16-Sep-1995  pk Network booting; "oldmon" support; combine all functionality in single images.
Many thanks to Gordon Ross and Chuck Cranor for figuring out and testing
the old monitor (sun4) stuff.
 1.4.2.1 13-Oct-1995  pk Update from trunk: remove rem.o
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.2.1 22-Feb-2000  he Apply patch (requested by pk):
Make several sparc boot programs to run at different relocated
addresses. The boot build procedures can then pick the one which
is least likely to fail.
 1.11.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.13.12.1 20-Jun-2002  nathanw Catch up to -current.
 1.13.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.10.1 03-Aug-2004  skrll Sync with HEAD
 1.16.128.1 18-May-2014  rmind sync with head
 1.16.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.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.17.40.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.26 08-Oct-2015  joerg Don't check if an array is (not) NULL, check if the string is empty.
 1.25 26-Oct-2009  cegger branches: 1.25.22; 1.25.40;
kill extra whitespaces
reviewed by tsutsui@
 1.24 23-Aug-2009  he We need an explicit include of <sys/exec_aout.h> here as well.
 1.23 23-Mar-2009  tsutsui - use -Os to shrink bianries
- remove local shrinked memcpy() from bootxx.c bacause
now it's identical with __OPTIMIZE_SIZE__ libsa one
derived from src/common/lib/libc/string/bcopy.c.

Tested netboot from le0 and bootxx + boot from sd0 on SS1+.
 1.22 19-Mar-2009  he Now that the stand/ code was converted to use memcpy(), the private
implementation of bcopy() needs to become memcpy() as well. The
simpler local implementation is needed so that the boot code doesn't
overflow the available space.
 1.21 18-Mar-2009  cegger bcopy -> memcpy
 1.20 28-Apr-2008  martin branches: 1.20.8; 1.20.14;
Remove clause 3 and 4 from TNF licenses
 1.19 08-Mar-2007  he branches: 1.19.40; 1.19.42; 1.19.44;
Make the loadboot() declaration consistent, use char* because it
does pointer arithmetic on the argument.
 1.18 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.17 13-Jul-2006  uwe branches: 1.17.10;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.16 14-Jun-2006  uwe Nothing in this file needs <sys/time.h>
 1.15 14-Jun-2006  uwe Get strcpy prototype from libkern.h, not string.h
 1.14 11-Dec-2005  christos branches: 1.14.4; 1.14.8; 1.14.14;
merge ktrace-lwp.
 1.13 03-Jun-2005  martin branches: 1.13.2;
constify
 1.12 28-Apr-2005  martin Ooops, missed this file when changing the bootdevice signature.
Pointed out by Juergen Hannken-Illjes.
 1.11 15-May-2002  lukem branches: 1.11.10; 1.11.16; 1.11.18; 1.11.24;
bootblock.h:
- unify sparc_bbinfo (1064 bytes, with 256 block entries)
and sun68k_bbinfo (296 byte, with 64 block entries)
into shared_bbinfo (512 bytes, with 118 block entries),
which will be also shared by future bbinfo-using platforms
(including macppc)
- add datestamp to *_BBINFO_MAGIC strings, to prevent installboot vs
bootxx version skew.
- add macppc support

*/bootxx.c:
- migrate to new shared_bbinfo structure

installboot:
- add macppc support (still needs applepartmap support and testing)
- improve and add some more warnings & errors to installboot
- implement shared_bbinfo_clearboot() and shared_bbinfo_setboot(), which
perform the majority of the work for bbinfo-using back-ends
(rather than replicating that across multiple back-ends).
 1.10 07-May-2002  lukem convert to <sys/bootblock.h>
 1.9 30-Oct-2001  thorpej Rather than using nlist(3), use a magic structure with a magic
number that installboot(8) can search for. Suggested by cgd@netbsd.org.
 1.8 13-Mar-2000  soren branches: 1.8.8; 1.8.10; 1.8.12;
Fix doubled 'the's in comments.
 1.7 08-Nov-1999  pk Include <sys/exec.h> instead of <a.out.h>/
 1.6 12-Jun-1999  pk branches: 1.6.2; 1.6.4; 1.6.8;
Initialize the heap (for alloc()) explicitly, since the `end' symbol
is not necessarily double-word aligned.
 1.5 03-May-1999  christos Casts for PROM_LOADADDR which is not casted anymore.
 1.4 15-Feb-1999  pk branches: 1.4.4;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.3 05-Sep-1998  pk Assign my copyrights to TNF.
 1.2 14-Sep-1997  pk Call the device close routine when we're done reading.
 1.1 01-Jun-1997  mrg branches: 1.1.4;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.1.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.6.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.4.1 15-Nov-1999  fvdl Sync with -current
 1.6.2.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.12.2 20-Jun-2002  nathanw Catch up to -current.
 1.8.12.1 08-Jan-2002  nathanw Catch up to -current.
 1.8.10.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.8.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.24.1 28-Apr-2005  tron Pull up revision 1.12 (requested by martin in ticket #211):
Ooops, missed this file when changing the bootdevice signature.
Pointed out by Juergen Hannken-Illjes.
 1.11.18.1 29-Apr-2005  kent sync with -current
 1.11.16.1 12-May-2005  riz Pull up new patch (requested by martin in ticket #1484):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.11.10.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.13.2.3 03-Sep-2007  yamt sync with head.
 1.13.2.2 30-Dec-2006  yamt sync with head.
 1.13.2.1 21-Jun-2006  yamt sync with head.
 1.14.14.1 19-Jun-2006  chap Sync with head.
 1.14.8.2 11-Aug-2006  yamt sync with head
 1.14.8.1 26-Jun-2006  yamt sync with head.
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.17.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.44.4 11-Mar-2010  yamt sync with head
 1.19.44.3 16-Sep-2009  yamt sync with head
 1.19.44.2 04-May-2009  yamt sync with head.
 1.19.44.1 16-May-2008  yamt sync with head.
 1.19.42.1 18-May-2008  yamt sync with head.
 1.19.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.40.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.25.22.1 03-Dec-2017  jdolecek update from HEAD
 1.12 07-Feb-2024  msaitoh Fix typo of "following" in comment.
 1.11 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.10 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9 04-Mar-2007  christos branches: 1.9.40; 1.9.42; 1.9.44;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 13-Jul-2006  uwe branches: 1.8.10;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.7 04-Mar-2006  uwe branches: 1.7.2;
s/u_intN_t/uintN_t/
 1.6 24-Dec-2005  perry branches: 1.6.4; 1.6.6;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 03-Jun-2005  martin branches: 1.4.2;
constify
 1.3 26-Feb-2003  pk branches: 1.3.2;
Move all `ID prom' stuff into the prom library.
 1.2 03-May-1999  christos Casts for PROM_LOADADDR which is not casted anymore.
 1.1 15-Feb-1999  pk branches: 1.1.4;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.1.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.3.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3 03-Sep-2007  yamt sync with head.
 1.4.2.2 30-Dec-2006  yamt sync with head.
 1.4.2.1 21-Jun-2006  yamt sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.2.1 11-Aug-2006  yamt sync with head
 1.8.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.44.1 16-May-2008  yamt sync with head.
 1.9.42.1 18-May-2008  yamt sync with head.
 1.9.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 07-May-2002  lukem decommission old installboot; it doesn't work on bootxx anymore anyway.
 1.1 30-Oct-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Rather than using nlist(3), use a magic structure with a magic
number that installboot(8) can search for. Suggested by cgd@netbsd.org.
 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 30-Oct-2001  thorpej file bbinfo.h was added on branch kqueue on 2002-01-10 19:49:09 +0000
 1.1.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.1.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.4.1 30-Oct-2001  nathanw file bbinfo.h was added on branch nathanw_sa on 2002-01-08 00:27:55 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 30-Oct-2001  thorpej file bbinfo.h was added on branch thorpej-mips-cache on 2001-11-12 21:17:33 +0000
 1.2 05-Apr-2008  tsutsui Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.1 01-Jun-1997  mrg branches: 1.1.70; 1.1.108; 1.1.124; 1.1.158;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.1.158.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.124.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.1.108.1 08-May-2008  jdc Pull up revisions:
src/sys/arch/sparc/stand/common/conf.c 1.2
src/sys/arch/sparc/stand/common/promdev.c 1.21
(requested by tsutsui in ticket #1132).

Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.1.70.2 08-May-2008  jdc Revert revisiion 1.1.70.1 and apply patch from ticket #1928 correctly.
 1.1.70.1 08-May-2008  jdc Pull up revisions:
src/sys/arch/sparc/stand/common/conf.c 1.2
src/sys/arch/sparc/stand/common/promdev.c 1.21
(requested by tsutsui in ticket #1928).

Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.15 21-Oct-2009  snj Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder).
 1.14 13-Jul-2006  uwe branches: 1.14.62;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.13 25-Jan-2006  uwe branches: 1.13.2; 1.13.6;
It's free -> dealloc, not free -> size_t (hi, Christos :).
 1.12 25-Jan-2006  christos free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.11 11-Dec-2005  christos branches: 1.11.2;
merge ktrace-lwp.
 1.10 10-Nov-2003  wiz branches: 1.10.16;
Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.9 31-Oct-2000  pk branches: 1.9.24;
Align the DVMA mapping on NBPSG boundaries.
 1.8 18-Jun-2000  fvdl branches: 1.8.2;
Rearrange previous slightly to avoid getting values that are too low;
the only goal here is to leave some space for the stack.
 1.7 18-Jun-2000  fvdl Account for the stack when computing the base va. This makes the
bootblocks work again on the 4/110.
 1.6 14-Apr-2000  pk branches: 1.6.2;
dvma_init: avoid integer variable overflow
 1.5 15-Feb-2000  pk Determine base address at run time.
 1.4 15-Feb-2000  pk Nuke unused code.
 1.3 15-Feb-1999  pk branches: 1.3.2; 1.3.8;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.2 12-Oct-1998  pk Move around a few PTE-manipulating macros.
 1.1 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.3.8.2 22-Nov-2000  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.3.2.3 27-Jul-2000  he Revert previous, and pull up revisions 1.7-1.8 (requested by pk):
Account for stack when computing base VA; fixes booting on sun4
systems. Fixes PR#9906 and PR#10165
(Previous patch had bug as submitted.)
 1.3.2.2 23-Jul-2000  he Pull up revisions 1.7-1.8 (via patch, requested by pk):
Account for stack when computing base VA; fixes booting on sun4
systems. Fixes PR#9906 and PR#10165
 1.3.2.1 27-Jun-2000  he Apply patch (requested by pk):
Fix lossage of the bootstrap program on sun4 machines, at least
when booting from disk. Fixes PR#9906.
 1.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.8.2.1 01-Nov-2000  tv Pullup 1.9 [pk]:
Align the DVMA mapping on NBPSG boundaries.
 1.9.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.24.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.2 30-Dec-2006  yamt sync with head.
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.11.2.1 01-Feb-2006  yamt sync with head.
 1.13.6.1 11-Aug-2006  yamt sync with head
 1.13.2.1 09-Sep-2006  rpaulo sync with head
 1.14.62.1 11-Mar-2010  yamt sync with head
 1.1 25-Aug-2010  christos branches: 1.1.2; 1.1.4; 1.1.10;
factor out the floppy detection code.
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 25-Aug-2010  rmind file isfloppy.c was added on branch rmind-uvmplock on 2011-03-05 20:52:04 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 25-Aug-2010  uebayasi file isfloppy.c was added on branch uebayasi-xip on 2010-10-22 07:21:33 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 25-Aug-2010  yamt file isfloppy.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:53 +0000
 1.1 25-Aug-2010  christos branches: 1.1.2; 1.1.4; 1.1.10;
factor out the floppy detection code.
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 25-Aug-2010  rmind file isfloppy.h was added on branch rmind-uvmplock on 2011-03-05 20:52:04 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 25-Aug-2010  uebayasi file isfloppy.h was added on branch uebayasi-xip on 2010-10-22 07:21:33 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 25-Aug-2010  yamt file isfloppy.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:53 +0000
 1.9 26-Mar-2014  christos kill sprintf
 1.8 28-Apr-2008  martin branches: 1.8.34; 1.8.44; 1.8.50;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.74; 1.7.76; 1.7.78;
merge ktrace-lwp.
 1.6 19-Jun-2005  thorpej Move common Sun ID PROM definitions into <dev/sun/idprom.h>.
 1.5 23-Jan-2005  pk Make pmap_map() work on sun4 machines.
Thanks to Matthew and Julian for finding this.
 1.4 24-Oct-2003  pk branches: 1.4.2; 1.4.6; 1.4.8;
pmap_map_srmmu: use the `map-pages' Forth word to let prom map all pages
at once.
 1.3 10-Jul-2003  pk pmap_map(): round up size to compute # of pages.
 1.2 27-Jun-2003  uwe branches: 1.2.2;
Drop redundant argument to printf("\n"). Obvious pasto.
 1.1 01-Mar-2003  pk Add support for large kernels by searching for a physical memory segment
to fit it in. As a bonus, the kernel is now also mapped to the virtual
address (i.e. KERNBASE) it is linked at.
 1.2.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.4 24-Jan-2005  skrll Sync with HEAD.
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.4.6.1 16-Mar-2005  tron Pull up revision 1.5 (requested by pk in ticket #1118):
Make pmap_map() work on sun4 machines.
Thanks to Matthew and Julian for finding this.
 1.4.2.1 16-Mar-2005  tron Pull up revision 1.5 (requested by pk in ticket #1118):
Make pmap_map() work on sun4 machines.
Thanks to Matthew and Julian for finding this.
 1.7.78.1 16-May-2008  yamt sync with head.
 1.7.76.1 18-May-2008  yamt sync with head.
 1.7.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.50.1 18-May-2014  rmind sync with head
 1.8.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.34.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11 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.10 23-Apr-2020  joerg branches: 1.10.4;
rootpath is owned by libsa
 1.9 21-Oct-2009  snj branches: 1.9.74;
Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder).
 1.8 13-Jul-2006  uwe branches: 1.8.62;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.7 25-Feb-2003  pk branches: 1.7.18; 1.7.32; 1.7.36;
Note which network boot protocol we're trying.
 1.6 14-May-2002  lukem - Enable NFS_BOOT_DHCP (as well as the existing NFS_BOOT_BOOTPARAM).
DHCP/Bootp is tried before bootparams in the MI nfs mountroot code.
- Change the order in boot.net from "bootparams then bootp" to
"bootp then bootparams", to be consistent with the MI nfs mountroot code.

(Consistency with other NetBSD ports is good, and things still work
for sites that run bootparams but not dhcp/bootp, although I'd argue that
dhcp/bootp is much easier to setup and manage and is easier to debug
than our rpc.bootparamd...)

Per discussion with Paul Kranenburg and Matt Green.
 1.5 22-Jan-2000  pk branches: 1.5.8; 1.5.12;
Try both the BOOTPARAMS and BOOTP protocol (in that order). This also
takes care of PR#8738.
 1.4 07-May-1999  drochner branches: 1.4.2;
include <lib/libkern/libkern.h> for intoa()/inet_ntoa()
 1.3 15-Feb-1999  pk branches: 1.3.4;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 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 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.3.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.12.1 20-Jun-2002  nathanw Catch up to -current.
 1.5.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.36.1 11-Aug-2006  yamt sync with head
 1.7.32.1 09-Sep-2006  rpaulo sync with head
 1.7.18.1 30-Dec-2006  yamt sync with head.
 1.8.62.1 11-Mar-2010  yamt sync with head
 1.9.74.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.10.4.1 17-Apr-2021  thorpej Sync with HEAD.
 1.12 21-Oct-2009  snj Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder).
 1.11 18-Mar-2009  cegger bzero -> memset
 1.10 12-Jan-2009  tsutsui branches: 1.10.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

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

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

Per discussion on current-users.
 1.9 13-Jul-2006  uwe branches: 1.9.58; 1.9.62; 1.9.70;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.8;
merge ktrace-lwp.
 1.7 15-Mar-2004  pk branches: 1.7.16;
Replace myetheraddr() by prom_getether(). Convert the file descriptor to
deivce tree node (if possible) to support the "local-mac-address' property.
 1.6 13-Mar-2003  hannken branches: 1.6.2;
Explicit cast for netif.

Approved by: Matthias Drochner <drochner@netbsd.org>
 1.5 26-Feb-2003  pk Move all `ID prom' stuff into the prom library.
 1.4 08-Nov-1999  pk Remove inclusion of unused headers.
 1.3 15-Feb-1999  pk branches: 1.3.8; 1.3.10; 1.3.14;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 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 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.10.1 15-Nov-1999  fvdl Sync with -current
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 30-Dec-2006  yamt sync with head.
 1.8.8.1 11-Aug-2006  yamt sync with head
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.70.2 28-Apr-2009  skrll Sync with HEAD.
 1.9.70.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.62.2 11-Mar-2010  yamt sync with head
 1.9.62.1 04-May-2009  yamt sync with head.
 1.9.58.1 17-Jan-2009  mjf Sync with HEAD.
 1.10.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3 21-Jul-2000  jdolecek switch to sys/conf/newvers_stand.sh for generation of version file
sync the message in boot/version with other ports using newvers_stand.sh
 1.2 15-Jan-1999  mrg branches: 1.2.8; 1.2.18;
look for /^Version:/ to find the boot block version, rather than using
the "version" file's RCS id (which is useless for branches).
 1.1 01-Jun-1997  mrg branches: 1.1.8;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.1.8.1 19-Jan-1999  cgd pull up rev 1.2 from trunk (mrg)
 1.2.18.1 26-Aug-2000  mrg "pull up" (via patch) fixes for sparc64 vs sparc boot blocks. (this is
resolved on the trunk with newvers_stand.sh). approved by thorpej.
 1.2.8.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck
 1.31 17-Jan-2025  riastradh sparc promdev.c: Nix trailing whitespace. Fix intertoken space.

No functional change intended.
 1.30 13-Jan-2025  jdc Move the check for RAID boot into the strategy routines.
This avoids a Data Access Exception at boot time on older PROM versions.
 1.29 03-Feb-2019  mrg branches: 1.29.36;
don't compare string pointers against \0
 1.28 25-Mar-2017  martin branches: 1.28.14;
Virtio block devices may have a "scsi" device_type instead of "block",
so accept both.
 1.27 30-Dec-2013  martin branches: 1.27.6; 1.27.10; 1.27.14;
Avoid buffer overruns (no practical difference for any sane firmware
properties, but better be safe).
 1.26 02-Sep-2010  uwe branches: 1.26.8; 1.26.18; 1.26.22;
Fix printf formats in -DDEBUG_PROM to make it compile.

XXX: print daddr_t after casting it to int since libsa is not built
with LIBSA_PRINTF_LONGLONG_SUPPORT by default.
 1.25 25-Aug-2010  christos factor out the floppy detection code.
 1.24 25-Aug-2010  christos Don't LOAD_BACKWARDS for floppies.
 1.23 18-Oct-2009  tsutsui branches: 1.23.2; 1.23.4;
Don't try to read disklabel to check FS_RAID on floppy boot since
reopening floppy could cause Data Access Exception later.
Fixes PR port-sparc/42186, ok'ed by mrg@.
 1.22 12-Jan-2009  tsutsui Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

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

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

Per discussion on current-users.
 1.21 05-Apr-2008  tsutsui branches: 1.21.4; 1.21.12; 1.21.14; 1.21.20;
Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.20 13-Jul-2006  uwe branches: 1.20.8; 1.20.24; 1.20.58;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.19 20-Jun-2006  jdc Add support to the 2nd stage boot loader for booting from RAID
partitions. We do this by checking the NetBSD label to see if the
boot partition is of type RAID. If so, we offset reads from the
disk so that the kernel image can be read.

Note that with this code, sun4 machines (with PROM monitor) will only
boot from RAID if the RAID partition is the first one on the disk.

Tested on a SPARCstation 20, a SPARCstation 2 and a 4/330.
 1.18 20-May-2006  mrg branches: 1.18.2;
struct filesystem is now struct fs_ops, since i don't know when.
 1.17 11-Dec-2005  christos branches: 1.17.4; 1.17.6; 1.17.8; 1.17.12; 1.17.14;
merge ktrace-lwp.
 1.16 27-Apr-2005  martin branches: 1.16.2;
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.15 30-Jul-2003  mrg branches: 1.15.6; 1.15.8; 1.15.14;
sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
 1.14 26-Feb-2003  pk branches: 1.14.2;
Move all `ID prom' stuff into the prom library.
 1.13 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.12 26-Sep-2001  eeh branches: 1.12.4;
getprop* -> PROM_getprop*
 1.11 05-Aug-2001  mrg branches: 1.11.2;
avoid an unused variable warning
 1.10 04-Apr-2001  pk branches: 1.10.2;
* Missing PROM_OPENFIRM: case in getdevtype() and prom_getether().
* In getdevtype(), use prom_instance_to_package() to get to the device node.

From Valeriy E. Ushakov on port-sparc@netbsd.org.
 1.9 18-Jan-2001  pk branches: 1.9.2;
On V0 proms, read the `idprom' property at the root node to get to the
station's ethernet address.
 1.8 28-Apr-1999  christos branches: 1.8.2; 1.8.12;
Include <sys/systm.h> to get prototype for memset.
 1.7 15-Feb-1999  pk branches: 1.7.4;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.6 12-Oct-1998  pk Move around a few PTE-manipulating macros.
 1.5 05-Oct-1998  christos rename getprop routine to avoid conflict with the one in bsd_openprom.h
 1.4 15-Sep-1998  pk Can't afford a 1K buffer in the data segment.
 1.3 29-Aug-1998  mrg add support for finding kernels other than `netbsd'. the list is:
netbsd, netbsd.gz, netbsd.old, netbsd.old.gz, onetbsd, onetbsd.gz
and vmunix, in that order. this is used by the bootable `bootfs'
image (suitable for floppies and cdroms), which contains a netbsd.gz
by default.
while i'm here, fix up `boot [device] -s' which got broke when
booting kernels with a - in their name was fixed..
 1.2 27-May-1998  pk Properly split boot spec into file name and arguments.
 1.1 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.7.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.12.1 03-Feb-2001  he Pull up revision 1.9 (requested by pk):
On V0 proms, read the ``idprom'' property at the root node to
get to the station's ethernet address. Fixes netbooting on some
older SPARCstations where the boot program would otherwise crash.
 1.8.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.8.2.1 11-Feb-2001  bouyer Sync with HEAD.
 1.9.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.10.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.10.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.11.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.12.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.12.4.1 26-Sep-2001  nathanw file promdev.c was added on branch nathanw_sa on 2002-10-18 02:40:01 +0000
 1.14.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.15.14.3 08-May-2008  jdc Pull up revisions:
src/sys/arch/sparc/stand/common/conf.c 1.2
src/sys/arch/sparc/stand/common/promdev.c 1.21
(requested by tsutsui in ticket #1928).

Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.15.14.2 10-Nov-2006  ghen Pull up following revision(s) (requested by jdc in ticket #1527):
sys/arch/sparc/stand/common/promdev.c: revision 1.19
share/man/man8/man8.sparc/boot.8: revision 1.29 + patch
share/man/man8/man8.sparc/boot.8: revision 1.30
Add support to the 2nd stage boot loader for booting from RAID
partitions. We do this by checking the NetBSD label to see if the
boot partition is of type RAID. If so, we offset reads from the
disk so that the kernel image can be read.
Note that with this code, sun4 machines (with PROM monitor) will only
boot from RAID if the RAID partition is the first one on the disk.
Tested on a SPARCstation 20, a SPARCstation 2 and a 4/330.
Add some PROM monitor and Open Boot PROM boot-related commands and a
BUGS section describing boot limitations.
Drop trailing whitespace.
 1.15.14.1 28-Apr-2005  tron Pull up revision 1.16 (requested by martin in ticket #210):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.15.8.1 29-Apr-2005  kent sync with -current
 1.15.6.1 12-May-2005  riz Pull up revision 1.16 (requested by martin in ticket #1484):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.16.2.2 30-Dec-2006  yamt sync with head.
 1.16.2.1 21-Jun-2006  yamt sync with head.
 1.17.14.1 19-Jun-2006  chap Sync with head.
 1.17.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.17.8.3 11-Aug-2006  yamt sync with head
 1.17.8.2 26-Jun-2006  yamt sync with head.
 1.17.8.1 24-May-2006  yamt sync with head.
 1.17.6.1 01-Jun-2006  kardel Sync with head.
 1.17.4.1 09-Sep-2006  rpaulo sync with head
 1.18.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.20.58.2 17-Jan-2009  mjf Sync with HEAD.
 1.20.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.24.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.20.8.2 27-Jan-2010  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1379):
sys/arch/sparc/sparc/auxreg.h: revision 1.13
distrib/sparc/ramdisk/dot.profile: revision 1.20
sys/arch/sparc/stand/common/promdev.c: revision 1.23
Don't try to read disklabel to check FS_RAID on floppy boot since
reopening floppy could cause Data Access Exception later.
Fixes PR port-sparc/42186, ok'ed by mrg@.
Use /dev/fd0a rather than /dev/rfd0a to read instfs.tgz image from floppy.
It looks newer (appearred after 1.6) gzip tries to read less than DEV_BSIZE
(to check header?) so we can't use raw device directly.
(note sparc bootfs ramdisk doesn't have dd(1))
Workaround for PR port-sparc/42193, and would also fix PR install/28734.
Explicitly clear AUXIO4M_FTC bit in FTC_FLIP macro used on
pseudo-dma for floppy, as well as AUXIO4C_FTC bit for sun4c.
A comment in the macro says AUXIO4M_FTC bit is auto-clear,
but my two SS20s (including compatible) with 150MHz hyperSPARCs
get data_overrun without it, and no bad side effect on SS5
(works with and without this change).
Closes PR port-sparc/42516, which is the last one of a bunch of
floppy issue on NetBSD/sparc since NetBSD 2.0 days. See
http://mail-index.NetBSD.org/port-sparc/2009/12/20/msg000484.html
for details.
 1.20.8.1 08-May-2008  jdc Pull up revisions:
src/sys/arch/sparc/stand/common/conf.c 1.2
src/sys/arch/sparc/stand/common/promdev.c 1.21
(requested by tsutsui in ticket #1132).

Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.21.20.1 21-Apr-2010  matt sync to netbsd-5
 1.21.14.1 23-Jan-2010  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1251):
sys/arch/sparc/sparc/auxreg.h: revision 1.13
distrib/sparc/ramdisk/dot.profile: revision 1.20
sys/arch/sparc/dev/audioamd.c: revision 1.25
sys/arch/sparc/dev/fd.c: revision 1.147
sys/arch/sparc/stand/common/promdev.c: revision 1.23
distrib/sparc/miniroot/Makefile.inc: revision 1.16
Build miniroot binaries for sparc with -Os to shrink instfs.tgz
for the second boot floppy which use miniroot objects.
This is workaround for PR install/42146, and ok'ed by mrg@.
Don't try to read disklabel to check FS_RAID on floppy boot since
reopening floppy could cause Data Access Exception later.
Fixes PR port-sparc/42186, ok'ed by mrg@.
Disable "fast trap" handlers which invoke software interrupts
in sparc/amd7930intr.s and sparc/bsd_fdintr.s until they are
rewritten to adapt new MI softint(9) API.
No particular comments on PR port-sparc/42192, but
this fixes timeout problem on floppy access on my SPARCstation 1+.
XXX: floppy support on sun4m seems to have another problem (data overrun).
Use /dev/fd0a rather than /dev/rfd0a to read instfs.tgz image from floppy.
It looks newer (appearred after 1.6) gzip tries to read less than DEV_BSIZE
(to check header?) so we can't use raw device directly.
(note sparc bootfs ramdisk doesn't have dd(1))
Workaround for PR port-sparc/42193, and would also fix PR install/28734.
Explicitly clear AUXIO4M_FTC bit in FTC_FLIP macro used on
pseudo-dma for floppy, as well as AUXIO4C_FTC bit for sun4c.
A comment in the macro says AUXIO4M_FTC bit is auto-clear,
but my two SS20s (including compatible) with 150MHz hyperSPARCs
get data_overrun without it, and no bad side effect on SS5
(works with and without this change).
Closes PR port-sparc/42516, which is the last one of a bunch of
floppy issue on NetBSD/sparc since NetBSD 2.0 days. See
http://mail-index.NetBSD.org/port-sparc/2009/12/20/msg000484.html
for details.
 1.21.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.21.4.3 09-Oct-2010  yamt sync with head
 1.21.4.2 11-Mar-2010  yamt sync with head
 1.21.4.1 04-May-2009  yamt sync with head.
 1.23.4.1 05-Mar-2011  rmind sync with head
 1.23.2.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.26.22.1 18-May-2014  rmind sync with head
 1.26.18.2 03-Dec-2017  jdolecek update from HEAD
 1.26.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.27.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.27.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.27.6.1 28-Aug-2017  skrll Sync with HEAD
 1.28.14.1 10-Jun-2019  christos Sync with HEAD
 1.29.36.1 02-Aug-2025  perseant Sync with HEAD
 1.16 25-Aug-2010  christos factor out the floppy detection code.
 1.15 25-Aug-2010  christos Don't LOAD_BACKWARDS for floppies.
 1.14 12-Jan-2009  tsutsui Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

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

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

Per discussion on current-users.
 1.13 28-Apr-2008  martin branches: 1.13.8;
Remove clause 3 and 4 from TNF licenses
 1.12 13-Jul-2006  uwe branches: 1.12.58; 1.12.60; 1.12.62;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.8;
merge ktrace-lwp.
 1.10 27-Apr-2005  martin branches: 1.10.2;
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.9 01-Mar-2003  pk branches: 1.9.2; 1.9.8; 1.9.10; 1.9.16;
Add support for large kernels by searching for a physical memory segment
to fit it in. As a bonus, the kernel is now also mapped to the virtual
address (i.e. KERNBASE) it is linked at.
 1.8 26-Feb-2003  pk Move all `ID prom' stuff into the prom library.
 1.7 27-May-1999  pk `xmit' & `recv' return `ssize_t'
 1.6 30-Apr-1999  christos Add bootinfo struct to pass symtab arguments.
XXX: This does not work with ELF yet, but I don't understand why...
 1.5 15-Feb-1999  pk branches: 1.5.4;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.4 12-Oct-1998  pk Move around a few PTE-manipulating macros.
 1.3 05-Sep-1998  pk Assign my copyrights to TNF.
 1.2 14-Sep-1997  pk Define a new DDB magic number to pass to the kernel.
 1.1 01-Jun-1997  mrg branches: 1.1.4;
Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.1.4.1 16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.16.1 28-Apr-2005  tron Pull up revision 1.10 (requested by martin in ticket #210):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.9.10.1 29-Apr-2005  kent sync with -current
 1.9.8.1 12-May-2005  riz Pull up revision 1.10 (requested by martin in ticket #1484):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.9.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.2.1 30-Dec-2006  yamt sync with head.
 1.11.8.1 11-Aug-2006  yamt sync with head
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.62.2 04-May-2009  yamt sync with head.
 1.12.62.1 16-May-2008  yamt sync with head.
 1.12.60.1 18-May-2008  yamt sync with head.
 1.12.58.2 17-Jan-2009  mjf Sync with HEAD.
 1.12.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.12 10-Mar-2016  martin Deal with _edata not being 4-byte aligned
 1.11 28-Apr-2008  martin branches: 1.11.44; 1.11.64;
Remove clause 3 and 4 from TNF licenses
 1.10 11-Dec-2005  christos branches: 1.10.74; 1.10.76; 1.10.78;
merge ktrace-lwp.
 1.9 23-Mar-2004  pk Add openfirmware() entry point.
 1.8 28-Jun-2003  uwe branches: 1.8.2;
Only JavaStations have OFW, so set cpu type to CPU_SUN4M in is_openfirm.
 1.7 21-Nov-2001  uwe Skip relocation if OpenFirmware already loaded us at the right address.
 1.6 20-May-2001  uwe branches: 1.6.2; 1.6.8;
Save OpenFirmware client interface handler in romp, where it is
expected to be. GC unused opf_romp variable.
 1.5 19-Oct-2000  pk branches: 1.5.2;
When relocating, there's no need to copy the BSS area.
 1.4 05-Mar-1999  pk branches: 1.4.8;
Use <machine/asm.h> to construct C identifiers.
 1.3 15-Feb-1999  pk Transfer copyright to TNF.
 1.2 15-Feb-1999  pk Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.1 01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.6.8.2 08-Jan-2002  nathanw Catch up to -current.
 1.6.8.1 20-May-2001  nathanw file srt0.S was added on branch nathanw_sa on 2002-01-08 00:27:56 +0000
 1.6.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.78.1 16-May-2008  yamt sync with head.
 1.10.76.1 18-May-2008  yamt sync with head.
 1.10.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.64.1 19-Mar-2016  skrll Sync with HEAD
 1.11.44.1 03-Dec-2017  jdolecek update from HEAD
 1.17 14-May-2022  hgutch PR 56829: Fix "map" call to Open Firmware and no longer mess up OFW stack.
This unbreaks miniroot.fs.

Thanks to Björn Johannesson for originally pointing this out and to
mrg@ for pointing out the actual issue and suggesting a fix.
 1.16 15-Sep-2017  martin Add more details about the boot device as a new bootinfo record type.
From within the bootloader, when we have readily accessible instance
handles of the boot device, it is easy to query more details like SCSI
LUN, target, and FC-AL wwn from the firmware.
The kernel later would have a hard time getting theses, but can make good
use to match the boot device.
 1.15 10-Oct-2015  martin Add compile time asserts to make sure we have properly picked up types
for a 64bit cpu and 64bit openfirmware.
 1.14 27-Mar-2015  nakayama Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.
 1.13 18-Dec-2013  martin branches: 1.13.4; 1.13.6;
The "close" call returns no arguments
 1.12 21-May-2011  tsutsui branches: 1.12.4; 1.12.10; 1.12.14; 1.12.16; 1.12.18; 1.12.24;
WARNSfy and fix dumb bugs noticed by warnings.
 1.11 18-May-2009  nakayama branches: 1.11.4; 1.11.6;
Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.10 17-Oct-2007  garbled branches: 1.10.20; 1.10.30; 1.10.40; 1.10.44;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.9 19-Sep-2007  martin Some aliases (like "cdrom") expand to a path that includes a partition -
deal with them.
 1.8 13-Jul-2006  uwe branches: 1.8.14; 1.8.22; 1.8.32; 1.8.34;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.7 27-Jan-2006  cdi branches: 1.7.2; 1.7.6;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.6 11-Dec-2005  christos branches: 1.6.2;
merge ktrace-lwp.
 1.5 01-Jun-2005  martin branches: 1.5.2;
Adapt to constification
 1.4 16-Jan-2005  chs remove some dead code, simplify and wrap some long lines.
 1.3 27-Sep-2002  provos branches: 1.3.6; 1.3.14;
remove trailing \n in panic(). approved perry.
 1.2 06-Jun-2002  martin Follow changes in libsa/stand.h: exit(void) -> exit(int) (one in a #if
0 block), to make it compile again.
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.8; 1.1.12; 1.1.20;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.20.1 15-Jul-2002  gehenna catch up with -current.
 1.1.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.12.1 20-Jun-2002  nathanw Catch up to -current.
 1.1.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file Locore.c was added on branch thorpej_scsipi on 2000-11-20 20:25:50 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file Locore.c was added on branch netbsd-1-5 on 2000-08-26 00:05:15 +0000
 1.3.14.1 29-Apr-2005  kent sync with -current
 1.3.6.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.6.1 17-Jan-2005  skrll Sync with HEAD.
 1.5.2.3 27-Oct-2007  yamt sync with head.
 1.5.2.2 30-Dec-2006  yamt sync with head.
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.6.2.1 01-Feb-2006  yamt sync with head.
 1.7.6.1 11-Aug-2006  yamt sync with head
 1.7.2.1 09-Sep-2006  rpaulo sync with head
 1.8.34.1 06-Nov-2007  matt sync with HEAD
 1.8.32.1 02-Oct-2007  joerg Sync with HEAD.
 1.8.22.1 03-Oct-2007  garbled Sync with HEAD
 1.8.14.1 09-Oct-2007  ad Sync with head.
 1.10.44.2 26-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.10.44.1 17-Apr-2015  msaitoh Pull up following revision(s) (requested by nakayama in ticket #1958):
sys/arch/sparc/stand/ofwboot/Locore.c: revision 1.14
Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.
 1.10.40.2 26-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.10.40.1 17-Apr-2015  msaitoh Pull up following revision(s) (requested by nakayama in ticket #1958):
sys/arch/sparc/stand/ofwboot/Locore.c: revision 1.14
Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.
 1.10.30.2 19-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.10.30.1 17-Apr-2015  msaitoh Pull up following revision(s) (requested by nakayama in ticket #1958):
sys/arch/sparc/stand/ofwboot/Locore.c: revision 1.14
Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.
 1.10.20.1 20-Jun-2009  yamt sync with head
 1.11.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.4.1 31-May-2011  rmind sync with head
 1.12.24.1 16-Apr-2015  msaitoh Pull up following revision(s) (requested by nakayama in ticket #1285):
sys/arch/sparc/stand/ofwboot/Locore.c: revision 1.14
Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.
 1.12.18.1 18-May-2014  rmind sync with head
 1.12.16.1 16-Apr-2015  msaitoh Pull up following revision(s) (requested by nakayama in ticket #1285):
sys/arch/sparc/stand/ofwboot/Locore.c: revision 1.14
Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.
 1.12.14.2 03-Dec-2017  jdolecek update from HEAD
 1.12.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.10.1 16-Apr-2015  msaitoh Pull up following revision(s) (requested by nakayama in ticket #1285):
sys/arch/sparc/stand/ofwboot/Locore.c: revision 1.14
Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.
 1.12.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.13.6.1 06-Apr-2015  skrll Sync with HEAD
 1.13.4.1 29-Mar-2015  martin Pull up following revision(s) (requested by nakayama in ticket #649):
sys/arch/sparc/sparc/openfirm.c: revision 1.20
sys/arch/sparc/include/openfirm.h: revision 1.8
sys/arch/sparc/stand/ofwboot/Locore.c: revision 1.14
Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.
Sync sparc64 kernel's OF_seek with ofwboot's one, but sparc version
is not changed.
 1.42 03-Jun-2023  lukem adapt to ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

Simplify CWARNFLAGS to use ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
which works for both clang and gcc, and remove compiler-specific
equivalents.
 1.41 03-Jun-2023  lukem bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER

Provide a single variable
CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
CLANG_NO_ADDR_OF_PACKED_MEMBER
CC_NO_ADDR_OF_PACKED_MEMBER
GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.40 06-Sep-2020  mrg add support for new GCC 9 warnings that may be too much to fix
right now. new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree. mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it. (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.) clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
 1.39 20-Apr-2020  riastradh More -Wno-error=address-of-packed-member to placate clang.
 1.38 08-Apr-2017  christos branches: 1.38.14; 1.38.24;
centralize vers.c building for standalone programs.
 1.37 01-Oct-2016  christos branches: 1.37.2;
deal with PIE and SSP
 1.36 26-Oct-2015  mrg branches: 1.36.2;
force -mcpu=v9 for ofwboot, which demands v9 cpus.
 1.35 10-Oct-2015  martin Simplify, get rid of manual _LP64 define.
Do not pass a SUN4U define, as that is no longer used in the relevant headers.
Instead tell the compiler we are compiling for a v9 CPU (so it internally
defines everything we need).
 1.34 02-Oct-2015  joerg Support per-target AFLAGS.
 1.33 11-Jan-2015  martin Strip debug symbols from ofwboot.

The forth bootsector loading this file when booting from disk is
"simplistic" and does not skip non loadable sections. The five times
bigger file with debug info overruns some important memory contents
with some firmware versions otherwise.
 1.32 12-Jan-2014  tsutsui branches: 1.32.4; 1.32.6;
Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.31 08-Dec-2013  palle Add support for running ofwboot on sun4v. Please note that the kernel on sun4v will be loaded properly but when the kernel takes over it will crash immediately since the kernel is not sun4v ready yet
 1.30 21-Aug-2013  matt Use <bsd.klinks.mk>
 1.29 21-May-2011  tsutsui branches: 1.29.4; 1.29.14; 1.29.18;
WARNSfy and fix dumb bugs noticed by warnings.
 1.28 23-Jan-2011  nakayama Redo previous.
bsd.own.mk must be included after NOMAN=.
 1.27 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.26 17-Jan-2011  joerg branches: 1.26.2;
Move SPARC and SPARC64 to modern CPP. Update UPDATING note for this and
Alpha.
 1.25 25-Aug-2010  christos branches: 1.25.2;
factor out the floppy detection code.
 1.24 27-May-2010  dholland Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.
 1.23 02-Apr-2010  martin Add support for /boot.cfg. Implement a single command for now: override
the boot partition, which will be used for bootable CDs. Add cd9660
support.
 1.22 27-Nov-2009  tsutsui branches: 1.22.2; 1.22.4;
Add src/common/include to -Ipath for proplib(3) so that build works
even without installed DESTDIR.
 1.21 17-Oct-2007  garbled branches: 1.21.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.20 29-Sep-2007  martin Enable booting from news Solaris ufs partitions.
 1.19 14-Sep-2007  martin branches: 1.19.2;
Rename the option to enable ISO 9660 file system support from ..._HSFS
to ..._CD9660.
 1.18 27-Jan-2006  cdi branches: 1.18.28; 1.18.36; 1.18.46; 1.18.48;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.17 27-Jan-2006  uwe Use the same code to create machine, sparc and sparc64 symlinks that
../Makefile.buildboot uses.
 1.16 22-Jan-2006  dsl Add an explicit -I for sys/lib/libsa so that we find the <iodesc.h>
requested inside sys/lib/libsa/net.h
This used to be "iodesc.h" but another build needs to override it with
a local copy.
 1.15 11-Dec-2005  christos branches: 1.15.2;
merge ktrace-lwp.
 1.14 10-Jul-2005  christos Turn on dhcp support.
 1.13 28-Jul-2004  simonb branches: 1.13.10; 1.13.12;
Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
 1.12 21-Jun-2004  jmc Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
 1.11 21-Mar-2004  martin branches: 1.11.2;
Create a symlink for <sparc/...> include paths as well, the new openfirm.h
needs it.
 1.10 07-Dec-2003  mrg merge ultrasparc ofwboot / ofwboot.net.
 1.9 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.8 01-Jun-2003  thorpej branches: 1.8.2;
Add -ffreestanding.
 1.7 17-May-2003  nakayama Make sure to remove lib directories.
 1.6 17-May-2003  nakayama Make sure to remove proper link.
 1.5 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.4 04-Dec-2001  thorpej Don't declare which exec formats to support in loadfile_machdep.h.
Instead, give each user of loadfile() control over which exec formats
it wants to support.
 1.3 22-Sep-2001  tv branches: 1.3.4;
objcopy -> ${OBJCOPY}; remove redundant definitions of OBJCOPY?= (it is
now in bsd.own.mk).
 1.2 04-Mar-2001  mrg branches: 1.2.2; 1.2.4;
this is a sparc64 program. so -DSUN4U, machine -> sparc64. cleanup.
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.4.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file Makefile was added on branch thorpej_scsipi on 2000-11-20 20:25:50 +0000
 1.1.2.3 26-Aug-2000  mrg "pull up" (via patch) fixes for sparc64 vs sparc boot blocks. (this is
resolved on the trunk with newvers_stand.sh). approved by thorpej.
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file Makefile was added on branch netbsd-1-5 on 2000-08-26 00:05:15 +0000
 1.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 22-Sep-2001  nathanw file Makefile was added on branch nathanw_sa on 2002-01-08 00:27:56 +0000
 1.8.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.11.2.1 22-Jun-2004  tron Pull up revision 1.12 (requested by jmc in ticket #531):
Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
 1.13.12.2 27-Oct-2007  yamt sync with head.
 1.13.12.1 21-Jun-2006  yamt sync with head.
 1.13.10.1 10-Jul-2005  tron Pull up revision 1.14 (requested by christos in ticket #567):
Turn on dhcp support.
 1.15.2.1 01-Feb-2006  yamt sync with head.
 1.18.48.1 06-Nov-2007  matt sync with HEAD
 1.18.46.1 02-Oct-2007  joerg Sync with HEAD.
 1.18.36.1 03-Oct-2007  garbled Sync with HEAD
 1.18.28.1 09-Oct-2007  ad Sync with head.
 1.19.2.1 06-Oct-2007  yamt sync with head.
 1.21.20.3 09-Oct-2010  yamt sync with head
 1.21.20.2 11-Aug-2010  yamt sync with head.
 1.21.20.1 11-Mar-2010  yamt sync with head
 1.22.4.3 31-May-2011  rmind sync with head
 1.22.4.2 05-Mar-2011  rmind sync with head
 1.22.4.1 30-May-2010  rmind sync with head
 1.22.2.3 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.22.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.22.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.25.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.26.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.29.18.2 18-May-2014  rmind sync with head
 1.29.18.1 28-Aug-2013  rmind sync with head
 1.29.14.2 03-Dec-2017  jdolecek update from HEAD
 1.29.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.29.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.32.6.4 28-Aug-2017  skrll Sync with HEAD
 1.32.6.3 05-Oct-2016  skrll Sync with HEAD
 1.32.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.32.6.1 06-Apr-2015  skrll Sync with HEAD
 1.32.4.1 12-Jan-2015  snj Pull up following revision(s) (requested by martin in ticket #411):
sys/arch/sparc/stand/ofwboot/Makefile: revision 1.33
Strip debug symbols from ofwboot.
The forth bootsector loading this file when booting from disk is
"simplistic" and does not skip non loadable sections. The five times
bigger file with debug info overruns some important memory contents
with some firmware versions otherwise.
 1.36.2.2 26-Apr-2017  pgoyette Sync with HEAD
 1.36.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.37.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.38.24.1 20-Apr-2020  bouyer Sync with HEAD
 1.38.14.1 21-Apr-2020  martin Sync with HEAD
 1.5 19-May-2011  christos handle prototype for freeall
 1.4 28-Apr-2008  martin branches: 1.4.22; 1.4.28;
Remove clause 3 and 4 from TNF licenses
 1.3 27-Jan-2006  uwe branches: 1.3.72; 1.3.74; 1.3.76;
Sync clean up changes with other copies of ofwboot/alloc.c.
Expand copyright/license by Jason R. Thorpe as in others too.
 1.2 25-Jan-2006  christos free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.44; 1.1.56;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.56.1 01-Feb-2006  yamt sync with head.
 1.1.44.1 21-Jun-2006  yamt sync with head.
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file alloc.c was added on branch thorpej_scsipi on 2000-11-20 20:25:50 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file alloc.c was added on branch netbsd-1-5 on 2000-08-26 00:05:16 +0000
 1.3.76.1 16-May-2008  yamt sync with head.
 1.3.74.1 18-May-2008  yamt sync with head.
 1.3.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.22.1 31-May-2011  rmind sync with head
 1.35 15-Sep-2017  martin Add more details about the boot device as a new bootinfo record type.
From within the bootloader, when we have readily accessible instance
handles of the boot device, it is easy to query more details like SCSI
LUN, target, and FC-AL wwn from the firmware.
The kernel later would have a hard time getting theses, but can make good
use to match the boot device.
 1.34 31-Aug-2016  martin Init the markers array to all 0 - pointed out by Mark Cave-Ayland.
 1.33 11-Jun-2016  dholland PR 51200 gets in libsa considered harmful: use kgets
 1.32 30-May-2016  martin David Binderman in PR port-sparc/51188: simplify while condition
 1.31 28-Jun-2014  rtr branches: 1.31.4;
patch posted to tech-kern@ 2014/06/25 for review with minor changes
resulting from feedback.

move multiple copies of code for parsing boot.cfg file from sparc, i386
and zaurus into libsa/bootcfg.{h,c}. largely retained i386 parsing logic
in addition to keeping sparc dispatch function while remaining consistent
with boot.cfg(5).

previous sparc64 file format has been obsoleted but only used by boot
CDs distrib/sparc64/bootfs/boot.cfg has been updated to compensate.

exported names have been prefixed with either BOOTCFG_ or bootcfg_ as per
feedback from christos@

tested on amd64 & sparc64 but not zaurus.
 1.30 30-Dec-2013  martin branches: 1.30.2;
Improve debugging output
 1.29 28-May-2012  martin branches: 1.29.2; 1.29.4;
Pass the "boothowto" from the bootloader to the kernel.
If (an old) bootloader did not pass the flags, check explicitly if we
missed RB_USERCONF and invoke userconf_prompt() in MD code, as MI code
already missed it.
This fixes PR 46466.
 1.28 21-May-2011  tsutsui branches: 1.28.4; 1.28.8; 1.28.10;
WARNSfy and fix dumb bugs noticed by warnings.
 1.27 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.26 06-Nov-2010  mrg branches: 1.26.2; 1.26.4;
add a "-T" option to disable the twiddler, which can help booting
with serial output slowness i've seen.
 1.25 25-Aug-2010  christos factor out the floppy detection code.
 1.24 25-Aug-2010  christos kill LOAD_MINIMAL.
 1.23 25-Aug-2010  christos Try to detect if we are doing a floppy boot from the device name and if
we are, load the minimal set to avoid backwards seeks.
 1.22 02-Apr-2010  martin Add support for /boot.cfg. Implement a single command for now: override
the boot partition, which will be used for bootable CDs. Add cd9660
support.
 1.21 27-Jan-2010  martin branches: 1.21.2; 1.21.4;
Properly close the firmware handle before starting the kernel.
This makes netbooting via bge* work.
 1.20 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.19 18-Mar-2009  cegger bcopy -> memcpy
 1.18 17-Oct-2007  garbled branches: 1.18.20; 1.18.28; 1.18.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.17 20-Sep-2007  martin Make the device name include the partition, if filename returned one.
 1.16 19-Sep-2007  martin If we can not find a filepath when splitting a single argument, the whole
thing certainly has to be a device name.
 1.15 16-Sep-2007  martin Change "Boot:" prompt option parsing to be more in line with the default
(no prompt) behaviour - it is now possible to "boot net:dhcp -a" and then
say "disk" at the "Boot:" prompt - result should be equivalent to "boot disk",
but the ofwboot was loaded from the network.
While there fix a few minor errors, and one significant: if the "a" partition
should not start at the beginning of the disk, the previous code failed
to read a disklabel. Use the "c" partition now to find the disklabel now
always.
 1.14 05-Jun-2007  martin branches: 1.14.8; 1.14.10;
Use the new loadfile() marker MARK_DATA to optimize the loaded kernel
mappings before calling the entry point - change text mappings to read
only and only insert those into the iTLB.
While there remove a few magic constants by information queried from
the firmware.
 1.13 13-Jul-2006  uwe branches: 1.13.14; 1.13.16; 1.13.22;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.12 27-Jan-2006  cdi branches: 1.12.2; 1.12.6;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.11 27-Jan-2006  uwe Constify kernel names.
 1.10 11-Dec-2005  christos branches: 1.10.2;
merge ktrace-lwp.
 1.9 15-Feb-2005  christos branches: 1.9.6;
Don't always increment i, because when we reach the end of the array we'll
die.
 1.8 16-Jan-2005  chs branches: 1.8.2;
remove some dead code, simplify and wrap some long lines.
 1.7 18-Jun-2004  martin branches: 1.7.4;
Better support for booting from partitions != a or at the start of the
disk, allow commands like "boot disk:d disk:d/netbsd" to work.
Use the real RF_PROTECTED_SECTORS define instead of a local magic number.
While there, minor cosmetics in diagnostics/output format.
 1.6 04-Dec-2003  keihan netbsd.org -> NetBSD.org

All "netbsd.org" is now gone from src/sys/arch.
 1.5 20-Oct-2002  martin branches: 1.5.6;
Allow hyphen in kernel names. Bump version.
Should fix PR 13429 and PR 18691.
 1.4 06-Jun-2002  martin Follow changes in libsa/stand.h: exit(void) -> exit(int) (one in a #if
0 block), to make it compile again.
 1.3 31-May-2001  mrg branches: 1.3.2; 1.3.8; 1.3.16; 1.3.18;
drop to prom on "halt" as well.
 1.2 24-Sep-2000  jdolecek branches: 1.2.2; 1.2.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.1 20-Aug-2000  mrg branches: 1.1.2;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file boot.c was added on branch netbsd-1-5 on 2000-08-26 00:05:16 +0000
 1.2.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 24-Sep-2000  bouyer file boot.c was added on branch thorpej_scsipi on 2000-11-20 20:25:50 +0000
 1.3.18.1 06-May-2004  jmc Pullup rev 1.5 (requested by martin in ticket #1684)

Allow hyphen in kernel names.
When calculating the allocated symbol table size, round up the section
sizes with ELF_ALIGN(). PR#13429 PR#18691 PR#25429
 1.3.16.1 15-Jul-2002  gehenna catch up with -current.
 1.3.8.3 11-Nov-2002  nathanw Catch up to -current
 1.3.8.2 20-Jun-2002  nathanw Catch up to -current.
 1.3.8.1 31-May-2001  nathanw file boot.c was added on branch nathanw_sa on 2002-06-20 03:41:16 +0000
 1.3.2.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.6.5 15-Feb-2005  skrll Sync with HEAD.
 1.5.6.4 17-Jan-2005  skrll Sync with HEAD.
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.8.2.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.6.4 27-Oct-2007  yamt sync with head.
 1.9.6.3 03-Sep-2007  yamt sync with head.
 1.9.6.2 30-Dec-2006  yamt sync with head.
 1.9.6.1 21-Jun-2006  yamt sync with head.
 1.10.2.1 01-Feb-2006  yamt sync with head.
 1.12.6.1 11-Aug-2006  yamt sync with head
 1.12.2.1 09-Sep-2006  rpaulo sync with head
 1.13.22.2 03-Oct-2007  garbled Sync with HEAD
 1.13.22.1 26-Jun-2007  garbled Sync with HEAD.
 1.13.16.1 11-Jul-2007  mjf Sync with head.
 1.13.14.2 09-Oct-2007  ad Sync with head.
 1.13.14.1 09-Jun-2007  ad Sync with head.
 1.14.10.1 06-Nov-2007  matt sync with HEAD
 1.14.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.18.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.18.20.4 09-Oct-2010  yamt sync with head
 1.18.20.3 11-Aug-2010  yamt sync with head.
 1.18.20.2 11-Mar-2010  yamt sync with head
 1.18.20.1 04-May-2009  yamt sync with head.
 1.21.4.3 31-May-2011  rmind sync with head
 1.21.4.2 05-Mar-2011  rmind sync with head
 1.21.4.1 30-May-2010  rmind sync with head
 1.21.2.3 09-Nov-2010  uebayasi Sync with HEAD.
 1.21.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.21.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.26.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.26.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.28.10.1 05-Jun-2012  jdc Pull up revisions:
src/sys/arch/sparc/include/bootinfo.h revision 1.6
src/sys/arch/sparc/sparc/autoconf.c revision 1.243
src/sys/arch/sparc/stand/boot/boot.c revision 1.28
src/sys/arch/sparc/stand/ofwboot/boot.c revision 1.29
src/sys/arch/sparc64/include/bootinfo.h revision 1.6-1.7
src/sys/arch/sparc64/sparc64/autoconf.c revision 1.186
(requested by martin in ticket #289).

Pass the "boothowto" from the bootloader to the kernel.
If (an old) bootloader did not pass the flags, check explicitly if we
missed RB_USERCONF and invoke userconf_prompt() in MD code, as MI code
already missed it.
This fixes PR 46466.

Ooops, remove definitions duplicated in <sparc/bootinfo.h>
 1.28.8.1 02-Jun-2012  mrg sync to latest -current.
 1.28.4.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.28.4.1 30-Oct-2012  yamt sync with head
 1.29.4.1 18-May-2014  rmind sync with head
 1.29.2.2 03-Dec-2017  jdolecek update from HEAD
 1.29.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.2.1 10-Aug-2014  tls Rebase.
 1.31.4.2 05-Oct-2016  skrll Sync with HEAD
 1.31.4.1 09-Jul-2016  skrll Sync with HEAD
 1.11 15-Sep-2017  martin Add more details about the boot device as a new bootinfo record type.
From within the bootloader, when we have readily accessible instance
handles of the boot device, it is easy to query more details like SCSI
LUN, target, and FC-AL wwn from the firmware.
The kernel later would have a hard time getting theses, but can make good
use to match the boot device.
 1.10 20-Feb-2014  joerg Add prototype for main.
 1.9 01-Jun-2011  tsutsui branches: 1.9.4; 1.9.14; 1.9.18;
- remove extern from function declarations
- some KNF
 1.8 19-May-2011  hauke Fix a tyop.
The intentions were good...
 1.7 19-May-2011  christos handle prototype for freeall
 1.6 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.5 28-Apr-2008  martin branches: 1.5.22; 1.5.28; 1.5.30;
Remove clause 3 and 4 from TNF licenses
 1.4 17-Oct-2007  garbled branches: 1.4.16; 1.4.18; 1.4.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.3 16-Sep-2007  martin Change "Boot:" prompt option parsing to be more in line with the default
(no prompt) behaviour - it is now possible to "boot net:dhcp -a" and then
say "disk" at the "Boot:" prompt - result should be equivalent to "boot disk",
but the ofwboot was loaded from the network.
While there fix a few minor errors, and one significant: if the "a" partition
should not start at the beginning of the disk, the previous code failed
to read a disklabel. Use the "c" partition now to find the disklabel now
always.
 1.2 05-Jun-2007  martin branches: 1.2.8; 1.2.10;
Use the new loadfile() marker MARK_DATA to optimize the loaded kernel
mappings before calling the entry point - change text mappings to read
only and only insert those into the iTLB.
While there remove a few magic constants by information queried from
the firmware.
 1.1 27-Jan-2006  cdi branches: 1.1.4; 1.1.18; 1.1.32; 1.1.34; 1.1.40;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.1.40.2 03-Oct-2007  garbled Sync with HEAD
 1.1.40.1 26-Jun-2007  garbled Sync with HEAD.
 1.1.34.1 11-Jul-2007  mjf Sync with head.
 1.1.32.2 09-Oct-2007  ad Sync with head.
 1.1.32.1 09-Jun-2007  ad Sync with head.
 1.1.18.4 27-Oct-2007  yamt sync with head.
 1.1.18.3 03-Sep-2007  yamt sync with head.
 1.1.18.2 21-Jun-2006  yamt sync with head.
 1.1.18.1 27-Jan-2006  yamt file boot.h was added on branch yamt-lazymbuf on 2006-06-21 14:56:40 +0000
 1.1.4.2 01-Feb-2006  yamt sync with head.
 1.1.4.1 27-Jan-2006  yamt file boot.h was added on branch yamt-uio_vmspace on 2006-02-01 14:51:37 +0000
 1.2.10.1 06-Nov-2007  matt sync with HEAD
 1.2.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.4.20.1 16-May-2008  yamt sync with head.
 1.4.18.1 18-May-2008  yamt sync with head.
 1.4.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.5.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.22.3 12-Jun-2011  rmind sync with head
 1.5.22.2 31-May-2011  rmind sync with head
 1.5.22.1 05-Mar-2011  rmind sync with head
 1.9.18.1 18-May-2014  rmind sync with head
 1.9.14.2 03-Dec-2017  jdolecek update from HEAD
 1.9.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 13-Jul-2006  uwe branches: 1.2.58; 1.2.60; 1.2.62;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.1 27-Jan-2006  cdi branches: 1.1.2; 1.1.4; 1.1.8; 1.1.18;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.1.18.3 30-Dec-2006  yamt sync with head.
 1.1.18.2 21-Jun-2006  yamt sync with head.
 1.1.18.1 27-Jan-2006  yamt file bootinfo.c was added on branch yamt-lazymbuf on 2006-06-21 14:56:40 +0000
 1.1.8.1 11-Aug-2006  yamt sync with head
 1.1.4.2 01-Feb-2006  yamt sync with head.
 1.1.4.1 27-Jan-2006  yamt file bootinfo.c was added on branch yamt-uio_vmspace on 2006-02-01 14:51:37 +0000
 1.1.2.1 09-Sep-2006  rpaulo sync with head
 1.2.62.1 16-May-2008  yamt sync with head.
 1.2.60.1 18-May-2008  yamt sync with head.
 1.2.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.9 27-Jan-2006  cdi Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.8 25-Jan-2006  christos free -> dealloc
unsigned -> size_t for alloc/dealloc
 1.7 11-Dec-2005  christos branches: 1.7.2;
merge ktrace-lwp.
 1.6 18-Jan-2005  he branches: 1.6.8;
Remove extraneous parenthesis, so that this compiles again.
 1.5 16-Jan-2005  chs remove some dead code, simplify and wrap some long lines.
 1.4 02-May-2004  martin branches: 1.4.4;
When calculating the allocated symbol table size, round up the section
sizes with ELF_ALIGN().
Fixes PR port-sparc64/25429.
 1.3 30-Aug-2001  eeh branches: 1.3.6; 1.3.16; 1.3.22; 1.3.24;
Handle kernels with data+BSS segments larger than 4MB.
 1.2 15-Aug-2001  eeh Make the loader extend the data+BSS segment to 4MB so we don't need to
shuffle it around in pmap_bootstrap().
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.8;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.8.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.8.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file elfXX_exec.c was added on branch thorpej_scsipi on 2000-11-20 20:25:50 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file elfXX_exec.c was added on branch netbsd-1-5 on 2000-08-26 00:05:16 +0000
 1.3.24.1 06-May-2004  jmc Pullup rev 1.4 (requested by martin in ticket #248)

When calculating the allocated symbol table size, round up the section
sizes with ELF_ALIGN(). PR#25429
 1.3.22.5 24-Jan-2005  skrll Sync with HEAD.
 1.3.22.4 17-Jan-2005  skrll Sync with HEAD.
 1.3.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.22.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.1 06-May-2004  jmc Pullup rev 1.4 (requested by martin in ticket #1684)

Allow hyphen in kernel names.
When calculating the allocated symbol table size, round up the section
sizes with ELF_ALIGN(). PR#13429 PR#18691 PR#25429
 1.3.6.2 30-Aug-2001  eeh Handle kernels with data+BSS segments larger than 4MB.
 1.3.6.1 30-Aug-2001  eeh file elfXX_exec.c was added on branch nathanw_sa on 2001-08-30 23:00:20 +0000
 1.4.4.1 29-Apr-2005  kent sync with -current
 1.6.8.1 21-Jun-2006  yamt sync with head.
 1.7.2.1 01-Feb-2006  yamt sync with head.
 1.17 29-Apr-2022  rin Fix fallout from libsa change; stand.h includes <sys/param.h> now.

- Stop redefining roundup2().
- Compare kvamap->start (uint64_t) with 0 instead of NULL.
- Include <sys/param.h> explicitly.

Thanks gson@ for notification.
 1.16 04-Nov-2016  macallan fix remaining *_TSB_DATA() uses
 1.15 15-Aug-2016  maxv Uninitialized var, found by brainy; not tested, but obvious enough
 1.14 14-Jun-2015  martin branches: 1.14.2;
Fix available length calculation in kvamap_extract when reusing existing
mappings.
 1.13 21-Apr-2014  palle branches: 1.13.2; 1.13.4;
sun4v: Update TTE data in sparc64_finalize_tlb_sun4v() - sun4v has no L (locked) bit + ensure that the ITLB has the EP (executable) bit set
 1.12 21-Feb-2014  palle branches: 1.12.2;
sun4v: Rename TLB_ defines to SUN4U_TLB_ so entries created using TSB_DATA() are properly setup for sun4u and sun4v. Relocate the cputyp variable from autoconf.c to locore.s and make it const in param.h so optimized code can be generated. Parts from OpenBSD. Optimization suggested by nakayama@. OK martin@, mrg@, nakayama@
 1.11 08-Dec-2013  palle Add support for running ofwboot on sun4v. Please note that the kernel on sun4v will be loaded properly but when the kernel takes over it will crash immediately since the kernel is not sun4v ready yet
 1.10 21-May-2011  nakayama branches: 1.10.4; 1.10.14; 1.10.18;
Fix debug build.
 1.9 21-May-2011  tsutsui WARNSfy and fix dumb bugs noticed by warnings.
 1.8 20-May-2011  he Put the external functions from net.c in it's own header file and
include it, and do some other minimal adjustments to bring this
back to a buildable state.

OK'ed by martin@
 1.7 18-May-2009  nakayama branches: 1.7.4; 1.7.6;
Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.6 25-Aug-2008  martin branches: 1.6.4; 1.6.14; 1.6.18;
Deal with kernels that have a combined text/data segment. Output a big
warning when booting them.
 1.5 28-Apr-2008  martin branches: 1.5.2; 1.5.6;
Remove clause 3 and 4 from TNF licenses
 1.4 17-Oct-2007  garbled branches: 1.4.16; 1.4.18; 1.4.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.3 05-Jun-2007  martin branches: 1.3.10;
Use the new loadfile() marker MARK_DATA to optimize the loaded kernel
mappings before calling the entry point - change text mappings to read
only and only insert those into the iTLB.
While there remove a few magic constants by information queried from
the firmware.
 1.2 04-Mar-2006  uwe branches: 1.2.12; 1.2.26; 1.2.28; 1.2.34;
s/u_intN_t/uintN_t/
 1.1 27-Jan-2006  cdi branches: 1.1.2; 1.1.4; 1.1.6;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.1.6.1 22-Apr-2006  simonb Sync with head.
 1.1.4.2 01-Feb-2006  yamt sync with head.
 1.1.4.1 27-Jan-2006  yamt file loadfile_machdep.c was added on branch yamt-uio_vmspace on 2006-02-01 14:51:37 +0000
 1.1.2.1 09-Sep-2006  rpaulo sync with head
 1.2.34.1 26-Jun-2007  garbled Sync with HEAD.
 1.2.28.1 11-Jul-2007  mjf Sync with head.
 1.2.26.1 09-Jun-2007  ad Sync with head.
 1.2.12.3 03-Sep-2007  yamt sync with head.
 1.2.12.2 21-Jun-2006  yamt sync with head.
 1.2.12.1 04-Mar-2006  yamt file loadfile_machdep.c was added on branch yamt-lazymbuf on 2006-06-21 14:56:40 +0000
 1.3.10.1 06-Nov-2007  matt sync with HEAD
 1.4.20.3 20-Jun-2009  yamt sync with head
 1.4.20.2 04-May-2009  yamt sync with head.
 1.4.20.1 16-May-2008  yamt sync with head.
 1.4.18.1 18-May-2008  yamt sync with head.
 1.4.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.4.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.6.1 19-Oct-2008  haad Sync with HEAD.
 1.5.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.6.18.1 26-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.6.14.1 26-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.6.4.1 19-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.7.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.4.1 31-May-2011  rmind sync with head
 1.10.18.1 18-May-2014  rmind sync with head
 1.10.14.2 03-Dec-2017  jdolecek update from HEAD
 1.10.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.4.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.2.1 10-Aug-2014  tls Rebase.
 1.13.4.3 05-Dec-2016  skrll Sync with HEAD
 1.13.4.2 05-Oct-2016  skrll Sync with HEAD
 1.13.4.1 22-Sep-2015  skrll Sync with HEAD
 1.13.2.1 20-Jul-2015  snj Pull up following revision(s) (requested by martin in ticket #842):
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c: revision 1.14
sys/arch/sparc/stand/ofwboot/version: revision 1.21
sys/arch/sparc64/include/cpu.h: revision 1.115
sys/arch/sparc64/sparc64/autoconf.c: revision 1.203
sys/arch/sparc64/sparc64/mp_subr.S: revision 1.9 via patch
sys/arch/sparc64/sparc64/pmap.c: revisions 1.295, 1.295 via patch
Fix available length calculation in kvamap_extract when reusing existing
mappings.
--
Bump version now that we can load kernels with sizeof(.data)+sizeof(.bss)> 4 MB
--
Do not hardcode the assumption that .data and .bss fit together in a single
4 MB page. This allows booting kernels with options USB_DEBUG again.
--
Slightly optimize the ITLB usage on secondary processors
 1.14.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.6 01-Jun-2011  tsutsui Remove unused header.
 1.5 13-Jul-2006  uwe branches: 1.5.84; 1.5.90;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.4 04-Mar-2006  uwe branches: 1.4.2;
s/u_intN_t/uintN_t/
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.6;
merge ktrace-lwp.
 1.2 04-Dec-2003  keihan branches: 1.2.16;
NetBSD.ORG -> NetBSD.org

Now all "NetBSD.ORG" are gone from src/sys.
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.28;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.28.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file md5.h was added on branch thorpej_scsipi on 2000-11-20 20:25:51 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file md5.h was added on branch netbsd-1-5 on 2000-08-26 00:05:17 +0000
 1.2.16.2 30-Dec-2006  yamt sync with head.
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.3.6.1 22-Apr-2006  simonb Sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.2.1 11-Aug-2006  yamt sync with head
 1.5.90.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.84.1 12-Jun-2011  rmind sync with head
 1.10 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.9 23-Apr-2020  joerg branches: 1.9.4;
rootpath is owned by libsa
 1.8 16-Jul-2012  tsutsui branches: 1.8.50;
Fix tftpboot which was broken by my botched WARNSfy in last year.
Also add comments that mention libsa tftp requires network device socket
in f_devdata in struct open_file, from spz@ in PR port-sparc64/46652.
Briefly tested tftpboot and nfsboot on Ultra5.
 1.7 21-May-2011  tsutsui branches: 1.7.4; 1.7.10;
WARNSfy and fix dumb bugs noticed by warnings.
 1.6 21-May-2011  christos more missing includes
 1.5 07-May-2009  roy branches: 1.5.4; 1.5.6;
Make 3 attempts at bootp before trying bootparams which allows slow
bridges a chance to work.
Clear variables when changing bootp/bootparams.
Displayed variables are cleaned up so they don't overflow the right of
the screen.

ok: martin
 1.4 12-May-2008  mlelstv branches: 1.4.12;
add support for booting a kernel by tftp. Syntax is similar
to other systems, e.g.: boot net tftp:netbsd
 1.3 13-Jul-2006  uwe branches: 1.3.58; 1.3.60; 1.3.62; 1.3.64;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.2 14-May-2002  lukem branches: 1.2.26; 1.2.40; 1.2.44;
- Enable NFS_BOOT_DHCP (as well as the existing NFS_BOOT_BOOTPARAM).
DHCP/Bootp is tried before bootparams in the MI nfs mountroot code.
- Change the order in boot.net from "bootparams then bootp" to
"bootp then bootparams", to be consistent with the MI nfs mountroot code.

(Consistency with other NetBSD ports is good, and things still work
for sites that run bootparams but not dhcp/bootp, although I'd argue that
dhcp/bootp is much easier to setup and manage and is easier to debug
than our rpc.bootparamd...)

Per discussion with Paul Kranenburg and Matt Green.
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.8; 1.1.12;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.12.1 20-Jun-2002  nathanw Catch up to -current.
 1.1.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file net.c was added on branch thorpej_scsipi on 2000-11-20 20:25:51 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file net.c was added on branch netbsd-1-5 on 2000-08-26 00:05:17 +0000
 1.2.44.1 11-Aug-2006  yamt sync with head
 1.2.40.1 09-Sep-2006  rpaulo sync with head
 1.2.26.1 30-Dec-2006  yamt sync with head.
 1.3.64.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.3.62.2 16-May-2009  yamt sync with head
 1.3.62.1 16-May-2008  yamt sync with head.
 1.3.60.1 18-May-2008  yamt sync with head.
 1.3.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.5.4.1 31-May-2011  rmind sync with head
 1.7.10.1 21-Jul-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #433):
sys/arch/sparc/stand/ofwboot/net.h: revision 1.3
sys/arch/sparc/stand/ofwboot/net.c: revision 1.8
sys/arch/sparc/stand/ofwboot/ofdev.c: revision 1.33
Fix tftpboot which was broken by my botched WARNSfy in last year.
Also add comments that mention libsa tftp requires network device socket
in f_devdata in struct open_file, from spz@ in PR port-sparc64/46652.
Briefly tested tftpboot and nfsboot on Ultra5.
 1.7.4.1 30-Oct-2012  yamt sync with head
 1.8.50.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.9.4.1 17-Apr-2021  thorpej Sync with HEAD.
 1.3 16-Jul-2012  tsutsui Fix tftpboot which was broken by my botched WARNSfy in last year.
Also add comments that mention libsa tftp requires network device socket
in f_devdata in struct open_file, from spz@ in PR port-sparc64/46652.
Briefly tested tftpboot and nfsboot on Ultra5.
 1.2 21-May-2011  tsutsui branches: 1.2.2; 1.2.6; 1.2.8; 1.2.14;
WARNSfy and fix dumb bugs noticed by warnings.
 1.1 20-May-2011  he Put the external functions from net.c in it's own header file and
include it, and do some other minimal adjustments to bring this
back to a buildable state.

OK'ed by martin@
 1.2.14.1 21-Jul-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #433):
sys/arch/sparc/stand/ofwboot/net.h: revision 1.3
sys/arch/sparc/stand/ofwboot/net.c: revision 1.8
sys/arch/sparc/stand/ofwboot/ofdev.c: revision 1.33
Fix tftpboot which was broken by my botched WARNSfy in last year.
Also add comments that mention libsa tftp requires network device socket
in f_devdata in struct open_file, from spz@ in PR port-sparc64/46652.
Briefly tested tftpboot and nfsboot on Ultra5.
 1.2.8.1 30-Oct-2012  yamt sync with head
 1.2.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.2.6.1 21-May-2011  jruoho file net.h was added on branch jruoho-x86intr on 2011-06-06 09:06:48 +0000
 1.2.2.2 31-May-2011  rmind sync with head
 1.2.2.1 21-May-2011  rmind file net.h was added on branch rmind-uvmplock on 2011-05-31 03:04:18 +0000
 1.9 30-Jul-2011  jakllsch printf fixes for ifdef NETIF_DEBUG
 1.8 21-May-2011  tsutsui WARNSfy and fix dumb bugs noticed by warnings.
 1.7 18-Mar-2009  cegger branches: 1.7.4; 1.7.6;
bzero -> memset
 1.6 12-Jan-2009  tsutsui branches: 1.6.2;
Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

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

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

Per discussion on current-users.
 1.5 07-May-2008  mlelstv branches: 1.5.8;
return the length without padding.
 1.4 13-Jul-2006  uwe branches: 1.4.58; 1.4.60; 1.4.62;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.3 27-Jan-2006  cdi branches: 1.3.2; 1.3.6;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.2 13-Mar-2003  hannken branches: 1.2.18; 1.2.30;
Explicit cast for netif.

Approved by: Matthias Drochner <drochner@netbsd.org>
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file netif_of.c was added on branch thorpej_scsipi on 2000-11-20 20:25:51 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file netif_of.c was added on branch netbsd-1-5 on 2000-08-26 00:05:18 +0000
 1.2.30.1 01-Feb-2006  yamt sync with head.
 1.2.18.2 30-Dec-2006  yamt sync with head.
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.3.6.1 11-Aug-2006  yamt sync with head
 1.3.2.1 09-Sep-2006  rpaulo sync with head
 1.4.62.2 04-May-2009  yamt sync with head.
 1.4.62.1 16-May-2008  yamt sync with head.
 1.4.60.1 18-May-2008  yamt sync with head.
 1.4.58.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.5.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.6.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.4.1 31-May-2011  rmind sync with head
 1.37 15-Sep-2017  martin Add more details about the boot device as a new bootinfo record type.
From within the bootloader, when we have readily accessible instance
handles of the boot device, it is easy to query more details like SCSI
LUN, target, and FC-AL wwn from the firmware.
The kernel later would have a hard time getting theses, but can make good
use to match the boot device.
 1.36 25-Mar-2017  martin Virtio block devices may have a "scsi" device_type instead of "block",
so accept both.
 1.35 20-Feb-2014  joerg branches: 1.35.6; 1.35.10; 1.35.14;
Zero the block on failure, not just the first pointer in it.
 1.34 16-Apr-2013  martin branches: 1.34.4;
Make a "panic" message slightly more verbose
 1.33 16-Jul-2012  tsutsui branches: 1.33.2;
Fix tftpboot which was broken by my botched WARNSfy in last year.
Also add comments that mention libsa tftp requires network device socket
in f_devdata in struct open_file, from spz@ in PR port-sparc64/46652.
Briefly tested tftpboot and nfsboot on Ultra5.
 1.32 01-Jun-2011  tsutsui branches: 1.32.4; 1.32.10;
Fix harmless merge botch.
 1.31 21-May-2011  nakayama Fix debug build.
 1.30 21-May-2011  tsutsui WARNSfy and fix dumb bugs noticed by warnings.
 1.29 20-May-2011  he Put the external functions from net.c in it's own header file and
include it, and do some other minimal adjustments to bring this
back to a buildable state.

OK'ed by martin@
 1.28 04-Apr-2010  martin branches: 1.28.2;
Turn a printf into a DPRINTF(), since we will very likely recover from
the condition (and it happens on stock install CDs)
 1.27 02-Apr-2010  martin Add support for /boot.cfg. Implement a single command for now: override
the boot partition, which will be used for bootable CDs. Add cd9660
support.
 1.26 17-Feb-2010  eeh branches: 1.26.2;
Add support for ffsv2 and lfs.
 1.25 27-Jan-2010  martin branches: 1.25.2;
Properly close the firmware handle before starting the kernel.
This makes netbooting via bge* work.
 1.24 26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.23 18-Mar-2009  cegger bcopy -> memcpy
 1.22 18-Mar-2009  cegger bzero -> memset
 1.21 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.20 18-May-2008  mlelstv branches: 1.20.6; 1.20.12;
put back NetBSD tag
 1.19 12-May-2008  mlelstv add support for booting a kernel by tftp. Syntax is similar
to other systems, e.g.: boot net tftp:netbsd
 1.18 17-Oct-2007  garbled branches: 1.18.16; 1.18.18; 1.18.20; 1.18.22;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.17 20-Sep-2007  martin Make filename() only return a partition if it actually found one in
the path.
 1.16 19-Sep-2007  martin Some aliases (like "cdrom") expand to a path that includes a partition -
deal with them.
 1.15 16-Sep-2007  martin Change "Boot:" prompt option parsing to be more in line with the default
(no prompt) behaviour - it is now possible to "boot net:dhcp -a" and then
say "disk" at the "Boot:" prompt - result should be equivalent to "boot disk",
but the ofwboot was loaded from the network.
While there fix a few minor errors, and one significant: if the "a" partition
should not start at the beginning of the disk, the previous code failed
to read a disklabel. Use the "c" partition now to find the disklabel now
always.
 1.14 14-Sep-2007  martin Rename the option to enable ISO 9660 file system support from ..._HSFS
to ..._CD9660.
 1.13 14-Sep-2007  martin Make sure the buffer used to read from disk is properly aligned to cast
it into a struct disklabel pointer w/o alignement problems.
(Bug did not hit by pure luck with our default optimization settings)
 1.12 13-Jul-2006  uwe branches: 1.12.14; 1.12.22; 1.12.32; 1.12.34;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.11 11-May-2006  mrg don't shadow the kernel's devsw unnecessarily.
 1.10 27-Jan-2006  cdi branches: 1.10.2; 1.10.4; 1.10.6; 1.10.8; 1.10.10;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.9 11-Dec-2005  christos branches: 1.9.2;
merge ktrace-lwp.
 1.8 23-Jun-2005  junyoung branches: 1.8.2;
Use FS_OPS() macro.
 1.7 22-Jun-2005  junyoung Remove trailing spaces.
 1.6 13-Nov-2004  grant tweak an error message.
 1.5 18-Jun-2004  martin Better support for booting from partitions != a or at the start of the
disk, allow commands like "boot disk:d disk:d/netbsd" to work.
Use the real RF_PROTECTED_SECTORS define instead of a local magic number.
While there, minor cosmetics in diagnostics/output format.
 1.4 01-Jan-2003  mrg branches: 1.4.2;
KNF.
 1.3 20-Oct-2002  martin Allow hyphen in kernel names. Bump version.
Should fix PR 13429 and PR 18691.
 1.2 29-Jul-2002  mrg bump offset by RF_PROTECTED_SECTORS if FS_RAID
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.8; 1.1.12; 1.1.20; 1.1.22;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.22.1 06-May-2004  jmc Pullup rev 1.3 (requested by martin in ticket #1684)

Allow hyphen in kernel names.
When calculating the allocated symbol table size, round up the section
sizes with ELF_ALIGN(). PR#13429 PR#18691 PR#25429
 1.1.20.1 31-Aug-2002  gehenna catch up with -current.
 1.1.12.3 03-Jan-2003  thorpej Sync with HEAD.

XXX ALT_SWITCH_CODE is not yet LWP'ified.
 1.1.12.2 11-Nov-2002  nathanw Catch up to -current
 1.1.12.1 01-Aug-2002  nathanw Catch up to -current.
 1.1.8.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file ofdev.c was added on branch thorpej_scsipi on 2000-11-20 20:25:51 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file ofdev.c was added on branch netbsd-1-5 on 2000-08-26 00:05:18 +0000
 1.4.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.4 14-Nov-2004  skrll 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.8.2.3 27-Oct-2007  yamt sync with head.
 1.8.2.2 30-Dec-2006  yamt sync with head.
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.9.2.1 01-Feb-2006  yamt sync with head.
 1.10.10.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.10.8.1 11-May-2006  elad sync with head
 1.10.6.2 11-Aug-2006  yamt sync with head
 1.10.6.1 24-May-2006  yamt sync with head.
 1.10.4.1 01-Jun-2006  kardel Sync with head.
 1.10.2.1 09-Sep-2006  rpaulo sync with head
 1.12.34.1 06-Nov-2007  matt sync with HEAD
 1.12.32.1 02-Oct-2007  joerg Sync with HEAD.
 1.12.22.1 03-Oct-2007  garbled Sync with HEAD
 1.12.14.1 09-Oct-2007  ad Sync with head.
 1.18.22.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.18.20.4 11-Aug-2010  yamt sync with head.
 1.18.20.3 11-Mar-2010  yamt sync with head
 1.18.20.2 04-May-2009  yamt sync with head.
 1.18.20.1 16-May-2008  yamt sync with head.
 1.18.18.2 04-Jun-2008  yamt sync with head
 1.18.18.1 18-May-2008  yamt sync with head.
 1.18.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.25.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.26.2.3 12-Jun-2011  rmind sync with head
 1.26.2.2 31-May-2011  rmind sync with head
 1.26.2.1 30-May-2010  rmind sync with head
 1.28.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.32.10.1 21-Jul-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #433):
sys/arch/sparc/stand/ofwboot/net.h: revision 1.3
sys/arch/sparc/stand/ofwboot/net.c: revision 1.8
sys/arch/sparc/stand/ofwboot/ofdev.c: revision 1.33
Fix tftpboot which was broken by my botched WARNSfy in last year.
Also add comments that mention libsa tftp requires network device socket
in f_devdata in struct open_file, from spz@ in PR port-sparc64/46652.
Briefly tested tftpboot and nfsboot on Ultra5.
 1.32.4.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.32.4.1 30-Oct-2012  yamt sync with head
 1.33.2.3 03-Dec-2017  jdolecek update from HEAD
 1.33.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.2.1 23-Jun-2013  tls resync from head
 1.34.4.1 18-May-2014  rmind sync with head
 1.35.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.35.10.1 26-Apr-2017  pgoyette Sync with HEAD
 1.35.6.1 28-Aug-2017  skrll Sync with HEAD
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file ofdev.h was added on branch thorpej_scsipi on 2000-11-20 20:25:51 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file ofdev.h was added on branch netbsd-1-5 on 2000-08-26 00:05:18 +0000
 1.6 15-Sep-2017  martin Add more details about the boot device as a new bootinfo record type.
From within the bootloader, when we have readily accessible instance
handles of the boot device, it is easy to query more details like SCSI
LUN, target, and FC-AL wwn from the firmware.
The kernel later would have a hard time getting theses, but can make good
use to match the boot device.
 1.5 21-May-2011  tsutsui branches: 1.5.14;
WARNSfy and fix dumb bugs noticed by warnings.
 1.4 18-May-2009  nakayama branches: 1.4.4; 1.4.6;
Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.3 13-Jul-2006  uwe branches: 1.3.62; 1.3.72; 1.3.82; 1.3.86;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.2 27-Jan-2006  cdi branches: 1.2.2; 1.2.6;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.44; 1.1.56;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.56.1 01-Feb-2006  yamt sync with head.
 1.1.44.2 30-Dec-2006  yamt sync with head.
 1.1.44.1 21-Jun-2006  yamt sync with head.
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file openfirm.h was added on branch thorpej_scsipi on 2000-11-20 20:25:51 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file openfirm.h was added on branch netbsd-1-5 on 2000-08-26 00:05:19 +0000
 1.2.6.1 11-Aug-2006  yamt sync with head
 1.2.2.1 09-Sep-2006  rpaulo sync with head
 1.3.86.1 26-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.3.82.1 26-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.3.72.1 19-Apr-2015  msaitoh Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h 1.7
sys/arch/sparc/stand/ofwboot/Locore.c 1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes. Idea from OpenBSD.
 1.3.62.1 20-Jun-2009  yamt sync with head
 1.4.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.4.1 31-May-2011  rmind sync with head
 1.5.14.1 03-Dec-2017  jdolecek update from HEAD
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 13-Jul-2006  uwe branches: 1.2.58; 1.2.60; 1.2.62;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.1 27-Jan-2006  cdi branches: 1.1.2; 1.1.4; 1.1.8; 1.1.18;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.1.18.3 30-Dec-2006  yamt sync with head.
 1.1.18.2 21-Jun-2006  yamt sync with head.
 1.1.18.1 27-Jan-2006  yamt file prf.c was added on branch yamt-lazymbuf on 2006-06-21 14:56:40 +0000
 1.1.8.1 11-Aug-2006  yamt sync with head
 1.1.4.2 01-Feb-2006  yamt sync with head.
 1.1.4.1 27-Jan-2006  yamt file prf.c was added on branch yamt-uio_vmspace on 2006-02-01 14:51:37 +0000
 1.1.2.1 09-Sep-2006  rpaulo sync with head
 1.2.62.1 16-May-2008  yamt sync with head.
 1.2.60.1 18-May-2008  yamt sync with head.
 1.2.58.1 02-Jun-2008  mjf Sync with HEAD.
 1.3 21-May-2011  tsutsui WARNSfy and fix dumb bugs noticed by warnings.
 1.2 28-Apr-2008  martin branches: 1.2.22; 1.2.28;
Remove clause 3 and 4 from TNF licenses
 1.1 27-Jan-2006  cdi branches: 1.1.4; 1.1.18; 1.1.76; 1.1.78; 1.1.80;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.1.80.1 16-May-2008  yamt sync with head.
 1.1.78.1 18-May-2008  yamt sync with head.
 1.1.76.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.18.2 21-Jun-2006  yamt sync with head.
 1.1.18.1 27-Jan-2006  yamt file promlib.c was added on branch yamt-lazymbuf on 2006-06-21 14:56:40 +0000
 1.1.4.2 01-Feb-2006  yamt sync with head.
 1.1.4.1 27-Jan-2006  yamt file promlib.c was added on branch yamt-uio_vmspace on 2006-02-01 14:51:37 +0000
 1.2.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.22.1 31-May-2011  rmind sync with head
 1.8 28-Nov-2019  martin Provide a mostly-zeroed page at the start of the text segment, to work around
an OpenBIOS bug, see PR port-sparc64/54719 for details.
 1.7 23-Aug-2015  joerg branches: 1.7.18;
Remove .proc 1, it has been ignored by gas for ages.
 1.6 17-Oct-2007  garbled branches: 1.6.64; 1.6.84;
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 05-Jun-2007  martin branches: 1.5.10;
Use the new loadfile() marker MARK_DATA to optimize the loaded kernel
mappings before calling the entry point - change text mappings to read
only and only insert those into the iTLB.
While there remove a few magic constants by information queried from
the firmware.
 1.4 04-Mar-2006  uwe branches: 1.4.24; 1.4.26; 1.4.32;
s/u_intN_t/uintN_t/
 1.3 27-Jan-2006  cdi branches: 1.3.2; 1.3.4;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.2 30-Oct-2002  petrov branches: 1.2.22; 1.2.34;
Compile with an ISO C preprocessor.
 1.1 20-Aug-2000  mrg branches: 1.1.2; 1.1.4; 1.1.12;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.12.1 11-Nov-2002  nathanw Catch up to -current
 1.1.4.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.1.4.1 20-Aug-2000  bouyer file srt0.s was added on branch thorpej_scsipi on 2000-11-20 20:25:51 +0000
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file srt0.s was added on branch netbsd-1-5 on 2000-08-26 00:05:19 +0000
 1.2.34.1 01-Feb-2006  yamt sync with head.
 1.2.22.2 03-Sep-2007  yamt sync with head.
 1.2.22.1 21-Jun-2006  yamt sync with head.
 1.3.4.1 22-Apr-2006  simonb Sync with head.
 1.3.2.1 09-Sep-2006  rpaulo sync with head
 1.4.32.1 26-Jun-2007  garbled Sync with HEAD.
 1.4.26.1 11-Jul-2007  mjf Sync with head.
 1.4.24.1 09-Jun-2007  ad Sync with head.
 1.5.10.1 06-Nov-2007  matt sync with HEAD
 1.6.84.1 22-Sep-2015  skrll Sync with HEAD
 1.6.64.1 03-Dec-2017  jdolecek update from HEAD
 1.7.18.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.23 15-Sep-2017  martin Add more details about the boot device as a new bootinfo record type.
From within the bootloader, when we have readily accessible instance
handles of the boot device, it is easy to query more details like SCSI
LUN, target, and FC-AL wwn from the firmware.
The kernel later would have a hard time getting theses, but can make good
use to match the boot device.
 1.22 25-Mar-2017  martin Bump version - virtio support added
 1.21 14-Jun-2015  martin branches: 1.21.2; 1.21.4;
Bump version now that we can load kernels with sizeof(.data)+sizeof(.bss)> 4 MB
 1.20 08-Dec-2013  palle branches: 1.20.4; 1.20.6;
Add support for running ofwboot on sun4v. Please note that the kernel on sun4v will be loaded properly but when the kernel takes over it will crash immediately since the kernel is not sun4v ready yet
 1.19 02-Apr-2010  martin branches: 1.19.8; 1.19.18; 1.19.22;
Bump version
 1.18 27-Jan-2010  martin branches: 1.18.2; 1.18.4;
Properly close the firmware handle before starting the kernel.
This makes netbooting via bge* work.
 1.17 07-May-2009  roy Make 3 attempts at bootp before trying bootparams which allows slow
bridges a chance to work.
Clear variables when changing bootp/bootparams.
Displayed variables are cleaned up so they don't overflow the right of
the screen.

ok: martin
 1.16 25-Aug-2008  martin branches: 1.16.8;
Deal with kernels that have a combined text/data segment. Output a big
warning when booting them.
 1.15 17-Oct-2007  garbled branches: 1.15.16; 1.15.20; 1.15.22; 1.15.26;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.14 29-Sep-2007  martin Enable booting from news Solaris ufs partitions.
 1.13 20-Sep-2007  martin branches: 1.13.2;
Bump version
 1.12 05-Jun-2007  martin branches: 1.12.8; 1.12.10;
Use the new loadfile() marker MARK_DATA to optimize the loaded kernel
mappings before calling the entry point - change text mappings to read
only and only insert those into the iTLB.
While there remove a few magic constants by information queried from
the firmware.
 1.11 27-Jan-2006  cdi branches: 1.11.28; 1.11.30; 1.11.36;
Alter sparc64 bootstrap:

- Map kernel with permanent 4MB pages to ease kernel's life
- Pass mappings down to the kernel as part of bootinfo structure
- Try to detect whether kernel is aware of the new boot scheme or not and
in the former case map the kernel using OpenFirmware and do not pass
bootinfo structure
- Provide -C switch to force compatibility mode if autodetection fails
- While on this, fix PR #25763: If load of default kernel fails, try one by
one those specified in compiled-in list

Much inspired by the bootloader of FreeBSD, with some imported code from there.
 1.10 11-Dec-2005  christos branches: 1.10.2;
merge ktrace-lwp.
 1.9 18-Jun-2004  martin branches: 1.9.12;
Better support for booting from partitions != a or at the start of the
disk, allow commands like "boot disk:d disk:d/netbsd" to work.
Use the real RF_PROTECTED_SECTORS define instead of a local magic number.
While there, minor cosmetics in diagnostics/output format.
 1.8 02-May-2004  martin When calculating the allocated symbol table size, round up the section
sizes with ELF_ALIGN().
Fixes PR port-sparc64/25429.
 1.7 20-Oct-2002  martin branches: 1.7.6; 1.7.8;
Allow hyphen in kernel names. Bump version.
Should fix PR 13429 and PR 18691.
 1.6 30-Aug-2001  eeh branches: 1.6.6; 1.6.16;
Handle kernels with data+BSS segments larger than 4MB.
 1.5 16-Aug-2001  eeh Bump version.
 1.4 02-Aug-2001  bjh21 Undo version bump. The sparc ofwboot doesn't use loadfile().
 1.3 02-Aug-2001  bjh21 Bump version numbers of all bootloaders that use loadfile/ELF, to account for
my changes to symbol loading. I should probably have done this at the time,
but it's better late than never.
 1.2 24-Sep-2000  jdolecek branches: 1.2.2; 1.2.6;
note support for verbose/quiet boot (-v, -q flags)
 1.1 20-Aug-2000  mrg branches: 1.1.2;
move ofwboot & bootblk here; add a Makefile to build ofwboot.net
 1.1.2.2 26-Aug-2000  mrg move these from arch/sparc64/stand; approved by thorpej.
 1.1.2.1 20-Aug-2000  mrg file version was added on branch netbsd-1-5 on 2000-08-26 00:05:20 +0000
 1.2.6.3 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.6.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.2.6.1 03-Aug-2001  lukem update to -current
 1.2.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.2.2.1 24-Sep-2000  bouyer file version was added on branch thorpej_scsipi on 2000-11-20 20:25:51 +0000
 1.6.16.1 06-May-2004  jmc Pullup rev 1.7-1-8 (requested by martin in ticket #1684)

Allow hyphen in kernel names.
When calculating the allocated symbol table size, round up the section
sizes with ELF_ALIGN(). PR#13429 PR#18691 PR#25429
 1.6.6.2 11-Nov-2002  nathanw Catch up to -current
 1.6.6.1 30-Aug-2001  nathanw file version was added on branch nathanw_sa on 2002-11-11 22:04:40 +0000
 1.7.8.1 06-May-2004  jmc Pullup rev 1.8 (requested by martin in ticket #248)

When calculating the allocated symbol table size, round up the section
sizes with ELF_ALIGN(). PR#25429
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.12.3 27-Oct-2007  yamt sync with head.
 1.9.12.2 03-Sep-2007  yamt sync with head.
 1.9.12.1 21-Jun-2006  yamt sync with head.
 1.10.2.1 01-Feb-2006  yamt sync with head.
 1.11.36.2 03-Oct-2007  garbled Sync with HEAD
 1.11.36.1 26-Jun-2007  garbled Sync with HEAD.
 1.11.30.1 11-Jul-2007  mjf Sync with head.
 1.11.28.2 09-Oct-2007  ad Sync with head.
 1.11.28.1 09-Jun-2007  ad Sync with head.
 1.12.10.1 06-Nov-2007  matt sync with HEAD
 1.12.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.13.2.1 06-Oct-2007  yamt sync with head.
 1.15.26.1 19-Oct-2008  haad Sync with HEAD.
 1.15.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.15.20.4 11-Aug-2010  yamt sync with head.
 1.15.20.3 11-Mar-2010  yamt sync with head
 1.15.20.2 16-May-2009  yamt sync with head
 1.15.20.1 04-May-2009  yamt sync with head.
 1.15.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.16.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.4.1 30-May-2010  rmind sync with head
 1.18.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.19.22.1 18-May-2014  rmind sync with head
 1.19.18.2 03-Dec-2017  jdolecek update from HEAD
 1.19.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.20.6.2 28-Aug-2017  skrll Sync with HEAD
 1.20.6.1 22-Sep-2015  skrll Sync with HEAD
 1.20.4.1 20-Jul-2015  snj Pull up following revision(s) (requested by martin in ticket #842):
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c: revision 1.14
sys/arch/sparc/stand/ofwboot/version: revision 1.21
sys/arch/sparc64/include/cpu.h: revision 1.115
sys/arch/sparc64/sparc64/autoconf.c: revision 1.203
sys/arch/sparc64/sparc64/mp_subr.S: revision 1.9 via patch
sys/arch/sparc64/sparc64/pmap.c: revisions 1.295, 1.295 via patch
Fix available length calculation in kvamap_extract when reusing existing
mappings.
--
Bump version now that we can load kernels with sizeof(.data)+sizeof(.bss)> 4 MB
--
Do not hardcode the assumption that .data and .bss fit together in a single
4 MB page. This allows booting kernels with options USB_DEBUG again.
--
Slightly optimize the ITLB usage on secondary processors
 1.21.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.21.2.1 26-Apr-2017  pgoyette Sync with HEAD

RSS XML Feed