> diff -ur hurd.orig/libddekit/pci.c hurd-0.9.git20250801/libddekit/pci.c
> --- hurd.orig/libddekit/pci.c 2025-10-23 05:36:08.000000000 +0100
> +++ hurd-0.9.git20250801/libddekit/pci.c      2025-10-23 05:38:19.000000000 
> +0100
> @@ -399,7 +399,21 @@
>       //TODO l4io_pci_set_master(dev->l4dev.handle);
>  }
>  
> +#include "libirqhelp/irqhelp.h"
> +#include <hurd.h>

There shouldn't be a need for including <hurd.h>?

> +
>  int ddekit_pci_irq_enable(int bus, int slot, int func, int pin, int *irq)
>  {
> -     return 0;
> +  int gsi = -1;
> +
> +  if (irqhelp_gsi_from_acpi(bus, slot, func, &gsi))

Indeed, that looks fine.

> +    {
> +      ddekit_printf("Cannot find gsi for: %d:%d:%d\n", bus, slot, func);
> +    }
> +  else if (gsi >= 0)
> +    {
> +      *irq = gsi;
> +    }
> +
> +  return 0;
>  }
> diff -ur hurd.orig/libirqhelp/irqhelp.c 
> hurd-0.9.git20250801/libirqhelp/irqhelp.c
> --- hurd.orig/libirqhelp/irqhelp.c    2025-10-23 05:36:53.000000000 +0100
> +++ hurd-0.9.git20250801/libirqhelp/irqhelp.c 2025-10-23 05:37:19.000000000 
> +0100
> @@ -355,6 +355,18 @@
>  }
>  
>  error_t
> +irqhelp_gsi_from_acpi(int bus, int dev, int fun, int* gsi)
> +{
> +  if (acpi_missing)
> +    return EIO;
> +
> +  if ((bus < 0) || (dev < 0) || (fun < 0))
> +    return EINVAL;
> +
> +  return acpi_get_pci_irq (acpidev, bus, dev, fun, gsi);
> +}
> +
> +error_t
>  irqhelp_remove_interrupt_handler(struct irq *irq)
>  {
>    if (!irq)
> diff -ur hurd.orig/libirqhelp/irqhelp.h 
> hurd-0.9.git20250801/libirqhelp/irqhelp.h
> --- hurd.orig/libirqhelp/irqhelp.h    2025-10-23 05:37:01.000000000 +0100
> +++ hurd-0.9.git20250801/libirqhelp/irqhelp.h 2025-10-23 05:37:19.000000000 
> +0100
> @@ -34,6 +34,11 @@
>     Returns a pointer to be used with other functions. */
>  struct irq * irqhelp_install_interrupt_handler(int gsi, int bus, int dev, 
> int fun,
>                                              void (*handler)(void *), void 
> *context);
> +
> +/* Lookup the required GSI for the device via ACPI */
> +error_t
> +irqhelp_gsi_from_acpi(int bus, int dev, int fun, int* gsi);
> +
>  /* Install as pthread */
>  void * irqhelp_server_loop(void *arg);
>  

> --- acpi_init.c.orig  2025-10-18 12:40:48.000000000 +0100
> +++ acpi_init.c       2025-10-18 13:13:03.000000000 +0100

I don't know acpi enough to be able to say anything about this change.

Samuel

Reply via email to