diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-26 10:18:28 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-26 10:18:28 +0000 |
commit | 24e25d11c0460dfb39fade685375c0e58cbcb40e (patch) | |
tree | a3e931c8113a9184433b347bacff079df18acac9 /MdePkg | |
parent | 23f52b03b4202e4dc5af440a90f0b0864a45dbdd (diff) | |
download | edk2-24e25d11c0460dfb39fade685375c0e58cbcb40e.zip edk2-24e25d11c0460dfb39fade685375c0e58cbcb40e.tar.gz edk2-24e25d11c0460dfb39fade685375c0e58cbcb40e.tar.bz2 |
• BaseMemoryLib:
Modify some Aassert()s conditions to sync with MWG 0.56d
Modify some defects in function header.
• PostCodeLib:
Implement PeiDxePostCodeLibReportStatusCode.
• Misc
Rename BaseDebugLibReportStatusCode to PeiDxeDebugLibReportStatusCode
Remove tabs in all .c and .h files in MdePkg.
Rename PeiServicesReinstallPpi() to PeiServicesReInstallPpi()
Adjust some minor coding style in PeCoffLoaderGetEntryPointerLib()
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@626 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
123 files changed, 2154 insertions, 1486 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h index 28d53bf..746d2ac 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -1,16 +1,16 @@ /** @file
- Memory-only library functions with no library constructor/destructor
+ Memory-only library functions with no library constructor/destructor
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: BaseLib.h
+ Module Name: BaseLib.h
**/
@@ -873,7 +873,7 @@ IsListEmpty ( If Node is not a node in List and Node is not equal to List, then ASSERT().
@param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
+ @param Node A pointer to a node in the doubly linked list.
@retval TRUE Node is one of the nodes in the doubly linked list.
@retval FALSE Node is not one of the nodes in the doubly linked list.
@@ -901,7 +901,7 @@ IsNull ( If Node is not a node in List, then ASSERT().
@param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
+ @param Node A pointer to a node in the doubly linked list.
@retval TRUE Node is the last node in the linked list.
@retval FALSE Node is not the last node in the linked list.
diff --git a/MdePkg/Include/Library/BaseMemoryLib.h b/MdePkg/Include/Library/BaseMemoryLib.h index 5994530..38f6c48 100644 --- a/MdePkg/Include/Library/BaseMemoryLib.h +++ b/MdePkg/Include/Library/BaseMemoryLib.h @@ -1,16 +1,16 @@ /** @file
- Memory-only library functions with no library constructor/destructor
+ Memory-only library functions with no library constructor/destructor
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: BaseMemoryLib.h
+ Module Name: BaseMemoryLib.h
**/
@@ -18,51 +18,48 @@ #define __BASE_MEMORY_LIB__
/**
- Copy Length bytes from Source to Destination.
+ Copies a source buffer to a destination buffer, and returns the destination buffer.
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and
- returns DestinationBuffer. The implementation must be reentrant, and it must
- handle the case where SourceBuffer overlaps DestinationBuffer.
+ This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
+ DestinationBuffer. The implementation must be reentrant, and it must handle the case
+ where SourceBuffer overlaps DestinationBuffer.
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
- ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
+ @param DestinationBuffer Pointer to the destination buffer of the memory copy.
+ @param SourceBuffer Pointer to the source buffer of the memory copy.
+ @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
+ @return DestinationBuffer.
**/
VOID *
EFIAPI
CopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ OUT VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
);
/**
- Set Buffer to Value for Size bytes.
+ Fills a target buffer with a byte value, and returns the target buffer.
This function fills Length bytes of Buffer with Value, and returns Buffer.
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
- @param Value Value of the set operation.
+ @param Buffer Memory to set.
+ @param Length Number of bytes to set
+ @param Value Value of the set operation.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
);
/**
@@ -72,7 +69,7 @@ SetMem ( Value, and returns Buffer. Value is repeated every 16-bits in for Length
bytes of Buffer.
- If Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
@@ -81,15 +78,15 @@ SetMem ( @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
);
/**
@@ -99,7 +96,7 @@ SetMem16 ( Value, and returns Buffer. Value is repeated every 32-bits in for Length
bytes of Buffer.
- If Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
@@ -108,15 +105,15 @@ SetMem16 ( @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
);
/**
@@ -126,7 +123,7 @@ SetMem32 ( Value, and returns Buffer. Value is repeated every 64-bits in for Length
bytes of Buffer.
- If Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@@ -135,232 +132,215 @@ SetMem32 ( @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
);
/**
- Set Buffer to 0 for Size bytes.
+ Fills a target buffer with zeros, and returns the target buffer.
This function fills Length bytes of Buffer with zeros, and returns Buffer.
+ If Length > 0 and Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Buffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
+ @param Buffer Pointer to the target buffer to fill with zeros.
+ @param Length Number of bytes in Buffer to fill with zeros.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
ZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
+ OUT VOID *Buffer,
+ IN UINTN Length
);
/**
- Compares two memory buffers of a given length.
+ Compares the contents of two buffers.
- This function compares Length bytes of SourceBuffer to Length bytes of
- DestinationBuffer. If all Length bytes of the two buffers are identical, then
- 0 is returned. Otherwise, the value returned is the first mismatched byte in
- SourceBuffer subtracted from the first mismatched byte in DestinationBuffer.
+ This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.
+ If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the
+ value returned is the first mismatched byte in SourceBuffer subtracted from the first
+ mismatched byte in DestinationBuffer.
+ If Length > 0 and DestinationBuffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and SourceBuffer is NULL and Length > 0, then ASSERT().
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- If DestinationBuffer is NULL and Length > 0, then ASSERT().
- If SourceBuffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
- ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- @param DestinationBuffer First memory buffer
- @param SourceBuffer Second memory buffer
- @param Length Length of DestinationBuffer and SourceBuffer memory
- regions to compare
+ @param DestinationBuffer Pointer to the destination buffer to compare.
+ @param SourceBuffer Pointer to the source buffer to compare.
+ @param Length Number of bytes to compare.
- @retval 0 if DestinationBuffer == SourceBuffer
- @retval Non-zero if DestinationBuffer != SourceBuffer
+ @return 0 All Length bytes of the two buffers are identical.
+ @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
+ mismatched byte in DestinationBuffer.
**/
INTN
EFIAPI
CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ IN CONST VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
);
/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
+ Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value
+ in the target buffer.
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address for an 8-bit value that matches
- Value. If a match is found, then a pointer to the matching byte in the target
- buffer is returned. If no match is found, then NULL is returned. If Length is
- 0, then NULL is returned.
+ This function searches target the buffer specified by Buffer and Length from the lowest
+ address to the highest address for an 8-bit value that matches Value. If a match is found,
+ then a pointer to the matching byte in the target buffer is returned. If no match is found,
+ then NULL is returned. If Length is 0, then NULL is returned.
+ If Length > 0 and Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ @param Buffer Pointer to the target buffer to scan.
+ @param Length Number of bytes in Buffer to scan.
+ @param Value Value to search for in the target buffer.
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
- @retval NULL if Length == 0 or Value was not found.
+ @return A pointer to the matching byte in the target buffer or NULL otherwise.
**/
VOID *
EFIAPI
ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
);
/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 16-bit increments for a 16-bit
- value that matches Value. If a match is found, then a pointer to the matching
- value in the target buffer is returned. If no match is found, then NULL is
- returned. If Length is 0, then NULL is returned.
+ Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value
+ in the target buffer.
- If Buffer is NULL, then ASSERT().
+ This function searches target the buffer specified by Buffer and Length from the lowest
+ address to the highest address for a 16-bit value that matches Value. If a match is found,
+ then a pointer to the matching byte in the target buffer is returned. If no match is found,
+ 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 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
+ @param Buffer Pointer to the target buffer to scan.
+ @param Length Number of bytes in Buffer to scan.
+ @param Value Value to search for in the target buffer.
- @return Pointer to the first occurrence.
- @retval NULL if Length == 0 or Value was not found.
+ @return A pointer to the matching byte in the target buffer or NULL otherwise.
**/
VOID *
EFIAPI
ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
);
/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 32-bit increments for a 32-bit
- value that matches Value. If a match is found, then a pointer to the matching
- value in the target buffer is returned. If no match is found, then NULL is
- returned. If Length is 0, then NULL is returned.
+ Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value
+ in the target buffer.
- If Buffer is NULL, then ASSERT().
+ This function searches target the buffer specified by Buffer and Length from the lowest
+ address to the highest address for a 32-bit value that matches Value. If a match is found,
+ then a pointer to the matching byte in the target buffer is returned. If no match is found,
+ 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 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
+ @param Buffer Pointer to the target buffer to scan.
+ @param Length Number of bytes in Buffer to scan.
+ @param Value Value to search for in the target buffer.
- @return Pointer to the first occurrence or NULL if not found.
- @retval NULL if Length == 0 or Value was not found.
+ @return A pointer to the matching byte in the target buffer or NULL otherwise.
**/
VOID *
EFIAPI
ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
);
/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 64-bit increments for a 64-bit
- value that matches Value. If a match is found, then a pointer to the matching
- value in the target buffer is returned. If no match is found, then NULL is
- returned. If Length is 0, then NULL is returned.
+ Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value
+ in the target buffer.
- If Buffer is NULL, then ASSERT().
+ This function searches target the buffer specified by Buffer and Length from the lowest
+ address to the highest address for a 64-bit value that matches Value. If a match is found,
+ then a pointer to the matching byte in the target buffer is returned. If no match is found,
+ 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 greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
+ @param Buffer Pointer to the target buffer to scan.
+ @param Length Number of bytes in Buffer to scan.
+ @param Value Value to search for in the target buffer.
- @return Pointer to the first occurrence or NULL if not found.
- @retval NULL if Length == 0 or Value was not found.
+ @return A pointer to the matching byte in the target buffer or NULL otherwise.
**/
VOID *
EFIAPI
ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
);
/**
- This function copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid
- to DestinationGuid, and returns DestinationGuid.
+ Copies a source GUID to a destination GUID.
+ This function copies the contents of the 128-bit GUID specified by SourceGuid to
+ DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
+ @param DestinationGuid Pointer to the destination GUID.
+ @param SourceGuid Pointer to the source GUID.
- @return DestinationGuid
+ @return DestinationGuid.
**/
GUID *
EFIAPI
CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
+ OUT GUID *DestinationGuid,
+ IN CONST GUID *SourceGuid
);
/**
- Compares two GUIDs
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE
- is returned. If there are any bit differences in the two GUIDs, then FALSE is
- returned.
+ Compares two GUIDs.
+ This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
+ If there are any bit differences in the two GUIDs, then FALSE is returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
- @param Guid1 guid to compare
- @param Guid2 guid to compare
+ @param Guid1 A pointer to a 128 bit GUID.
+ @param Guid2 A pointer to a 128 bit GUID.
- @retval TRUE if Guid1 == Guid2
- @retval FALSE if Guid1 != Guid2
+ @retval TRUE Guid1 and Guid2 are identical.
+ @retval FALSE Guid1 and Guid2 are not identical.
**/
BOOLEAN
EFIAPI
CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
+ IN CONST GUID *Guid1,
+ IN CONST GUID *Guid2
);
/**
@@ -368,28 +348,27 @@ CompareGuid ( in the target buffer.
This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the
- 128-bit GUID value that matches Guid. If a match is found, then a pointer to
- the matching GUID in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
+ the lowest address to the highest address at 128-bit increments for the 128-bit
+ GUID value that matches Guid. If a match is found, then a pointer to the matching
+ GUID in the target buffer is returned. If no match is found, 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 greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Guid Value to search for in the target buffer.
- @return Pointer to the first occurrence.
- @retval NULL if Length == 0 or Guid was not found.
+ @return A pointer to the matching Guid in the target buffer or NULL otherwise.
+
**/
VOID *
EFIAPI
ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN CONST GUID *Guid
);
#endif
diff --git a/MdePkg/Include/Library/CacheMaintenanceLib.h b/MdePkg/Include/Library/CacheMaintenanceLib.h index 205bc2a..91e55cf 100644 --- a/MdePkg/Include/Library/CacheMaintenanceLib.h +++ b/MdePkg/Include/Library/CacheMaintenanceLib.h @@ -1,16 +1,16 @@ /** @file
- Cache Maintenance Functions
+ Cache Maintenance Functions
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: CacheMaintenanceLib.h
+ Module Name: CacheMaintenanceLib.h
**/
diff --git a/MdePkg/Include/Library/CpuLib.h b/MdePkg/Include/Library/CpuLib.h index d79c002..02eed1c 100644 --- a/MdePkg/Include/Library/CpuLib.h +++ b/MdePkg/Include/Library/CpuLib.h @@ -1,16 +1,16 @@ /** @file
- Library that provides processor specific library services
+ Library that provides processor specific library services
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: CpuLib.h
+ Module Name: CpuLib.h
**/
diff --git a/MdePkg/Include/Library/DevicePathLib.h b/MdePkg/Include/Library/DevicePathLib.h index b42a8fe..299d607 100644 --- a/MdePkg/Include/Library/DevicePathLib.h +++ b/MdePkg/Include/Library/DevicePathLib.h @@ -1,16 +1,16 @@ /** @file
- Entry point to a DXE Boot Services Driver
+ Entry point to a DXE Boot Services Driver
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: DevicePathLib.h
+ Module Name: DevicePathLib.h
**/
@@ -18,13 +18,13 @@ #define __DEVICE_PATH_LIB_H__
/**
- This function returns the size, in bytes,
- of the device path data structure specified by DevicePath.
- If DevicePath is NULL, then 0 is returned.
+ This function returns the size, in bytes,
+ of the device path data structure specified by DevicePath.
+ If DevicePath is NULL, then 0 is returned.
- @param DevicePath A pointer to a device path data structure.
+ @param DevicePath A pointer to a device path data structure.
- @return The size of a device path in bytes.
+ @return The size of a device path in bytes.
**/
UINTN
@@ -35,12 +35,12 @@ GetDevicePathSize ( ;
/**
- This function allocates space for a new copy of the device path
- specified by DevicePath.
+ This function allocates space for a new copy of the device path
+ specified by DevicePath.
- @param DevicePath A pointer to a device path data structure.
+ @param DevicePath A pointer to a device path data structure.
- @return The duplicated device path.
+ @return The duplicated device path.
**/
EFI_DEVICE_PATH_PROTOCOL *
@@ -51,18 +51,18 @@ DuplicateDevicePath ( ;
/**
- This function appends the device path SecondDevicePath
- to every device path instance in FirstDevicePath.
+ This function appends the device path SecondDevicePath
+ to every device path instance in FirstDevicePath.
- @param FirstDevicePath A pointer to a device path data structure.
-
- @param SecondDevicePath A pointer to a device path data structure.
+ @param FirstDevicePath A pointer to a device path data structure.
+
+ @param SecondDevicePath A pointer to a device path data structure.
- @return
- A pointer to the new device path is returned.
- NULL is returned if space for the new device path could not be allocated from pool.
- It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath
- if they are no longer needed.
+ @return
+ A pointer to the new device path is returned.
+ NULL is returned if space for the new device path could not be allocated from pool.
+ It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath
+ if they are no longer needed.
**/
EFI_DEVICE_PATH_PROTOCOL *
@@ -95,16 +95,16 @@ AppendDevicePathNode ( ;
/**
- This function appends the device path instance Instance to the device path Source.
- If Source is NULL, then a new device path with one instance is created.
+ This function appends the device path instance Instance to the device path Source.
+ If Source is NULL, then a new device path with one instance is created.
- @param Source A pointer to a device path data structure.
- @param Instance A pointer to a device path instance.
+ @param Source A pointer to a device path data structure.
+ @param Instance A pointer to a device path instance.
- @return
- A pointer to the new device path.
- If there is not enough temporary pool memory available to complete this function,
- then NULL is returned.
+ @return
+ A pointer to the new device path.
+ If there is not enough temporary pool memory available to complete this function,
+ then NULL is returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
@@ -116,17 +116,17 @@ AppendDevicePathInstance ( ;
/**
- Function retrieves the next device path instance from a device path data structure.
+ Function retrieves the next device path instance from a device path data structure.
- @param DevicePath A pointer to a device path data structure.
-
- @param Size A pointer to the size of a device path instance in bytes.
+ @param DevicePath A pointer to a device path data structure.
+
+ @param Size A pointer to the size of a device path instance in bytes.
- @return
- This function returns a pointer to the current device path instance.
- In addition, it returns the size in bytes of the current device path instance in Size,
- and a pointer to the next device path instance in DevicePath.
- If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
+ @return
+ This function returns a pointer to the current device path instance.
+ In addition, it returns the size in bytes of the current device path instance in Size,
+ and a pointer to the next device path instance in DevicePath.
+ If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
**/
EFI_DEVICE_PATH_PROTOCOL *
@@ -138,12 +138,12 @@ GetNextDevicePathInstance ( ;
/**
- Return TRUE is this is a multi instance device path.
+ Return TRUE is this is a multi instance device path.
- @param DevicePath A pointer to a device path data structure.
+ @param DevicePath A pointer to a device path data structure.
- @retval TRUE If DevicePath is multi-instance.
- @retval FALSE If DevicePath is not multi-instance or DevicePath is NULL.
+ @retval TRUE If DevicePath is multi-instance.
+ @retval FALSE If DevicePath is not multi-instance or DevicePath is NULL.
**/
BOOLEAN
@@ -154,13 +154,13 @@ IsDevicePathMultiInstance ( ;
/**
- This function retrieves the device path protocol from a handle.
+ This function retrieves the device path protocol from a handle.
- @param Handle The handle from which to retrieve the device path protocol.
+ @param Handle The handle from which to retrieve the device path protocol.
- @return
- This function returns the device path protocol from the handle specified by Handle.
- If Handle is NULL or Handle does not contain a device path protocol, then NULL is returned.
+ @return
+ This function returns the device path protocol from the handle specified by Handle.
+ If Handle is NULL or Handle does not contain a device path protocol, then NULL is returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
@@ -171,18 +171,18 @@ DevicePathFromHandle ( ;
/**
- This function allocates a device path for a file and appends it to an existing device path.
-
- @param Device A pointer to a device handle. This parameter is optional and may be NULL.
- @param FileName A pointer to a Null-terminated Unicode string.
-
- @return
- If Device is a valid device handle that contains a device path protocol,
- then a device path for the file specified by FileName is allocated
- and appended to the device path associated with the handle Device. The allocated device path is returned.
- If Device is NULL or Device is a handle that does not support the device path protocol,
- then a device path containing a single device path node for the file specified by FileName
- is allocated and returned.
+ This function allocates a device path for a file and appends it to an existing device path.
+
+ @param Device A pointer to a device handle. This parameter is optional and may be NULL.
+ @param FileName A pointer to a Null-terminated Unicode string.
+
+ @return
+ If Device is a valid device handle that contains a device path protocol,
+ then a device path for the file specified by FileName is allocated
+ and appended to the device path associated with the handle Device. The allocated device path is returned.
+ If Device is NULL or Device is a handle that does not support the device path protocol,
+ then a device path containing a single device path node for the file specified by FileName
+ is allocated and returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
diff --git a/MdePkg/Include/Library/DxeRuntimeDriverLib.h b/MdePkg/Include/Library/DxeRuntimeDriverLib.h index 7f6f0eb..247979c 100644 --- a/MdePkg/Include/Library/DxeRuntimeDriverLib.h +++ b/MdePkg/Include/Library/DxeRuntimeDriverLib.h @@ -1,16 +1,16 @@ /** @file
- Library to abstract runtime services
+ Library to abstract runtime services
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: DxeRuntimeDriverLib.h
+ Module Name: DxeRuntimeDriverLib.h
**/
diff --git a/MdePkg/Include/Library/DxeServicesTableLib.h b/MdePkg/Include/Library/DxeServicesTableLib.h index f473a17..b3aa42b 100644 --- a/MdePkg/Include/Library/DxeServicesTableLib.h +++ b/MdePkg/Include/Library/DxeServicesTableLib.h @@ -1,16 +1,16 @@ /** @file
- Library that provides a global pointer to the DXE Services Table
+ Library that provides a global pointer to the DXE Services Table
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: DxeServicesTableLib.h
+ Module Name: DxeServicesTableLib.h
**/
diff --git a/MdePkg/Include/Library/HiiLib.h b/MdePkg/Include/Library/HiiLib.h index 05824a6..51fde14 100644 --- a/MdePkg/Include/Library/HiiLib.h +++ b/MdePkg/Include/Library/HiiLib.h @@ -1,16 +1,16 @@ /** @file
- Public include file for the HII Library
+ Public include file for the HII Library
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: HiiLib.h
+ Module Name: HiiLib.h
**/
@@ -18,16 +18,16 @@ #define __HII_LIB_H__
/**
- This function allocates pool for an EFI_HII_PACKAGES structure
- with enough space for the variable argument list of package pointers.
- The allocated structure is initialized using NumberOfPackages, Guid,
- and the variable length argument list of package pointers.
+ This function allocates pool for an EFI_HII_PACKAGES structure
+ with enough space for the variable argument list of package pointers.
+ The allocated structure is initialized using NumberOfPackages, Guid,
+ and the variable length argument list of package pointers.
- @param NumberOfPackages The number of HII packages to prepare.
- @param Guid Package GUID.
+ @param NumberOfPackages The number of HII packages to prepare.
+ @param Guid Package GUID.
- @return
- The allocated and initialized packages.
+ @return
+ The allocated and initialized packages.
**/
EFI_HII_PACKAGES *
diff --git a/MdePkg/Include/Library/HobLib.h b/MdePkg/Include/Library/HobLib.h index 0d9dc83..4b2745d 100644 --- a/MdePkg/Include/Library/HobLib.h +++ b/MdePkg/Include/Library/HobLib.h @@ -1,16 +1,16 @@ /** @file
- Public include file for the HOB Library
+ Public include file for the HOB Library
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: HobLib.h
+ Module Name: HobLib.h
**/
diff --git a/MdePkg/Include/Library/IoLib.h b/MdePkg/Include/Library/IoLib.h index d82b23c..4e9b7f5 100644 --- a/MdePkg/Include/Library/IoLib.h +++ b/MdePkg/Include/Library/IoLib.h @@ -1,16 +1,16 @@ /** @file
- I/O and MMIO Library Services
+ I/O and MMIO Library Services
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: IoLib.h
+ Module Name: IoLib.h
**/
diff --git a/MdePkg/Include/Library/MemoryAllocationLib.h b/MdePkg/Include/Library/MemoryAllocationLib.h index 4e76684..bb2c724 100644 --- a/MdePkg/Include/Library/MemoryAllocationLib.h +++ b/MdePkg/Include/Library/MemoryAllocationLib.h @@ -1,16 +1,16 @@ /** @file
- Memory Allocation Library Services
+ Memory Allocation Library Services
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: MemoryAllocationLib.h
+ Module Name: MemoryAllocationLib.h
**/
@@ -18,14 +18,14 @@ #define __MEMORY_ALLOCATION_LIB_H__
/**
- Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData.
+ Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData.
- @param Pages The number of 4 KB pages to allocate.
+ @param Pages The number of 4 KB pages to allocate.
- @return
- A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
- If Pages is 0, then NULL is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
+ If Pages is 0, then NULL is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -36,14 +36,14 @@ AllocatePages ( ;
/**
- Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData.
+ Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData.
- @param Pages The number of 4 KB pages to allocate.
+ @param Pages The number of 4 KB pages to allocate.
- @return
- A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
- If Pages is 0, then NULL is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
+ If Pages is 0, then NULL is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -54,14 +54,14 @@ AllocateRuntimePages ( ;
/**
- Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType.
+ Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType.
- @param Pages The number of 4 KB pages to allocate.
+ @param Pages The number of 4 KB pages to allocate.
- @return
- A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
- If Pages is 0, then NULL is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
+ If Pages is 0, then NULL is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -72,13 +72,13 @@ AllocateReservedPages ( ;
/**
- Frees one or more 4KB pages that were previously allocated with
- one of the page allocation functions in the Memory Allocation Library.
+ Frees one or more 4KB pages that were previously allocated with
+ one of the page allocation functions in the Memory Allocation Library.
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
+ @param Buffer Pointer to the buffer of pages to free.
+ @param Pages The number of 4 KB pages to free.
- None.
+ None.
**/
VOID
@@ -90,15 +90,15 @@ FreePages ( ;
/**
- Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an alignment specified by Alignment.
+ Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an alignment specified by Alignment.
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param Pages The number of 4 KB pages to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- The allocated buffer is returned. If Pages is 0, then NULL is returned.
- If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
+ @return
+ The allocated buffer is returned. If Pages is 0, then NULL is returned.
+ If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -110,15 +110,15 @@ AllocateAlignedPages ( ;
/**
- Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an alignment specified by Alignment.
+ Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an alignment specified by Alignment.
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param Pages The number of 4 KB pages to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- The allocated buffer is returned. If Pages is 0, then NULL is returned.
- If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
+ @return
+ The allocated buffer is returned. If Pages is 0, then NULL is returned.
+ If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -130,15 +130,15 @@ AllocateAlignedRuntimePages ( ;
/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
+ Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param Pages The number of 4 KB pages to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- The allocated buffer is returned. If Pages is 0, then NULL is returned.
- If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
+ @return
+ The allocated buffer is returned. If Pages is 0, then NULL is returned.
+ If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -150,13 +150,13 @@ AllocateAlignedReservedPages ( ;
/**
- Frees one or more 4KB pages that were previously allocated with
- one of the aligned page allocation functions in the Memory Allocation Library.
+ Frees one or more 4KB pages that were previously allocated with
+ one of the aligned page allocation functions in the Memory Allocation Library.
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
+ @param Buffer Pointer to the buffer of pages to free.
+ @param Pages The number of 4 KB pages to free.
- None.
+ None.
**/
VOID
@@ -168,13 +168,13 @@ FreeAlignedPages ( ;
/**
- Allocates a buffer of type EfiBootServicesData.
+ Allocates a buffer of type EfiBootServicesData.
- @param AllocationSize The number of bytes to allocate.
+ @param AllocationSize The number of bytes to allocate.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -185,13 +185,13 @@ AllocatePool ( ;
/**
- Allocates a buffer of type EfiRuntimeServicesData.
+ Allocates a buffer of type EfiRuntimeServicesData.
- @param AllocationSize The number of bytes to allocate.
+ @param AllocationSize The number of bytes to allocate.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -202,13 +202,13 @@ AllocateRuntimePool ( ;
/**
- Allocates a buffer of type EfiReservedMemoryType.
+ Allocates a buffer of type EfiReservedMemoryType.
- @param AllocationSize The number of bytes to allocate.
+ @param AllocationSize The number of bytes to allocate.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -219,13 +219,13 @@ AllocateReservedPool ( ;
/**
- Allocates and zeros a buffer of type EfiBootServicesData.
+ Allocates and zeros a buffer of type EfiBootServicesData.
- @param AllocationSize The number of bytes to allocate and zero.
+ @param AllocationSize The number of bytes to allocate and zero.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -236,13 +236,13 @@ AllocateZeroPool ( ;
/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData.
+ Allocates and zeros a buffer of type EfiRuntimeServicesData.
- @param AllocationSize The number of bytes to allocate and zero.
+ @param AllocationSize The number of bytes to allocate and zero.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -253,13 +253,13 @@ AllocateRuntimeZeroPool ( ;
/**
- Allocates and zeros a buffer of type EfiReservedMemoryType.
+ Allocates and zeros a buffer of type EfiReservedMemoryType.
- @param AllocationSize The number of bytes to allocate and zero.
+ @param AllocationSize The number of bytes to allocate and zero.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -270,14 +270,14 @@ AllocateReservedZeroPool ( ;
/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData.
+ Copies a buffer to an allocated buffer of type EfiBootServicesData.
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
+ @param AllocationSize The number of bytes to allocate.
+ @param Buffer The buffer to copy to the allocated buffer.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -289,14 +289,14 @@ AllocateCopyPool ( ;
/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
+ Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
+ @param AllocationSize The number of bytes to allocate.
+ @param Buffer The buffer to copy to the allocated buffer.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -308,14 +308,14 @@ AllocateRuntimeCopyPool ( ;
/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
+ Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
+ @param AllocationSize The number of bytes to allocate.
+ @param Buffer The buffer to copy to the allocated buffer.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -327,12 +327,12 @@ AllocateReservedCopyPool ( ;
/**
- Frees a buffer that was previously allocated with one of the pool allocation functions
- in the Memory Allocation Library.
+ Frees a buffer that was previously allocated with one of the pool allocation functions
+ in the Memory Allocation Library.
- @param Buffer Pointer to the buffer to free.
+ @param Buffer Pointer to the buffer to free.
- None.
+ None.
**/
VOID
@@ -343,15 +343,15 @@ FreePool ( ;
/**
- Allocates a buffer of type EfiBootServicesData at a specified alignment.
+ Allocates a buffer of type EfiBootServicesData at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -363,15 +363,15 @@ AllocateAlignedPool ( ;
/**
- Allocates a buffer of type EfiRuntimeServicesData at a specified alignment.
+ Allocates a buffer of type EfiRuntimeServicesData at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -383,15 +383,15 @@ AllocateAlignedRuntimePool ( ;
/**
- Allocates a buffer of type EfiReservedMemoryType at a specified alignment.
+ Allocates a buffer of type EfiReservedMemoryType at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -403,15 +403,15 @@ AllocateAlignedReservedPool ( ;
/**
- Allocates and zeros a buffer of type EfiBootServicesData at a specified alignment.
+ Allocates and zeros a buffer of type EfiBootServicesData at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -423,15 +423,15 @@ AllocateAlignedZeroPool ( ;
/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData at a specified alignment.
+ Allocates and zeros a buffer of type EfiRuntimeServicesData at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -443,15 +443,15 @@ AllocateAlignedRuntimeZeroPool ( ;
/**
- Allocates and zeros a buffer of type EfiReservedMemoryType at a specified alignment.
+ Allocates and zeros a buffer of type EfiReservedMemoryType at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -463,16 +463,16 @@ AllocateAlignedReservedZeroPool ( ;
/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData at a specified alignment.
+ Copies a buffer to an allocated buffer of type EfiBootServicesData at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Buffer The buffer to copy to the allocated buffer.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -485,16 +485,16 @@ AllocateAlignedCopyPool ( ;
/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData at a specified alignment.
+ Copies a buffer to an allocated buffer of type EfiRuntimeServicesData at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Buffer The buffer to copy to the allocated buffer.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -507,16 +507,16 @@ AllocateAlignedRuntimeCopyPool ( ;
/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType at a specified alignment.
+ Copies a buffer to an allocated buffer of type EfiReservedMemoryType at a specified alignment.
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
+ @param AllocationSize The number of bytes to allocate.
+ @param Buffer The buffer to copy to the allocated buffer.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
- @return
- A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
+ @return
+ A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
+ If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
@@ -529,12 +529,12 @@ AllocateAlignedReservedCopyPool ( ;
/**
- Frees a buffer that was previously allocated with one of the aligned pool allocation functions
- in the Memory Allocation Library.
+ Frees a buffer that was previously allocated with one of the aligned pool allocation functions
+ in the Memory Allocation Library.
- @param Buffer Pointer to the buffer to free.
+ @param Buffer Pointer to the buffer to free.
- None.
+ None.
**/
VOID
diff --git a/MdePkg/Include/Library/PciCf8Lib.h b/MdePkg/Include/Library/PciCf8Lib.h index 3898abe..e2ac1b2 100644 --- a/MdePkg/Include/Library/PciCf8Lib.h +++ b/MdePkg/Include/Library/PciCf8Lib.h @@ -1,16 +1,16 @@ /** @file
- PCI CF8 Library Services for PCI Segment #0
+ PCI CF8 Library Services for PCI Segment #0
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: PciCf8Lib.h
+ Module Name: PciCf8Lib.h
**/
diff --git a/MdePkg/Include/Library/PciExpressLib.h b/MdePkg/Include/Library/PciExpressLib.h index 3c3fd18..c21a279 100644 --- a/MdePkg/Include/Library/PciExpressLib.h +++ b/MdePkg/Include/Library/PciExpressLib.h @@ -1,16 +1,16 @@ /** @file
- Pci Express Library Services for PCI Segment #0
+ Pci Express Library Services for PCI Segment #0
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: PciExpressLib.h
+ Module Name: PciExpressLib.h
**/
diff --git a/MdePkg/Include/Library/PciLib.h b/MdePkg/Include/Library/PciLib.h index a80ceae..4d21cb7 100644 --- a/MdePkg/Include/Library/PciLib.h +++ b/MdePkg/Include/Library/PciLib.h @@ -1,16 +1,16 @@ /** @file
- PCI Library Services for PCI Segment #0
+ PCI Library Services for PCI Segment #0
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: PciLib.h
+ Module Name: PciLib.h
**/
diff --git a/MdePkg/Include/Library/PeCoffGetEntryPointLib.h b/MdePkg/Include/Library/PeCoffGetEntryPointLib.h index f20562e..85e3e25 100644 --- a/MdePkg/Include/Library/PeCoffGetEntryPointLib.h +++ b/MdePkg/Include/Library/PeCoffGetEntryPointLib.h @@ -1,16 +1,16 @@ /** @file
- Memory Only PE COFF loader
+ Memory Only PE COFF loader
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: PeCoffGetEntryPointLib.h
+ Module Name: PeCoffGetEntryPointLib.h
**/
@@ -18,22 +18,27 @@ #define __PE_COFF_GET_ENTRY_POINT_LIB_H__
/**
- Loads a PE/COFF image into memory
+ Retrieves and returns a pointer to the entry point to a PE/COFF image that has been loaded
+ into system memory with the PE/COFF Loader Library functions.
- @param Pe32Data Pointer to a PE/COFF Image
-
- @param EntryPoint Pointer to the entry point of the PE/COFF image
+ Retrieves the entry point to the PE/COFF image specified by Pe32Data and returns this entry
+ point in EntryPoint. If the entry point could not be retrieved from the PE/COFF image, then
+ return RETURN_INVALID_PARAMETER. Otherwise return RETURN_SUCCESS.
+ If Pe32Data is NULL, then ASSERT().
+ If EntryPoint is NULL, then ASSERT().
- @retval EFI_SUCCESS if the EntryPoint was returned
- @retval EFI_INVALID_PARAMETER if the EntryPoint could not be found from Pe32Data
+ @param Pe32Data Pointer to the PE/COFF image that is loaded in system memory.
+ @param EntryPoint Pointer to entry point to the PE/COFF image to return.
+
+ @retval RETURN_SUCCESS EntryPoint was returned.
+ @retval RETURN_INVALID_PARAMETER The entry point could not be found in the PE/COFF image.
**/
RETURN_STATUS
EFIAPI
PeCoffLoaderGetEntryPoint (
- IN VOID *Pe32Data,
- IN OUT VOID **EntryPoint
- )
-;
+ IN VOID *Pe32Data,
+ OUT VOID **EntryPoint
+ );
#endif
diff --git a/MdePkg/Include/Library/PeCoffLib.h b/MdePkg/Include/Library/PeCoffLib.h index 0a68ae6..df588b7 100644 --- a/MdePkg/Include/Library/PeCoffLib.h +++ b/MdePkg/Include/Library/PeCoffLib.h @@ -1,16 +1,16 @@ /** @file
- Memory Only PE COFF loader
+ Memory Only PE COFF loader
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: PeCoffLib.h
+ Module Name: PeCoffLib.h
**/
diff --git a/MdePkg/Include/Library/PeiServicesLib.h b/MdePkg/Include/Library/PeiServicesLib.h index 64bd253..10eebb5 100644 --- a/MdePkg/Include/Library/PeiServicesLib.h +++ b/MdePkg/Include/Library/PeiServicesLib.h @@ -1,16 +1,16 @@ /** @file
- PEI Core Library implementation
+ PEI Core Library implementation
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: PeiServicesLib.h
+ Module Name: PeiServicesLib.h
**/
@@ -18,15 +18,15 @@ #define __PEI_SERVICES_LIB_H__
/**
- This service enables a given PEIM to register an interface into the PEI Foundation.
+ This service enables a given PEIM to register an interface into the PEI Foundation.
- @param PpiList A pointer to the list of interfaces that the caller shall install.
+ @param PpiList A pointer to the list of interfaces that the caller shall install.
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have
- the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
+ @retval EFI_SUCCESS The interface was successfully installed.
+ @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
+ @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have
+ the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
+ @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
**/
EFI_STATUS
@@ -37,37 +37,37 @@ PeiServicesInstallPpi ( ;
/**
- This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
+ This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
- @param OldPpi Pointer to the old PEI PPI Descriptors.
- @param NewPpi Pointer to the new PEI PPI Descriptors.
+ @param OldPpi Pointer to the old PEI PPI Descriptors.
+ @param NewPpi Pointer to the new PEI PPI Descriptors.
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have
- the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
- @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.
+ @retval EFI_SUCCESS The interface was successfully installed.
+ @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
+ @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have
+ the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
+ @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
+ @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.
**/
EFI_STATUS
EFIAPI
-PeiServicesReinstallPpi (
+PeiServicesReInstallPpi (
IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
)
;
/**
- This service enables PEIMs to discover a given instance of an interface.
+ This service enables PEIMs to discover a given instance of an interface.
- @param Guid A pointer to the GUID whose corresponding interface needs to be found.
- @param Instance The N-th instance of the interface that is required.
- @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
- @param Ppi A pointer to the instance of the interface.
+ @param Guid A pointer to the GUID whose corresponding interface needs to be found.
+ @param Instance The N-th instance of the interface that is required.
+ @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
+ @param Ppi A pointer to the instance of the interface.
- @retval EFI_SUCCESS The interface was successfully returned.
- @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
+ @retval EFI_SUCCESS The interface was successfully returned.
+ @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
**/
EFI_STATUS
@@ -81,16 +81,16 @@ PeiServicesLocatePpi ( ;
/**
- This service enables PEIMs to register a given service to be invoked
- when another service is installed or reinstalled.
+ This service enables PEIMs to register a given service to be invoked
+ when another service is installed or reinstalled.
- @param NotifyList A pointer to the list of notification interfaces that the caller shall install.
+ @param NotifyList A pointer to the list of notification interfaces that the caller shall install.
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have
- the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
+ @retval EFI_SUCCESS The interface was successfully installed.
+ @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
+ @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have
+ the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
+ @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
**/
EFI_STATUS
@@ -101,12 +101,12 @@ PeiServicesNotifyPpi ( ;
/**
- This service enables PEIMs to ascertain the present value of the boot mode.
+ This service enables PEIMs to ascertain the present value of the boot mode.
- @param BootMode A pointer to contain the value of the boot mode.
+ @param BootMode A pointer to contain the value of the boot mode.
- @retval EFI_SUCCESS The boot mode was returned successfully.
- @retval EFI_INVALID_PARAMETER BootMode is NULL.
+ @retval EFI_SUCCESS The boot mode was returned successfully.
+ @retval EFI_INVALID_PARAMETER BootMode is NULL.
**/
EFI_STATUS
@@ -117,11 +117,11 @@ PeiServicesGetBootMode ( ;
/**
- This service enables PEIMs to update the boot mode variable.
+ This service enables PEIMs to update the boot mode variable.
- @param BootMode The value of the boot mode to set.
+ @param BootMode The value of the boot mode to set.
- @retval EFI_SUCCESS The value was successfully updated
+ @retval EFI_SUCCESS The value was successfully updated
**/
EFI_STATUS
@@ -132,12 +132,12 @@ PeiServicesSetBootMode ( ;
/**
- This service enables a PEIM to ascertain the address of the list of HOBs in memory.
+ This service enables a PEIM to ascertain the address of the list of HOBs in memory.
- @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
+ @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
- @retval EFI_SUCCESS The list was successfully returned.
- @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
+ @retval EFI_SUCCESS The list was successfully returned.
+ @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
**/
EFI_STATUS
@@ -148,14 +148,14 @@ PeiServicesGetHobList ( ;
/**
- This service enables PEIMs to create various types of HOBs.
+ This service enables PEIMs to create various types of HOBs.
- @param Type The type of HOB to be installed.
- @param Length The length of the HOB to be added.
- @param Hob The address of a pointer that will contain the HOB header.
+ @param Type The type of HOB to be installed.
+ @param Length The length of the HOB to be added.
+ @param Hob The address of a pointer that will contain the HOB header.
- @retval EFI_SUCCESS The HOB was successfully created.
- @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
+ @retval EFI_SUCCESS The HOB was successfully created.
+ @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
**/
EFI_STATUS
@@ -168,15 +168,15 @@ PeiServicesCreateHob ( ;
/**
- This service enables PEIMs to discover additional firmware volumes.
+ This service enables PEIMs to discover additional firmware volumes.
- @param Instance This instance of the firmware volume to find.
- The value 0 is the Boot Firmware Volume (BFV).
- @param FwVolHeader Pointer to the firmware volume header of the volume to return.
+ @param Instance This instance of the firmware volume to find.
+ The value 0 is the Boot Firmware Volume (BFV).
+ @param FwVolHeader Pointer to the firmware volume header of the volume to return.
- @retval EFI_SUCCESS The volume was found.
- @retval EFI_NOT_FOUND The volume was not found.
- @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
+ @retval EFI_SUCCESS The volume was found.
+ @retval EFI_NOT_FOUND The volume was not found.
+ @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
**/
EFI_STATUS
@@ -188,16 +188,16 @@ PeiServicesFfsFindNextVolume ( ;
/**
- This service enables PEIMs to discover additional firmware files.
+ This service enables PEIMs to discover additional firmware files.
- @param SearchType A filter to find files only of this type.
- @param FwVolHeader Pointer to the firmware volume header of the volume to search.
- This parameter must point to a valid FFS volume.
- @param FileHeader Pointer to the current file from which to begin searching.
+ @param SearchType A filter to find files only of this type.
+ @param FwVolHeader Pointer to the firmware volume header of the volume to search.
+ This parameter must point to a valid FFS volume.
+ @param FileHeader Pointer to the current file from which to begin searching.
- @retval EFI_SUCCESS The file was found.
- @retval EFI_NOT_FOUND The file was not found.
- @retval EFI_NOT_FOUND The header checksum was not zero.
+ @retval EFI_SUCCESS The file was found.
+ @retval EFI_NOT_FOUND The file was not found.
+ @retval EFI_NOT_FOUND The header checksum was not zero.
**/
EFI_STATUS
@@ -210,14 +210,14 @@ PeiServicesFfsFindNextFile ( ;
/**
- This service enables PEIMs to discover sections of a given type within a valid FFS file.
+ This service enables PEIMs to discover sections of a given type within a valid FFS file.
- @param SearchType The value of the section type to find.
- @param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
- @param SectionData A pointer to the discovered section, if successful.
+ @param SearchType The value of the section type to find.
+ @param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
+ @param SectionData A pointer to the discovered section, if successful.
- @retval EFI_SUCCESS The section was found.
- @retval EFI_NOT_FOUND The section was not found.
+ @retval EFI_SUCCESS The section was found.
+ @retval EFI_NOT_FOUND The section was not found.
**/
EFI_STATUS
@@ -230,15 +230,15 @@ PeiServicesFfsFindSectionData ( ;
/**
- This service enables PEIMs to register the permanent memory configuration
- that has been initialized with the PEI Foundation.
+ This service enables PEIMs to register the permanent memory configuration
+ that has been initialized with the PEI Foundation.
- @param MemoryBegin The value of a region of installed memory.
- @param MemoryLength The corresponding length of a region of installed memory.
+ @param MemoryBegin The value of a region of installed memory.
+ @param MemoryLength The corresponding length of a region of installed memory.
- @retval EFI_SUCCESS The region was successfully installed in a HOB.
- @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
- @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
+ @retval EFI_SUCCESS The region was successfully installed in a HOB.
+ @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
+ @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
**/
EFI_STATUS
@@ -250,16 +250,16 @@ PeiServicesInstallPeiMemory ( ;
/**
- This service enables PEIMs to allocate memory after the permanent memory has been installed by a PEIM.
+ This service enables PEIMs to allocate memory after the permanent memory has been installed by a PEIM.
- @param MemoryType Type of memory to allocate.
- @param Pages Number of pages to allocate.
- @param Memory Pointer of memory allocated.
+ @param MemoryType Type of memory to allocate.
+ @param Pages Number of pages to allocate.
+ @param Memory Pointer of memory allocated.
- @retval EFI_SUCCESS The memory range was successfully allocated.
- @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
- @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
- @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
+ @retval EFI_SUCCESS The memory range was successfully allocated.
+ @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
+ @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
+ @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
**/
EFI_STATUS
@@ -272,14 +272,14 @@ PeiServicesAllocatePages ( ;
/**
- This service allocates memory from the Hand-Off Block (HOB) heap.
+ This service allocates memory from the Hand-Off Block (HOB) heap.
- @param Size The number of bytes to allocate from the pool.
- @param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer;
- undefined otherwise.
+ @param Size The number of bytes to allocate from the pool.
+ @param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer;
+ undefined otherwise.
- @retval EFI_SUCCESS The allocation was successful
- @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
+ @retval EFI_SUCCESS The allocation was successful
+ @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
**/
EFI_STATUS
@@ -291,9 +291,9 @@ PeiServicesAllocatePool ( ;
/**
- This service resets the entire platform, including all processors and devices, and reboots the system.
+ This service resets the entire platform, including all processors and devices, and reboots the system.
- @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
+ @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
**/
EFI_STATUS
diff --git a/MdePkg/Include/Library/PeiServicesTablePointerLib.h b/MdePkg/Include/Library/PeiServicesTablePointerLib.h index 815e722..2a346aa 100644 --- a/MdePkg/Include/Library/PeiServicesTablePointerLib.h +++ b/MdePkg/Include/Library/PeiServicesTablePointerLib.h @@ -1,16 +1,16 @@ /** @file
- PEI Services Table Pointer Library services
+ PEI Services Table Pointer Library services
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: PeiServicesTablePointerLib.h
+ Module Name: PeiServicesTablePointerLib.h
**/
diff --git a/MdePkg/Include/Library/PrintLib.h b/MdePkg/Include/Library/PrintLib.h index 22df74c..bdab062 100644 --- a/MdePkg/Include/Library/PrintLib.h +++ b/MdePkg/Include/Library/PrintLib.h @@ -1,16 +1,16 @@ /** @file
- Library that provides print services
+ Library that provides print services
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: PrintLib.h
+ Module Name: PrintLib.h
**/
@@ -362,7 +362,7 @@ AsciiSPrintUnicodeFormat ( Unicode string.
@param Flags The bitmask of flags that specify left justification, zero pad, and commas.
@param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of Unicode characters to place in Buffer.
+ @param Width The maximum number of Unicode characters to place in Buffer.
@return Total number of characters required to perform the conversion.
@@ -406,7 +406,7 @@ UnicodeValueToString ( ASCII string.
@param Flags The bitmask of flags that specify left justification, zero pad, and commas.
@param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of ASCII characters to place in Buffer.
+ @param Width The maximum number of ASCII characters to place in Buffer.
@return Total number of characters required to perform the conversion.
diff --git a/MdePkg/Include/Library/ResourcePublicationLib.h b/MdePkg/Include/Library/ResourcePublicationLib.h index 2aa0040..ccd3eae 100644 --- a/MdePkg/Include/Library/ResourcePublicationLib.h +++ b/MdePkg/Include/Library/ResourcePublicationLib.h @@ -1,16 +1,16 @@ /** @file
- Declare presence of resources in the platform
+ Declare presence of resources in the platform
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: ResourcePublicationLib.h
+ Module Name: ResourcePublicationLib.h
**/
diff --git a/MdePkg/Include/Library/SmbusLib.h b/MdePkg/Include/Library/SmbusLib.h index 6d214aa..0520523 100644 --- a/MdePkg/Include/Library/SmbusLib.h +++ b/MdePkg/Include/Library/SmbusLib.h @@ -1,16 +1,16 @@ /** @file
- SMBUS Functions
+ SMBUS Functions
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: SmbusLib.h
+ Module Name: SmbusLib.h
**/
diff --git a/MdePkg/Include/Library/TimerLib.h b/MdePkg/Include/Library/TimerLib.h index 3d0f03e..4b12152 100644 --- a/MdePkg/Include/Library/TimerLib.h +++ b/MdePkg/Include/Library/TimerLib.h @@ -1,16 +1,16 @@ /** @file
- Timer Library Functions
+ Timer Library Functions
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: TimerLib.h
+ Module Name: TimerLib.h
**/
diff --git a/MdePkg/Include/Library/UefiBootServicesTableLib.h b/MdePkg/Include/Library/UefiBootServicesTableLib.h index 52b5e23..73a2e39 100644 --- a/MdePkg/Include/Library/UefiBootServicesTableLib.h +++ b/MdePkg/Include/Library/UefiBootServicesTableLib.h @@ -1,16 +1,16 @@ /** @file
- Library that provides a global pointer to the UEFI Boot Services Tables
+ Library that provides a global pointer to the UEFI Boot Services Tables
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: UefiBootServicesTableLib.h
+ Module Name: UefiBootServicesTableLib.h
**/
diff --git a/MdePkg/Include/Library/UefiDecompressLib.h b/MdePkg/Include/Library/UefiDecompressLib.h index d2a3793..d1cf2d7 100644 --- a/MdePkg/Include/Library/UefiDecompressLib.h +++ b/MdePkg/Include/Library/UefiDecompressLib.h @@ -1,16 +1,16 @@ /** @file
- Return UEFI Decompress Protocol
+ Return UEFI Decompress Protocol
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: UefiDecompressLib.h
+ Module Name: UefiDecompressLib.h
**/
diff --git a/MdePkg/Include/Library/UefiDriverModelLib.h b/MdePkg/Include/Library/UefiDriverModelLib.h index b6532f1..5d10e75 100644 --- a/MdePkg/Include/Library/UefiDriverModelLib.h +++ b/MdePkg/Include/Library/UefiDriverModelLib.h @@ -1,16 +1,16 @@ /** @file
- UEFI Driver Model Library Services
+ UEFI Driver Model Library Services
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: UefiDriverModelLib.h
+ Module Name: UefiDriverModelLib.h
**/
diff --git a/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h b/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h index c59851e..d1dfe43 100644 --- a/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h +++ b/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h @@ -1,16 +1,16 @@ /** @file
- Library that provides a global pointer to the UEFI Runtime Services Tables
+ Library that provides a global pointer to the UEFI Runtime Services Tables
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: UefiRuntimeServicesTableLib.h
+ Module Name: UefiRuntimeServicesTableLib.h
**/
diff --git a/MdePkg/Library/BaseLib/Ia32/Non-existing.c b/MdePkg/Library/BaseLib/Ia32/Non-existing.c index 4132d30..b4e50e9 100644 --- a/MdePkg/Library/BaseLib/Ia32/Non-existing.c +++ b/MdePkg/Library/BaseLib/Ia32/Non-existing.c @@ -1,16 +1,16 @@ /** @file
- Non-existing BaseLib functions on Ia32
+ Non-existing BaseLib functions on Ia32
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: Non-existing.c
+ Module Name: Non-existing.c
**/
diff --git a/MdePkg/Library/BaseLib/LinkedList.c b/MdePkg/Library/BaseLib/LinkedList.c index be7e0a6..846a813 100644 --- a/MdePkg/Library/BaseLib/LinkedList.c +++ b/MdePkg/Library/BaseLib/LinkedList.c @@ -278,7 +278,7 @@ IsListEmpty ( If Node is not a node in List and Node is not equal to List, then ASSERT().
@param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
+ @param Node A pointer to a node in the doubly linked list.
@retval TRUE Node is one of the nodes in the doubly linked list.
@retval FALSE Node is not one of the nodes in the doubly linked list.
@@ -314,7 +314,7 @@ IsNull ( If Node is not a node in List, then ASSERT().
@param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
+ @param Node A pointer to a node in the doubly linked list.
@retval TRUE Node is the last node in the linked list.
@retval FALSE Node is not the last node in the linked list.
diff --git a/MdePkg/Library/BaseLib/X64/Non-existing.c b/MdePkg/Library/BaseLib/X64/Non-existing.c index b2c7378..fc4fd43 100644 --- a/MdePkg/Library/BaseLib/X64/Non-existing.c +++ b/MdePkg/Library/BaseLib/X64/Non-existing.c @@ -1,16 +1,16 @@ /** @file
- Non-existing BaseLib functions on x64
+ Non-existing BaseLib functions on x64
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: Non-existing.c
+ Module Name: Non-existing.c
**/
diff --git a/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c index 6081bbe..e3b0fe3 100644 --- a/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c @@ -50,9 +50,9 @@ INTN
EFIAPI
CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ IN CONST VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c index 5ca62f5..1fd00ac 100644 --- a/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c @@ -26,41 +26,37 @@ #include "MemLibInternals.h"
/**
- Copy Length bytes from Source to Destination.
+ Copies a source buffer to a destination buffer, and returns the destination buffer.
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and
- returns DestinationBuffer. The implementation must be reentrant, and it must
- handle the case where SourceBuffer overlaps DestinationBuffer.
+ This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
+ DestinationBuffer. The implementation must be reentrant, and it must handle the case
+ where SourceBuffer overlaps DestinationBuffer.
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
- ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
+ @param DestinationBuffer Pointer to the destination buffer of the memory copy.
+ @param SourceBuffer Pointer to the source buffer of the memory copy.
+ @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
+ @return DestinationBuffer.
**/
VOID *
EFIAPI
CopyMem (
- OUT VOID *Destination,
- IN CONST VOID *Source,
- IN UINTN Length
+ OUT VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
- ASSERT (
- Destination == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Destination + 1
- );
- ASSERT (
- Source == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Source + 1
- );
- if (Destination == Source || Length == 0) {
- return Destination;
+ if (Length == 0) {
+ return DestinationBuffer;
+ }
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
+
+ if (DestinationBuffer == SourceBuffer) {
+ return DestinationBuffer;
}
- return InternalMemCopyMem (Destination, Source, Length);
+ return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
}
diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c b/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c index 53c4e44..3fecfc9 100644 --- a/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c +++ b/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c @@ -161,7 +161,6 @@ InternalMemScanMem8 ( {
CONST UINT8 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT8*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -192,7 +191,6 @@ InternalMemScanMem16 ( {
CONST UINT16 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT16*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -223,7 +221,6 @@ InternalMemScanMem32 ( {
CONST UINT32 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT32*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -254,7 +251,6 @@ InternalMemScanMem64 ( {
CONST UINT64 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT64*)Buffer;
do {
if (*(Pointer++) == Value) {
diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c index c54983c..351e370 100644 --- a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c @@ -24,25 +24,24 @@ **/
/**
- This function copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid
- to DestinationGuid, and returns DestinationGuid.
+ Copies a source GUID to a destination GUID.
+ This function copies the contents of the 128-bit GUID specified by SourceGuid to
+ DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
+ @param DestinationGuid Pointer to the destination GUID.
+ @param SourceGuid Pointer to the source GUID.
- @return DestinationGuid
+ @return DestinationGuid.
**/
GUID *
EFIAPI
CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
+ OUT GUID *DestinationGuid,
+ IN CONST GUID *SourceGuid
)
{
WriteUnaligned64 (
@@ -57,27 +56,25 @@ CopyGuid ( }
/**
- Compares two GUIDs
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE
- is returned. If there are any bit differences in the two GUIDs, then FALSE is
- returned.
+ Compares two GUIDs.
+ This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
+ If there are any bit differences in the two GUIDs, then FALSE is returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
- @param Guid1 guid to compare
- @param Guid2 guid to compare
+ @param Guid1 A pointer to a 128 bit GUID.
+ @param Guid2 A pointer to a 128 bit GUID.
- @retval TRUE if Guid1 == Guid2
- @retval FALSE if Guid1 != Guid2
+ @retval TRUE Guid1 and Guid2 are identical.
+ @retval FALSE Guid1 and Guid2 are not identical.
**/
BOOLEAN
EFIAPI
CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
+ IN CONST GUID *Guid1,
+ IN CONST GUID *Guid2
)
{
return (BOOLEAN)(
@@ -93,28 +90,27 @@ CompareGuid ( in the target buffer.
This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the
- 128-bit GUID value that matches Guid. If a match is found, then a pointer to
- the matching GUID in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
+ the lowest address to the highest address at 128-bit increments for the 128-bit
+ GUID value that matches Guid. If a match is found, then a pointer to the matching
+ GUID in the target buffer is returned. If no match is found, 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 greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Guid Value to search for in the target buffer.
- @return Pointer to the first occurrence.
- @retval NULL if Length == 0 or Guid was not found.
+ @return A pointer to the matching Guid in the target buffer or NULL otherwise.
+
**/
VOID *
EFIAPI
ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN CONST GUID *Guid
)
{
CONST GUID *GuidPtr;
diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c index d336d59..9ffc2cf 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem16 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c index 8de5594..6b0beee 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem32 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c index 228c864..589d45c 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem64 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c index 72a8078..4dc8bac 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c @@ -46,9 +46,9 @@ VOID *
EFIAPI
ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
@@ -57,5 +57,5 @@ ScanMem8 ( ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem8 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLib/SetMem.c b/MdePkg/Library/BaseMemoryLib/SetMem.c index bd7fee0..07acc6f 100644 --- a/MdePkg/Library/BaseMemoryLib/SetMem.c +++ b/MdePkg/Library/BaseMemoryLib/SetMem.c @@ -13,7 +13,7 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name: EfiSetMem.c
+ Module Name: SetMem.c
**/
diff --git a/MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.c b/MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.c index fd3720c..41467a9 100644 --- a/MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 16-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.c b/MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.c index 77f1abd..4258406 100644 --- a/MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 32-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.c b/MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.c index f95b97f..4a1eda8 100644 --- a/MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 64-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c index d0e8760..3965be7 100644 --- a/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c @@ -41,9 +41,9 @@ VOID *
EFIAPI
SetMem (
- IN VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c index 4a3d615..56dbe5d 100644 --- a/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c @@ -26,24 +26,23 @@ #include "MemLibInternals.h"
/**
- Set Buffer to 0 for Size bytes.
+ Fills a target buffer with zeros, and returns the target buffer.
This function fills Length bytes of Buffer with zeros, and returns Buffer.
+ If Length > 0 and Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Buffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ @param Buffer Pointer to the target buffer to fill with zeros.
+ @param Length Number of bytes in Buffer to fill with zeros.
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
ZeroMem (
- IN VOID *Buffer,
- IN UINTN Length
+ OUT VOID *Buffer,
+ IN UINTN Length
)
{
ASSERT (!(Buffer == NULL && Length > 0));
diff --git a/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c index 6081bbe..e3b0fe3 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c @@ -50,9 +50,9 @@ INTN
EFIAPI
CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ IN CONST VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c index 5ca62f5..1fd00ac 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c @@ -26,41 +26,37 @@ #include "MemLibInternals.h"
/**
- Copy Length bytes from Source to Destination.
+ Copies a source buffer to a destination buffer, and returns the destination buffer.
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and
- returns DestinationBuffer. The implementation must be reentrant, and it must
- handle the case where SourceBuffer overlaps DestinationBuffer.
+ This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
+ DestinationBuffer. The implementation must be reentrant, and it must handle the case
+ where SourceBuffer overlaps DestinationBuffer.
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
- ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
+ @param DestinationBuffer Pointer to the destination buffer of the memory copy.
+ @param SourceBuffer Pointer to the source buffer of the memory copy.
+ @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
+ @return DestinationBuffer.
**/
VOID *
EFIAPI
CopyMem (
- OUT VOID *Destination,
- IN CONST VOID *Source,
- IN UINTN Length
+ OUT VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
- ASSERT (
- Destination == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Destination + 1
- );
- ASSERT (
- Source == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Source + 1
- );
- if (Destination == Source || Length == 0) {
- return Destination;
+ if (Length == 0) {
+ return DestinationBuffer;
+ }
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
+
+ if (DestinationBuffer == SourceBuffer) {
+ return DestinationBuffer;
}
- return InternalMemCopyMem (Destination, Source, Length);
+ return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
}
diff --git a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c index c54983c..351e370 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c @@ -24,25 +24,24 @@ **/
/**
- This function copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid
- to DestinationGuid, and returns DestinationGuid.
+ Copies a source GUID to a destination GUID.
+ This function copies the contents of the 128-bit GUID specified by SourceGuid to
+ DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
+ @param DestinationGuid Pointer to the destination GUID.
+ @param SourceGuid Pointer to the source GUID.
- @return DestinationGuid
+ @return DestinationGuid.
**/
GUID *
EFIAPI
CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
+ OUT GUID *DestinationGuid,
+ IN CONST GUID *SourceGuid
)
{
WriteUnaligned64 (
@@ -57,27 +56,25 @@ CopyGuid ( }
/**
- Compares two GUIDs
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE
- is returned. If there are any bit differences in the two GUIDs, then FALSE is
- returned.
+ Compares two GUIDs.
+ This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
+ If there are any bit differences in the two GUIDs, then FALSE is returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
- @param Guid1 guid to compare
- @param Guid2 guid to compare
+ @param Guid1 A pointer to a 128 bit GUID.
+ @param Guid2 A pointer to a 128 bit GUID.
- @retval TRUE if Guid1 == Guid2
- @retval FALSE if Guid1 != Guid2
+ @retval TRUE Guid1 and Guid2 are identical.
+ @retval FALSE Guid1 and Guid2 are not identical.
**/
BOOLEAN
EFIAPI
CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
+ IN CONST GUID *Guid1,
+ IN CONST GUID *Guid2
)
{
return (BOOLEAN)(
@@ -93,28 +90,27 @@ CompareGuid ( in the target buffer.
This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the
- 128-bit GUID value that matches Guid. If a match is found, then a pointer to
- the matching GUID in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
+ the lowest address to the highest address at 128-bit increments for the 128-bit
+ GUID value that matches Guid. If a match is found, then a pointer to the matching
+ GUID in the target buffer is returned. If no match is found, 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 greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Guid Value to search for in the target buffer.
- @return Pointer to the first occurrence.
- @retval NULL if Length == 0 or Guid was not found.
+ @return A pointer to the matching Guid in the target buffer or NULL otherwise.
+
**/
VOID *
EFIAPI
ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN CONST GUID *Guid
)
{
CONST GUID *GuidPtr;
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c index d336d59..9ffc2cf 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem16 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c index 8de5594..6b0beee 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem32 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c index 228c864..589d45c 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem64 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c index 72a8078..4dc8bac 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c @@ -46,9 +46,9 @@ VOID *
EFIAPI
ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
@@ -57,5 +57,5 @@ ScanMem8 ( ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem8 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c index fd3720c..41467a9 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 16-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c index 77f1abd..4258406 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 32-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c index f95b97f..4a1eda8 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 64-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c index d0e8760..3965be7 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c @@ -41,9 +41,9 @@ VOID *
EFIAPI
SetMem (
- IN VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c index 4a3d615..56dbe5d 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c @@ -26,24 +26,23 @@ #include "MemLibInternals.h"
/**
- Set Buffer to 0 for Size bytes.
+ Fills a target buffer with zeros, and returns the target buffer.
This function fills Length bytes of Buffer with zeros, and returns Buffer.
+ If Length > 0 and Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Buffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ @param Buffer Pointer to the target buffer to fill with zeros.
+ @param Length Number of bytes in Buffer to fill with zeros.
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
ZeroMem (
- IN VOID *Buffer,
- IN UINTN Length
+ OUT VOID *Buffer,
+ IN UINTN Length
)
{
ASSERT (!(Buffer == NULL && Length > 0));
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/CompareMemWrapper.c index 6081bbe..e3b0fe3 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/CompareMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/CompareMemWrapper.c @@ -50,9 +50,9 @@ INTN
EFIAPI
CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ IN CONST VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/CopyMemWrapper.c index 5ca62f5..1fd00ac 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/CopyMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/CopyMemWrapper.c @@ -26,41 +26,37 @@ #include "MemLibInternals.h"
/**
- Copy Length bytes from Source to Destination.
+ Copies a source buffer to a destination buffer, and returns the destination buffer.
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and
- returns DestinationBuffer. The implementation must be reentrant, and it must
- handle the case where SourceBuffer overlaps DestinationBuffer.
+ This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
+ DestinationBuffer. The implementation must be reentrant, and it must handle the case
+ where SourceBuffer overlaps DestinationBuffer.
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
- ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
+ @param DestinationBuffer Pointer to the destination buffer of the memory copy.
+ @param SourceBuffer Pointer to the source buffer of the memory copy.
+ @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
+ @return DestinationBuffer.
**/
VOID *
EFIAPI
CopyMem (
- OUT VOID *Destination,
- IN CONST VOID *Source,
- IN UINTN Length
+ OUT VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
- ASSERT (
- Destination == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Destination + 1
- );
- ASSERT (
- Source == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Source + 1
- );
- if (Destination == Source || Length == 0) {
- return Destination;
+ if (Length == 0) {
+ return DestinationBuffer;
+ }
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
+
+ if (DestinationBuffer == SourceBuffer) {
+ return DestinationBuffer;
}
- return InternalMemCopyMem (Destination, Source, Length);
+ return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
}
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c index c54983c..351e370 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c @@ -24,25 +24,24 @@ **/
/**
- This function copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid
- to DestinationGuid, and returns DestinationGuid.
+ Copies a source GUID to a destination GUID.
+ This function copies the contents of the 128-bit GUID specified by SourceGuid to
+ DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
+ @param DestinationGuid Pointer to the destination GUID.
+ @param SourceGuid Pointer to the source GUID.
- @return DestinationGuid
+ @return DestinationGuid.
**/
GUID *
EFIAPI
CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
+ OUT GUID *DestinationGuid,
+ IN CONST GUID *SourceGuid
)
{
WriteUnaligned64 (
@@ -57,27 +56,25 @@ CopyGuid ( }
/**
- Compares two GUIDs
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE
- is returned. If there are any bit differences in the two GUIDs, then FALSE is
- returned.
+ Compares two GUIDs.
+ This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
+ If there are any bit differences in the two GUIDs, then FALSE is returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
- @param Guid1 guid to compare
- @param Guid2 guid to compare
+ @param Guid1 A pointer to a 128 bit GUID.
+ @param Guid2 A pointer to a 128 bit GUID.
- @retval TRUE if Guid1 == Guid2
- @retval FALSE if Guid1 != Guid2
+ @retval TRUE Guid1 and Guid2 are identical.
+ @retval FALSE Guid1 and Guid2 are not identical.
**/
BOOLEAN
EFIAPI
CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
+ IN CONST GUID *Guid1,
+ IN CONST GUID *Guid2
)
{
return (BOOLEAN)(
@@ -93,28 +90,27 @@ CompareGuid ( in the target buffer.
This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the
- 128-bit GUID value that matches Guid. If a match is found, then a pointer to
- the matching GUID in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
+ the lowest address to the highest address at 128-bit increments for the 128-bit
+ GUID value that matches Guid. If a match is found, then a pointer to the matching
+ GUID in the target buffer is returned. If no match is found, 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 greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Guid Value to search for in the target buffer.
- @return Pointer to the first occurrence.
- @retval NULL if Length == 0 or Guid was not found.
+ @return A pointer to the matching Guid in the target buffer or NULL otherwise.
+
**/
VOID *
EFIAPI
ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN CONST GUID *Guid
)
{
CONST GUID *GuidPtr;
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c index d336d59..9ffc2cf 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem16 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c index 8de5594..6b0beee 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem32 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c index 228c864..589d45c 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem64 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c index 72a8078..4dc8bac 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c @@ -46,9 +46,9 @@ VOID *
EFIAPI
ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
@@ -57,5 +57,5 @@ ScanMem8 ( ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem8 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/SetMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/SetMem16Wrapper.c index fd3720c..41467a9 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/SetMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/SetMem16Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 16-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/SetMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/SetMem32Wrapper.c index 77f1abd..4258406 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/SetMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/SetMem32Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 32-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/SetMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/SetMem64Wrapper.c index f95b97f..4a1eda8 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/SetMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/SetMem64Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 64-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c index d0e8760..3965be7 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c @@ -41,9 +41,9 @@ VOID *
EFIAPI
SetMem (
- IN VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c index 4a3d615..56dbe5d 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c @@ -26,24 +26,23 @@ #include "MemLibInternals.h"
/**
- Set Buffer to 0 for Size bytes.
+ Fills a target buffer with zeros, and returns the target buffer.
This function fills Length bytes of Buffer with zeros, and returns Buffer.
+ If Length > 0 and Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Buffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ @param Buffer Pointer to the target buffer to fill with zeros.
+ @param Length Number of bytes in Buffer to fill with zeros.
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
ZeroMem (
- IN VOID *Buffer,
- IN UINTN Length
+ OUT VOID *Buffer,
+ IN UINTN Length
)
{
ASSERT (!(Buffer == NULL && Length > 0));
diff --git a/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c index 6081bbe..e3b0fe3 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c @@ -50,9 +50,9 @@ INTN
EFIAPI
CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ IN CONST VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c index 5ca62f5..1fd00ac 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c @@ -26,41 +26,37 @@ #include "MemLibInternals.h"
/**
- Copy Length bytes from Source to Destination.
+ Copies a source buffer to a destination buffer, and returns the destination buffer.
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and
- returns DestinationBuffer. The implementation must be reentrant, and it must
- handle the case where SourceBuffer overlaps DestinationBuffer.
+ This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
+ DestinationBuffer. The implementation must be reentrant, and it must handle the case
+ where SourceBuffer overlaps DestinationBuffer.
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
- ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
+ @param DestinationBuffer Pointer to the destination buffer of the memory copy.
+ @param SourceBuffer Pointer to the source buffer of the memory copy.
+ @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
+ @return DestinationBuffer.
**/
VOID *
EFIAPI
CopyMem (
- OUT VOID *Destination,
- IN CONST VOID *Source,
- IN UINTN Length
+ OUT VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
- ASSERT (
- Destination == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Destination + 1
- );
- ASSERT (
- Source == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Source + 1
- );
- if (Destination == Source || Length == 0) {
- return Destination;
+ if (Length == 0) {
+ return DestinationBuffer;
+ }
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
+
+ if (DestinationBuffer == SourceBuffer) {
+ return DestinationBuffer;
}
- return InternalMemCopyMem (Destination, Source, Length);
+ return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
}
diff --git a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c index c54983c..351e370 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c @@ -24,25 +24,24 @@ **/
/**
- This function copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid
- to DestinationGuid, and returns DestinationGuid.
+ Copies a source GUID to a destination GUID.
+ This function copies the contents of the 128-bit GUID specified by SourceGuid to
+ DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
+ @param DestinationGuid Pointer to the destination GUID.
+ @param SourceGuid Pointer to the source GUID.
- @return DestinationGuid
+ @return DestinationGuid.
**/
GUID *
EFIAPI
CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
+ OUT GUID *DestinationGuid,
+ IN CONST GUID *SourceGuid
)
{
WriteUnaligned64 (
@@ -57,27 +56,25 @@ CopyGuid ( }
/**
- Compares two GUIDs
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE
- is returned. If there are any bit differences in the two GUIDs, then FALSE is
- returned.
+ Compares two GUIDs.
+ This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
+ If there are any bit differences in the two GUIDs, then FALSE is returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
- @param Guid1 guid to compare
- @param Guid2 guid to compare
+ @param Guid1 A pointer to a 128 bit GUID.
+ @param Guid2 A pointer to a 128 bit GUID.
- @retval TRUE if Guid1 == Guid2
- @retval FALSE if Guid1 != Guid2
+ @retval TRUE Guid1 and Guid2 are identical.
+ @retval FALSE Guid1 and Guid2 are not identical.
**/
BOOLEAN
EFIAPI
CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
+ IN CONST GUID *Guid1,
+ IN CONST GUID *Guid2
)
{
return (BOOLEAN)(
@@ -93,28 +90,27 @@ CompareGuid ( in the target buffer.
This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the
- 128-bit GUID value that matches Guid. If a match is found, then a pointer to
- the matching GUID in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
+ the lowest address to the highest address at 128-bit increments for the 128-bit
+ GUID value that matches Guid. If a match is found, then a pointer to the matching
+ GUID in the target buffer is returned. If no match is found, 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 greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Guid Value to search for in the target buffer.
- @return Pointer to the first occurrence.
- @retval NULL if Length == 0 or Guid was not found.
+ @return A pointer to the matching Guid in the target buffer or NULL otherwise.
+
**/
VOID *
EFIAPI
ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN CONST GUID *Guid
)
{
CONST GUID *GuidPtr;
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c index d336d59..9ffc2cf 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem16 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c index 8de5594..6b0beee 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem32 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c index 228c864..589d45c 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem64 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c index 72a8078..4dc8bac 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c @@ -46,9 +46,9 @@ VOID *
EFIAPI
ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
@@ -57,5 +57,5 @@ ScanMem8 ( ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem8 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
}
diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c index fd3720c..41467a9 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 16-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c index 77f1abd..4258406 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 32-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c index f95b97f..4a1eda8 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 64-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c index d0e8760..3965be7 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c @@ -41,9 +41,9 @@ VOID *
EFIAPI
SetMem (
- IN VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c index 4a3d615..56dbe5d 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c @@ -26,24 +26,23 @@ #include "MemLibInternals.h"
/**
- Set Buffer to 0 for Size bytes.
+ Fills a target buffer with zeros, and returns the target buffer.
This function fills Length bytes of Buffer with zeros, and returns Buffer.
+ If Length > 0 and Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Buffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ @param Buffer Pointer to the target buffer to fill with zeros.
+ @param Length Number of bytes in Buffer to fill with zeros.
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
ZeroMem (
- IN VOID *Buffer,
- IN UINTN Length
+ OUT VOID *Buffer,
+ IN UINTN Length
)
{
ASSERT (!(Buffer == NULL && Length > 0));
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c index 32a70c0..6b8adc1 100644 --- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c +++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c @@ -560,11 +560,11 @@ PeCoffLoaderRelocateImage ( //
RelocDir = &TeHdr->DataDirectory[0];
RelocBase = (EFI_IMAGE_BASE_RELOCATION *)(UINTN)(
- ImageContext->ImageAddress +
- RelocDir->VirtualAddress +
- sizeof(EFI_TE_IMAGE_HEADER) -
- TeHdr->StrippedSize
- );
+ ImageContext->ImageAddress +
+ RelocDir->VirtualAddress +
+ sizeof(EFI_TE_IMAGE_HEADER) -
+ TeHdr->StrippedSize
+ );
RelocBaseEnd = (EFI_IMAGE_BASE_RELOCATION *) ((UINTN) RelocBase + (UINTN) RelocDir->Size - 1);
}
@@ -580,10 +580,10 @@ PeCoffLoaderRelocateImage ( FixupBase = PeCoffLoaderImageAddress (ImageContext, RelocBase->VirtualAddress);
} else {
FixupBase = (CHAR8 *)(UINTN)(ImageContext->ImageAddress +
- RelocBase->VirtualAddress +
- sizeof(EFI_TE_IMAGE_HEADER) -
- TeHdr->StrippedSize
- );
+ RelocBase->VirtualAddress +
+ sizeof(EFI_TE_IMAGE_HEADER) -
+ TeHdr->StrippedSize
+ );
}
if ((CHAR8 *) RelocEnd < (CHAR8 *) ((UINTN) ImageContext->ImageAddress) ||
@@ -808,9 +808,9 @@ PeCoffLoaderLoadImage ( TeHdr = (EFI_TE_IMAGE_HEADER *) (UINTN) (ImageContext->ImageAddress);
FirstSection = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN)ImageContext->ImageAddress +
- sizeof(EFI_TE_IMAGE_HEADER)
- );
+ (UINTN)ImageContext->ImageAddress +
+ sizeof(EFI_TE_IMAGE_HEADER)
+ );
NumberOfSections = (UINTN) (TeHdr->NumberOfSections);
}
@@ -905,9 +905,9 @@ PeCoffLoaderLoadImage ( );
} else {
ImageContext->EntryPoint = (PHYSICAL_ADDRESS) (
- (UINTN)ImageContext->ImageAddress +
- (UINTN)TeHdr->AddressOfEntryPoint +
- (UINTN)sizeof(EFI_TE_IMAGE_HEADER) -
+ (UINTN)ImageContext->ImageAddress +
+ (UINTN)TeHdr->AddressOfEntryPoint +
+ (UINTN)sizeof(EFI_TE_IMAGE_HEADER) -
(UINTN) TeHdr->StrippedSize
);
}
@@ -948,11 +948,11 @@ PeCoffLoaderLoadImage ( );
} else {
DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)(UINTN)(
- ImageContext->ImageAddress +
- ImageContext->DebugDirectoryEntryRva +
- sizeof(EFI_TE_IMAGE_HEADER) -
- TeHdr->StrippedSize
- );
+ ImageContext->ImageAddress +
+ ImageContext->DebugDirectoryEntryRva +
+ sizeof(EFI_TE_IMAGE_HEADER) -
+ TeHdr->StrippedSize
+ );
}
if (DebugEntry != NULL) {
@@ -971,9 +971,9 @@ PeCoffLoaderLoadImage ( ImageContext->CodeView = PeCoffLoaderImageAddress (ImageContext, TempDebugEntryRva);
} else {
ImageContext->CodeView = (VOID *)(
- (UINTN)ImageContext->ImageAddress +
- (UINTN)TempDebugEntryRva +
- (UINTN)sizeof(EFI_TE_IMAGE_HEADER) -
+ (UINTN)ImageContext->ImageAddress +
+ (UINTN)TempDebugEntryRva +
+ (UINTN)sizeof(EFI_TE_IMAGE_HEADER) -
(UINTN) TeHdr->StrippedSize
);
}
diff --git a/MdePkg/Library/BasePerformanceLibNull/PerformanceLib.c b/MdePkg/Library/BasePerformanceLibNull/PerformanceLib.c index ec88d84..406acb5 100644 --- a/MdePkg/Library/BasePerformanceLibNull/PerformanceLib.c +++ b/MdePkg/Library/BasePerformanceLibNull/PerformanceLib.c @@ -22,16 +22,16 @@ If TimeStamp is zero, then this function reads the current time stamp
and adds that time stamp value to the record as the start time.
- @param Handle Pointer to environment specific context used
+ @param Handle Pointer to environment specific context used
to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
+ @param Token Pointer to a Null-terminated ASCII string
that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
+ @param Module Pointer to a Null-terminated ASCII string
that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
+ @param TimeStamp 64-bit time stamp.
@retval RETURN_SUCCESS The start of the measurement was recorded.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.
+ @retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.
**/
RETURN_STATUS
@@ -57,16 +57,16 @@ StartPerformanceMeasurement ( the current time stamp and adds that time stamp value to the record as the end time.
If this function is called multiple times for the same record, then the end time is overwritten.
- @param Handle Pointer to environment specific context used
+ @param Handle Pointer to environment specific context used
to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
+ @param Token Pointer to a Null-terminated ASCII string
that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
+ @param Module Pointer to a Null-terminated ASCII string
that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
+ @param TimeStamp 64-bit time stamp.
@retval RETURN_SUCCESS The end of the measurement was recorded.
- @retval RETURN_NOT_FOUND The specified measurement record could not be found.
+ @retval RETURN_NOT_FOUND The specified measurement record could not be found.
**/
RETURN_STATUS
@@ -146,7 +146,7 @@ GetPerformanceMeasurement ( @retval TRUE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
PcdPerformanceLibraryPropertyMask is set.
- @retval FALSE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
+ @retval FALSE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
PcdPerformanceLibraryPropertyMask is clear.
**/
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c index 0a8c22e..bbafeea 100644 --- a/MdePkg/Library/BasePrintLib/PrintLib.c +++ b/MdePkg/Library/BasePrintLib/PrintLib.c @@ -946,7 +946,7 @@ AsciiSPrintUnicodeFormat ( Unicode string.
@param Flags The bitmask of flags that specify left justification, zero pad, and commas.
@param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of Unicode characters to place in Buffer.
+ @param Width The maximum number of Unicode characters to place in Buffer.
@return Total number of characters required to perform the conversion.
@@ -993,7 +993,7 @@ UnicodeValueToString ( ASCII string.
@param Flags The bitmask of flags that specify left justification, zero pad, and commas.
@param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of ASCII characters to place in Buffer.
+ @param Width The maximum number of ASCII characters to place in Buffer.
@return Total number of characters required to perform the conversion.
diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c b/MdePkg/Library/BasePrintLib/PrintLibInternal.c index 06c2206..9314b60 100644 --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c @@ -117,7 +117,7 @@ BasePrintLibValueToString ( @param Flags The bitmask of flags that specify left justification, zero pad,
and commas.
@param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of characters to place in Buffer.
+ @param Width The maximum number of characters to place in Buffer.
@param Increment Character increment in Buffer.
@return Total number of characters required to perform the conversion.
diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.h b/MdePkg/Library/BasePrintLib/PrintLibInternal.h index f395bb7..5e650b0 100644 --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.h +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.h @@ -148,7 +148,7 @@ BasePrintLibValueToString ( @param Flags The bitmask of flags that specify left justification, zero pad,
and commas.
@param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of characters to place in Buffer.
+ @param Width The maximum number of characters to place in Buffer.
@param Increment Character increment in Buffer.
@return Total number of characters required to perform the conversion.
diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.c b/MdePkg/Library/DxePcdLib/DxePcdLib.c index ee51771..fe7ae42 100644 --- a/MdePkg/Library/DxePcdLib/DxePcdLib.c +++ b/MdePkg/Library/DxePcdLib/DxePcdLib.c @@ -20,7 +20,7 @@ static PCD_PROTOCOL *mPcd; /**
The constructor function caches the PCD_PROTOCOL pointer.
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The constructor always return EFI_SUCCESS.
diff --git a/MdePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c new file mode 100644 index 0000000..b06a756 --- /dev/null +++ b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c @@ -0,0 +1,283 @@ +/** @file
+ Debug Library that fowards all messages to ReportStatusCode()
+
+ Copyright (c) 2006, Intel Corporation<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+/**
+
+ Prints a debug message to the debug output device if the specified error level is enabled.
+
+ If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print
+ the message specified by Format and the associated variable argument list to
+ the debug output device.
+
+ If Format is NULL, then ASSERT().
+
+ @param ErrorLevel The error level of the debug message.
+ @param Format Format string for the debug message to print.
+
+**/
+VOID
+EFIAPI
+DebugPrint (
+ IN UINTN ErrorLevel,
+ IN CONST CHAR8 *Format,
+ ...
+ )
+{
+ UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];
+ EFI_DEBUG_INFO *DebugInfo;
+ UINTN TotalSize;
+ UINTN Index;
+ VA_LIST Marker;
+ UINT64 *ArgumentPointer;
+
+ //
+ // If Format is NULL, then ASSERT().
+ //
+ ASSERT (Format != NULL);
+
+ //
+ // Check driver Debug Level value and global debug level
+ //
+ if ((ErrorLevel & PcdGet32(PcdDebugPrintErrorLevel)) == 0) {
+ return;
+ }
+
+ TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrLen (Format) + 1;
+ if (TotalSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {
+ return;
+ }
+
+ //
+ // Then EFI_DEBUG_INFO
+ //
+ DebugInfo = (EFI_DEBUG_INFO *)Buffer;
+ DebugInfo->ErrorLevel = (UINT32)ErrorLevel;
+
+ //
+ // 256 byte mini Var Arg stack. That is followed by the format string.
+ //
+ VA_START (Marker, Format);
+ for (Index = 0, ArgumentPointer = (UINT64 *)(DebugInfo + 1); Index < 12; Index++, ArgumentPointer++) {
+ *ArgumentPointer = VA_ARG (Marker, UINT64);
+ }
+ VA_END (Marker);
+ AsciiStrCpy ((CHAR8 *)ArgumentPointer, Format);
+
+ //
+ //
+ //
+ REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
+ EFI_DEBUG_CODE,
+ (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),
+ DebugInfo,
+ TotalSize
+ );
+}
+
+
+/**
+
+ Prints an assert message containing a filename, line number, and description.
+ This may be followed by a breakpoint or a dead loop.
+
+ Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"
+ to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
+ PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
+ DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
+ CpuDeadLoop() is called. If neither of these bits are set, then this function
+ returns immediately after the message is printed to the debug output device.
+ DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
+ processing another DebugAssert(), then DebugAssert() must return immediately.
+
+ If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.
+
+ If Description is NULL, then a <Description> string of "(NULL) Description" is printed.
+
+ @param FileName Pointer to the name of the source file that generated the assert condition.
+ @param LineNumber The line number in the source file that generated the assert condition
+ @param Description Pointer to the description of the assert condition.
+
+**/
+VOID
+EFIAPI
+DebugAssert (
+ IN CONST CHAR8 *FileName,
+ IN UINTN LineNumber,
+ IN CONST CHAR8 *Description
+ )
+{
+ UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof(UINT64)];
+ EFI_DEBUG_ASSERT_DATA *AssertData;
+ UINTN TotalSize;
+ CHAR8 *Temp;
+
+ //
+ // Make sure it will all fit in the passed in buffer
+ //
+ TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA) + AsciiStrLen (FileName) + 1 + AsciiStrLen (Description) + 1;
+ if (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE) {
+ //
+ // Fill in EFI_DEBUG_ASSERT_DATA
+ //
+ AssertData = (EFI_DEBUG_ASSERT_DATA *)Buffer;
+ AssertData->LineNumber = (UINT32)LineNumber;
+
+ //
+ // Copy Ascii FileName including NULL.
+ //
+ Temp = AsciiStrCpy ((CHAR8 *)(AssertData + 1), FileName);
+
+ //
+ // Copy Ascii Description
+ //
+ AsciiStrCpy (Temp + AsciiStrLen(FileName) + 1, Description);
+
+ REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
+ (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),
+ (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),
+ AssertData,
+ TotalSize
+ );
+ }
+
+ //
+ // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
+ //
+ if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
+ CpuBreakpoint ();
+ } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
+ CpuDeadLoop ();
+ }
+}
+
+
+/**
+
+ Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
+
+ This function fills Length bytes of Buffer with the value specified by
+ PcdDebugClearMemoryValue, and returns Buffer.
+
+ If Buffer is NULL, then ASSERT().
+
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
+
+ @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
+ @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
+
+ @return Buffer
+
+**/
+VOID *
+EFIAPI
+DebugClearMemory (
+ OUT VOID *Buffer,
+ IN UINTN Length
+ )
+{
+ //
+ // If Buffer is NULL, then ASSERT().
+ //
+ ASSERT (Buffer != NULL);
+
+ //
+ // SetMem() checks for the the ASSERT() condition on Length and returns Buffer
+ //
+ return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
+}
+
+
+/**
+
+ Returns TRUE if ASSERT() macros are enabled.
+
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
+ PcdDebugProperyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
+ @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugAssertEnabled (
+ VOID
+ )
+{
+ return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
+}
+
+
+/**
+
+ Returns TRUE if DEBUG()macros are enabled.
+
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
+ PcdDebugProperyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
+ @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugPrintEnabled (
+ VOID
+ )
+{
+ return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
+}
+
+
+/**
+
+ Returns TRUE if DEBUG_CODE()macros are enabled.
+
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
+ PcdDebugProperyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
+ @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugCodeEnabled (
+ VOID
+ )
+{
+ return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
+}
+
+
+/**
+
+ Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.
+
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of
+ PcdDebugProperyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
+ @retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugClearMemoryEnabled (
+ VOID
+ )
+{
+ return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
+}
diff --git a/MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.mbd b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.mbd new file mode 100644 index 0000000..b8ee6a4 --- /dev/null +++ b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.mbd @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<LibraryModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+ <MbdLibHeader>
+ <BaseName>PeiDxeDebugLibReportStatusCode</BaseName>
+ <Guid>bda39d3a-451b-4350-8266-81ab10fa0523</Guid>
+ <Version>0</Version>
+ <Description>FIX ME!</Description>
+ <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+ <License>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ </License>
+ <Created>2006-03-09 23:16</Created>
+ <Modified>2006-03-19 15:17</Modified>
+ </MbdLibHeader>
+</LibraryModuleBuildDescription>
diff --git a/MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.msa b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.msa new file mode 100644 index 0000000..a9a965f --- /dev/null +++ b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.msa @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<LibraryModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+ <MsaLibHeader>
+ <BaseName>PeiDxeDebugLibReportStatusCode</BaseName>
+ <ModuleType>PEIM</ModuleType>
+ <ComponentType>LIBRARY</ComponentType>
+ <Guid>bda39d3a-451b-4350-8266-81ab10fa0523</Guid>
+ <Version>0</Version>
+ <Abstract>Debug Library for PEIMs that send debug messages to ReportStatusCode</Abstract>
+ <Description>FIX ME!</Description>
+ <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+ <License>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ </License>
+ <Created>2006-03-09 23:16</Created>
+ <Updated>2006-03-19 15:17</Updated>
+ <Specification>0</Specification>
+ </MsaLibHeader>
+ <LibraryClassDefinitions>
+ <LibraryClass Usage="ALWAYS_PRODUCED">DebugLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">BaseMemoryLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">ReportStatusCodeLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PcdLib</LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>DebugLib.c</Filename>
+ </SourceFiles>
+ <Includes>
+ <PackageName>MdePkg</PackageName>
+ </Includes>
+ <PcdCoded>
+ <PcdEntry PcdItemType="FIXED_AT_BUILD">
+ <C_Name>PcdDebugPropertyMask</C_Name>
+ </PcdEntry>
+ <PcdEntry PcdItemType="FIXED_AT_BUILD">
+ <C_Name>PcdDebugClearMemoryValue</C_Name>
+ </PcdEntry>
+ <PcdEntry PcdItemType="PATCHABLE_IN_MODULE">
+ <C_Name>PcdDebugPrintErrorLevel</C_Name>
+ </PcdEntry>
+ </PcdCoded>
+</LibraryModuleSurfaceArea>
diff --git a/MdePkg/Library/PeiDxeDebugLibReportStatusCode/build.xml b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/build.xml new file mode 100644 index 0000000..348a447 --- /dev/null +++ b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/build.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
+<project basedir="." default="PeiDxeDebugLibReportStatusCode"><!--Apply external ANT tasks-->
+ <taskdef resource="GenBuild.tasks"/>
+ <taskdef resource="net/sf/antcontrib/antlib.xml"/>
+ <property environment="env"/>
+ <property name="WORKSPACE_DIR" value="${env.WORKSPACE}"/>
+ <import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml"/><!--MODULE_RELATIVE PATH is relative to PACKAGE_DIR-->
+ <property name="MODULE_RELATIVE_PATH" value="Library/PeiDxeDebugLibReportStatusCode"/>
+ <property name="MODULE_DIR" value="${PACKAGE_DIR}/${MODULE_RELATIVE_PATH}"/>
+ <property name="COMMON_FILE" value="${WORKSPACE_DIR}/Tools/Conf/Common.xml"/>
+ <target name="PeiDxeDebugLibReportStatusCode">
+ <GenBuild baseName="PeiDxeDebugLibReportStatusCode" mbdFilename="${MODULE_DIR}/PeiDxeDebugLibReportStatusCode.mbd" msaFilename="${MODULE_DIR}/PeiDxeDebugLibReportStatusCode.msa"/>
+ </target>
+ <target depends="PeiDxeDebugLibReportStatusCode_clean" name="clean"/>
+ <target depends="PeiDxeDebugLibReportStatusCode_cleanall" name="cleanall"/>
+ <target name="PeiDxeDebugLibReportStatusCode_clean">
+ <OutputDirSetup baseName="PeiDxeDebugLibReportStatusCode" mbdFilename="${MODULE_DIR}/PeiDxeDebugLibReportStatusCode.mbd" msaFilename="${MODULE_DIR}/PeiDxeDebugLibReportStatusCode.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}/PeiDxeDebugLibReportStatusCode_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}/PeiDxeDebugLibReportStatusCode_build.xml" target="clean"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
+ </target>
+ <target name="PeiDxeDebugLibReportStatusCode_cleanall">
+ <OutputDirSetup baseName="PeiDxeDebugLibReportStatusCode" mbdFilename="${MODULE_DIR}/PeiDxeDebugLibReportStatusCode.mbd" msaFilename="${MODULE_DIR}/PeiDxeDebugLibReportStatusCode.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}/PeiDxeDebugLibReportStatusCode_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}/PeiDxeDebugLibReportStatusCode_build.xml" target="cleanall"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}"/>
+ <delete dir="${DEST_DIR_DEBUG}"/>
+ <delete>
+ <fileset dir="${BIN_DIR}" includes="**PeiDxeDebugLibReportStatusCode*"/>
+ </delete>
+ </target>
+</project>
\ No newline at end of file diff --git a/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.mbd b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.mbd new file mode 100644 index 0000000..ec8007d --- /dev/null +++ b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.mbd @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<LibraryModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+ <MbdLibHeader>
+ <BaseName>PeiDxePostCodeLibReportStatusCode</BaseName>
+ <Guid>55c61087-7367-4546-bc32-4937c5e6aff3</Guid>
+ <Version>0</Version>
+ <Description>FIX ME!</Description>
+ <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+ <License>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ </License>
+ <Created>2006-03-09 23:16</Created>
+ <Modified>2006-03-19 15:17</Modified>
+ </MbdLibHeader>
+</LibraryModuleBuildDescription>
diff --git a/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.msa b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.msa new file mode 100644 index 0000000..6f3e0ae --- /dev/null +++ b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.msa @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<LibraryModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+ <MsaLibHeader>
+ <BaseName>PeiDxePostCodeLibReportStatusCode</BaseName>
+ <ModuleType>PEIM</ModuleType>
+ <ComponentType>LIBRARY</ComponentType>
+ <Guid>55c61087-7367-4546-bc32-4937c5e6aff3</Guid>
+ <Version>0</Version>
+ <Abstract>Component description file for the entry point to a EFIDXE Drivers</Abstract>
+ <Description>FIX ME!</Description>
+ <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+ <License>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ </License>
+ <Created>2006-03-09 23:16</Created>
+ <Updated>2006-03-19 15:17</Updated>
+ <Specification>0</Specification>
+ </MsaLibHeader>
+ <LibraryClassDefinitions>
+ <LibraryClass Usage="ALWAYS_PRODUCED">PostCodeLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">ReportStatusCodeLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PcdLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>PostCode.c</Filename>
+ </SourceFiles>
+ <Includes>
+ <PackageName>MdePkg</PackageName>
+ </Includes>
+ <PcdCoded>
+ <PcdEntry PcdItemType="FIXED_AT_BUILD">
+ <C_Name>PcdPostCodePropertyMask</C_Name>
+ </PcdEntry>
+ </PcdCoded>
+</LibraryModuleSurfaceArea>
diff --git a/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c new file mode 100644 index 0000000..c57489d --- /dev/null +++ b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c @@ -0,0 +1,150 @@ +/** @file
+ Report Status Code Library Post Code functions for DXE Phase.
+
+ Copyright (c) 2006, Intel Corporation<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+/**
+ Converts POST code value to status code value.
+
+ This macro converts the post code to status code value. Bits 0..4 of PostCode
+ are mapped to bits 16..20 of status code value, and bits 5..7 of PostCode are mapped to bits
+ 24..26 of status code value.
+
+ @param PostCode POST code value.
+
+ @return The converted status code value.
+
+**/
+#define POST_CODE_TO_STATUS_CODE_VALUE(PostCode) \
+ ((EFI_STATUS_CODE_VALUE) (((PostCode & 0x1f) << 16) | ((PostCode & 0x3) << 19)))
+
+/**
+ Sends an 32-bit value to a POST card.
+
+ Sends the 32-bit value specified by Value to a POST card, and returns Value.
+ Some implementations of this library function may perform I/O operations
+ directly to a POST card device. Other implementations may send Value to
+ ReportStatusCode(), and the status code reporting mechanism will eventually
+ display the 32-bit value on the status reporting device.
+
+ PostCode() must actively prevent recursion. If PostCode() is called while
+ processing another any other Report Status Code Library function, then
+ PostCode() must return Value immediately.
+
+ @param Value The 32-bit value to write to the POST card.
+
+ @return Value
+
+**/
+UINT32
+EFIAPI
+PostCode (
+ IN UINT32 Value
+ )
+{
+ REPORT_STATUS_CODE (EFI_PROGRESS_CODE, POST_CODE_TO_STATUS_CODE_VALUE (Value));
+ return Value;
+}
+
+
+/**
+ Sends an 32-bit value to a POST and associated ASCII string.
+
+ Sends the 32-bit value specified by Value to a POST card, and returns Value.
+ If Description is not NULL, then the ASCII string specified by Description is
+ also passed to the handler that displays the POST card value. Some
+ implementations of this library function may perform I/O operations directly
+ to a POST card device. Other implementations may send Value to ReportStatusCode(),
+ and the status code reporting mechanism will eventually display the 32-bit
+ value on the status reporting device.
+
+ PostCodeWithDescription()must actively prevent recursion. If
+ PostCodeWithDescription() is called while processing another any other Report
+ Status Code Library function, then PostCodeWithDescription() must return Value
+ immediately.
+
+ @param Value The 32-bit value to write to the POST card.
+ @param Description Pointer to an ASCII string that is a description of the
+ POST code value. This is an optional parameter that may
+ be NULL.
+
+ @return Value
+
+**/
+UINT32
+EFIAPI
+PostCodeWithDescription (
+ IN UINT32 Value,
+ IN CONST CHAR8 *Description OPTIONAL
+ )
+{
+ if (Description == NULL) {
+ REPORT_STATUS_CODE (
+ EFI_PROGRESS_CODE,
+ POST_CODE_TO_STATUS_CODE_VALUE (Value)
+ );
+ } else {
+ REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
+ EFI_PROGRESS_CODE,
+ POST_CODE_TO_STATUS_CODE_VALUE (Value),
+ Description,
+ AsciiStrSize (Description)
+ );
+ }
+
+ return Value;
+}
+
+
+/**
+ Returns TRUE if POST Codes are enabled.
+
+ This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
+ bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
+ PcdPostCodeProperyMask is set.
+ @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
+ PcdPostCodeProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+PostCodeEnabled (
+ VOID
+ )
+{
+ return ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
+}
+
+
+/**
+ Returns TRUE if POST code descriptions are enabled.
+
+ This function returns TRUE if the
+ POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
+ PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED
+ bit of PcdPostCodeProperyMask is set.
+ @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED
+ bit of PcdPostCodeProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+PostCodeDescriptionEnabled (
+ VOID
+ )
+{
+ return ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
+}
diff --git a/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/build.xml b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/build.xml new file mode 100644 index 0000000..3303727 --- /dev/null +++ b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/build.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
+<project basedir="." default="PeiDxePostCodeLibReportStatusCode"><!--Apply external ANT tasks-->
+ <taskdef resource="GenBuild.tasks"/>
+ <taskdef resource="net/sf/antcontrib/antlib.xml"/>
+ <property environment="env"/>
+ <property name="WORKSPACE_DIR" value="${env.WORKSPACE}"/>
+ <import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml"/><!--MODULE_RELATIVE PATH is relative to PACKAGE_DIR-->
+ <property name="MODULE_RELATIVE_PATH" value="Library/PeiDxePostCodeLibReportStatusCode"/>
+ <property name="MODULE_DIR" value="${PACKAGE_DIR}/${MODULE_RELATIVE_PATH}"/>
+ <property name="COMMON_FILE" value="${WORKSPACE_DIR}/Tools/Conf/Common.xml"/>
+ <target name="PeiDxePostCodeLibReportStatusCode">
+ <GenBuild baseName="PeiDxePostCodeLibReportStatusCode" mbdFilename="${MODULE_DIR}/PeiDxePostCodeLibReportStatusCode.mbd" msaFilename="${MODULE_DIR}/PeiDxePostCodeLibReportStatusCode.msa"/>
+ </target>
+ <target depends="PeiDxePostCodeLibReportStatusCode_clean" name="clean"/>
+ <target depends="PeiDxePostCodeLibReportStatusCode_cleanall" name="cleanall"/>
+ <target name="PeiDxePostCodeLibReportStatusCode_clean">
+ <OutputDirSetup baseName="PeiDxePostCodeLibReportStatusCode" mbdFilename="${MODULE_DIR}/PeiDxePostCodeLibReportStatusCode.mbd" msaFilename="${MODULE_DIR}/PeiDxePostCodeLibReportStatusCode.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}/PeiDxePostCodeLibReportStatusCode_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}/PeiDxePostCodeLibReportStatusCode_build.xml" target="clean"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
+ </target>
+ <target name="PeiDxePostCodeLibReportStatusCode_cleanall">
+ <OutputDirSetup baseName="PeiDxePostCodeLibReportStatusCode" mbdFilename="${MODULE_DIR}/PeiDxePostCodeLibReportStatusCode.mbd" msaFilename="${MODULE_DIR}/PeiDxePostCodeLibReportStatusCode.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}/PeiDxePostCodeLibReportStatusCode_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}/PeiDxePostCodeLibReportStatusCode_build.xml" target="cleanall"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}"/>
+ <delete dir="${DEST_DIR_DEBUG}"/>
+ <delete>
+ <fileset dir="${BIN_DIR}" includes="**PeiDxePostCodeLibReportStatusCode*"/>
+ </delete>
+ </target>
+</project>
\ No newline at end of file diff --git a/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c b/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c index 6081bbe..e3b0fe3 100644 --- a/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c +++ b/MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c @@ -50,9 +50,9 @@ INTN
EFIAPI
CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ IN CONST VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/PeiMemoryLib/CopyMemWrapper.c b/MdePkg/Library/PeiMemoryLib/CopyMemWrapper.c index 5ca62f5..1fd00ac 100644 --- a/MdePkg/Library/PeiMemoryLib/CopyMemWrapper.c +++ b/MdePkg/Library/PeiMemoryLib/CopyMemWrapper.c @@ -26,41 +26,37 @@ #include "MemLibInternals.h"
/**
- Copy Length bytes from Source to Destination.
+ Copies a source buffer to a destination buffer, and returns the destination buffer.
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and
- returns DestinationBuffer. The implementation must be reentrant, and it must
- handle the case where SourceBuffer overlaps DestinationBuffer.
+ This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
+ DestinationBuffer. The implementation must be reentrant, and it must handle the case
+ where SourceBuffer overlaps DestinationBuffer.
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
- ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
+ @param DestinationBuffer Pointer to the destination buffer of the memory copy.
+ @param SourceBuffer Pointer to the source buffer of the memory copy.
+ @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
+ @return DestinationBuffer.
**/
VOID *
EFIAPI
CopyMem (
- OUT VOID *Destination,
- IN CONST VOID *Source,
- IN UINTN Length
+ OUT VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
- ASSERT (
- Destination == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Destination + 1
- );
- ASSERT (
- Source == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Source + 1
- );
- if (Destination == Source || Length == 0) {
- return Destination;
+ if (Length == 0) {
+ return DestinationBuffer;
+ }
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
+
+ if (DestinationBuffer == SourceBuffer) {
+ return DestinationBuffer;
}
- return InternalMemCopyMem (Destination, Source, Length);
+ return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
}
diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c b/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c index 53c4e44..3fecfc9 100644 --- a/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c +++ b/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c @@ -161,7 +161,6 @@ InternalMemScanMem8 ( {
CONST UINT8 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT8*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -192,7 +191,6 @@ InternalMemScanMem16 ( {
CONST UINT16 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT16*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -223,7 +221,6 @@ InternalMemScanMem32 ( {
CONST UINT32 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT32*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -254,7 +251,6 @@ InternalMemScanMem64 ( {
CONST UINT64 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT64*)Buffer;
do {
if (*(Pointer++) == Value) {
diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c index c54983c..351e370 100644 --- a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c @@ -24,25 +24,24 @@ **/
/**
- This function copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid
- to DestinationGuid, and returns DestinationGuid.
+ Copies a source GUID to a destination GUID.
+ This function copies the contents of the 128-bit GUID specified by SourceGuid to
+ DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
+ @param DestinationGuid Pointer to the destination GUID.
+ @param SourceGuid Pointer to the source GUID.
- @return DestinationGuid
+ @return DestinationGuid.
**/
GUID *
EFIAPI
CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
+ OUT GUID *DestinationGuid,
+ IN CONST GUID *SourceGuid
)
{
WriteUnaligned64 (
@@ -57,27 +56,25 @@ CopyGuid ( }
/**
- Compares two GUIDs
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE
- is returned. If there are any bit differences in the two GUIDs, then FALSE is
- returned.
+ Compares two GUIDs.
+ This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
+ If there are any bit differences in the two GUIDs, then FALSE is returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
- @param Guid1 guid to compare
- @param Guid2 guid to compare
+ @param Guid1 A pointer to a 128 bit GUID.
+ @param Guid2 A pointer to a 128 bit GUID.
- @retval TRUE if Guid1 == Guid2
- @retval FALSE if Guid1 != Guid2
+ @retval TRUE Guid1 and Guid2 are identical.
+ @retval FALSE Guid1 and Guid2 are not identical.
**/
BOOLEAN
EFIAPI
CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
+ IN CONST GUID *Guid1,
+ IN CONST GUID *Guid2
)
{
return (BOOLEAN)(
@@ -93,28 +90,27 @@ CompareGuid ( in the target buffer.
This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the
- 128-bit GUID value that matches Guid. If a match is found, then a pointer to
- the matching GUID in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
+ the lowest address to the highest address at 128-bit increments for the 128-bit
+ GUID value that matches Guid. If a match is found, then a pointer to the matching
+ GUID in the target buffer is returned. If no match is found, 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 greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Guid Value to search for in the target buffer.
- @return Pointer to the first occurrence.
- @retval NULL if Length == 0 or Guid was not found.
+ @return A pointer to the matching Guid in the target buffer or NULL otherwise.
+
**/
VOID *
EFIAPI
ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN CONST GUID *Guid
)
{
CONST GUID *GuidPtr;
diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c index d336d59..9ffc2cf 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem16 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c index 8de5594..6b0beee 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem32 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c index 228c864..589d45c 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem64 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c index 72a8078..4dc8bac 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c @@ -46,9 +46,9 @@ VOID *
EFIAPI
ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
@@ -57,5 +57,5 @@ ScanMem8 ( ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem8 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
}
diff --git a/MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c b/MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c index fd3720c..41467a9 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 16-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c b/MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c index 77f1abd..4258406 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 32-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c b/MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c index f95b97f..4a1eda8 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 64-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c b/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c index d0e8760..3965be7 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c @@ -41,9 +41,9 @@ VOID *
EFIAPI
SetMem (
- IN VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c b/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c index 4a3d615..56dbe5d 100644 --- a/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c @@ -26,24 +26,23 @@ #include "MemLibInternals.h"
/**
- Set Buffer to 0 for Size bytes.
+ Fills a target buffer with zeros, and returns the target buffer.
This function fills Length bytes of Buffer with zeros, and returns Buffer.
+ If Length > 0 and Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Buffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ @param Buffer Pointer to the target buffer to fill with zeros.
+ @param Length Number of bytes in Buffer to fill with zeros.
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
ZeroMem (
- IN VOID *Buffer,
- IN UINTN Length
+ OUT VOID *Buffer,
+ IN UINTN Length
)
{
ASSERT (!(Buffer == NULL && Length > 0));
diff --git a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c index ef16064..2f666a6 100644 --- a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c +++ b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c @@ -54,7 +54,7 @@ PeiServicesInstallPpi ( **/
EFI_STATUS
EFIAPI
-PeiServicesReinstallPpi (
+PeiServicesReInstallPpi (
IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
)
diff --git a/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c b/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c index 6081bbe..e3b0fe3 100644 --- a/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c +++ b/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c @@ -50,9 +50,9 @@ INTN
EFIAPI
CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ IN CONST VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/UefiMemoryLib/CopyMemWrapper.c b/MdePkg/Library/UefiMemoryLib/CopyMemWrapper.c index 5ca62f5..1fd00ac 100644 --- a/MdePkg/Library/UefiMemoryLib/CopyMemWrapper.c +++ b/MdePkg/Library/UefiMemoryLib/CopyMemWrapper.c @@ -26,41 +26,37 @@ #include "MemLibInternals.h"
/**
- Copy Length bytes from Source to Destination.
+ Copies a source buffer to a destination buffer, and returns the destination buffer.
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and
- returns DestinationBuffer. The implementation must be reentrant, and it must
- handle the case where SourceBuffer overlaps DestinationBuffer.
+ This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
+ DestinationBuffer. The implementation must be reentrant, and it must handle the case
+ where SourceBuffer overlaps DestinationBuffer.
+ If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
- ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
+ @param DestinationBuffer Pointer to the destination buffer of the memory copy.
+ @param SourceBuffer Pointer to the source buffer of the memory copy.
+ @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
+ @return DestinationBuffer.
**/
VOID *
EFIAPI
CopyMem (
- OUT VOID *Destination,
- IN CONST VOID *Source,
- IN UINTN Length
+ OUT VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
- ASSERT (
- Destination == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Destination + 1
- );
- ASSERT (
- Source == NULL ||
- Length <= MAX_ADDRESS - (UINTN)Source + 1
- );
- if (Destination == Source || Length == 0) {
- return Destination;
+ if (Length == 0) {
+ return DestinationBuffer;
+ }
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
+ ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
+
+ if (DestinationBuffer == SourceBuffer) {
+ return DestinationBuffer;
}
- return InternalMemCopyMem (Destination, Source, Length);
+ return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
}
diff --git a/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c b/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c index 53c4e44..3fecfc9 100644 --- a/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c +++ b/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c @@ -161,7 +161,6 @@ InternalMemScanMem8 ( {
CONST UINT8 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT8*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -192,7 +191,6 @@ InternalMemScanMem16 ( {
CONST UINT16 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT16*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -223,7 +221,6 @@ InternalMemScanMem32 ( {
CONST UINT32 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT32*)Buffer;
do {
if (*(Pointer++) == Value) {
@@ -254,7 +251,6 @@ InternalMemScanMem64 ( {
CONST UINT64 *Pointer;
- ASSERT (Length > 0);
Pointer = (CONST UINT64*)Buffer;
do {
if (*(Pointer++) == Value) {
diff --git a/MdePkg/Library/UefiMemoryLib/MemLibGuid.c b/MdePkg/Library/UefiMemoryLib/MemLibGuid.c index c54983c..351e370 100644 --- a/MdePkg/Library/UefiMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/UefiMemoryLib/MemLibGuid.c @@ -24,25 +24,24 @@ **/
/**
- This function copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid
- to DestinationGuid, and returns DestinationGuid.
+ Copies a source GUID to a destination GUID.
+ This function copies the contents of the 128-bit GUID specified by SourceGuid to
+ DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
+ @param DestinationGuid Pointer to the destination GUID.
+ @param SourceGuid Pointer to the source GUID.
- @return DestinationGuid
+ @return DestinationGuid.
**/
GUID *
EFIAPI
CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
+ OUT GUID *DestinationGuid,
+ IN CONST GUID *SourceGuid
)
{
WriteUnaligned64 (
@@ -57,27 +56,25 @@ CopyGuid ( }
/**
- Compares two GUIDs
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE
- is returned. If there are any bit differences in the two GUIDs, then FALSE is
- returned.
+ Compares two GUIDs.
+ This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
+ If there are any bit differences in the two GUIDs, then FALSE is returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
- @param Guid1 guid to compare
- @param Guid2 guid to compare
+ @param Guid1 A pointer to a 128 bit GUID.
+ @param Guid2 A pointer to a 128 bit GUID.
- @retval TRUE if Guid1 == Guid2
- @retval FALSE if Guid1 != Guid2
+ @retval TRUE Guid1 and Guid2 are identical.
+ @retval FALSE Guid1 and Guid2 are not identical.
**/
BOOLEAN
EFIAPI
CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
+ IN CONST GUID *Guid1,
+ IN CONST GUID *Guid2
)
{
return (BOOLEAN)(
@@ -93,28 +90,27 @@ CompareGuid ( in the target buffer.
This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the
- 128-bit GUID value that matches Guid. If a match is found, then a pointer to
- the matching GUID in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
+ the lowest address to the highest address at 128-bit increments for the 128-bit
+ GUID value that matches Guid. If a match is found, then a pointer to the matching
+ GUID in the target buffer is returned. If no match is found, 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 greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Guid Value to search for in the target buffer.
- @return Pointer to the first occurrence.
- @retval NULL if Length == 0 or Guid was not found.
+ @return A pointer to the matching Guid in the target buffer or NULL otherwise.
+
**/
VOID *
EFIAPI
ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN CONST GUID *Guid
)
{
CONST GUID *GuidPtr;
diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c index d336d59..9ffc2cf 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem16 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c index 8de5594..6b0beee 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem32 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c index 228c864..589d45c 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c @@ -47,12 +47,15 @@ VOID *
EFIAPI
ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem64 ( ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);
}
diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c index 72a8078..4dc8bac 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c @@ -46,9 +46,9 @@ VOID *
EFIAPI
ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
@@ -57,5 +57,5 @@ ScanMem8 ( ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem8 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
}
diff --git a/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c index fd3720c..41467a9 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 16-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c index 77f1abd..4258406 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 32-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c index f95b97f..4a1eda8 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 64-bits in for Length
bytes of Buffer.
- If Length > 0 and Buffer is NULL and Length > 0, then ASSERT().
+ If Length > 0 and Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@@ -41,15 +41,15 @@ @param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT64 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c b/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c index d0e8760..3965be7 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c @@ -41,9 +41,9 @@ VOID *
EFIAPI
SetMem (
- IN VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT8 Value
)
{
if (Length == 0) {
diff --git a/MdePkg/Library/UefiMemoryLib/ZeroMemWrapper.c b/MdePkg/Library/UefiMemoryLib/ZeroMemWrapper.c index 4a3d615..56dbe5d 100644 --- a/MdePkg/Library/UefiMemoryLib/ZeroMemWrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ZeroMemWrapper.c @@ -26,24 +26,23 @@ #include "MemLibInternals.h"
/**
- Set Buffer to 0 for Size bytes.
+ Fills a target buffer with zeros, and returns the target buffer.
This function fills Length bytes of Buffer with zeros, and returns Buffer.
+ If Length > 0 and Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT().
- If Buffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+ @param Buffer Pointer to the target buffer to fill with zeros.
+ @param Length Number of bytes in Buffer to fill with zeros.
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
+ @return Buffer.
**/
VOID *
EFIAPI
ZeroMem (
- IN VOID *Buffer,
- IN UINTN Length
+ OUT VOID *Buffer,
+ IN UINTN Length
)
{
ASSERT (!(Buffer == NULL && Length > 0));
diff --git a/MdePkg/MdePkg-All-Archs.fpd b/MdePkg/MdePkg-All-Archs.fpd index a363b6a..2c7ed06 100644 --- a/MdePkg/MdePkg-All-Archs.fpd +++ b/MdePkg/MdePkg-All-Archs.fpd @@ -71,7 +71,7 @@ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiServicesTablePointerLibMm7" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiReportStatusCodeLib" />
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" />
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiCoreEntryPoint" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeimEntryPoint" />
@@ -88,7 +88,7 @@ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="UefiDriverEntryPoint" />
@@ -144,7 +144,7 @@ <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiServicesTablePointerLibMm7" />
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiReportStatusCodeLib" />
- <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" />
+ <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" />
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiCoreEntryPoint" />
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeimEntryPoint" />
@@ -161,7 +161,7 @@ <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />
- <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />
+ <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" />
<ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="DxeSmmDriverEntryPoint" />
@@ -216,7 +216,7 @@ <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiServicesTablePointerLibMm7" />
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiReportStatusCodeLib" />
- <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" />
+ <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" />
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiCoreEntryPoint" />
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeimEntryPoint" />
@@ -233,7 +233,7 @@ <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />
- <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />
+ <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" />
<ModuleSA Arch="X64" FvBinding="NULL" ModuleName="UefiDriverEntryPoint" />
@@ -289,7 +289,7 @@ <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="PeiServicesTablePointerLibMm7" />
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="PeiReportStatusCodeLib" />
- <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" />
+ <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" />
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="PeiCoreEntryPoint" />
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="PeimEntryPoint" />
@@ -306,7 +306,7 @@ <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />
- <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />
+ <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" />
<ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="DxeSmmDriverEntryPoint" />
@@ -680,7 +680,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" >
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdDebugPropertyMask</C_Name>
@@ -764,7 +764,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" >
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdPostCodePropertyMask</C_Name>
@@ -1040,7 +1040,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" >
+ <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdDebugPropertyMask</C_Name>
@@ -1124,7 +1124,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" >
+ <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdPostCodePropertyMask</C_Name>
@@ -1400,7 +1400,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" >
+ <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdDebugPropertyMask</C_Name>
@@ -1484,7 +1484,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" >
+ <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdPostCodePropertyMask</C_Name>
@@ -1760,7 +1760,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" >
+ <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdDebugPropertyMask</C_Name>
@@ -1844,7 +1844,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" >
+ <ModuleSA Arch="EBC" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdPostCodePropertyMask</C_Name>
diff --git a/MdePkg/MdePkg.fpd b/MdePkg/MdePkg.fpd index 35de27d..33fc12d 100644 --- a/MdePkg/MdePkg.fpd +++ b/MdePkg/MdePkg.fpd @@ -68,7 +68,7 @@ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiServicesTablePointerLibMm7" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiReportStatusCodeLib" />
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" />
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiCoreEntryPoint" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeimEntryPoint" />
@@ -84,7 +84,7 @@ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BaseReportStatusCodeLibNull" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibPort80" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibDebug" />
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" />
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="UefiDriverEntryPoint" />
<ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="DxeSmmDriverEntryPoint" />
@@ -458,7 +458,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BaseDebugLibReportStatusCode" >
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiDxeDebugLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdDebugPropertyMask</C_Name>
@@ -542,7 +542,7 @@ </PcdData>
</PcdBuildDefinition>
</ModuleSA>
- <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="BasePostCodeLibReportStatusCode" >
+ <ModuleSA Arch="IA32" FvBinding="NULL" ModuleName="PeiDxePostCodeLibReportStatusCode" >
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdPostCodePropertyMask</C_Name>
diff --git a/MdePkg/MdePkg.spd b/MdePkg/MdePkg.spd index e2756b8..31dc134 100644 --- a/MdePkg/MdePkg.spd +++ b/MdePkg/MdePkg.spd @@ -187,7 +187,7 @@ <Filename>Library/BaseDebugLibNull/BaseDebugLibNull.msa</Filename>
</MsaFile>
<MsaFile>
- <Filename>Library/BaseDebugLibReportStatusCode/BaseDebugLibReportStatusCode.msa</Filename>
+ <Filename>Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.msa</Filename>
</MsaFile>
<MsaFile>
<Filename>Library/BasePerformanceLibNull/BasePerformanceLibNull.msa</Filename>
@@ -232,7 +232,7 @@ <Filename>Library/BasePostCodeLibDebug/BasePostCodeLibDebug.msa</Filename>
</MsaFile>
<MsaFile>
- <Filename>Library/BasePostCodeLibReportStatusCode/BasePostCodeLibReportStatusCode.msa</Filename>
+ <Filename>Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.msa</Filename>
</MsaFile>
<MsaFile>
<Filename>Library/BaseSmbusLib/BaseSmbusLib.msa</Filename>
|