Home | History | Annotate | only in /src/sys/arch/hppa/include
History log of /src/sys/arch/hppa/include
RevisionDateAuthorComments
 1.16 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.15 04-Nov-2024  christos Undo previous lwp.h change.
 1.14 03-Nov-2024  christos Split __lwp_getprivate_fast and __lwp_*tcb from mcontext.h into a separate
lwp.h file.
 1.13 12-Jul-2018  maxv branches: 1.13.36;
Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

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

* Removes the PMC code of ARM XSCALE.

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

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

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

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.12 27-Dec-2014  martin branches: 1.12.16; 1.12.18;
fenv(3) support for hppa
 1.11 24-Feb-2014  skrll branches: 1.11.4; 1.11.6;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.10 17-Jul-2011  joerg branches: 1.10.2; 1.10.12; 1.10.16;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.9 09-Feb-2007  ad Merge newlock2 to head.
 1.8 06-Feb-2007  skrll G/C hp{pa,700}/spinlock.h
 1.7 26-Jul-2006  drochner branches: 1.7.4;
don't install <machine/db_machdep.h>, this is kernel only
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8;
merge ktrace-lwp.
 1.5 08-May-2004  kleink branches: 1.5.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.4 20-Sep-2003  matt Install <hppa/mcontext.h>
 1.3 26-Nov-2002  lukem branches: 1.3.6;
Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more.
 1.2 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.3 31-Aug-2002  gehenna catch up with -current.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file Makefile was added on branch gehenna-devsw on 2002-07-14 17:47:16 +0000
 1.1.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file Makefile was added on branch kqueue on 2002-06-23 17:37:06 +0000
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.5.12.2 26-Feb-2007  yamt sync with head.
 1.5.12.1 30-Dec-2006  yamt sync with head.
 1.6.8.1 11-Aug-2006  yamt sync with head
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.7.4.2 09-Feb-2007  ad Sync with HEAD.
 1.7.4.1 29-Jan-2007  ad Make hp700 compile.
 1.10.16.1 18-May-2014  rmind sync with head
 1.10.12.2 03-Dec-2017  jdolecek update from HEAD
 1.10.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.11.6.1 06-Apr-2015  skrll Sync with HEAD
 1.11.4.1 20-Jan-2015  snj Pull up following revision(s) (requested by martin in ticket #416):
distrib/sets/lists/comp/md.hppa: revision 1.3
include/fenv.h: revision 1.13 via patch
lib/libm/Makefile: revision 1.168
lib/libm/arch/hppa/fenv.c: revisions 1.1, 1.2
sys/arch/hppa/include/Makefile: revision 1.12
sys/arch/hppa/include/fenv.h: revisions 1.1, 1.2
sys/arch/hppa/include/ieeefp.h: revisions 1.5-1.7
tests/lib/libm/Makefile: revision 1.29 via patch
fenv(3) support for hppa
--
use unsigned over uint32_t so that this file works without stdint.h
being included before hand.
fixes mknative-gcc problems, and likely others.
--
Properly separate fenv.h and ieeefp.h by moving all fenv defines
over to the former.
Now that they are decoupled, make rounding modes match the hardware bits.
--
Simplify, now that rounding mode defines match the hardware bits.
 1.12.18.1 10-Jun-2019  christos Sync with HEAD
 1.12.16.1 28-Jul-2018  pgoyette Sync with HEAD
 1.13.36.1 02-Aug-2025  perseant Sync with HEAD
 1.15 07-May-2019  kamil Switch all users (except ia64) of custom machine/ansi.h to common_ansi.h

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

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

Proposed and discussed on a mailing list (twice).

Itanium uses custom !ELF fallback switch, temporarily leave it as it is.
 1.14 17-Jun-2015  martin branches: 1.14.18;
Make clock_t unsigned int everywhere.
Ok: matt@, mrg@
 1.13 17-Jul-2011  joerg branches: 1.13.12; 1.13.28; 1.13.30;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.12 27-Mar-2010  tnozaki 1. {wctype,wctrans,mbstate}_t: switch MD to MI like other
libc implementation (such as *BSD and glibc2).

2. don't typedef void * wc{type,trans}_t, suggested by soda@-san.
it may pass through compiler type check, it's harmful.
so i introduce dummy struct __tag_wc{type,trans}_t(iconv_t already does).

no ABI change was made.
 1.11 11-Jan-2009  christos branches: 1.11.4; 1.11.6;
merge christos-time_t
 1.10 22-Mar-2008  simonb branches: 1.10.2; 1.10.6; 1.10.14;
Remove unused _BSD_OFF_T_.
 1.9 17-Oct-2007  garbled branches: 1.9.16;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.8 03-Sep-2007  drochner clean up some definitions around rune_t which are not needed anymore
 1.7 04-Oct-2006  tnozaki branches: 1.7.8; 1.7.16; 1.7.22; 1.7.26; 1.7.28;
fix gcc -Werror -Wmissing-braces problem
mbstate_t(this is opaque object)'s initializer should be ``{ 0 }'',
so changed 1st field of union from character array to integer.
 1.6 11-Dec-2005  christos branches: 1.6.20; 1.6.22;
merge ktrace-lwp.
 1.5 04-Feb-2005  skrll branches: 1.5.6;
Modernise these to use GCC __builtin_* functions and types.

Also provide a (protected) va_copy.
 1.4 06-Oct-2003  matt branches: 1.4.8; 1.4.10;
Change headers to comply with the new toolchain changes.
 1.3 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 02-Mar-2003  tshiozak branches: 1.2.2;
add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file ansi.h was added on branch gehenna-devsw on 2002-07-14 17:47:17 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file ansi.h was added on branch kqueue on 2002-06-23 17:37:06 +0000
 1.2.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.10.1 12-Feb-2005  yamt sync with head.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.6.3 24-Mar-2008  yamt sync with head.
 1.5.6.2 27-Oct-2007  yamt sync with head.
 1.5.6.1 30-Dec-2006  yamt sync with head.
 1.6.22.1 22-Oct-2006  yamt sync with head
 1.6.20.1 18-Nov-2006  ad Sync with head.
 1.7.28.1 06-Nov-2007  matt sync with HEAD
 1.7.26.1 02-Oct-2007  joerg Sync with HEAD.
 1.7.22.1 10-Sep-2007  skrll Sync with HEAD.
 1.7.16.1 03-Oct-2007  garbled Sync with HEAD
 1.7.8.1 09-Oct-2007  ad Sync with head.
 1.9.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.9.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.14.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.6.2 11-Aug-2010  yamt sync with head.
 1.10.6.1 04-May-2009  yamt sync with head.
 1.10.2.2 30-Mar-2008  christos time_t is now __int64_t
 1.10.2.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.11.6.1 30-May-2010  rmind sync with head
 1.11.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.13.30.1 22-Sep-2015  skrll Sync with HEAD
 1.13.28.1 16-Jul-2015  riz Pull up following revision(s) (requested by martin in ticket #846):
sys/arch/mips/include/ansi.h: revision 1.29
sys/arch/sh3/include/ansi.h: revision 1.16
sys/arch/sparc64/include/ansi.h: revision 1.18
sys/arch/m68k/include/ansi.h: revision 1.24
sys/arch/powerpc/include/ansi.h: revision 1.30
sys/arch/hppa/include/ansi.h: revision 1.14
sys/arch/i386/include/ansi.h: revision 1.27
sys/arch/alpha/include/ansi.h: revision 1.25
sys/arch/usermode/include/ansi.h: revision 1.5
sys/arch/sparc/include/ansi.h: revision 1.24
Make _BSD_CLOCK_T_ unsigned int so it's the same for IPL32 and LP64
environments. We don't really have a powerpc64 native userland
and the mips64 native userland is IPL32 so this shouldn't affect anything.
Make clock_t unsigned
Make clock_t unsigned int everywhere.
Ok: matt@, mrg@
 1.13.12.1 03-Dec-2017  jdolecek update from HEAD
 1.14.18.1 10-Jun-2019  christos Sync with HEAD
 1.3 16-Apr-2019  skrll Trailing whitespace
 1.2 10-Dec-2002  thorpej branches: 1.2.198;
Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file aout_machdep.h was added on branch gehenna-devsw on 2002-07-14 17:47:17 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file aout_machdep.h was added on branch kqueue on 2002-06-23 17:37:07 +0000
 1.2.198.1 10-Jun-2019  christos Sync with HEAD
 1.20 06-Jan-2025  martin PR 58960: fix misunderstanding in semantic and provide both the original
id string as well as _NETBSD_REVISIONID.
Do not rely on string concatenation in the inline assembler, use .ascii
and .asciz for individual string parts instead.
 1.19 04-Jan-2025  skrll PR 58960: hppa/asm.h: Respect _NETBSD_REVISIONID.
 1.18 01-Jun-2022  skrll branches: 1.18.10;
delay slot indentation
 1.17 17-Apr-2020  joerg Mark the .ident section as mergable string section to avoid redundant
entries.
 1.16 16-Apr-2019  skrll branches: 1.16.10;
Trailing whitespace
 1.15 12-Sep-2013  joerg branches: 1.15.30;
Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
 1.14 13-Jul-2013  skrll Put some common entry stuff into _ENTRY and use it.
 1.13 12-Feb-2011  matt branches: 1.13.4; 1.13.14; 1.13.18;
Put RCSIDs in section .ident. (use .pushsection/.popsection)
 1.12 20-Dec-2010  joerg branches: 1.12.2; 1.12.4;
Consistently use .gnu.warning with .pushsectio and .popsection on all
architectures instead of obsolete STABS frames for linker warnings.
 1.11 08-Mar-2010  skrll branches: 1.11.2;
Fix and use the BSS macro.
 1.10 11-Aug-2008  skrll branches: 1.10.14;
Define _ASM_LS_CHAR as '!' on hppa.
 1.9 02-Dec-2007  skrll branches: 1.9.14; 1.9.18; 1.9.20; 1.9.24;
Provide a _C_LABEL
 1.8 12-Nov-2007  skrll Fix kernel profiling on HPPA.

- stop gcc emitting stuff that HPUX requires
- don't use splhigh() in MCOUNT_ENTER as a call to _mcount will be
generated at the moment. Disable interrupts in hardware instead.
- Fix _PROF_PROLOGUE to save/restore all the register args when calling
_mcount.
- Fixup LEAF_ENTRY to dtrt (I think) in the GPROF case.
- Provide LEAF_ENTRY_NOPROFILE and sprinkle its use where i) profiling
causes problems, e.g. trap handlers, and ii) where it just doesn't
make sense, e.g. start.
 1.7 07-Apr-2007  skrll branches: 1.7.12; 1.7.14; 1.7.18; 1.7.20;
Improve EXIT and add a BSS macro. From OpenBSD.

Implement WARN_REFERENCES.
 1.6 20-Jan-2006  christos branches: 1.6.24; 1.6.28; 1.6.30;
Add a STRONG_ALIAS macro
 1.5 11-Dec-2005  christos branches: 1.5.2;
merge ktrace-lwp.
 1.4 18-Jul-2004  chs branches: 1.4.12;
add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.3 06-Oct-2003  matt Change headers to comply with the new toolchain changes.
 1.2 04-Jul-2002  thorpej branches: 1.2.2; 1.2.8;
Add ENTRY_NOPROFILE().
 1.1 05-Jun-2002  fredette branches: 1.1.2;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file asm.h was added on branch kqueue on 2002-06-23 17:37:07 +0000
 1.2.8.1 03-Aug-2004  skrll Sync with HEAD
 1.2.2.3 16-Jul-2002  gehenna catch up with -current.
 1.2.2.2 14-Jul-2002  gehenna catch up with -current.
 1.2.2.1 04-Jul-2002  gehenna file asm.h was added on branch gehenna-devsw on 2002-07-14 17:47:17 +0000
 1.4.12.4 07-Dec-2007  yamt sync with head
 1.4.12.3 15-Nov-2007  yamt sync with head.
 1.4.12.2 03-Sep-2007  yamt sync with head.
 1.4.12.1 21-Jun-2006  yamt sync with head.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.30.1 11-Jul-2007  mjf Sync with head.
 1.6.28.3 03-Dec-2007  ad Sync with HEAD.
 1.6.28.2 03-Dec-2007  ad Sync with HEAD.
 1.6.28.1 10-Apr-2007  ad Sync with head.
 1.6.24.1 15-Apr-2007  yamt sync with head.
 1.7.20.2 08-Dec-2007  mjf Sync with HEAD.
 1.7.20.1 19-Nov-2007  mjf Sync with HEAD.
 1.7.18.1 13-Nov-2007  bouyer Sync with HEAD
 1.7.14.1 09-Jan-2008  matt sync with HEAD
 1.7.12.2 03-Dec-2007  joerg Sync with HEAD.
 1.7.12.1 14-Nov-2007  joerg Sync with HEAD.
 1.9.24.1 19-Oct-2008  haad Sync with HEAD.
 1.9.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.9.18.2 11-Mar-2010  yamt sync with head
 1.9.18.1 04-May-2009  yamt sync with head.
 1.9.14.1 28-Sep-2008  mjf Sync with HEAD.
 1.10.14.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.11.2.1 05-Mar-2011  rmind sync with head
 1.12.4.1 17-Feb-2011  bouyer Sync with HEAD
 1.12.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.18.2 18-May-2014  rmind sync with head
 1.13.18.1 28-Aug-2013  rmind sync with head
 1.13.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.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.15.30.2 21-Apr-2020  martin Sync with HEAD
 1.15.30.1 10-Jun-2019  christos Sync with HEAD
 1.16.10.1 20-Apr-2020  bouyer Sync with HEAD
 1.18.10.1 02-Aug-2025  perseant Sync with HEAD
 1.2 16-Jun-2017  jdolecek dumpconf(void) long doesn't exist, remove the prototype

PR kern/39714 by Henning Petersen
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10; 1.1.12;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.12.1 28-Aug-2017  skrll Sync with HEAD
 1.1.10.3 03-Dec-2017  jdolecek update from HEAD
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file autoconf.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file autoconf.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file autoconf.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file bootinfo.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file bootinfo.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file bootinfo.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.2 31-Jan-2006  dsl Change sys/arch/xxx/include/bswap.h to #include machine/byte_swap.h then
sys/bswap.h in order to pick up the MD inline routines and the constant
folding definitions in the right order.
Code can include either sys/bswap.h or machine/bswap.h with the same effect.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.26; 1.1.38;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.38.1 01-Feb-2006  yamt sync with head.
 1.1.26.1 21-Jun-2006  yamt sync with head.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file bswap.h was added on branch gehenna-devsw on 2002-07-14 17:47:18 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file bswap.h was added on branch kqueue on 2002-06-23 17:37:07 +0000
 1.3 28-Jan-2024  macallan add missing bus_space_*_stream() methods instead of quietly aliasing them
to their potentially byte-swapping regular counterparts

ok skrll@
 1.2 23-Sep-2019  skrll branches: 1.2.26;
Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10; 1.1.36;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.36.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file bus_defs.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file bus_defs.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file bus_defs.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.2.26.1 17-Feb-2024  martin Pull up following revision(s) (requested by macallan in ticket #592):

sys/arch/hppa/hppa/mainbus.c: revision 1.13
sys/arch/hppa/dev/elroy.c: revision 1.7
sys/arch/hppa/dev/dino.c: revision 1.17
sys/arch/hppa/include/bus_funcs.h: revision 1.2
sys/arch/hppa/include/bus_defs.h: revision 1.3

add missing bus_space_*_stream() methods instead of quietly aliasing them
to their potentially byte-swapping regular counterparts

ok skrll@
 1.2 28-Jan-2024  macallan add missing bus_space_*_stream() methods instead of quietly aliasing them
to their potentially byte-swapping regular counterparts

ok skrll@
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10; 1.1.66;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.66.1 17-Feb-2024  martin Pull up following revision(s) (requested by macallan in ticket #592):

sys/arch/hppa/hppa/mainbus.c: revision 1.13
sys/arch/hppa/dev/elroy.c: revision 1.7
sys/arch/hppa/dev/dino.c: revision 1.17
sys/arch/hppa/include/bus_funcs.h: revision 1.2
sys/arch/hppa/include/bus_defs.h: revision 1.3

add missing bus_space_*_stream() methods instead of quietly aliasing them
to their potentially byte-swapping regular counterparts

ok skrll@
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file bus_funcs.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file bus_funcs.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file bus_funcs.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.8 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.7 03-Feb-2006  dsl branches: 1.7.74; 1.7.82; 1.7.88;
Use uint32_t and uint16_t not in_addr_t and in_port_t
 1.6 30-Jan-2006  dsl branches: 1.6.2;
Move all the stuff that detects bswapxx(constant) into the MI sys/bswap.h
Put the minimum to define the required inline assembler or C into the MD files.
NB: there may be some fallout from this!
 1.5 28-Dec-2005  perry branches: 1.5.2;
inline -> __inline
 1.4 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 06-Oct-2003  matt branches: 1.2.16;
Change headers to comply with the new toolchain changes.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file byte_swap.h was added on branch gehenna-devsw on 2002-07-14 17:47:18 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file byte_swap.h was added on branch kqueue on 2002-06-23 17:37:07 +0000
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.5.2.2 18-Feb-2006  yamt sync with head.
 1.5.2.1 01-Feb-2006  yamt sync with head.
 1.6.2.1 09-Sep-2006  rpaulo sync with head
 1.7.88.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.82.1 27-Oct-2008  skrll Commit work in progress.
 1.7.74.1 04-May-2009  yamt sync with head.
 1.3 18-Mar-2014  christos Make all __ALIGNBYTES macros return the same type (size_t)
 1.2 20-Jan-2012  joerg branches: 1.2.6; 1.2.10;
Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressions
again. This was changed in sys/socket.h r1.51 to work around fallout
from the IPv6 aux data migration. It broke the historic ABI on some
platforms. This commit restores compatibility for netbsd32 code on such
platforms and provides a template for future changes to the CMSG_*
alignment. Revert PCC/Clang workarounds in postfix and tmux.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.150; 1.1.154;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.154.1 18-Feb-2012  mrg merge to -current.
 1.1.150.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.150.1 17-Apr-2012  yamt sync with head
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file cdefs.h was added on branch gehenna-devsw on 2002-07-14 17:47:19 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file cdefs.h was added on branch kqueue on 2002-06-23 17:37:07 +0000
 1.2.10.1 18-May-2014  rmind sync with head
 1.2.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13 23-Feb-2023  riastradh hppa: Add missing barriers in cpu_switchto.

PR kern/57240

Not sure hppa has ever had working MULTIPROCESSOR, so maybe no
pullups needed?
 1.12 02-Nov-2021  ryo branches: 1.12.4;
In order to prevent _mcount() from being recursively called when built with COPTS=-O0,
sprinkle `__always_inline' to make _mcount() be generated as a single function.
 1.11 14-Aug-2021  ryo Improved the performance of kernel profiling on MULTIPROCESSOR, and possible to get profiling data for each CPU.

In the current implementation, locks are acquired at the entrance of the mcount
internal function, so the higher the number of cores, the more lock conflict
occurs, making profiling performance in a MULTIPROCESSOR environment unusable
and slow. Profiling buffers has been changed to be reserved for each CPU,
improving profiling performance in MP by several to several dozen times.

- Eliminated cpu_simple_lock in mcount internal function, using per-CPU buffers.
- Add ci_gmon member to struct cpu_info of each MP arch.
- Add kern.profiling.percpu node in sysctl tree.
- Add new -c <cpuid> option to kgmon(8) to specify the cpuid, like openbsd.
For compatibility, if the -c option is not specified, the entire system can be
operated as before, and the -p option will get the total profiling data for
all CPUs.
 1.10 16-Apr-2020  skrll Fix cur{lwp,cpu} and other bits for MODULES
 1.9 05-Dec-2019  skrll branches: 1.9.6;
Attempt to restore Utah $Hdr$
 1.8 05-Dec-2019  riastradh Only need one ci_onproc member.
 1.7 04-Dec-2019  skrll +ci_onproc
 1.6 01-Dec-2019  ad Fix false sharing problems with cpu_info. Identified with tprof(8).
This was a very nice win in my tests on a 48 CPU box.

- Reorganise cpu_data slightly according to usage.
- Put cpu_onproc into struct cpu_info alongside ci_curlwp (now is ci_onproc).
- On x86, put some items in their own cache lines according to usage, like
the IPI bitmask and ci_want_resched.
 1.5 16-Apr-2019  skrll branches: 1.5.4;
Trailing whitespace
 1.4 22-Aug-2018  msaitoh - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
- Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
use them on all m68k machines.
 1.3 25-Jan-2016  christos branches: 1.3.10; 1.3.16; 1.3.18;
Don't expose kernel structs to userland.
 1.2 06-Mar-2014  skrll branches: 1.2.4; 1.2.6; 1.2.10; 1.2.12;
Move to a flat space register convention. %sr[4-7] are all now the space
number allocated to the process. gcc produces (slightly) better code
with this convention.

Retain backwards compatiblity.

Welcome to 6.99.36
 1.1 24-Feb-2014  skrll Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.2.12.1 19-Mar-2016  skrll Sync with HEAD
 1.2.10.3 03-Dec-2017  jdolecek update from HEAD
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 06-Mar-2014  tls file cpu.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.2.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.6.1 06-Mar-2014  yamt file cpu.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 06-Mar-2014  rmind file cpu.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.3.18.3 21-Apr-2020  martin Sync with HEAD
 1.3.18.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3.18.1 10-Jun-2019  christos Sync with HEAD
 1.3.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.10.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1859):

sys/arch/ia64/ia64/vm_machdep.c: revision 1.18
sys/arch/powerpc/powerpc/locore_subr.S: revision 1.67
sys/arch/aarch64/aarch64/locore.S: revision 1.91
sys/arch/mips/include/asm.h: revision 1.74
sys/arch/hppa/include/cpu.h: revision 1.13
sys/arch/arm/arm/armv6_start.S: revision 1.38
(applied also to sys/arch/arm/cortex/a9_mpsubr.S,
sys/arch/arm/cortex/a9_mpsubr.S,
sys/arch/arm/cortex/cortex_init.S)
sys/arch/evbmips/ingenic/cpu_startup.S: revision 1.2
sys/arch/mips/mips/locore.S: revision 1.229
sys/arch/alpha/include/asm.h: revision 1.45
(applied to sys/arch/alpha/alpha/multiproc.s)
sys/arch/sparc64/sparc64/locore.s: revision 1.432
sys/arch/vax/vax/subr.S: revision 1.42
sys/arch/mips/mips/locore_mips3.S: revision 1.116
sys/arch/ia64/ia64/machdep.c: revision 1.44
sys/arch/arm/arm32/cpuswitch.S: revision 1.106
sys/arch/sparc/sparc/locore.s: revision 1.284
(all via patch)

aarch64: Add missing barriers in cpu_switchto.
Details in comments.

Note: This is a conservative change that inserts a barrier where
there was a comment saying none is needed, which is probably correct.
The goal of this change is to systematically add barriers to be
confident in correctness; subsequent changes may remove some bariers,
as an optimization, with an explanation of why each barrier is not
needed.

PR kern/57240

alpha: Add missing barriers in cpu_switchto.
Details in comments.

arm32: Add missing barriers in cpu_switchto.
Details in comments.

hppa: Add missing barriers in cpu_switchto.
Not sure hppa has ever had working MULTIPROCESSOR, so maybe no
pullups needed?

ia64: Add missing barriers in cpu_switchto.
(ia64 has never really worked, so no pullups needed, right?)

mips: Add missing barriers in cpu_switchto.
Details in comments.

powerpc: Add missing barriers in cpu_switchto.
Details in comments.

sparc: Add missing barriers in cpu_switchto.

sparc64: Add missing barriers in cpu_switchto.
Details in comments.

vax: Note where cpu_switchto needs barriers.

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.
 1.5.4.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1676):

sys/arch/ia64/ia64/vm_machdep.c: revision 1.18
sys/arch/powerpc/powerpc/locore_subr.S: revision 1.67
sys/arch/aarch64/aarch64/locore.S: revision 1.91
sys/arch/mips/include/asm.h: revision 1.74
sys/arch/hppa/include/cpu.h: revision 1.13
sys/arch/arm/arm/armv6_start.S: revision 1.38
sys/arch/evbmips/ingenic/cpu_startup.S: revision 1.2
sys/arch/mips/mips/locore.S: revision 1.229
sys/arch/aarch64/aarch64/cpuswitch.S: revision 1.40
sys/arch/alpha/include/asm.h: revision 1.45
sys/arch/sparc64/sparc64/locore.s: revision 1.432
sys/arch/vax/vax/subr.S: revision 1.42
sys/arch/mips/mips/locore_mips3.S: revision 1.116
sys/arch/ia64/ia64/machdep.c: revision 1.44
sys/arch/arm/arm32/cpuswitch.S: revision 1.106
sys/arch/sparc/sparc/locore.s: revision 1.284
(all via patch)

aarch64: Add missing barriers in cpu_switchto.
Details in comments.

Note: This is a conservative change that inserts a barrier where
there was a comment saying none is needed, which is probably correct.
The goal of this change is to systematically add barriers to be
confident in correctness; subsequent changes may remove some bariers,
as an optimization, with an explanation of why each barrier is not
needed.

PR kern/57240

alpha: Add missing barriers in cpu_switchto.
Details in comments.

arm32: Add missing barriers in cpu_switchto.
Details in comments.

hppa: Add missing barriers in cpu_switchto.
Not sure hppa has ever had working MULTIPROCESSOR, so maybe no
pullups needed?

ia64: Add missing barriers in cpu_switchto.
(ia64 has never really worked, so no pullups needed, right?)

mips: Add missing barriers in cpu_switchto.
Details in comments.

powerpc: Add missing barriers in cpu_switchto.
Details in comments.

sparc: Add missing barriers in cpu_switchto.

sparc64: Add missing barriers in cpu_switchto.
Details in comments.

vax: Note where cpu_switchto needs barriers.

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.
 1.9.6.1 20-Apr-2020  bouyer Sync with HEAD
 1.12.4.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #264):

sys/arch/ia64/ia64/vm_machdep.c: revision 1.18
sys/arch/powerpc/powerpc/locore_subr.S: revision 1.67
sys/arch/aarch64/aarch64/locore.S: revision 1.91
sys/arch/mips/include/asm.h: revision 1.74
sys/arch/hppa/include/cpu.h: revision 1.13
sys/arch/arm/arm/armv6_start.S: revision 1.38
sys/arch/evbmips/ingenic/cpu_startup.S: revision 1.2
sys/arch/mips/mips/locore.S: revision 1.229
sys/arch/aarch64/aarch64/cpuswitch.S: revision 1.40
sys/arch/alpha/include/asm.h: revision 1.45
sys/arch/sparc64/sparc64/locore.s: revision 1.432
sys/arch/vax/vax/subr.S: revision 1.42
sys/arch/mips/mips/locore_mips3.S: revision 1.116
sys/arch/riscv/riscv/cpu_switch.S: revision 1.3
sys/arch/ia64/ia64/machdep.c: revision 1.44
sys/arch/arm/arm32/cpuswitch.S: revision 1.106
sys/arch/sparc/sparc/locore.s: revision 1.284

aarch64: Add missing barriers in cpu_switchto.
Details in comments.

Note: This is a conservative change that inserts a barrier where
there was a comment saying none is needed, which is probably correct.
The goal of this change is to systematically add barriers to be
confident in correctness; subsequent changes may remove some bariers,
as an optimization, with an explanation of why each barrier is not
needed.

PR kern/57240

alpha: Add missing barriers in cpu_switchto.
Details in comments.

arm32: Add missing barriers in cpu_switchto.
Details in comments.

hppa: Add missing barriers in cpu_switchto.
Not sure hppa has ever had working MULTIPROCESSOR, so maybe no
pullups needed?

ia64: Add missing barriers in cpu_switchto.
(ia64 has never really worked, so no pullups needed, right?)

mips: Add missing barriers in cpu_switchto.
Details in comments.

powerpc: Add missing barriers in cpu_switchto.
Details in comments.

riscv: Add missing barriers in cpu_switchto.
Details in comments.

sparc: Add missing barriers in cpu_switchto.

sparc64: Add missing barriers in cpu_switchto.
Details in comments.

vax: Note where cpu_switchto needs barriers.

Not sure vax has ever had working MULTIPROCESSOR, though, and I'm not
even sure how to spell store-before-load barriers on VAX, so no
functional change for now.
 1.17 21-May-2012  skrll Provide hppa_{enable,disable}_irq
 1.16 03-Apr-2012  skrll Kill cpu_gethpa by using the HPA stored in the cpu_info structure.
 1.15 04-Feb-2012  skrll G/C unused [fp]dcache_small.

OK riz@
 1.14 29-Nov-2009  skrll branches: 1.14.12; 1.14.16;
Add lci to get coherence index for an address.
 1.13 29-Nov-2009  skrll KNF
 1.12 03-Nov-2009  snj Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.11 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.10 18-Oct-2007  skrll branches: 1.10.20; 1.10.28; 1.10.34;
Remove get_psw/set_psw - they're not needed and can cause problems.
 1.9 07-Apr-2007  skrll branches: 1.9.12; 1.9.14; 1.9.18;
de-__P() and whitespace.
 1.8 27-Aug-2006  skrll branches: 1.8.6; 1.8.8; 1.8.12; 1.8.14; 1.8.18;
Pull across OpenBSD cpufunc.h:1.27 (ignore the typo)

revision 1.27
date: 2005/04/07 00:19:28; author: mickey; state: Exp; lines: +3 -3
put a memmory barrier onto the sync_caches()
 1.7 28-Dec-2005  perry branches: 1.7.4; 1.7.8;
inline -> __inline
 1.6 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 31-Jan-2005  jkunz branches: 1.4.6;
Import mfcpu() from OpenBSD, needed by power switch code.
 1.3 26-Aug-2004  jkunz branches: 1.3.4; 1.3.6;
Import STI wscons(4) driver from OpenBSD and add new driver for PS/2
keyboard / mouse pots of LASI.
 1.2 19-Aug-2002  fredette branches: 1.2.6;
Cleaned up BTLB support. There are no longer BTLB function pointers
in struct hppa_cpu_info or anywhere else, now there are just hppa_btlb_*
functions. Added support for machines with split I/D and variable-range
BTLBs. Added support for purging BTLB entries.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.3 31-Aug-2002  gehenna catch up with -current.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file cpufunc.h was added on branch gehenna-devsw on 2002-07-14 17:47:20 +0000
 1.1.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file cpufunc.h was added on branch kqueue on 2002-06-23 17:37:07 +0000
 1.2.6.2 04-Feb-2005  skrll Sync with HEAD.
 1.2.6.1 03-Sep-2004  skrll Sync with HEAD
 1.3.6.1 12-Feb-2005  yamt sync with head.
 1.3.4.1 29-Apr-2005  kent sync with -current
 1.4.6.4 27-Oct-2007  yamt sync with head.
 1.4.6.3 03-Sep-2007  yamt sync with head.
 1.4.6.2 30-Dec-2006  yamt sync with head.
 1.4.6.1 21-Jun-2006  yamt sync with head.
 1.7.8.1 03-Sep-2006  yamt sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.18.1 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.8.14.1 11-Jul-2007  mjf Sync with head.
 1.8.12.2 23-Oct-2007  ad Sync with head.
 1.8.12.1 10-Apr-2007  ad Sync with head.
 1.8.8.1 15-Apr-2007  yamt sync with head.
 1.8.6.1 24-Oct-2007  xtraeme Pull up following revision(s) (requested by skrll in ticket #939):
sys/arch/hppa/include/cpufunc.h: revision 1.10

Remove get_psw/set_psw - they're not needed and can cause problems.
 1.9.18.1 25-Oct-2007  bouyer Sync with HEAD.
 1.9.14.1 06-Nov-2007  matt sync with HEAD
 1.9.12.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.10.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.28.1 27-Oct-2008  skrll Commit work in progress.
 1.10.20.2 11-Mar-2010  yamt sync with head
 1.10.20.1 04-May-2009  yamt sync with head.
 1.14.16.3 02-Jun-2012  mrg sync to latest -current.
 1.14.16.2 05-Apr-2012  mrg sync to latest -current.
 1.14.16.1 18-Feb-2012  mrg merge to -current.
 1.14.12.2 23-May-2012  yamt sync with head.
 1.14.12.1 17-Apr-2012  yamt sync with head
 1.15 03-Sep-2023  andvar remove (db_addr_t) cast in hppa PC_REGS(regs) definition.
rename tf_hptm to tf_cr24 in kgdb_hppa.c.
This name was lost from trapframe (frame.h) in v1.8 and restored as tf_cr24 in v1.12.

Fixes KGDB enabled build for hppa.
 1.14 06-Nov-2017  christos Cleanup and clarify the ELFSIZE mess:

We now have 2 variables automatically set in elf_machdep.h:

ARCH_ELFSIZE: the size for userland binaries
KERN_ELFSIZE: the size for the kernel binaries

DB_ELFSIZE has been deleted and KERN_ELFSIZE should have always the
same values DB_ELFSIZE used to have.

In sys/exec_elf.h, if ELFSIZE is not set, it is set to KERN_ELFSIZE
for the kernel and ARCH_ELFSIZE for userland. These defaults should
eliminate the need for most manual ELFSIZE setting.
 1.13 11-Jan-2016  skrll PR port-hppa/50642: src/sys/arch/hppa/include/db_machdep.h:118: bad if test ?

Correct the test for rfir and add one for rfi while I'm here.
 1.12 18-Jan-2012  skrll branches: 1.12.2; 1.12.6; 1.12.22; 1.12.24; 1.12.26;
Support crash(8) on hppa.
 1.11 26-May-2011  joerg branches: 1.11.4; 1.11.8;
Introduce DDB_EXPR_FMT and replace the logic around DB_EXPR_T_IS_QUAD.
 1.10 14-Jan-2011  rmind branches: 1.10.2;
Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete. Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
 1.9 02-Mar-2010  skrll branches: 1.9.2;
Add a "mach frame" command to hppa ddb.
 1.8 03-Nov-2009  snj branches: 1.8.2;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.7 07-Apr-2007  skrll branches: 1.7.38;
Add ldcw as a store instruction. From OpenBSD.
 1.6 07-Apr-2007  skrll de-__P()
 1.5 01-Apr-2006  cherry branches: 1.5.14; 1.5.18; 1.5.20;
closes: PR kern/32359

modifies machine/db_machdep.h: BKPT_SET(inst) to BKPT_SET(inst, addr) for all archs ie; passess the
breakpoint address as well.

Patch from cherry@mahiti.org
 1.4 16-Feb-2006  perry branches: 1.4.2; 1.4.4; 1.4.6;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.3 24-Dec-2005  perry branches: 1.3.2; 1.3.4; 1.3.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 29-Apr-2003  scw branches: 1.2.18;
Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file db_machdep.h was added on branch gehenna-devsw on 2002-07-14 17:47:20 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file db_machdep.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.2.18.2 03-Sep-2007  yamt sync with head.
 1.2.18.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.3.2.1 18-Feb-2006  yamt sync with head.
 1.4.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.4.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.4.2.1 11-Apr-2006  yamt sync with head
 1.5.20.1 11-Jul-2007  mjf Sync with head.
 1.5.18.1 10-Apr-2007  ad Sync with head.
 1.5.14.1 15-Apr-2007  yamt sync with head.
 1.7.38.1 11-Mar-2010  yamt sync with head
 1.8.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.9.2.2 31-May-2011  rmind sync with head
 1.9.2.1 05-Mar-2011  rmind sync with head
 1.10.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.8.1 18-Feb-2012  mrg merge to -current.
 1.11.4.1 17-Apr-2012  yamt sync with head
 1.12.26.1 12-Jan-2016  snj Pull up following revision(s) (requested by skrll in ticket #1072):
sys/arch/hppa/include/db_machdep.h: revision 1.13
PR port-hppa/50642: src/sys/arch/hppa/include/db_machdep.h:118: bad if test ?
Correct the test for rfir and add one for rfi while I'm here.
 1.12.24.1 19-Mar-2016  skrll Sync with HEAD
 1.12.22.1 12-Jan-2016  snj Pull up following revision(s) (requested by skrll in ticket #1072):
sys/arch/hppa/include/db_machdep.h: revision 1.13
PR port-hppa/50642: src/sys/arch/hppa/include/db_machdep.h:118: bad if test ?
Correct the test for rfir and add one for rfi while I'm here.
 1.12.6.1 03-Dec-2017  jdolecek update from HEAD
 1.12.2.1 13-Jul-2016  snj Pull up following revision(s) (requested by skrll in ticket #1360):
sys/arch/hppa/include/db_machdep.h: revision 1.13
PR port-hppa/50642: src/sys/arch/hppa/include/db_machdep.h:118: bad if test ?
Correct the test for rfir and add one for rfi while I'm here.
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file disklabel.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file disklabel.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file disklabel.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.3 31-Mar-2014  christos branches: 1.3.4; 1.3.6; 1.3.10;
fix eisa_intr_string
 1.2 29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.1 24-Feb-2014  skrll Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.3.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.10.1 31-Mar-2014  tls file eisa_machdep.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.3.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.1 31-Mar-2014  yamt file eisa_machdep.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.3.4.2 18-May-2014  rmind sync with head
 1.3.4.1 31-Mar-2014  rmind file eisa_machdep.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.4 06-Nov-2017  christos Cleanup and clarify the ELFSIZE mess:

We now have 2 variables automatically set in elf_machdep.h:

ARCH_ELFSIZE: the size for userland binaries
KERN_ELFSIZE: the size for the kernel binaries

DB_ELFSIZE has been deleted and KERN_ELFSIZE should have always the
same values DB_ELFSIZE used to have.

In sys/exec_elf.h, if ELFSIZE is not set, it is set to KERN_ELFSIZE
for the kernel and ARCH_ELFSIZE for userland. These defaults should
eliminate the need for most manual ELFSIZE setting.
 1.3 30-May-2009  skrll branches: 1.3.22;
Add TLS relocation definitions.
 1.2 19-May-2009  skrll Whitespace.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.116;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.116.1 20-Jun-2009  yamt sync with head
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file elf_machdep.h was added on branch gehenna-devsw on 2002-07-14 17:47:21 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file elf_machdep.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.3.22.1 03-Dec-2017  jdolecek update from HEAD
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file endian.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file endian.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file endian.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file endian_machdep.h was added on branch gehenna-devsw on 2002-07-14 17:47:22 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file endian_machdep.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.3 16-Apr-2019  skrll Trailing whitespace
 1.2 10-Dec-2002  thorpej branches: 1.2.198;
Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file exec.h was added on branch gehenna-devsw on 2002-07-14 17:47:22 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file exec.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.2.198.1 10-Jun-2019  christos Sync with HEAD
 1.2 13-Jan-2015  martin branches: 1.2.2; 1.2.4; 1.2.20;
Properly separate fenv.h and ieeefp.h by moving all fenv defines
over to the former.
Now that they are decoupled, make rounding modes match the hardware bits.
 1.1 27-Dec-2014  martin fenv(3) support for hppa
 1.2.20.2 03-Dec-2017  jdolecek update from HEAD
 1.2.20.1 13-Jan-2015  jdolecek file fenv.h was added on branch tls-maxphys on 2017-12-03 11:36:16 +0000
 1.2.4.2 06-Apr-2015  skrll Sync with HEAD
 1.2.4.1 13-Jan-2015  skrll file fenv.h was added on branch nick-nhusb on 2015-04-06 15:17:57 +0000
 1.2.2.2 20-Jan-2015  snj Pull up following revision(s) (requested by martin in ticket #416):
distrib/sets/lists/comp/md.hppa: revision 1.3
include/fenv.h: revision 1.13 via patch
lib/libm/Makefile: revision 1.168
lib/libm/arch/hppa/fenv.c: revisions 1.1, 1.2
sys/arch/hppa/include/Makefile: revision 1.12
sys/arch/hppa/include/fenv.h: revisions 1.1, 1.2
sys/arch/hppa/include/ieeefp.h: revisions 1.5-1.7
tests/lib/libm/Makefile: revision 1.29 via patch
fenv(3) support for hppa
--
use unsigned over uint32_t so that this file works without stdint.h
being included before hand.
fixes mknative-gcc problems, and likely others.
--
Properly separate fenv.h and ieeefp.h by moving all fenv defines
over to the former.
Now that they are decoupled, make rounding modes match the hardware bits.
--
Simplify, now that rounding mode defines match the hardware bits.
 1.2.2.1 13-Jan-2015  snj file fenv.h was added on branch netbsd-7 on 2015-01-20 20:57:24 +0000
 1.9 30-Oct-2024  riastradh Sprinkle <sys/featuretest.h> where _*_SOURCE macros are consulted.

Otherwise, the feature tests might come out wrong. For example,
header files that check for _NETBSD_SOURCE won't get the default when
no other _*_SOURCE macros are defined; header files that check for
_POSIX_C_SOURCE might miss _XOPEN_SOURCE, which is supposed to imply
a corresponding _POSIX_C_SOURCE.

PR lib/58752: various header files test _*_SOURCE macros but don't
include sys/featuretest.h
 1.8 11-Jul-2011  matt branches: 1.8.90;
Fix FLT_* and DBL_* redefinition problem.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 24-Jul-2004  chs FPU fixes and improvements, adapted from openbsd:
- handle exceptions correctly
- emulation of unimplemented instructions (eg. on PA-7300LC)
 1.5 30-Oct-2003  kleink It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.4 23-Oct-2003  kleink * Move the definitions for types other than single-precision and double-
precision back to machine-dependent headers. C99 has no strict
requirement which, if any, extended-precision type `long double' must
match, and even between 80-bit formats there are differences in
implementation (m68k vs. x86).
* On arm, consider __VFP_FP__.
 1.3 31-Aug-2003  chs update for LWPs, and some lite cleanup.
 1.2 19-Apr-2003  christos branches: 1.2.2;
PR/3012: Greg A. Woods: Write all float.h files [except the vax of course]
in terms of float_ieee.h
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file float.h was added on branch gehenna-devsw on 2002-07-14 17:47:23 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file float.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.90.1 02-Aug-2025  perseant Sync with HEAD
 1.12 22-Jan-2011  skrll Save CR24 and CR27 and report in ddb.
 1.11 30-Mar-2010  skrll branches: 1.11.2; 1.11.4;
Whitespace.
 1.10 16-Mar-2010  skrll The FP regs are accessed in both physical and virtual modes. Make sure
they're allocated in directly mapped memory to avoid aliasing problems
and unnecessary cache flushing.

Fix various names and references. If we ever directly map the uarea and
pcb we can change things at that point.

Significantly helps my J210 (PA7200).

Mostly from OpenBSD.
 1.9 03-Nov-2009  snj branches: 1.9.2; 1.9.4;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.8 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.7 22-Dec-2007  skrll branches: 1.7.10; 1.7.18; 1.7.24;
Cast the argument to HPPA_FRAME_ROUND to uintptr_t
 1.6 18-Nov-2007  skrll branches: 1.6.2; 1.6.6;
Typo in comment. From OpenBSD.
 1.5 13-Nov-2007  skrll No need for reg.h here.
 1.4 07-Apr-2007  skrll branches: 1.4.12; 1.4.14; 1.4.18; 1.4.20;
Typo. From OpenBSD.
 1.3 11-Dec-2005  christos branches: 1.3.26; 1.3.30; 1.3.32;
merge ktrace-lwp.
 1.2 18-Jul-2004  chs branches: 1.2.12;
add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file frame.h was added on branch gehenna-devsw on 2002-07-14 17:47:23 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file frame.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.2.12.4 21-Jan-2008  yamt sync with head
 1.2.12.3 07-Dec-2007  yamt sync with head
 1.2.12.2 15-Nov-2007  yamt sync with head.
 1.2.12.1 03-Sep-2007  yamt sync with head.
 1.3.32.1 11-Jul-2007  mjf Sync with head.
 1.3.30.2 03-Dec-2007  ad Sync with HEAD.
 1.3.30.1 10-Apr-2007  ad Sync with head.
 1.3.26.1 15-Apr-2007  yamt sync with head.
 1.4.20.2 27-Dec-2007  mjf Sync with HEAD.
 1.4.20.1 19-Nov-2007  mjf Sync with HEAD.
 1.4.18.1 18-Nov-2007  bouyer Sync with HEAD
 1.4.14.1 09-Jan-2008  matt sync with HEAD
 1.4.12.2 21-Nov-2007  joerg Sync with HEAD.
 1.4.12.1 14-Nov-2007  joerg Sync with HEAD.
 1.6.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.6.2.1 26-Dec-2007  ad Sync with head.
 1.7.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.18.1 27-Oct-2008  skrll Commit work in progress.
 1.7.10.3 11-Aug-2010  yamt sync with head.
 1.7.10.2 11-Mar-2010  yamt sync with head
 1.7.10.1 04-May-2009  yamt sync with head.
 1.9.4.2 05-Mar-2011  rmind sync with head
 1.9.4.1 30-May-2010  rmind sync with head
 1.9.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.11.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.11.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file hil_machdep.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file hil_machdep.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file hil_machdep.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.14 31-Jan-2014  matt Consolidate the 128-bit long double defintions to <sys/ieee754.h>
Each arch that uses it now defines __HAVE_LONG_DOUBLE to 128.
<machine/ieee.h> is now just include the machine's math.h followed
by <sys/ieee754.h>
 1.13 31-Jan-2014  matt Add inclusion protection.
Convert to ieee_ext to use uint64_t
Format uses implicit NBIT
 1.12 10-Jul-2011  matt branches: 1.12.2; 1.12.12; 1.12.16;
Add defines for extu_frac[ln]m
 1.11 20-Sep-2010  christos cargo cult the x86 changes.
 1.10 04-Feb-2007  christos branches: 1.10.48; 1.10.68; 1.10.70;
make this gdtoa friendly.
 1.9 11-Dec-2005  christos branches: 1.9.20; 1.9.24;
merge ktrace-lwp.
 1.8 15-Apr-2005  kleink branches: 1.8.2;
Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.

IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
 1.7 30-Oct-2003  kleink branches: 1.7.8; 1.7.14;
It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.6 27-Oct-2003  kleink Err, rename some members added in previous to make them reflect their
semantics better.
 1.5 26-Oct-2003  kleink For convenient use in libc, add unions of the C floating types and their
corresponding structure definitions.
 1.4 26-Oct-2003  kleink Use <sys/ieee754.h> where applicable.
 1.3 26-Oct-2003  kleink Rip out E80 format definitions which are neither "notyet", nor going to
happen.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file ieee.h was added on branch gehenna-devsw on 2002-07-14 17:47:24 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file ieee.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.7.14.1 19-Apr-2005  tron Pull up revision 1.8 (requested by kleink in ticket #163):
Push back the descriptions of NaN formats, and descriptions of the
distinction between signalling NaNs and quiet NaNs back into the
machine-dependent headers; treat the implementation of __nanf in the
same spirit.
IEEE 754 leaves the distinction between signalling NaNs and quiet NANs
to the implementation, and unlike our headers used to suggest they're
not identical in the interpretation of the fraction's MSb; in due
course, make those of hppa, mips, sh3, and sh5 reflect reality.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.2.1 26-Feb-2007  yamt sync with head.
 1.9.24.1 07-May-2007  pavel Pull up following revision(s) (requested by manu in ticket #607):
lib/libc/arch/i386/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoa.c: revision 1.2-1.3
lib/libc/arch/x86_64/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoaimp.h: revision 1.6
sys/arch/m68k/include/ieee.h: revision 1.13
usr.bin/xlint/lint1/scan.l: revision 1.36-1.37
lib/libc/stdio/snprintf_ss.c: revision 1.4
lib/libc/arch/i386/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfscanf.c: revision 1.38
sys/arch/sparc/include/ieee.h: revision 1.11-1.12
lib/libc/gdtoa/dtoa.c: revision 1.4
lib/libc/stdio/Makefile.inc: revision 1.35
lib/libc/stdio/fvwrite.c: revision 1.17
lib/libc/arch/m68k/gen/fpclassifyl.c: revision 1.2
lib/libc/arch/i386/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfprintf.c: revision 1.55-1.57
lib/libc/stdio/vsnprintf_ss.c: revision 1.3
lib/libc/stdio/vfwprintf.c: revision 1.10
sys/arch/x86/include/ieee.h: revision 1.10
lib/libc/gdtoa/dmisc.c: revision 1.3
lib/libc/gdtoa/Makefile.inc: revision 1.5
sys/arch/hppa/include/ieee.h: revision 1.10
lib/libc/arch/x86_64/gen/fpclassifyl.c: revision 1.3
lib/libc/arch/i386/gen/fpclassifyl.c: revision 1.2
sys/sys/ieee754.h: revision 1.7
lib/libc/gdtoa/gdtoa.h: revision 1.7
include/stdio.h: revision 1.67-1.68
lib/libc/gdtoa/hdtoa.c: revision 1.1-1.4
lib/libc/gdtoa/ldtoa.c: revision 1.1-1.4
defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.
Fix for issue reported in PR lib/35401 as well as related overflow bugs.
deal with hex doubles.
Instead of abusing stdio to get a signal-safe version of sprintf, provide one.
remove __SAFE
add long double and hex double support from freebsd.
make this compile.
add new prototypes.
add the new files to the build. Note I am not bumping libc now, because
these are not used yet.
Merge the int bit with the high fraction bit. Add constants/macros
needed by gdtoa.
add constants used by gdtoa
since the int bit is merged, do the explicit math.
ext_int bit is no more.
ext_int bit is no more.
- merge change from freebsd
- add support for building as vfprintf.c
- XXX: we strdup to simplify the freeing logic. This should be fixed for
efficiency in the vfprintf case.
use vfwprintf.c
enable wide doubles.
some int -> size_t
deal with sparc64 that has 112 bits of mantissa.
make extended precision gdtoa friendly.
int/size_t changes
make this gdtoa friendly.
remove dup definition
use dtoa() instead of returning empty when we don't have extended precision
information.
Fix previous, add forgotten pointer dereference in the call to dtoa().
Add a cheesy workaround marked XXX for the situation where the
strtod() implementation available in the environment does not
handle hex floats.
Discussed with and suggested by christos
From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
vax does not have <machine/ieee.h> or long double
It would be nice if the compiler provided something like __IEEE_MATH__
bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
 1.9.20.1 09-Feb-2007  ad Sync with HEAD.
 1.10.70.1 05-Mar-2011  rmind sync with head
 1.10.68.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.10.48.1 09-Oct-2010  yamt sync with head
 1.12.16.1 18-May-2014  rmind sync with head
 1.12.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8 16-Apr-2019  skrll Trailing whitespace
 1.7 13-Jan-2015  martin branches: 1.7.18;
Properly separate fenv.h and ieeefp.h by moving all fenv defines
over to the former.
Now that they are decoupled, make rounding modes match the hardware bits.
 1.6 12-Jan-2015  mrg use unsigned over uint32_t so that this file works without stdint.h
being included before hand.

fixes mknative-gcc problems, and likely others.
 1.5 27-Dec-2014  martin fenv(3) support for hppa
 1.4 05-Aug-2008  matt branches: 1.4.38; 1.4.56; 1.4.58;
Update <machine/ieeefp.h> to use the C99 FE_* definitions instead of the
NetBSD defined ones. Redefine the NetBSD ones in terms of the C99 ones.
Step 1 to having <fenv.h>
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.78; 1.3.80; 1.3.84;
merge ktrace-lwp.
 1.2 24-Jul-2004  chs FPU fixes and improvements, adapted from openbsd:
- handle exceptions correctly
- emulation of unimplemented instructions (eg. on PA-7300LC)
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file ieeefp.h was added on branch gehenna-devsw on 2002-07-14 17:47:24 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file ieeefp.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.3.84.1 19-Oct-2008  haad Sync with HEAD.
 1.3.80.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.3.74.1 28-Sep-2008  mjf Sync with HEAD.
 1.4.58.1 06-Apr-2015  skrll Sync with HEAD
 1.4.56.1 20-Jan-2015  snj Pull up following revision(s) (requested by martin in ticket #416):
distrib/sets/lists/comp/md.hppa: revision 1.3
include/fenv.h: revision 1.13 via patch
lib/libm/Makefile: revision 1.168
lib/libm/arch/hppa/fenv.c: revisions 1.1, 1.2
sys/arch/hppa/include/Makefile: revision 1.12
sys/arch/hppa/include/fenv.h: revisions 1.1, 1.2
sys/arch/hppa/include/ieeefp.h: revisions 1.5-1.7
tests/lib/libm/Makefile: revision 1.29 via patch
fenv(3) support for hppa
--
use unsigned over uint32_t so that this file works without stdint.h
being included before hand.
fixes mknative-gcc problems, and likely others.
--
Properly separate fenv.h and ieeefp.h by moving all fenv defines
over to the former.
Now that they are decoupled, make rounding modes match the hardware bits.
--
Simplify, now that rounding mode defines match the hardware bits.
 1.4.38.1 03-Dec-2017  jdolecek update from HEAD
 1.7.18.1 10-Jun-2019  christos Sync with HEAD
 1.3 29-May-2010  tnozaki fix wrong integer promotion rule(removed U suffix from UINT{8,16}_C).
see ISO/IEC 9899:1999 7.18.4.3.
 1.2 28-Apr-2008  martin branches: 1.2.20; 1.2.22;
Remove clause 3 and 4 from TNF licenses
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.112; 1.1.114; 1.1.116;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.116.2 11-Aug-2010  yamt sync with head.
 1.1.116.1 16-May-2008  yamt sync with head.
 1.1.114.1 18-May-2008  yamt sync with head.
 1.1.112.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file int_const.h was added on branch gehenna-devsw on 2002-07-14 17:47:25 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file int_const.h was added on branch kqueue on 2002-06-23 17:37:08 +0000
 1.2.22.1 30-May-2010  rmind sync with head
 1.2.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.3 13-Aug-2014  matt include <sys/common_int_fmtio.h> if __INTPTR_FMTd__ is defined
 1.2 28-Apr-2008  martin branches: 1.2.44;
Remove clause 3 and 4 from TNF licenses
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.112; 1.1.114; 1.1.116;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.116.1 16-May-2008  yamt sync with head.
 1.1.114.1 18-May-2008  yamt sync with head.
 1.1.112.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file int_fmtio.h was added on branch gehenna-devsw on 2002-07-14 17:47:25 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file int_fmtio.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.2.44.1 03-Dec-2017  jdolecek update from HEAD
 1.7 16-Apr-2019  skrll Trailing whitespace
 1.6 28-Apr-2008  martin branches: 1.6.88;
Remove clause 3 and 4 from TNF licenses
 1.5 17-Oct-2007  garbled branches: 1.5.16; 1.5.18; 1.5.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.4 31-Aug-2007  drochner Fix definitions of UCHAR_MAX/USHRT_MAX and related
types. C99 requires that these definitions promote to (signed/unsigned)
integer the same way as the types the definition is for. And since
unsigned char/short fit into an "int" on all our archs and thus promote
to signed int, the definitions must not be unsigned.
Fixes PR lib/31306 by Neil Booth.
 1.3 11-Dec-2005  christos branches: 1.3.30; 1.3.38; 1.3.44; 1.3.48; 1.3.50;
merge ktrace-lwp.
 1.2 08-May-2004  kleink branches: 1.2.12;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file int_limits.h was added on branch gehenna-devsw on 2002-07-14 17:47:25 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file int_limits.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.2.12.1 03-Sep-2007  yamt sync with head.
 1.3.50.1 06-Nov-2007  matt sync with HEAD
 1.3.48.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.3.44.1 03-Sep-2007  skrll Sync with HEAD.
 1.3.38.1 03-Oct-2007  garbled Sync with HEAD
 1.3.30.1 09-Oct-2007  ad Sync with head.
 1.5.20.1 16-May-2008  yamt sync with head.
 1.5.18.1 18-May-2008  yamt sync with head.
 1.5.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.88.1 10-Jun-2019  christos Sync with HEAD
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 24-Dec-2005  perry branches: 1.2.74; 1.2.76; 1.2.78;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.26;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.26.1 21-Jun-2006  yamt sync with head.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file int_mwgwtypes.h was added on branch gehenna-devsw on 2002-07-14 17:47:26 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file int_mwgwtypes.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.2.78.1 16-May-2008  yamt sync with head.
 1.2.76.1 18-May-2008  yamt sync with head.
 1.2.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 25-May-2005  kleink branches: 1.3.2;
Include <sys/cdefs.h> for __signed; related to lib/30072.
 1.2 07-Aug-2003  agc branches: 1.2.6; 1.2.14;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file int_types.h was added on branch gehenna-devsw on 2002-07-14 17:47:26 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file int_types.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.2.14.1 28-May-2005  tron Pull up revision 1.3 (requested by klein in ticket #346):
Include <sys/cdefs.h> for __signed; related to lib/30072.
 1.2.6.1 29-May-2005  riz Pull up revision 1.3 (requested by kleink in ticket #1555):
Include <sys/cdefs.h> for __signed; related to lib/30072.
 1.3.2.1 21-Jun-2006  yamt sync with head.
 1.4 12-Jul-2023  mrg fix hppa and vax builds.

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

move the hppa ipl_t typedef with the moved usage of it.
 1.3 11-Jul-2023  riastradh hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
 1.2 26-Feb-2022  macallan branches: 1.2.4;
unmask interrupt bits leading to other interrupt registers
now hardware interrupts actually fire instead of being found pending by the
timer interrupt
with this SCSI throughput on my c360 is what you'd expect from an UW esiop
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file intr.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file intr.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file intr.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.2.4.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

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

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

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

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

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

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

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

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

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

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

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

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

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

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

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

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

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

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

ddb: Cast pointer to uintptr_t first before db_expr_t.

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

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

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

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

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

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

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

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

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

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

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

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

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

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

fix hppa and vax builds.

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

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

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

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

re-fix hppa builds.

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

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

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

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

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

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

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

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

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

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

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

Note that fls32 is 1-based and returns 0 for x=0.
 1.2 19-May-2014  rmind branches: 1.2.2; 1.2.6;
Implement MI IPI interface with cross-call support.
 1.1 24-Feb-2014  skrll branches: 1.1.2; 1.1.4;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file intrdefs.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.1.2.1 10-Aug-2014  tls Rebase.
 1.2.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 19-May-2014  tls file intrdefs.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.2.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.2.1 19-May-2014  yamt file intrdefs.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file iomod.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file iomod.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file iomod.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.2 18-Oct-2016  jdolecek add isa_intr_establish_xname() to MD isa headers so that it can be used
by MI drivers
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10; 1.1.12; 1.1.16;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.16.1 04-Nov-2016  pgoyette Sync with HEAD
 1.1.12.1 05-Dec-2016  skrll Sync with HEAD
 1.1.10.3 03-Dec-2017  jdolecek update from HEAD
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file isa_machdep.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file isa_machdep.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file isa_machdep.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.2 03-Nov-2009  snj Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.116;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.116.1 11-Mar-2010  yamt sync with head
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file kcore.h was added on branch gehenna-devsw on 2002-07-14 17:47:27 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file kcore.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.17 16-Apr-2019  skrll Trailing whitespace
 1.16 21-Jan-2019  dholland Fix wrong scoping of {U,}LLONG_MAX. More cases, not just amd64.
PR 53298 from Roberto E. Vargas Caballero.
 1.15 11-Apr-2013  christos branches: 1.15.34; 1.15.36;
add missing SSIZE_MIN
 1.14 28-Mar-2012  christos branches: 1.14.2;
- Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
 1.13 11-Jul-2011  matt branches: 1.13.2; 1.13.6;
Fix FLT_* and DBL_* redefinition problem.
 1.12 07-Jun-2010  tnozaki 1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
prepareing for next libc major crunk.
4. bump libc minor version.
 1.11 13-Sep-2008  skrll branches: 1.11.14; 1.11.16;
Fix (U)LLONG_(MAX|MIN) defines.

From Jonathan Kollasch. Thanks.
 1.10 13-Sep-2008  skrll Swap max/min in comments to match symbols.
 1.9 13-Sep-2008  skrll Multiple inclusion protection.
 1.8 17-Oct-2007  garbled branches: 1.8.16; 1.8.20; 1.8.22; 1.8.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.7 31-Aug-2007  drochner Fix definitions of UCHAR_MAX/USHRT_MAX and related
types. C99 requires that these definitions promote to (signed/unsigned)
integer the same way as the types the definition is for. And since
unsigned char/short fit into an "int" on all our archs and thus promote
to signed int, the definitions must not be unsigned.
Fixes PR lib/31306 by Neil Booth.
 1.6 19-Oct-2006  he branches: 1.6.8; 1.6.16; 1.6.22; 1.6.26; 1.6.28;
Convert to using hexadecimal literals for the type limits.
Also, add a trailing 'U' to the unsigned limits.
 1.5 11-Dec-2005  christos branches: 1.5.20; 1.5.22;
merge ktrace-lwp.
 1.4 07-Aug-2003  agc branches: 1.4.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 28-Apr-2003  bjh21 branches: 1.3.2;
Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.2 23-Jun-2002  perry branches: 1.2.2; 1.2.4;
Remove (completely unused) definition of CLK_TCK. Nothing in the
kernel uses it, it is protected by _KERNEL, and it conflicts with the
definition in userland.
 1.1 05-Jun-2002  fredette Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.2.4.3 16-Jul-2002  gehenna catch up with -current.
 1.2.4.2 14-Jul-2002  gehenna catch up with -current.
 1.2.4.1 23-Jun-2002  gehenna file limits.h was added on branch gehenna-devsw on 2002-07-14 17:47:27 +0000
 1.2.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.1 23-Jun-2002  jdolecek file limits.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.2 03-Sep-2007  yamt sync with head.
 1.4.16.1 30-Dec-2006  yamt sync with head.
 1.5.22.1 22-Oct-2006  yamt sync with head
 1.5.20.1 18-Nov-2006  ad Sync with head.
 1.6.28.1 06-Nov-2007  matt sync with HEAD
 1.6.26.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.6.22.1 03-Sep-2007  skrll Sync with HEAD.
 1.6.16.1 03-Oct-2007  garbled Sync with HEAD
 1.6.8.1 09-Oct-2007  ad Sync with head.
 1.8.26.1 19-Oct-2008  haad Sync with HEAD.
 1.8.22.1 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.8.20.2 11-Aug-2010  yamt sync with head.
 1.8.20.1 04-May-2009  yamt sync with head.
 1.8.16.1 28-Sep-2008  mjf Sync with HEAD.
 1.11.16.1 03-Jul-2010  rmind sync with head
 1.11.14.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.13.6.1 05-Apr-2012  mrg sync to latest -current.
 1.13.2.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.2.1 17-Apr-2012  yamt sync with head
 1.14.2.1 23-Jun-2013  tls resync from head
 1.15.36.1 10-Jun-2019  christos Sync with HEAD
 1.15.34.1 26-Jan-2019  pgoyette Sync with HEAD
 1.2 06-Aug-2014  joerg branches: 1.2.4;
Consistently define WARN in a way that passes format string checks, i.e.
always uses the same number of arguments as given in the format string.
 1.1 24-Feb-2014  skrll branches: 1.1.2; 1.1.4; 1.1.6;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file loadfile_machdep.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file loadfile_machdep.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.1.2.1 10-Aug-2014  tls Rebase.
 1.2.4.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.4.1 06-Aug-2014  tls file loadfile_machdep.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.24 13-Feb-2022  riastradh hppa: __cpu_simple_lock membar audit.

ok skrll
 1.23 12-Feb-2022  riastradh __cpu_simple_lock(9): Omit needless barriers in init.

It is, and always has been, the caller's responsibility to ensure the
lock is initialized before it can be used -- otherwise the memory
could hold garbage; it is nonsensical to even attempt locking
operations on it before initialization.

So there's no need to issue explicit barriers here. The barrier
seems to have been introduced in sys/arch/alpha/alpha/lock_machdep.c
rev. 1.1 (since moved to inline asm in alpha/include/lock.h) and then
copied & pasted into several other architectures.
 1.22 29-Nov-2019  riastradh Nix mb_* on hppa.
 1.21 16-Apr-2019  skrll Trailing whitespace
 1.20 17-Sep-2017  christos branches: 1.20.4;
more const.
 1.19 15-Jan-2017  christos undo paren change
 1.18 15-Jan-2017  christos more types for constants
 1.17 14-Jan-2017  christos fix constant types
 1.16 28-Apr-2008  martin branches: 1.16.44; 1.16.64; 1.16.68;
Remove clause 3 and 4 from TNF licenses
 1.15 13-Nov-2007  skrll branches: 1.15.14; 1.15.16; 1.15.18;
Don't use structure copy in __cpu_simple_lock_init. Set the array elements
to __SIMPLELOCK_RAW_UNLOCKED instead.
 1.14 17-Oct-2007  garbled branches: 1.14.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.13 15-Sep-2007  he branches: 1.13.4;
Fix build problem: ensure uintptr_t is declared by including <sys/stdint.h>.
OKed by skrll.
 1.12 10-Sep-2007  skrll Merge nick-csl-alignment.
 1.11 09-Feb-2007  ad branches: 1.11.6; 1.11.14; 1.11.18; 1.11.22; 1.11.24;
Merge newlock2 to head.
 1.10 22-Sep-2006  skrll Create real lock primatives using as little asm as possible.

It's not used anywhere, but it's better committed than on any of my HDs.
 1.9 28-Dec-2005  perry branches: 1.9.20; 1.9.22;
inline -> __inline
 1.8 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 07-Aug-2004  chs branches: 1.6.12;
stub out the ldcw stuff for now, since gcc -O2 chokes on it.
 1.5 01-Nov-2003  matt Compile at -O2. Fix various GCC3-isms
XXX mem.c still fails to assemble.
 1.4 06-Oct-2003  matt Change headers to comply with the new toolchain changes.
 1.3 20-Sep-2003  matt Use #ifdef _KERNEL_OPT around #include "opt_XXX.h"
 1.2 23-Jun-2003  martin branches: 1.2.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file lock.h was added on branch gehenna-devsw on 2002-07-14 17:47:27 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file lock.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.2.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.12.5 15-Nov-2007  yamt sync with head.
 1.6.12.4 27-Oct-2007  yamt sync with head.
 1.6.12.3 26-Feb-2007  yamt sync with head.
 1.6.12.2 30-Dec-2006  yamt sync with head.
 1.6.12.1 21-Jun-2006  yamt sync with head.
 1.9.22.1 22-Oct-2006  yamt sync with head
 1.9.20.2 29-Jan-2007  ad Make hp700 compile.
 1.9.20.1 18-Nov-2006  ad Sync with head.
 1.11.24.2 09-Jan-2008  matt sync with HEAD
 1.11.24.1 06-Nov-2007  matt sync with HEAD
 1.11.22.2 14-Nov-2007  joerg Sync with HEAD.
 1.11.22.1 02-Oct-2007  joerg Sync with HEAD.
 1.11.18.2 23-Aug-2007  skrll Sprinkle volatile.
 1.11.18.1 18-Jul-2007  skrll Initial work on provided correctly aligned __cpu_simple_lock_t for hppa
and first attempt at adapting i386 to the changes.

More to come.
 1.11.14.1 03-Oct-2007  garbled Sync with HEAD
 1.11.6.2 03-Dec-2007  ad Sync with HEAD.
 1.11.6.1 09-Oct-2007  ad Sync with head.
 1.13.4.1 13-Nov-2007  bouyer Sync with HEAD
 1.14.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.15.18.1 16-May-2008  yamt sync with head.
 1.15.16.1 18-May-2008  yamt sync with head.
 1.15.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.68.1 20-Mar-2017  pgoyette Sync with HEAD
 1.16.64.1 05-Feb-2017  skrll Sync with HEAD
 1.16.44.1 03-Dec-2017  jdolecek update from HEAD
 1.20.4.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.20.4.1 10-Jun-2019  christos Sync with HEAD
 1.2 04-Nov-2024  christos Undo previous lwp.h change.
 1.1 03-Nov-2024  christos Split __lwp_getprivate_fast and __lwp_*tcb from mcontext.h into a separate
lwp.h file.
 1.1 30-Nov-2024  christos branches: 1.1.4;
Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 30-Nov-2024  perseant file lwp_private.h was added on branch perseant-exfatfs on 2025-08-02 05:55:42 +0000
 1.8 31-Jan-2014  matt Consolidate the 128-bit long double defintions to <sys/ieee754.h>
Each arch that uses it now defines __HAVE_LONG_DOUBLE to 128.
<machine/ieee.h> is now just include the machine's math.h followed
by <sys/ieee754.h>
 1.7 11-Dec-2005  christos branches: 1.7.112; 1.7.122; 1.7.128;
merge ktrace-lwp.
 1.6 30-Oct-2003  kleink It turns out the hppa ABI we're using does not support an extended-
precision type, so drop the library support for now but leave in place
(#ifdef _LP64) the header definitions.
 1.5 28-Oct-2003  kleink #define __HAVE_LONG_DOUBLE on platforms which implement a distinct
`long double' type.
 1.4 22-Oct-2003  kleink G/c the local declaration of __nanf; handling of this (conditional on
__HAVE_NANF) was moved to <math.h> some time ago.
 1.3 06-Oct-2003  matt Change headers to comply with the new toolchain changes.
 1.2 28-Apr-2003  bjh21 branches: 1.2.2;
Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file math.h was added on branch gehenna-devsw on 2002-07-14 17:47:28 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file math.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.128.1 18-May-2014  rmind sync with head
 1.7.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.112.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16 30-Nov-2024  christos Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.
 1.15 04-Nov-2024  christos Undo previous lwp.h change.
 1.14 03-Nov-2024  christos Split __lwp_getprivate_fast and __lwp_*tcb from mcontext.h into a separate
lwp.h file.
 1.13 18-May-2024  thorpej branches: 1.13.2;
Clean up the <sys/ucontext.h> <-> <machine/mcontext.h> interface up
a little:
- Define _UC_MD_BIT* constants for the available machine-dependent bits,
and use those constants to define the machine-dependent bits as well
as the machine-independent bits that have machine-dependent values.
- Explicitly generate an error if _UC_TLSBASE, _UC_SETSTACK, or
_UC_CLRSTACK are not defined by <machine/mcontext.h>.
 1.12 26-Jun-2022  skrll Decorate the HPPA signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
 1.11 27-Dec-2019  kamil Harmonize the namespace of fast TLS base pointer getter functions

Protect __lwp_getprivate_fast() with _RTLD_SOURCE, _LIBC_SOURCE and
__LIBPTHREAD_SOURCE__.

Include in this namespace <sys/tcl.h> and use __BEGIN_DECLS/__END_DECLS
for the sake of consistency.
 1.10 27-Feb-2018  kamil branches: 1.10.4;
Implement _UC_MACHINE_INTRV() for hppa

INTRV = integer return value
For hppa this is R28 alias _REG_RET0.
 1.9 15-Feb-2018  kamil Introduce _UC_MACHINE_FP() as a macro

_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer.

Don't rely on this interface as a compiler might strip frame pointer or
optimize it making this interface unreliable.


For hppa assume a small frame context, for larger frames FP might be located
in a different register (4 instead of 3).

For ia64 there is no strict frame pointer, and registers might rotate.
Reuse 79 following:

./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM LOC_REG (79)

Once ia64 will mature, this should be revisited.

A macro can encapsulate a real function for extracting Frame Pointer on
more complex CPUs / ABIs.


For the remaining CPUs, reuse standard register as defined in appropriate ABI.

The direct users of this macro are LLVM and GCC with Sanitizers.

Proposed on tech-userlevel@.

Sponsored by <The NetBSD Foundation>
 1.8 19-Feb-2014  skrll branches: 1.8.22;
Provide a genassym.cf in libc for hppa and use it.
 1.7 08-Dec-2011  skrll branches: 1.7.6; 1.7.10;
Track if we saved l_private in the mcontext and don't blindly restore it.

This fixes the tests in /usr/tests/lib/libc/setjmp/t_threadjmp
 1.6 25-Feb-2011  joerg branches: 1.6.4; 1.6.8;
Be nicer to software that insists on -ansi and use __inline.
 1.5 24-Feb-2011  joerg Allow storing and receiving the LWP private pointer via ucontext_t
on all platforms except VAX and IA64. Add fast access via register for
AMD64, i386 and SH3 ports. Use this fast access in libpthread to replace
the stack based pthread_self(). Implement skeleton support for Alpha,
HPPA, PowerPC, SPARC and SPARC64, but leave it disabled.

Ports that support this feature provide __HAVE____LWP_GETPRIVATE_FAST in
machine/types.h and a corresponding __lwp_getprivate_fast in
machine/mcontext.h.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106; 1.4.108;
merge ktrace-lwp.
 1.3 18-Jul-2004  chs branches: 1.3.2;
add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.2 08-Oct-2003  thorpej Add some accessor macros for the ucontext:
* _UC_MACHINE_PC() - access the program counter
* _UC_MACHINE_INTRV() - access the integer return value register
* _UC_MACHINE_SET_PC() - set the program counter (this requires
special handling on some platforms).
 1.1 31-Aug-2003  chs add some placeholders so we can at least build.
 1.3.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.3 05-Aug-2004  skrll Fix some merge mistakes.
 1.3.2.2 03-Aug-2004  skrll Sync with HEAD
 1.3.2.1 18-Jul-2004  skrll file mcontext.h was added on branch ktrace-lwp on 2004-08-03 10:35:37 +0000
 1.4.108.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 05-Mar-2011  rmind sync with head
 1.6.8.1 18-Feb-2012  mrg merge to -current.
 1.6.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.6.4.1 17-Apr-2012  yamt sync with head
 1.7.10.1 18-May-2014  rmind sync with head
 1.7.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.22.3 21-Mar-2018  martin Pull up the following, requested by kamil in ticket #552:

external/gpl3/gcc{.old}/dist/libsanitizer/asan/asan_linux.cc 1.4
sys/arch/aarch64/include/mcontext.h 1.2
sys/arch/alpha/include/mcontext.h 1.9
sys/arch/amd64/include/mcontext.h 1.19
sys/arch/arm/include/mcontext.h 1.19
sys/arch/hppa/include/mcontext.h 1.9
sys/arch/i386/include/mcontext.h 1.14
sys/arch/ia64/include/mcontext.h 1.6
sys/arch/m68k/include/mcontext.h 1.10
sys/arch/mips/include/mcontext.h 1.22
sys/arch/or1k/include/mcontext.h 1.2
sys/arch/powerpc/include/mcontext.h 1.18
sys/arch/riscv/include/mcontext.h 1.5
sys/arch/sh3/include/mcontext.h 1.11
sys/arch/sparc/include/mcontext.h 1.14-1.17
sys/arch/sparc64/include/mcontext.h 1.10
sys/arch/vax/include/mcontext.h 1.9
tests/lib/libc/sys/Makefile 1.50
tests/lib/libc/sys/t_ucontext.c 1.2-1.5
sys/arch/hppa/include/mcontext.h 1.10
sys/arch/ia64/include/mcontext.h 1.7

- Introduce _UC_MACHINE_FP(). _UC_MACHINE_FP() is a helper
macro to extract from mcontext a frame pointer.
- Add new tests in lib/libc/sys/t_ucontext:
* ucontext_sp (testing _UC_MACHINE_SP)
* ucontext_fp (testing _UC_MACHINE_FP)
* ucontext_pc (testing _UC_MACHINE_PC)
* ucontext_intrv (testing _UC_MACHINE_INTRV)

Add a dummy implementation of _UC_MACHINE_INTRV() for ia64.

Implement _UC_MACHINE_INTRV() for hppa.

Make the t_ucontext.c test more portable.

We now have _UC_MACHINE_FP.
 1.8.22.2 26-Feb-2018  snj revert ticket 552, which broke the build
 1.8.22.1 25-Feb-2018  snj Pull up following revision(s) (requested by kamil in ticket #552):
sys/arch/aarch64/include/mcontext.h: 1.2
sys/arch/alpha/include/mcontext.h: 1.9
sys/arch/amd64/include/mcontext.h: 1.19
sys/arch/arm/include/mcontext.h: 1.19
sys/arch/hppa/include/mcontext.h: 1.9
sys/arch/i386/include/mcontext.h: 1.14
sys/arch/ia64/include/mcontext.h: 1.6
sys/arch/m68k/include/mcontext.h: 1.10
sys/arch/mips/include/mcontext.h: 1.22
sys/arch/or1k/include/mcontext.h: 1.2
sys/arch/powerpc/include/mcontext.h: 1.18
sys/arch/riscv/include/mcontext.h: 1.5
sys/arch/sh3/include/mcontext.h: 1.11
sys/arch/sparc/include/mcontext.h: 1.14-1.17
sys/arch/sparc64/include/mcontext.h: 1.10
sys/arch/vax/include/mcontext.h: 1.9
tests/lib/libc/sys/Makefile: 1.50
tests/lib/libc/sys/t_ucontext.c: 1.2
Introduce _UC_MACHINE_FP() as a macro
_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer.
Don't rely on this interface as a compiler might strip frame pointer or
optimize it making this interface unreliable.
For hppa assume a small frame context, for larger frames FP might be located
in a different register (4 instead of 3).
For ia64 there is no strict frame pointer, and registers might rotate.
Reuse 79 following:
./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM LOC_REG (79)
Once ia64 will mature, this should be revisited.
A macro can encapsulate a real function for extracting Frame Pointer on
more complex CPUs / ABIs.
For the remaining CPUs, reuse standard register as defined in appropriate ABI.
The direct users of this macro are LLVM and GCC with Sanitizers.
Proposed on tech-userlevel@.
Sponsored by <The NetBSD Foundation>
--
Improve _UC_MACHINE_FP() for SPARC/SPARC64
Introduce a static inline function _uc_machine_fp() that contains improved
caluclation of a frame pointer.
Algorithm:
uptr *stk_ptr;
# if defined (__arch64__)
stk_ptr = (uptr *) (*sp + 2047);
# else
stk_ptr = (uptr *) *sp;
# endif
*bp = stk_ptr[15];
Noted by <mrg>
--
Make _UC_MACHINE_FP() compile again and fix it so that it does not add
the offset twice.
--
fix _UC_MACHINE32_FP() -- use 32 bit pointer value so that [15] is
the right offset. do this by using __greg32_t, which is only in
the sparc64 version, and these are only useful there, so move them.
--
Add new tests in lib/libc/sys/t_ucontext
New tests:
- ucontext_sp
- ucontext_fp
- ucontext_pc
- ucontext_intrv
They test respectively:
- _UC_MACHINE_SP
- _UC_MACHINE_FP
- _UC_MACHINE_PC
- _UC_MACHINE_INTRV
These tests attempt to access and print the values from ucontext, without
interpreting the values.
This is a follow up of the _UC_MACHINE_FP() introduction.
These tests use PRIxREGISTER, and require to be built with -D_KERNTYPES.
Sponsored by <The NetBSD Foundation>
 1.10.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.13.2.1 02-Aug-2025  perseant Sync with HEAD
 1.19 13-Jul-2023  mrg re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.
 1.18 12-Jul-2023  riastradh machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.
 1.17 12-Jul-2023  mrg fix hppa and vax builds.

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

move the hppa ipl_t typedef with the moved usage of it.
 1.16 09-Jul-2023  riastradh machine/mutex.h: Sprinkle includes so this can be used by crash(8).

XXX pullup-10
 1.15 07-Jan-2020  ad branches: 1.15.26;
hppa has custom adaptive mutexes. Allow it to build again while not
reintroducing the main read of mtx_owner that I wanted to eliminate.
 1.14 29-Nov-2019  riastradh Nix mb_* on hppa.
 1.13 04-Oct-2017  christos branches: 1.13.4;
const me harder!
 1.12 24-Sep-2017  christos const me harder.
 1.11 16-Nov-2010  uebayasi branches: 1.11.18;
sys/mutex.h includes machine/intr.h via sys/intr.h, so no need here.
 1.10 14-Nov-2010  uebayasi Don't rely on global APIs from internal.
 1.9 28-Apr-2008  martin branches: 1.9.22;
Remove clause 3 and 4 from TNF licenses
 1.8 21-Nov-2007  yamt branches: 1.8.14; 1.8.16; 1.8.18;
make kmutex_t and krwlock_t smaller by killing lock id.
ok'ed by Andrew Doran.
 1.7 17-Oct-2007  garbled branches: 1.7.2;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.6 10-Sep-2007  skrll branches: 1.6.4;
Merge nick-csl-alignment.
 1.5 15-May-2007  skrll branches: 1.5.4; 1.5.8; 1.5.10;
Pull across #include file fix from yamt-idlelwp.
 1.4 15-Feb-2007  ad branches: 1.4.2; 1.4.4; 1.4.8; 1.4.10; 1.4.16;
Add MUTEX_CLEAR_WAITERS().
 1.3 10-Feb-2007  skrll Destroy a mutex correctly. That is, overright the owner and don't set
mtx_waiters.
 1.2 09-Feb-2007  ad Merge newlock2 to head.
 1.1 29-Jan-2007  ad branches: 1.1.2;
file mutex.h was initially added on branch newlock2.
 1.1.2.6 06-Feb-2007  skrll First pass at lock stubs for hppa. They don't work yet.
 1.1.2.5 06-Feb-2007  skrll Fix MUTEX_UNOWNED_OR_SPIN
 1.1.2.4 02-Feb-2007  ad Fix declarations. Spotted by uebayasi.
 1.1.2.3 01-Feb-2007  ad Handle hppa weirdness.
 1.1.2.2 01-Feb-2007  ad Header file cleanup.
 1.1.2.1 29-Jan-2007  ad Make hp700 compile.
 1.4.16.2 03-Oct-2007  garbled Sync with HEAD
 1.4.16.1 22-May-2007  matt Update to HEAD.
 1.4.10.1 11-Jul-2007  mjf Sync with head.
 1.4.8.3 03-Dec-2007  ad Sync with HEAD.
 1.4.8.2 09-Oct-2007  ad Sync with head.
 1.4.8.1 27-May-2007  ad Sync with head.
 1.4.4.5 07-Dec-2007  yamt sync with head
 1.4.4.4 27-Oct-2007  yamt sync with head.
 1.4.4.3 03-Sep-2007  yamt sync with head.
 1.4.4.2 26-Feb-2007  yamt sync with head.
 1.4.4.1 15-Feb-2007  yamt file mutex.h was added on branch yamt-lazymbuf on 2007-02-26 09:06:43 +0000
 1.4.2.1 08-May-2007  skrll This file needs machine/lock.h so add it.
 1.5.10.2 09-Jan-2008  matt sync with HEAD
 1.5.10.1 06-Nov-2007  matt sync with HEAD
 1.5.8.2 21-Nov-2007  joerg Sync with HEAD.
 1.5.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.5.4.1 18-Jul-2007  skrll Initial work on provided correctly aligned __cpu_simple_lock_t for hppa
and first attempt at adapting i386 to the changes.

More to come.
 1.6.4.1 21-Nov-2007  bouyer Sync with HEAD
 1.7.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.8.18.1 16-May-2008  yamt sync with head.
 1.8.16.1 18-May-2008  yamt sync with head.
 1.8.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.22.1 05-Mar-2011  rmind sync with head
 1.11.18.1 03-Dec-2017  jdolecek update from HEAD
 1.13.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.15.26.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

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

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

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

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

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

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

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

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

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

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

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

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

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

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

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

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

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

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

ddb: Cast pointer to uintptr_t first before db_expr_t.

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

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

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

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

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

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

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

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

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

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

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

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

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

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

fix hppa and vax builds.

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

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

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

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

re-fix hppa builds.

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

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

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

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

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

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

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

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

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

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

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

Note that fls32 is 1-based and returns 0 for x=0.
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file nvm.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file nvm.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file nvm.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.31 20-Apr-2025  riastradh t_signal_and_sp: Add hppa support.

Fortunately, hppa -- which uses monster 64-byte(!) stack alignment --
looks good already.

PR kern/59327: user stack pointer is not aligned properly
 1.30 22-Mar-2022  macallan branches: 1.30.10;
bump MSGBUFSIZE
 1.29 31-May-2021  simonb Include "opt_param.h" (ifdef _KERNEL_OPT) everywhere that MSGBUFSIZE is
referenced since some sources include <machine/param.h>.
 1.28 08-May-2021  skrll KNF
 1.27 01-May-2020  isaki branches: 1.27.6;
Move machine dependent AUDIO_BLK_MS default value to <machine/param.h>.
If the port has __AUDIO_BLK_MS in <machine/param.h>, it will be used.
Otherwise the default value (currently 10 msec) defined in audio.c will
be used. This mechanism is for very old ports which cannot satisfactorily
handle 10 msec block. Currently hppa, m68k, sh3, sparc(!64) and vax are.

For port maintainers, if general models in your port cannot satisfactorily
handle 10 msec block, please consider to define your suitable longer period
(40 msec would be a good first choice).
But please don't be eager to make the default value shorter.

<machine/param.h> was discussed in source-changes-d. It's better than
ifdef storm, or adding 60+ new header files in every arch/*/include/
directories for this. Thanks mrg@, ad@, and everyone.
http://mail-index.netbsd.org/source-changes-d/2020/05/01/msg012572.html
 1.26 21-Mar-2020  riastradh Revert another historic $Hdr$ collapse.
 1.25 05-Mar-2020  riastradh Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.
 1.24 05-Mar-2020  riastradh Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.
 1.23 16-Apr-2019  skrll branches: 1.23.4;
Trailing whitespace
 1.22 07-Jan-2019  jdolecek move DEV_BSIZE, DEV_BSHIFT out of MD param.h, they are same on all ports

also move BLKDEV_IOSIZE, MAXPHYS, but allow override since some ports
have different value (powerpc uses NBPG for BLKDEV_IOSIZE, sun2/sun3
have lower MAXPHYS)
 1.21 27-Oct-2015  mrg branches: 1.21.16; 1.21.18;
make sure MSGBUFSIZE can't expand strangely by using parens.
 1.20 24-Feb-2014  skrll branches: 1.20.6;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.19 10-Feb-2012  para branches: 1.19.6; 1.19.10;
proper sizing of kmem_arena on different ports

PR port-i386/45946: Kernel locks up in VMEM system
 1.18 04-Feb-2012  para improve sizing of kmem_arena now that more allocations are made from it
don't enforce limits if not required

ok: riz@
 1.17 24-Jan-2012  christos Use and define ALIGN() ALIGN_POINTER() and STACK_ALIGN() consistently,
and avoid definining them in 10 different places if not needed.
 1.16 20-Jan-2012  joerg Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressions
again. This was changed in sys/socket.h r1.51 to work around fallout
from the IPv6 aux data migration. It broke the historic ABI on some
platforms. This commit restores compatibility for netbsd32 code on such
platforms and provides a template for future changes to the CMSG_*
alignment. Revert PCC/Clang workarounds in postfix and tmux.
 1.15 08-Feb-2010  joerg branches: 1.15.10; 1.15.14;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
 1.14 17-Jan-2010  skrll branches: 1.14.2;
Simplify.
 1.13 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.12 10-Jan-2008  skrll branches: 1.12.10; 1.12.18; 1.12.24;
Various improvements to the hppa kernel for gdb.

- add the useful space and control registers to struct reg
- update process_{read,write}_regs accordingly
- use MID_HPPA in core dumps.
- dump the fp regs into cores.
- add single stepping support from OpenBSD.
 1.11 02-Jan-2008  he Remove the #endif corresponding to the #ifdef _KERNEL removed in previous.
 1.10 31-Dec-2007  ad Remove COMPAT_HPUX.
 1.9 03-Mar-2007  skrll branches: 1.9.20; 1.9.26; 1.9.32;
Remove hppa_{round,trunc}_page.
 1.8 28-Aug-2006  yamt branches: 1.8.8;
- remove unused bdbtofsb.
- move the following macros from MD headers to sys/param.h.
ctod
dtoc
ctob
btoc
dbtob
btodb
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.8;
merge ktrace-lwp.
 1.6 18-Jul-2004  chs branches: 1.6.12;
add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.5 20-Sep-2003  matt Use #ifdef _KERNEL_OPT around #include "opt_XXX.h"
 1.4 23-Jun-2003  martin branches: 1.4.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.3 28-Apr-2003  bjh21 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.2 01-Apr-2003  thorpej * Define PAGE_SHIFT, PAGE_SIZE, and PAGE_MASK in <hppa/vmparam.h>,
not in <hppa/param.h>.
* Define NBPG in terms of PGSHIFT.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file param.h was added on branch gehenna-devsw on 2002-07-14 17:47:28 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file param.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.12.3 21-Jan-2008  yamt sync with head
 1.6.12.2 03-Sep-2007  yamt sync with head.
 1.6.12.1 30-Dec-2006  yamt sync with head.
 1.7.8.1 03-Sep-2006  yamt sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.9.32.3 11-Jan-2008  bouyer Sync with HEAD
 1.9.32.2 08-Jan-2008  bouyer Sync with HEAD
 1.9.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.9.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.20.2 23-Mar-2008  matt sync with HEAD
 1.9.20.1 09-Jan-2008  matt sync with HEAD
 1.12.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.18.1 19-Feb-2009  skrll Fixup redzone stuff and enable it if DIAGNOSTIC.
 1.12.10.2 11-Mar-2010  yamt sync with head
 1.12.10.1 04-May-2009  yamt sync with head.
 1.14.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.15.14.1 18-Feb-2012  mrg merge to -current.
 1.15.10.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.10.1 17-Apr-2012  yamt sync with head
 1.19.10.1 18-May-2014  rmind sync with head
 1.19.6.2 03-Dec-2017  jdolecek update from HEAD
 1.19.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.21.18.1 10-Jun-2019  christos Sync with HEAD
 1.21.16.1 18-Jan-2019  pgoyette Synch with HEAD
 1.23.4.1 18-May-2020  martin Pull up following revision(s) (requested by isaki in ticket #911):

sys/dev/audio/audiodef.h: revision 1.13
sys/dev/audio/audiodef.h: revision 1.14
sys/arch/sparc/include/param.h: revision 1.74
sys/arch/evbarm/conf/GENERIC64: revision 1.148
sys/arch/sh3/include/param.h: revision 1.25
sys/arch/evbarm/conf/GENERIC: revision 1.75
sys/arch/m68k/include/param.h: revision 1.23
sys/arch/amd64/conf/GENERIC: revision 1.564
sys/arch/hppa/include/param.h: revision 1.27
sys/dev/audio/audio.c: revision 1.68
sys/arch/vax/include/param.h: revision 1.63
sys/dev/audio/audio.c: revision 1.69

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.

- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.

Set AUDIO_BLK_MS 40 msec on other old(slow) architectures not only m68k.

Thanks tsutsui@ for comment about architecture choice.
And move it from audiodef.h to audio.c as suggested by joerg@.


Move machine dependent AUDIO_BLK_MS default value to <machine/param.h>.
If the port has __AUDIO_BLK_MS in <machine/param.h>, it will be used.

Otherwise the default value (currently 10 msec) defined in audio.c will
be used. This mechanism is for very old ports which cannot satisfactorily
handle 10 msec block. Currently hppa, m68k, sh3, sparc(!64) and vax are.

For port maintainers, if general models in your port cannot satisfactorily
handle 10 msec block, please consider to define your suitable longer period
(40 msec would be a good first choice).

But please don't be eager to make the default value shorter.
<machine/param.h> was discussed in source-changes-d. It's better than
ifdef storm, or adding 60+ new header files in every arch/*/include/
directories for this. Thanks mrg@, ad@, and everyone.
http://mail-index.netbsd.org/source-changes-d/2020/05/01/msg012572.html
 1.27.6.2 17-Jun-2021  thorpej Sync w/ HEAD.
 1.27.6.1 13-May-2021  thorpej Sync with HEAD.
 1.30.10.1 02-Aug-2025  perseant Sync with HEAD
 1.10 16-Apr-2019  skrll Trailing whitespace
 1.9 16-Mar-2010  skrll branches: 1.9.60;
The FP regs are accessed in both physical and virtual modes. Make sure
they're allocated in directly mapped memory to avoid aliasing problems
and unnecessary cache flushing.

Fix various names and references. If we ever directly map the uarea and
pcb we can change things at that point.

Significantly helps my J210 (PA7200).

Mostly from OpenBSD.
 1.8 03-Nov-2009  snj branches: 1.8.2; 1.8.4;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.7 24-May-2009  skrll u_intNN_t -> uintNN_t

"same" code before and after.
 1.6 18-Jan-2008  skrll branches: 1.6.10;
Adjust comments to fit <80 columns.
 1.5 10-Jan-2008  skrll Various improvements to the hppa kernel for gdb.

- add the useful space and control registers to struct reg
- update process_{read,write}_regs accordingly
- use MID_HPPA in core dumps.
- dump the fp regs into cores.
- add single stepping support from OpenBSD.
 1.4 07-Apr-2007  skrll branches: 1.4.14; 1.4.20; 1.4.26;
Whitespace.
 1.3 11-Dec-2005  christos branches: 1.3.26; 1.3.30; 1.3.32;
merge ktrace-lwp.
 1.2 18-Jul-2004  chs branches: 1.2.12;
store the kernel stack pointer for a sleeping LWP in its PCB instead of
in its trapframe. this is needed for scheduler activations, so that we can
change the user stack pointer via the trapframe. from openbsd.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file pcb.h was added on branch gehenna-devsw on 2002-07-14 17:47:28 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file pcb.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.2.12.2 21-Jan-2008  yamt sync with head
 1.2.12.1 03-Sep-2007  yamt sync with head.
 1.3.32.1 11-Jul-2007  mjf Sync with head.
 1.3.30.1 10-Apr-2007  ad Sync with head.
 1.3.26.1 15-Apr-2007  yamt sync with head.
 1.4.26.2 19-Jan-2008  bouyer Sync with HEAD
 1.4.26.1 11-Jan-2008  bouyer Sync with HEAD
 1.4.20.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.14.1 23-Mar-2008  matt sync with HEAD
 1.6.10.3 11-Aug-2010  yamt sync with head.
 1.6.10.2 11-Mar-2010  yamt sync with head
 1.6.10.1 20-Jun-2009  yamt sync with head
 1.8.4.1 30-May-2010  rmind sync with head
 1.8.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.9.60.1 10-Jun-2019  christos Sync with HEAD
 1.3 16-Aug-2022  skrll Provide pci_intr_setattr (which does nothing atm)
 1.2 29-Mar-2014  christos branches: 1.2.4; 1.2.6; 1.2.10;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.1 24-Feb-2014  skrll Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 29-Mar-2014  tls file pci_machdep.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.2.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.6.1 29-Mar-2014  yamt file pci_machdep.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 29-Mar-2014  rmind file pci_machdep.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.3 24-Feb-2025  andvar fix various typos in comments.
 1.2 26-Mar-2023  andvar branches: 1.2.6;
fix various typos in documentation, comments and sysctl device description.
mainly aion -> ation and inlude -> include.
 1.1 24-Feb-2014  skrll branches: 1.1.4; 1.1.6; 1.1.10;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 24-Feb-2014  tls file pdc.h was added on branch tls-maxphys on 2014-08-20 00:03:05 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 24-Feb-2014  yamt file pdc.h was added on branch yamt-pagecache on 2014-05-22 11:39:50 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 24-Feb-2014  rmind file pdc.h was added on branch rmind-smpnet on 2014-05-18 17:45:11 +0000
 1.2.6.1 02-Aug-2025  perseant Sync with HEAD
 1.41 26-May-2022  skrll port-hppa/56849: Wacko kernel memory accounting in current/hppa

Two fixes:
- Don't include direct mapped memory in pmap statistics
- Decrement pmap statistics counts in pmap_kremove
 1.40 14-Mar-2020  ad pmap_remove_all(): Return a boolean value to indicate the behaviour. If
true, all mappings have been removed, the pmap is totally cleared out, and
UVM can then avoid doing the work to call pmap_remove() for each map entry.
If false, either nothing has been done, or some helpful arch-specific voodoo
has taken place.
 1.39 24-Feb-2020  ad Adjust for UVM locking changes.
 1.38 12-Aug-2019  skrll branches: 1.38.2;
Use __BIT()
 1.37 07-Jan-2013  chs branches: 1.37.38; 1.37.42;
switch to __USE_TOPDOWN_VM.
move the stack to the top of the user address space so that
the available free space is more contiguous.
 1.36 06-Jan-2012  skrll branches: 1.36.6;
Track if a page has an executable mapping and flush the icache (and
dcache) appropriately.

Fixes the lang/python26 build on my C3700 (PA8700) and chuq's J6700 with
PA8500.

Thanks to chuq for ideas and help with this.
 1.35 06-Jan-2012  skrll Comment fix.
 1.34 06-Jan-2012  skrll No need to flush the icache/itlb for pool pages as they're never marked
executable.
 1.33 23-Dec-2011  skrll Define PMAP_NEED_PROCWR and provide pmap_procwr so that the i-cache is
synchronised with the d-cache appropriately.
 1.32 16-Dec-2011  skrll Whitespace.
 1.31 16-Dec-2011  skrll G/C pvh_aliases
 1.30 12-Jun-2011  rmind branches: 1.30.2; 1.30.6;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

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

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

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

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

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

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.29 14-Nov-2010  uebayasi branches: 1.29.6;
Move struct vm_page_md definition from vmparam.h to pmap.h, because
it's used only by pmap. vmparam.h has definitions for wider
audience.

All GENERIC kernels build tested, except ia64.

powerpc/include/booke/vmparam.h has one too, but it has no pmap.h,
so it's left as is.
 1.28 06-Jul-2010  cegger Turn PMAP_NOCACHE into MI flag.
Add MI flags PMAP_WRITE_COMBINE, PMAP_WRITE_BACK, PMAP_NOCACHE_OVR.
Update pmap(9) manpage.

hppa: Remove MD PMAP_NOCACHE flag as it exists as MI flag
mips: Rename MD PMAP_NOCACHE to PGC_NOCACHE.

x86: Implement new MI flags using Page-Attribute Tables.
x86: Implement BUS_SPACE_MAP_PREFETCHABLE.

Patch presented on tech-kern@:
http://mail-index.netbsd.org/tech-kern/2010/06/30/msg008458.html

No comments on this last version.
 1.27 21-Jun-2010  skrll Allow PVF_UNCACHEABLE in set/clear of pmap_changebit call (for now).
 1.26 19-Mar-2010  skrll Not all PA CPUs have the U-bit (uncacheable) for non-IO memory. In fact
most don't. Deal with non-equivalent aliases by removing and flushing the
managed mappings, and flushing the unmanaged mappings.

When flushing caches/TLB flush the cache before purging the TLB just in
case the flush enters the mapping into the TLB.
 1.25 06-Mar-2010  skrll branches: 1.25.2;
Add #include "opt_cputype.h" where necessary.
 1.24 22-Feb-2010  skrll Deal with PA2.0 cache move-in rules by purging the TLB as well as
flushing/purging the cache.
 1.23 15-Nov-2009  skrll branches: 1.23.2;
Put PMAP_NOCACHE in the MD space.
 1.22 11-Nov-2009  skrll Use the new flags argument to pmap_kenter_pa for PMAP_NOCACHE.
 1.21 24-May-2009  skrll u_intNN_t -> uintNN_t

"same" code before and after.
 1.20 30-Apr-2009  skrll Remove if defined(HP7100LC_CPU) || defined(HP7300LC_CPU) from around
pmap_hptsize and pdc_hwtlb (for now).
 1.19 30-Apr-2009  skrll Move HPPA_SID_KERNEL into pmap.h and deal with the move.
 1.18 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.17 09-Dec-2008  pooka branches: 1.17.2;
Make pmap_kernel() a MI macro for struct pmap *kernel_pmap_ptr,
which is now the "API" provided by the pmap module. pmap_kernel()
remains as the syntactic sugar.

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

Thanks to Greg Oster for providing cpu muscle for doing test builds.
 1.16 06-Jan-2008  dsl branches: 1.16.6; 1.16.10; 1.16.16; 1.16.18;
include sys/simplelock.h
 1.15 17-Oct-2007  garbled branches: 1.15.2; 1.15.8;
Merge the ppcoea-renovation branch to HEAD.

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

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

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.14 12-Jul-2007  skrll branches: 1.14.10;
Like I said - don't futz with the trapframe in pmap_activate. Instead
update the trapframe space and protection register in cpu_lwp_fork and
setregs.
 1.13 18-May-2007  skrll pmap_activate shouldn't play with the trap frame - especially not now it's
called by the MI code.

Implement a way of tracking the vmspace allocated to a process and its
LWPs so that if it changes underneath us we can correct the space id in
the trapframe in pmap_activate for now.

An example of when this happens is vfork/exec.

An exec hook is probably the way to go.
 1.12 07-Apr-2007  skrll branches: 1.12.4;
de-__P()

s/lwp/l/ for argument name in pmap_deactivate.
 1.11 16-Feb-2006  perry branches: 1.11.20; 1.11.24; 1.11.26;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.10 24-Dec-2005  perry branches: 1.10.2; 1.10.4; 1.10.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 17-Jan-2005  atatat branches: 1.8.8;
Convert the PMAP_PREFER() macro from two arguments (offset and hint)
to four (adding size and direction).

In order for topdown uvm to be an option on ports using PMAP_PREFER,
they will need to "prefer" lower addresses if topdown is being used.
Additionally, at least one port also needs to know the size.
 1.7 18-Jul-2004  chs branches: 1.7.4;
add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.6 18-May-2004  chs convert pmap_deactivate() from a macro to an inline function
so that the kernel builds again.
 1.5 05-Jan-2004  chs add a PMAP_NC flag for pmap_kenter_pa() to specific a non-cached mapping.
use this in mbus_dmamem_map() to fix corruption of DMA memory.
note that this TLB bit is ignored on some CPUs (PA7100 and probably
others of that era), so this doesn't fix the problem in general,
but it does work on newer models and will make things easier later.
 1.4 31-Aug-2003  chs update for LWPs, and some lite cleanup.
 1.3 22-Sep-2002  chs branches: 1.3.6;
it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not. doh.
 1.2 22-Sep-2002  chs add pmap_remove_all() hook (empty on most platforms so far).
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file pmap.h was added on branch gehenna-devsw on 2002-07-14 17:47:29 +0000
 1.1.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file pmap.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.3.6.2 17-Jan-2005  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.8.8.2 21-Jan-2008  yamt sync with head
 1.8.8.1 03-Sep-2007  yamt sync with head.
 1.10.6.1 22-Apr-2006  simonb Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.10.2.1 18-Feb-2006  yamt sync with head.
 1.11.26.1 11-Jul-2007  mjf Sync with head.
 1.11.24.3 15-Jul-2007  ad Sync with head.
 1.11.24.2 27-May-2007  ad Sync with head.
 1.11.24.1 10-Apr-2007  ad Sync with head.
 1.11.20.1 15-Apr-2007  yamt sync with head.
 1.12.4.2 03-Oct-2007  garbled Sync with HEAD
 1.12.4.1 22-May-2007  matt Update to HEAD.
 1.14.10.2 09-Jan-2008  matt sync with HEAD
 1.14.10.1 06-Nov-2007  matt sync with HEAD
 1.15.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.15.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.16.18.13 28-Apr-2009  skrll Track unmanaged mappings to deal with loaning and non-equivalient aliases.
 1.16.18.12 11-Feb-2009  skrll -extern struct pmap kernel_pmap_store;
 1.16.18.11 11-Feb-2009  skrll Handle non-equivalent aliases.

Thanks to mjf for help with this.
 1.16.18.10 30-Jan-2009  skrll Add some defines for attributes of pages or mappings of pages
 1.16.18.9 25-Jan-2009  skrll Be careful not to PMAP_UNMAP_POOLPAGE and leave cache aliases.
 1.16.18.8 19-Jan-2009  skrll Sync with HEAD.
 1.16.18.7 09-Dec-2008  mjf Back out my previous change. PMAP_NC is blatantly used, which means I
just broke the build.
 1.16.18.6 08-Dec-2008  mjf Delete PMAP_NC because it's never used. To mark a vmpage as uncacheable
we use pmap_pvh_attrs(TLB_UNCACHEABLE) instead.
 1.16.18.5 02-Dec-2008  skrll Whirespace.
 1.16.18.4 02-Dec-2008  skrll Add PMAP_{,UN}MAP_POOLPAGE
 1.16.18.3 17-Nov-2008  skrll Restore PMAP_NC
 1.16.18.2 17-Nov-2008  skrll G/C some old stuff.
 1.16.18.1 27-Oct-2008  skrll Commit work in progress.
 1.16.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.16.10.4 11-Aug-2010  yamt sync with head.
 1.16.10.3 11-Mar-2010  yamt sync with head
 1.16.10.2 20-Jun-2009  yamt sync with head
 1.16.10.1 04-May-2009  yamt sync with head.
 1.16.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.17.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.23.2.4 16-Nov-2010  uebayasi Sync with HEAD.
 1.23.2.3 17-Aug-2010  uebayasi Sync with HEAD.
 1.23.2.2 30-Apr-2010  uebayasi Sync with HEAD.
 1.23.2.1 25-Feb-2010  uebayasi Use VM_PAGE_TO_MD(). Only compile tested.
 1.25.2.5 09-Mar-2011  skrll Drop per-page locking i.e. pvh_lock and rely on locking provided by
upper layer, UVM. Sprinkle asserts.
 1.25.2.4 05-Mar-2011  rmind sync with head
 1.25.2.3 03-Jul-2010  rmind sync with head
 1.25.2.2 30-May-2010  rmind sync with head
 1.25.2.1 16-Mar-2010  rmind Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc(). It allows us to share the locks among UVM objects.
 1.29.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.30.6.1 18-Feb-2012  mrg merge to -current.
 1.30.2.2 23-Jan-2013  yamt sync with head
 1.30.2.1 17-Apr-2012  yamt sync with head
 1.36.6.1 25-Feb-2013  tls resync with head
 1.37.42.1 10-Jun-2022  martin Pull up following revision(s) (requested by skrll in ticket #1467):

sys/arch/hppa/include/pmap.h: revision 1.41
sys/arch/hppa/hppa/pmap.c: revision 1.117

port-hppa/56849: Wacko kernel memory accounting in current/hppa

Two fixes:
- Don't include direct mapped memory in pmap statistics
- Decrement pmap statistics counts in pmap_kremove
 1.37.38.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.37.38.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.38.2.1 29-Feb-2020  ad Sync with head.
 1.2 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

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

* Removes the PMC code of ARM XSCALE.

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

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

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

* Removes the pmc_evid_t and pmc_ctr_t types.

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

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.1.202.1 10-Jun-2019  christos Sync with HEAD
 1.1.200.1 28-Jul-2018  pgoyette Sync with HEAD
 1.1.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.4.1 07-Aug-2002  jdolecek file pmc.h was added on branch kqueue on 2002-09-06 08:35:50 +0000
 1.1.2.2 31-Aug-2002  gehenna catch up with -current.
 1.1.2.1 07-Aug-2002  gehenna file pmc.h was added on branch gehenna-devsw on 2002-08-31 13:44:48 +0000
 1.15 23-Jul-2023  skrll PR/57261: hppa should be converted to __HAVE_SYSCALL_INTERN

Provide syscall_intern and use the md_syscall in syscall trap handling.
 1.14 23-Jul-2023  skrll Use __BIT
 1.13 05-Dec-2020  christos Use __vaddr_t since we don't expose vaddr_t by default to userland.
 1.12 06-Mar-2014  skrll branches: 1.12.42;
Move to a flat space register convention. %sr[4-7] are all now the space
number allocated to the process. gcc produces (slightly) better code
with this convention.

Retain backwards compatiblity.

Welcome to 6.99.36
 1.11 14-Jan-2011  rmind branches: 1.11.8; 1.11.18; 1.11.22;
Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete. Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
 1.10 03-Apr-2010  skrll Add md_astpending to struct mdlwp and use it.
 1.9 31-Mar-2010  skrll Whitespace.
 1.8 21-Nov-2009  rmind branches: 1.8.2; 1.8.4;
Include sys/user.h for MD proc.h (hppa and m68k ports).
 1.7 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.6 10-Jan-2008  skrll branches: 1.6.10; 1.6.18; 1.6.24;
Various improvements to the hppa kernel for gdb.

- add the useful space and control registers to struct reg
- update process_{read,write}_regs accordingly
- use MID_HPPA in core dumps.
- dump the fp regs into cores.
- add single stepping support from OpenBSD.
 1.5 16-Nov-2007  skrll branches: 1.5.6;
s/proc/lwp/ in comment
 1.4 11-Dec-2005  christos branches: 1.4.30; 1.4.48; 1.4.50; 1.4.54; 1.4.56;
merge ktrace-lwp.
 1.3 31-Aug-2003  chs branches: 1.3.16;
update for LWPs, and some lite cleanup.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file proc.h was added on branch gehenna-devsw on 2002-07-14 17:47:29 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file proc.h was added on branch kqueue on 2002-06-23 17:37:09 +0000
 1.3.16.2 21-Jan-2008  yamt sync with head
 1.3.16.1 07-Dec-2007  yamt sync with head
 1.4.56.2 18-Feb-2008  mjf Sync with HEAD.
 1.4.56.1 19-Nov-2007  mjf Sync with HEAD.
 1.4.54.1 18-Nov-2007  bouyer Sync with HEAD
 1.4.50.2 23-Mar-2008  matt sync with HEAD
 1.4.50.1 09-Jan-2008  matt sync with HEAD
 1.4.48.1 21-Nov-2007  joerg Sync with HEAD.
 1.4.30.1 03-Dec-2007  ad Sync with HEAD.
 1.5.6.1 11-Jan-2008  bouyer Sync with HEAD
 1.6.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.18.1 27-Oct-2008  skrll Commit work in progress.
 1.6.10.3 11-Aug-2010  yamt sync with head.
 1.6.10.2 11-Mar-2010  yamt sync with head
 1.6.10.1 04-May-2009  yamt sync with head.
 1.8.4.2 05-Mar-2011  rmind sync with head
 1.8.4.1 30-May-2010  rmind sync with head
 1.8.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.11.22.1 18-May-2014  rmind sync with head
 1.11.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.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.12.42.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.8 12-Nov-2007  skrll Fix kernel profiling on HPPA.

- stop gcc emitting stuff that HPUX requires
- don't use splhigh() in MCOUNT_ENTER as a call to _mcount will be
generated at the moment. Disable interrupts in hardware instead.
- Fix _PROF_PROLOGUE to save/restore all the register args when calling
_mcount.
- Fixup LEAF_ENTRY to dtrt (I think) in the GPROF case.
- Provide LEAF_ENTRY_NOPROFILE and sprinkle its use where i) profiling
causes problems, e.g. trap handlers, and ii) where it just doesn't
make sense, e.g. start.
 1.7 07-Apr-2007  skrll branches: 1.7.12; 1.7.14; 1.7.18; 1.7.20;
de-__P()

s/lwp/l/ for argument name in pmap_deactivate.
 1.6 16-Feb-2006  perry branches: 1.6.20; 1.6.24; 1.6.26;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.5 24-Dec-2005  perry branches: 1.5.2; 1.5.4; 1.5.6;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.4 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file profile.h was added on branch gehenna-devsw on 2002-07-14 17:47:29 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file profile.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.2.16.3 15-Nov-2007  yamt sync with head.
 1.2.16.2 03-Sep-2007  yamt sync with head.
 1.2.16.1 21-Jun-2006  yamt sync with head.
 1.5.6.1 22-Apr-2006  simonb Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.5.2.1 18-Feb-2006  yamt sync with head.
 1.6.26.1 11-Jul-2007  mjf Sync with head.
 1.6.24.2 03-Dec-2007  ad Sync with HEAD.
 1.6.24.1 10-Apr-2007  ad Sync with head.
 1.6.20.1 15-Apr-2007  yamt sync with head.
 1.7.20.1 19-Nov-2007  mjf Sync with HEAD.
 1.7.18.1 13-Nov-2007  bouyer Sync with HEAD
 1.7.14.1 09-Jan-2008  matt sync with HEAD
 1.7.12.1 14-Nov-2007  joerg Sync with HEAD.
 1.9 08-Feb-2018  dholland Typos.
 1.8 29-Mar-2012  skrll Remove unnecessary #include
 1.7 03-Nov-2009  snj branches: 1.7.12; 1.7.16;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.6 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.5 18-Jan-2008  skrll branches: 1.5.10; 1.5.18; 1.5.24;
Add W and O PSW bit defines.

From OpenBSD.
 1.4 11-Dec-2005  christos branches: 1.4.50; 1.4.56; 1.4.64;
merge ktrace-lwp.
 1.3 18-Jul-2004  chs branches: 1.3.12;
add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.2 31-Aug-2003  chs update for LWPs, and some lite cleanup.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file psl.h was added on branch gehenna-devsw on 2002-07-14 17:47:30 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file psl.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.3.12.1 21-Jan-2008  yamt sync with head
 1.4.64.1 19-Jan-2008  bouyer Sync with HEAD
 1.4.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.50.1 23-Mar-2008  matt sync with HEAD
 1.5.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.18.1 27-Oct-2008  skrll Commit work in progress.
 1.5.10.2 11-Mar-2010  yamt sync with head
 1.5.10.1 04-May-2009  yamt sync with head.
 1.7.16.1 05-Apr-2012  mrg sync to latest -current.
 1.7.12.1 17-Apr-2012  yamt sync with head
 1.5 16-Apr-2019  skrll Trailing whitespace
 1.4 16-Jan-2010  skrll branches: 1.4.64;
Add a couple of comments and some whitespace.
 1.3 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.2 11-Aug-2002  fredette branches: 1.2.112; 1.2.120; 1.2.126;
Significant pmap changes to no longer rely on the "U-bit" (TLB_UNCACHEABLE)
to deal with aliasing of regular memory pages, because many processors don't
support it.

Now, the pmap marks all mappings of a page that has any non-equivalent
aliasing and any writable mapping, and the fault handlers watch for this
and flush other mappings out of the TLB and cache before (re)entering a
conflicting mapping.

When a page has non-equivalent aliasing, only one writable mapping at
a time may be in the TLB and cache. If no writable mapping is in the
TLB and cache, any number of read-only mappings may be.

The PA7100LC/PA7300LC fault handlers have not been converted yet.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.3 31-Aug-2002  gehenna catch up with -current.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file pte.h was added on branch gehenna-devsw on 2002-07-14 17:47:30 +0000
 1.1.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file pte.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.2.126.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.120.2 29-Oct-2008  skrll Improve TLB_BITS.

Tidy-up a bit.
 1.2.120.1 27-Oct-2008  skrll Commit work in progress.
 1.2.112.2 11-Mar-2010  yamt sync with head
 1.2.112.1 04-May-2009  yamt sync with head.
 1.4.64.1 10-Jun-2019  christos Sync with HEAD
 1.12 06-Jun-2022  skrll Match up PTRACE_BREAKPOINT_ASM with PTRACE_BREAKPOINT which is the
gdb breakpoint instruction.
 1.11 06-Jun-2022  skrll Define a PTRACE_ILLEGAL_ASM
 1.10 24-Dec-2019  kamil Introduce PT_LWPSTATUS + PT_LWPNEXT, obsolete PT_LWPINFO

PT_LWPINFO is a legacy ptrace(2) operation that was originally intended
to retrieve the thread (LWP) information inside a traced process.

It has a number of flaws and is confused with PT_LWPINFO from FreeBSD.

PT_LWPSTATUS and PT_LWPNEXT address the problems (shortly by: rename,
removal of pl_event) and introduces new features: signal context
(pl_sigpend, pl_sigmask), LWP name (pl_name), LWP TLS base address
(pl_private). The private pointer was so far missing information for
a debugger.

PT_LWPSTATUS@nnn is now shipped with core(5) files and contain LWP specific
information, so far missed in the core(5) files.

PT_LWPSTATUS retrieves LWP information for the prompted thread.
PT_LWPNEXT retrieves LWP information for the next thread, borrowing the
semantics from NetBSD specific PT_LWPINFO.

PT_LWPINFO is namespaced with __LEGACY_PT_LWPINFO and still available for
the foreseeable future, without plans of removing it.

Add ATF tests for PT_LWPSTATUS + PT_LWPNEXT.

Keep ATF tests for PT_LWPINFO.

Switch GDB to new API.

Proposed on tech-kern@.
 1.9 18-Jun-2019  kamil branches: 1.9.2;
Introduce PTRACE_REG_FP() a helper macro to retrieve the frame pointer

The macro is dummy for ia64 (the FP register is unknown and can change
freely) and sparc/sparc64 (not stored in struct reg).
 1.8 12-Apr-2017  kamil branches: 1.8.12;
Add new macro PTRACE_BREAKPOINT_ASM in <sys/ptrace.h> MD part

This macro ships with a MD-specific assembly instruction triggering
a software breakpoint.

Missing instruction for powerpc targets.

This code is used in ATF tests (lib/libc/sys/t_ptrace_wait).

Original patch by Nick Hudson, thanks!
 1.7 08-Apr-2017  kamil Add new ptrace(2) API: PT_SETSTEP & PT_CLEARSTEP

These operations allow to mark thread as a single-stepping one.

This allows to i.a.:
- single step and emit a signal (PT_SETSTEP & PT_CONTINUE)
- single step and trace syscall entry and exit (PT_SETSTEP & PT_SYSCALL)

The former is useful for debuggers like GDB or LLDB. The latter can be used
to singlestep a usermode kernel. These examples don't limit use-cases of
this interface.

Define PT_*STEP only for platforms defining PT_STEP.

Add new ATF tests setstep[1234].

These ptrace(2) operations first appeared in FreeBSD.

Sponsored by <The NetBSD Foundation>
 1.6 25-Nov-2016  christos branches: 1.6.2;
fix register names
 1.5 25-Sep-2015  christos branches: 1.5.2;
For processors that have memory breakpoints, add macros for them to help
libproc
 1.4 15-Sep-2015  christos Provide access to pc/sp/syscall-return registers like we have for mcontext
 1.3 03-Nov-2009  snj branches: 1.3.22; 1.3.40;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.2 22-Nov-2007  skrll branches: 1.2.18;
Define PT_MACHDEP_STRINGS for kdump(1)
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.26; 1.1.68; 1.1.86; 1.1.88; 1.1.92; 1.1.94;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.94.1 08-Dec-2007  mjf Sync with HEAD.
 1.1.92.1 22-Nov-2007  bouyer Sync with HEAD
 1.1.88.1 09-Jan-2008  matt sync with HEAD
 1.1.86.1 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.1.68.2 03-Dec-2007  ad Sync with HEAD.
 1.1.68.1 03-Dec-2007  ad Sync with HEAD.
 1.1.26.1 07-Dec-2007  yamt sync with head
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file ptrace.h was added on branch gehenna-devsw on 2002-07-14 17:47:31 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file ptrace.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.2.18.1 11-Mar-2010  yamt sync with head
 1.3.40.4 28-Aug-2017  skrll Sync with HEAD
 1.3.40.3 05-Dec-2016  skrll Sync with HEAD
 1.3.40.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.3.40.1 22-Sep-2015  skrll Sync with HEAD
 1.3.22.1 03-Dec-2017  jdolecek update from HEAD
 1.5.2.2 26-Apr-2017  pgoyette Sync with HEAD
 1.5.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.6.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.8.12.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8.12.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.9.2.1 10-Jun-2022  martin Pull up following revision(s) (requested by skrll in ticket #1468):

sys/arch/hppa/hppa/trap.c: revision 1.120
sys/arch/hppa/include/ptrace.h: revision 1.11-1.12 (via patch)

Define a PTRACE_ILLEGAL_ASM

Match up PTRACE_BREAKPOINT_ASM with PTRACE_BREAKPOINT which is the
gdb breakpoint instruction.

Only report the SSBREAKPOINT break instruction as SIGTRAP/TRAP_TRACE. All
other break instructions will be reported as SIGTRAP/TRAP_BRKPT
This fixes a mistake I made back in 2008.

PR/56866: hppa: kernel gets confused between actual breakpoints and
single-step breakpoints
 1.13 16-Apr-2019  skrll Trailing whitespace
 1.12 06-Jun-2010  skrll branches: 1.12.60;
MULTIPROCESSOR fixes

- provide curcpu in a control register instead of curlwp
- define {GET,SET}_CURLWP and GET_CURCPU and use whereever possible.
- define a cpu count and use it in CPU_INFO_FOREACH

XXX hppa_ncpus isn't valid yet.
 1.11 16-Mar-2010  skrll The FP regs are accessed in both physical and virtual modes. Make sure
they're allocated in directly mapped memory to avoid aliasing problems
and unnecessary cache flushing.

Fix various names and references. If we ever directly map the uarea and
pcb we can change things at that point.

Significantly helps my J210 (PA7200).

Mostly from OpenBSD.
 1.10 03-Nov-2009  snj branches: 1.10.2; 1.10.4;
Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.9 24-May-2009  skrll u_intNN_t -> uintNN_t

"same" code before and after.
 1.8 16-May-2009  skrll Note that CR27 is used for thread local storage (TLS)
 1.7 30-Apr-2009  skrll Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.6 10-Jan-2008  skrll branches: 1.6.10; 1.6.18; 1.6.24;
Various improvements to the hppa kernel for gdb.

- add the useful space and control registers to struct reg
- update process_{read,write}_regs accordingly
- use MID_HPPA in core dumps.
- dump the fp regs into cores.
- add single stepping support from OpenBSD.
 1.5 11-Dec-2005  christos branches: 1.5.50; 1.5.56; 1.5.64;
merge ktrace-lwp.
 1.4 31-Jan-2005  jkunz branches: 1.4.6;
Implement powerd(8) interface via sysmon(9) for power switch, controllable by sysctl(8).
 1.3 26-Aug-2004  jkunz branches: 1.3.4; 1.3.6;
Import STI wscons(4) driver from OpenBSD and add new driver for PS/2
keyboard / mouse pots of LASI.
 1.2 18-Jul-2004  chs add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.3 04-Feb-2005  skrll Sync with HEAD.
 1.1.10.2 03-Sep-2004  skrll Sync with HEAD
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file reg.h was added on branch gehenna-devsw on 2002-07-14 17:47:31 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file reg.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.3.6.1 12-Feb-2005  yamt sync with head.
 1.3.4.1 29-Apr-2005  kent sync with -current
 1.4.6.1 21-Jan-2008  yamt sync with head
 1.5.64.1 11-Jan-2008  bouyer Sync with HEAD
 1.5.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.5.50.1 23-Mar-2008  matt sync with HEAD
 1.6.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.18.3 17-Apr-2009  skrll Correct a comment.
 1.6.18.2 28-Feb-2009  skrll Correct comment.
 1.6.18.1 27-Oct-2008  skrll Commit work in progress.
 1.6.10.4 11-Aug-2010  yamt sync with head.
 1.6.10.3 11-Mar-2010  yamt sync with head
 1.6.10.2 20-Jun-2009  yamt sync with head
 1.6.10.1 04-May-2009  yamt sync with head.
 1.10.4.2 03-Jul-2010  rmind sync with head
 1.10.4.1 30-May-2010  rmind sync with head
 1.10.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.10.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.12.60.1 10-Jun-2019  christos Sync with HEAD
 1.2 03-Nov-2009  snj Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.116;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.116.1 11-Mar-2010  yamt sync with head
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file reloc.h was added on branch gehenna-devsw on 2002-07-14 17:47:31 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file reloc.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.6 29-Nov-2019  riastradh Largely eliminate the MD rwlock.h header file.

This was full of definitions that have been obsolete for over a
decade. The file still remains for __HAVE_RW_STUBS but that's all.
Used only internally in kern_rwlock.c now, not by <sys/rwlock.h>.
 1.5 28-Apr-2008  martin branches: 1.5.88;
Remove clause 3 and 4 from TNF licenses
 1.4 29-Nov-2007  ad branches: 1.4.14; 1.4.16; 1.4.18;
- Change lock_cas from "compare and set" to "compare and swap".
- Add aliases for atomic_cas_ulong(), etc.

Ok skrll@
 1.3 21-Nov-2007  yamt make kmutex_t and krwlock_t smaller by killing lock id.
ok'ed by Andrew Doran.
 1.2 09-Feb-2007  ad branches: 1.2.4; 1.2.8; 1.2.24; 1.2.26; 1.2.30; 1.2.32;
Merge newlock2 to head.
 1.1 29-Jan-2007  ad branches: 1.1.2;
file rwlock.h was initially added on branch newlock2.
 1.1.2.1 29-Jan-2007  ad Make hp700 compile.
 1.2.32.1 08-Dec-2007  mjf Sync with HEAD.
 1.2.30.1 21-Nov-2007  bouyer Sync with HEAD
 1.2.26.1 09-Jan-2008  matt sync with HEAD
 1.2.24.2 03-Dec-2007  joerg Sync with HEAD.
 1.2.24.1 21-Nov-2007  joerg Sync with HEAD.
 1.2.8.1 03-Dec-2007  ad Sync with HEAD.
 1.2.4.3 07-Dec-2007  yamt sync with head
 1.2.4.2 26-Feb-2007  yamt sync with head.
 1.2.4.1 09-Feb-2007  yamt file rwlock.h was added on branch yamt-lazymbuf on 2007-02-26 09:06:43 +0000
 1.4.18.1 16-May-2008  yamt sync with head.
 1.4.16.1 18-May-2008  yamt sync with head.
 1.4.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.88.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file setjmp.h was added on branch gehenna-devsw on 2002-07-14 17:47:31 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file setjmp.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.12 28-Oct-2021  christos Finish restoring the compat code.
 1.11 28-Oct-2021  christos We still need struct sigcontext for longjmp.
 1.10 27-Oct-2021  thorpej "struct sigcontext" has never been used on NetBSD/hppa; garbage-collect
it and other related definitions.
 1.9 26-Oct-2021  christos Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
sigcontext before. all the other ports that supported sigcontext had
the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
 1.8 16-Apr-2019  skrll Trailing whitespace
 1.7 29-Nov-2017  christos branches: 1.7.4;
need sigtypes.h for sigset_t, since <sys/siginfo.h> includes this directly.
 1.6 02-Jan-2011  skrll branches: 1.6.18;
__HAVE_SIGINFO has not been required/used for a long time now.

Prompted by uwe@
 1.5 11-Dec-2005  christos branches: 1.5.100;
merge ktrace-lwp.
 1.4 26-Mar-2004  drochner To the rest of the kernel, pretend that hppa supports SIGINFO.
There are still only "sigcontext" stackframes passed to the user,
but at least we can clean up the MI sources now.
 1.3 20-Sep-2003  matt Add multiple inclusion protection.
 1.2 28-Apr-2003  bjh21 branches: 1.2.2;
Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file signal.h was added on branch gehenna-devsw on 2002-07-14 17:47:32 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file signal.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.100.1 05-Mar-2011  rmind sync with head
 1.6.18.1 03-Dec-2017  jdolecek update from HEAD
 1.7.4.1 10-Jun-2019  christos Sync with HEAD
 1.2 03-Nov-2009  snj Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.116;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.116.1 11-Mar-2010  yamt sync with head
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file som.h was added on branch gehenna-devsw on 2002-07-14 17:47:32 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file som.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.2 03-Mar-2007  skrll Actually remove spinlock.h
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.26; 1.1.64;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.64.2 17-May-2007  yamt fix a merge botch.
 1.1.64.1 12-Mar-2007  rmind Sync with HEAD.
 1.1.26.1 03-Sep-2007  yamt sync with head.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file spinlock.h was added on branch gehenna-devsw on 2002-07-14 17:47:32 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file spinlock.h was added on branch kqueue on 2002-06-23 17:37:10 +0000
 1.7 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.6 07-Jul-2011  mrg port to GCC 4.5.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 04-Feb-2005  skrll Modernise these to use GCC __builtin_* functions and types.

Also provide a (protected) va_copy.
 1.3 03-Feb-2005  jmc Provide lint wrappers around the va_* defs like other ports do so this can
make it through lint (was dying in libpam)
 1.2 07-Aug-2003  agc branches: 1.2.8; 1.2.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.5 04-Feb-2005  skrll Sync with HEAD.
 1.1.10.4 04-Feb-2005  skrll Sync with HEAD.
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file stdarg.h was added on branch gehenna-devsw on 2002-07-14 17:47:33 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file stdarg.h was added on branch kqueue on 2002-06-23 17:37:11 +0000
 1.2.10.1 12-Feb-2005  yamt sync with head.
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.5 06-Sep-2021  andvar fix various typos in comments.
 1.4 16-Jan-2010  skrll Use the description in the ACD for T_DBREAK.
 1.3 03-Nov-2009  snj Follow upstream license changes for files with Michael Shalayeff's
copyright. In most cases, this means dropping the 3rd and 4th clauses.
 1.2 22-Dec-2007  skrll branches: 1.2.10;
Add some more trap types and HPPA_BREAK_SS. From OpenBSD.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.26; 1.1.88; 1.1.98; 1.1.102;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.102.1 02-Jan-2008  bouyer Sync with HEAD
 1.1.98.1 26-Dec-2007  ad Sync with head.
 1.1.88.1 09-Jan-2008  matt sync with HEAD
 1.1.26.1 21-Jan-2008  yamt sync with head
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file trap.h was added on branch gehenna-devsw on 2002-07-14 17:47:33 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file trap.h was added on branch kqueue on 2002-06-23 17:37:11 +0000
 1.2.10.1 11-Mar-2010  yamt sync with head
 1.33 28-Apr-2024  skrll Whitespace
 1.32 23-Jul-2023  skrll PR/57261: hppa should be converted to __HAVE_SYSCALL_INTERN

Provide syscall_intern and use the md_syscall in syscall trap handling.
 1.31 01-Apr-2021  simonb Whitespace: #define<tab>
 1.30 23-Jan-2021  christos branches: 1.30.2;
Document via __HAVE_BUS_SPACE_8 platforms that implement bus_space_*_8
 1.29 05-Dec-2020  christos Use __vaddr_t since we don't expose vaddr_t by default to userland.
 1.28 16-Apr-2020  skrll branches: 1.28.2;
To allow concurrent page faults on the same set of pages lock the PV
lists. From ad@ and fixed up by me.

Remove __HAVE_UNLOCKED_PMAP
 1.27 22-Mar-2020  ad branches: 1.27.2;
Temporarily mark hppa, mips, powerpc and riscv with __HAVE_UNLOCKED_PMAP,
for the benefit of UVM.

These need some pmap changes to support concurrent faults on the same
object. I have changes to do just that, but they're a work in progress.
 1.26 23-Jan-2016  christos branches: 1.26.18;
expose the kernel types for standalone code.
 1.25 23-Jan-2016  christos Hide {p,v}{addr,size}_t and register_t (and a couple more types that
are machine-specific) from userland unless _KERNEL/_KMEMUSER and a
new _KERNTYPES variables is defined. The _KERNTYPES should be fixed
for many subsystems that should not be using it (rump)...
 1.24 27-Aug-2015  pooka Fix PTHREAD_FOO_INITIALIZER for C++ by not using volatile in the relevant
pthread types in C++ builds, attempt 2.

The problem with attempt 1 was making assumptions of what the MD
__cpu_simple_lock_t (declared volatile) looks like. To get a same type
except non-volatile, we change the MD type to __cpu_simple_lock_nv_t
and typedef __cpu_simple_lock_t as a volatile __cpu_simple_lock_nv_t.
IMO, __cpu_simple_lock_t should not be volatile at all, but changing it
now is too risky.

Fixes at least Rumprun w/ gcc 5.1/5.2. Furthermore, the mpd application
(and possibly others) will no longer require NetBSD-specific patches.

Tested: build.sh for i386, Rumprun for x86_64 w/ gcc 5.2.

Based on the patch from Christos in lib/49989.
 1.23 24-Feb-2014  skrll branches: 1.23.6;
Rename NetBSD/hp700 to NetBSD/hppa.

Unfortunately our VCS isn't very helpful here.
 1.22 18-Jan-2012  skrll branches: 1.22.6; 1.22.10;
Support crash(8) on hppa.
 1.21 10-Jan-2012  skrll G/C vm_{offset,size}_t
 1.20 17-Mar-2011  skrll branches: 1.20.4; 1.20.8;
HPPA TLS support.
 1.19 28-Feb-2011  skrll __HAVE___LWP_GETPRIVATE_FAST works now.
 1.18 24-Feb-2011  joerg Allow storing and receiving the LWP private pointer via ucontext_t
on all platforms except VAX and IA64. Add fast access via register for
AMD64, i386 and SH3 ports. Use this fast access in libpthread to replace
the stack based pthread_self(). Implement skeleton support for Alpha,
HPPA, PowerPC, SPARC and SPARC64, but leave it disabled.

Ports that support this feature provide __HAVE____LWP_GETPRIVATE_FAST in
machine/types.h and a corresponding __lwp_getprivate_fast in
machine/mcontext.h.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.17 11-Dec-2009  matt branches: 1.17.4; 1.17.6; 1.17.8;
Add PRIx{P,V}{ADDR,SIZE}, PRIu{P,V}SIZE, and PRIxREGISTER{,32,64} for all
(except where they will be added via merge). These should be used to print
{p,v}{addr,size}_t and register*_t as appropriate.
 1.16 17-Oct-2007  garbled branches: 1.16.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.15 10-Sep-2007  skrll Merge nick-csl-alignment.
 1.14 17-May-2007  yamt branches: 1.14.4; 1.14.8; 1.14.10;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.13 24-Dec-2005  perry branches: 1.13.26; 1.13.30; 1.13.32; 1.13.38;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 07-Aug-2004  chs branches: 1.11.12;
remove the alignment attribute from the typedef of __cpu_simple_lock_t
since it doesn't have any affect and lint chokes on it.
 1.10 19-Jul-2004  chs put RAS_DECL() back to declaring a function by default (since SH5
requires that). instead, allow <machine/types.h> to override the
default definition and do so on hppa.
 1.9 18-Jul-2004  chs add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.8 01-Nov-2003  matt Compile at -O2. Fix various GCC3-isms
XXX mem.c still fails to assemble.
 1.7 06-Oct-2003  matt Change headers to comply with the new toolchain changes.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 28-Apr-2003  bjh21 branches: 1.5.2;
Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.4 22-Sep-2002  simonb Use "#define\t" instead of "#define ".
 1.3 22-Sep-2002  gmcgarry Add __HAVE_MD_RUNQUEUE flag for MD code to override MI run queue primitives.
 1.2 10-Jul-2002  fredette branches: 1.2.2;
Define __HAVE_FUNCTION_DESCRIPTORS, which is used by ld.elf_so.
 1.1 05-Jun-2002  fredette branches: 1.1.2;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file types.h was added on branch kqueue on 2002-06-23 17:37:11 +0000
 1.2.2.3 16-Jul-2002  gehenna catch up with -current.
 1.2.2.2 14-Jul-2002  gehenna catch up with -current.
 1.2.2.1 10-Jul-2002  gehenna file types.h was added on branch gehenna-devsw on 2002-07-14 17:47:33 +0000
 1.5.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.11.12.3 27-Oct-2007  yamt sync with head.
 1.11.12.2 03-Sep-2007  yamt sync with head.
 1.11.12.1 21-Jun-2006  yamt sync with head.
 1.13.38.2 03-Oct-2007  garbled Sync with HEAD
 1.13.38.1 22-May-2007  matt Update to HEAD.
 1.13.32.1 11-Jul-2007  mjf Sync with head.
 1.13.30.2 09-Oct-2007  ad Sync with head.
 1.13.30.1 27-May-2007  ad Sync with head.
 1.13.26.1 23-Mar-2007  skrll Adapt hp700/hppa to yamt-idlelwp.

XXX Interrupts can fire before curlwp = new in sched_switch_unlock.
XXX This triggers the DEBUG check in sys/arch/hppa/hppa/trap.c:451
 1.14.10.1 06-Nov-2007  matt sync with HEAD
 1.14.8.1 02-Oct-2007  joerg Sync with HEAD.
 1.14.4.1 18-Jul-2007  skrll Initial work on provided correctly aligned __cpu_simple_lock_t for hppa
and first attempt at adapting i386 to the changes.

More to come.
 1.16.20.1 11-Mar-2010  yamt sync with head
 1.17.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.17.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.4.2 21-Apr-2011  rmind sync with head
 1.17.4.1 05-Mar-2011  rmind sync with head
 1.20.8.1 18-Feb-2012  mrg merge to -current.
 1.20.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.20.4.1 17-Apr-2012  yamt sync with head
 1.22.10.1 18-May-2014  rmind sync with head
 1.22.6.2 03-Dec-2017  jdolecek update from HEAD
 1.22.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.6.2 19-Mar-2016  skrll Sync with HEAD
 1.23.6.1 22-Sep-2015  skrll Sync with HEAD
 1.26.18.2 21-Apr-2020  martin Sync with HEAD
 1.26.18.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.27.2.1 20-Apr-2020  bouyer Sync with HEAD
 1.28.2.2 03-Apr-2021  thorpej Sync with HEAD.
 1.28.2.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.30.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.4 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4; 1.1.10;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file varargs.h was added on branch gehenna-devsw on 2002-07-14 17:47:34 +0000
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file varargs.h was added on branch kqueue on 2002-06-23 17:37:11 +0000
 1.22 26-Feb-2021  simonb Use a valuely human readable number for MAXTSIZ.
 1.21 16-Apr-2019  skrll branches: 1.21.12;
Trailing whitespace
 1.20 07-Jan-2013  chs branches: 1.20.38;
switch to __USE_TOPDOWN_VM.
move the stack to the top of the user address space so that
the available free space is more contiguous.
 1.19 16-Nov-2010  uebayasi branches: 1.19.8; 1.19.18;
MD interrupt implementation is not VM parameter.
 1.18 14-Nov-2010  uebayasi Move struct vm_page_md definition from vmparam.h to pmap.h, because
it's used only by pmap. vmparam.h has definitions for wider
audience.

All GENERIC kernels build tested, except ia64.

powerpc/include/booke/vmparam.h has one too, but it has no pmap.h,
so it's left as is.
 1.17 14-Nov-2010  uebayasi Don't rely on global APIs from internal.
 1.16 06-Nov-2010  uebayasi Remove incomplete, never worked dynamic run-time memory registration
(uvm_page_physload(9)). This functionality will be re-added later.
 1.15 16-Feb-2010  skrll branches: 1.15.2;
Remove the dma24_ex method of dealing with BUS_DMA_24BIT and replace
with a uvm managed freelist of pages in the right range.
 1.14 30-Apr-2009  skrll branches: 1.14.2;
Merge nick-hppapmap.

This is a port of the OpenBSD pmap and trap handling code to get us

- Performance boost on some/all machines.
- Well on the way to PA2.0 (in 32bit mode) support. Several
machines probe hardware, but fail sometime after interrupts
are enabled.

Other things changed / fixed on the branch are

- update autoconf to use the OpenBSD code.
- com @ dino is very close to being supported.
- HPPA_REDZONE has been replaced with a working redzone which
is enabled with DIAGNOSTIC.
- UPAGES has been halved in size.
- power(4) from OpenBSD to fix a few bugs.
- updated list of modules from OpenBSD.
- initial ports of uturn(4), astro(4) and elroy(4).
- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
 1.13 06-Mar-2009  joerg Remove SHMMAXPGS from all kernel configs. Dynamically compute the
initial limit as 1/4 of the physical memory. Ensure the limit is at
least 1024 pages, the old default on most platforms.
 1.12 05-Feb-2008  skrll branches: 1.12.10; 1.12.18; 1.12.24;
Rely on implicit PAGE_SIZE alignment and don't confuse uvm_glue.c.
 1.11 18-Apr-2007  skrll branches: 1.11.12; 1.11.18;
Whitespace.
 1.10 18-Apr-2007  skrll Bump the initial stack size limit to bring in line with other ports.

newfs_lfs doesn't core by default now.
 1.9 07-Apr-2007  skrll Correct a comment.
 1.8 14-Oct-2006  skrll branches: 1.8.2; 1.8.4; 1.8.8; 1.8.10;
Typo in comment.
 1.7 11-Dec-2005  christos branches: 1.7.20; 1.7.22;
merge ktrace-lwp.
 1.6 18-Jul-2004  chs branches: 1.6.12;
add hppa support for RAS, context stuff, siginfo and scheduler activations:
- add a RAS hook in cpu_switch().
- fill in the definition of struct mcontext.
- implement cpu_upcall(), cpu_getmcontext(), cpu_getmcontext() and
cpu_switchto().
- for now, force the right priviledge bits and space regs in setcontext().
- use correct values for __SIMPLELOCK_*.
- move the user stack to start at a multiple of the pthread stack size
so that libpthread can use the sp-masking trick.
 1.5 02-Apr-2003  thorpej branches: 1.5.2;
Use PAGE_SIZE rather than NBPG.
 1.4 01-Apr-2003  thorpej * Define PAGE_SHIFT, PAGE_SIZE, and PAGE_MASK in <hppa/vmparam.h>,
not in <hppa/param.h>.
* Define NBPG in terms of PGSHIFT.
 1.3 10-Dec-2002  thorpej Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
 1.2 05-Aug-2002  fredette Made changes in where/how the kernel is linked, and how the pmap
maps it with BTLB entries, to minimize the number of BTLB entries
needed.

Because the CPU type was often guessed incorrectly, the mapping of
HP board number to system name now includes information about the
expected CPU type.
 1.1 05-Jun-2002  fredette branches: 1.1.2; 1.1.4;
Added files to support generic HP PA-RISC based machines. hp700-specific
files to follow.
 1.1.4.3 31-Aug-2002  gehenna catch up with -current.
 1.1.4.2 14-Jul-2002  gehenna catch up with -current.
 1.1.4.1 05-Jun-2002  gehenna file vmparam.h was added on branch gehenna-devsw on 2002-07-14 17:47:34 +0000
 1.1.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.1 05-Jun-2002  jdolecek file vmparam.h was added on branch kqueue on 2002-06-23 17:37:11 +0000
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.12.3 11-Feb-2008  yamt sync with head.
 1.6.12.2 03-Sep-2007  yamt sync with head.
 1.6.12.1 30-Dec-2006  yamt sync with head.
 1.7.22.1 22-Oct-2006  yamt sync with head
 1.7.20.1 18-Nov-2006  ad Sync with head.
 1.8.10.1 11-Jul-2007  mjf Sync with head.
 1.8.8.2 27-May-2007  ad Sync with head.
 1.8.8.1 10-Apr-2007  ad Sync with head.
 1.8.4.2 07-May-2007  yamt sync with head.
 1.8.4.1 15-Apr-2007  yamt sync with head.
 1.8.2.1 20-Apr-2007  bouyer Pull up following revision(s) (requested by skrll in ticket #583):
sys/arch/hppa/include/vmparam.h: revision 1.10
Bump the initial stack size limit to bring in line with other ports.
newfs_lfs doesn't core by default now.
 1.11.18.1 18-Feb-2008  mjf Sync with HEAD.
 1.11.12.1 23-Mar-2008  matt sync with HEAD
 1.12.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.18.4 28-Apr-2009  skrll Sync with HEAD.
 1.12.18.3 11-Feb-2009  skrll Handle non-equivalent aliases.

Thanks to mjf for help with this.
 1.12.18.2 03-Feb-2009  skrll Make LOCKDEBUG kernels boot.
 1.12.18.1 27-Oct-2008  skrll Commit work in progress.
 1.12.10.2 11-Mar-2010  yamt sync with head
 1.12.10.1 04-May-2009  yamt sync with head.
 1.14.2.4 16-Nov-2010  uebayasi Sync with HEAD.
 1.14.2.3 30-Apr-2010  uebayasi Sync with HEAD.
 1.14.2.2 26-Apr-2010  uebayasi Remove the unfinished code to add a memory segment after uvm_page_init().
It doesn't even compile.

(In the future, we should allocate struct vm_page [] on the added memory
segment for NUMA's sake.)
 1.14.2.1 23-Feb-2010  uebayasi Convert all VM_MDPAGE_INIT()'s to take struct vm_page_md * and paddr_t.
 1.15.2.1 05-Mar-2011  rmind sync with head
 1.19.18.1 25-Feb-2013  tls resync with head
 1.19.8.1 23-Jan-2013  yamt sync with head
 1.20.38.1 10-Jun-2019  christos Sync with HEAD
 1.21.12.1 03-Apr-2021  thorpej Sync with HEAD.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 11-Dec-2005  christos branches: 1.2.74; 1.2.76; 1.2.78;
merge ktrace-lwp.
 1.1 08-May-2004  kleink branches: 1.1.2;
Factor out W{CHAR,INT}_{MAX,MIN} into their own header file.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 08-May-2004  skrll file wchar_limits.h was added on branch ktrace-lwp on 2004-08-03 10:35:37 +0000
 1.2.78.1 16-May-2008  yamt sync with head.
 1.2.76.1 18-May-2008  yamt sync with head.
 1.2.74.1 02-Jun-2008  mjf Sync with HEAD.

RSS XML Feed