13.07.2015 Views

Cortex-A8 R2P2.pdf - ARM Information Center

Cortex-A8 R2P2.pdf - ARM Information Center

Cortex-A8 R2P2.pdf - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Debug}*data++ := ReadRegister(1);--nbytes;}// Step 5. Restore the corrupted registers r0 and r1.WriteRegister(0, saved_r0);WriteRegister(1, saved-r1);// Step 6. Check the DSCR for a sticky abort.aborted := CheckForAborts();return datum;Example 12-21 shows the sequence for reading a word of memory.NoteA faster method is available for reading and writing words using the direct memoryaccess function of the DCC. See Fast memory read/write on page 12-112.Example 12-21 Reading a word of memoryuint32 ReadWord(uint32 address, bool &aborted){// Step 1. Save the value of r0.saved_r0 := ReadRegister(0);// Step 2. Write the address to r0.WriteRegister(0, address);// Step 3. Execute instruction STC p14, c5, [r0] through the ITR.Execute<strong>ARM</strong>Instruction(0xED905E00);// Step 4. Read the value from the DTR directly.datum := ReadDCC();// Step 5. Restore the corrupted register r0.WriteRegister(0, saved_r0);// Step 6. Check the DSCR for a sticky abort.aborted := CheckForAborts();return datum;}Fast register read/writeWhen multiple registers must be read in succession, you can optimize the process byplacing the DCC into stall mode and by writing the value 1 to the DCC access modebits. For more information, see CP14 c1, Debug Status and Control Register onpage 12-21.12-110 Copyright © 2006-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0344E

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!