aboutsummaryrefslogtreecommitdiff
path: root/risu.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-02-24 17:02:25 +0000
committerPeter Maydell <peter.maydell@linaro.org>2017-02-24 17:02:58 +0000
commit31e34835ebbf98beab46e6d2ae832a1dd6e054de (patch)
tree470c9c72351f25c096770f7478cc05ec4daae914 /risu.h
parent02998ad7c3b71add9391b04263c95dbe60c13112 (diff)
Move send_register_info() to reginfo.c
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 <peter.maydell@linaro.org>
Diffstat (limited to 'risu.h')
-rw-r--r--risu.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/risu.h b/risu.h
index d95dace..0f00b5f 100644
--- a/risu.h
+++ b/risu.h
@@ -16,6 +16,15 @@
#include <stdint.h>
#include <ucontext.h>
+/* 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_ ## ARCHNAME.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;
struct reginfo;
-/* Interface provided by CPU-specific code: */
+/* Functions operating on reginfo */
/* 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);
+/* 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.