]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.h
Improve coding style in MdeModulePkg.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciDxe / UsbHcMem.h
index ce0a78298f93e59b26038426ca9f2768976970a5..3394c9b99e681256617c5a9dbc8143047cb96191 100644 (file)
@@ -2,7 +2,7 @@
 \r
   This file contains the definination for host controller memory management routines.\r
 \r
-Copyright (c) 2007 - 2009, Intel Corporation\r
+Copyright (c) 2007 - 2010, Intel Corporation\r
 All rights reserved. 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
@@ -24,15 +24,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define USB_HC_HIGH_32BIT(Addr64)    \\r
           ((UINT32)(RShiftU64((UINTN)(Addr64), 32) & 0XFFFFFFFF))\r
 \r
-typedef struct _USBHC_MEM_BLOCK {\r
+typedef struct _USBHC_MEM_BLOCK USBHC_MEM_BLOCK;\r
+struct _USBHC_MEM_BLOCK {\r
   UINT8                   *Bits;    // Bit array to record which unit is allocated\r
   UINTN                   BitsLen;\r
   UINT8                   *Buf;\r
   UINT8                   *BufHost;\r
   UINTN                   BufLen;   // Memory size in bytes\r
   VOID                    *Mapping;\r
-  struct _USBHC_MEM_BLOCK *Next;\r
-} USBHC_MEM_BLOCK;\r
+  USBHC_MEM_BLOCK         *Next;\r
+};\r
 \r
 //\r
 // USBHC_MEM_POOL is used to manage the memory used by USB\r
@@ -46,12 +47,13 @@ typedef struct _USBHC_MEM_POOL {
   USBHC_MEM_BLOCK         *Head;\r
 } USBHC_MEM_POOL;\r
 \r
-typedef enum {\r
-  USBHC_MEM_UNIT           = 64,     // Memory allocation unit, must be 2^n, n>4\r
+//\r
+// Memory allocation unit, must be 2^n, n>4\r
+//\r
+#define USBHC_MEM_UNIT           64\r
 \r
-  USBHC_MEM_UNIT_MASK      = USBHC_MEM_UNIT - 1,\r
-  USBHC_MEM_DEFAULT_PAGES  = 16\r
-} USBHC_MEM_UNIT_DATA;\r
+#define USBHC_MEM_UNIT_MASK      (USBHC_MEM_UNIT - 1)\r
+#define USBHC_MEM_DEFAULT_PAGES  16\r
 \r
 #define USBHC_MEM_ROUND(Len)  (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK))\r
 \r