|
PLATFORM\COMMON\SRC\COMMON\OTHER\memory.c
中有
BOOL OEMGetExtensionDRAM(LPDWORD pMemoryStart, LPDWORD pMemoryLength)
{
return FALSE;
}
没有代码,直接返回了FALSE
我在PLATFORM\DEVICEEMULATOR\SRC\OAL\OALLIB\init.c中找到了一个此函数的实现代码
- BOOL
- OEMGetExtensionDRAM(
- LPDWORD lpMemStart,
- LPDWORD lpMemLen
- )
- {
- typedef volatile unsigned long MegOfExtendedRam_t[1024 * 1024 / sizeof (unsigned long)];
- MegOfExtendedRam_t *MegsOfRam = (MegOfExtendedRam_t *)EXTENDED_RAM_BASE;
- DWORD each_meg;
- const DWORD dwPageSize = 4096; // PAGE_SIZE in ceddk isn't valid until later in boot
- OALMSG(OAL_FUNC, (L"++OEMGetExtensionDRAM\r\n"));
- // Employ a simple memory test to see that all N meg's are there.
- // NB: Because an empty memory bus can "float" data for several
- // cycles and appear as valid memory, discharge the bus before
- // verifying the data.
- //
- // The probe is nondestructive, to allow the contents of extension
- // RAM to be preserved across soft resets
- try {
- for (each_meg = 0; each_meg < EXTENDED_RAM_MEGS; ++each_meg)
- {
- unsigned long temp0 = MegsOfRam[each_meg][0];
- unsigned long temp1 = MegsOfRam[each_meg][1];
- MegsOfRam[each_meg][0] = 0x55555555UL; // Write pattern
- MegsOfRam[each_meg][1] = ~0x55555555UL; // Discharge
- if (MegsOfRam[each_meg][0] != 0x55555555UL) // Verify patern
- break;
- MegsOfRam[each_meg][0] = ~0x55555555UL; // Write pattern-not
- MegsOfRam[each_meg][1] = 0x55555555UL; // Discharge
- if (MegsOfRam[each_meg][0] != ~0x55555555UL)
- break;
- MegsOfRam[each_meg][0] = temp0;
- MegsOfRam[each_meg][1] = temp1;
- }
- } except (EXCEPTION_EXECUTE_HANDLER) {
- OALMSG(OAL_FUNC, (L"--OEMGetExtensionDRAM\r\n"));
- return FALSE; // no extension DRAM
- }
- *lpMemStart = EXTENDED_RAM_BASE;
- *lpMemLen = each_meg * sizeof (MegOfExtendedRam_t);
- OALMSG(OAL_LOG_INFO, (L"OEMGetExtensionDRAM: found 0x%08x bytes of ram at 0x%08x\r\n",
- *lpMemLen, *lpMemStart));
- // adjust by RAM FMD amount
- if(g_dwExtensionRAMFMDSize != 0) {
- if((g_dwExtensionRAMFMDSize & (dwPageSize - 1)) != 0) {
- OALMSG(OAL_LOG_WARN,
- (L"OEMGetExtensionDRAM: g_dwExtensionRAMFMDSize 0x%08x not a multiple of %u\r\n",
- g_dwExtensionRAMFMDSize, dwPageSize));
- } else if(*lpMemLen < g_dwExtensionRAMFMDSize) {
- OALMSG(OAL_LOG_WARN,
- (L"OEMGetExtensionDRAM: 0x%08x bytes of extension ram not enough to satisfy FMD request for 0x%0x bytes\r\n",
- *lpMemLen, g_dwExtensionRAMFMDSize));
- } else {
- g_pvExtensionRAMFMDBaseAddr = (PVOID) EXTENDED_RAM_BASE;
- *lpMemStart = EXTENDED_RAM_BASE + g_dwExtensionRAMFMDSize;
- *lpMemLen -= g_dwExtensionRAMFMDSize;
- OALMSG(OAL_LOG_INFO, (L"OEMGetExtensionDRAM: reserving 0x%08x bytes of ram at 0x%08x for RAMFMD\r\n",
- g_dwExtensionRAMFMDSize, g_pvExtensionRAMFMDBaseAddr));
- }
- }
- OALMSG(OAL_LOG_INFO, (L"OEMGetExtensionDRAM: returning 0x%08x bytes of ram at 0x%08x\r\n",
- *lpMemLen, *lpMemStart));
- OALMSG(OAL_FUNC, (L"--OEMGetExtensionDRAM\r\n"));
- return TRUE;
- }
复制代码
有点搞不明白了 |
|