Index: sys/dev/acpica/acpi_pcib.c
===================================================================
RCS file: /home/cvs/src/sys/dev/acpica/acpi_pcib.c,v
retrieving revision 1.10
diff -u -u -r1.10 acpi_pcib.c
--- sys/dev/acpica/acpi_pcib.c	2001/07/07 10:12:06	1.10
+++ sys/dev/acpica/acpi_pcib.c	2001/07/27 02:44:32
@@ -269,6 +269,41 @@
     pci_cfgregwrite(bus, slot, func, reg, data, bytes);
 }
 
+static ACPI_STATUS
+acpi_EnlargeResource(ACPI_BUFFER *bufp, ACPI_RESOURCE *curp, size_t want)
+{
+	ACPI_RESOURCE	*top;
+	ACPI_RESOURCE	*alloc;
+	size_t		p;
+	size_t		BufferSize;
+
+	if (curp < (top = bufp->Pointer) ||
+	    POINTER_ADD(ACPI_RESOURCE, top, bufp->Length - curp->Length) < curp)
+		return AE_BAD_PARAMETER;
+
+	BufferSize = bufp->Length - curp->Length + want;
+	if ((alloc = AcpiOsAllocate(BufferSize)) == NULL)
+		return AE_NO_MEMORY;
+
+	p = (char *)curp - (char *)top;
+	memcpy(alloc, top, p);
+
+	memcpy((char *)alloc + p, curp, want);
+	(POINTER_ADD(ACPI_RESOURCE, alloc, p))->Length = want;
+
+	memcpy((char *)alloc + p + want, (char *)curp + curp->Length,
+	    bufp->Length - p - curp->Length);
+
+	alloc->Length += want - curp->Length;
+	bufp->Length = BufferSize;
+	AcpiOsFree(bufp->Pointer);
+	bufp->Pointer = alloc;
+
+	return AE_OK;
+}
+
+
+
 /*
  * Route an interrupt for a child of the bridge.
  *
@@ -473,6 +508,43 @@
     for (i = 0; i < prsres->Data.Irq.NumberOfInterrupts; i++)
 	printf("  %d", prsres->Data.Irq.Interrupts[i]);
     printf("\n");
+
+    {
+	ACPI_RESOURCE	*r, *s;
+	size_t		newsize;
+	int		i, j, n;
+
+	/*
+	 * first grow the size of IRQ resource so we have room for an IRQ
+	 */
+	n = crsres->Data.Irq.NumberOfInterrupts +
+	    prsres->Data.Irq.NumberOfInterrupts;
+	newsize = (char *)&(crsres->Data.Irq.Interrupts[0]) - (char *)crsres +
+	    n * sizeof (crsres->Data.Irq.Interrupts[0]);
+	if (acpi_EnlargeResource(&crsbuf, crsres, newsize) != AE_OK)
+	    goto out;
+
+	/* fix crsres point to the resource in the newly allocated buffer */
+	acpi_FindIndexedResource((ACPI_RESOURCE *)crsbuf.Pointer,
+	    prt->SourceIndex, &crsres);
+
+	for (i = crsres->Data.Irq.NumberOfInterrupts, j = 0; i < n; ++i, ++j)
+	    crsres->Data.Irq.Interrupts[i] = prsres->Data.Irq.Interrupts[j];
+	crsres->Data.Irq.NumberOfInterrupts = n;
+
+	/*
+	 * find the last element(Length = 0)
+	 * and set Id to ACPI_RSTYPE_END_TAG
+	 */
+	r = crsbuf.Pointer,
+	s = POINTER_ADD(ACPI_RESOURCE, crsbuf.Pointer, crsbuf.Length);
+	for (; r < s; r = POINTER_ADD(ACPI_RESOURCE, r, r->Length))
+	    if (r->Length == 0) {
+		r->Id = ACPI_RSTYPE_END_TAG;
+		break;
+	    }
+    }
+
     crsres->Data.Irq.Interrupts[0] = prsres->Data.Irq.Interrupts[0];
     crsres->Data.Irq.NumberOfInterrupts = 1;
     if (ACPI_FAILURE(status = AcpiSetCurrentResources(lnkdev, &crsbuf))) {
