/* Update an ARM MOVT or MOVW immediate instruction immediate data. */
VOID ThumbMovtImmediatePatch(IN OUT UINT16 *Instruction, IN UINT16 Address)
/* Update an ARM MOVT or MOVW immediate instruction immediate data. */
VOID ThumbMovtImmediatePatch(IN OUT UINT16 *Instruction, IN UINT16 Address)
{
  UINT16  Patch;
  Patch  = ((Address >> 12) & 0x000f);
  Patch |= (((Address & BIT11) != 0) ? BIT10 : 0);
  *Instruction = (*Instruction & ~0x040f) | Patch;
  Patch  =  Address & 0x000000ff;
  Patch |=  ((Address << 4) & 0x00007000);
  Instruction++;
  *Instruction = (*Instruction & ~0x70ff) | Patch;
}