summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Disk
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-23 16:20:43 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-23 16:20:43 +0000
commit48557c6550adecf39e1e8e140b1736275d070dfb (patch)
tree115213a1ad58d23aac000e3fa0a4c10469770b6e /MdeModulePkg/Universal/Disk
parenta387653db209935677f95ef01608a533bc51633f (diff)
downloadedk2-48557c6550adecf39e1e8e140b1736275d070dfb.zip
edk2-48557c6550adecf39e1e8e140b1736275d070dfb.tar.gz
edk2-48557c6550adecf39e1e8e140b1736275d070dfb.tar.bz2
Code scrub DxeIpl, Runtime, DevicePath, FvbServicesLib, DiskIo, Partition, English, EBC.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7105 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Disk')
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c1
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h4
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf11
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c4
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c4
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h2
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf24
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf9
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c12
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h19
10 files changed, 54 insertions, 36 deletions
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
index ec1d68f..b0d92c7 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
@@ -231,7 +231,6 @@ DiskIoDriverBindingStop (
&Private->DiskIo
);
if (!EFI_ERROR (Status)) {
-
Status = gBS->CloseProtocol (
ControllerHandle,
&gEfiBlockIoProtocolGuid,
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h
index 4bc6d28..7d4533a 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h
@@ -29,9 +29,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiBootServicesTableLib.h>
-#define DISK_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('d', 's', 'k', 'I')
+#define DATA_BUFFER_BLOCK_NUM 64
-#define DATA_BUFFER_BLOCK_NUM (64)
+#define DISK_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('d', 's', 'k', 'I')
typedef struct {
UINTN Signature;
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
index c27650e..757b403 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
@@ -1,7 +1,12 @@
#/** @file
-#
-# This module lays DiskIo protocol on every blockIo protocol
-# to provide byte-oriented access to block media.
+# Module that lays Disk I/O protocol on every Block I/O protocol.
+#
+# This module produces Disk I/O protocol to abstract the block accesses
+# of the Block I/O protocol to a more general offset-length protocol
+# to provide byte-oriented access to block media. It adds this protocol
+# to any Block I/O interface that appears in the system that does not
+# already have a Disk I/O protocol. File systems and other disk access
+# code utilize the Disk I/O protocol.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
index 21d1163..5d544e8 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
@@ -6,7 +6,7 @@
code that is not run on an EFI system. The legacy code reads the
first sector of the active partition into memory and
- BPB - Boot(?) Parameter Block is in the first sector of a FAT file system.
+ BPB - BIOS Parameter Block is in the first sector of a FAT file system.
The BPB contains information about the FAT file system. The BPB is
always on the first sector of a media. The first sector also contains
the legacy boot strap code.
@@ -212,7 +212,7 @@ PartitionInstallMbrChildHandles (
HdDev.PartitionNumber = PartitionNumber ++;
HdDev.PartitionStart = UNPACK_UINT32 (Mbr->Partition[Index].StartingLBA);
HdDev.PartitionSize = UNPACK_UINT32 (Mbr->Partition[Index].SizeInLBA);
- CopyMem (HdDev.Signature, &(Mbr->UniqueMbrSignature[0]), sizeof (UINT32));
+ CopyMem (HdDev.Signature, &(Mbr->UniqueMbrSignature[0]), sizeof (Mbr->UniqueMbrSignature));
Status = PartitionInstallChildHandle (
This,
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
index 15061be..5d06444 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
@@ -31,7 +31,7 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding = {
};
//
-// Priortized function list to detect partition table.
+// Prioritized function list to detect partition table.
//
PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {
PartitionInstallGptChildHandles,
@@ -278,7 +278,7 @@ PartitionDriverBindingStart (
/**
- Stop this driver on ControllerHandle. Support stoping any child handles
+ Stop this driver on ControllerHandle. Support stopping any child handles
created by this driver.
@param This Protocol instance pointer.
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
index a9bbcc6..d0d0d52 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
@@ -143,7 +143,7 @@ PartitionDriverBindingStart (
);
/**
- Stop this driver on ControllerHandle. Support stoping any child handles
+ Stop this driver on ControllerHandle. Support stopping any child handles
created by this driver.
@param This Protocol instance pointer.
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf b/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
index d187a91..b7fa67b 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
@@ -1,11 +1,11 @@
#/** @file
-#
-# Component description file for Partition module.
-#
-# Partition driver produces the logical BlockIo device
-# that represents the bytes Start to End of the Parent Block IO
-# device (one partition of physical BlockIo device,
-# which can be one of GPT, MBR, ElTorito partition).
+# Modules that produces the logic Block I/O protocol for every partition
+# it discovers via the physical Block I/O.
+#
+# This module produces the logical Block I/O device that represents
+# the bytes from Start to End of the Parent Block I/O device.
+# The partition of physical BlockIo device supported is one of legacy MBR, GPT,
+# and "El Torito" partitions.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
@@ -31,9 +31,9 @@
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
-# DRIVER_BINDING = gPartitionDriverBinding
-# COMPONENT_NAME = gPartitionComponentName
-# COMPONENT_NAME2 = gPartitionComponentName2
+# DRIVER_BINDING = gPartitionDriverBinding
+# COMPONENT_NAME = gPartitionComponentName
+# COMPONENT_NAME2 = gPartitionComponentName2
#
[Sources.common]
@@ -68,7 +68,7 @@
[Protocols]
gEfiBlockIoProtocolGuid # PROTOCOL BY_START
gEfiDevicePathProtocolGuid # PROTOCOL BY_START
+ gEfiDiskIoProtocolGuid # PROTOCOL BY_START
+ gEfiBlockIoProtocolGuid # PROTOCOL TO_START
gEfiDevicePathProtocolGuid # PROTOCOL TO_START
gEfiDiskIoProtocolGuid # PROTOCOL TO_START
- gEfiBlockIoProtocolGuid # PROTOCOL TO_START
-
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
index 66eb083..5592c5c 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
@@ -1,8 +1,11 @@
#/** @file
+# English module that provides Unicode Collation supports.
#
-# Component description file for English module for unicode collation.
-#
-# This driver installs UEFI EFI_UNICODE_COLLATION_PROTOCOL protocol to provide Unicode strings function.
+# This driver installs Unicode ISO 639-2 Collation and
+# RFC 4646 Unicode Collation 2 protocols based on feature flags
+# PcdUnicodeCollationSupport & PcdUnicodeCollation2Support respectively.
+# It allows code running in the boot services environment to perform lexical
+# comparison functions on Unicode strings for English languages.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
index e8c5bd9..f5f8770 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
@@ -15,9 +15,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "UnicodeCollationEng.h"
-CHAR8 mEngUpperMap[0x100];
-CHAR8 mEngLowerMap[0x100];
-CHAR8 mEngInfoMap[0x100];
+CHAR8 mEngUpperMap[MAP_TABLE_SIZE];
+CHAR8 mEngLowerMap[MAP_TABLE_SIZE];
+CHAR8 mEngInfoMap[MAP_TABLE_SIZE];
CHAR8 mOtherChars[] = {
'0',
@@ -106,7 +106,7 @@ InitializeUnicodeCollationEng (
//
// Initialize mapping tables for the supported languages
//
- for (Index = 0; Index < 0x100; Index++) {
+ for (Index = 0; Index < MAP_TABLE_SIZE; Index++) {
mEngUpperMap[Index] = (CHAR8) Index;
mEngLowerMap[Index] = (CHAR8) Index;
mEngInfoMap[Index] = 0;
@@ -453,9 +453,9 @@ EngStrToFat (
if (*String != '.' && *String != ' ') {
//
// If this is a valid fat char, move it.
- // Otherwise, move a '_' and flag the fact that the name needs an Lfn
+ // Otherwise, move a '_' and flag the fact that the name needs a long file name.
//
- if (*String < 0x100 && ((mEngInfoMap[*String] & CHAR_FAT_VALID) != 0)) {
+ if (*String < MAP_TABLE_SIZE && ((mEngInfoMap[*String] & CHAR_FAT_VALID) != 0)) {
*Fat = mEngUpperMap[*String];
} else {
*Fat = '_';
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
index 85dc593..76695dd 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
@@ -19,7 +19,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Uefi.h>
-
#include <Protocol/UnicodeCollation.h>
#include <Library/DebugLib.h>
@@ -28,12 +27,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PcdLib.h>
//
-// Defines
+// Bit mask to indicate the validity of character in FAT file name.
//
#define CHAR_FAT_VALID 0x01
-#define TO_UPPER(a) (CHAR16) (a <= 0xFF ? mEngUpperMap[a] : a)
-#define TO_LOWER(a) (CHAR16) (a <= 0xFF ? mEngLowerMap[a] : a)
+//
+// Maximum FAT table size.
+//
+#define MAP_TABLE_SIZE 0x100
+
+//
+// Macro to map character a to upper case.
+//
+#define TO_UPPER(a) (CHAR16) ((a) <= 0xFF ? mEngUpperMap[a] : (a))
+
+//
+// Macro to map character a to lower case.
+//
+#define TO_LOWER(a) (CHAR16) ((a) <= 0xFF ? mEngLowerMap[a] : (a))
//
// Prototypes