]> git.proxmox.com Git - mirror_edk2.git/blob - FatPkg/EnhancedFatDxe/Debug.c
FatPkg/EnhancedFatDxe: Add comments for functions
[mirror_edk2.git] / FatPkg / EnhancedFatDxe / Debug.c
1 /** @file
2 Debug functions for fat driver
3
4 Copyright (c) 2005, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available
6 under the terms and conditions of the BSD License which accompanies this
7 distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "Fat.h"
16
17 /**
18
19 Dump all the FAT Entry of the FAT table in the volume.
20
21 @param Volume - The volume whose FAT info will be dumped
22
23 **/
24 VOID
25 FatDumpFatTable (
26 IN FAT_VOLUME *Volume
27 )
28 {
29 UINTN EntryValue;
30 UINTN MaxIndex;
31 UINTN Index;
32 CHAR16 *Pointer;
33
34 MaxIndex = Volume->MaxCluster + 2;
35
36 Print (L"Dump of Fat Table, MaxCluster %x\n", MaxIndex);
37 for (Index = 0; Index < MaxIndex; Index++) {
38 EntryValue = FatGetFatEntry (Volume, Index);
39 if (EntryValue != FAT_CLUSTER_FREE) {
40 Pointer = NULL;
41 switch (EntryValue) {
42 case FAT_CLUSTER_RESERVED:
43 Pointer = L"RESREVED";
44 break;
45
46 case FAT_CLUSTER_BAD:
47 Pointer = L"BAD";
48 break;
49 }
50
51 if (FAT_END_OF_FAT_CHAIN (EntryValue)) {
52 Pointer = L"LAST";
53 }
54
55 if (Pointer != NULL) {
56 Print (L"Entry %x = %s\n", Index, Pointer);
57 } else {
58 Print (L"Entry %x = %x\n", Index, EntryValue);
59 }
60 }
61 }
62 }