From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH risu 6/9] Make reginfo_{init, is_eq, dump, dump_mismatch} official per-CPU API
Date: Fri, 24 Feb 2017 17:35:25 +0000 [thread overview]
Message-ID: <1487957728-8354-7-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1487957728-8354-1-git-send-email-peter.maydell@linaro.org>
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 <peter.maydell@linaro.org>
---
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 @@
#include <inttypes.h>
#include <stdint.h>
+#include <ucontext.h>
/* 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);
+/* 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=ok */
+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];
};
-/* 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=ok */
-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;
};
-/* 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;
};
-/* 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=ok */
-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;
};
-/* 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=ok */
-int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f);
-
#endif /* RISU_REGINFO_PPC64LE_H */
--
2.7.4
next prev parent reply other threads:[~2017-02-24 17:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-24 17:35 [Qemu-devel] [PATCH risu 0/9] risu: refactor and reduce CPU-specific code Peter Maydell
2017-02-24 17:35 ` [Qemu-devel] [PATCH risu 1/9] Drop the weird modification of a ucontext in the ppc reginfo_is_eq() Peter Maydell
2017-02-24 17:35 ` [Qemu-devel] [PATCH risu 2/9] Abstract out getting and setting parameter register Peter Maydell
2017-02-24 17:35 ` [Qemu-devel] [PATCH risu 3/9] Make get_risuop() a formal part of the CPU interface Peter Maydell
2017-02-24 17:35 ` [Qemu-devel] [PATCH risu 4/9] ppc64le, m68k: Make reginfo_dump() API match arm, aarch64 Peter Maydell
2017-02-24 17:35 ` [Qemu-devel] [PATCH risu 5/9] m68k: Drop unused ucontext_t* argument to reginfo_is_eq() Peter Maydell
2017-02-24 17:35 ` Peter Maydell [this message]
2017-02-24 17:35 ` [Qemu-devel] [PATCH risu 7/9] Move send_register_info() to reginfo.c Peter Maydell
2017-02-24 17:35 ` [Qemu-devel] [PATCH risu 8/9] Move recv_and_compare_register_info() and report_match_status() " Peter Maydell
2017-02-24 17:35 ` [Qemu-devel] [PATCH risu 9/9] Tidy up #include lines Peter Maydell
2017-02-24 18:15 ` [Qemu-devel] [PATCH risu 0/9] risu: refactor and reduce CPU-specific code Laurent Vivier
2017-02-24 18:17 ` Peter Maydell
2017-02-28 17:47 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487957728-8354-7-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=laurent@vivier.eu \
--cc=nikunj@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).