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.

B3.13.3 Address translation<br />

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

The following pseudocode describes address translation in a VMSA implementation:<br />

// TranslateAddressV()<br />

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

AddressDescriptor TranslateAddressV(bits(32) va, boolean ispriv, boolean iswrite)<br />

mva = FCSETranslate(va);<br />

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

(tlbhit, tlbrecord) = CheckTLB(CONTEXTIDR.ASID, mva);<br />

if !tlbhit then<br />

tlbrecord = TranslationTableWalk(mva, iswrite);<br />

if CheckDomain(tlbrecord.domain, mva, tlbrecord.sectionnotpage, iswrite) then<br />

CheckPermission(tlbrecord.perms, mva, tlbrecord.sectionnotpage, iswrite, ispriv);<br />

else<br />

tlbrecord = TranslationTableWalk(mva, iswrite);<br />

return tlbrecord.addrdesc;<br />

B3.13.4 Domain checking<br />

The following pseudocode describes domain checking:<br />

// CheckDomain()<br />

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

boolean CheckDomain(bits(4) domain, bits(32) mva, boolean sectionnotpage, boolean iswrite)<br />

bitpos = 2*UInt(domain);<br />

case DACR of<br />

when ‘00’ DataAbort(mva, domain, sectionnotpage, iswrite, DAbort_Domain);<br />

when ‘01’ permissioncheck = TRUE;<br />

when ‘10’ UNPREDICTABLE;<br />

when ‘11’ permissioncheck = FALSE;<br />

return permissioncheck;<br />

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

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

Saved successfully!

Ooh no, something went wrong!