summaryrefslogtreecommitdiff
path: root/util/cpt_upgraders/arm-contextidr-el2.py
blob: 9910ded78b0f08e8f1d5a1064f1b6df5a99668e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Add the ARM CONTEXTIDR_EL2 miscreg.
def upgrader(cpt):
    if cpt.get('root','isa') == 'arm':
        for sec in cpt.sections():
            import re
            # Search for all ISA sections
            if re.search('.*sys.*\.cpu.*\.isa$', sec):
                miscRegs = cpt.get(sec, 'miscRegs').split()
                # CONTEXTIDR_EL2 defaults to 0b11111100000000000001
                miscRegs[599:599] = [0xFC001]
                cpt.set(sec, 'miscRegs', ' '.join(str(x) for x in miscRegs))

legacy_version = 14