From 870fead39cb9e380c96abafe6fbf3b9ffec9bc29 Mon Sep 17 00:00:00 2001 From: Sven Peter Date: Wed, 17 Feb 2021 21:34:25 +0100 Subject: [PATCH] proxyclient: add ops for writeread{8,16,32,64} Signed-off-by: Sven Peter --- proxyclient/proxy.py | 13 +++++++++++++ src/proxy.c | 17 +++++++++++++++++ src/proxy.h | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/proxyclient/proxy.py b/proxyclient/proxy.py index 09170b40..2bf79fed 100755 --- a/proxyclient/proxy.py +++ b/proxyclient/proxy.py @@ -308,6 +308,10 @@ class M1N1Proxy: P_MASK32 = 0x111 P_MASK16 = 0x112 P_MASK8 = 0x113 + P_WRITEREAD64 = 0x114 + P_WRITEREAD32 = 0x115 + P_WRITEREAD16 = 0x116 + P_WRITEREAD8 = 0x117 P_MEMCPY64 = 0x200 P_MEMCPY32 = 0x201 @@ -487,6 +491,15 @@ class M1N1Proxy: def mask8(self, addr, clear, set): self.request(self.P_MASK8, addr, clear, set) + def writeread64(self, addr, data): + return self.request(self.P_WRITEREAD64, addr, data) + def writeread32(self, addr, data): + return self.request(self.P_WRITEREAD32, addr, data) + def writeread16(self, addr, data): + return self.request(self.P_WRITEREAD16, addr, data) + def writeread8(self, addr, data): + return self.request(self.P_WRITEREAD8, addr, data) + def memcpy64(self, dst, src, size): if src & 7 or dst & 7: raise AlignmentError() diff --git a/src/proxy.c b/src/proxy.c index 9c5b82f5..afd4f8b4 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -149,6 +149,23 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply) reply->retval = mask8(request->args[0], request->args[1], request->args[2]); break; + case P_WRITEREAD64: + exc_guard = GUARD_MARK; + reply->retval = writeread64(request->args[0], request->args[1]); + break; + case P_WRITEREAD32: + exc_guard = GUARD_MARK; + reply->retval = writeread32(request->args[0], request->args[1]); + break; + case P_WRITEREAD16: + exc_guard = GUARD_MARK; + reply->retval = writeread16(request->args[0], request->args[1]); + break; + case P_WRITEREAD8: + exc_guard = GUARD_MARK; + reply->retval = writeread8(request->args[0], request->args[1]); + break; + case P_MEMCPY64: exc_guard = GUARD_RETURN; memcpy64((void *)request->args[0], (void *)request->args[1], request->args[2]); diff --git a/src/proxy.h b/src/proxy.h index 8b931141..13bcec08 100644 --- a/src/proxy.h +++ b/src/proxy.h @@ -36,6 +36,10 @@ typedef enum { P_MASK32, P_MASK16, P_MASK8, + P_WRITEREAD64, + P_WRITEREAD32, + P_WRITEREAD16, + P_WRITEREAD8, P_MEMCPY64 = 0x200, // Memory block transfer functions P_MEMCPY32,