-//\r
-// Device Path functions\r
-//\r
-\r
-\r
-/**\r
- Calculate the size of a whole device path.\r
-\r
- @param DevicePath The pointer to the device path data.\r
-\r
- @return Size of device path data structure..\r
-\r
-**/\r
-UINTN\r
-CoreDevicePathSize (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
- );\r
-\r
-\r
-/**\r
- Return TRUE is this is a multi instance device path.\r
-\r
- @param DevicePath A pointer to a device path data structure.\r
-\r
- @retval TRUE If DevicePath is multi instance. FALSE - If\r
- DevicePath is not multi instance.\r
-\r
-**/\r
-BOOLEAN\r
-CoreIsDevicePathMultiInstance (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
- );\r
-\r
-\r
-\r
-/**\r
- Duplicate a new device path data structure from the old one.\r
-\r
- @param DevicePath A pointer to a device path data structure.\r
-\r
- @return A pointer to the new allocated device path data.\r
- @return Caller must free the memory used by DevicePath if it is no longer needed.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-CoreDuplicateDevicePath (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
- );\r
-\r
-\r
-/**\r
- Function is used to append a Src1 and Src2 together.\r
-\r
- @param Src1 A pointer to a device path data structure.\r
- @param Src2 A pointer to a device path data structure.\r
-\r
- @return A pointer to the new device path is returned.\r
- @return NULL is returned if space for the new device path could not be allocated from pool.\r
- @return It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-CoreAppendDevicePath (\r
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,\r
- IN EFI_DEVICE_PATH_PROTOCOL *Src2\r
- );\r
-\r
-\r
-/**\r
- Allocate pool of type EfiBootServicesData, the size is specified with AllocationSize.\r
-\r
- @param AllocationSize Size to allocate.\r
-\r
- @return Pointer of the allocated pool.\r
-\r
-**/\r
-VOID *\r
-CoreAllocateBootServicesPool (\r
- IN UINTN AllocationSize\r
- );\r
-\r
-\r
-/**\r
- Allocate pool of type EfiBootServicesData and zero it, the size is specified with AllocationSize.\r
-\r
- @param AllocationSize Size to allocate.\r
-\r
- @return Pointer of the allocated pool.\r
-\r
-**/\r
-VOID *\r
-CoreAllocateZeroBootServicesPool (\r
- IN UINTN AllocationSize\r
- );\r
-\r
-\r
-/**\r
- Find a config table by name in system table's ConfigurationTable.\r
-\r
- @param Guid The table name to look for\r
- @param Table Pointer of the config table\r
-\r
- @retval EFI_NOT_FOUND Could not find the table in system table's\r
- ConfigurationTable.\r
- @retval EFI_SUCCESS Table successfully found.\r
-\r
-**/\r
-EFI_STATUS\r
-CoreGetConfigTable (\r
- IN EFI_GUID *Guid,\r
- OUT VOID **Table\r
- );\r
-\r
-\r
-/**\r
- Allocate pool of specified size with EfiRuntimeServicesData type, and copy specified buffer to this pool.\r
-\r
- @param AllocationSize Size to allocate.\r
- @param Buffer Specified buffer that will be copy to the allocated\r
- pool\r
-\r
- @return Pointer of the allocated pool.\r
-\r
-**/\r
-VOID *\r
-CoreAllocateRuntimeCopyPool (\r
- IN UINTN AllocationSize,\r
- IN VOID *Buffer\r
- );\r
-\r
-\r
-/**\r
- Allocate pool of type EfiRuntimeServicesData, the size is specified with AllocationSize.\r
-\r
- @param AllocationSize Size to allocate.\r
-\r
- @return Pointer of the allocated pool.\r
-\r
-**/\r
-VOID *\r
-CoreAllocateRuntimePool (\r
- IN UINTN AllocationSize\r
- );\r
-\r
-\r
-/**\r
- Allocate pool of specified size with EfiBootServicesData type, and copy specified buffer to this pool.\r
-\r
- @param AllocationSize Size to allocate.\r
- @param Buffer Specified buffer that will be copy to the allocated\r
- pool\r
-\r
- @return Pointer of the allocated pool.\r
-\r
-**/\r
-VOID *\r
-CoreAllocateCopyPool (\r
- IN UINTN AllocationSize,\r
- IN VOID *Buffer\r
- );\r
-\r