summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-08 10:26:16 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-08 10:26:16 +0000
commit78c2ffb5a7172b9c5fbef15b5edc7aae3de5d4f2 (patch)
treeb03daf0305f4cc6158867b2e99bbe920178929fc /MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
parent38bbd3d91c38481d18c1a7e2049473c951ee98ed (diff)
downloadedk2-78c2ffb5a7172b9c5fbef15b5edc7aae3de5d4f2.tar.gz
edk2-78c2ffb5a7172b9c5fbef15b5edc7aae3de5d4f2.tar.bz2
edk2-78c2ffb5a7172b9c5fbef15b5edc7aae3de5d4f2.zip
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5427 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c')
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c103
1 files changed, 44 insertions, 59 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
index d038ebc20d..92d7bf7a84 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
@@ -1,5 +1,7 @@
/** @file
+ Routine procedures for memory allocate/free.
+
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -9,15 +11,6 @@ http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-Module Name:
-
- EhciMem.c
-
-Abstract:
-
-
-Revision History
-
**/
@@ -25,15 +18,14 @@ Revision History
/**
- Allocate a block of memory to be used by the buffer pool
+ Allocate a block of memory to be used by the buffer pool.
- @param Pool The buffer pool to allocate memory for
- @param Pages How many pages to allocate
+ @param Pool The buffer pool to allocate memory for.
+ @param Pages How many pages to allocate.
- @return The allocated memory block or NULL if failed
+ @return The allocated memory block or NULL if failed.
**/
-STATIC
USBHC_MEM_BLOCK *
UsbHcAllocMemBlock (
IN USBHC_MEM_POOL *Pool,
@@ -127,15 +119,14 @@ FREE_BITARRAY:
/**
- Free the memory block from the memory pool
+ Free the memory block from the memory pool.
- @param Pool The memory pool to free the block from
- @param Block The memory block to free
+ @param Pool The memory pool to free the block from.
+ @param Block The memory block to free.
- @return VOID
+ @return None.
**/
-STATIC
VOID
UsbHcFreeMemBlock (
IN USBHC_MEM_POOL *Pool,
@@ -160,17 +151,15 @@ UsbHcFreeMemBlock (
/**
- Alloc some memory from the block
+ Alloc some memory from the block.
- @param Block The memory block to allocate memory from
- @param Mem The variable to store the memory allocated
- @param Units Number of memory units to allocate
+ @param Block The memory block to allocate memory from.
+ @param Units Number of memory units to allocate.
- @return EFI_SUCCESS : The needed memory is allocated
- @return EFI_NOT_FOUND : Can't find the free memory
+ @return The pointer to the allocated memory. If couldn't allocate the needed memory,
+ the return value is NULL.
**/
-STATIC
VOID *
UsbHcAllocMemFromBlock (
IN USBHC_MEM_BLOCK *Block,
@@ -236,15 +225,14 @@ UsbHcAllocMemFromBlock (
/**
- Insert the memory block to the pool's list of the blocks
+ Insert the memory block to the pool's list of the blocks.
- @param Head The head of the memory pool's block list
- @param Block The memory block to insert
+ @param Head The head of the memory pool's block list.
+ @param Block The memory block to insert.
- @return VOID
+ @return None.
**/
-STATIC
VOID
UsbHcInsertMemBlockToPool (
IN USBHC_MEM_BLOCK *Head,
@@ -260,13 +248,12 @@ UsbHcInsertMemBlockToPool (
/**
Is the memory block empty?
- @param Block The memory block to check
+ @param Block The memory block to check.
- @return TRUE : The memory block is empty
- @return FALSE : The memory block isn't empty
+ @retval TRUE The memory block is empty.
+ @retval FALSE The memory block isn't empty.
**/
-STATIC
BOOLEAN
UsbHcIsMemBlockEmpty (
IN USBHC_MEM_BLOCK *Block
@@ -285,15 +272,14 @@ UsbHcIsMemBlockEmpty (
/**
- Unlink the memory block from the pool's list
+ Unlink the memory block from the pool's list.
- @param Head The block list head of the memory's pool
+ @param Head The block list head of the memory's pool.
@param BlockToUnlink The memory block to unlink.
- @return VOID
+ @return None.
**/
-STATIC
VOID
UsbHcUnlinkMemBlock (
IN USBHC_MEM_BLOCK *Head,
@@ -315,16 +301,15 @@ UsbHcUnlinkMemBlock (
/**
- Initialize the memory management pool for the host controller
+ Initialize the memory management pool for the host controller.
- @param Pool The USB memory pool to initialize
- @param PciIo The PciIo that can be used to access the host controller
- @param Check4G Whether the host controller requires allocated memory
- from one 4G address space.
- @param Which4G The 4G memory area each memory allocated should be from
+ @param PciIo The PciIo that can be used to access the host controller.
+ @param Check4G Whether the host controller requires allocated memory
+ from one 4G address space.
+ @param Which4G The 4G memory area each memory allocated should be from.
- @return EFI_SUCCESS : The memory pool is initialized
- @return EFI_OUT_OF_RESOURCE : Fail to init the memory pool
+ @retval EFI_SUCCESS The memory pool is initialized.
+ @retval EFI_OUT_OF_RESOURCE Fail to init the memory pool.
**/
USBHC_MEM_POOL *
@@ -357,12 +342,12 @@ UsbHcInitMemPool (
/**
- Release the memory management pool
+ Release the memory management pool.
- @param Pool The USB memory pool to free
+ @param Pool The USB memory pool to free.
- @return EFI_SUCCESS : The memory pool is freed
- @return EFI_DEVICE_ERROR : Failed to free the memory pool
+ @retval EFI_SUCCESS The memory pool is freed.
+ @retval EFI_DEVICE_ERROR Failed to free the memory pool.
**/
EFI_STATUS
@@ -394,10 +379,10 @@ UsbHcFreeMemPool (
Allocate some memory from the host controller's memory pool
which can be used to communicate with host controller.
- @param Pool The host controller's memory pool
- @param Size Size of the memory to allocate
+ @param Pool The host controller's memory pool.
+ @param Size Size of the memory to allocate.
- @return The allocated memory or NULL
+ @return The allocated memory or NULL.
**/
VOID *
@@ -468,13 +453,13 @@ UsbHcAllocateMem (
/**
- Free the allocated memory back to the memory pool
+ Free the allocated memory back to the memory pool.
- @param Pool The memory pool of the host controller
- @param Mem The memory to free
- @param Size The size of the memory to free
+ @param Pool The memory pool of the host controller.
+ @param Mem The memory to free.
+ @param Size The size of the memory to free.
- @return VOID
+ @return None.
**/
VOID