|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v3 01/22] xen/device-tree: Initial framework for Device Tree NUMA support
Introduce the initial framework for Device Tree-based NUMA support
on ARM Xen. This patch adds the required Device Tree-dependent
helper functions needed for NUMA configuration. Note that some
functions currently contain stub implementations.
Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
---
xen/include/xen/bootinfo.h | 14 ++++++++++++++
xen/include/xen/dt-numa.h | 23 +++++++++++++++++++++++
2 files changed, 37 insertions(+)
create mode 100644 xen/include/xen/dt-numa.h
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index dbf492c2e3..ca675db5ce 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -6,6 +6,7 @@
#include <xen/kernel.h>
#include <xen/macros.h>
#include <xen/xmalloc.h>
+#include <xen/errno.h>
#define NR_MEM_BANKS 256
#define NR_SHMEM_BANKS 32
@@ -214,4 +215,17 @@ void fw_unreserved_regions(paddr_t s, paddr_t e,
void (*cb)(paddr_t ps, paddr_t pe),
unsigned int first);
+static inline int bootinfo_get_ram_range(unsigned int idx, paddr_t *start,
paddr_t *end)
+{
+ struct membanks *mem = bootinfo_get_mem();
+
+ if ( idx >= mem->nr_banks )
+ return -ENOENT;
+
+ *start = mem->bank[idx].start;
+ *end = *start + mem->bank[idx].size;
+
+ return 0;
+}
+
#endif /* XEN_BOOTINFO_H */
diff --git a/xen/include/xen/dt-numa.h b/xen/include/xen/dt-numa.h
new file mode 100644
index 0000000000..c4a229bf9b
--- /dev/null
+++ b/xen/include/xen/dt-numa.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DT_NUMA_H
+#define XEN_DT_NUMA_H
+
+#include <xen/types.h>
+#include <xen/device_tree.h>
+
+static inline unsigned int numa_node_to_dt_nid(unsigned int n)
+{
+ return n;
+}
+
+#endif /* XEN_DT_NUMA_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |