Index: rscalc.c =================================================================== RCS file: /home/cmplr/cvs/acpica/Acpi/source/components/resources/rscalc.c,v retrieving revision 1.82 diff -u -r1.82 rscalc.c --- rscalc.c 9 Jan 2008 21:27:19 -0000 1.82 +++ rscalc.c 24 Jan 2008 23:19:43 -0000 @@ -312,6 +312,15 @@ */ switch (Resource->Type) { + case ACPI_RESOURCE_TYPE_IRQ: + + if (Resource->Data.Irq.DescriptorLength == 2) + { + TotalSize--; + } + break; + + case ACPI_RESOURCE_TYPE_VENDOR: /* * Vendor Defined Resource: Index: rsdump.c =================================================================== RCS file: /home/cmplr/cvs/acpica/Acpi/source/components/resources/rsdump.c,v retrieving revision 1.63 diff -u -r1.63 rsdump.c --- rsdump.c 9 Jan 2008 21:27:19 -0000 1.63 +++ rsdump.c 7 Feb 2008 21:17:29 -0000 @@ -200,9 +200,10 @@ * ******************************************************************************/ -ACPI_RSDUMP_INFO AcpiRsDumpIrq[6] = +ACPI_RSDUMP_INFO AcpiRsDumpIrq[7] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIrq), "IRQ", NULL}, + {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.DescriptorLength), "Descriptor Length", NULL}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Triggering), "Triggering", AcpiGbl_HeDecode}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity), "Polarity", AcpiGbl_LlDecode}, {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Sharable), "Sharing", AcpiGbl_ShrDecode}, @@ -220,9 +221,10 @@ {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]), "Channel List", NULL} }; -ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[3] = +ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[4] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpStartDpf), "Start-Dependent-Functions",NULL}, + {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (StartDpf.DescriptorLength), "Descriptor Length", NULL}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.CompatibilityPriority), "Compatibility Priority", AcpiGbl_ConfigDecode}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.PerformanceRobustness), "Performance/Robustness", AcpiGbl_ConfigDecode} }; Index: rsio.c =================================================================== RCS file: /home/cmplr/cvs/acpica/Acpi/source/components/resources/rsio.c,v retrieving revision 1.36 diff -u -r1.36 rsio.c --- rsio.c 9 Jan 2008 21:27:19 -0000 1.36 +++ rsio.c 7 Feb 2008 21:04:08 -0000 @@ -272,7 +272,7 @@ * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsGetStartDpf[5] = +ACPI_RSCONVERT_INFO AcpiRsGetStartDpf[6] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_START_DEPENDENT, ACPI_RS_SIZE (ACPI_RESOURCE_START_DEPENDENT), @@ -284,6 +284,12 @@ ACPI_ACCEPTABLE_CONFIGURATION, 2}, + /* Get the descriptor length (0 or 1 for Start Dpf descriptor) */ + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.DescriptorLength), + AML_OFFSET (StartDpf.DescriptorType), + 0}, + /* All done if there is no flag byte present in the descriptor */ {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 1}, @@ -306,8 +312,10 @@ * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[6] = +ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[10] = { + /* Start with a default descriptor of length 1 */ + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_START_DEPENDENT, sizeof (AML_RESOURCE_START_DEPENDENT), ACPI_RSC_TABLE_SIZE (AcpiRsSetStartDpf)}, @@ -322,6 +330,33 @@ AML_OFFSET (StartDpf.Flags), 2}, /* + * All done if the output descriptor length is required to be 1 + * (i.e., optimization to 0 bytes cannot be attempted) + */ + {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, + ACPI_RS_OFFSET(Data.StartDpf.DescriptorLength), + 1}, + + /* Set length to 0 bytes (no flags byte) */ + + {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO)}, + + /* + * All done if the output descriptor length is required to be 0. + * + * TBD: Perhaps we should check for error if input flags are not + * compatible with a 0-byte descriptor. + */ + {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, + ACPI_RS_OFFSET(Data.StartDpf.DescriptorLength), + 0}, + + /* Reset length to 1 byte (descriptor with flags byte) */ + + {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_IRQ)}, + + + /* * All done if flags byte is necessary -- if either priority value * is not ACPI_ACCEPTABLE_CONFIGURATION */ Index: rsirq.c =================================================================== RCS file: /home/cmplr/cvs/acpica/Acpi/source/components/resources/rsirq.c,v retrieving revision 1.51 diff -u -r1.51 rsirq.c --- rsirq.c 9 Jan 2008 21:27:19 -0000 1.51 +++ rsirq.c 7 Feb 2008 21:05:05 -0000 @@ -129,7 +129,7 @@ * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsGetIrq[7] = +ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ, ACPI_RS_SIZE (ACPI_RESOURCE_IRQ), @@ -147,6 +147,12 @@ ACPI_EDGE_SENSITIVE, 1}, + /* Get the descriptor length (2 or 3 for IRQ descriptor) */ + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Irq.DescriptorLength), + AML_OFFSET (Irq.DescriptorType), + 0}, + /* All done if no flag byte present in descriptor */ {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3}, @@ -173,8 +179,10 @@ * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsSetIrq[9] = +ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] = { + /* Start with a default descriptor of length 3 */ + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ, sizeof (AML_RESOURCE_IRQ), ACPI_RSC_TABLE_SIZE (AcpiRsSetIrq)}, @@ -185,7 +193,7 @@ AML_OFFSET (Irq.IrqMask), ACPI_RS_OFFSET (Data.Irq.InterruptCount)}, - /* Set the flags byte by default */ + /* Set the flags byte */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering), AML_OFFSET (Irq.Flags), @@ -198,6 +206,33 @@ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Sharable), AML_OFFSET (Irq.Flags), 4}, + + /* + * All done if the output descriptor length is required to be 3 + * (i.e., optimization to 2 bytes cannot be attempted) + */ + {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, + ACPI_RS_OFFSET(Data.Irq.DescriptorLength), + 3}, + + /* Set length to 2 bytes (no flags byte) */ + + {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_IRQ_NOFLAGS)}, + + /* + * All done if the output descriptor length is required to be 2. + * + * TBD: Perhaps we should check for error if input flags are not + * compatible with a 2-byte descriptor. + */ + {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, + ACPI_RS_OFFSET(Data.Irq.DescriptorLength), + 2}, + + /* Reset length to 3 bytes (descriptor with flags byte) */ + + {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_IRQ)}, + /* * Check if the flags byte is necessary. Not needed if the flags are: * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE @@ -214,7 +249,7 @@ ACPI_RS_OFFSET (Data.Irq.Sharable), ACPI_EXCLUSIVE}, - /* IrqNoFlags() descriptor can be used */ + /* We can optimize to a 2-byte IrqNoFlags() descriptor */ {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_IRQ_NOFLAGS)} }; Index: rsmisc.c =================================================================== RCS file: /home/cmplr/cvs/acpica/Acpi/source/components/resources/rsmisc.c,v retrieving revision 1.47 diff -u -r1.47 rsmisc.c --- rsmisc.c 9 Jan 2008 21:27:19 -0000 1.47 +++ rsmisc.c 24 Jan 2008 22:41:50 -0000 @@ -610,6 +610,18 @@ break; + case ACPI_RSC_EXIT_EQ: + /* + * Control - Exit conversion if equal + */ + if (*ACPI_ADD_PTR (UINT8, Resource, + COMPARE_TARGET (Info)) == COMPARE_VALUE (Info)) + { + goto Exit; + } + break; + + default: ACPI_ERROR ((AE_INFO, "Invalid conversion opcode"));