summaryrefslogtreecommitdiff
path: root/cactus/cactus_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'cactus/cactus_helpers.h')
-rw-r--r--cactus/cactus_helpers.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/cactus/cactus_helpers.h b/cactus/cactus_helpers.h
new file mode 100644
index 0000000..f4c766c
--- /dev/null
+++ b/cactus/cactus_helpers.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef __CACTUS_HELPERS_H__
+#define __CACTUS_HELPERS_H__
+
+#include <stdint.h>
+
+/*
+ * Helper functions
+ */
+uint64_t cactus_svc(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3,
+ uint64_t x4, uint64_t x5, uint64_t x6, uint64_t x7);
+
+/*
+ * Choose a pseudo-random number within the [min,max] range (both limits are
+ * inclusive).
+ */
+uintptr_t bound_rand(uintptr_t min, uintptr_t max);
+
+/*
+ * Check that expr == expected.
+ * If not, loop forever.
+ */
+void expect(int expr, int expected);
+
+/*
+ * Test framework functions
+ */
+
+void announce_test_section_start(const char *test_sect_desc);
+void announce_test_section_end(const char *test_sect_desc);
+
+void announce_test_start(const char *test_desc);
+void announce_test_end(const char *test_desc);
+
+#endif /* __CACTUS_HELPERS_H__ */