audk/MdePkg/Library/BaseLib
Laszlo Ersek 8596c14090 MdePkg/BaseLib: add PatchInstructionX86()
Some edk2 modules generate X86 machine code at module execution time by:

- compiling "template" code with NASM at module build time,

- linking the object code into the module,

- and patching the immediate (constant) operands of some instructions when
  the module is executed.

Add a helper function to BaseLib so that the C code performing the
patching is easier to read and maintain.

The implementation in this patch is taken mainly from Mike Kinney's
mailing list messages at
<http://mid.mail-archive.com/E92EE9817A31E24EB0585FDF735412F5B895C360@ORSMSX113.amr.corp.intel.com>,
<http://mid.mail-archive.com/E92EE9817A31E24EB0585FDF735412F5B898BF66@ORSMSX112.amr.corp.intel.com>.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=866
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2018-04-04 16:43:58 +02:00
..
AArch64 MdePkg/Library/BaseLib/AArch64: Comment style harmonization 2018-03-20 10:03:05 +08:00
Arm MdePkg/Library/BaseLib: Enable VS2017/ARM builds 2018-02-07 09:49:21 +08:00
Ebc MdePkg/BaseLib: add attribute 'RETURNS_TWICE' to SetJump 2018-01-10 11:42:17 +08:00
Ia32 MdePkg/BaseLib: add attribute 'RETURNS_TWICE' to SetJump 2018-01-10 11:42:17 +08:00
Ipf
X64 MdePkg/BaseLib: Add stack switch related definitions for IA32 2017-12-08 14:38:48 +08:00
ARShiftU64.c
BaseLib.inf MdePkg/BaseLib: add PatchInstructionX86() 2018-04-04 16:43:58 +02:00
BaseLib.uni
BaseLibInternals.h MdePkg/BaseLib: Add IsNodeInList() function. 2017-08-16 16:55:30 +08:00
BitField.c
CheckSum.c MdePkg BaseLib: Add new API CalculateCrc32() 2017-10-10 18:10:15 +08:00
ChkStkGcc.c
Cpu.c
CpuDeadLoop.c
DivS64x64Remainder.c
DivU64x32.c
DivU64x32Remainder.c
DivU64x64Remainder.c
FilePaths.c MdePkg/BaseLib: Avoid reading content beyond string boundary 2017-09-21 14:06:28 +08:00
GetPowerOfTwo32.c
GetPowerOfTwo64.c
HighBitSet32.c
HighBitSet64.c
LRotU32.c
LRotU64.c
LShiftU64.c
LinkedList.c MdePkg/BaseLib: Update internal LinkedList verifications. 2017-08-16 16:55:32 +08:00
LongJump.c
LowBitSet32.c
LowBitSet64.c
Math64.c
ModU64x32.c
MultS64x64.c
MultU64x32.c
MultU64x64.c
RRotU32.c
RRotU64.c
RShiftU64.c
SafeString.c MdePkg/SafeString: Fix potential out-of-bound memory access 2018-02-06 17:31:08 +08:00
SetJump.c
String.c MdePkg: Refine casting expression result to bigger size 2017-03-06 14:18:45 +08:00
SwapBytes16.c
SwapBytes32.c
SwapBytes64.c
SwitchStack.c
Unaligned.c
X86DisablePaging32.c
X86DisablePaging64.c
X86EnablePaging32.c
X86EnablePaging64.c
X86FxRestore.c
X86FxSave.c
X86GetInterruptState.c
X86MemoryFence.c
X86Msr.c
X86PatchInstruction.c MdePkg/BaseLib: add PatchInstructionX86() 2018-04-04 16:43:58 +02:00
X86RdRand.c MdePkg/BaseLib: Add one wrapper on RdRand access for parameter check. 2016-11-16 16:49:10 +08:00
X86ReadGdtr.c
X86ReadIdtr.c
X86Thunk.c
X86WriteGdtr.c
X86WriteIdtr.c