]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: Add DEBUG messages to dump the contents of CMOS
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 21 Jan 2011 16:50:31 +0000 (16:50 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 21 Jan 2011 16:50:31 +0000 (16:50 +0000)
The contents of CMOS on boot can describe some aspects of
the system configuration.  For example, the size of memory
available to qemu/kvm.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11264 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/PlatformPei/Platform.c

index 833f62adffbe6ed2698fda14cedd772b6e7d9383..66bb0984c864e8c44538496367d9a05214d8625d 100644 (file)
@@ -31,6 +31,7 @@
 #include <Guid/MemoryTypeInformation.h>\r
 \r
 #include "Platform.h"\r
+#include "Cmos.h"\r
 \r
 EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {\r
   { EfiACPIMemoryNVS,       0x004 },\r
@@ -200,6 +201,27 @@ ReserveEmuVariableNvStore (
 }\r
 \r
 \r
+VOID\r
+DebugDumpCmos (\r
+  VOID\r
+  )\r
+{\r
+  UINTN  Loop;\r
+\r
+  DEBUG ((EFI_D_INFO, "CMOS:\n"));\r
+\r
+  for (Loop = 0; Loop < 0x80; Loop++) {\r
+    if ((Loop % 0x10) == 0) {\r
+      DEBUG ((EFI_D_INFO, "%02x:", Loop));\r
+    }\r
+    DEBUG ((EFI_D_INFO, " %02x", CmosRead8 (Loop)));\r
+    if ((Loop % 0x10) == 0xf) {\r
+      DEBUG ((EFI_D_INFO, "\n"));\r
+    }\r
+  }\r
+}\r
+\r
+\r
 /**\r
   Perform Platform PEI initialization.\r
 \r
@@ -220,6 +242,8 @@ InitializePlatform (
 \r
   DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));\r
 \r
+  DebugDumpCmos ();\r
+\r
   TopOfMemory = MemDetect ();\r
 \r
   ReserveEmuVariableNvStore ();\r