aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/memblock/tests/common.h
diff options
context:
space:
mode:
authorKarolina Drobnik <karolinadrobnik@gmail.com>2022-02-02 12:03:10 +0100
committerMike Rapoport <rppt@linux.ibm.com>2022-02-20 08:44:37 +0200
commitf3252a22d1f59d89cca769431efa1c95d6343929 (patch)
tree924a6a46092b6f7493f1f76029d8772c5eb981c0 /tools/testing/memblock/tests/common.h
parent16802e55dea9534c18a30bd8eeefea8a06337916 (diff)
memblock tests: Add memblock reset function
Memblock simulator needs to be able to reset memblock data structures between different test cases. Add a function that sets all fields to their default values. Add a test checking if memblock is being initialized to expected values. Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com> Signed-off-by: Mike Rapoport <rppt@kernel.org> Link: https://lore.kernel.org/r/8c185aa7e0dd68c2c7e937c9a06c90ae413e240f.1643796665.git.karolinadrobnik@gmail.com
Diffstat (limited to 'tools/testing/memblock/tests/common.h')
-rw-r--r--tools/testing/memblock/tests/common.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/testing/memblock/tests/common.h b/tools/testing/memblock/tests/common.h
new file mode 100644
index 000000000000..48efc4270ea1
--- /dev/null
+++ b/tools/testing/memblock/tests/common.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef _MEMBLOCK_TEST_H
+#define _MEMBLOCK_TEST_H
+
+#include <linux/types.h>
+#include <linux/memblock.h>
+
+struct region {
+ phys_addr_t base;
+ phys_addr_t size;
+};
+
+void reset_memblock(void);
+
+#endif