blob: 06369ca3e82d3eb6c104f897eec5ee33d2a6b848 [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/*++ @file
2 Produce Simple File System abstractions for a directory on your PC using Unix APIs.
3 The configuration of what devices to mount or emulate comes from
4 environment variables.
5
6Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
7Portions copyright (c) 2011, Apple Inc. All rights reserved.
8This program and the accompanying materials
9are licensed and made available under the terms and conditions of the BSD License
10which accompanies this distribution. The full text of the license may be found at
11http://opensource.org/licenses/bsd-license.php
12
13THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16
17**/
18
19#ifndef _EMU_SIMPLE_FILE_SYSTEM_H_
20#define _EMU_SIMPLE_FILE_SYSTEM_H_
21
22#include "PiDxe.h"
23
24#include <Guid/FileSystemInfo.h>
25#include <Guid/FileInfo.h>
26#include <Guid/FileSystemVolumeLabelInfo.h>
27
28#include <Protocol/EmuIoThunk.h>
29#include <Protocol/SimpleFileSystem.h>
30
31#include <Library/DebugLib.h>
32#include <Library/BaseLib.h>
33#include <Library/UefiDriverEntryPoint.h>
34#include <Library/UefiLib.h>
35#include <Library/BaseMemoryLib.h>
36#include <Library/MemoryAllocationLib.h>
37#include <Library/UefiBootServicesTableLib.h>
38
39
40extern EFI_DRIVER_BINDING_PROTOCOL gEmuSimpleFileSystemDriverBinding;
41extern EFI_COMPONENT_NAME_PROTOCOL gEmuSimpleFileSystemComponentName;
42extern EFI_COMPONENT_NAME2_PROTOCOL gEmuSimpleFileSystemComponentName2;
43
44#define EMU_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE SIGNATURE_32 ('E', 'M', 'f', 's')
45
46typedef struct {
47 UINTN Signature;
48 EMU_IO_THUNK_PROTOCOL *IoThunk;
49 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFileSystem;
50 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Io;
51 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
52} EMU_SIMPLE_FILE_SYSTEM_PRIVATE;
53
54#define EMU_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS(a) \
55 CR (a, \
56 EMU_SIMPLE_FILE_SYSTEM_PRIVATE, \
57 SimpleFileSystem, \
58 EMU_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE \
59 )
60
61#define EMU_EFI_FILE_PRIVATE_SIGNATURE SIGNATURE_32 ('e', 'm', 'f', 's')
62
63typedef struct {
64 UINTN Signature;
65 EMU_IO_THUNK_PROTOCOL *IoThunk;
66 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFileSystem;
67 EFI_FILE_PROTOCOL EfiFile;
68 EFI_FILE_PROTOCOL *Io;
69} EMU_EFI_FILE_PRIVATE;
70
71#define EMU_EFI_FILE_PRIVATE_DATA_FROM_THIS(a) \
72 CR (a, \
73 EMU_EFI_FILE_PRIVATE, \
74 EfiFile, \
75 EMU_EFI_FILE_PRIVATE_SIGNATURE \
76 )
77
78
79
80#endif