aboutsummaryrefslogtreecommitdiff
path: root/risu.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2010-09-20 18:41:19 +0100
committerPeter Maydell <peter.maydell@linaro.org>2010-09-20 18:46:37 +0100
commit452057e1b7fc91bfa3ee06e5a71c3d13d2711b6b (patch)
tree00e3b1212be8cda04d39bd7b4802d5d6c60cfef2 /risu.h
parent403892c49503b5939689dc7793ca413bbdd4ba37 (diff)
Add the initial structure of SIGILL handling and CPU-specific interface.
Diffstat (limited to 'risu.h')
-rw-r--r--risu.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/risu.h b/risu.h
new file mode 100644
index 0000000..8964e30
--- /dev/null
+++ b/risu.h
@@ -0,0 +1,39 @@
+/* Copyright 2010 Linaro Limited */
+
+#ifndef RISU_H
+#define RISU_H
+
+#include <stdint.h>
+
+/* Socket related routines */
+int master_connect(uint16_t port);
+int apprentice_connect(const char *hostname, uint16_t port);
+int send_data_pkt(int sock, void *pkt, int pktlen);
+void recv_data_pkt(int sock, void *pkt, int pktlen);
+void send_response_byte(int sock, int resp);
+
+
+
+/* Interface provided by CPU-specific code: */
+
+/* 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);
+
+/* 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);
+
+/* 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);
+
+#endif /* RISU_H */