From patchwork Fri Dec 9 11:48:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 87445 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp262908qgi; Fri, 9 Dec 2016 03:52:13 -0800 (PST) X-Received: by 10.233.235.72 with SMTP id b69mr75695309qkg.144.1481284332956; Fri, 09 Dec 2016 03:52:12 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id q8si19805544qtc.272.2016.12.09.03.52.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 09 Dec 2016 03:52:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFJim-0002pI-9K for patch@linaro.org; Fri, 09 Dec 2016 06:52:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFJgO-0007Go-Nu for qemu-devel@nongnu.org; Fri, 09 Dec 2016 06:49:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFJgL-0007oj-Cy for qemu-devel@nongnu.org; Fri, 09 Dec 2016 06:49:44 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:34339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFJgL-0007oS-2P for qemu-devel@nongnu.org; Fri, 09 Dec 2016 06:49:41 -0500 Received: by mail-wm0-f47.google.com with SMTP id u144so12821989wmu.1 for ; Fri, 09 Dec 2016 03:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nOI+qzGPif5/fAqNQDmUR/6A8Ii/LVPvs7IzH6g2/1Q=; b=Z4ytGW4KGwtU438PdhwIwCy4Vfh7h61IPNuLkyVkMXu4KJEp3nDYtDP3MWIDPCeMLE llhP46ppIHP+cMC1PbhYxsHhBwETja8IVOohTIYGZBF0QUrPd7Cn5QTwxnRo5vY3Kwaj bvIcFoFBysHR+RI/FLwi/vFH49jHFq0/2rMS0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nOI+qzGPif5/fAqNQDmUR/6A8Ii/LVPvs7IzH6g2/1Q=; b=O/ZJOmG7VhEV+IgLvQ4rtRA+TN/y8OyxncXrgGaY9r5foYKpjs928dW2uCll8jVcZf a7Avn0aCNfwTFHsQyx6MOvkx7aJEaMhtHNQ/XBaNvjWZXiz0dUl72eW4w7lvxdwn8bHk TlsrPU6HgB8mP33BVzuZasVUkSEpsWWRht+zR9fmr72gTH4A/ivQjyiQIEjyuqRIXfOd OHWI3GIiiw+8zoBo5nVysiTrQsyvqJY4k+DkFDMSIRtblXBaFGz+z+hOe+PbDSBH+jwA Z+A+ScJ0JdxrV+Y7bzZTdWYxUpBVnecR1QkZ0j6Lm/la/R7+4P7JcPMcClUx9Kt8SMHg vCzg== X-Gm-Message-State: AKaTC00GHqOmBhHEwrtsQ8C6u0RL9LN6VIBdHfzaCoUcsh3FXynDYN78iEJ+CMLYd89z425f X-Received: by 10.28.74.133 with SMTP id n5mr6175307wmi.132.1481284119635; Fri, 09 Dec 2016 03:48:39 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id di9sm41882320wjc.37.2016.12.09.03.48.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Dec 2016 03:48:37 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A936E3E06EC; Fri, 9 Dec 2016 11:48:34 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 9 Dec 2016 11:48:23 +0000 Message-Id: <20161209114830.9158-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161209114830.9158-1-alex.bennee@linaro.org> References: <20161209114830.9158-1-alex.bennee@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.47 Subject: [Qemu-devel] [RISU PATCH v3 03/10] risu: paramterise send/receive functions 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , joserz@linux.vnet.ibm.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a precursor to record/playback support. Instead of passing the socket fd we now pass helper functions for reading/writing and responding. This will allow us to do the rest of the record/playback work without hacking up the arch specific stuff. I've also added a header packet with pc/risu op in it so we can keep better track of how things are going. --- v3 - new for v3 - arm, aarch64, ppc64 --- risu.c | 23 +++++++- risu.h | 11 +++- risu_aarch64.c | 115 ++++++++++++++++++++++++-------------- risu_arm.c | 147 +++++++++++++++++++++++++++++++------------------ risu_ppc64le.c | 127 ++++++++++++++++++++++++++---------------- risu_reginfo_aarch64.h | 7 +++ risu_reginfo_arm.h | 6 ++ risu_reginfo_ppc64le.h | 6 ++ 8 files changed, 295 insertions(+), 147 deletions(-) -- 2.11.0 diff --git a/risu.c b/risu.c index bcdc219..22571cd 100644 --- a/risu.c +++ b/risu.c @@ -47,9 +47,28 @@ void report_test_status(void *pc) } } +/* Master functions */ + +int read_sock(void *ptr, size_t bytes) +{ + return recv_data_pkt(master_socket, ptr, bytes); +} + +void respond_sock(int r) +{ + send_response_byte(master_socket, r); +} + +/* Apprentice function */ + +int write_sock(void *ptr, size_t bytes) +{ + return send_data_pkt(apprentice_socket, ptr, bytes); +} + void master_sigill(int sig, siginfo_t *si, void *uc) { - switch (recv_and_compare_register_info(master_socket, uc)) + switch (recv_and_compare_register_info(read_sock, respond_sock, uc)) { case 0: /* match OK */ @@ -63,7 +82,7 @@ void master_sigill(int sig, siginfo_t *si, void *uc) void apprentice_sigill(int sig, siginfo_t *si, void *uc) { - switch (send_register_info(apprentice_socket, uc)) + switch (send_register_info(write_sock, uc)) { case 0: /* match OK */ diff --git a/risu.h b/risu.h index e4bb323..b0178df 100644 --- a/risu.h +++ b/risu.h @@ -40,17 +40,24 @@ extern int ismaster; /* Interface provided by CPU-specific code: */ +/* To keep the read/write logic from multiplying across all arches + * we wrap up the function here to keep all the changes in one place + */ +typedef int (*write_fn) (void *ptr, size_t bytes); +typedef int (*read_fn) (void *ptr, size_t bytes); +typedef void (*respond_fn) (int response); + /* Send the register information from the struct ucontext down the socket. * Return the response code from the master. * NB: called from a signal handler. */ -int send_register_info(int sock, void *uc); +int send_register_info(write_fn write_fn, void *uc); /* 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 recv_and_compare_register_info(read_fn read_fn, respond_fn respond, void *uc); /* Print a useful report on the status of the last comparison * done in recv_and_compare_register_info(). This is called on diff --git a/risu_aarch64.c b/risu_aarch64.c index 1595604..c4c0d4d 100644 --- a/risu_aarch64.c +++ b/risu_aarch64.c @@ -50,21 +50,30 @@ static int get_risuop(uint32_t insn) return (key != risukey) ? -1 : op; } -int send_register_info(int sock, void *uc) +int send_register_info(write_fn write_fn, void *uc) { struct reginfo ri; - int op; + trace_header_t header; + int op, r = 0; + reginfo_init(&ri, uc); op = get_risuop(ri.faulting_insn); + /* Write a header with PC/op to keep in sync */ + header.pc = ri.pc; + header.risu_op = op; + if (write_fn(&header, sizeof(header)) != 0) { + fprintf(stderr,"%s: failed header write\n", __func__); + return -1; + } + 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)); + if (write_fn(&ri, sizeof(ri)) != 0) { + fprintf(stderr,"%s: failed last write\n", __func__); + } + r = 1; + break; case OP_SETMEMBLOCK: memblock = (void *)ri.regs[0]; break; @@ -72,10 +81,16 @@ int send_register_info(int sock, void *uc) set_x0(uc, ri.regs[0] + (uintptr_t)memblock); break; case OP_COMPAREMEM: - return send_data_pkt(sock, memblock, MEMBLOCKLEN); + return write_fn(memblock, MEMBLOCKLEN); break; + case OP_COMPARE: + default: + /* Do a simple register compare on (a) explicit request + * (b) end of test (c) a non-risuop UNDEF + */ + return write_fn(&ri, sizeof(ri)); } - return 0; + return r; } /* Read register info from the socket and compare it with that from the @@ -86,51 +101,69 @@ int send_register_info(int sock, void *uc) * 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 recv_and_compare_register_info(read_fn read_fn, respond_fn resp_fn, void *uc) { int resp = 0, op; + trace_header_t header; reginfo_init(&master_ri, uc); op = get_risuop(master_ri.faulting_insn); - 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 = 1; - resp = 2; - - } else if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { - /* register mismatch */ - resp = 2; - - } else if (op == OP_TESTEND) { - resp = 1; - } - send_response_byte(sock, resp); - break; - case OP_SETMEMBLOCK: + if (read_fn(&header, sizeof(header)) != 0) { + fprintf(stderr,"%s: failed header read\n", __func__); + return -1; + } + + if (header.risu_op == op ) { + + /* send OK for the header */ + resp_fn(0); + + 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 (read_fn(&apprentice_ri, sizeof(apprentice_ri))) { + packet_mismatch = 1; + resp = 2; + + } else if (!reginfo_is_eq(&master_ri, &apprentice_ri)) { + /* register mismatch */ + resp = 2; + + } else if (op == OP_TESTEND) { + resp = 1; + } + resp_fn(resp); + break; + case OP_SETMEMBLOCK: memblock = (void *)master_ri.regs[0]; break; - case OP_GETMEMBLOCK: + case OP_GETMEMBLOCK: set_x0(uc, master_ri.regs[0] + (uintptr_t)memblock); break; - case OP_COMPAREMEM: - mem_used = 1; - if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) { - packet_mismatch = 1; - resp = 2; - } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != 0) { + case OP_COMPAREMEM: + mem_used = 1; + if (read_fn(apprentice_memblock, MEMBLOCKLEN)) { + packet_mismatch = 1; + resp = 2; + } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != 0) { /* memory mismatch */ resp = 2; } - send_response_byte(sock, resp); + resp_fn(resp); break; - } + } + } else { + fprintf(stderr, "out of sync %lx/%lx %d/%d\n", + master_ri.pc, header.pc, + op, header.risu_op); + resp = 2; + resp_fn(resp); + } return resp; } diff --git a/risu_arm.c b/risu_arm.c index c3fe3d3..474729c 100644 --- a/risu_arm.c +++ b/risu_arm.c @@ -73,22 +73,31 @@ static int get_risuop(uint32_t insn, int isz) } -int send_register_info(int sock, void *uc) +int send_register_info(write_fn write_fn, void *uc) { struct reginfo ri; - int op; + trace_header_t header; + int op, r = 0; + reginfo_init(&ri, uc); op = get_risuop(ri.faulting_insn, ri.faulting_insn_size); + /* Write a header with PC/op to keep in sync */ + header.pc = ri.gpreg[15]; + header.risu_op = op; + if (write_fn(&header, sizeof(header)) != 0) { + fprintf(stderr,"%s: failed header write\n", __func__); + return -1; + } + 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)); + if (write_fn(&ri, sizeof(ri)) != 0) { + fprintf(stderr,"%s: failed last write\n", __func__); + } + r = 1; + break; case OP_SETMEMBLOCK: memblock = (void *)ri.gpreg[0]; break; @@ -96,10 +105,18 @@ int send_register_info(int sock, void *uc) set_r0(uc, ri.gpreg[0] + (uintptr_t)memblock); break; case OP_COMPAREMEM: - return send_data_pkt(sock, memblock, MEMBLOCKLEN); + r = write_fn(memblock, MEMBLOCKLEN); + break; + case OP_COMPARE: + default: + /* Do a simple register compare on (a) explicit request + * (b) end of test (c) a non-risuop UNDEF + */ + r = write_fn(&ri, sizeof(ri)); break; } - return 0; + + return r; } /* Read register info from the socket and compare it with that from the @@ -110,58 +127,78 @@ int send_register_info(int sock, void *uc) * 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 recv_and_compare_register_info(read_fn read_fn, respond_fn resp_fn, void *uc) { int resp = 0, op; + trace_header_t header; reginfo_init(&master_ri, uc); op = get_risuop(master_ri.faulting_insn, master_ri.faulting_insn_size); - 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 = 1; - resp = 2; - } - else if (memcmp(&master_ri, &apprentice_ri, sizeof(master_ri)) != 0) - { - /* register mismatch */ - resp = 2; - } - else if (op == OP_TESTEND) - { - resp = 1; - } - send_response_byte(sock, resp); - break; - case OP_SETMEMBLOCK: - memblock = (void *)master_ri.gpreg[0]; - break; - case OP_GETMEMBLOCK: - set_r0(uc, master_ri.gpreg[0] + (uintptr_t)memblock); - break; - case OP_COMPAREMEM: - mem_used = 1; - if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) - { - packet_mismatch = 1; - resp = 2; - } - else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != 0) - { - /* memory mismatch */ - resp = 2; - } - send_response_byte(sock, resp); - break; + if (read_fn(&header, sizeof(header)) != 0) { + fprintf(stderr,"%s: failed header read\n", __func__); + return -1; } + + if ( header.pc == master_ri.gpreg[15] && + header.risu_op == op ) { + + /* send OK for the header */ + resp_fn(0); + + 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 (read_fn(&apprentice_ri, sizeof(apprentice_ri))) + { + packet_mismatch = 1; + resp = 2; + } + else if (memcmp(&master_ri, &apprentice_ri, sizeof(master_ri)) != 0) + { + /* register mismatch */ + resp = 2; + } + else if (op == OP_TESTEND) + { + resp = 1; + } + resp_fn(resp); + break; + case OP_SETMEMBLOCK: + memblock = (void *)master_ri.gpreg[0]; + break; + case OP_GETMEMBLOCK: + set_r0(uc, master_ri.gpreg[0] + (uintptr_t)memblock); + break; + case OP_COMPAREMEM: + mem_used = 1; + if (read_fn(apprentice_memblock, MEMBLOCKLEN)) + { + packet_mismatch = 1; + resp = 2; + } + else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != 0) + { + /* memory mismatch */ + resp = 2; + } + resp_fn(resp); + break; + } + } else { + fprintf(stderr, "out of sync %x/%x %d/%d\n", + master_ri.gpreg[15], header.pc, + op, header.risu_op); + resp = 2; + resp_fn(resp); + } + return resp; } diff --git a/risu_ppc64le.c b/risu_ppc64le.c index 9c1fafd..f156ed8 100644 --- a/risu_ppc64le.c +++ b/risu_ppc64le.c @@ -44,19 +44,30 @@ static int get_risuop(uint32_t insn) return (key != risukey) ? -1 : op; } -int send_register_info(int sock, void *uc) +int send_register_info(write_fn write_fn, void *uc) { struct reginfo ri; - int op; + trace_header_t header; + int op, r = 0; reginfo_init(&ri, uc); op = get_risuop(ri.faulting_insn); + /* Write a header with PC/op to keep in sync */ + header.pc = ri.nip; + header.risu_op = op; + if (write_fn(&header, sizeof(header)) != 0) { + fprintf(stderr,"%s: failed header write\n", __func__); + return -1; + } + switch (op) { - case OP_COMPARE: case OP_TESTEND: - default: - return send_data_pkt(sock, &ri, sizeof(ri)); + if (write_fn(&ri, sizeof(ri)) != 0) { + fprintf(stderr,"%s: failed last write\n", __func__); + } + r = 1; + break; case OP_SETMEMBLOCK: memblock = (void*)ri.gregs[0]; break; @@ -64,57 +75,79 @@ int send_register_info(int sock, void *uc) set_x0(uc, ri.gregs[0] + (uintptr_t)memblock); break; case OP_COMPAREMEM: - return send_data_pkt(sock, memblock, MEMBLOCKLEN); + return write_fn(memblock, MEMBLOCKLEN); break; + case OP_COMPARE: + default: + return write_fn(&ri, sizeof(ri)); } - return 0; + return r; } /* 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 recv_and_compare_register_info(read_fn read_fn, respond_fn resp_fn, void *uc) { - int resp = 0; - int op; - - reginfo_init(&master_ri, uc); - op = get_risuop(master_ri.faulting_insn); - - switch (op) { - case OP_COMPARE: - case OP_TESTEND: - default: - if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) { - packet_mismatch = 1; - resp = 2; - } else if (!reginfo_is_eq(&master_ri, &apprentice_ri, uc)) { - resp = 2; - } - else if (op == OP_TESTEND) { - resp = 1; - } - send_response_byte(sock, resp); - break; - case OP_SETMEMBLOCK: - memblock = (void*)master_ri.gregs[0]; - break; - case OP_GETMEMBLOCK: - set_x0(uc, master_ri.gregs[0] + (uintptr_t)memblock); - break; - case OP_COMPAREMEM: - mem_used = 1; - if (recv_data_pkt(sock, apprentice_memblock, MEMBLOCKLEN)) { - packet_mismatch = 1; - resp = 2; - } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != 0) { - resp = 2; - } - send_response_byte(sock, resp); - break; - } - return resp; + int resp = 0; + int op; + trace_header_t header; + + reginfo_init(&master_ri, uc); + op = get_risuop(master_ri.faulting_insn); + + if (read_fn(&header, sizeof(header)) != 0) { + fprintf(stderr,"%s: failed header read\n", __func__); + return -1; + } + + if (header.risu_op == op ) { + + /* send OK for the header */ + resp_fn(0); + + switch (op) { + case OP_COMPARE: + case OP_TESTEND: + default: + if (read_fn(&apprentice_ri, sizeof(apprentice_ri))) { + packet_mismatch = 1; + resp = 2; + } else if (!reginfo_is_eq(&master_ri, &apprentice_ri, uc)) { + resp = 2; + } + else if (op == OP_TESTEND) { + resp = 1; + } + resp_fn(resp); + break; + case OP_SETMEMBLOCK: + memblock = (void*)master_ri.gregs[0]; + break; + case OP_GETMEMBLOCK: + set_x0(uc, master_ri.gregs[0] + (uintptr_t)memblock); + break; + case OP_COMPAREMEM: + mem_used = 1; + if (read_fn(apprentice_memblock, MEMBLOCKLEN)) { + packet_mismatch = 1; + resp = 2; + } else if (memcmp(memblock, apprentice_memblock, MEMBLOCKLEN) != 0) { + resp = 2; + } + resp_fn(resp); + break; + } + } else { + fprintf(stderr, "out of sync %lx/%lx %d/%d\n", + master_ri.nip, header.pc, + op, header.risu_op); + resp = 2; + resp_fn(resp); + } + + return resp; } /* Print a useful report on the status of the last comparison diff --git a/risu_reginfo_aarch64.h b/risu_reginfo_aarch64.h index 166b76c..db51cb2 100644 --- a/risu_reginfo_aarch64.h +++ b/risu_reginfo_aarch64.h @@ -28,6 +28,13 @@ struct reginfo __uint128_t vregs[32]; }; +typedef struct +{ + uint64_t pc; + uint32_t risu_op; +} trace_header_t; + + /* initialize structure from a ucontext */ void reginfo_init(struct reginfo *ri, ucontext_t *uc); diff --git a/risu_reginfo_arm.h b/risu_reginfo_arm.h index 80c28c6..7e7e408 100644 --- a/risu_reginfo_arm.h +++ b/risu_reginfo_arm.h @@ -23,6 +23,12 @@ struct reginfo uint32_t fpscr; }; +typedef struct +{ + uint32_t pc; + uint32_t risu_op; +} trace_header_t; + /* initialize a reginfo structure with data from uc */ void reginfo_init(struct reginfo *ri, ucontext_t *uc); diff --git a/risu_reginfo_ppc64le.h b/risu_reginfo_ppc64le.h index abe6002..49b4938 100644 --- a/risu_reginfo_ppc64le.h +++ b/risu_reginfo_ppc64le.h @@ -25,6 +25,12 @@ struct reginfo vrregset_t vrregs; }; +typedef struct +{ + uint64_t pc; + uint32_t risu_op; +} trace_header_t; + /* initialize structure from a ucontext */ void reginfo_init(struct reginfo *ri, ucontext_t *uc);