MCPcopy
hub / github.com/AsahiLinux/m1n1 / sysreg_parse

Function sysreg_parse

proxyclient/m1n1/sysreg.py:44–61  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

42 return f"s{enc[0]}_{enc[1]}_c{enc[2]}_c{enc[3]}_{enc[4]}"
43
44def sysreg_parse(s):
45 if isinstance(s, tuple) or isinstance(s, list):
46 return tuple(s)
47 s = s.strip()
48 for r in (r"s(\d+)_(\d+)_c(\d+)_c(\d+)_(\d+)", r"(\d+), *(\d+), *(\d+), *(\d+), *(\d+)"):
49 if m := re.match(r, s):
50 enc = tuple(map(int, m.groups()))
51 break
52 else:
53 for i in sysreg_fwd, sysop_fwd, sysop_fwd_id:
54 try:
55 enc = i[s]
56 except KeyError:
57 continue
58 break
59 else:
60 raise Exception(f"Unknown sysreg name {s}")
61 return enc
62
63def DBGBCRn_EL1(n):
64 return (2,0,0,n,5)

Callers 2

mrsMethod · 0.85
msrMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected