diff mbox series

[v2,24/39] xen/riscv: introduce asm/irq.h

Message ID e9fc98cad562dad495ac1eb87b98be77cda72524.1700761381.git.oleksii.kurochko@gmail.com (mailing list archive)
State Superseded
Headers show
Series Enable build of full Xen for RISC-V | expand

Commit Message

Oleksii Kurochko Nov. 24, 2023, 10:30 a.m. UTC
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V2:
	- add ifdef CONFIG_HAS_DEVICE_TREE for things that shouldn't be
      in case !CONFIG_HAS_DEVICE_TREE
	- use proper includes.
---
 xen/arch/riscv/include/asm/irq.h | 37 ++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 xen/arch/riscv/include/asm/irq.h

Comments

Jan Beulich Dec. 14, 2023, 2:09 p.m. UTC | #1
On 24.11.2023 11:30, Oleksii Kurochko wrote:
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> Changes in V2:
> 	- add ifdef CONFIG_HAS_DEVICE_TREE for things that shouldn't be
>       in case !CONFIG_HAS_DEVICE_TREE

Is there going to be a RISC-V build without this enabled (selected)? If
not, I'd recommend against such pointless #ifdef-ary.

Jan
Oleksii Kurochko Dec. 18, 2023, 10:04 a.m. UTC | #2
On Thu, 2023-12-14 at 15:09 +0100, Jan Beulich wrote:
> On 24.11.2023 11:30, Oleksii Kurochko wrote:
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> > Changes in V2:
> > 	- add ifdef CONFIG_HAS_DEVICE_TREE for things that
> > shouldn't be
> >       in case !CONFIG_HAS_DEVICE_TREE
> 
> Is there going to be a RISC-V build without this enabled (selected)?
> If
> not, I'd recommend against such pointless #ifdef-ary.
For this stage (Xen RISC-V full build), CONFIG_HAS_DEVICE_TREE will not
be selected, but it will be in the near future.

~ Oleksii
Jan Beulich Dec. 18, 2023, 10:12 a.m. UTC | #3
On 18.12.2023 11:04, Oleksii wrote:
> On Thu, 2023-12-14 at 15:09 +0100, Jan Beulich wrote:
>> On 24.11.2023 11:30, Oleksii Kurochko wrote:
>>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>> ---
>>> Changes in V2:
>>> 	- add ifdef CONFIG_HAS_DEVICE_TREE for things that
>>> shouldn't be
>>>       in case !CONFIG_HAS_DEVICE_TREE
>>
>> Is there going to be a RISC-V build without this enabled (selected)?
>> If
>> not, I'd recommend against such pointless #ifdef-ary.
> For this stage (Xen RISC-V full build), CONFIG_HAS_DEVICE_TREE will not
> be selected, but it will be in the near future.

And from then on it'll always be selected, or only conditionally? In the
former case it would still feel odd if #ifdef-s were introduced.

Jan
Oleksii Kurochko Dec. 18, 2023, 11:42 a.m. UTC | #4
On Mon, 2023-12-18 at 11:12 +0100, Jan Beulich wrote:
> On 18.12.2023 11:04, Oleksii wrote:
> > On Thu, 2023-12-14 at 15:09 +0100, Jan Beulich wrote:
> > > On 24.11.2023 11:30, Oleksii Kurochko wrote:
> > > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > > > ---
> > > > Changes in V2:
> > > > 	- add ifdef CONFIG_HAS_DEVICE_TREE for things that
> > > > shouldn't be
> > > >       in case !CONFIG_HAS_DEVICE_TREE
> > > 
> > > Is there going to be a RISC-V build without this enabled
> > > (selected)?
> > > If
> > > not, I'd recommend against such pointless #ifdef-ary.
> > For this stage (Xen RISC-V full build), CONFIG_HAS_DEVICE_TREE will
> > not
> > be selected, but it will be in the near future.
> 
> And from then on it'll always be selected, or only conditionally? In
> the
> former case it would still feel odd if #ifdef-s were introduced.
It will always be selected until ACPI support is provided. I've seen
patches that add ACPI support for the Linux kernel, but I'm not sure if
it is really needed at this point. So, I've planned to go with Device
Tree for quite a while

~ Oleksii
diff mbox series

Patch

diff --git a/xen/arch/riscv/include/asm/irq.h b/xen/arch/riscv/include/asm/irq.h
new file mode 100644
index 0000000000..ca49d3f9b4
--- /dev/null
+++ b/xen/arch/riscv/include/asm/irq.h
@@ -0,0 +1,37 @@ 
+#ifndef __ASM_RISCV_IRQ_H__
+#define __ASM_RISCV_IRQ_H__
+
+#include <xen/bug.h>
+#ifdef CONFIG_HAS_DEVICE_TREE
+#include <xen/device_tree.h>
+#endif
+
+/* TODO */
+#define nr_irqs 0U
+#define nr_static_irqs 0
+#define arch_hwdom_irqs(domid) 0U
+
+#define domain_pirq_to_irq(d, pirq) (pirq)
+
+#define arch_evtchn_bind_pirq(d, pirq) ((void)((d) + (pirq)))
+
+struct arch_pirq {
+};
+
+struct arch_irq_desc {
+    unsigned int type;
+};
+
+static inline void arch_move_irqs(struct vcpu *v)
+{
+    BUG();
+}
+
+#ifdef CONFIG_HAS_DEVICE_TREE
+static inline int platform_get_irq(const struct dt_device_node *device, int index)
+{
+    BUG();
+}
+#endif
+
+#endif /* __ASM_RISCV_IRQ_H__ */