drivers/amd/agesa: Fix some white spaces issues
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I0a11d303d2e2c83cb72773656f5caedec666dc66 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65898 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
558d731a4c
commit
76c63231d9
|
@ -42,20 +42,20 @@ AGESA_STATUS GetBiosCallout (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
if (i >= BiosCalloutsLen)
|
if (i >= BiosCalloutsLen)
|
||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
|
|
||||||
return BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr);
|
return BiosCallouts[i].CalloutPtr(Func, Data, ConfigPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
AGESA_STATUS agesa_NoopUnsupported (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
AGESA_STATUS agesa_NoopUnsupported(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
{
|
{
|
||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
AGESA_STATUS agesa_NoopSuccess (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
AGESA_STATUS agesa_NoopSuccess(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
{
|
{
|
||||||
return AGESA_SUCCESS;
|
return AGESA_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
AGESA_STATUS agesa_EmptyIdsInitData (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
AGESA_STATUS agesa_EmptyIdsInitData(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
{
|
{
|
||||||
IDS_NV_ITEM *IdsPtr = ((IDS_CALLOUT_STRUCT *) ConfigPtr)->IdsNvPtr;
|
IDS_NV_ITEM *IdsPtr = ((IDS_CALLOUT_STRUCT *) ConfigPtr)->IdsNvPtr;
|
||||||
if (Data == IDS_CALLOUT_INIT)
|
if (Data == IDS_CALLOUT_INIT)
|
||||||
|
@ -63,7 +63,7 @@ AGESA_STATUS agesa_EmptyIdsInitData (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
return AGESA_SUCCESS;
|
return AGESA_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
AGESA_STATUS agesa_Reset (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
AGESA_STATUS agesa_Reset(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
{
|
{
|
||||||
AGESA_STATUS Status;
|
AGESA_STATUS Status;
|
||||||
UINT8 Value;
|
UINT8 Value;
|
||||||
|
@ -88,7 +88,7 @@ AGESA_STATUS agesa_Reset (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
case WARM_RESET_IMMEDIATELY:
|
case WARM_RESET_IMMEDIATELY:
|
||||||
case COLD_RESET_IMMEDIATELY:
|
case COLD_RESET_IMMEDIATELY:
|
||||||
Value = 0x06;
|
Value = 0x06;
|
||||||
LibAmdIoWrite (AccessWidth8, 0xCf9, &Value, StdHeader);
|
LibAmdIoWrite(AccessWidth8, 0xCf9, &Value, StdHeader);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -99,7 +99,7 @@ AGESA_STATUS agesa_Reset (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
AGESA_STATUS agesa_RunFuncOnAp (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
AGESA_STATUS agesa_RunFuncOnAp(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
{
|
{
|
||||||
AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
|
AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
|
||||||
AGESA_STATUS status;
|
AGESA_STATUS status;
|
||||||
|
@ -127,12 +127,12 @@ AGESA_STATUS agesa_GfxGetVbiosImage(UINT32 Func, UINTN FchData, VOID *ConfigPrt)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AGESA_STATUS agesa_ReadSpd (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
AGESA_STATUS agesa_ReadSpd(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
{
|
{
|
||||||
if (!ENV_RAMINIT)
|
if (!ENV_RAMINIT)
|
||||||
return AGESA_UNSUPPORTED;
|
return AGESA_UNSUPPORTED;
|
||||||
|
|
||||||
return AmdMemoryReadSPD (Func, Data, ConfigPtr);
|
return AmdMemoryReadSPD(Func, Data, ConfigPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
AGESA_STATUS agesa_ReadSpd_from_cbfs(UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
|
|
|
@ -151,13 +151,13 @@ static const char *decodeAGESA_STATUS(AGESA_STATUS sret)
|
||||||
|
|
||||||
static void show_event(EVENT_PARAMS *Event)
|
static void show_event(EVENT_PARAMS *Event)
|
||||||
{
|
{
|
||||||
printk(BIOS_DEBUG,"\nEventLog: EventClass = %x, EventInfo = %x.\n",
|
printk(BIOS_DEBUG, "\nEventLog: EventClass = %x, EventInfo = %x.\n",
|
||||||
(unsigned int)Event->EventClass,
|
(unsigned int)Event->EventClass,
|
||||||
(unsigned int)Event->EventInfo);
|
(unsigned int)Event->EventInfo);
|
||||||
printk(BIOS_DEBUG," Param1 = %x, Param2 = %x.\n",
|
printk(BIOS_DEBUG, " Param1 = %x, Param2 = %x.\n",
|
||||||
(unsigned int)Event->DataParam1,
|
(unsigned int)Event->DataParam1,
|
||||||
(unsigned int)Event->DataParam2);
|
(unsigned int)Event->DataParam2);
|
||||||
printk(BIOS_DEBUG," Param3 = %x, Param4 = %x.\n",
|
printk(BIOS_DEBUG, " Param3 = %x, Param4 = %x.\n",
|
||||||
(unsigned int)Event->DataParam3,
|
(unsigned int)Event->DataParam3,
|
||||||
(unsigned int)Event->DataParam4);
|
(unsigned int)Event->DataParam4);
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ void agesawrapper_trace(AGESA_STATUS ret, AMD_CONFIG_PARAMS *StdHeader,
|
||||||
amd_flush_eventlog(&AmdEventParams);
|
amd_flush_eventlog(&AmdEventParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
AGESA_STATUS agesawrapper_amdreadeventlog (UINT8 HeapStatus)
|
AGESA_STATUS agesawrapper_amdreadeventlog(UINT8 HeapStatus)
|
||||||
{
|
{
|
||||||
EVENT_PARAMS AmdEventParams;
|
EVENT_PARAMS AmdEventParams;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ void EmptyHeap(void)
|
||||||
memset(base, 0, BIOS_HEAP_SIZE);
|
memset(base, 0, BIOS_HEAP_SIZE);
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "Wiped HEAP at [%08x - %08x]\n",
|
printk(BIOS_DEBUG, "Wiped HEAP at [%08x - %08x]\n",
|
||||||
(unsigned int)(uintptr_t) base, (unsigned int)(uintptr_t) base + BIOS_HEAP_SIZE - 1);
|
(unsigned int)(uintptr_t)base, (unsigned int)(uintptr_t) base + BIOS_HEAP_SIZE - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HEAP_CALLOUT_RUNTIME) && ENV_RAMSTAGE
|
#if defined(HEAP_CALLOUT_RUNTIME) && ENV_RAMSTAGE
|
||||||
|
@ -104,15 +104,15 @@ static AGESA_STATUS agesa_AllocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
if (BiosHeapBasePtr->StartOfAllocatedNodes == 0) {
|
if (BiosHeapBasePtr->StartOfAllocatedNodes == 0) {
|
||||||
/* First allocation */
|
/* First allocation */
|
||||||
CurrNodeOffset = sizeof(BIOS_HEAP_MANAGER);
|
CurrNodeOffset = sizeof(BIOS_HEAP_MANAGER);
|
||||||
CurrNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + CurrNodeOffset);
|
CurrNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + CurrNodeOffset);
|
||||||
CurrNodePtr->BufferHandle = AllocParams->BufferHandle;
|
CurrNodePtr->BufferHandle = AllocParams->BufferHandle;
|
||||||
CurrNodePtr->BufferSize = AllocParams->BufferLength;
|
CurrNodePtr->BufferSize = AllocParams->BufferLength;
|
||||||
CurrNodePtr->NextNodeOffset = 0;
|
CurrNodePtr->NextNodeOffset = 0;
|
||||||
AllocParams->BufferPointer = (UINT8 *) CurrNodePtr + sizeof(BIOS_BUFFER_NODE);
|
AllocParams->BufferPointer = (UINT8 *)CurrNodePtr + sizeof(BIOS_BUFFER_NODE);
|
||||||
|
|
||||||
/* Update the remaining free space */
|
/* Update the remaining free space */
|
||||||
FreedNodeOffset = CurrNodeOffset + CurrNodePtr->BufferSize + sizeof(BIOS_BUFFER_NODE);
|
FreedNodeOffset = CurrNodeOffset + CurrNodePtr->BufferSize + sizeof(BIOS_BUFFER_NODE);
|
||||||
FreedNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + FreedNodeOffset);
|
FreedNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + FreedNodeOffset);
|
||||||
FreedNodePtr->BufferSize = AvailableHeapSize
|
FreedNodePtr->BufferSize = AvailableHeapSize
|
||||||
- (FreedNodeOffset - CurrNodeOffset)
|
- (FreedNodeOffset - CurrNodeOffset)
|
||||||
- sizeof(BIOS_BUFFER_NODE);
|
- sizeof(BIOS_BUFFER_NODE);
|
||||||
|
@ -126,10 +126,10 @@ static AGESA_STATUS agesa_AllocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
* If it has, return AGESA_BOUNDS_CHK.
|
* If it has, return AGESA_BOUNDS_CHK.
|
||||||
*/
|
*/
|
||||||
CurrNodeOffset = BiosHeapBasePtr->StartOfAllocatedNodes;
|
CurrNodeOffset = BiosHeapBasePtr->StartOfAllocatedNodes;
|
||||||
CurrNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + CurrNodeOffset);
|
CurrNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + CurrNodeOffset);
|
||||||
|
|
||||||
while (CurrNodeOffset != 0) {
|
while (CurrNodeOffset != 0) {
|
||||||
CurrNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + CurrNodeOffset);
|
CurrNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + CurrNodeOffset);
|
||||||
if (CurrNodePtr->BufferHandle == AllocParams->BufferHandle) {
|
if (CurrNodePtr->BufferHandle == AllocParams->BufferHandle) {
|
||||||
return AGESA_BOUNDS_CHK;
|
return AGESA_BOUNDS_CHK;
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ static AGESA_STATUS agesa_AllocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
BestFitNodeOffset = 0;
|
BestFitNodeOffset = 0;
|
||||||
BestFitPrevNodeOffset = 0;
|
BestFitPrevNodeOffset = 0;
|
||||||
while (FreedNodeOffset != 0) {
|
while (FreedNodeOffset != 0) {
|
||||||
FreedNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + FreedNodeOffset);
|
FreedNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + FreedNodeOffset);
|
||||||
if (FreedNodePtr->BufferSize >= (AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE))) {
|
if (FreedNodePtr->BufferSize >= (AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE))) {
|
||||||
if (BestFitNodeOffset == 0) {
|
if (BestFitNodeOffset == 0) {
|
||||||
/* First node that fits the requested buffer size */
|
/* First node that fits the requested buffer size */
|
||||||
|
@ -152,7 +152,7 @@ static AGESA_STATUS agesa_AllocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
BestFitPrevNodeOffset = PrevNodeOffset;
|
BestFitPrevNodeOffset = PrevNodeOffset;
|
||||||
} else {
|
} else {
|
||||||
/* Find out whether current node is a better fit than the previous nodes */
|
/* Find out whether current node is a better fit than the previous nodes */
|
||||||
BestFitNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + BestFitNodeOffset);
|
BestFitNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + BestFitNodeOffset);
|
||||||
if (BestFitNodePtr->BufferSize > FreedNodePtr->BufferSize) {
|
if (BestFitNodePtr->BufferSize > FreedNodePtr->BufferSize) {
|
||||||
BestFitNodeOffset = FreedNodeOffset;
|
BestFitNodeOffset = FreedNodeOffset;
|
||||||
BestFitPrevNodeOffset = PrevNodeOffset;
|
BestFitPrevNodeOffset = PrevNodeOffset;
|
||||||
|
@ -169,14 +169,14 @@ static AGESA_STATUS agesa_AllocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
*/
|
*/
|
||||||
return AGESA_BOUNDS_CHK;
|
return AGESA_BOUNDS_CHK;
|
||||||
} else {
|
} else {
|
||||||
BestFitNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + BestFitNodeOffset);
|
BestFitNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + BestFitNodeOffset);
|
||||||
BestFitPrevNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + BestFitPrevNodeOffset);
|
BestFitPrevNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + BestFitPrevNodeOffset);
|
||||||
|
|
||||||
/* If BestFitNode is larger than the requested buffer, fragment the node further */
|
/* If BestFitNode is larger than the requested buffer, fragment the node further */
|
||||||
if (BestFitNodePtr->BufferSize > (AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE))) {
|
if (BestFitNodePtr->BufferSize > (AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE))) {
|
||||||
NextFreeOffset = BestFitNodeOffset + AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE);
|
NextFreeOffset = BestFitNodeOffset + AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE);
|
||||||
|
|
||||||
NextFreePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + NextFreeOffset);
|
NextFreePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + NextFreeOffset);
|
||||||
NextFreePtr->BufferSize = BestFitNodePtr->BufferSize - (AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE));
|
NextFreePtr->BufferSize = BestFitNodePtr->BufferSize - (AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE));
|
||||||
NextFreePtr->NextNodeOffset = BestFitNodePtr->NextNodeOffset;
|
NextFreePtr->NextNodeOffset = BestFitNodePtr->NextNodeOffset;
|
||||||
} else {
|
} else {
|
||||||
|
@ -200,7 +200,7 @@ static AGESA_STATUS agesa_AllocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
BestFitNodePtr->NextNodeOffset = 0;
|
BestFitNodePtr->NextNodeOffset = 0;
|
||||||
|
|
||||||
/* Remove BestFitNode from list of Freed nodes */
|
/* Remove BestFitNode from list of Freed nodes */
|
||||||
AllocParams->BufferPointer = (UINT8 *) BestFitNodePtr + sizeof(BIOS_BUFFER_NODE);
|
AllocParams->BufferPointer = (UINT8 *)BestFitNodePtr + sizeof(BIOS_BUFFER_NODE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ static AGESA_STATUS agesa_DeallocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
* Return AGESA_BOUNDS_CHK if the BufferHandle is not found.
|
* Return AGESA_BOUNDS_CHK if the BufferHandle is not found.
|
||||||
*/
|
*/
|
||||||
AllocNodeOffset = BiosHeapBasePtr->StartOfAllocatedNodes;
|
AllocNodeOffset = BiosHeapBasePtr->StartOfAllocatedNodes;
|
||||||
AllocNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + AllocNodeOffset);
|
AllocNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + AllocNodeOffset);
|
||||||
PrevNodeOffset = AllocNodeOffset;
|
PrevNodeOffset = AllocNodeOffset;
|
||||||
|
|
||||||
while (AllocNodePtr->BufferHandle != AllocParams->BufferHandle) {
|
while (AllocNodePtr->BufferHandle != AllocParams->BufferHandle) {
|
||||||
|
@ -234,20 +234,20 @@ static AGESA_STATUS agesa_DeallocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
}
|
}
|
||||||
PrevNodeOffset = AllocNodeOffset;
|
PrevNodeOffset = AllocNodeOffset;
|
||||||
AllocNodeOffset = AllocNodePtr->NextNodeOffset;
|
AllocNodeOffset = AllocNodePtr->NextNodeOffset;
|
||||||
AllocNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + AllocNodeOffset);
|
AllocNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + AllocNodeOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove target node from list of allocated nodes */
|
/* Remove target node from list of allocated nodes */
|
||||||
PrevNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + PrevNodeOffset);
|
PrevNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + PrevNodeOffset);
|
||||||
PrevNodePtr->NextNodeOffset = AllocNodePtr->NextNodeOffset;
|
PrevNodePtr->NextNodeOffset = AllocNodePtr->NextNodeOffset;
|
||||||
|
|
||||||
/* Zero out the buffer, and clear the BufferHandle */
|
/* Zero out the buffer, and clear the BufferHandle */
|
||||||
LibAmdMemFill ((UINT8 *)AllocNodePtr + sizeof(BIOS_BUFFER_NODE), 0, AllocNodePtr->BufferSize, &(AllocParams->StdHeader));
|
LibAmdMemFill((UINT8 *)AllocNodePtr + sizeof(BIOS_BUFFER_NODE), 0, AllocNodePtr->BufferSize, &(AllocParams->StdHeader));
|
||||||
AllocNodePtr->BufferHandle = 0;
|
AllocNodePtr->BufferHandle = 0;
|
||||||
|
|
||||||
/* Add deallocated node in order to the list of freed nodes */
|
/* Add deallocated node in order to the list of freed nodes */
|
||||||
FreedNodeOffset = BiosHeapBasePtr->StartOfFreedNodes;
|
FreedNodeOffset = BiosHeapBasePtr->StartOfFreedNodes;
|
||||||
FreedNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + FreedNodeOffset);
|
FreedNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + FreedNodeOffset);
|
||||||
|
|
||||||
EndNodeOffset = AllocNodeOffset + AllocNodePtr->BufferSize +
|
EndNodeOffset = AllocNodeOffset + AllocNodePtr->BufferSize +
|
||||||
sizeof(BIOS_BUFFER_NODE);
|
sizeof(BIOS_BUFFER_NODE);
|
||||||
|
@ -284,14 +284,14 @@ static AGESA_STATUS agesa_DeallocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
NextNodeOffset = NextNodePtr->NextNodeOffset;
|
NextNodeOffset = NextNodePtr->NextNodeOffset;
|
||||||
NextNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + NextNodeOffset);
|
NextNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + NextNodeOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If deallocated node is adjacent to the next node,
|
/* If deallocated node is adjacent to the next node,
|
||||||
* concatenate both nodes.
|
* concatenate both nodes.
|
||||||
*/
|
*/
|
||||||
if (NextNodeOffset == EndNodeOffset) {
|
if (NextNodeOffset == EndNodeOffset) {
|
||||||
NextNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + NextNodeOffset);
|
NextNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + NextNodeOffset);
|
||||||
AllocNodePtr->BufferSize += NextNodePtr->BufferSize +
|
AllocNodePtr->BufferSize += NextNodePtr->BufferSize +
|
||||||
sizeof(BIOS_BUFFER_NODE);
|
sizeof(BIOS_BUFFER_NODE);
|
||||||
AllocNodePtr->NextNodeOffset = NextNodePtr->NextNodeOffset;
|
AllocNodePtr->NextNodeOffset = NextNodePtr->NextNodeOffset;
|
||||||
|
@ -306,7 +306,7 @@ static AGESA_STATUS agesa_DeallocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
/* If deallocated node is adjacent to the previous node,
|
/* If deallocated node is adjacent to the previous node,
|
||||||
* concatenate both nodes.
|
* concatenate both nodes.
|
||||||
*/
|
*/
|
||||||
PrevNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + PrevNodeOffset);
|
PrevNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + PrevNodeOffset);
|
||||||
EndNodeOffset = PrevNodeOffset + PrevNodePtr->BufferSize +
|
EndNodeOffset = PrevNodeOffset + PrevNodePtr->BufferSize +
|
||||||
sizeof(BIOS_BUFFER_NODE);
|
sizeof(BIOS_BUFFER_NODE);
|
||||||
if (AllocNodeOffset == EndNodeOffset) {
|
if (AllocNodeOffset == EndNodeOffset) {
|
||||||
|
@ -332,7 +332,7 @@ static AGESA_STATUS agesa_LocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
BIOS_BUFFER_NODE *AllocNodePtr;
|
BIOS_BUFFER_NODE *AllocNodePtr;
|
||||||
|
|
||||||
AllocNodeOffset = BiosHeapBasePtr->StartOfAllocatedNodes;
|
AllocNodeOffset = BiosHeapBasePtr->StartOfAllocatedNodes;
|
||||||
AllocNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + AllocNodeOffset);
|
AllocNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + AllocNodeOffset);
|
||||||
|
|
||||||
while (AllocParams->BufferHandle != AllocNodePtr->BufferHandle) {
|
while (AllocParams->BufferHandle != AllocNodePtr->BufferHandle) {
|
||||||
if (AllocNodePtr->NextNodeOffset == 0) {
|
if (AllocNodePtr->NextNodeOffset == 0) {
|
||||||
|
@ -341,11 +341,11 @@ static AGESA_STATUS agesa_LocateBuffer(BIOS_HEAP_MANAGER *BiosHeapBasePtr,
|
||||||
return AGESA_BOUNDS_CHK;
|
return AGESA_BOUNDS_CHK;
|
||||||
} else {
|
} else {
|
||||||
AllocNodeOffset = AllocNodePtr->NextNodeOffset;
|
AllocNodeOffset = AllocNodePtr->NextNodeOffset;
|
||||||
AllocNodePtr = (BIOS_BUFFER_NODE *) (BiosHeapBaseAddr + AllocNodeOffset);
|
AllocNodePtr = (BIOS_BUFFER_NODE *)(BiosHeapBaseAddr + AllocNodeOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AllocParams->BufferPointer = (UINT8 *) ((UINT8 *) AllocNodePtr + sizeof(BIOS_BUFFER_NODE));
|
AllocParams->BufferPointer = (UINT8 *)((UINT8 *) AllocNodePtr + sizeof(BIOS_BUFFER_NODE));
|
||||||
AllocParams->BufferLength = AllocNodePtr->BufferSize;
|
AllocParams->BufferLength = AllocNodePtr->BufferSize;
|
||||||
|
|
||||||
return AGESA_SUCCESS;
|
return AGESA_SUCCESS;
|
||||||
|
|
|
@ -45,7 +45,7 @@ void fixup_cbmem_to_UC(int s3resume)
|
||||||
* writeback possible.
|
* writeback possible.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uintptr_t top_of_ram = (uintptr_t) cbmem_top();
|
uintptr_t top_of_ram = (uintptr_t)cbmem_top();
|
||||||
top_of_ram = ALIGN_UP(top_of_ram, 4 * MiB);
|
top_of_ram = ALIGN_UP(top_of_ram, 4 * MiB);
|
||||||
|
|
||||||
set_range_uc(top_of_ram - 4 * MiB, 4 * MiB);
|
set_range_uc(top_of_ram - 4 * MiB, 4 * MiB);
|
||||||
|
@ -79,12 +79,12 @@ static void recover_postcar_frame(struct postcar_frame *pcf)
|
||||||
* speed make them WB after CAR teardown.
|
* speed make them WB after CAR teardown.
|
||||||
*/
|
*/
|
||||||
if (s3resume) {
|
if (s3resume) {
|
||||||
uintptr_t top_of_ram = (uintptr_t) cbmem_top();
|
uintptr_t top_of_ram = (uintptr_t)cbmem_top();
|
||||||
top_of_ram = ALIGN_DOWN(top_of_ram, 4*MiB);
|
top_of_ram = ALIGN_DOWN(top_of_ram, 4 * MiB);
|
||||||
|
|
||||||
postcar_frame_add_mtrr(pcf, top_of_ram - 4*MiB, 4*MiB,
|
postcar_frame_add_mtrr(pcf, top_of_ram - 4 * MiB, 4 * MiB,
|
||||||
MTRR_TYPE_WRBACK);
|
MTRR_TYPE_WRBACK);
|
||||||
postcar_frame_add_mtrr(pcf, top_of_ram - 8*MiB, 4*MiB,
|
postcar_frame_add_mtrr(pcf, top_of_ram - 8 * MiB, 4 * MiB,
|
||||||
MTRR_TYPE_WRBACK);
|
MTRR_TYPE_WRBACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ AGESA_STATUS OemS3LateRestore(AMD_S3_PARAMS *dataBlock)
|
||||||
return AGESA_FATAL;
|
return AGESA_FATAL;
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "Using resume HEAP at %08x\n",
|
printk(BIOS_DEBUG, "Using resume HEAP at %08x\n",
|
||||||
(unsigned int)(uintptr_t) heap);
|
(unsigned int)(uintptr_t)heap);
|
||||||
|
|
||||||
/* Return allocated CBMEM size, we do not keep track of
|
/* Return allocated CBMEM size, we do not keep track of
|
||||||
* how much was actually used.
|
* how much was actually used.
|
||||||
|
|
|
@ -36,7 +36,7 @@ static void agesa_locate_image(AMD_CONFIG_PARAMS *StdHeader)
|
||||||
|
|
||||||
image = LibAmdLocateImage(agesa, agesa + file_size, 4096,
|
image = LibAmdLocateImage(agesa, agesa + file_size, 4096,
|
||||||
ModuleIdentifier);
|
ModuleIdentifier);
|
||||||
StdHeader->ImageBasePtr = (void *) image;
|
StdHeader->ImageBasePtr = (void *)image;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ int agesa_execute_state(struct sysinfo *cb, AGESA_STRUCT_NAME func)
|
||||||
|
|
||||||
/* For these calls, heap is not available. */
|
/* For these calls, heap is not available. */
|
||||||
if (func == AMD_INIT_RESET || func == AMD_S3LATE_RESTORE) {
|
if (func == AMD_INIT_RESET || func == AMD_S3LATE_RESTORE) {
|
||||||
buf = (void *) &agesa_params;
|
buf = (void *)&agesa_params;
|
||||||
len = sizeof(agesa_params);
|
len = sizeof(agesa_params);
|
||||||
memcpy(buf, &cb->StdHeader, sizeof(cb->StdHeader));
|
memcpy(buf, &cb->StdHeader, sizeof(cb->StdHeader));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue