3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 Portions copyright (c) 2011, Apple Inc. All rights reserved.
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __EMU_BUS_DRIVER_H__
16 #define __EMU_BUS_DRIVER_H__
20 #include <Protocol/DevicePath.h>
21 #include <Protocol/EmuThunk.h>
22 #include <Protocol/EmuIoThunk.h>
24 #include <Library/DebugLib.h>
25 #include <Library/BaseLib.h>
26 #include <Library/UefiDriverEntryPoint.h>
27 #include <Library/UefiLib.h>
28 #include <Library/PcdLib.h>
29 #include <Library/BaseMemoryLib.h>
30 #include <Library/MemoryAllocationLib.h>
31 #include <Library/UefiBootServicesTableLib.h>
32 #include <Library/DevicePathLib.h>
34 extern EFI_DRIVER_BINDING_PROTOCOL gEmuBusDriverBinding
;
35 extern EFI_COMPONENT_NAME_PROTOCOL gEmuBusDriverComponentName
;
36 extern EFI_COMPONENT_NAME2_PROTOCOL gEmuBusDriverComponentName2
;
40 // Unix Bus Controller Structure
42 #define EMU_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('L', 'X', 'B', 'D')
46 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
50 // Unix Child Device Controller Structure
52 #define EMU_IO_DEVICE_SIGNATURE SIGNATURE_32 ('L', 'X', 'V', 'D')
57 EMU_IO_THUNK_PROTOCOL EmuIoThunk
;
58 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
61 // Private data about the parent
63 EFI_HANDLE ControllerHandle
;
64 EFI_DEVICE_PATH_PROTOCOL
*ParentDevicePath
;
66 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
70 #define EMU_IO_DEVICE_FROM_THIS(a) \
71 CR(a, EMU_IO_DEVICE, EmuIoThunk, EMU_IO_DEVICE_SIGNATURE)
76 // Driver Binding Protocol function prototypes
80 EmuBusDriverBindingSupported (
81 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
83 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
89 EmuBusDriverBindingStart (
90 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
91 IN EFI_HANDLE ParentHandle
,
92 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
98 EmuBusDriverBindingStop (
99 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
100 IN EFI_HANDLE Handle
,
101 IN UINTN NumberOfChildren
,
102 IN EFI_HANDLE
*ChildHandleBuffer
106 // Unix Bus Driver private worker functions
108 EFI_DEVICE_PATH_PROTOCOL
*
109 EmuBusCreateDevicePath (
110 IN EFI_DEVICE_PATH_PROTOCOL
*RootDevicePath
,
112 IN UINT16 InstanceNumber