blob: 402fc4365bf704b8577e08fb1adc5e51397d30dc [file] [log] [blame]
Ronak Kanabar1ae366f2023-06-07 01:21:56 +05301/** @file
2 Provides a GUID and a data structure that can be used with EFI_FILE_PROTOCOL.GetInfo()
3 or EFI_FILE_PROTOCOL.SetInfo() to get or set information about the system's volume.
4 This GUID is defined in UEFI specification.
5
6Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7SPDX-License-Identifier: BSD-2-Clause-Patent
8
9**/
10
11#ifndef __FILE_SYSTEM_INFO_H__
12#define __FILE_SYSTEM_INFO_H__
13
14#define EFI_FILE_SYSTEM_INFO_ID \
15 { \
16 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
17 }
18
19typedef struct {
20 ///
21 /// The size of the EFI_FILE_SYSTEM_INFO structure, including the Null-terminated VolumeLabel string.
22 ///
23 UINT64 Size;
24 ///
25 /// TRUE if the volume only supports read access.
26 ///
27 BOOLEAN ReadOnly;
28 ///
29 /// The number of bytes managed by the file system.
30 ///
31 UINT64 VolumeSize;
32 ///
33 /// The number of available bytes for use by the file system.
34 ///
35 UINT64 FreeSpace;
36 ///
37 /// The nominal block size by which files are typically grown.
38 ///
39 UINT32 BlockSize;
40 ///
41 /// The Null-terminated string that is the volume's label.
42 ///
43 CHAR16 VolumeLabel[1];
44} EFI_FILE_SYSTEM_INFO;
45
46///
47/// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
48/// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
49/// to be the size of the data structure without the VolumeLable field. The following macro
50/// computes this size correctly no matter how big the VolumeLable array is declared.
51/// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
52///
53#define SIZE_OF_EFI_FILE_SYSTEM_INFO OFFSET_OF (EFI_FILE_SYSTEM_INFO, VolumeLabel)
54
55extern EFI_GUID gEfiFileSystemInfoGuid;
56
57#endif