1 /*++ 2 3 Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR> 4 This program and the accompanying materials 5 are licensed and made available under the terms and conditions of the BSD License 6 which accompanies this distribution. The full text of the license may be found at 7 http://opensource.org/licenses/bsd-license.php 8 9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 12 Module Name: 13 14 EmuBlockIo.h 15 16 Abstract: 17 18 Produce block IO abstractions for real devices on your PC using Posix APIs. 19 The configuration of what devices to mount or emulate comes from UNIX 20 environment variables. The variables must be visible to the Microsoft* 21 Developer Studio for them to work. 22 23 * Other names and brands may be claimed as the property of others. 24 25 **/ 26 27 #ifndef _EMU_BLOCK_IO_H_ 28 #define _EMU_BLOCK_IO_H_ 29 30 #include <PiDxe.h> 31 #include <Protocol/EmuIoThunk.h> 32 #include <Protocol/BlockIo.h> 33 #include <Protocol/BlockIo2.h> 34 #include <Protocol/EmuBlockIo.h> 35 36 #include <Guid/EmuPhysicalDisk.h> 37 #include <Guid/EmuVirtualDisk.h> 38 39 #include <Library/DebugLib.h> 40 #include <Library/BaseLib.h> 41 #include <Library/UefiDriverEntryPoint.h> 42 #include <Library/UefiLib.h> 43 #include <Library/BaseMemoryLib.h> 44 #include <Library/MemoryAllocationLib.h> 45 #include <Library/UefiBootServicesTableLib.h> 46 47 48 // 49 // Language supported for driverconfiguration protocol 50 // 51 52 #define EMU_BLOCK_IO_PRIVATE_SIGNATURE SIGNATURE_32 ('E', 'M', 'b', 'k') 53 typedef struct { 54 UINTN Signature; 55 EMU_IO_THUNK_PROTOCOL *IoThunk; 56 EMU_BLOCK_IO_PROTOCOL *Io; 57 58 EFI_HANDLE EfiHandle; 59 EFI_BLOCK_IO_PROTOCOL BlockIo; 60 EFI_BLOCK_IO2_PROTOCOL BlockIo2; 61 EFI_BLOCK_IO_MEDIA Media; 62 63 EFI_UNICODE_STRING_TABLE *ControllerNameTable; 64 65 } EMU_BLOCK_IO_PRIVATE; 66 67 #define EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS(a) \ 68 CR(a, EMU_BLOCK_IO_PRIVATE, BlockIo, EMU_BLOCK_IO_PRIVATE_SIGNATURE) 69 70 #define EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS(a) \ 71 CR(a, EMU_BLOCK_IO_PRIVATE, BlockIo2, EMU_BLOCK_IO_PRIVATE_SIGNATURE) 72 73 74 // 75 // Block I/O Global Variables 76 // 77 extern EFI_DRIVER_BINDING_PROTOCOL gEmuBlockIoDriverBinding; 78 extern EFI_COMPONENT_NAME_PROTOCOL gEmuBlockIoComponentName; 79 extern EFI_COMPONENT_NAME2_PROTOCOL gEmuBlockIoComponentName2; 80 extern EFI_DRIVER_CONFIGURATION_PROTOCOL gEmuBlockIoDriverConfiguration; 81 extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL gEmuBlockIoDriverDiagnostics; 82 extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL gEmuBlockIoDriverDiagnostics2; 83 84 #endif 85