Home | History | Annotate | only in /src/sys/arch/sparc/stand/ofwboot
History log of /src/sys/arch/sparc/stand/ofwboot
RevisionDateAuthorComments
 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