History log of /netbsd-current/sys/arch/atari/atari/machdep.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.191 05-Mar-2024 thorpej

Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().

It's a small step, but it's a step.


# 1.190 13-Feb-2024 andvar

s/enqueing/enqueuing/ in debug messages (took a bait from recent Nick's commit)
s/occaision/occasion/ in comment.


# 1.189 07-Dec-2023 thorpej

extent(9) -> vmem(9)


Revision tags: netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
# 1.188 03-Jul-2022 tsutsui

Move the iomem extent stuff managed by bus_space(9) and make them static.

Inspired by MD bus_space(9) implemantation of arc.
Briefly tested on TT030.


# 1.187 02-Jul-2022 tsutsui

Use and print consistent CPU/MMU/FPU names.


# 1.186 13-Mar-2022 andvar

s/hander/handler/ and s/hader/header/ in comments and documentation.


# 1.185 09-Oct-2021 tsutsui

Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.184 03-Jan-2021 thorpej

malloc(9) -> kmem(9)


# 1.183 11-Jun-2020 ad

branches: 1.183.2;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.190 13-Feb-2024 andvar

s/enqueing/enqueuing/ in debug messages (took a bait from recent Nick's commit)
s/occaision/occasion/ in comment.


# 1.189 07-Dec-2023 thorpej

extent(9) -> vmem(9)


Revision tags: netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
# 1.188 03-Jul-2022 tsutsui

Move the iomem extent stuff managed by bus_space(9) and make them static.

Inspired by MD bus_space(9) implemantation of arc.
Briefly tested on TT030.


# 1.187 02-Jul-2022 tsutsui

Use and print consistent CPU/MMU/FPU names.


# 1.186 13-Mar-2022 andvar

s/hander/handler/ and s/hader/header/ in comments and documentation.


# 1.185 09-Oct-2021 tsutsui

Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.184 03-Jan-2021 thorpej

malloc(9) -> kmem(9)


# 1.183 11-Jun-2020 ad

branches: 1.183.2;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.189 07-Dec-2023 thorpej

extent(9) -> vmem(9)


Revision tags: thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
# 1.188 03-Jul-2022 tsutsui

Move the iomem extent stuff managed by bus_space(9) and make them static.

Inspired by MD bus_space(9) implemantation of arc.
Briefly tested on TT030.


# 1.187 02-Jul-2022 tsutsui

Use and print consistent CPU/MMU/FPU names.


# 1.186 13-Mar-2022 andvar

s/hander/handler/ and s/hader/header/ in comments and documentation.


# 1.185 09-Oct-2021 tsutsui

Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.184 03-Jan-2021 thorpej

malloc(9) -> kmem(9)


# 1.183 11-Jun-2020 ad

branches: 1.183.2;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.188 03-Jul-2022 tsutsui

Move the iomem extent stuff managed by bus_space(9) and make them static.

Inspired by MD bus_space(9) implemantation of arc.
Briefly tested on TT030.


# 1.187 02-Jul-2022 tsutsui

Use and print consistent CPU/MMU/FPU names.


# 1.186 13-Mar-2022 andvar

s/hander/handler/ and s/hader/header/ in comments and documentation.


# 1.185 09-Oct-2021 tsutsui

Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.184 03-Jan-2021 thorpej

malloc(9) -> kmem(9)


# 1.183 11-Jun-2020 ad

branches: 1.183.2;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.187 02-Jul-2022 tsutsui

Use and print consistent CPU/MMU/FPU names.


# 1.186 13-Mar-2022 andvar

s/hander/handler/ and s/hader/header/ in comments and documentation.


# 1.185 09-Oct-2021 tsutsui

Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.184 03-Jan-2021 thorpej

malloc(9) -> kmem(9)


# 1.183 11-Jun-2020 ad

branches: 1.183.2;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.186 13-Mar-2022 andvar

s/hander/handler/ and s/hader/header/ in comments and documentation.


# 1.185 09-Oct-2021 tsutsui

Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.184 03-Jan-2021 thorpej

malloc(9) -> kmem(9)


# 1.183 11-Jun-2020 ad

branches: 1.183.2;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.185 09-Oct-2021 tsutsui

Call cnpollc(9) before cngetc(9) as the cons(9) man page says.

Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.184 03-Jan-2021 thorpej

malloc(9) -> kmem(9)


# 1.183 11-Jun-2020 ad

branches: 1.183.2;
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.184 03-Jan-2021 thorpej

malloc(9) -> kmem(9)


Revision tags: thorpej-futex-base
# 1.183 11-Jun-2020 ad

uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.183 11-Jun-2020 ad

uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: netbsd-8-2-RELEASE phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20; 1.177.30;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.182 31-Dec-2019 ad

Rename uvm_free() -> uvm_availmem().


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.181 21-Dec-2019 ad

uvmexp.free -> uvm_free()


Revision tags: netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision


# 1.180 29-Jun-2019 tsutsui

Remove obsolete stuff.


# 1.179 29-Jun-2019 tsutsui

Fix PR/54325 (use of dangling pointer).


# 1.178 29-Jun-2019 tsutsui

TAB/space cleanup.


Revision tags: phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.177 26-Mar-2014 christos

branches: 1.177.10; 1.177.20;
kill sprintf


# 1.176 24-Mar-2014 christos

- remove unused
- use cpu_{g,s}etmodel() (not committed yet)


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.175 10-Aug-2012 tsutsui

branches: 1.175.2; 1.175.4;
Appease gcc -fno-common:
- remove physmem from machdep.c since it's initialized in atari_init.c
- declare I/O address space variables properly
Compile test only. (currenty my TT030 is busy on pkgsrc builds)


# 1.174 27-Jul-2012 matt

Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.173 12-Dec-2011 mrg

implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places. avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.172 12-Jun-2011 rmind

branches: 1.172.2; 1.172.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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.171 16-May-2011 tsutsui

branches: 1.171.2;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.


Revision tags: jym-xensuspend-nbase bouyer-quota2-nbase jym-xensuspend-base
# 1.170 04-Mar-2011 joerg

Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.


Revision tags: uebayasi-xip-base7 bouyer-quota2-base
# 1.169 08-Feb-2011 rmind

Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.


Revision tags: jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.168 16-Oct-2010 tsutsui

branches: 1.168.2; 1.168.4;
Prepare empty module_init_md() for options MODULAR for all other m68k ports.


Revision tags: yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1
# 1.167 13-Apr-2010 tsutsui

Misc KNF.


# 1.166 31-Mar-2010 tsutsui

Misc KNF and cosmetics.


Revision tags: yamt-nfs-mp-base9
# 1.165 08-Feb-2010 joerg

branches: 1.165.2;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base matt-premerge-20091211
# 1.164 10-Dec-2009 matt

branches: 1.164.2;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.


# 1.163 23-Nov-2009 rmind

Use lwp_getpcb() on m68k ports, clean from struct user usage.


# 1.162 07-Nov-2009 cegger

Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.


Revision tags: yamt-nfs-mp-base8
# 1.161 19-Aug-2009 he

Another needing <sys/exec_aout.h>.


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.160 05-Mar-2009 tsutsui

Some KNF.


Revision tags: nick-hppapmap-base2
# 1.159 13-Feb-2009 apb

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.


# 1.158 24-Jan-2009 tsutsui

branches: 1.158.2;
Use pmap_kenter_pa(9) to map msgbufpa as other m68k ports.
Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.


# 1.157 21-Jan-2009 he

Re-adapt to the changed return types for major() and minor().


Revision tags: mjf-devfs2-base
# 1.156 17-Jan-2009 tsutsui

Use PRIu64 to print 64 bit dev_t (for now).


# 1.155 03-Jan-2009 tsutsui

Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.154 30-Nov-2008 martin

As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.


# 1.153 25-Nov-2008 ad

dumpsys: don't spew numbers into the log.


# 1.152 12-Nov-2008 ad

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.


# 1.151 11-Nov-2008 dyoung

It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.


Revision tags: netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.150 02-Jul-2008 ad

branches: 1.150.2; 1.150.4; 1.150.6;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.149 08-Jan-2008 joerg

branches: 1.149.6; 1.149.10; 1.149.12; 1.149.14;
Convert Atari to generic TODR and timecounter.


Revision tags: matt-armv6-base
# 1.148 03-Jan-2008 joerg

ANSIfy.


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.147 03-Dec-2007 ad

branches: 1.147.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base
# 1.146 17-Oct-2007 garbled

branches: 1.146.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.145 21-May-2007 tsutsui

branches: 1.145.8; 1.145.10;
curlwp can't be NULL so no need to check it.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.144 21-Mar-2007 tsutsui

branches: 1.144.4;
Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html


# 1.143 04-Mar-2007 christos

branches: 1.143.2; 1.143.4; 1.143.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.142 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


Revision tags: post-newlock2-merge
# 1.141 09-Feb-2007 ad

branches: 1.141.2;
Merge newlock2 to head.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 newlock2-base netbsd-4-base
# 1.140 21-Oct-2006 mrg

in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev. this occurs when we try to set the dumpdev to a device
with no driver loaded. this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf(). (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.139 24-Dec-2005 perry

branches: 1.139.20; 1.139.22;
bare asm -> __asm


# 1.138 11-Dec-2005 christos

merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.137 04-Jun-2005 he

branches: 1.137.2;
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.


Revision tags: kent-audio2-base
# 1.136 25-Apr-2005 lukem

Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2
# 1.135 11-Feb-2005 yamt

remove uvm_map_protect from cpu_startup of several ports.
- they shouldn't be needed with the current fault handler.
- they causes assertion failure with the recent vm_map implementation.

discussed on tech-kern@. reviewed by Chuck Silvers.
PR/29179 from Julio M. Merino Vidal.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE yamt-km-base netbsd-2-0-1-RELEASE kent-audio1-beforemerge netbsd-2-base kent-audio1-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.134 24-Mar-2004 atatat

branches: 1.134.8; 1.134.10;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.133 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.132 30-Dec-2003 pk

Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.


# 1.131 04-Dec-2003 atatat

Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.


# 1.130 27-Sep-2003 cl

Cast through (void *) to appease gcc3.


# 1.129 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.128 15-Jul-2003 lukem

__KERNEL_RCSID()


# 1.127 29-Jun-2003 fvdl

branches: 1.127.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.126 28-Jun-2003 darrenr

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V


# 1.125 23-Jun-2003 martin

Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.124 10-May-2003 thorpej

Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.


# 1.123 08-May-2003 thorpej

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM. Machine-dependent code is
responsible for initializing them before main() is called. Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).


# 1.122 26-Apr-2003 ragge

Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)


# 1.121 01-Apr-2003 thorpej

Use PAGE_SIZE rather than NBPG.


# 1.120 17-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.119 25-Sep-2002 thorpej

Don't include <sys/map.h>.


# 1.118 19-Sep-2002 ragge

Do not include <sys/clist.h>, it's not used in NetBSD at all.


# 1.117 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.116 25-Aug-2002 thorpej

Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.115 09-Apr-2002 leo

branches: 1.115.2;
Pull in prototype for setregs()


Revision tags: eeh-devprop-base
# 1.114 20-Mar-2002 christos

kill remaining PS_STRINGS instances.


Revision tags: newlock-base
# 1.113 06-Mar-2002 tsutsui

Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.


Revision tags: ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.112 10-Sep-2001 chris

branches: 1.112.4;
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

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

Reviewed by Jason.


Revision tags: thorpej-devvp-base
# 1.111 24-Aug-2001 chs

branches: 1.111.2;
use pmap_k* for buffer cache pages.


# 1.110 02-Jun-2001 chs

branches: 1.110.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.


# 1.109 15-May-2001 leo

Add an NMI handler for the Milan.


Revision tags: thorpej_scsipi_beforemerge
# 1.108 24-Apr-2001 thorpej

Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.


Revision tags: thorpej_scsipi_nbase thorpej_scsipi_base
# 1.107 15-Mar-2001 chs

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS 0
KERN_INVALID_ADDRESS EFAULT
KERN_PROTECTION_FAILURE EACCES
KERN_NO_SPACE ENOMEM
KERN_INVALID_ARGUMENT EINVAL
KERN_FAILURE various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE ENOMEM
KERN_NOT_RECEIVER <unused>
KERN_NO_ACCESS <unused>
KERN_PAGES_LOCKED <unused>


# 1.106 09-Feb-2001 leo

branches: 1.106.2;
Prepare assembly parts for an eventual transition to ELF. Mostly from a
diff from Steve Woodford.


# 1.105 15-Jan-2001 thorpej

Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().


# 1.104 07-Jan-2001 leo

Expand identify_cpu() for the Milan.


# 1.103 07-Jan-2001 leo

Update the printf format in straymfpint() too.


# 1.102 07-Jan-2001 leo

Fixes for straytrap():
- make it clear that we are printing hex-numbers
- fix the loop protection.


# 1.101 28-Sep-2000 leo

Move config_console() out of the grf-layer. This allows for more than just
grf-type consoles (wscons). Config_console() is now called from consinit(),
just after setting up the kernel msgbuf, so debugging is easy(er).
To further facilitate this move, the pcibus now allows for early-console
attaches by allocating static bus_space_tags (no mallocs possible at this
point).


# 1.100 13-Sep-2000 thorpej

Add an align argument to uvm_map() and some callers of that
routine. Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.


# 1.99 02-Jul-2000 cgd

undef PS after inclusion of net/netisr.h to avoid conflict w/ machine/reg.h


# 1.98 02-Jul-2000 cgd

Kwality control:
* put #includes of opt headers and headers to get protos used by
net/netisr_dispatch.h in net/netisr.h (if !defined(_LOCORE)) (rather than
in netisr_dispatch.h itself, and potentially nowhere, respectively).
* require netisr.h to be included before netisr_dispatch.h.
* minor additional cleanup of both netisr.h and netisr_dispatch.h.
* clean up uses to remove now-unnecessary header file inclusions, and
local prototypes of the fns.
* convert netisr dispatch implementations which didn't use
netisr_dispatch.h (pc532) to use it.


# 1.97 29-Jun-2000 mrg

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>


# 1.96 26-Jun-2000 mrg

remove/move more mach vm header files:

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

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.95 05-Jun-2000 jhawk

Do not clear msgbufenabled in dumpsys(). Dump messages will now go to
the message buffer. This can be invaluable in debugging if the dump
fails (assuming a persistant message buffer)


Revision tags: minoura-xpg4dl-base
# 1.94 26-May-2000 thorpej

branches: 1.94.2;
First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

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

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

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

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

Tested on i386 and Alpha. Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.


# 1.93 28-Mar-2000 simonb

Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.


# 1.92 21-Feb-2000 erh

Define the DONETISR macro and use netisr_dispatch.h. This is to cut down on code duplication and to standardize the available NETISRs across all ports.


Revision tags: chs-ubc2-newbase
# 1.91 19-Jan-2000 thorpej

Move callout initialization to a single location; no need to duplicate
that code all over the place.


# 1.90 19-Jan-2000 msaitoh

check whether tv_usec >= 1000000


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.89 04-Dec-1999 ragge

CL* discarding.


Revision tags: fvdl-softdep-base
# 1.88 13-Nov-1999 thorpej

Update for pmap_enter() API change. No functional difference.


Revision tags: comdex-fall-1999-base
# 1.87 28-Oct-1999 leo

Use extent maps.


Revision tags: chs-ubc2-base
# 1.86 22-Jul-1999 leo

branches: 1.86.2; 1.86.4; 1.86.6;
Do the mesgbuf initialisation a bit earlier in the boot process. This
makes debugging the console somewhat easier.


# 1.85 28-Jun-1999 itojun

- Call ip6intr if INET6 is defined.
- remove "need-flag" for mac68k esp driver, as it is not used in anywhere
and conflicts with IPsec ESP header.

This should be the only MD change in IPv6 support, except kernel config file.
Very sorry if you have any compilation problem with it (I believe it is okay).
If your favorite arch is not included in here, please add a
call to ip6intr() from softintr handle.


# 1.84 26-May-1999 thorpej

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags. PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that. INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now). This will eventually
change now these maps are locked, as well.


# 1.83 26-May-1999 leo

Make this compile again. I assumed that the use of 'format_memory()' was
an error? Made it use format_bytes()....


# 1.82 20-May-1999 lukem

* convert to using MI allocsys(). most ports were using an MD allocsys(),
although a couple still used the old pre-4.4-lite (?) mechanism.
* use format_bytes() to format the various printf()s that print out memory sizes


# 1.81 26-Apr-1999 thorpej

Garbage-collect the VM_MBUF_SIZE constant. Instead, use the size
(nmbclusters * mclbytes), so that the right amount of KVA space is
allocated if those variables are patched.


# 1.80 11-Apr-1999 chs

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.


Revision tags: netbsd-1-4-base
# 1.79 01-Apr-1999 thorpej

branches: 1.79.2;
Don't call configure() from cpu_startup().


# 1.78 26-Mar-1999 mycroft

Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.


# 1.77 24-Mar-1999 mrg

completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.


# 1.76 27-Feb-1999 scottr

defopt BUFCACHE and BUFPAGES.


# 1.75 09-Jan-1999 thorpej

Garbage-collect `mbutl'.


Revision tags: kenh-if-detach-base
# 1.74 24-Nov-1998 leo

Implement BUFCACHE option as suggested by lukem.


# 1.73 24-Nov-1998 leo

Make compile with -DDEBUG


# 1.72 24-Nov-1998 leo

Pull-in device.h for configure() prototype.


Revision tags: chs-ubc-base
# 1.71 19-Oct-1998 tron

Defopt SYSVMSG, SYSVSEM and SYSVSHM.


# 1.70 02-Sep-1998 leo

Get rid of vm_offset_t/vm_size_t


# 1.69 11-Aug-1998 leo

Add CCITT & NATM interrupt handlers. (Jonathan Stone).


Revision tags: eeh-paddr_t-base
# 1.68 05-Jul-1998 jonathan

* defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.


# 1.67 05-Jul-1998 jonathan

defopt NS, NSIP.


# 1.66 05-Jul-1998 jonathan

defopt ISO TPIP.


# 1.65 05-Jul-1998 jonathan

defopt INET, NETATALK.


# 1.64 04-Jul-1998 jonathan

defopt DDB.


# 1.63 09-Jun-1998 tv

Change ddb_init() for a.out to provision for kernels which are not booted by
the current 'bootblock' method, like the Shark, which preloads and preformats
the symbol table right in the boot code.


# 1.62 11-May-1998 leo

Add UVM option.


# 1.61 07-May-1998 leo

Implement MACHINE_NEW_NONCONTIG. Implementation is based on Ignatios' amiga
implementation and Chuck's conversion description.


# 1.60 13-Mar-1998 leo

Move the bus_* functions from machdep.c to bus.c .


# 1.59 10-Mar-1998 leo

Bus-dma implementation for the atari. Heavily based on the i386
implementation.


# 1.58 19-Feb-1998 thorpej

Disable the message buffer during crash dumps by clearing msgbufenabled,
not msgbufmapped.


# 1.57 24-Jan-1998 mycroft

When dumping, print out the device number as major,minor.


# 1.56 04-Dec-1997 tv

Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.


# 1.55 22-Oct-1997 leo

Make this compile again by including <vm/vm.h> and moving sysctl.h below
that include.


Revision tags: netbsd-1-3-base marc-pcmcia-base
# 1.54 19-Sep-1997 leo

branches: 1.54.2;
Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.


# 1.53 12-Sep-1997 mycroft

Set the status word as well, and remove a bogus comment.


# 1.52 12-Sep-1997 mycroft

Always initialize all registers in setregs().


# 1.51 11-Sep-1997 mycroft

Fix execve(2) and *setregs() interfaces so emulations can set registers in a
more correct way. (See tech-kern.)


Revision tags: thorpej-signal-base marc-pcmcia-bp
# 1.50 15-Jul-1997 leo

branches: 1.50.2;
Implement bus_space_subregion()


# 1.49 12-Jun-1997 mrg

bring mrg-vm-swap2 onto mainilne.


# 1.48 10-Jun-1997 veego

s/atari_round_page/m68k_round_page/ s/atari_trunc_page/m68k_trunc_page/


# 1.47 08-Jun-1997 veego

Initialize machine from MACHINE.


Revision tags: mrg-vm-swap2-base
# 1.46 09-Apr-1997 thorpej

branches: 1.46.2;
Garbage-collect regdump() and friends.


# 1.45 06-Apr-1997 leo

Calculate dumpsize correctly (in pages).


# 1.44 02-Apr-1997 christos

Add netatalk netisr


# 1.43 27-Mar-1997 thorpej

Don't allocate mclrefcnt[]; it's dead and gone.


# 1.42 26-Mar-1997 gwr

Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/


# 1.41 26-Mar-1997 leo

Use m68k/sig_machdep.c


# 1.40 26-Mar-1997 leo

Add missing 'break'.


# 1.39 15-Mar-1997 is

New ARP system, supports IPv4 over any hardware link.

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

For the detailed change history, look at the commit log entries for
the is-newarp branch.


Revision tags: is-newarp-before-merge
# 1.38 10-Mar-1997 leo

Push out some 060 support. It's all untested and mostly copied in from the
amiga-port.


Revision tags: is-newarp-base
# 1.37 27-Jan-1997 leo

branches: 1.37.2; 1.37.4;
Use bus_space_tag when calculating the physical address.


# 1.36 21-Jan-1997 leo

Add a 'size' argument to badbaddr(). This is very useful on busses that
only accept certain size accesses on a specific address range. Like the
VME bus.


# 1.35 14-Dec-1996 leo

branches: 1.35.2;
Remove some code accidently checked in on previous commit.


# 1.34 08-Nov-1996 leo

Adapt to changes in the bus-interface; bus_[mem|io] -> bus_space. Thanks Jason.


# 1.33 06-Nov-1996 leo

Add bus_mem_(un)map functions.


# 1.32 25-Oct-1996 leo

db_memrw.c:
- Sync with hp300 version.

Machdep.c:
- Notify the vm-system that kernel-text is read/execute
- Notify the vm-system that page zero isn't mapped

[ Grrr.. How do you cancel a check-in when you find out too late they
should have different comments ]


# 1.31 13-Oct-1996 christos

backout previous kprintf changes


# 1.30 11-Oct-1996 christos

printf -> kprintf, sprintf -> ksprintf


# 1.29 25-Sep-1996 leo

Catchup with -current:
- Extra argument to boot()
- select -> poll


# 1.28 23-Aug-1996 leo

Recognize the Hades as a valid machine type.


# 1.27 23-Aug-1996 leo

- Make it compile & work for the 68040
- Map the various I/O areas just below Sysmap
- Cleanup a bit
- Fix machine-type detection to recognize the Hades.


# 1.26 09-Aug-1996 mrg

Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.


# 1.25 12-Jul-1996 leo

Sync with atari_init cleanup


# 1.24 29-Jun-1996 leo

Remove references to kern_extern.h


Revision tags: netbsd-1-2-BETA netbsd-1-2-base
# 1.23 26-Apr-1996 leo

branches: 1.23.4;
Corrections for removed <sys/cpu.h> and some more prototypes.


# 1.22 18-Apr-1996 leo

Yet more prototyping and -Wall fixes.


# 1.21 27-Mar-1996 leo

Allow call-back functions to drop to spl0().


# 1.20 10-Mar-1996 leo

Add the include files and the atari kernel support for new format panic
dumps.


# 1.19 22-Feb-1996 leo

First bunch of changes due to stricter prototype checking.


# 1.18 04-Jan-1996 jtc

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.


# 1.17 25-Dec-1995 leo

Add doshutdownhooks


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 07-Oct-1995 mycroft

Prefix names of system call implementation functions with `sys_'.


# 1.15 19-Sep-1995 thorpej

Make system calls conform to a standard prototype and bring those
prototypes into scope.


# 1.14 01-Sep-1995 mycroft

SA_ONSTACK --> SS_ONSTACK


# 1.13 28-Aug-1995 leo

Fix typo in previous commit


# 1.12 28-Aug-1995 leo

Detect type and precence of an FPU in the kernel instead of relying on GEM.


# 1.11 13-Jul-1995 leo

Add pppintr() to netintr().


# 1.10 11-Jul-1995 leo

Dumping works, now if there were tools to handle it...


# 1.9 28-May-1995 leo

Remove FPCOPROC use fputype instead.


# 1.8 21-May-1995 leo

Set A2 to PS_STRINGS.


# 1.7 14-May-1995 leo

- Remove double mapping of stack
- Change to new coredump format


# 1.6 10-May-1995 leo

Print proper machine type at startup. Use 'vfs_shutdown' to sync the
disks.


# 1.5 05-May-1995 leo

Report "real mem" correctly and make one single module for handling
software interrupts.


# 1.4 27-Apr-1995 leo

Removed cpuspeed


# 1.3 22-Apr-1995 christos

- added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.


# 1.2 10-Apr-1995 mycroft

kernel_pmap --> pmap_kernel()


# 1.1 26-Mar-1995 leo

branches: 1.1.1;
Initial revision