From c692a690dafe4c6bdb406c4c5e0ae66bfcb2f6cb Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 12 Aug 2013 13:42:12 +0100 Subject: [settings] Expose memory map via settings mechanism Allow memory map entries to be read using the syntax ${memmap/..} where is the index of the memory region, 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 is the number of bits by which to shift the result. This allows for several values of interest to be encoded. For example: ${memmap/.1.0:hexraw} # 64-bit start address of ${memmap/.2.0:hexraw} # 64-bit length of , in bytes ${memmap/.3.0:hexraw} # 64-bit end address of ${memmap/.2.10:int32} # Length of , in kB ${memmap/.2.20:int32} # Length of , 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 --- src/config/config.c | 3 +++ src/config/settings.h | 1 + 2 files changed, 4 insertions(+) (limited to 'src/config') diff --git a/src/config/config.c b/src/config/config.c index 06c5713f0..c8cb53994 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -316,6 +316,9 @@ REQUIRE_OBJECT ( guestinfo ); #ifdef CPUID_SETTINGS REQUIRE_OBJECT ( cpuid_settings ); #endif +#ifdef MEMMAP_SETTINGS +REQUIRE_OBJECT ( memmap_settings ); +#endif /* * Drag in selected keyboard map diff --git a/src/config/settings.h b/src/config/settings.h index 97131e883..b06f2901b 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -11,6 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #define PCI_SETTINGS /* PCI device settings */ //#define CPUID_SETTINGS /* CPUID settings */ +//#define MEMMAP_SETTINGS /* Memory map settings */ //#define VMWARE_SETTINGS /* VMware GuestInfo settings */ #include -- cgit v1.2.3-55-g7522