本文整理汇总了C++中MEM_NB_BLOCK::GetBitField方法的典型用法代码示例。如果您正苦于以下问题:C++ MEM_NB_BLOCK::GetBitField方法的具体用法?C++ MEM_NB_BLOCK::GetBitField怎么用?C++ MEM_NB_BLOCK::GetBitField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEM_NB_BLOCK
的用法示例。
在下文中一共展示了MEM_NB_BLOCK::GetBitField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
INT8
MemTGetLD3 (
IN OUT MEM_TECH_BLOCK *TechPtr
)
{
INT8 LD;
MEM_NB_BLOCK *NBPtr;
NBPtr = TechPtr->NBPtr;
//
// For DDR3, BIOS calculates the latency difference (Ld) as equal to read CAS latency minus write CAS
// latency, in MEMCLKs (see F2x[1, 0]88[Tcl] and F2x[1, 0]84[Tcwl]) which can be a negative or positive
// value.
//
LD = ((INT8) NBPtr->GetBitField (NBPtr, BFTcl) + 4) - ((INT8) NBPtr->GetBitField (NBPtr, BFTcwl) + 5);
return LD;
}
示例2:
VOID
MemRecTEMRS13 (
IN OUT MEM_TECH_BLOCK *TechPtr
)
{
UINT16 MrsAddress;
UINT8 DramTerm;
MEM_NB_BLOCK *NBPtr;
NBPtr = TechPtr->NBPtr;
// BA2=0,BA1=0,BA0=1
NBPtr->SetBitField (NBPtr, BFMrsBank, 1);
MrsAddress = 0;
// program MrsAddress[5,1]=output driver impedance control (DIC):
// based on F2x[1,0]84[DrvImpCtrl], which is 2'b01
MrsAddress |= ((UINT16) 1 << 1);
// program MrsAddress[9,6,2]=nominal termination resistance of ODT (RTT):
// based on F2x[1,0]84[DramTerm], which is 3'b001 (60 Ohms)
if (!(NBPtr->IsSupported[CheckDramTerm])) {
DramTerm = (UINT8) NBPtr->GetBitField (NBPtr, BFDramTerm);
} else {
DramTerm = NBPtr->PsPtr->DramTerm;
}
if ((DramTerm & 1) != 0) {
MrsAddress |= ((UINT16) 1 << 2);
}
if ((DramTerm & 2) != 0) {
MrsAddress |= ((UINT16) 1 << 6);
}
if ((DramTerm & 4) != 0) {
MrsAddress |= ((UINT16) 1 << 9);
}
// program MrsAddress[12]=output disable (QOFF):
// based on F2x[1,0]84[Qoff], which is 1'b0
// program MrsAddress[11]=TDQS:
// based on F2x[1,0]94[RDqsEn], which is 1'b0
NBPtr->SetBitField (NBPtr, BFMrsAddress, MrsAddress);
}
示例3: ASSERT
/**
*
* This function is the interface to call the PCI register access function
* defined in NB block.
*
* @param[in] *NBPtr - Pointer to the parameter structure MEM_NB_BLOCK
* @param[in] NodeID - Node ID number of the target Northbridge
* @param[in] DctNum - DCT number if applicable, otherwise, put 0
* @param[in] BitFieldName - targeted bitfield
*
* @retval UINT32 - 32 bits PCI register value
*
*/
UINT32
MemFGetPCI (
IN MEM_NB_BLOCK *NBPtr,
IN UINT8 NodeID,
IN UINT8 DctNum,
IN BIT_FIELD_NAME BitFieldName
)
{
MEM_NB_BLOCK *LocalNBPtr;
UINT8 Die;
// Find NBBlock that associates with node NodeID
for (Die = 0; (Die < MAX_NODES_SUPPORTED) && (NBPtr[Die].Node != NodeID); Die ++);
ASSERT (Die < MAX_NODES_SUPPORTED);
// Get the northbridge pointer for the targeted node.
LocalNBPtr = &NBPtr[Die];
LocalNBPtr->FamilySpecificHook[DCTSelectSwitch] (LocalNBPtr, &DctNum);
LocalNBPtr->Dct = DctNum;
// The caller of this function will take care of the ganged/unganged situation.
// So Ganged is set to be false here, and do PCI read on the DCT specified by DctNum.
return LocalNBPtr->GetBitField (LocalNBPtr, BitFieldName);
}
示例4: LibAmdReadCpuReg
VOID
MemTBeginTraining (
IN OUT MEM_TECH_BLOCK *TechPtr
)
{
S_UINT64 SMsr;
MEM_DATA_STRUCT *MemPtr;
MEM_NB_BLOCK *NBPtr;
NBPtr = TechPtr->NBPtr;
MemPtr = NBPtr->MemPtr;
LibAmdReadCpuReg (CR4_REG, &TechPtr->CR4reg);
LibAmdWriteCpuReg (CR4_REG, TechPtr->CR4reg | ((UINT32)1 << 9)); // enable SSE2
LibAmdMsrRead (HWCR, (UINT64 *) (&SMsr), &MemPtr->StdHeader); // HWCR
TechPtr->HwcrLo = SMsr.lo;
SMsr.lo |= 0x00020000; // turn on HWCR.wrap32dis
SMsr.lo &= 0xFFFF7FFF; // turn off HWCR.SSEDIS
LibAmdMsrWrite (HWCR, (UINT64 *) (&SMsr), &MemPtr->StdHeader);
TechPtr->DramEcc = (UINT8) NBPtr->GetBitField (NBPtr, BFDramEccEn);
NBPtr->SetBitField (NBPtr, BFDramEccEn, 0); // Disable ECC
}