]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/AcpiPlatformDxe/QemuLoader.h
OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map
[mirror_edk2.git] / OvmfPkg / AcpiPlatformDxe / QemuLoader.h
index b8f6147ceb622d746e5b7b8b13140c3d76ad146c..437776d86d9a0351d86c71db66541fad9eb24112 100644 (file)
 #include <Library/QemuFwCfgLib.h>\r
 \r
 //\r
-// The types and the documentation reflects the SeaBIOS interface. In OVMF we\r
-// use a minimal subset of it.\r
+// The types and the documentation reflects the SeaBIOS interface.\r
 //\r
 #define QEMU_LOADER_FNAME_SIZE QEMU_FW_CFG_FNAME_SIZE\r
 \r
-//\r
-// We only look at the Allocate command, and only to get FwCfg filenames.\r
-//\r
 typedef enum {\r
   QemuLoaderCmdAllocate = 1,\r
   QemuLoaderCmdAddPointer,\r
-  QemuLoaderCmdAddChecksum\r
+  QemuLoaderCmdAddChecksum,\r
+  QemuLoaderCmdWritePointer,\r
 } QEMU_LOADER_COMMAND_TYPE;\r
 \r
 typedef enum {\r
@@ -76,13 +73,38 @@ typedef struct {
   UINT32 Length;\r
 } QEMU_LOADER_ADD_CHECKSUM;\r
 \r
+//\r
+// QemuLoaderCmdWritePointer: the bytes at\r
+// [PointerOffset..PointerOffset+PointerSize) in the writeable fw_cfg file\r
+// PointerFile are to receive the absolute address of PointeeFile, as allocated\r
+// and downloaded by the firmware, incremented by the value of PointeeOffset.\r
+// Store the sum of (a) the base address of where PointeeFile's contents have\r
+// been placed (when QemuLoaderCmdAllocate has been executed for PointeeFile)\r
+// and (b) PointeeOffset, to this portion of PointerFile.\r
+//\r
+// This command is similar to QemuLoaderCmdAddPointer; the difference is that\r
+// the "pointer to patch" does not exist in guest-physical address space, only\r
+// in "fw_cfg file space". In addition, the "pointer to patch" is not\r
+// initialized by QEMU in-place with a possibly nonzero offset value: the\r
+// relative offset into PointeeFile comes from the explicit PointeeOffset\r
+// field.\r
+//\r
+typedef struct {\r
+  UINT8  PointerFile[QEMU_LOADER_FNAME_SIZE]; // NUL-terminated\r
+  UINT8  PointeeFile[QEMU_LOADER_FNAME_SIZE]; // NUL-terminated\r
+  UINT32 PointerOffset;\r
+  UINT32 PointeeOffset;\r
+  UINT8  PointerSize;                         // one of 1, 2, 4, 8\r
+} QEMU_LOADER_WRITE_POINTER;\r
+\r
 typedef struct {\r
   UINT32 Type;                             // QEMU_LOADER_COMMAND_TYPE values\r
   union {\r
-    QEMU_LOADER_ALLOCATE     Allocate;\r
-    QEMU_LOADER_ADD_POINTER  AddPointer;\r
-    QEMU_LOADER_ADD_CHECKSUM AddChecksum;\r
-    UINT8                    Padding[124];\r
+    QEMU_LOADER_ALLOCATE      Allocate;\r
+    QEMU_LOADER_ADD_POINTER   AddPointer;\r
+    QEMU_LOADER_ADD_CHECKSUM  AddChecksum;\r
+    QEMU_LOADER_WRITE_POINTER WritePointer;\r
+    UINT8                     Padding[124];\r
   } Command;\r
 } QEMU_LOADER_ENTRY;\r
 #pragma pack ()\r