freebsd-nq/sys
Ian Lepore 69dcb7e771 Make the 'env' directive described in config(5) work on all architectures,
providing compiled-in static environment data that is used instead of any
data passed in from a boot loader.

Previously 'env' worked only on i386 and arm xscale systems, because it
required the MD startup code to examine the global envmode variable and
decide whether to use static_env or an environment obtained from the boot
loader, and set the global kern_envp accordingly.  Most startup code wasn't
doing so.  Making things even more complex, some mips startup code uses an
alternate scheme that involves calling init_static_kenv() to pass an empty
buffer and its size, then uses a series of kern_setenv() calls to populate
that buffer.

Now all MD startup code calls init_static_kenv(), and that routine provides
a single point where envmode is checked and the decision is made whether to
use the compiled-in static_kenv or the values provided by the MD code.

The routine also continues to serve its original purpose for mips; if a
non-zero buffer size is passed the routine installs the empty buffer ready
to accept kern_setenv() values.  Now if the size is zero, the provided buffer
full of existing env data is installed.  A NULL pointer can be passed if the
boot loader provides no env data; this allows the static env to be installed
if envmode is set to do so.

Most of the work here is a near-mechanical change to call the init function
instead of directly setting kern_envp.  A notable exception is in xen/pv.c;
that code was originally installing a buffer full of preformatted env data
along with its non-zero size (like mips code does), which would have allowed
kern_setenv() calls to wipe out the preformatted data.  Now it passes a zero
for the size so that the buffer of data it installs is treated as
non-writeable.
2016-01-02 02:53:48 +00:00
..
amd64 Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
arm Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
arm64 Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
boot Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
bsm Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: 2015-12-20 23:22:04 +00:00
cam Fix style issues around existing SDT probes. 2015-12-16 23:39:27 +00:00
cddl Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c 2015-12-27 17:33:59 +00:00
compat Handle when filedescriptors are closed before initialized. An early 2015-12-31 14:47:45 +00:00
conf In the unload target, check that the module is loaded first. 2016-01-01 03:59:09 +00:00
contrib [rtwn] add rtwn firmware. 2015-12-31 22:31:43 +00:00
crypto Break up opencrypto/xform.c so it can be reused piecemeal 2015-12-30 22:43:07 +00:00
ddb Add helper to catch single step debug event and distinguish it from bkpt 2015-11-27 19:03:59 +00:00
dev Accidentally dropped the 0 padding. 2016-01-01 17:56:52 +00:00
fs Minor style cleanup. 2016-01-01 15:48:48 +00:00
gdb
geom Add some additional GPT partition types 2015-12-27 18:12:13 +00:00
gnu
i386 Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
isa
kern Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
kgssapi Unset the gss kernel state when gssd exits 2016-01-01 17:06:16 +00:00
libkern libkern: ffs, fls: s/4/3/ the 3rd BSD clause 2015-10-22 21:04:47 +00:00
mips Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
modules 17 years and change after I wrote warp_saver, here's a simple plasma effect 2016-01-01 04:04:40 +00:00
net Remove second EVENTHANDLER_REGISTER slipped in r292978. 2016-01-01 10:15:06 +00:00
net80211 [net80211] document the (not completely complete) set of places where 2016-01-01 00:21:07 +00:00
netgraph - grab ng_btsocket_l2cap_sockets_mtx lock in 2015-12-23 16:32:04 +00:00
netinet Remove second EVENTHANDLER_REGISTER slipped in r292978. 2016-01-01 10:15:06 +00:00
netinet6 Use lltable_get_ifp() instead of direct access to lltable fields. 2016-01-01 12:35:33 +00:00
netipsec Overhaul if_enc(4) and make it loadable in run-time. 2015-11-25 07:31:59 +00:00
netnatm
netpfil Properly drain callouts in the IPFW subsystem to avoid use after free 2015-12-15 09:02:05 +00:00
netsmb The problem report was for a crash that happened when smbfs was 2015-11-18 23:04:01 +00:00
nfs Add kernel support to the NFS server for the "-manage-gids" 2015-11-30 21:54:27 +00:00
nfsclient
nfsserver
nlm
ofed Implement interface link header precomputation API. 2015-12-31 05:03:27 +00:00
opencrypto Break up opencrypto/xform.c so it can be reused piecemeal 2015-12-30 22:43:07 +00:00
pc98 Add asynchronous command support to the pass(4) driver, and the new 2015-12-03 20:54:55 +00:00
powerpc Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
riscv/include Import RISC-V machine headers. This is a minimal set required to compile 2015-12-17 18:44:30 +00:00
rpc Improve locking of sg_threadcount. 2015-11-19 08:04:05 +00:00
security Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: 2015-12-20 23:22:04 +00:00
sparc64 Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
sys Bump copyright year. 2015-12-31 11:21:45 +00:00
teken
tests Style 9 changes. 2015-11-12 10:31:14 +00:00
tools
ufs Recheck curthread->td_su after the VFS_SYNC() call, and re-sync if the 2015-12-21 11:50:32 +00:00
vm Add missed relpbuf() for a smallfs page-in. 2015-12-27 14:42:39 +00:00
x86 Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
xdr
xen Clean up unused-but-set-variable spotted by gcc-4.9. 2015-12-31 01:54:07 +00:00
Makefile