//-------------------------------------------------------------------------------- // BTSenableAtom.mac: BTS trace (DRAM) setup //-------------------------------------------------------------------------------- // create data store in DRAM puts("** Creating data store in DRAM **\n") define ord8 dsBase = 0x100000 // data store base address define ord8 dsLength = 0x1000 // data store size define ord8 dsOverheadAreaSize = 0x50 // data store overhead area siz //-------------------------------------------------------------------------------- // common code for DS/BTS initialization (DRAM) // // See Intel 64 and IA-32 Architecture Software Developer's Guide, Volume 3b, // Chapter 18 for more information //-------------------------------------------------------------------------------- // write DS base address MSR IA32_DS_AREA = dsBase // calculate BTS base address (just past overhead area) define ord8 btsBase = dsBase + dsOverheadAreaSize // calculate BTS entry size define ord4 nBtmSize = 0n64 //stevelan (isem64t ? 24T : 12T) // calculate number of entries in BTS define ord4 nBtsEntries = (dsLength - dsOverheadAreaSize) / nBtmSize // calculate BTS max address (1 byte past the last entry) define ord8 btsMax = btsBase + nBtsEntries * nBtmSize // initialize 32-bit DS overhead area ord4 dsBase = btsBase // set bts base address ord4 (dsBase + 0x04) = 0x0 // High word clear ord4 (dsBase + 0x08) = btsBase +8 // set bts index to start of bts ord4 (dsBase + 0x0C) = 0x0 // High word clear ord4 (dsBase + 0x10) = btsMax + 0x28 // set bts max address ord4 (dsBase + 0x14) = 0x0 // High word clear ord4 (dsBase + 0x18) = btsMax + 0x28 // set bts interrupt threshold past max (to disable) ord4 (dsBase + 0x1C) = 0x0 // High word clear