Calculate "RamSize" needed by 16bit interface dynamically.

Calculate a LegacyRamSize directly from the e820 map for use by
handle_1588() and handle_15e801() (the only two external interfaces
that require "RamSize").  All other users of the existing RamSize (and
RamSizeOver4G) variables are specific to QEMU, so move the
declarations to paravirt.c.

Signed-off-by: Kevin O'Connor <>
diff --git a/src/paravirt.h b/src/paravirt.h
index 7237731..fce5af9 100644
--- a/src/paravirt.h
+++ b/src/paravirt.h
@@ -9,6 +9,8 @@
 #define PF_XEN      (1<<1)
 #define PF_KVM      (1<<2)
+extern u32 RamSize;
+extern u64 RamSizeOver4G;
 extern int PlatformRunningOn;
 static inline int runningOnQEMU(void) {