jennifer123
Hello every one, I am using visual C++ tool to debug the following code. However, during a line by line debug, the execution flow DOES NOT move to (#if defined INTEL_W32 ). I am using visual C++ on windows XP .
Can any one kindly tell me what is the MEANING of
#if defined INTEL_W32
===============================================
Debugging following program:
#if defined INTEL_W32
static Boolean fFirstTime = FALSE;
UInt32 ulLinearAddress;
UInt32 offset;
// Always register the atexit routine at least once, so any allocated
// resources are guaranteed to be released and freed. The function
// halpFreeLinearAddress is fully reentrant, so it can be called
// multiple times, in any order, without causing any harm.
if (!fFirstTime)
{ fFirstTime = TRUE;
printf("fFirstTime = %d \n",fFirstTime); // added
atexit(halpFreeLinearAddress);
}
// Use the configured register address to retrieve the linear address.
// NOTE: for PCI the register address should be zero, causing the VxD
// to locate the S1D13A05 in PCI address space.
if (HalInfo.dwRegisterAddress > HalInfo.dwMemoryAddress)
{
gnHalErrCode = halpGetLinearAddress(HalInfo.dwMemoryAddress, &ulLinearAddress);
if (gnHalErrCode != ERR_NONE)
return FALSE;
offset = HalInfo.dwRegisterAddress - HalInfo.dwMemoryAddress;
if (offset == 0)
offset = 0x200000;
gpHalMemAddr = (pvUInt32) ulLinearAddress;
gpHalRegAddr = (pvUInt32)(ulLinearAddress + offset);
}
else
{
gnHalErrCode = halpGetLinearAddress(HalInfo.dwRegisterAddress, &ulLinearAddress);
if (gnHalErrCode != ERR_NONE)
return FALSE;
offset = HalInfo.dwMemoryAddress - HalInfo.dwRegisterAddress;
if (offset == 0)
offset = 0x200000;
gpHalRegAddr = (pvUInt32) ulLinearAddress;
gpHalMemAddr = (pvUInt32)(ulLinearAddress + offset);
printf ("<<<<<<<<<gpHalMemAddr, %d \n",gpHalMemAddr); // added
printf ("<<<<<<<<<gpHalRegAddr, %d \n",gpHalRegAddr); //added
}
if (pReg)
*pReg = (UInt32) gpHalRegAddr;
if (pMem)
*pMem = (UInt32) gpHalMemAddr;
#else
// ********DEBUGGING WILL CONTINUE FROM HERE ******
gpHalRegAddr = (pvUInt32) HalInfo.dwRegisterAddress; gpHalMemAddr = (pvUInt32) HalInfo.dwMemoryAddress;
if (pReg)
*pReg = HalInfo.dwRegisterAddress;
if (pMem)
*pMem = HalInfo.dwMemoryAddress;
#endif
return TRUE;
}
Can any one kindly tell me what is the MEANING of
#if defined INTEL_W32
===============================================
Debugging following program:
#if defined INTEL_W32
static Boolean fFirstTime = FALSE;
UInt32 ulLinearAddress;
UInt32 offset;
// Always register the atexit routine at least once, so any allocated
// resources are guaranteed to be released and freed. The function
// halpFreeLinearAddress is fully reentrant, so it can be called
// multiple times, in any order, without causing any harm.
if (!fFirstTime)
{ fFirstTime = TRUE;
printf("fFirstTime = %d \n",fFirstTime); // added
atexit(halpFreeLinearAddress);
}
// Use the configured register address to retrieve the linear address.
// NOTE: for PCI the register address should be zero, causing the VxD
// to locate the S1D13A05 in PCI address space.
if (HalInfo.dwRegisterAddress > HalInfo.dwMemoryAddress)
{
gnHalErrCode = halpGetLinearAddress(HalInfo.dwMemoryAddress, &ulLinearAddress);
if (gnHalErrCode != ERR_NONE)
return FALSE;
offset = HalInfo.dwRegisterAddress - HalInfo.dwMemoryAddress;
if (offset == 0)
offset = 0x200000;
gpHalMemAddr = (pvUInt32) ulLinearAddress;
gpHalRegAddr = (pvUInt32)(ulLinearAddress + offset);
}
else
{
gnHalErrCode = halpGetLinearAddress(HalInfo.dwRegisterAddress, &ulLinearAddress);
if (gnHalErrCode != ERR_NONE)
return FALSE;
offset = HalInfo.dwMemoryAddress - HalInfo.dwRegisterAddress;
if (offset == 0)
offset = 0x200000;
gpHalRegAddr = (pvUInt32) ulLinearAddress;
gpHalMemAddr = (pvUInt32)(ulLinearAddress + offset);
printf ("<<<<<<<<<gpHalMemAddr, %d \n",gpHalMemAddr); // added
printf ("<<<<<<<<<gpHalRegAddr, %d \n",gpHalRegAddr); //added
}
if (pReg)
*pReg = (UInt32) gpHalRegAddr;
if (pMem)
*pMem = (UInt32) gpHalMemAddr;
#else
// ********DEBUGGING WILL CONTINUE FROM HERE ******
gpHalRegAddr = (pvUInt32) HalInfo.dwRegisterAddress; gpHalMemAddr = (pvUInt32) HalInfo.dwMemoryAddress;
if (pReg)
*pReg = HalInfo.dwRegisterAddress;
if (pMem)
*pMem = HalInfo.dwMemoryAddress;
#endif
return TRUE;
}