]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg Variable: Remove CacheOffset in UpdateVariable()
authorStar Zeng <star.zeng@intel.com>
Sat, 12 Jan 2019 08:31:51 +0000 (16:31 +0800)
committerStar Zeng <star.zeng@intel.com>
Thu, 24 Jan 2019 02:52:33 +0000 (10:52 +0800)
commitebe34c96f473b9b7389f1f05a29c0bdb3fe36ac3
tree1e974f6772583ff24338c54afb79aa2a1341be4a
parentb59fd889acc43a34030c20241cfcf102b442e5bf
MdeModulePkg Variable: Remove CacheOffset in UpdateVariable()

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

CacheOffset could be removed in UpdateVariable() after
//
// update the memory copy of Flash region.
//
CopyMem (
  (UINT8 *)mNvVariableCache + CacheOffset,
  (UINT8 *)NextVariable, VarSize
   );

is moved to be before mVariableModuleGlobal->NonVolatileLastVariableOffset
value is updated, like right before
mVariableModuleGlobal->NonVolatileLastVariableOffset +=
  HEADER_ALIGN (VarSize);

Except for the movement above, the patch also capitalizes the first
character of "update the memory copy of Flash region".

This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c