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