- PERF_CODE (\r
- AsciiSPrint (PerfToken, sizeof(PerfToken), "S%04xB%02xD%02xF%01x", Segment, SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function);\r
- Identifier = (Segment << 16) | SourceId.Uint16;\r
- PERF_START_EX (gImageHandle, PerfToken, "IntelVTD", 0, Identifier);\r
- );\r
-\r
- Status = SetAccessAttribute (Segment, SourceId, DeviceAddress, Length, IoMmuAccess);\r
+ if (mAcpiDmarTable == NULL) {\r
+ //\r
+ // Record the entry to driver global variable.\r
+ // As such once VTd is activated, the setting can be adopted.\r
+ //\r
+ Status = RequestAccessAttribute (Segment, SourceId, DeviceAddress, Length, IoMmuAccess);\r
+ } else {\r
+ PERF_CODE (\r
+ AsciiSPrint (PerfToken, sizeof(PerfToken), "S%04xB%02xD%02xF%01x", Segment, SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function);\r
+ Identifier = (Segment << 16) | SourceId.Uint16;\r
+ PERF_START_EX (gImageHandle, PerfToken, "IntelVTD", 0, Identifier);\r
+ );\r
+\r
+ Status = SetAccessAttribute (Segment, SourceId, DeviceAddress, Length, IoMmuAccess);\r
+\r
+ PERF_CODE (\r
+ Identifier = (Segment << 16) | SourceId.Uint16;\r
+ PERF_END_EX (gImageHandle, PerfToken, "IntelVTD", 0, Identifier);\r
+ );\r
+ }\r