]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r293045, r293046:
authorian <ian@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 24 Jan 2016 21:04:06 +0000 (21:04 +0000)
committerian <ian@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 24 Jan 2016 21:04:06 +0000 (21:04 +0000)
commita14c34e125bccba4af32d774056d6ad07741a8c1
tree33c17616598fc9b12d795c2df7df3c15d2707e86
parent3d45e6d7a11c3f5812ff0b1537f66dee85e01055
MFC r293045, r293046:

  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.

  Also, revert accidental change that snuck into r293045.

git-svn-id: svn://svn.freebsd.org/base/stable/10@294683 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/amd64/amd64/machdep.c
sys/arm/arm/machdep.c
sys/arm/xscale/ixp425/avila_machdep.c
sys/i386/i386/machdep.c
sys/kern/kern_environment.c
sys/sparc64/sparc64/machdep.c