forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/x86/xen/enlighten.c
....@@ -1,10 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0
2
+
13 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
2
-#include <linux/bootmem.h>
4
+#include <linux/memblock.h>
35 #endif
46 #include <linux/cpu.h>
57 #include <linux/kexec.h>
68 #include <linux/slab.h>
79
10
+#include <xen/xen.h>
811 #include <xen/features.h>
912 #include <xen/page.h>
1013
....@@ -48,9 +51,6 @@
4851 DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
4952 EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
5053
51
-enum xen_domain_type xen_domain_type = XEN_NATIVE;
52
-EXPORT_SYMBOL_GPL(xen_domain_type);
53
-
5454 unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START;
5555 EXPORT_SYMBOL(machine_to_phys_mapping);
5656 unsigned long machine_to_phys_nr;
....@@ -65,10 +65,12 @@
6565 EXPORT_SYMBOL_GPL(xen_have_vector_callback);
6666
6767 /*
68
- * NB: needs to live in .data because it's used by xen_prepare_pvh which runs
69
- * before clearing the bss.
68
+ * NB: These need to live in .data or alike because they're used by
69
+ * xen_prepare_pvh() which runs before clearing the bss.
7070 */
71
-uint32_t xen_start_flags __attribute__((section(".data"))) = 0;
71
+enum xen_domain_type __ro_after_init xen_domain_type = XEN_NATIVE;
72
+EXPORT_SYMBOL_GPL(xen_domain_type);
73
+uint32_t xen_start_flags __section(".data") = 0;
7274 EXPORT_SYMBOL(xen_start_flags);
7375
7476 /*