/* Returns Breakpoint type (InstructionExecution, DataWrite, DataRead or DataReadWrite) based on the Breakpoint number */
BREAK_TYPE GetBreakpointType(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN BreakpointNumber)
/* Returns Breakpoint type (InstructionExecution, DataWrite, DataRead or DataReadWrite) based on the Breakpoint number */
BREAK_TYPE GetBreakpointType(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN BreakpointNumber)
{
  IA32_DR7    Dr7;
  BREAK_TYPE  Type = NotSupported;
  Dr7.UintN = SystemContext.SystemContextIa32->Dr7;
  if (BreakpointNumber == 1) {
    Type = (BREAK_TYPE)Dr7.Bits.RW0;
  } else if (BreakpointNumber == 2) {
    Type = (BREAK_TYPE)Dr7.Bits.RW1;
  } else if (BreakpointNumber == 3) {
    Type = (BREAK_TYPE)Dr7.Bits.RW2;
  } else if (BreakpointNumber == 4) {
    Type = (BREAK_TYPE)Dr7.Bits.RW3;
  }
  return Type;
}