]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.h
MdeModulePkg/XhciDxe: Add boundary check for TRB ring allocation
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / XhciDxe / UsbHcMem.h
index 48ae86141ca2df9fca4c9552a9230eb865c1b478..c85b0b919f56116674d47d894380ad25f85544e8 100644 (file)
@@ -48,6 +48,8 @@ typedef struct _USBHC_MEM_POOL {
 \r
 #define USBHC_MEM_ROUND(Len)  (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK))\r
 \r
+#define USBHC_MEM_TRB_RINGS_BOUNDARY  SIZE_64KB\r
+\r
 //\r
 // Advance the byte and bit to the next bit, adjust byte accordingly.\r
 //\r
@@ -92,8 +94,9 @@ UsbHcFreeMemPool (
   Allocate some memory from the host controller's memory pool\r
   which can be used to communicate with host controller.\r
 \r
-  @param  Pool  The host controller's memory pool.\r
-  @param  Size  Size of the memory to allocate.\r
+  @param  Pool                 The host controller's memory pool.\r
+  @param  Size                 Size of the memory to allocate.\r
+  @param  AllocationForRing    The allocated memory is for Ring or not.\r
 \r
   @return The allocated memory or NULL.\r
 \r
@@ -101,7 +104,8 @@ UsbHcFreeMemPool (
 VOID *\r
 UsbHcAllocateMem (\r
   IN  USBHC_MEM_POOL  *Pool,\r
-  IN  UINTN           Size\r
+  IN  UINTN           Size,\r
+  IN  BOOLEAN         AllocationForRing\r
   );\r
 \r
 /**\r