mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-26 00:10:18 +00:00
sysreg.py: Add sysreg_name() helper
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
a519af2ca8
commit
5bea278509
1 changed files with 5 additions and 0 deletions
|
@ -14,6 +14,11 @@ sysreg_fwd = dict(load_registers())
|
|||
sysreg_rev = {v: k for k, v in sysreg_fwd.items()}
|
||||
globals().update(sysreg_fwd)
|
||||
|
||||
def sysreg_name(enc):
|
||||
if enc in sysreg_rev:
|
||||
return sysreg_rev[enc]
|
||||
return f"s{enc[0]}_{enc[1]}_c{enc[2]}_c{enc[3]}_{enc[4]}"
|
||||
|
||||
class ESR_EC(IntEnum):
|
||||
UNKNOWN = 0b000000
|
||||
WFI = 0b000001
|
||||
|
|
Loading…
Reference in a new issue