I would like to see the CopyMem implementation.  Which source file I should
look for it.  I see some implementation in commonlib.c in basetools but I
assume it wont be taken from there and instead will be used from boot
services table.  So how can I know about the implementation.  The reason I
want to look into that is, in reallocatepool, there is a possibility that
the CopyMem can be called with 0 length.  If CopyMem implementation is
similar to what is in commonlib.c (as mentioned below), the 0 will be
decremented and due to the type of length (UINTN) there might be some
memory corruption.



Please correct if my understanding is wrong.





VOID

PeiCopyMem (

  IN VOID   *Destination,

  IN VOID   *Source,

  IN UINTN  Length

  )

*/*++*



*Routine Description:*



*  Copy Length bytes from Source to Destination.*



*Arguments:*



*  Destination - Target of copy*



*  Source      - Place to copy from*



*  Length      - Number of bytes to copy*



*Returns:*



*  None*



*--*/*

{

  CHAR8 *Destination8;

  CHAR8 *Source8;



  Destination8  = Destination;

  Source8       = Source;

  *while* (Length--) {

    *(Destination8++) = *(Source8++);

  }

}



Thanks

Sathya



PS: My E-mail ID changed from [email protected] to
[email protected]. Please update your address book.
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to