/** @file\r
Supporting functions for IA32 architecture.\r
\r
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
IA32_DESCRIPTOR IdtDescriptor;\r
UINTN Index;\r
UINT16 CodeSegment;\r
+ UINT32 RegEdx;\r
\r
AsmReadIdtr (&IdtDescriptor);\r
\r
IdtEntry[DEBUG_TIMER_VECTOR].Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32;\r
\r
//\r
+ // If the CPU supports Debug Extensions(CPUID:01 EDX:BIT2), then \r
// Set DE flag in CR4 to enable IO breakpoint\r
//\r
- AsmWriteCr4 (AsmReadCr4 () | BIT3);\r
+ AsmCpuid (1, NULL, NULL, NULL, &RegEdx);\r
+ if ((RegEdx & BIT2) != 0) {\r
+ AsmWriteCr4 (AsmReadCr4 () | BIT3);\r
+ }\r
}\r
\r
/**\r