TianoCore EDK2 master
|
#include <Uefi.h>
Go to the source code of this file.
Data Structures | |
struct | _USBHC_MEM_BLOCK |
struct | _USBHC_MEM_POOL |
Macros | |
#define | USBHC_MEM_DEFAULT_PAGES 16 |
#define | USBHC_MEM_UNIT 64 |
#define | USBHC_MEM_UNIT_MASK (USBHC_MEM_UNIT - 1) |
#define | USBHC_MEM_ROUND(Len) (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK)) |
#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 | NEXT_BIT(Byte, Bit) |
Typedefs | |
typedef struct _USBHC_MEM_BLOCK | USBHC_MEM_BLOCK |
typedef struct _USBHC_MEM_POOL | USBHC_MEM_POOL |
Functions | |
EFI_PHYSICAL_ADDRESS | UsbHcGetPciAddrForHostAddr (IN USBHC_MEM_POOL *Pool, IN VOID *Mem, IN UINTN Size, IN BOOLEAN Alignment) |
EFI_PHYSICAL_ADDRESS | UsbHcGetHostAddrForPciAddr (IN USBHC_MEM_POOL *Pool, IN VOID *Mem, IN UINTN Size, IN BOOLEAN Alignment) |
EFI_STATUS | UsbHcAllocateAlignedPages (IN UINTN Pages, IN UINTN Alignment, OUT VOID **HostAddress, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping) |
VOID | UsbHcFreeAlignedPages (IN VOID *HostAddress, IN UINTN Pages, IN VOID *Mapping) |
Private Header file for Usb Host Controller PEIM
Copyright (c) 2014, 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 45 of file UsbHcMem.h.
#define USB_HC_BIT | ( | a | ) | ((UINTN)(1 << (a))) |
Definition at line 37 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 39 of file UsbHcMem.h.
#define USBHC_MEM_DEFAULT_PAGES 16 |
Definition at line 15 of file UsbHcMem.h.
#define USBHC_MEM_ROUND | ( | Len | ) | (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK)) |
Definition at line 35 of file UsbHcMem.h.
#define USBHC_MEM_UNIT 64 |
Definition at line 32 of file UsbHcMem.h.
#define USBHC_MEM_UNIT_MASK (USBHC_MEM_UNIT - 1) |
Definition at line 34 of file UsbHcMem.h.
typedef struct _USBHC_MEM_BLOCK USBHC_MEM_BLOCK |
Definition at line 17 of file UsbHcMem.h.
EFI_STATUS UsbHcAllocateAlignedPages | ( | IN UINTN | Pages, |
IN UINTN | Alignment, | ||
OUT VOID ** | HostAddress, | ||
OUT EFI_PHYSICAL_ADDRESS * | DeviceAddress, | ||
OUT VOID ** | Mapping | ||
) |
Allocates pages at a specified alignment.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
Pages | The number of pages to allocate. |
Alignment | The requested alignment of the allocation. Must be a power of two. |
HostAddress | The system memory address to map to the PCI controller. |
DeviceAddress | The resulting map address for the bus master PCI controller to use to access the hosts HostAddress. |
Mapping | A resulting value to pass to Unmap(). |
EFI_SUCCESS | Success to allocate aligned pages. |
EFI_INVALID_PARAMETER | Pages or Alignment is not valid. |
EFI_OUT_OF_RESOURCES | Do not have enough resources to allocate memory. |
Definition at line 597 of file UsbHcMem.c.
Frees memory that was allocated with UsbHcAllocateAlignedPages().
HostAddress | The system memory address to map to the PCI controller. |
Pages | The number of pages to free. |
Mapping | The mapping value returned from Map(). |
Definition at line 663 of file UsbHcMem.c.
EFI_PHYSICAL_ADDRESS UsbHcGetHostAddrForPciAddr | ( | IN USBHC_MEM_POOL * | Pool, |
IN VOID * | Mem, | ||
IN UINTN | Size, | ||
IN BOOLEAN | Alignment | ||
) |
Calculate the corresponding host address according to the pci address.
Pool | The memory pool of the host controller. |
Mem | The pointer to pci memory. |
Size | The size of the memory region. |
Alignment | Alignment the size to USBHC_MEM_UNIT bytes. |
Definition at line 290 of file UsbHcMem.c.
EFI_PHYSICAL_ADDRESS UsbHcGetPciAddrForHostAddr | ( | IN USBHC_MEM_POOL * | Pool, |
IN VOID * | Mem, | ||
IN UINTN | Size, | ||
IN BOOLEAN | Alignment | ||
) |
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. |
Alignment | Alignment the size to USBHC_MEM_UNIT bytes. |
Definition at line 235 of file UsbHcMem.c.