VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_efi.h@ 62501

Last change on this file since 62501 was 62500, checked in by vboxsync, 9 years ago

(C) 2016

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1/* $Id: fsw_efi.h 62500 2016-07-22 19:06:59Z vboxsync $ */
2/** @file
3 * fsw_efi.h - EFI host environment header.
4 */
5
6/*
7 * Copyright (C) 2010-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27/*-
28 * This code is based on:
29 *
30 * Copyright (c) 2006 Christoph Pfisterer
31 *
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions are
34 * met:
35 *
36 * * Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 *
39 * * Redistributions in binary form must reproduce the above copyright
40 * notice, this list of conditions and the following disclaimer in the
41 * documentation and/or other materials provided with the
42 * distribution.
43 *
44 * * Neither the name of Christoph Pfisterer nor the names of the
45 * contributors may be used to endorse or promote products derived
46 * from this software without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
49 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
50 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
51 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
52 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
53 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
54 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
55 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
56 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
57 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
58 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 */
60
61#ifndef _FSW_EFI_H_
62#define _FSW_EFI_H_
63
64#include "fsw_core.h"
65
66
67/**
68 * EFI Host: Private per-volume structure.
69 */
70
71typedef struct {
72 UINT64 Signature; //!< Used to identify this structure
73
74 EFI_FILE_IO_INTERFACE FileSystem; //!< Published EFI protocol interface structure
75
76 EFI_HANDLE Handle; //!< The device handle the protocol is attached to
77 EFI_DISK_IO *DiskIo; //!< The Disk I/O protocol we use for disk access
78 UINT32 MediaId; //!< The media ID from the Block I/O protocol
79 EFI_STATUS LastIOStatus; //!< Last status from Disk I/O
80
81 struct fsw_volume *vol; //!< FSW volume structure
82
83} FSW_VOLUME_DATA;
84
85/** Signature for the volume structure. */
86#define FSW_VOLUME_DATA_SIGNATURE EFI_SIGNATURE_32 ('f', 's', 'w', 'V')
87/** Access macro for the volume structure. */
88#define FSW_VOLUME_FROM_FILE_SYSTEM(a) CR (a, FSW_VOLUME_DATA, FileSystem, FSW_VOLUME_DATA_SIGNATURE)
89
90/**
91 * EFI Host: Private structure for a EFI_FILE interface.
92 */
93
94typedef struct {
95 UINT64 Signature; //!< Used to identify this structure
96
97 EFI_FILE FileHandle; //!< Published EFI protocol interface structure
98
99 UINTN Type; //!< File type used for dispatching
100 struct fsw_shandle shand; //!< FSW handle for this file
101
102} FSW_FILE_DATA;
103
104/** File type: regular file. */
105#define FSW_EFI_FILE_TYPE_FILE (0)
106/** File type: directory. */
107#define FSW_EFI_FILE_TYPE_DIR (1)
108
109/** Signature for the file handle structure. */
110#define FSW_FILE_DATA_SIGNATURE EFI_SIGNATURE_32 ('f', 's', 'w', 'F')
111/** Access macro for the file handle structure. */
112#define FSW_FILE_FROM_FILE_HANDLE(a) CR (a, FSW_FILE_DATA, FileHandle, FSW_FILE_DATA_SIGNATURE)
113
114
115//
116// Library functions
117//
118
119VOID fsw_efi_decode_time(OUT EFI_TIME *EfiTime, IN UINT32 UnixTime);
120
121UINTN fsw_efi_strsize(struct fsw_string *s);
122VOID fsw_efi_strcpy(CHAR16 *Dest, struct fsw_string *src);
123
124
125#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette