diff mbox series

[v2,09/15] xen/asm-generic: introduce generic header smp.h

Message ID bf7b027f7ae05533a6b2034e2ad4882ae27f2c67.1699633310.git.oleksii.kurochko@gmail.com (mailing list archive)
State Superseded
Headers show
Series Introduce generic headers | expand

Commit Message

Oleksii Kurochko Nov. 10, 2023, 4:30 p.m. UTC
<asm/smp.h> is expcted to be generic between Arm, PPC and RISC-V
there by it is moved to asm-generic.

Right now it is common only by PPC and RISC-V but during work on
support of the mentioned arhcs <asm/smp.h> is expected to be the
same.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V2:
	- drop #ifded ASSEMBLY as this header isn't expected to be included in asm files.
	- update the commit message.
---
 xen/include/asm-generic/smp.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 xen/include/asm-generic/smp.h

Comments

Oleksii Kurochko Nov. 17, 2023, 9:58 a.m. UTC | #1
I will drop this patch as it will be hard to make it generic for Arm,
PPC and RISC-V.

~ Oleksii

On Fri, 2023-11-10 at 18:30 +0200, Oleksii Kurochko wrote:
> <asm/smp.h> is expcted to be generic between Arm, PPC and RISC-V
> there by it is moved to asm-generic.
> 
> Right now it is common only by PPC and RISC-V but during work on
> support of the mentioned arhcs <asm/smp.h> is expected to be the
> same.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> Changes in V2:
>         - drop #ifded ASSEMBLY as this header isn't expected to be
> included in asm files.
>         - update the commit message.
> ---
>  xen/include/asm-generic/smp.h | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 xen/include/asm-generic/smp.h
> 
> diff --git a/xen/include/asm-generic/smp.h b/xen/include/asm-
> generic/smp.h
> new file mode 100644
> index 0000000000..6740a2064c
> --- /dev/null
> +++ b/xen/include/asm-generic/smp.h
> @@ -0,0 +1,28 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __ASM_GENERIC_SMP_H
> +#define __ASM_GENERIC_SMP_H
> +
> +#include <xen/cpumask.h>
> +#include <xen/percpu.h>
> +
> +DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
> +DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
> +
> +#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
> +
> +/*
> + * Do we, for platform reasons, need to actually keep CPUs online
> when we
> + * would otherwise prefer them to be off?
> + */
> +#define park_offline_cpus false
> +
> +#endif
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: BSD
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
diff mbox series

Patch

diff --git a/xen/include/asm-generic/smp.h b/xen/include/asm-generic/smp.h
new file mode 100644
index 0000000000..6740a2064c
--- /dev/null
+++ b/xen/include/asm-generic/smp.h
@@ -0,0 +1,28 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_SMP_H
+#define __ASM_GENERIC_SMP_H
+
+#include <xen/cpumask.h>
+#include <xen/percpu.h>
+
+DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
+DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
+
+#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
+
+/*
+ * Do we, for platform reasons, need to actually keep CPUs online when we
+ * would otherwise prefer them to be off?
+ */
+#define park_offline_cpus false
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: BSD
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */