diff options
author | Olivier Martin <olivier.martin@arm.com> | 2013-09-23 09:43:51 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-09-23 09:43:51 +0000 |
commit | c8af31eca6af260f9755c90f189c02b6f83fdd1d (patch) | |
tree | 311ca2a4f16e2627dd5f91eb943d3ff95173adef /EmbeddedPkg | |
parent | 1d7b547e69b230e39bdd9a821a57c1620228612c (diff) | |
download | edk2-c8af31eca6af260f9755c90f189c02b6f83fdd1d.tar.gz edk2-c8af31eca6af260f9755c90f189c02b6f83fdd1d.tar.bz2 edk2-c8af31eca6af260f9755c90f189c02b6f83fdd1d.zip |
MmcDxe Diagnostics: return EFI_UNSUPPORTED for Language other than english
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14706 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/Universal/MmcDxe/Diagnostics.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c index 516c832bb5..14035afb10 100644 --- a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c +++ b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c @@ -17,6 +17,7 @@ #include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/BaseLib.h>
#include "Mmc.h"
@@ -31,7 +32,7 @@ DiagnosticInitLog ( )
{
mLogRemainChar = MaxBufferChar;
- mLogBuffer = AllocatePool ((UINTN)MaxBufferChar * sizeof(CHAR16));
+ mLogBuffer = AllocatePool ((UINTN)MaxBufferChar * sizeof (CHAR16));
return mLogBuffer;
}
@@ -79,8 +80,8 @@ CompareBuffer ( for (i = 0; i < (BufferSize >> 3); i++) {
if (*BufferA64 != *BufferB64) {
- DEBUG((EFI_D_ERROR, "CompareBuffer: Error at %i", i));
- DEBUG((EFI_D_ERROR, "(0x%lX) != (0x%lX)\n", *BufferA64, *BufferB64));
+ DEBUG ((EFI_D_ERROR, "CompareBuffer: Error at %i", i));
+ DEBUG ((EFI_D_ERROR, "(0x%lX) != (0x%lX)\n", *BufferA64, *BufferB64));
return FALSE;
}
BufferA64++;
@@ -192,6 +193,11 @@ MmcDriverDiagnosticsRunDiagnostics ( return EFI_INVALID_PARAMETER;
}
+ // Check Language is supported (i.e. is "en-*" - only English is supported)
+ if (AsciiStrnCmp (Language, "en", 2) != 0) {
+ return EFI_UNSUPPORTED;
+ }
+
Status = EFI_SUCCESS;
*ErrorType = NULL;
*BufferSize = DIAGNOSTIC_LOGBUFFER_MAXCHAR;
@@ -202,8 +208,8 @@ MmcDriverDiagnosticsRunDiagnostics ( // For each MMC instance
CurrentLink = mMmcHostPool.ForwardLink;
while (CurrentLink != NULL && CurrentLink != &mMmcHostPool && (Status == EFI_SUCCESS)) {
- MmcHostInstance = MMC_HOST_INSTANCE_FROM_LINK(CurrentLink);
- ASSERT(MmcHostInstance != NULL);
+ MmcHostInstance = MMC_HOST_INSTANCE_FROM_LINK (CurrentLink);
+ ASSERT (MmcHostInstance != NULL);
// LBA=1 Size=BlockSize
DiagnosticLog (L"MMC Driver Diagnostics - Test: First Block\n");
|