Re: [edk2] [PATCH] ArmPkg: Bug fix for UncachedMemoryAllocationLib

2015-09-02 Thread Leif Lindholm
Hi Heyi,

Thanks a lot for this fix.
Committed as SVN r18390.

/
Leif

On 28 August 2015 at 16:21, Heyi Guo  wrote:
> Hi Ard,
>
> Would you help to commit the patch? Sorry I didn't see it upstreamed.
>
> Thanks.
>
>
> On 08/17/2015 06:25 PM, Ard Biesheuvel wrote:
>>
>> On 13 August 2015 at 16:37, Heyi Guo  wrote:
>>>
>>> NewNode is the node we found, while Node is the last node in the
>>> list. Also update mFreedBufferSize.
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>> Signed-off-by: Heyi Guo 
>>> Cc: Leif Lindholm 
>>> Cc: Ard Biesheuvel 
>>> ---
>>>   .../UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c  | 7
>>> ---
>>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>>
>> Reviewed-by: Ard Biesheuvel 
>>
>>
>>> diff --git
>>> a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
>>> b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
>>> index e70d877..b859f63 100644
>>> ---
>>> a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
>>> +++
>>> b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
>>> @@ -125,9 +125,10 @@ AllocatePagesFromList (
>>> }
>>> // Check if we have found a node that could contain our new
>>> allocation
>>> if (NewNode != NULL) {
>>> -NewNode->Allocated = TRUE;
>>> -Node->Allocation   = (VOID*)(UINTN)Node->Base;
>>> -*Allocation= Node->Allocation;
>>> +NewNode->Allocated  = TRUE;
>>> +NewNode->Allocation = (VOID*)(UINTN)NewNode->Base;
>>> +*Allocation = NewNode->Allocation;
>>> +mFreedBufferSize-= NewNode->Pages * EFI_PAGE_SIZE;
>>>   return EFI_SUCCESS;
>>> }
>>>
>>> --
>>> 2.1.4
>>>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPkg: Bug fix for UncachedMemoryAllocationLib

2015-08-17 Thread Ard Biesheuvel
On 13 August 2015 at 16:37, Heyi Guo heyi@linaro.org wrote:
 NewNode is the node we found, while Node is the last node in the
 list. Also update mFreedBufferSize.

 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Heyi Guo heyi@linaro.org
 Cc: Leif Lindholm leif.lindh...@linaro.org
 Cc: Ard Biesheuvel ard.biesheu...@linaro.org
 ---
  .../UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c  | 7 
 ---
  1 file changed, 4 insertions(+), 3 deletions(-)


Reviewed-by: Ard Biesheuvel ard.biesheu...@linaro.org


 diff --git 
 a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c 
 b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
 index e70d877..b859f63 100644
 --- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
 +++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
 @@ -125,9 +125,10 @@ AllocatePagesFromList (
}
// Check if we have found a node that could contain our new allocation
if (NewNode != NULL) {
 -NewNode-Allocated = TRUE;
 -Node-Allocation   = (VOID*)(UINTN)Node-Base;
 -*Allocation= Node-Allocation;
 +NewNode-Allocated  = TRUE;
 +NewNode-Allocation = (VOID*)(UINTN)NewNode-Base;
 +*Allocation = NewNode-Allocation;
 +mFreedBufferSize-= NewNode-Pages * EFI_PAGE_SIZE;
  return EFI_SUCCESS;
}

 --
 2.1.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel