summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h
diff options
context:
space:
mode:
authorChris Smart <chris@distroguy.com>2016-06-17 09:34:47 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2016-07-05 23:49:51 +1000
commit4375088072295b09cc5d9bf7a8cd2333b608492a (patch)
treeee4d78c9d440e0505c347212d5eb945302558d1b /tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h
parentae26b36f8098c793a754549662771099215904ed (diff)
downloadlinux-next-4375088072295b09cc5d9bf7a8cd2333b608492a.tar.gz
linux-next-4375088072295b09cc5d9bf7a8cd2333b608492a.zip
selftests/powerpc: Test unaligned copy and paste
Test that an ISA 3.0 compliant machine performing an unaligned copy, copy_first, paste or paste_last is sent a SIGBUS. Signed-off-by: Chris Smart <chris@distroguy.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h')
-rw-r--r--tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h b/tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h
new file mode 100644
index 000000000000..053899fe506e
--- /dev/null
+++ b/tools/testing/selftests/powerpc/alignment/copy_paste_unaligned_common.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2016, Chris Smart, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Declarations for common code for copy, copy_first, paste and
+ * paste_last unaligned tests.
+ *
+ */
+
+#ifndef _SELFTESTS_POWERPC_COPY_PASTE_H
+#define _SELFTESTS_POWERPC_COPY_PASTE_H
+
+#include <signal.h>
+
+int main(int argc, char *argv[]);
+void signal_action_handler(int signal_num, siginfo_t *info, void *ptr);
+void setup_signal_handler(void);
+extern char cacheline_buf[128] __cacheline_aligned;
+extern unsigned int expected_instruction;
+extern unsigned int instruction_mask;
+
+#endif /* _SELFTESTS_POWERPC_COPY_PASTE_H */