From 2e2b988f9e2818cb39d1642e3dedf9d8ff6483c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E5=B8=85=E9=94=85?= <37646748+0xjacklove@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:44:20 +0800 Subject: [PATCH] add ldaxr Add the ldaxr instruction --- miasm/arch/aarch64/sem.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/miasm/arch/aarch64/sem.py b/miasm/arch/aarch64/sem.py index eaa012286..af64f0ece 100644 --- a/miasm/arch/aarch64/sem.py +++ b/miasm/arch/aarch64/sem.py @@ -1355,6 +1355,15 @@ def ldrsh(ir, instr, arg1, arg2): def ldrsw(ir, instr, arg1, arg2): return ldrs_size(ir, instr, arg1, arg2, 32) +def ldaxr(ir, instr, arg1, arg2): + # TODO XXX no memory lock implemented + assert arg2.is_op('preinc') + assert len(arg2.args) == 1 + ptr = arg2.args[0] + e = [] + e.append(ExprAssign(arg1, ExprMem(ptr, arg1.size).zeroExtend(arg1.size))) + return e, [] + def ldaxrb(ir, instr, arg1, arg2): # TODO XXX no memory lock implemented assert arg2.is_op('preinc') @@ -2212,6 +2221,7 @@ def smull(arg1, arg2, arg3): 'ldar': ldr, # TODO memory barrier 'ldarb': ldrb, + 'ldaxr': ldaxr, 'ldaxrb': ldaxrb, 'stlxrb': stlxrb,