aboutsummaryrefslogtreecommitdiffstats
path: root/os/various/memtest.hpp
diff options
context:
space:
mode:
authorbarthess <barthess@yandex.ru>2015-08-04 00:35:44 +0300
committerbarthess <barthess@yandex.ru>2015-08-04 00:35:44 +0300
commit8c8c0a0be4dc937c36bac5c5f29a1974e5a1e0ec (patch)
tree6308cb8202e2b58da8086900ae9a123714b4e40c /os/various/memtest.hpp
parentcabe3aafad984ea9f5e05a237fa0e0e8d062d931 (diff)
downloadChibiOS-Contrib-8c8c0a0be4dc937c36bac5c5f29a1974e5a1e0ec.tar.gz
ChibiOS-Contrib-8c8c0a0be4dc937c36bac5c5f29a1974e5a1e0ec.tar.bz2
ChibiOS-Contrib-8c8c0a0be4dc937c36bac5c5f29a1974e5a1e0ec.zip
Memtest improvements
Diffstat (limited to 'os/various/memtest.hpp')
-rw-r--r--os/various/memtest.hpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/os/various/memtest.hpp b/os/various/memtest.hpp
index 200db1f..ba686a3 100644
--- a/os/various/memtest.hpp
+++ b/os/various/memtest.hpp
@@ -37,7 +37,8 @@ typedef uint32_t testtype;
/*
* Error call back.
*/
-typedef void (*memtestecb_t)(memtest_t *testp, testtype type, size_t address);
+typedef void (*memtestecb_t)(memtest_t *testp, testtype type, size_t offset,
+ size_t current_width, uint32_t got, uint32_t expect);
/*
*
@@ -45,18 +46,32 @@ typedef void (*memtestecb_t)(memtest_t *testp, testtype type, size_t address);
typedef enum {
MEMTEST_WIDTH_8,
MEMTEST_WIDTH_16,
- MEMTEST_WIDTH_32
+ MEMTEST_WIDTH_32,
} memtest_bus_width_t;
/*
*
*/
struct memtest_t {
+ /*
+ * Pointer to the test area start. Must be word aligned.
+ */
void *start;
+ /*
+ * Test area size in bytes.
+ */
size_t size;
+ /*
+ * Maximum width of transactions.
+ * Note: it implies all narrower tests.
+ * Note: width my be wider then your memory interface because AHB is
+ * smart enough to split big transactions to smaller ones.
+ */
memtest_bus_width_t width;
- memtestecb_t ecb;
- unsigned int rand_seed;
+ /*
+ * Error callback pointer. Set to NULL if unused.
+ */
+ memtestecb_t errcb;
};
/*