]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/mm: Introduce mm-types.h
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 25 Apr 2025 10:20:09 +0000 (11:20 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 1 May 2025 21:55:46 +0000 (22:55 +0100)
The type used for pagetable attributes/permissions is currently unsigned int,
but needs to become architecture dependent as PPC needs unsigned long.

Introduce mm-types.h to house pte_attr_t.

Given the new toolchain baseline, we can use __has_include() now to remove the
need for boilerplate on most architectures.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/xen/mm-types.h [new file with mode: 0644]

diff --git a/xen/include/xen/mm-types.h b/xen/include/xen/mm-types.h
new file mode 100644 (file)
index 0000000..19f692e
--- /dev/null
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef XEN_MM_TYPES_H
+#define XEN_MM_TYPES_H
+
+/*
+ * Types used to abstract away architecture-specific details in the memory
+ * management code.
+ *
+ * Architectures need only provide their own asm/mm-types.h if they want to
+ * override the defaults given here.
+ */
+#if __has_include(<asm/mm-types.h>)
+# include <asm/mm-types.h>
+#else /* !__has_include(<asm/mm-types.h>) */
+
+typedef unsigned int pte_attr_t;
+
+#endif /* !__has_include(<asm/mm-types.h>) */
+#endif /* XEN_MM_TYPES_H */