TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | _USBHC_MEM_BLOCK |
struct | _USBHC_MEM_POOL |
Macros | |
#define | USB_HC_BIT(a) ((UINTN)(1 << (a))) |
#define | USB_HC_BIT_IS_SET(Data, Bit) ((BOOLEAN)(((Data) & USB_HC_BIT(Bit)) == USB_HC_BIT(Bit))) |
#define | USB_HC_HIGH_32BIT(Addr64) ((UINT32)(RShiftU64((UINTN)(Addr64), 32) & 0XFFFFFFFF)) |
#define | USBHC_MEM_UNIT 64 |
#define | USBHC_MEM_UNIT_MASK (USBHC_MEM_UNIT - 1) |
#define | USBHC_MEM_DEFAULT_PAGES 16 |
#define | USBHC_MEM_ROUND(Len) (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK)) |
#define | NEXT_BIT(Byte, Bit) |
Typedefs | |
typedef struct _USBHC_MEM_BLOCK | USBHC_MEM_BLOCK |
typedef struct _USBHC_MEM_POOL | USBHC_MEM_POOL |
Functions | |
USBHC_MEM_POOL * | UsbHcInitMemPool (IN EFI_PCI_IO_PROTOCOL *PciIo, IN BOOLEAN Check4G, IN UINT32 Which4G) |
EFI_STATUS | UsbHcFreeMemPool (IN USBHC_MEM_POOL *Pool) |
VOID * | UsbHcAllocateMem (IN USBHC_MEM_POOL *Pool, IN UINTN Size) |
VOID | UsbHcFreeMem (IN USBHC_MEM_POOL *Pool, IN VOID *Mem, IN UINTN Size) |
EFI_PHYSICAL_ADDRESS | UsbHcGetPciAddressForHostMem (IN USBHC_MEM_POOL *Pool, IN VOID *Mem, IN UINTN Size) |
This file contains the definination for host controller memory management routines
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbHcMem.h.
#define NEXT_BIT | ( | Byte, | |
Bit | |||
) |
Definition at line 57 of file UsbHcMem.h.
#define USB_HC_BIT | ( | a | ) | ((UINTN)(1 << (a))) |
Definition at line 13 of file UsbHcMem.h.
#define USB_HC_BIT_IS_SET | ( | Data, | |
Bit | |||
) | ((BOOLEAN)(((Data) & USB_HC_BIT(Bit)) == USB_HC_BIT(Bit))) |
Definition at line 15 of file UsbHcMem.h.
Definition at line 18 of file UsbHcMem.h.
#define USBHC_MEM_DEFAULT_PAGES 16 |
Definition at line 50 of file UsbHcMem.h.
#define USBHC_MEM_ROUND | ( | Len | ) | (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK)) |
Definition at line 52 of file UsbHcMem.h.
#define USBHC_MEM_UNIT 64 |
Definition at line 47 of file UsbHcMem.h.
#define USBHC_MEM_UNIT_MASK (USBHC_MEM_UNIT - 1) |
Definition at line 49 of file UsbHcMem.h.
typedef struct _USBHC_MEM_BLOCK USBHC_MEM_BLOCK |
Definition at line 21 of file UsbHcMem.h.
VOID * UsbHcAllocateMem | ( | IN USBHC_MEM_POOL * | Pool, |
IN UINTN | Size | ||
) |
Allocate some memory from the host controller's memory pool which can be used to communicate with host controller.
Pool | The host controller's memory pool. |
Size | Size of the memory to allocate. |
Definition at line 419 of file UsbHcMem.c.
VOID UsbHcFreeMem | ( | IN USBHC_MEM_POOL * | Pool, |
IN VOID * | Mem, | ||
IN UINTN | Size | ||
) |
Free the allocated memory back to the memory pool.
Pool | The memory pool of the host controller. |
Mem | The memory to free. |
Size | The size of the memory to free. |
Free the allocated memory back to the memory pool.
Pool | The memory pool of the host controller. |
Mem | The memory to free. |
Size | The size of the memory to free. |
Definition at line 493 of file UsbHcMem.c.
EFI_STATUS UsbHcFreeMemPool | ( | IN USBHC_MEM_POOL * | Pool | ) |
Release the memory management pool.
Pool | The USB memory pool to free. |
Release the memory management pool.
Pool | The USB memory pool to free. |
EFI_SUCCESS | The memory pool is freed. |
EFI_DEVICE_ERROR | Failed to free the memory pool. |
Release the memory management pool.
Pool | The USB memory pool to free. |
Definition at line 385 of file UsbHcMem.c.
EFI_PHYSICAL_ADDRESS UsbHcGetPciAddressForHostMem | ( | IN USBHC_MEM_POOL * | Pool, |
IN VOID * | Mem, | ||
IN UINTN | Size | ||
) |
Calculate the corresponding pci bus address according to the Mem parameter.
Pool | The memory pool of the host controller. |
Mem | The pointer to host memory. |
Size | The size of the memory region. |
Definition at line 223 of file UsbHcMem.c.
USBHC_MEM_POOL * UsbHcInitMemPool | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN BOOLEAN | Check4G, | ||
IN UINT32 | Which4G | ||
) |
Initialize the memory management pool for the host controller.
PciIo | The PciIo that can be used to access the host controller. |
Check4G | Whether the host controller requires allocated memory from one 4G address space. |
Which4G | The 4G memory area each memory allocated should be from. |
EFI_SUCCESS | The memory pool is initialized. |
EFI_OUT_OF_RESOURCE | Fail to init the memory pool. |
Initialize the memory management pool for the host controller.
PciIo | The PciIo that can be used to access the host controller. |
Check4G | Whether the host controller requires allocated memory from one 4G address space. |
Which4G | The 4G memory area each memory allocated should be from. |
Definition at line 348 of file UsbHcMem.c.