X-Git-Url: https://code.delx.au/refind/blobdiff_plain/8b7e5d7b0d0ec821647a41f712f7a67c0e1ddb8b..7e41f7799b358fdd955115c904e5862cb1efc44d:/refind/driver_support.h diff --git a/refind/driver_support.h b/refind/driver_support.h new file mode 100644 index 0000000..5e09945 --- /dev/null +++ b/refind/driver_support.h @@ -0,0 +1,53 @@ +/* + * File to implement LibScanHandleDatabase(), which is used by rEFInd's + * driver-loading code (inherited from rEFIt), but which has not been + * implemented in GNU-EFI and seems to have been dropped from current + * versions of the Tianocore library. This function was taken from a git + * site with EFI code. The original file bore the following copyright + * notice: + * + * Copyright (c) 2006 - 2011, 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 that accompanies this distribution. + * The full text of the license may be found at + * 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. + * + */ + +#include +#include + +#ifndef _MY_SCAN_HANDLE_DATABASE +#define _MY_SCAN_HANDLE_DATABASE + +// Below is from http://git.etherboot.org/?p=mirror/efi/shell/.git;a=commitdiff;h=b1b0c63423cac54dc964c2930e04aebb46a946ec; +// Seems to have been replaced by ParseHandleDatabaseByRelationshipWithType(), but the latter isn't working for me.... +EFI_STATUS +LibScanHandleDatabase ( + EFI_HANDLE DriverBindingHandle, OPTIONAL + UINT32 *DriverBindingHandleIndex, OPTIONAL + EFI_HANDLE ControllerHandle, OPTIONAL + UINT32 *ControllerHandleIndex, OPTIONAL + UINTN *HandleCount, + EFI_HANDLE **HandleBuffer, + UINT32 **HandleType + ); + + +#define EFI_HANDLE_TYPE_UNKNOWN 0x000 +#define EFI_HANDLE_TYPE_IMAGE_HANDLE 0x001 +#define EFI_HANDLE_TYPE_DRIVER_BINDING_HANDLE 0x002 +#define EFI_HANDLE_TYPE_DEVICE_DRIVER 0x004 +#define EFI_HANDLE_TYPE_BUS_DRIVER 0x008 +#define EFI_HANDLE_TYPE_DRIVER_CONFIGURATION_HANDLE 0x010 +#define EFI_HANDLE_TYPE_DRIVER_DIAGNOSTICS_HANDLE 0x020 +#define EFI_HANDLE_TYPE_COMPONENT_NAME_HANDLE 0x040 +#define EFI_HANDLE_TYPE_DEVICE_HANDLE 0x080 +#define EFI_HANDLE_TYPE_PARENT_HANDLE 0x100 +#define EFI_HANDLE_TYPE_CONTROLLER_HANDLE 0x200 +#define EFI_HANDLE_TYPE_CHILD_HANDLE 0x400 + +#endif