From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487958253928591.0472972824701; Fri, 24 Feb 2017 09:44:13 -0800 (PST) Received: from localhost ([::1]:38903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJue-0002Lc-Nm for importer@patchew.org; Fri, 24 Feb 2017 12:44:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmM-0003rr-DG for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmL-0004nt-DA for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:38 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmL-0004Og-5R for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:37 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmD-0008KT-Nu; Fri, 24 Feb 2017 17:35:29 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:20 +0000 Message-Id: <1487957728-8354-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 1/9] Drop the weird modification of a ucontext in the ppc reginfo_is_eq() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Maydell The PPC reginfo_is_eq() has some weird code which tries to modify a ucontext_t in the middle of comparing the two registers. I don't understand this, but this is definitely not the right place to do anything like this. Drop the weird code. Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- risu_ppc64le.c | 4 ++-- risu_reginfo_ppc64le.c | 10 +--------- risu_reginfo_ppc64le.h | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/risu_ppc64le.c b/risu_ppc64le.c index 9c1fafd..1c986a9 100644 --- a/risu_ppc64le.c +++ b/risu_ppc64le.c @@ -89,7 +89,7 @@ int recv_and_compare_register_info(int sock, void *uc) if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) { packet_mismatch =3D 1; resp =3D 2; - } else if (!reginfo_is_eq(&master_ri, &apprentice_ri, uc)) { + } else if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { resp =3D 2; } else if (op =3D=3D OP_TESTEND) { @@ -134,7 +134,7 @@ int report_match_status(void) fprintf(stderr, "master reginfo:\n"); reginfo_dump(&master_ri, 0); } - if (!reginfo_is_eq(&master_ri, &apprentice_ri, NULL)) { + if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { fprintf(stderr, "mismatch on regs!\n"); resp =3D 1; } diff --git a/risu_reginfo_ppc64le.c b/risu_reginfo_ppc64le.c index e6bc0e0..585d8b7 100644 --- a/risu_reginfo_ppc64le.c +++ b/risu_reginfo_ppc64le.c @@ -50,7 +50,7 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc) } =20 /* reginfo_is_eq: compare the reginfo structs, returns nonzero if equal */ -int reginfo_is_eq(struct reginfo *m, struct reginfo *a, ucontext_t *uc) +int reginfo_is_eq(struct reginfo *m, struct reginfo *a) { int i; for (i =3D 0; i < 32; i++) { @@ -86,14 +86,6 @@ int reginfo_is_eq(struct reginfo *m, struct reginfo *a, = ucontext_t *uc) m->vrregs.vrregs[i][1] !=3D a->vrregs.vrregs[i][1] || m->vrregs.vrregs[i][2] !=3D a->vrregs.vrregs[i][2] || m->vrregs.vrregs[i][3] !=3D a->vrregs.vrregs[i][3]) { - - if (uc !=3D NULL && (m->gregs[CCR] & 0x10)) { - uc->uc_mcontext.v_regs->vrregs[i][0] =3D a->vrregs.vrregs[= i][0]; - uc->uc_mcontext.v_regs->vrregs[i][1] =3D a->vrregs.vrregs[= i][1]; - uc->uc_mcontext.v_regs->vrregs[i][2] =3D a->vrregs.vrregs[= i][2]; - uc->uc_mcontext.v_regs->vrregs[i][3] =3D a->vrregs.vrregs[= i][3]; - return 1; - } return 0; } } diff --git a/risu_reginfo_ppc64le.h b/risu_reginfo_ppc64le.h index abe6002..49bb1aa 100644 --- a/risu_reginfo_ppc64le.h +++ b/risu_reginfo_ppc64le.h @@ -29,7 +29,7 @@ struct reginfo void reginfo_init(struct reginfo *ri, ucontext_t *uc); =20 /* return 1 if structs are equal, 0 otherwise. */ -int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2, ucontext_t *uc); +int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); =20 /* print reginfo state to a stream */ void reginfo_dump(struct reginfo *ri, int is_master); --=20 2.7.4 From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487958525646540.5849583287181; Fri, 24 Feb 2017 09:48:45 -0800 (PST) Received: from localhost ([::1]:38927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJz2-00071k-70 for importer@patchew.org; Fri, 24 Feb 2017 12:48:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmT-0003uv-HY for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmS-0005G3-0a for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:45 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmR-0004Og-No for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:43 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmE-0008Kj-CA; Fri, 24 Feb 2017 17:35:30 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:21 +0000 Message-Id: <1487957728-8354-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 2/9] Abstract out getting and setting parameter register X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Maydell The SETMEMBLOCK operation takes a parameter in a register, and GETMEMBLOCK returns a result in a register. Abstract these out into functions provided by the backend, so we can use common code for send_register_info() and recv_and_compare_register_info(). Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- risu.h | 11 +++++++++++ risu_aarch64.c | 19 +++++++++++++------ risu_arm.c | 20 ++++++++++++++------ risu_m68k.c | 19 +++++++++++++------ risu_ppc64le.c | 19 +++++++++++++------ 5 files changed, 64 insertions(+), 24 deletions(-) diff --git a/risu.h b/risu.h index 26ed834..4f923b2 100644 --- a/risu.h +++ b/risu.h @@ -37,6 +37,8 @@ extern int test_fp_exc; /* The memory block should be this long */ #define MEMBLOCKLEN 8192 =20 +struct reginfo; + /* Interface provided by CPU-specific code: */ =20 /* Send the register information from the struct ucontext down the socket. @@ -63,4 +65,13 @@ int report_match_status(void); */ void advance_pc(void *uc); =20 +/* Set the parameter register in a ucontext_t to the specified value. + * (32-bit targets can ignore high 32 bits.) + * vuc is a ucontext_t* cast to void*. + */ +void set_ucontext_paramreg(void *vuc, uint64_t value); + +/* Return the value of the parameter register from a reginfo. */ +uint64_t get_reginfo_paramreg(struct reginfo *ri); + #endif /* RISU_H */ diff --git a/risu_aarch64.c b/risu_aarch64.c index f150dcd..f13338d 100644 --- a/risu_aarch64.c +++ b/risu_aarch64.c @@ -30,10 +30,15 @@ void advance_pc(void *vuc) uc->uc_mcontext.pc +=3D 4; } =20 -static void set_x0(void *vuc, uint64_t x0) +void set_ucontext_paramreg(void *vuc, uint64_t value) { ucontext_t *uc =3D vuc; - uc->uc_mcontext.regs[0] =3D x0; + uc->uc_mcontext.regs[0] =3D value; +} + +uint64_t get_reginfo_paramreg(struct reginfo *ri) +{ + return ri->regs[0]; } =20 static int get_risuop(uint32_t insn) @@ -63,10 +68,11 @@ int send_register_info(int sock, void *uc) */ return send_data_pkt(sock, &ri, sizeof(ri)); case OP_SETMEMBLOCK: - memblock =3D (void *)ri.regs[0]; + memblock =3D (void *)get_reginfo_paramreg(&ri); break; case OP_GETMEMBLOCK: - set_x0(uc, ri.regs[0] + (uintptr_t)memblock); + set_ucontext_paramreg(uc, + get_reginfo_paramreg(&ri) + (uintptr_t)membl= ock); break; case OP_COMPAREMEM: return send_data_pkt(sock, memblock, MEMBLOCKLEN); @@ -111,10 +117,11 @@ int recv_and_compare_register_info(int sock, void *uc) send_response_byte(sock, resp); break; case OP_SETMEMBLOCK: - memblock =3D (void *)master_ri.regs[0]; + memblock =3D (void *)get_reginfo_paramreg(&master_ri); break; case OP_GETMEMBLOCK: - set_x0(uc, master_ri.regs[0] + (uintptr_t)memblock); + set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + + (uintptr_t)memblock); break; case OP_COMPAREMEM: mem_used =3D 1; diff --git a/risu_arm.c b/risu_arm.c index bdfb59b..c2b79a5 100644 --- a/risu_arm.c +++ b/risu_arm.c @@ -52,10 +52,16 @@ void advance_pc(void *vuc) uc->uc_mcontext.arm_pc +=3D insnsize(uc); } =20 -static void set_r0(void *vuc, uint32_t r0) + +void set_ucontext_paramreg(void *vuc, uint64_t value) { ucontext_t *uc =3D vuc; - uc->uc_mcontext.arm_r0 =3D r0; + uc->uc_mcontext.arm_r0 =3D value; +} + +uint64_t get_reginfo_paramreg(struct reginfo *ri) +{ + return ri->gpreg[0]; } =20 static int get_risuop(uint32_t insn, int isz) @@ -87,10 +93,11 @@ int send_register_info(int sock, void *uc) */ return send_data_pkt(sock, &ri, sizeof(ri)); case OP_SETMEMBLOCK: - memblock =3D (void *)ri.gpreg[0]; + memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&ri); break; case OP_GETMEMBLOCK: - set_r0(uc, ri.gpreg[0] + (uintptr_t)memblock); + set_ucontext_paramreg(uc, + get_reginfo_paramreg(&ri) + (uintptr_t)memb= lock); break; case OP_COMPAREMEM: return send_data_pkt(sock, memblock, MEMBLOCKLEN); @@ -139,10 +146,11 @@ int recv_and_compare_register_info(int sock, void *uc) send_response_byte(sock, resp); break; case OP_SETMEMBLOCK: - memblock =3D (void *)master_ri.gpreg[0]; + memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&master_ri); break; case OP_GETMEMBLOCK: - set_r0(uc, master_ri.gpreg[0] + (uintptr_t)memblock); + set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + + (uintptr_t)memblock); break; case OP_COMPAREMEM: mem_used =3D 1; diff --git a/risu_m68k.c b/risu_m68k.c index 15e30b1..feb3912 100644 --- a/risu_m68k.c +++ b/risu_m68k.c @@ -25,10 +25,15 @@ void advance_pc(void *vuc) uc->uc_mcontext.gregs[R_PC] +=3D 4; } =20 -void set_a0(void *vuc, uint32_t a0) +void set_ucontext_paramreg(void *vuc, uint64_t value) { ucontext_t *uc =3D vuc; - uc->uc_mcontext.gregs[R_A0] =3D a0; + uc->uc_mcontext.gregs[R_A0] =3D value; +} + +uint64_t get_reginfo_paramreg(struct reginfo *ri) +{ + return ri->gregs[R_A0]; } =20 static int get_risuop(uint32_t insn) @@ -53,10 +58,11 @@ int send_register_info(int sock, void *uc) default: return send_data_pkt(sock, &ri, sizeof(ri)); case OP_SETMEMBLOCK: - memblock =3D (void*)ri.gregs[R_A0]; + memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&ri); break; case OP_GETMEMBLOCK: - set_a0(uc, ri.gregs[R_A0] + (uintptr_t)memblock); + set_ucontext_paramreg(uc, + get_reginfo_paramreg(&ri) + (uintptr_t)membl= ock); break; case OP_COMPAREMEM: return send_data_pkt(sock, memblock, MEMBLOCKLEN); @@ -93,10 +99,11 @@ int recv_and_compare_register_info(int sock, void *uc) send_response_byte(sock, resp); break; case OP_SETMEMBLOCK: - memblock =3D (void*)master_ri.gregs[R_A0]; + memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&master_ri); break; case OP_GETMEMBLOCK: - set_a0(uc, master_ri.gregs[R_A0] + (uintptr_t)memblock); + set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + + (uintptr_t)memblock); break; case OP_COMPAREMEM: mem_used =3D 1; diff --git a/risu_ppc64le.c b/risu_ppc64le.c index 1c986a9..05b0294 100644 --- a/risu_ppc64le.c +++ b/risu_ppc64le.c @@ -30,10 +30,15 @@ void advance_pc(void *vuc) uc->uc_mcontext.regs->nip +=3D 4; } =20 -void set_x0(void *vuc, uint64_t x0) +void set_ucontext_paramreg(void *vuc, uint64_t value) { ucontext_t *uc =3D vuc; - uc->uc_mcontext.gp_regs[0] =3D x0; + uc->uc_mcontext.gp_regs[0] =3D value; +} + +uint64_t get_reginfo_paramreg(struct reginfo *ri) +{ + return ri->gregs[0]; } =20 static int get_risuop(uint32_t insn) @@ -58,10 +63,11 @@ int send_register_info(int sock, void *uc) default: return send_data_pkt(sock, &ri, sizeof(ri)); case OP_SETMEMBLOCK: - memblock =3D (void*)ri.gregs[0]; + memblock =3D (void*)get_reginfo_paramreg(&ri); break; case OP_GETMEMBLOCK: - set_x0(uc, ri.gregs[0] + (uintptr_t)memblock); + set_ucontext_paramreg(uc, + get_reginfo_paramreg(&ri) + (uintptr_t)membl= ock); break; case OP_COMPAREMEM: return send_data_pkt(sock, memblock, MEMBLOCKLEN); @@ -98,10 +104,11 @@ int recv_and_compare_register_info(int sock, void *uc) send_response_byte(sock, resp); break; case OP_SETMEMBLOCK: - memblock =3D (void*)master_ri.gregs[0]; + memblock =3D (void*)get_reginfo_paramreg(&master_ri); break; case OP_GETMEMBLOCK: - set_x0(uc, master_ri.gregs[0] + (uintptr_t)memblock); + set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + + (uintptr_t)memblock); break; case OP_COMPAREMEM: mem_used =3D 1; --=20 2.7.4 From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487958690058941.7808358162376; Fri, 24 Feb 2017 09:51:30 -0800 (PST) Received: from localhost ([::1]:38943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chK1g-00036K-QC for importer@patchew.org; Fri, 24 Feb 2017 12:51:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmS-0003u8-F9 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmR-0005Cl-Am for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:44 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmQ-0004Og-Ux for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:43 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmE-0008Kx-RX; Fri, 24 Feb 2017 17:35:30 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:22 +0000 Message-Id: <1487957728-8354-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 3/9] Make get_risuop() a formal part of the CPU interface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Maydell Make get_risuop() a formal part of the CPU interface rather than just a de-facto common routine. Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- risu.h | 5 +++++ risu_aarch64.c | 7 ++++--- risu_arm.c | 9 +++++---- risu_m68k.c | 7 ++++--- risu_ppc64le.c | 7 ++++--- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/risu.h b/risu.h index 4f923b2..1525b3e 100644 --- a/risu.h +++ b/risu.h @@ -74,4 +74,9 @@ void set_ucontext_paramreg(void *vuc, uint64_t value); /* Return the value of the parameter register from a reginfo. */ uint64_t get_reginfo_paramreg(struct reginfo *ri); =20 +/* Return the risu operation number we have been asked to do, + * or -1 if this was a SIGILL for a non-risuop insn. + */ +int get_risuop(struct reginfo *ri); + #endif /* RISU_H */ diff --git a/risu_aarch64.c b/risu_aarch64.c index f13338d..81573e3 100644 --- a/risu_aarch64.c +++ b/risu_aarch64.c @@ -41,11 +41,12 @@ uint64_t get_reginfo_paramreg(struct reginfo *ri) return ri->regs[0]; } =20 -static int get_risuop(uint32_t insn) +int get_risuop(struct reginfo *ri) { /* Return the risuop we have been asked to do * (or -1 if this was a SIGILL for a non-risuop insn) */ + uint32_t insn =3D ri->faulting_insn; uint32_t op =3D insn & 0xf; uint32_t key =3D insn & ~0xf; uint32_t risukey =3D 0x00005af0; @@ -57,7 +58,7 @@ int send_register_info(int sock, void *uc) struct reginfo ri; int op; reginfo_init(&ri, uc); - op =3D get_risuop(ri.faulting_insn); + op =3D get_risuop(&ri); =20 switch (op) { case OP_COMPARE: @@ -94,7 +95,7 @@ int recv_and_compare_register_info(int sock, void *uc) int resp =3D 0, op; =20 reginfo_init(&master_ri, uc); - op =3D get_risuop(master_ri.faulting_insn); + op =3D get_risuop(&master_ri); =20 switch (op) { case OP_COMPARE: diff --git a/risu_arm.c b/risu_arm.c index c2b79a5..36ac3c8 100644 --- a/risu_arm.c +++ b/risu_arm.c @@ -64,24 +64,25 @@ uint64_t get_reginfo_paramreg(struct reginfo *ri) return ri->gpreg[0]; } =20 -static int get_risuop(uint32_t insn, int isz) +int get_risuop(struct reginfo *ri) { /* Return the risuop we have been asked to do * (or -1 if this was a SIGILL for a non-risuop insn) */ + uint32_t insn =3D ri->faulting_insn; + int isz =3D ri->faulting_insn_size; uint32_t op =3D insn & 0xf; uint32_t key =3D insn & ~0xf; uint32_t risukey =3D (isz =3D=3D 2) ? 0xdee0 : 0xe7fe5af0; return (key !=3D risukey) ? -1 : op; } =20 - int send_register_info(int sock, void *uc) { struct reginfo ri; int op; reginfo_init(&ri, uc); - op =3D get_risuop(ri.faulting_insn, ri.faulting_insn_size); + op =3D get_risuop(&ri); =20 switch (op) { @@ -119,7 +120,7 @@ int recv_and_compare_register_info(int sock, void *uc) int resp =3D 0, op; =20 reginfo_init(&master_ri, uc); - op =3D get_risuop(master_ri.faulting_insn, master_ri.faulting_insn_size= ); + op =3D get_risuop(&master_ri); =20 switch (op) { diff --git a/risu_m68k.c b/risu_m68k.c index feb3912..8c138dd 100644 --- a/risu_m68k.c +++ b/risu_m68k.c @@ -36,8 +36,9 @@ uint64_t get_reginfo_paramreg(struct reginfo *ri) return ri->gregs[R_A0]; } =20 -static int get_risuop(uint32_t insn) +int get_risuop(struct reginfo *ri) { + uint32_t insn =3D ri->faulting_insn; uint32_t op =3D insn & 0xf; uint32_t key =3D insn & ~0xf; uint32_t risukey =3D 0x4afc7000; @@ -50,7 +51,7 @@ int send_register_info(int sock, void *uc) int op; =20 reginfo_init(&ri, uc); - op =3D get_risuop(ri.faulting_insn); + op =3D get_risuop(&ri); =20 switch (op) { case OP_COMPARE: @@ -81,7 +82,7 @@ int recv_and_compare_register_info(int sock, void *uc) int op; =20 reginfo_init(&master_ri, uc); - op =3D get_risuop(master_ri.faulting_insn); + op =3D get_risuop(&master_ri); =20 switch (op) { case OP_COMPARE: diff --git a/risu_ppc64le.c b/risu_ppc64le.c index 05b0294..43170ea 100644 --- a/risu_ppc64le.c +++ b/risu_ppc64le.c @@ -41,8 +41,9 @@ uint64_t get_reginfo_paramreg(struct reginfo *ri) return ri->gregs[0]; } =20 -static int get_risuop(uint32_t insn) +int get_risuop(struct reginfo *ri) { + uint32_t insn =3D ri->faulting_insn; uint32_t op =3D insn & 0xf; uint32_t key =3D insn & ~0xf; uint32_t risukey =3D 0x00005af0; @@ -55,7 +56,7 @@ int send_register_info(int sock, void *uc) int op; =20 reginfo_init(&ri, uc); - op =3D get_risuop(ri.faulting_insn); + op =3D get_risuop(&ri); =20 switch (op) { case OP_COMPARE: @@ -86,7 +87,7 @@ int recv_and_compare_register_info(int sock, void *uc) int op; =20 reginfo_init(&master_ri, uc); - op =3D get_risuop(master_ri.faulting_insn); + op =3D get_risuop(&master_ri); =20 switch (op) { case OP_COMPARE: --=20 2.7.4 From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487958951205207.28571225466044; Fri, 24 Feb 2017 09:55:51 -0800 (PST) Received: from localhost ([::1]:38965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chK5t-0008Dp-DL for importer@patchew.org; Fri, 24 Feb 2017 12:55:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmX-0003yZ-A9 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmQ-000595-DR for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:49 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmQ-0004Og-4y for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:42 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmF-0008LM-D5; Fri, 24 Feb 2017 17:35:31 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:23 +0000 Message-Id: <1487957728-8354-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 4/9] ppc64le, m68k: Make reginfo_dump() API match arm, aarch64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Make the reginfo_dump() API for ppc64le and m68k match the one used for ARM and AArch64, which takes a FILE*, doesn't have a flag for is_master, and returns a success indication. Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- risu_m68k.c | 6 +++--- risu_ppc64le.c | 6 +++--- risu_reginfo_m68k.c | 21 +++++++++++---------- risu_reginfo_m68k.h | 4 ++-- risu_reginfo_ppc64le.c | 49 +++++++++++++++++++++++++---------------------= --- risu_reginfo_ppc64le.h | 4 ++-- 6 files changed, 46 insertions(+), 44 deletions(-) diff --git a/risu_m68k.c b/risu_m68k.c index 8c138dd..87776ab 100644 --- a/risu_m68k.c +++ b/risu_m68k.c @@ -135,7 +135,7 @@ int report_match_status(void) fprintf(stderr, "packet mismatch (probably disagreement " "about UNDEF on load/store)\n"); fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, 0); + reginfo_dump(&master_ri, stderr); } if (!reginfo_is_eq(&master_ri, &apprentice_ri, NULL)) { fprintf(stderr, "mismatch on regs!\n"); @@ -151,10 +151,10 @@ int report_match_status(void) } =20 fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, 1); + reginfo_dump(&master_ri, stderr); =20 fprintf(stderr, "apprentice reginfo:\n"); - reginfo_dump(&apprentice_ri, 0); + reginfo_dump(&apprentice_ri, stderr); =20 reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); return resp; diff --git a/risu_ppc64le.c b/risu_ppc64le.c index 43170ea..8757712 100644 --- a/risu_ppc64le.c +++ b/risu_ppc64le.c @@ -140,7 +140,7 @@ int report_match_status(void) fprintf(stderr, "packet mismatch (probably disagreement " "about UNDEF on load/store)\n"); fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, 0); + reginfo_dump(&master_ri, stderr); } if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { fprintf(stderr, "mismatch on regs!\n"); @@ -156,10 +156,10 @@ int report_match_status(void) } =20 fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, 1); + reginfo_dump(&master_ri, stderr); =20 fprintf(stderr, "apprentice reginfo:\n"); - reginfo_dump(&apprentice_ri, 0); + reginfo_dump(&apprentice_ri, stderr); =20 reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); return resp; diff --git a/risu_reginfo_m68k.c b/risu_reginfo_m68k.c index d0d47d9..3988d71 100644 --- a/risu_reginfo_m68k.c +++ b/risu_reginfo_m68k.c @@ -75,29 +75,30 @@ int reginfo_is_eq(struct reginfo *m, struct reginfo *a,= ucontext_t *uc) } =20 /* reginfo_dump: print state to a stream, returns nonzero on success */ -void reginfo_dump(struct reginfo *ri, int is_master) +int reginfo_dump(struct reginfo *ri, FILE *f) { int i; - if (is_master) { - fprintf(stderr, " pc \e[1;101;37m0x%08x\e[0m\n", - ri->pc); - } - fprintf(stderr, "\tPC: %08x\n", ri->gregs[R_PC]); - fprintf(stderr, "\tPS: %04x\n", ri->gregs[R_PS]); + fprintf(f, " pc \e[1;101;37m0x%08x\e[0m\n", + ri->pc); + + fprintf(f, "\tPC: %08x\n", ri->gregs[R_PC]); + fprintf(f, "\tPS: %04x\n", ri->gregs[R_PS]); =20 for (i =3D 0; i < 8; i++) { - fprintf(stderr, "\tD%d: %8x\tA%d: %8x\n", i, ri->gregs[i], + fprintf(f, "\tD%d: %8x\tA%d: %8x\n", i, ri->gregs[i], i, ri->gregs[i + 8]); } =20 =20 for (i =3D 0; i < 8; i++) { - fprintf(stderr, "\tFP%d: %08x %08x %08x\n", i, + fprintf(f, "\tFP%d: %08x %08x %08x\n", i, ri->fpregs.f_fpregs[i][0], ri->fpregs.f_fpregs[i][1], ri->fpregs.f_fpregs[i][2]); } =20 - fprintf(stderr, "\n"); + fprintf(f, "\n"); + + return !ferror(f); } =20 int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f) diff --git a/risu_reginfo_m68k.h b/risu_reginfo_m68k.h index 9dd8f32..3922bf6 100644 --- a/risu_reginfo_m68k.h +++ b/risu_reginfo_m68k.h @@ -23,8 +23,8 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc); /* return 1 if structs are equal, 0 otherwise. */ int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2, ucontext_t *uc); =20 -/* print reginfo state to a stream */ -void reginfo_dump(struct reginfo *ri, int is_master); +/* print reginfo state to a stream, returns 1 on success, 0 on failure */ +int reginfo_dump(struct reginfo *ri, FILE *f); =20 /* reginfo_dump_mismatch: print mismatch details to a stream, ret nonzero= =3Dok */ int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); diff --git a/risu_reginfo_ppc64le.c b/risu_reginfo_ppc64le.c index 585d8b7..9e673e1 100644 --- a/risu_reginfo_ppc64le.c +++ b/risu_reginfo_ppc64le.c @@ -93,46 +93,47 @@ int reginfo_is_eq(struct reginfo *m, struct reginfo *a) } =20 /* reginfo_dump: print state to a stream, returns nonzero on success */ -void reginfo_dump(struct reginfo *ri, int is_master) +int reginfo_dump(struct reginfo *ri, FILE *f) { int i; - if (is_master) { - fprintf(stderr, " faulting insn 0x%x\n", ri->faulting_insn); - fprintf(stderr, " prev insn 0x%x\n", ri->prev_insn); - fprintf(stderr, " prev addr 0x%" PRIx64 "\n\n", ri->nip); - } + + fprintf(f, " faulting insn 0x%x\n", ri->faulting_insn); + fprintf(f, " prev insn 0x%x\n", ri->prev_insn); + fprintf(f, " prev addr 0x%" PRIx64 "\n\n", ri->nip); =20 for (i =3D 0; i < 16; i++) { - fprintf(stderr, "\tr%2d: %16lx\tr%2d: %16lx\n", i, ri->gregs[i], + fprintf(f, "\tr%2d: %16lx\tr%2d: %16lx\n", i, ri->gregs[i], i + 16, ri->gregs[i + 16]); } =20 - fprintf(stderr, "\n"); - fprintf(stderr, "\tnip : %16lx\n", ri->gregs[32]); - fprintf(stderr, "\tmsr : %16lx\n", ri->gregs[33]); - fprintf(stderr, "\torig r3: %16lx\n", ri->gregs[34]); - fprintf(stderr, "\tctr : %16lx\n", ri->gregs[35]); - fprintf(stderr, "\tlnk : %16lx\n", ri->gregs[36]); - fprintf(stderr, "\txer : %16lx\n", ri->gregs[37]); - fprintf(stderr, "\tccr : %16lx\n", ri->gregs[38]); - fprintf(stderr, "\tmq : %16lx\n", ri->gregs[39]); - fprintf(stderr, "\ttrap : %16lx\n", ri->gregs[40]); - fprintf(stderr, "\tdar : %16lx\n", ri->gregs[41]); - fprintf(stderr, "\tdsisr : %16lx\n", ri->gregs[42]); - fprintf(stderr, "\tresult : %16lx\n", ri->gregs[43]); - fprintf(stderr, "\tdscr : %16lx\n\n", ri->gregs[44]); + fprintf(f, "\n"); + fprintf(f, "\tnip : %16lx\n", ri->gregs[32]); + fprintf(f, "\tmsr : %16lx\n", ri->gregs[33]); + fprintf(f, "\torig r3: %16lx\n", ri->gregs[34]); + fprintf(f, "\tctr : %16lx\n", ri->gregs[35]); + fprintf(f, "\tlnk : %16lx\n", ri->gregs[36]); + fprintf(f, "\txer : %16lx\n", ri->gregs[37]); + fprintf(f, "\tccr : %16lx\n", ri->gregs[38]); + fprintf(f, "\tmq : %16lx\n", ri->gregs[39]); + fprintf(f, "\ttrap : %16lx\n", ri->gregs[40]); + fprintf(f, "\tdar : %16lx\n", ri->gregs[41]); + fprintf(f, "\tdsisr : %16lx\n", ri->gregs[42]); + fprintf(f, "\tresult : %16lx\n", ri->gregs[43]); + fprintf(f, "\tdscr : %16lx\n\n", ri->gregs[44]); =20 for (i =3D 0; i < 16; i++) { - fprintf(stderr, "\tf%2d: %.4f\tr%2d: %.4f\n", i, ri->fpregs[i], + fprintf(f, "\tf%2d: %.4f\tr%2d: %.4f\n", i, ri->fpregs[i], i + 16, ri->fpregs[i + 16]); } - fprintf(stderr, "\tfpscr: %f\n\n", ri->fpregs[32]); + fprintf(f, "\tfpscr: %f\n\n", ri->fpregs[32]); =20 for (i =3D 0; i < 32; i++) { - fprintf(stderr, "vr%02d: %8x, %8x, %8x, %8x\n", i, + fprintf(f, "vr%02d: %8x, %8x, %8x, %8x\n", i, ri->vrregs.vrregs[i][0], ri->vrregs.vrregs[i][1], ri->vrregs.vrregs[i][2], ri->vrregs.vrregs[i][3]); } + + return !ferror(f); } =20 int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f) diff --git a/risu_reginfo_ppc64le.h b/risu_reginfo_ppc64le.h index 49bb1aa..9f74cd3 100644 --- a/risu_reginfo_ppc64le.h +++ b/risu_reginfo_ppc64le.h @@ -31,8 +31,8 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc); /* return 1 if structs are equal, 0 otherwise. */ int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); =20 -/* print reginfo state to a stream */ -void reginfo_dump(struct reginfo *ri, int is_master); +/* print reginfo state to a stream, returns 1 on success, 0 on failure */ +int reginfo_dump(struct reginfo *ri, FILE *f); =20 /* reginfo_dump_mismatch: print mismatch details to a stream, ret nonzero= =3Dok */ int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); --=20 2.7.4 From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487958147773735.3574448043393; Fri, 24 Feb 2017 09:42:27 -0800 (PST) Received: from localhost ([::1]:38895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJst-0000Rr-3B for importer@patchew.org; Fri, 24 Feb 2017 12:42:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmQ-0003u5-Gj for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmP-00055K-Iw for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:42 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmP-0004Og-CH for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:41 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmF-0008Ll-TR; Fri, 24 Feb 2017 17:35:31 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:24 +0000 Message-Id: <1487957728-8354-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 5/9] m68k: Drop unused ucontext_t* argument to reginfo_is_eq() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Drop the ucontext*t argument to reginfo_is_eq(); we don't use it. Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- risu_m68k.c | 4 ++-- risu_reginfo_m68k.c | 2 +- risu_reginfo_m68k.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/risu_m68k.c b/risu_m68k.c index 87776ab..e345b25 100644 --- a/risu_m68k.c +++ b/risu_m68k.c @@ -91,7 +91,7 @@ int recv_and_compare_register_info(int sock, void *uc) if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) { packet_mismatch =3D 1; resp =3D 2; - } else if (!reginfo_is_eq(&master_ri, &apprentice_ri, uc)) { + } else if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { resp =3D 2; } else if (op =3D=3D OP_TESTEND) { @@ -137,7 +137,7 @@ int report_match_status(void) fprintf(stderr, "master reginfo:\n"); reginfo_dump(&master_ri, stderr); } - if (!reginfo_is_eq(&master_ri, &apprentice_ri, NULL)) { + if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { fprintf(stderr, "mismatch on regs!\n"); resp =3D 1; } diff --git a/risu_reginfo_m68k.c b/risu_reginfo_m68k.c index 3988d71..45950b1 100644 --- a/risu_reginfo_m68k.c +++ b/risu_reginfo_m68k.c @@ -38,7 +38,7 @@ void reginfo_init(struct reginfo *ri, ucontext_t *uc) } =20 /* reginfo_is_eq: compare the reginfo structs, returns nonzero if equal */ -int reginfo_is_eq(struct reginfo *m, struct reginfo *a, ucontext_t *uc) +int reginfo_is_eq(struct reginfo *m, struct reginfo *a) { int i; =20 diff --git a/risu_reginfo_m68k.h b/risu_reginfo_m68k.h index 3922bf6..021939d 100644 --- a/risu_reginfo_m68k.h +++ b/risu_reginfo_m68k.h @@ -21,7 +21,7 @@ struct reginfo void reginfo_init(struct reginfo *ri, ucontext_t *uc); =20 /* return 1 if structs are equal, 0 otherwise. */ -int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2, ucontext_t *uc); +int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); =20 /* print reginfo state to a stream, returns 1 on success, 0 on failure */ int reginfo_dump(struct reginfo *ri, FILE *f); --=20 2.7.4 From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487958160732198.88591254496157; Fri, 24 Feb 2017 09:42:40 -0800 (PST) Received: from localhost ([::1]:38897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJt7-0000gO-Ul for importer@patchew.org; Fri, 24 Feb 2017 12:42:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmQ-0003u2-0Y for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmO-00051t-Q6 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:42 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmO-0004Og-F8 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:40 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmG-0008MW-Ib; Fri, 24 Feb 2017 17:35:32 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:25 +0000 Message-Id: <1487957728-8354-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 6/9] Make reginfo_{init, is_eq, dump, dump_mismatch} official per-CPU API X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" All CPUs now implement reginfo_{init,is_eq,dump,dump_mismatch} with the same API and semantics. Make this official by moving the prototypes into risu.h. Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- risu.h | 13 +++++++++++++ risu_reginfo_aarch64.h | 12 ------------ risu_reginfo_arm.h | 12 ------------ risu_reginfo_m68k.h | 12 ------------ risu_reginfo_ppc64le.h | 12 ------------ 5 files changed, 13 insertions(+), 48 deletions(-) diff --git a/risu.h b/risu.h index 1525b3e..d95dace 100644 --- a/risu.h +++ b/risu.h @@ -14,6 +14,7 @@ =20 #include #include +#include =20 /* Socket related routines */ int master_connect(int port); @@ -79,4 +80,16 @@ uint64_t get_reginfo_paramreg(struct reginfo *ri); */ int get_risuop(struct reginfo *ri); =20 +/* initialize structure from a ucontext */ +void reginfo_init(struct reginfo *ri, ucontext_t *uc); + +/* return 1 if structs are equal, 0 otherwise. */ +int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); + +/* print reginfo state to a stream, returns 1 on success, 0 on failure */ +int reginfo_dump(struct reginfo *ri, FILE *f); + +/* reginfo_dump_mismatch: print mismatch details to a stream, ret nonzero= =3Dok */ +int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); + #endif /* RISU_H */ diff --git a/risu_reginfo_aarch64.h b/risu_reginfo_aarch64.h index 166b76c..3d1b2fd 100644 --- a/risu_reginfo_aarch64.h +++ b/risu_reginfo_aarch64.h @@ -28,16 +28,4 @@ struct reginfo __uint128_t vregs[32]; }; =20 -/* initialize structure from a ucontext */ -void reginfo_init(struct reginfo *ri, ucontext_t *uc); - -/* return 1 if structs are equal, 0 otherwise. */ -int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); - -/* print reginfo state to a stream, returns 1 on success, 0 on failure */ -int reginfo_dump(struct reginfo *ri, FILE *f); - -/* reginfo_dump_mismatch: print mismatch details to a stream, ret nonzero= =3Dok */ -int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); - #endif /* RISU_REGINFO_AARCH64_H */ diff --git a/risu_reginfo_arm.h b/risu_reginfo_arm.h index 80c28c6..96e5791 100644 --- a/risu_reginfo_arm.h +++ b/risu_reginfo_arm.h @@ -23,16 +23,4 @@ struct reginfo uint32_t fpscr; }; =20 -/* initialize a reginfo structure with data from uc */ -void reginfo_init(struct reginfo *ri, ucontext_t *uc); - -/* returns 1 if structs are equal, zero otherwise */ -int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); - -/* print struct values to a stream, return 0 on stream err, 1 on success */ -int reginfo_dump(struct reginfo *ri, FILE *f); - -/* print a detailed mismatch report, return 0 on stream err, 1 on success = */ -int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); - #endif /* RISU_REGINFO_ARM_H */ diff --git a/risu_reginfo_m68k.h b/risu_reginfo_m68k.h index 021939d..06ea61d 100644 --- a/risu_reginfo_m68k.h +++ b/risu_reginfo_m68k.h @@ -17,16 +17,4 @@ struct reginfo fpregset_t fpregs; }; =20 -/* initialize structure from a ucontext */ -void reginfo_init(struct reginfo *ri, ucontext_t *uc); - -/* return 1 if structs are equal, 0 otherwise. */ -int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); - -/* print reginfo state to a stream, returns 1 on success, 0 on failure */ -int reginfo_dump(struct reginfo *ri, FILE *f); - -/* reginfo_dump_mismatch: print mismatch details to a stream, ret nonzero= =3Dok */ -int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); - #endif /* RISU_REGINFO_M68K_H */ diff --git a/risu_reginfo_ppc64le.h b/risu_reginfo_ppc64le.h index 9f74cd3..826143e 100644 --- a/risu_reginfo_ppc64le.h +++ b/risu_reginfo_ppc64le.h @@ -25,16 +25,4 @@ struct reginfo vrregset_t vrregs; }; =20 -/* initialize structure from a ucontext */ -void reginfo_init(struct reginfo *ri, ucontext_t *uc); - -/* return 1 if structs are equal, 0 otherwise. */ -int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); - -/* print reginfo state to a stream, returns 1 on success, 0 on failure */ -int reginfo_dump(struct reginfo *ri, FILE *f); - -/* reginfo_dump_mismatch: print mismatch details to a stream, ret nonzero= =3Dok */ -int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); - #endif /* RISU_REGINFO_PPC64LE_H */ --=20 2.7.4 From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487958406855265.3122846510148; Fri, 24 Feb 2017 09:46:46 -0800 (PST) Received: from localhost ([::1]:38921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJx6-0004sT-CE for importer@patchew.org; Fri, 24 Feb 2017 12:46:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmP-0003tz-Me for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmN-0004yT-TI for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:41 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmN-0004Og-K2 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:39 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmH-0008Ml-1D; Fri, 24 Feb 2017 17:35:33 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:26 +0000 Message-Id: <1487957728-8354-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 7/9] Move send_register_info() to reginfo.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" send_register_info() is now essentially the same code for all target CPUs, so move it into reginfo.c rather than having duplicated code. Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- Makefile | 4 ++-- reginfo.c | 43 +++++++++++++++++++++++++++++++++++++++++++ risu.h | 13 ++++++++++++- risu_aarch64.c | 29 ----------------------------- risu_arm.c | 30 ------------------------------ risu_m68k.c | 27 --------------------------- risu_ppc64le.c | 27 --------------------------- 7 files changed, 57 insertions(+), 116 deletions(-) create mode 100644 reginfo.c diff --git a/Makefile b/Makefile index d20c4e4..9a29bb4 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,10 @@ VPATH=3D$(SRCDIR) =20 CFLAGS ?=3D -g =20 -ALL_CFLAGS =3D -Wall -D_GNU_SOURCE $(CFLAGS) $(EXTRA_CFLAGS) +ALL_CFLAGS =3D -Wall -D_GNU_SOURCE -DARCH=3D$(ARCH) $(CFLAGS) $(EXTRA_CFLA= GS) =20 PROG=3Drisu -SRCS=3Drisu.c comms.c risu_$(ARCH).c risu_reginfo_$(ARCH).c +SRCS=3Drisu.c comms.c reginfo.c risu_$(ARCH).c risu_reginfo_$(ARCH).c HDRS=3Drisu.h BINS=3Dtest_$(ARCH).bin =20 diff --git a/reginfo.c b/reginfo.c new file mode 100644 index 0000000..d62a2ed --- /dev/null +++ b/reginfo.c @@ -0,0 +1,43 @@ +/*************************************************************************= ***** + * Copyright (c) 2017 Linaro Limited + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Peter Maydell (Linaro) - initial implementation + *************************************************************************= ****/ + +#include + +#include "risu.h" + +int send_register_info(int sock, void *uc) +{ + struct reginfo ri; + int op; + reginfo_init(&ri, uc); + op =3D get_risuop(&ri); + + switch (op) { + case OP_COMPARE: + case OP_TESTEND: + default: + /* Do a simple register compare on (a) explicit request + * (b) end of test (c) a non-risuop UNDEF + */ + return send_data_pkt(sock, &ri, sizeof(ri)); + case OP_SETMEMBLOCK: + memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&ri); + break; + case OP_GETMEMBLOCK: + set_ucontext_paramreg(uc, + get_reginfo_paramreg(&ri) + (uintptr_t)membl= ock); + break; + case OP_COMPAREMEM: + return send_data_pkt(sock, memblock, MEMBLOCKLEN); + break; + } + return 0; +} diff --git a/risu.h b/risu.h index d95dace..0f00b5f 100644 --- a/risu.h +++ b/risu.h @@ -16,6 +16,15 @@ #include #include =20 +/* GCC computed include to pull in the correct risu_reginfo_*.h for + * the architecture. + */ +#define REGINFO_HEADER2(X) #X +#define REGINFO_HEADER1(ARCHNAME) REGINFO_HEADER2(risu_reginfo_ ## ARCHNAM= E.h) +#define REGINFO_HEADER(ARCH) REGINFO_HEADER1(ARCH) + +#include REGINFO_HEADER(ARCH) + /* Socket related routines */ int master_connect(int port); int apprentice_connect(const char *hostname, int port); @@ -40,7 +49,7 @@ extern int test_fp_exc; =20 struct reginfo; =20 -/* Interface provided by CPU-specific code: */ +/* Functions operating on reginfo */ =20 /* Send the register information from the struct ucontext down the socket. * Return the response code from the master. @@ -48,6 +57,8 @@ struct reginfo; */ int send_register_info(int sock, void *uc); =20 +/* Interface provided by CPU-specific code: */ + /* Read register info from the socket and compare it with that from the * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. * NB: called from a signal handler. diff --git a/risu_aarch64.c b/risu_aarch64.c index 81573e3..7363eb1 100644 --- a/risu_aarch64.c +++ b/risu_aarch64.c @@ -53,35 +53,6 @@ int get_risuop(struct reginfo *ri) return (key !=3D risukey) ? -1 : op; } =20 -int send_register_info(int sock, void *uc) -{ - struct reginfo ri; - int op; - reginfo_init(&ri, uc); - op =3D get_risuop(&ri); - - switch (op) { - case OP_COMPARE: - case OP_TESTEND: - default: - /* Do a simple register compare on (a) explicit request - * (b) end of test (c) a non-risuop UNDEF - */ - return send_data_pkt(sock, &ri, sizeof(ri)); - case OP_SETMEMBLOCK: - memblock =3D (void *)get_reginfo_paramreg(&ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, - get_reginfo_paramreg(&ri) + (uintptr_t)membl= ock); - break; - case OP_COMPAREMEM: - return send_data_pkt(sock, memblock, MEMBLOCKLEN); - break; - } - return 0; -} - /* Read register info from the socket and compare it with that from the * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. * NB: called from a signal handler. diff --git a/risu_arm.c b/risu_arm.c index 36ac3c8..878b2ee 100644 --- a/risu_arm.c +++ b/risu_arm.c @@ -77,36 +77,6 @@ int get_risuop(struct reginfo *ri) return (key !=3D risukey) ? -1 : op; } =20 -int send_register_info(int sock, void *uc) -{ - struct reginfo ri; - int op; - reginfo_init(&ri, uc); - op =3D get_risuop(&ri); - - switch (op) - { - case OP_COMPARE: - case OP_TESTEND: - default: - /* Do a simple register compare on (a) explicit request - * (b) end of test (c) a non-risuop UNDEF - */ - return send_data_pkt(sock, &ri, sizeof(ri)); - case OP_SETMEMBLOCK: - memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, - get_reginfo_paramreg(&ri) + (uintptr_t)memb= lock); - break; - case OP_COMPAREMEM: - return send_data_pkt(sock, memblock, MEMBLOCKLEN); - break; - } - return 0; -} - /* Read register info from the socket and compare it with that from the * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. * NB: called from a signal handler. diff --git a/risu_m68k.c b/risu_m68k.c index e345b25..c0e29ff 100644 --- a/risu_m68k.c +++ b/risu_m68k.c @@ -45,33 +45,6 @@ int get_risuop(struct reginfo *ri) return (key !=3D risukey) ? -1 : op; } =20 -int send_register_info(int sock, void *uc) -{ - struct reginfo ri; - int op; - - reginfo_init(&ri, uc); - op =3D get_risuop(&ri); - - switch (op) { - case OP_COMPARE: - case OP_TESTEND: - default: - return send_data_pkt(sock, &ri, sizeof(ri)); - case OP_SETMEMBLOCK: - memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, - get_reginfo_paramreg(&ri) + (uintptr_t)membl= ock); - break; - case OP_COMPAREMEM: - return send_data_pkt(sock, memblock, MEMBLOCKLEN); - break; - } - return 0; -} - /* Read register info from the socket and compare it with that from the * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. * NB: called from a signal handler. diff --git a/risu_ppc64le.c b/risu_ppc64le.c index 8757712..928f36f 100644 --- a/risu_ppc64le.c +++ b/risu_ppc64le.c @@ -50,33 +50,6 @@ int get_risuop(struct reginfo *ri) return (key !=3D risukey) ? -1 : op; } =20 -int send_register_info(int sock, void *uc) -{ - struct reginfo ri; - int op; - - reginfo_init(&ri, uc); - op =3D get_risuop(&ri); - - switch (op) { - case OP_COMPARE: - case OP_TESTEND: - default: - return send_data_pkt(sock, &ri, sizeof(ri)); - case OP_SETMEMBLOCK: - memblock =3D (void*)get_reginfo_paramreg(&ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, - get_reginfo_paramreg(&ri) + (uintptr_t)membl= ock); - break; - case OP_COMPAREMEM: - return send_data_pkt(sock, memblock, MEMBLOCKLEN); - break; - } - return 0; -} - /* Read register info from the socket and compare it with that from the * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. * NB: called from a signal handler. --=20 2.7.4 From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487957875802812.4790429168605; Fri, 24 Feb 2017 09:37:55 -0800 (PST) Received: from localhost ([::1]:38871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJoY-00059n-DT for importer@patchew.org; Fri, 24 Feb 2017 12:37:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmP-0003u0-NS for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmN-0004ul-2K for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:41 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmM-0004Og-MP for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:38 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmH-0008Mz-GO; Fri, 24 Feb 2017 17:35:33 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:27 +0000 Message-Id: <1487957728-8354-9-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 8/9] Move recv_and_compare_register_info() and report_match_status() to reginfo.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Move recv_and_compare_register_info() and report_match_status() to reginfo.c -- they are essentially the same for all targets so can be common code. The shared variables they use come with them. Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- reginfo.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++ risu.h | 4 +- risu_aarch64.c | 108 ----------------------------------------------------- risu_arm.c | 116 -----------------------------------------------------= ---- risu_m68k.c | 94 ---------------------------------------------- risu_ppc64le.c | 94 ---------------------------------------------- 6 files changed, 110 insertions(+), 414 deletions(-) diff --git a/reginfo.c b/reginfo.c index d62a2ed..96c6342 100644 --- a/reginfo.c +++ b/reginfo.c @@ -10,9 +10,17 @@ *************************************************************************= ****/ =20 #include +#include =20 #include "risu.h" =20 +struct reginfo master_ri, apprentice_ri; + +uint8_t apprentice_memblock[MEMBLOCKLEN]; + +static int mem_used =3D 0; +static int packet_mismatch =3D 0; + int send_register_info(int sock, void *uc) { struct reginfo ri; @@ -41,3 +49,103 @@ int send_register_info(int sock, void *uc) } return 0; } + +/* Read register info from the socket and compare it with that from the + * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. + * NB: called from a signal handler. + * + * We don't have any kind of identifying info in the incoming data + * that says whether it is register or memory data, so if the two + * sides get out of sync then we will fail obscurely. + */ +int recv_and_compare_register_info(int sock, void *uc) +{ + int resp =3D 0, op; + + reginfo_init(&master_ri, uc); + op =3D get_risuop(&master_ri); + + switch (op) { + case OP_COMPARE: + case OP_TESTEND: + default: + /* Do a simple register compare on (a) explicit request + * (b) end of test (c) a non-risuop UNDEF + */ + if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) { + packet_mismatch =3D 1; + resp =3D 2; + + } else if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { + /* register mismatch */ + resp =3D 2; + + } else if (op =3D=3D OP_TESTEND) { + resp =3D 1; + } + send_response_byte(sock, resp); + break; + case OP_SETMEMBLOCK: + memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&master_ri); + break; + case OP_GETMEMBLOCK: + set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + + (uintptr_t)memblock); + break; + case OP_COMPAREMEM: + mem_used =3D 1; + if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) { + packet_mismatch =3D 1; + resp =3D 2; + } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != =3D 0) { + /* memory mismatch */ + resp =3D 2; + } + send_response_byte(sock, resp); + break; + } + + return resp; +} + +/* Print a useful report on the status of the last comparison + * done in recv_and_compare_register_info(). This is called on + * exit, so need not restrict itself to signal-safe functions. + * Should return 0 if it was a good match (ie end of test) + * and 1 for a mismatch. + */ +int report_match_status(void) +{ + int resp =3D 0; + fprintf(stderr, "match status...\n"); + if (packet_mismatch) { + fprintf(stderr, "packet mismatch (probably disagreement " + "about UNDEF on load/store)\n"); + /* We don't have valid reginfo from the apprentice side + * so stop now rather than printing anything about it. + */ + fprintf(stderr, "master reginfo:\n"); + reginfo_dump(&master_ri, stderr); + return 1; + } + if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { + fprintf(stderr, "mismatch on regs!\n"); + resp =3D 1; + } + if (mem_used && memcmp(memblock, &apprentice_memblock, MEMBLOCKLEN) != =3D 0) { + fprintf(stderr, "mismatch on memory!\n"); + resp =3D 1; + } + if (!resp) { + fprintf(stderr, "match!\n"); + return 0; + } + + fprintf(stderr, "master reginfo:\n"); + reginfo_dump(&master_ri, stderr); + fprintf(stderr, "apprentice reginfo:\n"); + reginfo_dump(&apprentice_ri, stderr); + + reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); + return resp; +} diff --git a/risu.h b/risu.h index 0f00b5f..90e4f23 100644 --- a/risu.h +++ b/risu.h @@ -57,8 +57,6 @@ struct reginfo; */ int send_register_info(int sock, void *uc); =20 -/* Interface provided by CPU-specific code: */ - /* Read register info from the socket and compare it with that from the * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. * NB: called from a signal handler. @@ -73,6 +71,8 @@ int recv_and_compare_register_info(int sock, void *uc); */ int report_match_status(void); =20 +/* Interface provided by CPU-specific code: */ + /* Move the PC past this faulting insn by adjusting ucontext */ void advance_pc(void *uc); diff --git a/risu_aarch64.c b/risu_aarch64.c index 7363eb1..cdd23d8 100644 --- a/risu_aarch64.c +++ b/risu_aarch64.c @@ -17,13 +17,6 @@ #include "risu.h" #include "risu_reginfo_aarch64.h" =20 -struct reginfo master_ri, apprentice_ri; - -uint8_t apprentice_memblock[MEMBLOCKLEN]; - -static int mem_used =3D 0; -static int packet_mismatch =3D 0; - void advance_pc(void *vuc) { ucontext_t *uc =3D vuc; @@ -52,104 +45,3 @@ int get_risuop(struct reginfo *ri) uint32_t risukey =3D 0x00005af0; return (key !=3D risukey) ? -1 : op; } - -/* Read register info from the socket and compare it with that from the - * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. - * NB: called from a signal handler. - * - * We don't have any kind of identifying info in the incoming data - * that says whether it is register or memory data, so if the two - * sides get out of sync then we will fail obscurely. - */ -int recv_and_compare_register_info(int sock, void *uc) -{ - int resp =3D 0, op; - - reginfo_init(&master_ri, uc); - op =3D get_risuop(&master_ri); - - switch (op) { - case OP_COMPARE: - case OP_TESTEND: - default: - /* Do a simple register compare on (a) explicit request - * (b) end of test (c) a non-risuop UNDEF - */ - if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) { - packet_mismatch =3D 1; - resp =3D 2; - - } else if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { - /* register mismatch */ - resp =3D 2; - - } else if (op =3D=3D OP_TESTEND) { - resp =3D 1; - } - send_response_byte(sock, resp); - break; - case OP_SETMEMBLOCK: - memblock =3D (void *)get_reginfo_paramreg(&master_ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + - (uintptr_t)memblock); - break; - case OP_COMPAREMEM: - mem_used =3D 1; - if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) { - packet_mismatch =3D 1; - resp =3D 2; - } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != =3D 0) { - /* memory mismatch */ - resp =3D 2; - } - send_response_byte(sock, resp); - break; - } - - return resp; -} - -/* Print a useful report on the status of the last comparison - * done in recv_and_compare_register_info(). This is called on - * exit, so need not restrict itself to signal-safe functions. - * Should return 0 if it was a good match (ie end of test) - * and 1 for a mismatch. - */ -int report_match_status(void) -{ - int resp =3D 0; - fprintf(stderr, "match status...\n"); - if (packet_mismatch) { - fprintf(stderr, "packet mismatch (probably disagreement " - "about UNDEF on load/store)\n"); - /* We don't have valid reginfo from the apprentice side - * so stop now rather than printing anything about it. - */ - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - return 1; - } - if (memcmp(&master_ri, &apprentice_ri, sizeof(master_ri)) !=3D 0) - { - fprintf(stderr, "mismatch on regs!\n"); - resp =3D 1; - } - if (mem_used && memcmp(memblock, &apprentice_memblock, MEMBLOCKLEN) != =3D 0) { - fprintf(stderr, "mismatch on memory!\n"); - resp =3D 1; - } - if (!resp) { - fprintf(stderr, "match!\n"); - return 0; - } - - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - fprintf(stderr, "apprentice reginfo:\n"); - reginfo_dump(&apprentice_ri, stderr); - - reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); - return resp; -} diff --git a/risu_arm.c b/risu_arm.c index 878b2ee..f570828 100644 --- a/risu_arm.c +++ b/risu_arm.c @@ -16,12 +16,6 @@ #include "risu.h" #include "risu_reginfo_arm.h" =20 -struct reginfo master_ri, apprentice_ri; -uint8_t apprentice_memblock[MEMBLOCKLEN]; - -static int mem_used =3D 0; -static int packet_mismatch =3D 0; - int insnsize(ucontext_t *uc) { /* Return instruction size in bytes of the @@ -76,113 +70,3 @@ int get_risuop(struct reginfo *ri) uint32_t risukey =3D (isz =3D=3D 2) ? 0xdee0 : 0xe7fe5af0; return (key !=3D risukey) ? -1 : op; } - -/* Read register info from the socket and compare it with that from the - * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. - * NB: called from a signal handler. - * - * We don't have any kind of identifying info in the incoming data - * that says whether it's register or memory data, so if the two - * sides get out of sync then we will fail obscurely. - */ -int recv_and_compare_register_info(int sock, void *uc) -{ - int resp =3D 0, op; - - reginfo_init(&master_ri, uc); - op =3D get_risuop(&master_ri); - - switch (op) - { - case OP_COMPARE: - case OP_TESTEND: - default: - /* Do a simple register compare on (a) explicit request - * (b) end of test (c) a non-risuop UNDEF - */ - if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) - { - packet_mismatch =3D 1; - resp =3D 2; - } - else if (memcmp(&master_ri, &apprentice_ri, sizeof(master_ri)) != =3D 0) - { - /* register mismatch */ - resp =3D 2; - } - else if (op =3D=3D OP_TESTEND) - { - resp =3D 1; - } - send_response_byte(sock, resp); - break; - case OP_SETMEMBLOCK: - memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&master_ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + - (uintptr_t)memblock); - break; - case OP_COMPAREMEM: - mem_used =3D 1; - if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) - { - packet_mismatch =3D 1; - resp =3D 2; - } - else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) !=3D = 0) - { - /* memory mismatch */ - resp =3D 2; - } - send_response_byte(sock, resp); - break; - } - return resp; -} - -/* Print a useful report on the status of the last comparison - * done in recv_and_compare_register_info(). This is called on - * exit, so need not restrict itself to signal-safe functions. - * Should return 0 if it was a good match (ie end of test) - * and 1 for a mismatch. - */ -int report_match_status(void) -{ - int resp =3D 0; - fprintf(stderr, "match status...\n"); - if (packet_mismatch) - { - fprintf(stderr, "packet mismatch (probably disagreement " - "about UNDEF on load/store)\n"); - /* We don't have valid reginfo from the apprentice side - * so stop now rather than printing anything about it. - */ - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - return 1; - } - if (!reginfo_is_eq(&master_ri, &apprentice_ri)) - { - fprintf(stderr, "mismatch on regs!\n"); - resp =3D 1; - } - if (mem_used && memcmp(memblock, &apprentice_memblock, MEMBLOCKLEN) != =3D 0) - { - fprintf(stderr, "mismatch on memory!\n"); - resp =3D 1; - } - if (!resp) - { - fprintf(stderr, "match!\n"); - return 0; - } - - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - fprintf(stderr, "apprentice reginfo:\n"); - reginfo_dump(&apprentice_ri, stderr); - - reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); - return resp; -} diff --git a/risu_m68k.c b/risu_m68k.c index c0e29ff..851487b 100644 --- a/risu_m68k.c +++ b/risu_m68k.c @@ -13,12 +13,6 @@ #include "risu.h" #include "risu_reginfo_m68k.h" =20 -struct reginfo master_ri, apprentice_ri; -static int mem_used =3D 0; -static int packet_mismatch =3D 0; - -uint8_t apprentice_memblock[MEMBLOCKLEN]; - void advance_pc(void *vuc) { ucontext_t *uc =3D (ucontext_t*)vuc; @@ -44,91 +38,3 @@ int get_risuop(struct reginfo *ri) uint32_t risukey =3D 0x4afc7000; return (key !=3D risukey) ? -1 : op; } - -/* Read register info from the socket and compare it with that from the - * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. - * NB: called from a signal handler. - */ -int recv_and_compare_register_info(int sock, void *uc) -{ - int resp =3D 0; - int op; - - reginfo_init(&master_ri, uc); - op =3D get_risuop(&master_ri); - - switch (op) { - case OP_COMPARE: - case OP_TESTEND: - default: - if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) { - packet_mismatch =3D 1; - resp =3D 2; - } else if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { - resp =3D 2; - } - else if (op =3D=3D OP_TESTEND) { - resp =3D 1; - } - send_response_byte(sock, resp); - break; - case OP_SETMEMBLOCK: - memblock =3D (void *)(uintptr_t)get_reginfo_paramreg(&master_ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + - (uintptr_t)memblock); - break; - case OP_COMPAREMEM: - mem_used =3D 1; - if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) { - packet_mismatch =3D 1; - resp =3D 2; - } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) !=3D= 0) { - resp =3D 2; - } - send_response_byte(sock, resp); - break; - } - return resp; -} - -/* Print a useful report on the status of the last comparison - * done in recv_and_compare_register_info(). This is called on - * exit, so need not restrict itself to signal-safe functions. - * Should return 0 if it was a good match (ie end of test) - * and 1 for a mismatch. - */ -int report_match_status(void) -{ - int resp =3D 0; - fprintf(stderr, "match status...\n"); - - if (packet_mismatch) { - fprintf(stderr, "packet mismatch (probably disagreement " - "about UNDEF on load/store)\n"); - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - } - if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { - fprintf(stderr, "mismatch on regs!\n"); - resp =3D 1; - } - if (mem_used && memcmp(memblock, &apprentice_memblock, MEMBLOCKLEN) != =3D 0) { - fprintf(stderr, "mismatch on memory!\n"); - resp =3D 1; - } - if (!resp) { - fprintf(stderr, "match!\n"); - return 0; - } - - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - - fprintf(stderr, "apprentice reginfo:\n"); - reginfo_dump(&apprentice_ri, stderr); - - reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); - return resp; -} diff --git a/risu_ppc64le.c b/risu_ppc64le.c index 928f36f..c15d78e 100644 --- a/risu_ppc64le.c +++ b/risu_ppc64le.c @@ -18,12 +18,6 @@ #include "risu.h" #include "risu_reginfo_ppc64le.h" =20 -struct reginfo master_ri, apprentice_ri; -static int mem_used =3D 0; -static int packet_mismatch =3D 0; - -uint8_t apprentice_memblock[MEMBLOCKLEN]; - void advance_pc(void *vuc) { ucontext_t *uc =3D (ucontext_t*)vuc; @@ -49,91 +43,3 @@ int get_risuop(struct reginfo *ri) uint32_t risukey =3D 0x00005af0; return (key !=3D risukey) ? -1 : op; } - -/* Read register info from the socket and compare it with that from the - * ucontext. Return 0 for match, 1 for end-of-test, 2 for mismatch. - * NB: called from a signal handler. - */ -int recv_and_compare_register_info(int sock, void *uc) -{ - int resp =3D 0; - int op; - - reginfo_init(&master_ri, uc); - op =3D get_risuop(&master_ri); - - switch (op) { - case OP_COMPARE: - case OP_TESTEND: - default: - if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) { - packet_mismatch =3D 1; - resp =3D 2; - } else if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { - resp =3D 2; - } - else if (op =3D=3D OP_TESTEND) { - resp =3D 1; - } - send_response_byte(sock, resp); - break; - case OP_SETMEMBLOCK: - memblock =3D (void*)get_reginfo_paramreg(&master_ri); - break; - case OP_GETMEMBLOCK: - set_ucontext_paramreg(uc, get_reginfo_paramreg(&master_ri) + - (uintptr_t)memblock); - break; - case OP_COMPAREMEM: - mem_used =3D 1; - if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) { - packet_mismatch =3D 1; - resp =3D 2; - } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) !=3D= 0) { - resp =3D 2; - } - send_response_byte(sock, resp); - break; - } - return resp; -} - -/* Print a useful report on the status of the last comparison - * done in recv_and_compare_register_info(). This is called on - * exit, so need not restrict itself to signal-safe functions. - * Should return 0 if it was a good match (ie end of test) - * and 1 for a mismatch. - */ -int report_match_status(void) -{ - int resp =3D 0; - fprintf(stderr, "match status...\n"); - - if (packet_mismatch) { - fprintf(stderr, "packet mismatch (probably disagreement " - "about UNDEF on load/store)\n"); - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - } - if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { - fprintf(stderr, "mismatch on regs!\n"); - resp =3D 1; - } - if (mem_used && memcmp(memblock, &apprentice_memblock, MEMBLOCKLEN) != =3D 0) { - fprintf(stderr, "mismatch on memory!\n"); - resp =3D 1; - } - if (!resp) { - fprintf(stderr, "match!\n"); - return 0; - } - - fprintf(stderr, "master reginfo:\n"); - reginfo_dump(&master_ri, stderr); - - fprintf(stderr, "apprentice reginfo:\n"); - reginfo_dump(&apprentice_ri, stderr); - - reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); - return resp; -} --=20 2.7.4 From nobody Sat May 4 20:55:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487957868505238.46440850761599; Fri, 24 Feb 2017 09:37:48 -0800 (PST) Received: from localhost ([::1]:38869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJoQ-00052o-8x for importer@patchew.org; Fri, 24 Feb 2017 12:37:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJmN-0003rz-6K for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJmM-0004qo-5N for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:39 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJmL-0004Og-Um for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:35:38 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1chJmI-0008ND-0r; Fri, 24 Feb 2017 17:35:34 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 17:35:28 +0000 Message-Id: <1487957728-8354-10-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> References: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH risu 9/9] Tidy up #include lines X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Nikunj A Dadhania Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Tidy up unnecessary #includes that risu.h provides. Signed-off-by: Peter Maydell Tested-by: Laurent Vivier --- risu.h | 1 + risu_aarch64.c | 5 ----- risu_m68k.c | 5 ----- risu_ppc64le.c | 5 ----- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/risu.h b/risu.h index 90e4f23..883bcf7 100644 --- a/risu.h +++ b/risu.h @@ -15,6 +15,7 @@ #include #include #include +#include =20 /* GCC computed include to pull in the correct risu_reginfo_*.h for * the architecture. diff --git a/risu_aarch64.c b/risu_aarch64.c index cdd23d8..9c6809d 100644 --- a/risu_aarch64.c +++ b/risu_aarch64.c @@ -10,12 +10,7 @@ * based on Peter Maydell's risu_arm.c *************************************************************************= ****/ =20 -#include -#include -#include - #include "risu.h" -#include "risu_reginfo_aarch64.h" =20 void advance_pc(void *vuc) { diff --git a/risu_m68k.c b/risu_m68k.c index 851487b..f84ac7a 100644 --- a/risu_m68k.c +++ b/risu_m68k.c @@ -6,12 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html *************************************************************************= *****/ =20 -#include -#include -#include - #include "risu.h" -#include "risu_reginfo_m68k.h" =20 void advance_pc(void *vuc) { diff --git a/risu_ppc64le.c b/risu_ppc64le.c index c15d78e..b575078 100644 --- a/risu_ppc64le.c +++ b/risu_ppc64le.c @@ -11,12 +11,7 @@ * based on Peter Maydell's risu_arm.c *************************************************************************= ****/ =20 -#include -#include -#include - #include "risu.h" -#include "risu_reginfo_ppc64le.h" =20 void advance_pc(void *vuc) { --=20 2.7.4