09.12.2012 Views

Cortex-A8 Technical Reference Manual - ARM Information Center

Cortex-A8 Technical Reference Manual - ARM Information Center

Cortex-A8 Technical Reference Manual - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.6 Operating system and predictor context<br />

5.6.1 Instruction memory barriers<br />

Program Flow Prediction<br />

The BTB does not have to be invalidated on a context switch, self-modifying code, or any other<br />

change in the VA-to-PA mapping.<br />

<strong>ARM</strong>v7-A specifies two branch prediction invalidation operations:<br />

• MCR p15, 0, Rx, c7, c5, 6 ; invalidate entire branch predictor array<br />

• MCR p15, 0, Rx, c7, c5, 7 ; invalidate VA from branch predictor array<br />

These operations are not required to perform a context switch in the processor and are<br />

implemented as NOPs. <strong>ARM</strong>v7-A generic context-switching or self-modifying code can<br />

contain these operations without cycle penalty. These instructions can be enabled by setting the<br />

IBE bit in the Auxiliary Control Register to 1. See c1, Auxiliary Control Register on page 3-47<br />

for details.<br />

<strong>ARM</strong>v7-A requires Instruction Memory Barriers (IMBs) after updates to certain CP15 registers<br />

or CP15 operations. The processor flushes the pipeline to ensure that the instructions following<br />

the given CP15 instruction are fetched in the new context. In addition, self-modifying code<br />

sequences must be preceded by an IMB. The recommended means of implementing an IMB is<br />

the ISB instruction.<br />

The following prefetch flush instruction is from earlier versions of the <strong>ARM</strong> architecture. The<br />

processor supports this instruction, but its use is deprecated in <strong>ARM</strong>v7-A.<br />

MCR p15, 0, Rx, c7, c5, 4<br />

<strong>ARM</strong> DDI 0344K Copyright © 2006-2010 <strong>ARM</strong> Limited. All rights reserved. 5-9<br />

ID060510 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!