summaryrefslogtreecommitdiffstats
path: root/include/abort.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-02-26 13:44:50 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-02-27 13:17:31 +0100
commitb42a3e2f68f97464d60110c58ba5f5f0e4bc333b (patch)
treebbae588bdc9fb5ba9ba7992792d6a5acd6c4ba88 /include/abort.h
parent86759346bac4477c6b3b34bbfc47bb42c46046a1 (diff)
downloadbarebox-b42a3e2f68f97464d60110c58ba5f5f0e4bc333b.tar.gz
barebox-b42a3e2f68f97464d60110c58ba5f5f0e4bc333b.tar.xz
ARM: Allow to mask data aborts
Sometimes it's useful to test if a memory operation works or aborts. This adds data_abort_mask() to ignore data aborts and data_abort_unmask() to enable them again. This is used in the next step for the 'md' command so that illegal addresses just show 'xxxxxxxx' instead of crashing the system. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/abort.h')
-rw-r--r--include/abort.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/abort.h b/include/abort.h
new file mode 100644
index 0000000000..7f14cb0bb5
--- /dev/null
+++ b/include/abort.h
@@ -0,0 +1,37 @@
+#ifndef __ABORT_H
+#define __ABORT_H
+
+#include <asm/barebox.h>
+
+#ifdef ARCH_HAS_DATA_ABORT_MASK
+
+/*
+ * data_abort_mask - ignore data aborts
+ *
+ * If data aborts are ignored the data abort handler
+ * will just return.
+ */
+void data_abort_mask(void);
+
+/*
+ * data_abort_unmask - Enable data aborts
+ *
+ * returns true if a data abort has happened between calling data_abort_mask()
+ * and data_abort_unmask()
+ */
+int data_abort_unmask(void);
+
+#else
+
+static inline void data_abort_mask(void)
+{
+}
+
+static inline int data_abort_unmask(void)
+{
+ return 0;
+}
+
+#endif
+
+#endif /* __ABORT_H */