freebsd-dev/sys/i386
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
..
acpica If x86 CPU implementation of the MWAIT instruction reasonably 2015-05-09 12:28:48 +00:00
bios Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
conf Disconnect iBCS2 emulator from the build. The ibcs2 option, the build 2015-11-28 08:31:32 +00:00
i386 Make the 'env' directive described in config(5) work on all architectures, 2016-01-02 02:53:48 +00:00
ibcs2 Replace struct filedesc argument in getvnode with struct thread 2015-06-16 13:09:18 +00:00
include Move shared variables from {amd64,i386}/initcpu.c to x86/identcpu.c. 2015-12-23 21:41:42 +00:00
isa Convert between abridged (from FXSAVE) and unabridged (from FSAVE) 2015-07-10 09:20:13 +00:00
linux Remove sv_prepsyscall, sv_sigsize and sv_sigtbl members of the struct 2015-11-28 08:49:07 +00:00
pci Remove support for Xen PV domU kernels. Support for HVM domU kernels 2015-04-30 15:48:48 +00:00
svr4 MFamd64: Move extern declaration of _ucodesel and _udatasel to 2014-11-02 21:40:32 +00:00
xbox After r261980, the local ptr variable in xbox_init() is no longer used, 2014-02-16 22:48:36 +00:00
Makefile