Applies the `pyupgrade` hook to all files in the repo. Change-Id: I9879c634a65c5fcaa9567c63bc5977ff97d5d3bf
16 lines
512 B
Python
16 lines
512 B
Python
# Remove the MISCREG_CPSR_MODE register from the ARM register file
|
|
def upgrader(cpt):
|
|
if cpt.get("root", "isa", fallback="") == "arm":
|
|
for sec in cpt.sections():
|
|
import re
|
|
|
|
# Search for all ISA sections
|
|
if re.search(r".*sys.*\.cpu.*\.isa$", sec):
|
|
mr = cpt.get(sec, "miscRegs").split()
|
|
# Remove MISCREG_CPSR_MODE
|
|
del mr[137]
|
|
cpt.set(sec, "miscRegs", " ".join(str(x) for x in mr))
|
|
|
|
|
|
legacy_version = 5
|