本文整理汇总了C++中HeapLocateBuffer函数的典型用法代码示例。如果您正苦于以下问题:C++ HeapLocateBuffer函数的具体用法?C++ HeapLocateBuffer怎么用?C++ HeapLocateBuffer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HeapLocateBuffer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MemNWritePmuSramMsgBlockKV
BOOLEAN
MemNWritePmuSramMsgBlockKV (
IN OUT MEM_NB_BLOCK *NBPtr
)
{
UINT16 i;
UINT16 *ImagePtr;
LOCATE_HEAP_PTR LocHeap;
LocHeap.BufferHandle = AMD_MEM_PMU_SRAM_MSG_BLOCK_HANDLE;
if (HeapLocateBuffer (&LocHeap, &(NBPtr->MemPtr->StdHeader)) != AGESA_SUCCESS) {
return FALSE; // Could not locate heap for PMU SRAM Message BLock.
}
ImagePtr = (UINT16 *) LocHeap.BufferPtr;
MemNSetBitFieldNb (NBPtr, BFPmuReset, 0);
// Write the word to D18F2x[B,0]9C_x0005_[27FF:0800]_dct[3:0] (using the broadcast port for all phys at
// D18F2xB98_dct[MaxDctMstr:0], and using the autoincrement feature).
IDS_HDT_CONSOLE (MEM_FLOW, "\t\tStart writing PMU SRAM Message Block...\n");
MemNSetBitFieldNb (NBPtr, RegDctAddlOffset, PMU_FIRMWARE_SRAM_START | DCT_ACCESS_WRITE | DCT_OFFSET_AUTO_INC_EN);
for (i = 0; i < sizeof (PMU_SRAM_MSG_BLOCK_KV) / sizeof (ImagePtr[0]); i++) {
MemNSetBitFieldNb (NBPtr, RegDctAddlData, ImagePtr[i]);
IDS_HDT_CONSOLE (MEM_SETREG, "~F2_9C_%x = %04x\n", PMU_FIRMWARE_SRAM_START + i, ImagePtr[i]);
}
IDS_HDT_CONSOLE (MEM_FLOW, "\t\tEnd writing PMU SRAM Message Block!\n");
MemNSetBitFieldNb (NBPtr, RegDctAddlOffset, 0);
return TRUE;
}
示例2: RetrieveDataBlockFromInitReset
STATIC VOID
RetrieveDataBlockFromInitReset (
IN FCH_DATA_BLOCK *FchParams
)
{
LOCATE_HEAP_PTR LocHeapPtr;
FCH_RESET_DATA_BLOCK *ResetDb;
AGESA_STATUS AgesaStatus;
LocHeapPtr.BufferHandle = AMD_FCH_RESET_DATA_BLOCK_HANDLE;
AgesaStatus = HeapLocateBuffer (&LocHeapPtr, FchParams->StdHeader);
if (AgesaStatus == AGESA_SUCCESS) {
ASSERT (LocHeapPtr.BufferPtr != NULL);
ResetDb = (FCH_RESET_DATA_BLOCK *) (LocHeapPtr.BufferPtr - sizeof (ResetDb) + sizeof (UINT32));
// Override FchParams with contents in ResetDb
FchParams->Usb.Xhci0Enable = ResetDb->FchReset.Xhci0Enable;
FchParams->Usb.Xhci1Enable = ResetDb->FchReset.Xhci1Enable;
FchParams->Spi.SpiFastSpeed = ResetDb->FastSpeed;
FchParams->Spi.WriteSpeed = ResetDb->WriteSpeed;
FchParams->Spi.SpiMode = ResetDb->Mode;
FchParams->Spi.AutoMode = ResetDb->AutoMode;
FchParams->Spi.SpiBurstWrite = ResetDb->BurstWrite;
FchParams->Sata.SataMode.Sata6AhciCap = (UINT8) ResetDb->Sata6AhciCap;
FchParams->Misc.Cg2Pll = ResetDb->Cg2Pll;
FchParams->Sata.SataMode.SataSetMaxGen2 = ResetDb->SataSetMaxGen2;
FchParams->Sata.SataMode.SataClkMode = ResetDb->SataClkMode;
FchParams->Sata.SataMode.SataModeReg = ResetDb->SataModeReg;
FchParams->Sata.SataInternal100Spread = (UINT8) ResetDb->SataInternal100Spread;
FchParams->Spi.SpiSpeed = ResetDb->SpiSpeed;
FchParams->Gpp = ResetDb->Gpp;
}
}
示例3: MemNInitPmuSramMsgBlockKV
BOOLEAN
MemNInitPmuSramMsgBlockKV (
IN OUT MEM_NB_BLOCK *NBPtr
)
{
LOCATE_HEAP_PTR LocHeap;
ALLOCATE_HEAP_PARAMS AllocHeapParams;
PMU_SRAM_MSG_BLOCK_KV *PmuSramMsgBlockPtr;
LocHeap.BufferHandle = AMD_MEM_PMU_SRAM_MSG_BLOCK_HANDLE;
if (HeapLocateBuffer (&LocHeap, &(NBPtr->MemPtr->StdHeader)) == AGESA_SUCCESS) {
PmuSramMsgBlockPtr = (PMU_SRAM_MSG_BLOCK_KV *) LocHeap.BufferPtr;
} else {
// Allocate temporary buffer for PMU SRAM Message Block
AllocHeapParams.RequestedBufferSize = sizeof (PMU_SRAM_MSG_BLOCK_KV);
AllocHeapParams.BufferHandle = AMD_MEM_PMU_SRAM_MSG_BLOCK_HANDLE;
AllocHeapParams.Persist = HEAP_LOCAL_CACHE;
if (HeapAllocateBuffer (&AllocHeapParams, &(NBPtr->MemPtr->StdHeader)) != AGESA_SUCCESS) {
return FALSE; // Could not allocate heap for PMU SRAM Message BLock.
}
PmuSramMsgBlockPtr = (PMU_SRAM_MSG_BLOCK_KV *) AllocHeapParams.BufferPtr;
}
LibAmdMemFill ((VOID *)PmuSramMsgBlockPtr, 0, (UINTN)sizeof (PMU_SRAM_MSG_BLOCK_KV), &(NBPtr->MemPtr->StdHeader));
return TRUE;
}
示例4: FchLocateHeapBuffer
//
// Private Function Declaration
//
FCH_DATA_BLOCK*
FchLocateHeapBuffer ( VOID )
{
LOCATE_HEAP_PTR LocateHeapPtr;
AMD_CONFIG_PARAMS StdHeader;
AGESA_STATUS AgesaStatus;
EFI_STATUS Status;
Status = gBS->LocateProtocol (
&gAmdBufferManagerProtocolGuid,
NULL,
&mBufferMgr
);
if (EFI_ERROR (Status)) {
return NULL;
}
mDxeBufferManager = mBufferMgr->DxeBufferManager;
StdHeader = mBufferMgr->StdHeader;
StdHeader.HeapStatus = HEAP_SYSTEM_MEM;
LocateHeapPtr.BufferHandle = AMD_FCH_DATA_BLOCK_HANDLE;
AgesaStatus = HeapLocateBuffer (&LocateHeapPtr, &StdHeader);
ASSERT (!AgesaStatus);
return (FCH_DATA_BLOCK *) LocateHeapPtr.BufferPtr;
}
示例5: AmdMemS3DatablobRevMatch
/**
*
*
* This function determines if the revision S3 data blob matches the S3 engine
*
* @param[in] Storage - Beginning of the device list.
* @param[in] *StdHeader - Config handle for library and services.
*
* @return AGESA_STATUS
* - AGESA_FATAL
* - AGESA_SUCCESS
*/
AGESA_STATUS
AmdMemS3DatablobRevMatch (
IN VOID *Storage,
IN AMD_CONFIG_PARAMS *StdHeader
)
{
S3_MEM_NB_BLOCK *S3NBPtr;
LOCATE_HEAP_PTR LocHeap;
DEVICE_BLOCK_HEADER *DeviceList;
DeviceList = (DEVICE_BLOCK_HEADER *) Storage;
LocHeap.BufferHandle = AMD_MEM_S3_NB_HANDLE;
S3NBPtr = NULL;
if (HeapLocateBuffer (&LocHeap, StdHeader) == AGESA_SUCCESS) {
S3NBPtr = (S3_MEM_NB_BLOCK *)LocHeap.BufferPtr;
} else {
ASSERT (FALSE) ; // No match for heap status, but could not locate "AMD_MEM_S3_NB_HANDLE" in heap for S3GetMsr
return AGESA_FATAL;
}
if (S3NBPtr[BSP_DIE].S3DatablobRev == DeviceList->Revision) {
return AGESA_SUCCESS;
} else {
ASSERT (FALSE);
return AGESA_FATAL;
}
}
示例6: AmdMemDoResume
/**
*
*
* This function determines if the PSP is present
*
* @param[in] *StdHeader - Config handle for library and services.
*
* @return AGESA_STATUS
* - AGESA_FATAL
* - AGESA_SUCCESS
*/
AGESA_STATUS
AmdMemDoResume (
IN AMD_CONFIG_PARAMS *StdHeader
)
{
S3_MEM_NB_BLOCK *S3NBPtr;
MEM_NB_BLOCK *NBPtr;
LOCATE_HEAP_PTR LocHeap;
LocHeap.BufferHandle = AMD_MEM_S3_NB_HANDLE;
S3NBPtr = NULL;
if (HeapLocateBuffer (&LocHeap, StdHeader) == AGESA_SUCCESS) {
S3NBPtr = (S3_MEM_NB_BLOCK *)LocHeap.BufferPtr;
NBPtr = ((S3_MEM_NB_BLOCK *)S3NBPtr)->NBPtr;
} else {
ASSERT (FALSE) ; // No match for heap status, but could not locate "AMD_MEM_S3_NB_HANDLE" in heap for S3GetMsr
return AGESA_FATAL;
}
if (S3NBPtr[BSP_DIE].MemS3PspPlatformSecureBootEn (S3NBPtr[BSP_DIE].NBPtr) == NBPtr->MemRunningOnPsp (NBPtr)) {
return AGESA_SUCCESS;
} else {
return AGESA_FATAL;
}
}
示例7: MemFS3GetCMsrDeviceRegisterList
/**
*
*
* This function returns the conditional MSR device register list according
* to the register list ID.
*
* @param[in] *Device - pointer to the CONDITIONAL_PCI_DEVICE_DESCRIPTOR
* @param[out] **RegisterHdr - pointer to the address of the register list
* @param[in] *StdHeader - Config handle for library and services
*
* @return AGESA_STATUS
* - AGESA_ALERT
* - AGESA_FATAL
* - AGESA_SUCCESS
* - AGESA_WARNING
*/
AGESA_STATUS
MemFS3GetCMsrDeviceRegisterList (
IN CONDITIONAL_MSR_DEVICE_DESCRIPTOR *Device,
OUT CMSR_REGISTER_BLOCK_HEADER **RegisterHdr,
IN AMD_CONFIG_PARAMS *StdHeader
)
{
AGESA_STATUS RetVal;
S3_MEM_NB_BLOCK *S3NBPtr;
VOID *RegisterHeader;
LOCATE_HEAP_PTR LocHeap;
AGESA_BUFFER_PARAMS LocBufferParams;
LibAmdMemCopy (&LocBufferParams.StdHeader, StdHeader, sizeof (AMD_CONFIG_PARAMS), StdHeader);
LocHeap.BufferHandle = AMD_MEM_S3_NB_HANDLE;
LocBufferParams.BufferHandle = AMD_MEM_S3_NB_HANDLE;
AGESA_TESTPOINT (TpIfBeforeLocateS3CMsrBuffer, StdHeader);
if (HeapLocateBuffer (&LocHeap, StdHeader) == AGESA_SUCCESS) {
S3NBPtr = (S3_MEM_NB_BLOCK *)LocHeap.BufferPtr;
} else {
ASSERT(FALSE) ; // No match for heap status, but could not locate "AMD_MEM_S3_NB_HANDLE" in heap for S3GetMsr
return AGESA_FATAL;
}
AGESA_TESTPOINT (TpIfAfterLocateS3CMsrBuffer, StdHeader);
// NB block has already been constructed by main block.
// No need to construct it here.
RetVal = S3NBPtr[BSP_DIE].MemS3GetDeviceRegLst (Device->RegisterListID, &RegisterHeader);
*RegisterHdr = (CMSR_REGISTER_BLOCK_HEADER *)RegisterHeader;
return RetVal;
}
示例8: IdsPerfTimestamp
/**
*
* Get Ids Performance analysis table pointer in the AGESA Heap.
*
* @param[in,out] StdHeader The Pointer of AGESA Header
* @param[in] TestPoint Progress indicator value, see @ref AGESA_TP
*
* @retval AGESA_SUCCESS Success to get the pointer of Performance analysis Table.
* @retval AGESA_ERROR Fail to get the pointer of Performance analysis Table.
* @retval AGESA_UNSUPPORTED Get an exclude testpoint
*
**/
AGESA_STATUS
IdsPerfTimestamp (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN AGESA_TP TestPoint
)
{
AGESA_STATUS status;
UINT8 Index;
UINT8 i;
TP_Perf_STRUCT *PerfTableEntry;
ALLOCATE_HEAP_PARAMS AllocHeapParams;
LOCATE_HEAP_PTR LocateHeapStructPtr;
UINT64 CurrentTsc;
// Exclude some testpoint which may cause deadloop
for (i = 0; i < (sizeof (IdsPerfExcludeTp) / sizeof (AGESA_TP)); i++) {
if (TestPoint == IdsPerfExcludeTp[i]) {
return AGESA_UNSUPPORTED;
}
}
//if heap is not ready yet, don't invoke locate buffer, or else will cause event log & locate heap dead loop
if (StdHeader->HeapStatus != HEAP_DO_NOT_EXIST_YET ) {
LibAmdMsrRead (TSC, &CurrentTsc, StdHeader);
LocateHeapStructPtr.BufferHandle = IDS_CHECK_POINT_PERF_HANDLE;
LocateHeapStructPtr.BufferPtr = NULL;
status = HeapLocateBuffer (&LocateHeapStructPtr, StdHeader);
if (status == AGESA_SUCCESS) {
PerfTableEntry = (TP_Perf_STRUCT *) (LocateHeapStructPtr.BufferPtr);
} else {
AllocHeapParams.RequestedBufferSize = sizeof (TP_Perf_STRUCT);
AllocHeapParams.BufferHandle = IDS_CHECK_POINT_PERF_HANDLE;
AllocHeapParams.Persist = HEAP_SYSTEM_MEM;
status = HeapAllocateBuffer (&AllocHeapParams, StdHeader);
if (status != AGESA_SUCCESS) {
return status;
}
PerfTableEntry = (TP_Perf_STRUCT *) (AllocHeapParams.BufferPtr);
LibAmdMemFill (PerfTableEntry, 0, sizeof (TP_Perf_STRUCT), StdHeader);
}
Index = PerfTableEntry ->Index;
//TPPerfUnit doesn't need to check, it may used for multiple time, used to check the time
// consumption of each perf measure routine.
if ((TestPoint != TpPerfUnit)) {
for (i = 0; i < Index; i++) {
if ((UINT8) TestPoint == PerfTableEntry ->TP[i].TestPoint) {
return AGESA_SUCCESS;
}
}
}
PerfTableEntry ->TP[Index].TestPoint = (UINT8) TestPoint;
PerfTableEntry ->TP[Index].StartTsc = CurrentTsc;
PerfTableEntry ->Index = ++Index;
}
return AGESA_SUCCESS;
}
示例9: IdsPerfAnalyseTimestamp
/**
* Output Test Point function .
*
* @param[in,out] StdHeader The Pointer of Standard Header.
*
* @retval AGESA_SUCCESS Success to get the pointer of IDS_CHECK_POINT_PERF_HANDLE.
* @retval AGESA_ERROR Fail to get the pointer of IDS_CHECK_POINT_PERF_HANDLE.
*
**/
AGESA_STATUS
IdsPerfAnalyseTimestamp (
IN OUT AMD_CONFIG_PARAMS *StdHeader
)
{
AGESA_STATUS status;
LOCATE_HEAP_PTR LocateHeapStructPtr;
UINT32 TscRateInMhz;
CPU_SPECIFIC_SERVICES *FamilySpecificServices;
IDS_CALLOUT_STRUCT IdsCalloutData;
AGESA_STATUS Status;
PERFREGBACKUP PerfReg;
UINT32 CR4reg;
UINT64 SMsr;
LocateHeapStructPtr.BufferHandle = IDS_CHECK_POINT_PERF_HANDLE;
LocateHeapStructPtr.BufferPtr = NULL;
status = HeapLocateBuffer (&LocateHeapStructPtr, StdHeader);
if (status != AGESA_SUCCESS) {
return status;
}
GetCpuServicesOfCurrentCore (&FamilySpecificServices, StdHeader);
FamilySpecificServices->GetTscRate (FamilySpecificServices, &TscRateInMhz, StdHeader);
((TP_Perf_STRUCT *) (LocateHeapStructPtr.BufferPtr)) ->TscInMhz = TscRateInMhz;
((TP_Perf_STRUCT *) (LocateHeapStructPtr.BufferPtr)) ->Version = IDS_PERF_VERSION;
IdsCalloutData.IdsNvPtr = NULL;
IdsCalloutData.StdHeader = *StdHeader;
IdsCalloutData.Reserved = 0;
Status = AgesaGetIdsData (IDS_CALLOUT_GET_PERF_BUFFER, &IdsCalloutData);
//Check if Platform BIOS provide a buffer to copy
if ((Status == AGESA_SUCCESS) && (IdsCalloutData.Reserved != 0)) {
LibAmdMemCopy ((VOID *)IdsCalloutData.Reserved, LocateHeapStructPtr.BufferPtr, sizeof (TP_Perf_STRUCT), StdHeader);
} else {
//No platform performance buffer provide, use the default HDTOUT output
if (AmdIdsHdtOutSupport () == FALSE) {
//Init break point
IdsPerfSaveReg (&PerfReg, StdHeader);
LibAmdMsrRead (0xC001100A, (UINT64 *)&SMsr, StdHeader);
SMsr |= 1;
LibAmdMsrWrite (0xC001100A, (UINT64 *)&SMsr, StdHeader);
LibAmdWriteCpuReg (DR2_REG, 0x99cc);
LibAmdWriteCpuReg (DR7_REG, 0x02000420);
LibAmdReadCpuReg (CR4_REG, &CR4reg);
LibAmdWriteCpuReg (CR4_REG, CR4reg | ((UINT32)1 << 3));
IdsPerfHdtOut (1, (UINT32) (UINT64) LocateHeapStructPtr.BufferPtr, StdHeader);
IdsPerfRestoreReg (&PerfReg, StdHeader);
}
}
return status;
}
示例10: IdsPerfTimestamp
/**
*
* Get Ids Performance analysis table pointer in the AGESA Heap.
*
* @param[in] LineInFile ((FILECODE) shift 16)+ Line number
* @param[in] Description ID for Description define idsperf.h
* @param[in,out] StdHeader The Pointer of AGESA Header
*
* @retval AGESA_SUCCESS Success to get the pointer of Performance analysis Table.
* @retval AGESA_ERROR Fail to get the pointer of Performance analysis Table.
* @retval AGESA_UNSUPPORTED Get an exclude testpoint
*
**/
AGESA_STATUS
IdsPerfTimestamp (
IN UINT32 LineInFile,
IN UINT32 Description,
IN OUT AMD_CONFIG_PARAMS *StdHeader
)
{
AGESA_STATUS status;
UINT32 Index;
TP_Perf_STRUCT *PerfTableEntry;
ALLOCATE_HEAP_PARAMS AllocHeapParams;
LOCATE_HEAP_PTR LocateHeapStructPtr;
UINT64 TscAtBegining;
UINT64 TscAtEnd;
//if heap is not ready yet, don't invoke locate buffer, or else will cause event log & locate heap dead loop
if (StdHeader->HeapStatus != HEAP_DO_NOT_EXIST_YET ) {
IdsGetGtsc (&TscAtBegining, StdHeader);
LocateHeapStructPtr.BufferHandle = IDS_CHECK_POINT_PERF_HANDLE;
LocateHeapStructPtr.BufferPtr = NULL;
status = HeapLocateBuffer (&LocateHeapStructPtr, StdHeader);
if (status == AGESA_SUCCESS) {
PerfTableEntry = (TP_Perf_STRUCT *) (LocateHeapStructPtr.BufferPtr);
} else {
AllocHeapParams.RequestedBufferSize = sizeof (TP_Perf_STRUCT);
AllocHeapParams.BufferHandle = IDS_CHECK_POINT_PERF_HANDLE;
AllocHeapParams.Persist = HEAP_SYSTEM_MEM;
status = HeapAllocateBuffer (&AllocHeapParams, StdHeader);
if (status != AGESA_SUCCESS) {
return status;
}
PerfTableEntry = (TP_Perf_STRUCT *) (AllocHeapParams.BufferPtr);
LibAmdMemFill (PerfTableEntry, 0, sizeof (TP_Perf_STRUCT), StdHeader);
PerfTableEntry->Signature = 'FREP';
PerfTableEntry->Version = IDS_PERF_VERSION;
}
Index = PerfTableEntry ->Index;
if (Index >= MAX_PERFORMANCE_UNIT_NUM - 1) {
ASSERT (FALSE);
return AGESA_WARNING;
}
// Read GTSC again, so we could calculate the time consumed by this routine
IdsGetGtsc (&TscAtEnd, StdHeader);
PerfTableEntry ->TP[Index].LineInFile = LineInFile;
PerfTableEntry ->TP[Index].Description = Description;
PerfTableEntry ->TP[Index].StartTsc = TscAtBegining - PerfTableEntry ->TP[MAX_PERFORMANCE_UNIT_NUM - 1].StartTsc;
PerfTableEntry ->TP[MAX_PERFORMANCE_UNIT_NUM - 1].StartTsc += TscAtEnd - TscAtBegining; // Using the last TP to record the total time consumed by this routine
PerfTableEntry ->Index = ++Index;
}
return AGESA_SUCCESS;
}
示例11: IdsPerfTimestamp
/**
*
* Get Ids Performance analysis table pointer in the AGESA Heap.
*
* @param[in] LineInFile ((FILECODE) shift 16)+ Line number
* @param[in] Description ID for Description define idsperf.h
* @param[in,out] StdHeader The Pointer of AGESA Header
*
* @retval AGESA_SUCCESS Success to get the pointer of Performance analysis Table.
* @retval AGESA_ERROR Fail to get the pointer of Performance analysis Table.
* @retval AGESA_UNSUPPORTED Get an exclude testpoint
*
**/
AGESA_STATUS
IdsPerfTimestamp (
IN UINT32 LineInFile,
IN UINT32 Description,
IN OUT AMD_CONFIG_PARAMS *StdHeader
)
{
AGESA_STATUS status;
UINT32 Index;
TP_Perf_STRUCT *PerfTableEntry;
ALLOCATE_HEAP_PARAMS AllocHeapParams;
LOCATE_HEAP_PTR LocateHeapStructPtr;
UINT64 CurrentTsc;
//if heap is not ready yet, don't invoke locate buffer, or else will cause event log & locate heap dead loop
if (StdHeader->HeapStatus != HEAP_DO_NOT_EXIST_YET ) {
LibAmdMsrRead (TSC, &CurrentTsc, StdHeader);
LocateHeapStructPtr.BufferHandle = IDS_CHECK_POINT_PERF_HANDLE;
LocateHeapStructPtr.BufferPtr = NULL;
status = HeapLocateBuffer (&LocateHeapStructPtr, StdHeader);
if (status == AGESA_SUCCESS) {
PerfTableEntry = (TP_Perf_STRUCT *) (LocateHeapStructPtr.BufferPtr);
} else {
AllocHeapParams.RequestedBufferSize = sizeof (TP_Perf_STRUCT);
AllocHeapParams.BufferHandle = IDS_CHECK_POINT_PERF_HANDLE;
AllocHeapParams.Persist = HEAP_SYSTEM_MEM;
status = HeapAllocateBuffer (&AllocHeapParams, StdHeader);
if (status != AGESA_SUCCESS) {
return status;
}
PerfTableEntry = (TP_Perf_STRUCT *) (AllocHeapParams.BufferPtr);
LibAmdMemFill (PerfTableEntry, 0, sizeof (TP_Perf_STRUCT), StdHeader);
PerfTableEntry->Signature = 'FREP';
PerfTableEntry->Version = IDS_PERF_VERSION;
}
Index = PerfTableEntry ->Index;
if (Index >= MAX_PERFORMANCE_UNIT_NUM) {
return AGESA_WARNING;
}
ASSERT (Index < MAX_PERFORMANCE_UNIT_NUM);
PerfTableEntry ->TP[Index].LineInFile = LineInFile;
PerfTableEntry ->TP[Index].Description = Description;
PerfTableEntry ->TP[Index].StartTsc = CurrentTsc;
PerfTableEntry ->Index = ++Index;
}
return AGESA_SUCCESS;
}
示例12: GnbLocateHeapBuffer
VOID *
GnbLocateHeapBuffer (
IN UINT32 Handle,
IN AMD_CONFIG_PARAMS *StdHeader
)
{
AGESA_STATUS Status;
LOCATE_HEAP_PTR LocHeapParams;
LocHeapParams.BufferHandle = Handle;
Status = HeapLocateBuffer (&LocHeapParams, StdHeader);
if (Status != AGESA_SUCCESS) {
return NULL;
}
return LocHeapParams.BufferPtr;
}
示例13: AcpiCditHBufferFind
/**
*
* Find out the pointer to the BufferHandle which contains
* Node Topology information
*
* @param[in, out] StdHeader Standard Head Pointer
* @param[in] SocketTopologyPtr Point to the address of Socket Topology
*
*/
VOID
STATIC
AcpiCditHBufferFind (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN UINT8 **SocketTopologyPtr
)
{
LOCATE_HEAP_PTR LocateBuffer;
LocateBuffer.BufferHandle = HOP_COUNT_TABLE_HANDLE;
if (HeapLocateBuffer (&LocateBuffer, StdHeader) == AGESA_SUCCESS) {
*SocketTopologyPtr = (UINT8 *) LocateBuffer.BufferPtr;
}
return;
}
示例14: F15TnPmNbAfterReset
/**
* Family 15h Trinity core 0 entry point for performing the necessary steps after
* a warm reset has occurred.
*
* The steps are as follows:
*
* 1. Temp1=D18F5x170[SwNbPstateLoDis].
* 2. Temp2=D18F5x170[NbPstateDisOnP0].
* 3. Temp3=D18F5x170[NbPstateThreshold].
* 4. Temp4=D18F5x170[NbPstateGnbSlowDis].
* 5. If MSRC001_0070[NbPstate]=0, go to step 6. If MSRC001_0070[NbPstate]=1, go to step 11.
* 6. Write 1 to D18F5x170[NbPstateGnbSlowDis].
* 7. Write 0 to D18F5x170[SwNbPstateLoDis, NbPstateDisOnP0, NbPstateThreshold].
* 8. Wait for D18F5x174[CurNbPstate] = D18F5x170[NbPstateLo] and D18F5x174[CurNbFid, CurNb-
* Did]=[NbFid, NbDid] from D18F5x1[6C:60] indexed by D18F5x170[NbPstateLo].
* 9. Set D18F5x170[SwNbPstateLoDis]=1.
* 10. Wait for D18F5x174[CurNbPstate] = D18F5x170[NbPstateHi] and D18F5x174[CurNbFid, CurNb-
* Did]=[NbFid, NbDid] from D18F5x1[6C:60] indexed by D18F5x170[NbPstateHi]. Go to step 15.
* 11. Write 1 to D18F5x170[SwNbPstateLoDis].
* 12. Wait for D18F5x174[CurNbPstate] = D18F5x170[NbPstateHi] and D18F5x174[CurNbFid, CurNb-
* Did]=[NbFid, NbDid] from D18F5x1[6C:60] indexed by D18F5x170[NbPstateHi].
* 13. Write 0 to D18F5x170[SwNbPstateLoDis, NbPstateDisOnP0, NbPstateThreshold].
* 14. Wait for D18F5x174[CurNbPstate] = D18F5x170[NbPstateLo] and D18F5x174[CurNbFid, CurNb-
* Did]=[NbFid, NbDid] from D18F5x1[6C:60] indexed by D18F5x170[NbPstateLo].
* 15. Set D18F5x170[SwNbPstateLoDis]=Temp1, D18F5x170[NbPstateDisOnP0]=Temp2, D18F5x170[NbP-
* stateThreshold]=Temp3, and D18F5x170[NbPstateGnbSlowDis]=Temp4.
*
* @param[in] FamilySpecificServices The current Family Specific Services.
* @param[in] CpuEarlyParamsPtr Service parameters
* @param[in] StdHeader Config handle for library and services.
*
*/
VOID
F15TnPmNbAfterReset (
IN CPU_SPECIFIC_SERVICES *FamilySpecificServices,
IN AMD_CPU_EARLY_PARAMS *CpuEarlyParamsPtr,
IN AMD_CONFIG_PARAMS *StdHeader
)
{
UINT32 Socket;
UINT32 Module;
UINT32 Core;
UINT32 TaskedCore;
UINT32 Ignored;
AP_TASK TaskPtr;
PCI_ADDR PciAddress;
AGESA_STATUS IgnoredSts;
LOCATE_HEAP_PTR Locate;
IDS_HDT_CONSOLE (CPU_TRACE, " F15TnPmNbAfterReset\n");
IdentifyCore (StdHeader, &Socket, &Module, &Core, &IgnoredSts);
ASSERT (Core == 0);
if (FamilySpecificServices->IsNbPstateEnabled (FamilySpecificServices, &CpuEarlyParamsPtr->PlatformConfig, StdHeader)) {
PciAddress.AddressValue = NB_PSTATE_CTRL_PCI_ADDR;
Locate.BufferHandle = AMD_CPU_NB_PSTATE_FIXUP_HANDLE;
if (HeapLocateBuffer (&Locate, StdHeader) == AGESA_SUCCESS) {
LibAmdPciWrite (AccessWidth32, PciAddress, Locate.BufferPtr, StdHeader);
} else {
ASSERT (FALSE);
}
}
// Launch one core per node.
TaskPtr.FuncAddress.PfApTask = F15TnPmNbAfterResetOnCore;
TaskPtr.DataTransfer.DataSizeInDwords = 0;
TaskPtr.ExeFlags = WAIT_FOR_CORE;
for (Module = 0; Module < GetPlatformNumberOfModules (); Module++) {
if (GetGivenModuleCoreRange (Socket, Module, &TaskedCore, &Ignored, StdHeader)) {
if (TaskedCore != 0) {
ApUtilRunCodeOnSocketCore ((UINT8) Socket, (UINT8) TaskedCore, &TaskPtr, StdHeader);
}
}
}
ApUtilTaskOnExecutingCore (&TaskPtr, StdHeader, (VOID *) CpuEarlyParamsPtr);
}
示例15: S3ScriptGetS3SaveTable
/**
* Initialize S3 Script framework
*
*
*
* @param[in] StdHeader Pointer to standard header
* @param[out] S3SaveTable S3 save table header
*/
AGESA_STATUS
S3ScriptGetS3SaveTable (
IN AMD_CONFIG_PARAMS *StdHeader,
OUT S3_SAVE_TABLE_HEADER **S3SaveTable
)
{
AGESA_STATUS Status;
LOCATE_HEAP_PTR LocHeapParams;
LocHeapParams.BufferHandle = AMD_S3_SCRIPT_SAVE_TABLE_HANDLE;
Status = HeapLocateBuffer (&LocHeapParams, StdHeader);
if (Status != AGESA_SUCCESS) {
*S3SaveTable = NULL;
return Status;
}
*S3SaveTable = (S3_SAVE_TABLE_HEADER *) LocHeapParams.BufferPtr;
return AGESA_SUCCESS;
}