05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Virtual Memory System <strong>Architecture</strong> (VMSA)<br />

B3.13.5 TLB operations<br />

The TLBRecord type represents the contentsof a TLB entry:<br />

// Types of TLB entry<br />

enumeration TLBRecType = { TLBRecType_SmallPage,<br />

TLBRecType_LargePage,<br />

TLBRecType_Section,<br />

TLBRecType_Supersection,<br />

TLBRecType_MMUDisabled<br />

};<br />

type TLBRecord is (<br />

Permissions perms,<br />

bit nG, // ‘0’ = Global, ‘1’ = not Global<br />

bits(4) domain,<br />

boolean sectionnotpage,<br />

TLBRecType type,<br />

AddressDescriptor addrdesc<br />

)<br />

The CheckTLB() function checks whether the TLB contains an entry that matches an ASID <strong>and</strong> address, <strong>and</strong><br />

returns TRUE <strong>and</strong> the matching TLBRecord if so. Otherwise, it returns FALSE <strong>and</strong> an UNKNOWN TLBRecord.<br />

(boolean, TLBRecord) CheckTLB(bits(8) asid, bits(32) address)<br />

The AssignToTLB() procedure supplies an ASID <strong>and</strong> new TLBRecord to the TLB, for possible allocation to a<br />

TLB entry. It is IMPLEMENTATION DEFINED under what circumstances this allocation takes place, <strong>and</strong> TLB<br />

entries might also be allocated at other times.<br />

AssignToTLB(bits(8) asid, bits(32) mva, TLBRecord entry)<br />

B3.13.6 Translation table walk<br />

The following pseudocode describes the translation table walk operation:<br />

// TranslationTableWalk()<br />

// ======================<br />

//<br />

// Returns a result of a translation table walk in TLBRecord form.<br />

TLBRecord TranslationTableWalk(bits(32) mva, boolean is_write)<br />

TLBRecord result;<br />

AddressDescriptor l1descaddr;<br />

AddressDescriptor l2descaddr;<br />

if SCTLR.M == ‘1’ then // MMU is enabled<br />

domain = bits(4) UNKNOWN; // For Data Abort exceptions found before a domain is known<br />

// Determine correct Translation Table Base Register to use.<br />

n = UInt(TTBCR.N);<br />

B3-158 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

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

Saved successfully!

Ooh no, something went wrong!