+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
-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
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
- \r
-\r
-Module Name:\r
-\r
- EdkIIGlueDevicePathLib.h\r
- \r
-Abstract: \r
-\r
- Public header file for Device Path Lib\r
-\r
---*/\r
-\r
-#ifndef __EDKII_GLUE_DEVICE_PATH_LIB_H__\r
-#define __EDKII_GLUE_DEVICE_PATH_LIB_H__\r
-\r
-\r
-#define GetDevicePathSize(_DEVICEPATH) GlueGetDevicePathSize(_DEVICEPATH)\r
-#define DuplicateDevicePath(_DEVICEPATH) GlueDuplicateDevicePath(_DEVICEPATH)\r
-#define AppendDevicePath(_FIRSTPATH, _SECONDPATH) GlueAppendDevicePath(_FIRSTPATH, _SECONDPATH)\r
-#define AppendDevicePathNode(_DEVICEPATH, _DEVICEPATHNODE) GlueAppendDevicePathNode(_DEVICEPATH, _DEVICEPATHNODE)\r
-#define AppendDevicePathInstance(_SOURCE, _INSTANCE) GlueAppendDevicePathInstance(_SOURCE,_INSTANCE)\r
-#define GetNextDevicePathInstance(_DEVICEPATH, _SIZE) GlueGetNextDevicePathInstance(_DEVICEPATH, _SIZE)\r
-#define IsDevicePathMultiInstance(_DEVICEPATH) GlueIsDevicePathMultiInstance(_DEVICEPATH)\r
-#define DevicePathFromHandle(_HANDLE) GlueDevicePathFromHandle(_HANDLE)\r
-#define FileDevicePath(_DEVICE, _FILENAME) GlueFileDevicePath(_DEVICE, _FILENAME)\r
-\r
-\r
-/**\r
- Returns the size of a device path in bytes.\r
-\r
- This function returns the size, in bytes, of the device path data structure specified by\r
- DevicePath including the end of device path node. If DevicePath is NULL, then 0 is returned.\r
-\r
- @param DevicePath A pointer to a device path data structure.\r
-\r
- @return The size of a device path in bytes.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-GlueGetDevicePathSize (\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
- );\r
-\r
-/**\r
- Creates a new device path by appending a second device path to a first device path.\r
-\r
- This function allocates space for a new copy of the device path specified by DevicePath. If\r
- DevicePath is NULL, then NULL is returned. If the memory is successfully allocated, then the\r
- contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer\r
- is returned. Otherwise, NULL is returned. \r
- \r
- @param DevicePath A pointer to a device path data structure.\r
-\r
- @return A pointer to the duplicated device path.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-GlueDuplicateDevicePath (\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
- );\r
-\r
-/**\r
- Creates a new device path by appending a second device path to a first device path.\r
-\r
- This function creates a new device path by appending a copy of SecondDevicePath to a copy of\r
- FirstDevicePath in a newly allocated buffer. Only the end-of-device-path device node from\r
- SecondDevicePath is retained. The newly created device path is returned. \r
- If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned. \r
- If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned. \r
- If both FirstDevicePath and SecondDevicePath are NULL, then NULL is returned. \r
- If there is not enough memory for the newly allocated buffer, then NULL is returned.\r
- The memory for the new device path is allocated from EFI boot services memory. It is the\r
- responsibility of the caller to free the memory allocated.\r
-\r
- @param FirstDevicePath A pointer to a device path data structure.\r
- @param SecondDevicePath A pointer to a device path data structure.\r
-\r
- @return A pointer to the new device path.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-GlueAppendDevicePath (\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath, OPTIONAL\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL\r
- );\r
-\r
-/**\r
- Creates a new path by appending the device node to the device path.\r
-\r
- This function creates a new device path by appending a copy of the device node specified by\r
- DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.\r
- The end-of-device-path device node is moved after the end of the appended device node.\r
- If DevicePath is NULL, then NULL is returned.\r
- If DevicePathNode is NULL, then NULL is returned.\r
- If there is not enough memory to allocate space for the new device path, then NULL is returned. \r
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
- free the memory allocated.\r
-\r
- @param DevicePath A pointer to a device path data structure.\r
- @param DevicePathNode A pointer to a single device path node.\r
-\r
- @return A pointer to the new device path.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-GlueAppendDevicePathNode (\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL\r
- );\r
-\r
-/**\r
- Creates a new device path by appending the specified device path instance to the specified device\r
- path.\r
- \r
- This function creates a new device path by appending a copy of the device path instance specified\r
- by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.\r
- The end-of-device-path device node is moved after the end of the appended device path instance\r
- and a new end-of-device-path-instance node is inserted between. \r
- If DevicePath is NULL, then a copy if DevicePathInstance is returned.\r
- If DevicePathInstance is NULL, then NULL is returned.\r
- If there is not enough memory to allocate space for the new device path, then NULL is returned. \r
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
- free the memory allocated.\r
- \r
- @param DevicePath A pointer to a device path data structure.\r
- @param DevicePathInstance A pointer to a device path instance.\r
-\r
- @return A pointer to the new device path.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-GlueAppendDevicePathInstance (\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL\r
- );\r
-\r
-/**\r
- Creates a copy of the current device path instance and returns a pointer to the next device path\r
- instance.\r
-\r
- This function creates a copy of the current device path instance. It also updates DevicePath to\r
- point to the next device path instance in the device path (or NULL if no more) and updates Size\r
- to hold the size of the device path instance copy.\r
- If DevicePath is NULL, then NULL is returned.\r
- If there is not enough memory to allocate space for the new device path, then NULL is returned. \r
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
- free the memory allocated.\r
- If Size is NULL, then ASSERT().\r
- \r
- @param DevicePath On input, this holds the pointer to the current device path\r
- instance. On output, this holds the pointer to the next device\r
- path instance or NULL if there are no more device path\r
- instances in the device path pointer to a device path data\r
- structure.\r
- @param Size On output, this holds the size of the device path instance, in\r
- bytes or zero, if DevicePath is NULL.\r
-\r
- @return A pointer to the current device path instance.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-GlueGetNextDevicePathInstance (\r
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
- OUT UINTN *Size\r
- );\r
-\r
-/**\r
- Creates a copy of the current device path instance and returns a pointer to the next device path\r
- instance.\r
-\r
- This function creates a new device node in a newly allocated buffer of size NodeLength and\r
- initializes the device path node header with NodeType and NodeSubType. The new device path node\r
- is returned.\r
- If NodeLength is smaller than a device path header, then NULL is returned. \r
- If there is not enough memory to allocate space for the new device path, then NULL is returned. \r
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
- free the memory allocated.\r
-\r
- @param NodeType The device node type for the new device node.\r
- @param NodeSubType The device node sub-type for the new device node.\r
- @param NodeLength The length of the new device node.\r
-\r
- @return The new device path.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-CreateDeviceNode (\r
- IN UINT8 NodeType,\r
- IN UINT8 NodeSubType,\r
- IN UINT16 NodeLength\r
- );\r
-\r
-/**\r
- Determines if a device path is single or multi-instance.\r
-\r
- This function returns TRUE if the device path specified by DevicePath is multi-instance.\r
- Otherwise, FALSE is returned. If DevicePath is NULL, then FALSE is returned.\r
-\r
- @param DevicePath A pointer to a device path data structure.\r
-\r
- @retval TRUE DevicePath is multi-instance.\r
- @retval FALSE DevicePath is not multi-instance or DevicePath is NULL.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-GlueIsDevicePathMultiInstance (\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
- );\r
-\r
-/**\r
- Retrieves the device path protocol from a handle.\r
-\r
- This function returns the device path protocol from the handle specified by Handle. If Handle is\r
- NULL or Handle does not contain a device path protocol, then NULL is returned.\r
- \r
- @param Handle The handle from which to retrieve the device path protocol.\r
-\r
- @return The device path protocol from the handle specified by Handle.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-GlueDevicePathFromHandle (\r
- IN EFI_HANDLE Handle\r
- );\r
-\r
-/**\r
- Allocates a device path for a file and appends it to an existing device path.\r
-\r
- If Device is a valid device handle that contains a device path protocol, then a device path for\r
- the file specified by FileName is allocated and appended to the device path associated with the\r
- handle Device. The allocated device path is returned. If Device is NULL or Device is a handle\r
- that does not support the device path protocol, then a device path containing a single device\r
- path node for the file specified by FileName is allocated and returned.\r
- If FileName is NULL, then ASSERT().\r
-\r
- @param Device A pointer to a device handle. This parameter is optional and\r
- may be NULL.\r
- @param FileName A pointer to a Null-terminated Unicode string.\r
-\r
- @return The allocated device path.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-GlueFileDevicePath (\r
- IN EFI_HANDLE Device, OPTIONAL\r
- IN CONST CHAR16 *FileName\r
- );\r
-\r
-#endif\r