]> code.delx.au - refind/blobdiff - filesystems/edk2/DriverBinding.h
New files related to building drivers using GNU-EFI
[refind] / filesystems / edk2 / DriverBinding.h
diff --git a/filesystems/edk2/DriverBinding.h b/filesystems/edk2/DriverBinding.h
new file mode 100644 (file)
index 0000000..fdb16c5
--- /dev/null
@@ -0,0 +1,181 @@
+/*++\r
+\r
+Copyright (c) 2004, 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
+Module Name:\r
+\r
+    DriverBinding.h\r
+    \r
+Abstract:\r
+\r
+    EFI ControllerHandle Driver Protocol\r
+\r
+Revision History\r
+\r
+--*/\r
+\r
+#ifndef _EFI_DRIVER_BINDING_H_\r
+#define _EFI_DRIVER_BINDING_H_\r
+\r
+#include <efidevp.h>\r
+\r
+//\r
+// Global ID for the ControllerHandle Driver Protocol\r
+//\r
+#define EFI_DRIVER_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71} \\r
+  }\r
+\r
+#define EFI_FORWARD_DECLARATION(x) typedef struct _##x x\r
+\r
+EFI_FORWARD_DECLARATION (EFI_DRIVER_BINDING_PROTOCOL);\r
+\r
+///\r
+/// Device Path protocol.\r
+///\r
+#define EFI_DEVICE_PATH_PROTOCOL_GUID \\r
+  { \\r
+    0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+// Begin included from DevicePath.h....\r
+\r
+///\r
+/// Device Path guid definition for backward-compatible with EFI1.1.\r
+///\r
+//#define DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH_PROTOCOL_GUID\r
+\r
+#pragma pack(1)\r
+\r
+/**\r
+  This protocol can be used on any device handle to obtain generic path/location\r
+  information concerning the physical device or logical device. If the handle does\r
+  not logically map to a physical device, the handle may not necessarily support\r
+  the device path protocol. The device path describes the location of the device\r
+  the handle is for. The size of the Device Path can be determined from the structures\r
+  that make up the Device Path.\r
+**/\r
+typedef struct {\r
+  UINT8 Type;       ///< 0x01 Hardware Device Path.\r
+                    ///< 0x02 ACPI Device Path.\r
+                    ///< 0x03 Messaging Device Path.\r
+                    ///< 0x04 Media Device Path.\r
+                    ///< 0x05 BIOS Boot Specification Device Path.\r
+                    ///< 0x7F End of Hardware Device Path.\r
+\r
+  UINT8 SubType;    ///< Varies by Type\r
+                    ///< 0xFF End Entire Device Path, or\r
+                    ///< 0x01 End This Instance of a Device Path and start a new\r
+                    ///< Device Path.\r
+\r
+  UINT8 Length[2];  ///< Specific Device Path data. Type and Sub-Type define\r
+                    ///< type of data. Size of data is included in Length.\r
+\r
+} EFI_DEVICE_PATH_PROTOCOL;\r
+\r
+#pragma pack()\r
+\r
+// End included from DevicePath.h\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            * This,\r
+  IN EFI_HANDLE                             ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL               * RemainingDevicePath OPTIONAL\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Test to see if this driver supports ControllerHandle. \r
+\r
+  Arguments:\r
+    This                - Protocol instance pointer.\r
+    ControllerHandle    - Handle of device to test\r
+    RemainingDevicePath - Optional parameter use to pick a specific child \r
+                          device to start.\r
+\r
+  Returns:\r
+    EFI_SUCCESS         - This driver supports this device\r
+    EFI_ALREADY_STARTED - This driver is already running on this device\r
+    other               - This driver does not support this device\r
+\r
+--*/\r
+;\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_START) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            * This,\r
+  IN EFI_HANDLE                             ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL               * RemainingDevicePath OPTIONAL\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Start this driver on ControllerHandle.\r
+\r
+  Arguments:\r
+    This                - Protocol instance pointer.\r
+    ControllerHandle    - Handle of device to bind driver to\r
+    RemainingDevicePath - Optional parameter use to pick a specific child \r
+                          device to start.\r
+\r
+  Returns:\r
+    EFI_SUCCESS         - This driver is added to ControllerHandle\r
+    EFI_ALREADY_STARTED - This driver is already running on ControllerHandle\r
+    other               - This driver does not support this device\r
+\r
+--*/\r
+;\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_STOP) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            * This,\r
+  IN  EFI_HANDLE                            ControllerHandle,\r
+  IN  UINTN                                 NumberOfChildren,\r
+  IN  EFI_HANDLE                            * ChildHandleBuffer\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Stop this driver on ControllerHandle.\r
+\r
+  Arguments:\r
+    This              - Protocol instance pointer.\r
+    ControllerHandle  - Handle of device to stop driver on \r
+    NumberOfChildren  - Number of Handles in ChildHandleBuffer. If number of \r
+                        children is zero stop the entire bus driver.\r
+    ChildHandleBuffer - List of Child Handles to Stop.\r
+\r
+  Returns:\r
+    EFI_SUCCESS         - This driver is removed ControllerHandle\r
+    other               - This driver was not removed from this device\r
+\r
+--*/\r
+;\r
+\r
+//\r
+// Interface structure for the ControllerHandle Driver Protocol\r
+//\r
+struct _EFI_DRIVER_BINDING_PROTOCOL {\r
+  EFI_DRIVER_BINDING_SUPPORTED  Supported;\r
+  EFI_DRIVER_BINDING_START      Start;\r
+  EFI_DRIVER_BINDING_STOP       Stop;\r
+  UINT32                        Version;\r
+  EFI_HANDLE                    ImageHandle;\r
+  EFI_HANDLE                    DriverBindingHandle;\r
+};\r
+\r
+extern EFI_GUID gEfiDriverBindingProtocolGuid;\r
+\r
+#endif\r