xref: /freebsd/sys/contrib/edk2/Include/Guid/FileInfo.h (revision 4f06a8e49099e597c42dac4588196eb934e6fcd2)
1*4f06a8e4SWarner Losh /** @file
2*4f06a8e4SWarner Losh   Provides a GUID and a data structure that can be used with EFI_FILE_PROTOCOL.SetInfo()
3*4f06a8e4SWarner Losh   and EFI_FILE_PROTOCOL.GetInfo() to set or get generic file information.
4*4f06a8e4SWarner Losh   This GUID is defined in UEFI specification.
5*4f06a8e4SWarner Losh 
6*4f06a8e4SWarner Losh Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7*4f06a8e4SWarner Losh SPDX-License-Identifier: BSD-2-Clause-Patent
8*4f06a8e4SWarner Losh 
9*4f06a8e4SWarner Losh **/
10*4f06a8e4SWarner Losh 
11*4f06a8e4SWarner Losh #ifndef __FILE_INFO_H__
12*4f06a8e4SWarner Losh #define __FILE_INFO_H__
13*4f06a8e4SWarner Losh 
14*4f06a8e4SWarner Losh #define EFI_FILE_INFO_ID \
15*4f06a8e4SWarner Losh   { \
16*4f06a8e4SWarner Losh     0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
17*4f06a8e4SWarner Losh   }
18*4f06a8e4SWarner Losh 
19*4f06a8e4SWarner Losh typedef struct {
20*4f06a8e4SWarner Losh   ///
21*4f06a8e4SWarner Losh   /// The size of the EFI_FILE_INFO structure, including the Null-terminated FileName string.
22*4f06a8e4SWarner Losh   ///
23*4f06a8e4SWarner Losh   UINT64      Size;
24*4f06a8e4SWarner Losh   ///
25*4f06a8e4SWarner Losh   /// The size of the file in bytes.
26*4f06a8e4SWarner Losh   ///
27*4f06a8e4SWarner Losh   UINT64      FileSize;
28*4f06a8e4SWarner Losh   ///
29*4f06a8e4SWarner Losh   /// PhysicalSize The amount of physical space the file consumes on the file system volume.
30*4f06a8e4SWarner Losh   ///
31*4f06a8e4SWarner Losh   UINT64      PhysicalSize;
32*4f06a8e4SWarner Losh   ///
33*4f06a8e4SWarner Losh   /// The time the file was created.
34*4f06a8e4SWarner Losh   ///
35*4f06a8e4SWarner Losh   EFI_TIME    CreateTime;
36*4f06a8e4SWarner Losh   ///
37*4f06a8e4SWarner Losh   /// The time when the file was last accessed.
38*4f06a8e4SWarner Losh   ///
39*4f06a8e4SWarner Losh   EFI_TIME    LastAccessTime;
40*4f06a8e4SWarner Losh   ///
41*4f06a8e4SWarner Losh   /// The time when the file's contents were last modified.
42*4f06a8e4SWarner Losh   ///
43*4f06a8e4SWarner Losh   EFI_TIME    ModificationTime;
44*4f06a8e4SWarner Losh   ///
45*4f06a8e4SWarner Losh   /// The attribute bits for the file.
46*4f06a8e4SWarner Losh   ///
47*4f06a8e4SWarner Losh   UINT64      Attribute;
48*4f06a8e4SWarner Losh   ///
49*4f06a8e4SWarner Losh   /// The Null-terminated name of the file.
50*4f06a8e4SWarner Losh   /// For a root directory, the name is an empty string.
51*4f06a8e4SWarner Losh   ///
52*4f06a8e4SWarner Losh   CHAR16      FileName[1];
53*4f06a8e4SWarner Losh } EFI_FILE_INFO;
54*4f06a8e4SWarner Losh 
55*4f06a8e4SWarner Losh ///
56*4f06a8e4SWarner Losh /// The FileName field of the EFI_FILE_INFO data structure is variable length.
57*4f06a8e4SWarner Losh /// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
58*4f06a8e4SWarner Losh /// be the size of the data structure without the FileName field.  The following macro
59*4f06a8e4SWarner Losh /// computes this size correctly no matter how big the FileName array is declared.
60*4f06a8e4SWarner Losh /// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
61*4f06a8e4SWarner Losh ///
62*4f06a8e4SWarner Losh #define SIZE_OF_EFI_FILE_INFO  OFFSET_OF (EFI_FILE_INFO, FileName)
63*4f06a8e4SWarner Losh 
64*4f06a8e4SWarner Losh extern EFI_GUID  gEfiFileInfoGuid;
65*4f06a8e4SWarner Losh 
66*4f06a8e4SWarner Losh #endif
67