Skip to content

Commit 7f9eaec

Browse files
committed
m1n1.asm: Textually replace sysregs with their identifier
Signed-off-by: Hector Martin <[email protected]>
1 parent bdf54ba commit 7f9eaec

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

proxyclient/m1n1/asm.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: MIT
22
import os, tempfile, shutil, subprocess
3+
from . import sysreg
34

45
__all__ = ["AsmException", "ARMAsm"]
56

@@ -53,6 +54,9 @@ def _get(self, program, args):
5354
return subprocess.check_output(program.replace("%ARCH", self.ARCH) + " " + args, shell=True).decode("ascii")
5455

5556
def compile(self, source):
57+
for name, enc in sysreg.sysreg_fwd.items():
58+
source = source.replace(name, f"s{enc[0]}_{enc[1]}_c{enc[2]}_c{enc[3]}_{enc[4]}")
59+
5660
self.sfile = self._tmp + "b.S"
5761
with open(self.sfile, "w") as fd:
5862
fd.write(self.HEADER + "\n")

0 commit comments

Comments
 (0)