]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/MdeModulePkg: Implement the missing SetMemorySpaceCapabilities function.
authorEugene Cohen <eugene@hp.com>
Thu, 20 Nov 2014 01:23:49 +0000 (01:23 +0000)
committerlzeng14 <lzeng14@Edk2>
Thu, 20 Nov 2014 01:23:49 +0000 (01:23 +0000)
It is defined in the PI Specification version 1.3.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16409 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/DxeMain.h
MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
MdeModulePkg/Core/Dxe/Gcd/Gcd.c
MdeModulePkg/Core/Dxe/Gcd/Gcd.h
MdeModulePkg/Core/Dxe/Mem/Page.c
MdePkg/Include/Pi/PiDxeCis.h

index bb2bfab370ff8ec32bb749336b9383684ad54d8d..059a38336acdd4502becdcae202a488198b269b8 100644 (file)
@@ -1863,7 +1863,7 @@ CoreGetMemorySpaceDescriptor (
                                 resource range specified by BaseAddress and Length.\r
   @retval EFI_UNSUPPORTED       The bit mask of attributes is not support for the memory resource\r
                                 range specified by BaseAddress and Length.\r
-  @retval EFI_ACCESS_DEFINED    The attributes for the memory resource range specified by\r
+  @retval EFI_ACCESS_DENIED     The attributes for the memory resource range specified by\r
                                 BaseAddress and Length cannot be modified.\r
   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the attributes of\r
                                 the memory resource range.\r
@@ -1880,6 +1880,32 @@ CoreSetMemorySpaceAttributes (
   );\r
 \r
 \r
+/**\r
+  Modifies the capabilities for a memory region in the global coherency domain of the\r
+  processor.\r
+\r
+  @param  BaseAddress      The physical address that is the start address of a memory region.\r
+  @param  Length           The size in bytes of the memory region.\r
+  @param  Capabilities     The bit mask of capabilities that the memory region supports.\r
+\r
+  @retval EFI_SUCCESS           The capabilities were set for the memory region.\r
+  @retval EFI_INVALID_PARAMETER Length is zero.\r
+  @retval EFI_UNSUPPORTED       The capabilities specified by Capabilities do not include the\r
+                                memory region attributes currently in use.\r
+  @retval EFI_ACCESS_DENIED     The capabilities for the memory resource range specified by\r
+                                BaseAddress and Length cannot be modified.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the capabilities\r
+                                of the memory resource range.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreSetMemorySpaceCapabilities (\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length,\r
+  IN UINT64                Capabilities\r
+  );\r
+\r
+\r
 /**\r
   Returns a map of the memory resources in the global coherency domain of the\r
   processor.\r
@@ -2816,4 +2842,26 @@ CoreUpdateProfile (
   IN VOID                   *Buffer\r
   );\r
 \r
+/**\r
+  Internal function.  Converts a memory range to use new attributes.\r
+\r
+  @param  Start                  The first address of the range Must be page\r
+                                 aligned\r
+  @param  NumberOfPages          The number of pages to convert\r
+  @param  NewAttributes          The new attributes value for the range.\r
+\r
+  @retval EFI_INVALID_PARAMETER  Invalid parameter\r
+  @retval EFI_NOT_FOUND          Could not find a descriptor cover the specified\r
+                                 range  or convertion not allowed.\r
+  @retval EFI_SUCCESS            Successfully converts the memory range to the\r
+                                 specified attributes.\r
+\r
+**/\r
+VOID\r
+CoreUpdateMemoryAttributes (\r
+  IN EFI_PHYSICAL_ADDRESS  Start,\r
+  IN UINT64                NumberOfPages,\r
+  IN UINT64                NewAttributes\r
+  );\r
+\r
 #endif\r
index 1ac5cc17212d590479723f9216e85e3f69852fe3..9b03509e6b9691f5c554bbf3482ca900eab0d4ee 100644 (file)
@@ -123,6 +123,7 @@ EFI_DXE_SERVICES mDxeServices = {
   (EFI_SCHEDULE)                     CoreSchedule,                        // Schedule\r
   (EFI_TRUST)                        CoreTrust,                           // Trust\r
   (EFI_PROCESS_FIRMWARE_VOLUME)      CoreProcessFirmwareVolume,           // ProcessFirmwareVolume\r
+  (EFI_SET_MEMORY_SPACE_CAPABILITIES)CoreSetMemorySpaceCapabilities,      // SetMemorySpaceCapabilities\r
 };\r
 \r
 EFI_SYSTEM_TABLE mEfiSystemTableTemplate = {\r
index fe2ac1011d274404654c93a4e4f3f1bfbd8ceeea..7268465f36584e1a60dd6f6af90cbcc1bbb07412 100644 (file)
@@ -3,7 +3,7 @@
   The GCD services are used to manage the memory and I/O regions that\r
   are accessible to the CPU that is executing the DXE core.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
@@ -798,7 +798,7 @@ CoreConvertSpace (
       }\r
       break;\r
     //\r
-    // Set attribute operations\r
+    // Set attributes operation\r
     //\r
     case GCD_SET_ATTRIBUTES_MEMORY_OPERATION:\r
       if ((Attributes & EFI_MEMORY_RUNTIME) != 0) {\r
@@ -812,6 +812,23 @@ CoreConvertSpace (
         goto Done;\r
       }\r
       break;\r
+    //
+    // Set capabilities operation
+    //
+    case GCD_SET_CAPABILITIES_MEMORY_OPERATION:
+      if ((BaseAddress & EFI_PAGE_MASK) != 0 || (Length & EFI_PAGE_MASK) != 0) {
+        Status = EFI_INVALID_PARAMETER;
+
+        goto Done;
+      }\r
+      //
+      // Current attributes must still be supported with new capabilities\r
+      //
+      if ((Capabilities & Entry->Attributes) != Entry->Attributes) {
+        Status = EFI_UNSUPPORTED;
+        goto Done;
+      }
+      break;\r
     }\r
     Link = Link->ForwardLink;\r
   }\r
@@ -891,11 +908,17 @@ CoreConvertSpace (
       Entry->GcdIoType = EfiGcdIoTypeNonExistent;\r
       break;\r
     //\r
-    // Set attribute operations\r
+    // Set attributes operation\r
     //\r
     case GCD_SET_ATTRIBUTES_MEMORY_OPERATION:\r
       Entry->Attributes = Attributes;\r
       break;\r
+    //\r
+    // Set capabilities operation\r
+    //\r
+    case GCD_SET_CAPABILITIES_MEMORY_OPERATION:
+      Entry->Capabilities = Capabilities;
+      break;\r
     }\r
     Link = Link->ForwardLink;\r
   }\r
@@ -1558,6 +1581,45 @@ CoreSetMemorySpaceAttributes (
 }\r
 \r
 \r
+/**\r
+  Modifies the capabilities for a memory region in the global coherency domain of the\r
+  processor.\r
+\r
+  @param  BaseAddress      The physical address that is the start address of a memory region.\r
+  @param  Length           The size in bytes of the memory region.\r
+  @param  Capabilities     The bit mask of capabilities that the memory region supports.\r
+\r
+  @retval EFI_SUCCESS           The capabilities were set for the memory region.\r
+  @retval EFI_INVALID_PARAMETER Length is zero.\r
+  @retval EFI_UNSUPPORTED       The capabilities specified by Capabilities do not include the\r
+                                memory region attributes currently in use.\r
+  @retval EFI_ACCESS_DENIED     The capabilities for the memory resource range specified by\r
+                                BaseAddress and Length cannot be modified.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the capabilities\r
+                                of the memory resource range.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreSetMemorySpaceCapabilities (\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length,\r
+  IN UINT64                Capabilities\r
+  )\r
+{\r
+  EFI_STATUS    Status;
+
+  DEBUG ((DEBUG_GCD, "GCD:CoreSetMemorySpaceCapabilities(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));\r
+  DEBUG ((DEBUG_GCD, "  Capabilities  = %016lx\n", Capabilities));
+
+  Status = CoreConvertSpace (GCD_SET_CAPABILITIES_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, Capabilities, 0);
+  if (!EFI_ERROR(Status)) {\r
+    CoreUpdateMemoryAttributes(BaseAddress, RShiftU64(Length, EFI_PAGE_SHIFT), Capabilities);
+  }
+
+  return Status;\r
+}\r
+\r
+\r
 /**\r
   Returns a map of the memory resources in the global coherency domain of the\r
   processor.\r
index b63291529f3edcbcfffd098d22dc161002625151..1d5fb61092007eeee1f4ad220ac36046ba175c53 100644 (file)
@@ -2,7 +2,7 @@
   GCD Operations and data structure used to\r
   convert from GCD attributes to EFI Memory Map attributes.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
@@ -22,16 +22,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define GCD_MEMORY_SPACE_OPERATION 0x20\r
 #define GCD_IO_SPACE_OPERATION     0x40\r
 \r
-#define GCD_ADD_MEMORY_OPERATION             (GCD_MEMORY_SPACE_OPERATION | 0)\r
-#define GCD_ALLOCATE_MEMORY_OPERATION        (GCD_MEMORY_SPACE_OPERATION | 1)\r
-#define GCD_FREE_MEMORY_OPERATION            (GCD_MEMORY_SPACE_OPERATION | 2)\r
-#define GCD_REMOVE_MEMORY_OPERATION          (GCD_MEMORY_SPACE_OPERATION | 3)\r
-#define GCD_SET_ATTRIBUTES_MEMORY_OPERATION  (GCD_MEMORY_SPACE_OPERATION | 4)\r
-\r
-#define GCD_ADD_IO_OPERATION                 (GCD_IO_SPACE_OPERATION | 0)\r
-#define GCD_ALLOCATE_IO_OPERATION            (GCD_IO_SPACE_OPERATION | 1)\r
-#define GCD_FREE_IO_OPERATION                (GCD_IO_SPACE_OPERATION | 2)\r
-#define GCD_REMOVE_IO_OPERATION              (GCD_IO_SPACE_OPERATION | 3)\r
+#define GCD_ADD_MEMORY_OPERATION               (GCD_MEMORY_SPACE_OPERATION | 0)\r
+#define GCD_ALLOCATE_MEMORY_OPERATION          (GCD_MEMORY_SPACE_OPERATION | 1)\r
+#define GCD_FREE_MEMORY_OPERATION              (GCD_MEMORY_SPACE_OPERATION | 2)\r
+#define GCD_REMOVE_MEMORY_OPERATION            (GCD_MEMORY_SPACE_OPERATION | 3)\r
+#define GCD_SET_ATTRIBUTES_MEMORY_OPERATION    (GCD_MEMORY_SPACE_OPERATION | 4)\r
+#define GCD_SET_CAPABILITIES_MEMORY_OPERATION  (GCD_MEMORY_SPACE_OPERATION | 5)\r
+\r
+#define GCD_ADD_IO_OPERATION                   (GCD_IO_SPACE_OPERATION | 0)\r
+#define GCD_ALLOCATE_IO_OPERATION              (GCD_IO_SPACE_OPERATION | 1)\r
+#define GCD_FREE_IO_OPERATION                  (GCD_IO_SPACE_OPERATION | 2)\r
+#define GCD_REMOVE_IO_OPERATION                (GCD_IO_SPACE_OPERATION | 3)\r
 \r
 //\r
 // The data structure used to convert from GCD attributes to EFI Memory Map attributes\r
index 18780070c5eaf8df44a27756933ba236c8c3800a..64967259a225e62b641c77d27c3069733dcfb8bb 100644 (file)
@@ -671,13 +671,17 @@ CoreAddMemoryDescriptor (
 \r
 \r
 /**\r
-  Internal function.  Converts a memory range to the specified type.\r
-  The range must exist in the memory map.\r
+  Internal function.  Converts a memory range to the specified type or attributes.\r
+  The range must exist in the memory map.  Either ChangingType or\r
+  ChangingAttributes must be set, but not both.\r
 \r
   @param  Start                  The first address of the range Must be page\r
                                  aligned\r
   @param  NumberOfPages          The number of pages to convert\r
+  @param  ChangingType           Boolean indicating that type value should be changed\r
   @param  NewType                The new type for the memory range\r
+  @param  ChangingAttributes     Boolean indicating that attributes value should be changed\r
+  @param  NewAttributes          The new attributes for the memory range\r
 \r
   @retval EFI_INVALID_PARAMETER  Invalid parameter\r
   @retval EFI_NOT_FOUND          Could not find a descriptor cover the specified\r
@@ -687,10 +691,13 @@ CoreAddMemoryDescriptor (
 \r
 **/\r
 EFI_STATUS\r
-CoreConvertPages (\r
+CoreConvertPagesEx (\r
   IN UINT64           Start,\r
   IN UINT64           NumberOfPages,\r
-  IN EFI_MEMORY_TYPE  NewType\r
+  IN BOOLEAN          ChangingType,\r
+  IN EFI_MEMORY_TYPE  NewType,\r
+  IN BOOLEAN          ChangingAttributes,\r
+  IN UINT64           NewAttributes\r
   )\r
 {\r
 \r
@@ -698,6 +705,7 @@ CoreConvertPages (
   UINT64          End;\r
   UINT64          RangeEnd;\r
   UINT64          Attribute;\r
+  EFI_MEMORY_TYPE MemType;\r
   LIST_ENTRY      *Link;\r
   MEMORY_MAP      *Entry;\r
 \r
@@ -709,6 +717,7 @@ CoreConvertPages (
   ASSERT ((Start & EFI_PAGE_MASK) == 0);\r
   ASSERT (End > Start) ;\r
   ASSERT_LOCKED (&gMemoryLock);\r
+  ASSERT ( (ChangingType == FALSE) || (ChangingAttributes == FALSE) );\r
 \r
   if (NumberOfPages == 0 || ((Start & EFI_PAGE_MASK) != 0) || (Start > (Start + NumberOfBytes))) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -747,36 +756,43 @@ CoreConvertPages (
       RangeEnd = Entry->End;\r
     }\r
 \r
-    DEBUG ((DEBUG_PAGE, "ConvertRange: %lx-%lx to %d\n", Start, RangeEnd, NewType));\r
-\r
-    //\r
-    // Debug code - verify conversion is allowed\r
-    //\r
-    if (!(NewType == EfiConventionalMemory ? 1 : 0) ^ (Entry->Type == EfiConventionalMemory ? 1 : 0)) {\r
-      DEBUG ((DEBUG_ERROR | DEBUG_PAGE, "ConvertPages: Incompatible memory types\n"));\r
-      return EFI_NOT_FOUND;\r
+    if (ChangingType) {\r
+      DEBUG ((DEBUG_PAGE, "ConvertRange: %lx-%lx to type %d\n", Start, RangeEnd, NewType));\r
+    }\r
+    if (ChangingAttributes) {\r
+      DEBUG ((DEBUG_PAGE, "ConvertRange: %lx-%lx to attr %lx\n", Start, RangeEnd, NewAttributes));\r
     }\r
 \r
-    //\r
-    // Update counters for the number of pages allocated to each memory type\r
-    //\r
-    if ((UINT32)Entry->Type < EfiMaxMemoryType) {\r
-      if ((Start >= mMemoryTypeStatistics[Entry->Type].BaseAddress && Start <= mMemoryTypeStatistics[Entry->Type].MaximumAddress) ||\r
-          (Start >= mDefaultBaseAddress && Start <= mDefaultMaximumAddress)                                                          ) {\r
-        if (NumberOfPages > mMemoryTypeStatistics[Entry->Type].CurrentNumberOfPages) {\r
-          mMemoryTypeStatistics[Entry->Type].CurrentNumberOfPages = 0;\r
-        } else {\r
-          mMemoryTypeStatistics[Entry->Type].CurrentNumberOfPages -= NumberOfPages;\r
+    if (ChangingType) {\r
+      //\r
+      // Debug code - verify conversion is allowed\r
+      //\r
+      if (!(NewType == EfiConventionalMemory ? 1 : 0) ^ (Entry->Type == EfiConventionalMemory ? 1 : 0)) {\r
+        DEBUG ((DEBUG_ERROR | DEBUG_PAGE, "ConvertPages: Incompatible memory types\n"));\r
+        return EFI_NOT_FOUND;\r
+      }\r
+\r
+      //\r
+      // Update counters for the number of pages allocated to each memory type\r
+      //\r
+      if ((UINT32)Entry->Type < EfiMaxMemoryType) {\r
+        if ((Start >= mMemoryTypeStatistics[Entry->Type].BaseAddress && Start <= mMemoryTypeStatistics[Entry->Type].MaximumAddress) ||\r
+            (Start >= mDefaultBaseAddress && Start <= mDefaultMaximumAddress)                                                          ) {\r
+          if (NumberOfPages > mMemoryTypeStatistics[Entry->Type].CurrentNumberOfPages) {\r
+            mMemoryTypeStatistics[Entry->Type].CurrentNumberOfPages = 0;\r
+          } else {\r
+            mMemoryTypeStatistics[Entry->Type].CurrentNumberOfPages -= NumberOfPages;\r
+          }\r
         }\r
       }\r
-    }\r
 \r
-    if ((UINT32)NewType < EfiMaxMemoryType) {\r
-      if ((Start >= mMemoryTypeStatistics[NewType].BaseAddress && Start <= mMemoryTypeStatistics[NewType].MaximumAddress) ||\r
-          (Start >= mDefaultBaseAddress && Start <= mDefaultMaximumAddress)                                                  ) {\r
-        mMemoryTypeStatistics[NewType].CurrentNumberOfPages += NumberOfPages;\r
-        if (mMemoryTypeStatistics[NewType].CurrentNumberOfPages > gMemoryTypeInformation[mMemoryTypeStatistics[NewType].InformationIndex].NumberOfPages) {\r
-          gMemoryTypeInformation[mMemoryTypeStatistics[NewType].InformationIndex].NumberOfPages = (UINT32)mMemoryTypeStatistics[NewType].CurrentNumberOfPages;\r
+      if ((UINT32)NewType < EfiMaxMemoryType) {\r
+        if ((Start >= mMemoryTypeStatistics[NewType].BaseAddress && Start <= mMemoryTypeStatistics[NewType].MaximumAddress) ||\r
+            (Start >= mDefaultBaseAddress && Start <= mDefaultMaximumAddress)                                                  ) {\r
+          mMemoryTypeStatistics[NewType].CurrentNumberOfPages += NumberOfPages;\r
+          if (mMemoryTypeStatistics[NewType].CurrentNumberOfPages > gMemoryTypeInformation[mMemoryTypeStatistics[NewType].InformationIndex].NumberOfPages) {\r
+            gMemoryTypeInformation[mMemoryTypeStatistics[NewType].InformationIndex].NumberOfPages = (UINT32)mMemoryTypeStatistics[NewType].CurrentNumberOfPages;\r
+          }\r
         }\r
       }\r
     }\r
@@ -830,9 +846,15 @@ CoreConvertPages (
 \r
     //\r
     // The new range inherits the same Attribute as the Entry\r
-    //it is being cut out of\r
+    // it is being cut out of unless attributes are being changed\r
     //\r
-    Attribute = Entry->Attribute;\r
+    if (ChangingType) {\r
+      Attribute = Entry->Attribute;\r
+      MemType = NewType;\r
+    } else {\r
+      Attribute = NewAttributes;\r
+      MemType = Entry->Type;\r
+    }\r
 \r
     //\r
     // If the descriptor is empty, then remove it from the map\r
@@ -845,8 +867,8 @@ CoreConvertPages (
     //\r
     // Add our new range in\r
     //\r
-    CoreAddRange (NewType, Start, RangeEnd, Attribute);\r
-    if (NewType == EfiConventionalMemory) {\r
+    CoreAddRange (MemType, Start, RangeEnd, Attribute);\r
+    if (ChangingType && (MemType == EfiConventionalMemory)) {\r
       //\r
       // Avoid calling DEBUG_CLEAR_MEMORY() for an address of 0 because this\r
       // macro will ASSERT() if address is 0.  Instead, CoreAddRange() guarantees\r
@@ -880,6 +902,65 @@ CoreConvertPages (
 }\r
 \r
 \r
+/**\r
+  Internal function.  Converts a memory range to the specified type.\r
+  The range must exist in the memory map.\r
+\r
+  @param  Start                  The first address of the range Must be page\r
+                                 aligned\r
+  @param  NumberOfPages          The number of pages to convert\r
+  @param  NewType                The new type for the memory range\r
+\r
+  @retval EFI_INVALID_PARAMETER  Invalid parameter\r
+  @retval EFI_NOT_FOUND          Could not find a descriptor cover the specified\r
+                                 range  or convertion not allowed.\r
+  @retval EFI_SUCCESS            Successfully converts the memory range to the\r
+                                 specified type.\r
+\r
+**/\r
+EFI_STATUS\r
+CoreConvertPages (\r
+  IN UINT64           Start,\r
+  IN UINT64           NumberOfPages,\r
+  IN EFI_MEMORY_TYPE  NewType\r
+  )\r
+{\r
+  return CoreConvertPagesEx(Start, NumberOfPages, TRUE, NewType, FALSE, 0);\r
+}\r
+\r
+\r
+/**\r
+  Internal function.  Converts a memory range to use new attributes.\r
+\r
+  @param  Start                  The first address of the range Must be page\r
+                                 aligned\r
+  @param  NumberOfPages          The number of pages to convert\r
+  @param  NewAttributes          The new attributes value for the range.\r
+\r
+  @retval EFI_INVALID_PARAMETER  Invalid parameter\r
+  @retval EFI_NOT_FOUND          Could not find a descriptor cover the specified\r
+                                 range  or convertion not allowed.\r
+  @retval EFI_SUCCESS            Successfully converts the memory range to the\r
+                                 specified attributes.\r
+\r
+**/\r
+VOID\r
+CoreUpdateMemoryAttributes (\r
+  IN EFI_PHYSICAL_ADDRESS  Start,\r
+  IN UINT64                NumberOfPages,\r
+  IN UINT64                NewAttributes\r
+  )\r
+{\r
+  CoreAcquireMemoryLock ();\r
+\r
+  //\r
+  // Update the attributes to the new value\r
+  //\r
+  CoreConvertPagesEx(Start, NumberOfPages, FALSE, (EFI_MEMORY_TYPE)0, TRUE, NewAttributes);\r
+\r
+  CoreReleaseMemoryLock ();\r
+}\r
+\r
 \r
 /**\r
   Internal function. Finds a consecutive free page range below\r
index 9bcfecc046498f9c6fd784add41616c418a0cef7..a3d57b16eb1f9edaf553b56dd884e18c0459c555 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Include file matches things in PI.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -365,7 +365,7 @@ EFI_STATUS
                                 resource range specified by BaseAddress and Length.\r
   @retval EFI_UNSUPPORTED       The bit mask of attributes is not support for the memory resource\r
                                 range specified by BaseAddress and Length.\r
-  @retval EFI_ACCESS_DEFINED    The attributes for the memory resource range specified by\r
+  @retval EFI_ACCESS_DENIED     The attributes for the memory resource range specified by\r
                                 BaseAddress and Length cannot be modified.\r
   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the attributes of\r
                                 the memory resource range.\r
@@ -380,6 +380,31 @@ EFI_STATUS
   IN UINT64                       Attributes\r
   );\r
 \r
+/**\r
+  Modifies the capabilities for a memory region in the global coherency domain of the\r
+  processor.\r
+\r
+  @param  BaseAddress      The physical address that is the start address of a memory region.\r
+  @param  Length           The size in bytes of the memory region.\r
+  @param  Capabilities     The bit mask of capabilities that the memory region supports.\r
+\r
+  @retval EFI_SUCCESS           The capabilities were set for the memory region.\r
+  @retval EFI_INVALID_PARAMETER Length is zero.\r
+  @retval EFI_UNSUPPORTED       The capabilities specified by Capabilities do not include the\r
+                                memory region attributes currently in use.\r
+  @retval EFI_ACCESS_DENIED     The capabilities for the memory resource range specified by\r
+                                BaseAddress and Length cannot be modified.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the capabilities\r
+                                of the memory resource range.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_MEMORY_SPACE_CAPABILITIES) (\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length,\r
+  IN UINT64                Capabilities\r
+  );\r
+\r
 /**\r
   Returns a map of the memory resources in the global coherency domain of the\r
   processor.\r
@@ -694,6 +719,10 @@ typedef struct {
   // Service to process a single firmware volume found in a capsule\r
   //\r
   EFI_PROCESS_FIRMWARE_VOLUME     ProcessFirmwareVolume;\r
+  //\r
+  // Extensions to Global Coherency Domain Services\r
+  //\r
+  EFI_SET_MEMORY_SPACE_CAPABILITIES SetMemorySpaceCapabilities;\r
 } DXE_SERVICES;\r
 \r
 typedef DXE_SERVICES EFI_DXE_SERVICES;\r