]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[settings] Expose memory map via settings mechanism
authorMichael Brown <mcb30@ipxe.org>
Mon, 12 Aug 2013 12:42:12 +0000 (13:42 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 12 Aug 2013 21:00:36 +0000 (22:00 +0100)
commitc692a690dafe4c6bdb406c4c5e0ae66bfcb2f6cb
treed4dc5f8d6d0938404e649f24e79ec91f81548188
parent55daa953fb82412e2e4dced4a39c6f7a3ff39b46
[settings] Expose memory map via settings mechanism

Allow memory map entries to be read using the syntax

  ${memmap/<region>.<properties>.<scale>}

where <region> is the index of the memory region, <properties> is a
bitmask where bit 0 represents the start address and bit 1 represents
the length (allowing the end address to be encoded by having both bits
0 and 1 set), and <scale> is the number of bits by which to shift the
result.

This allows for several values of interest to be encoded.  For
example:

  ${memmap/<region>.1.0:hexraw}   # 64-bit start address of <region>
  ${memmap/<region>.2.0:hexraw}   # 64-bit length of <region>, in bytes
  ${memmap/<region>.3.0:hexraw}   # 64-bit end address of <region>
  ${memmap/<region>.2.10:int32}   # Length of <region>, in kB
  ${memmap/<region>.2.20:int32}   # Length of <region>, in MB

The numeric encoding is slightly more sophisticated than described
here, allowing a single encoding to cover multiple regions.  (See the
source code for details.)  The primary use case for this feature is to
provide the total system memory size (in MB) via the "memsize"
predefined setting.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/config/config.c
src/config/settings.h
src/core/memmap_settings.c [new file with mode: 0644]
src/include/ipxe/errfile.h