From add13dc21720eff1a37fdea34c0fef190e2ad37d Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Wed, 5 Jul 2006 04:17:04 +0000 Subject: DebugLib: Fix a bug in PeiDxeDebugLibReportStatusCode: it should use gReportStatusCodeDebugType so that report status code infrastructure can correctly extract debug info. Fix functional and coding style issues in the three instances in EdkModulePkg, namely: EdkDxeDebugLibReportStatusCode, EdkUefiDebugLibStderr, EdkUefiDebugLibConout. DevicePathLib: Sync with MWG 0.57 and add new interface of CreateDevicePathNode(). All the function headers have been updated. PeiServicesLib: Adjust coding style and fix a minor comment error. PciLib: Adjust assert() condition to sync with MWG 0.57 BaseMemoryLib: Adjust assert() for ScanMemXX (), ScanGuid() Rename UefiMemoryLib to DxeMemoryLib PrintLib: Change the return value of all print services to exclude the NULL-terminator. Misc: Slightly adjust the coding style in hob.c in PeiCore module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@757 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c') diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c index 589d45c1a1..7bfc7d721e 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c @@ -19,7 +19,7 @@ BaseMemoryLibSse2 BaseMemoryLibRepStr PeiMemoryLib - UefiMemoryLib + DxeMemoryLib **/ @@ -35,6 +35,7 @@ then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). + If Length is not aligned on a 64-bit boundary, then ASSERT(). If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @@ -52,16 +53,14 @@ ScanMem64 ( IN UINT64 Value ) { - UINTN Stride; - - Stride = Length / sizeof (Value); - if (Stride == 0) { + if (Length == 0) { return NULL; } ASSERT (Buffer != NULL); ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); + ASSERT ((Length & (sizeof (Value) - 1)) == 0); - return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value); + return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value); } -- cgit v1.2.3