[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/5] Make linux drivers optional
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 1/5] Make linux drivers optional |
Date: |
Sat, 27 Mar 2021 16:13:19 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Damien Zammit, le ven. 26 mars 2021 20:48:46 +1100, a ecrit:
> +#ifndef LINUX_DEV
> +struct intr_list {
> + user_intr_t *user_intr;
> + struct intr_list *next;
> +};
> +static struct intr_list *user_intr_handlers;
> +#endif
> +
> static user_intr_t *
> search_intr (struct irqdev *dev, ipc_port_t dst_port)
> {
> @@ -147,6 +156,33 @@ out:
> return ret;
> }
>
> +#ifndef LINUX_DEV
> +int
> +install_user_intr_handler (struct irqdev *dev, int id, unsigned long flags,
> + user_intr_t *user_intr)
> +{
> + unsigned int irq = dev->irq[id];
> + struct intr_list *old = user_intr_handlers;
> +
> + assert (irq < NINTR);
> +
> + while (old)
> + {
> + /* Test whether the irq handler has been set */
> + if (old->user_intr->dst_port && old->user_intr->dst_port ==
> user_intr->dst_port)
Did you mean old->user_intr like the linux code does?
> + {
> + printf ("This interrupt handler has already been installed on line
> %d", irq);
> + return 1;
> + }
> + old = old->next;
> + }
> +
> + old = kalloc (sizeof (struct intr_list));
> + *(old->user_intr) = *user_intr;
? did you mean
old->user_intr = user_intr;
?
Also, you need to add the new entry to the user_intr_handlers list.
> + return deliver_user_intr(dev, irq, old->user_intr);
?? what for in install_user_intr_handler??
Also, this patch seems to be lacking the actual interrupt delivery.
The interrupt delivery also has to check for the value returned by
deliver_user_intr, so the entry can be removed whenever it is not needed
any more. See how linux_intr does it.
> diff --git a/linux/configfrag.ac b/linux/configfrag.ac
> index 78b59d7f..26c99e45 100644
> --- a/linux/configfrag.ac
> +++ b/linux/configfrag.ac
I do not understand this part without explanation of your approach.
> @@ -33,6 +33,8 @@ dnl USE OF THIS SOFTWARE.
> + qemu)
> + device_driver_group_qemu=selected;;
? but qemu drivers is not a group?
> +AC_Linux_DRIVER([ne],
> + [Ethernet controller NE2000/NE1000 ISA (ne, ne1000, ne2000)],
> + [CONFIG_NE2000],
> + [qemu])
No, ne is part of the net group.
What is the actual intermediate problem you are trying to solve here by
making qemu a group?
Put another way, is it not possible to add a block group and use
--enable-block-group=no --enable-net-group=no --enable-scsi-group=no
--enable-wireless-group=no --enable-pcmcia-group=no
?
Samuel
- gnumach: IOAPIC and LAPIC support, Damien Zammit, 2021/03/26
- [PATCH 2/5] fixup acpi base table search, Damien Zammit, 2021/03/26
- [PATCH 1/5] Make linux drivers optional, Damien Zammit, 2021/03/26
- Re: [PATCH 1/5] Make linux drivers optional,
Samuel Thibault <=
- [PATCH 3/5] fix timer bug, Damien Zammit, 2021/03/26
- [PATCH 4/5] fix EISA check in init_IRQ, Damien Zammit, 2021/03/26
- [PATCH 5/5] ioapic interrupts and lapic timer support, Damien Zammit, 2021/03/26
- Re: gnumach: IOAPIC and LAPIC support, Samuel Thibault, 2021/03/26