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