[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RESEND PATCH 05/23] hw/acpi/aml-build: Add aml_interru
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [RESEND PATCH 05/23] hw/acpi/aml-build: Add aml_interrupt() term |
Date: |
Wed, 20 May 2015 15:49:16 +0200 |
On Wed, 20 May 2015 19:28:26 +0800
Shannon Zhao <address@hidden> wrote:
>
>
> On 2015/5/20 19:05, Igor Mammedov wrote:
> > On Wed, 20 May 2015 12:23:02 +0800
> > Shannon Zhao <address@hidden> wrote:
> >
> >> > From: Shannon Zhao <address@hidden>
> >> >
> >> > Add aml_interrupt() for describing device interrupt in resource template.
> >> > These can be used to generating DSDT table for ACPI on ARM.
> >> >
> >> > Signed-off-by: Shannon Zhao <address@hidden>
> >> > Signed-off-by: Shannon Zhao <address@hidden>
> >> > ---
> >> > hw/acpi/aml-build.c | 22 ++++++++++++++++++++++
> >> > include/hw/acpi/aml-build.h | 42
> >> > ++++++++++++++++++++++++++++++++++++++++++
> >> > 2 files changed, 64 insertions(+)
> >> >
> >> > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> >> > index 805a0ad..5f06367 100644
> >> > --- a/hw/acpi/aml-build.c
> >> > +++ b/hw/acpi/aml-build.c
> >> > @@ -531,6 +531,28 @@ Aml *aml_memory32_fixed(uint32_t addr, uint32_t
> >> > size,
> >> > return var;
> >> > }
> >> >
> >> > +/*
> >> > + * ACPI 5.0: 6.4.3.6 Extended Interrupt Descriptor
> >> > + * Type 1, Large Item Name 0x9
> >> > + */
> >> > +Aml *aml_interrupt(AmlConsumerAndProducer con_and_pro,
> >> > + AmlLevelAndEdge level_and_edge,
> >> > + AmlActiveHighAndLow high_and_low, AmlShared shared,
> >> > + uint32_t irq)
> >> > +{
> >> > + Aml *var = aml_alloc();
> >> > + uint8_t irq_flags = con_and_pro | (level_and_edge << 1)
> >> > + | (high_and_low << 2) | (shared << 3);
> >> > +
> >> > + build_append_byte(var->buf, 0x89); /* Extended irq descriptor */
> >> > + build_append_byte(var->buf, 6); /* Length, bits[7:0] minimum value
> >> > = 6 */
> >> > + build_append_byte(var->buf, 0); /* Length, bits[15:8] minimum value
> >> > = 0 */
> >> > + build_append_byte(var->buf, irq_flags); /* Interrupt Vector
> >> > Information. */
> >> > + build_append_byte(var->buf, 0x01); /* Interrupt table length = 1 */
> >> > + build_append_4bytes(var->buf, irq); /* Interrupt Number */
> > Just looking at the patch I have no idea what above line does;
> >
> > using 4 build_append_byte() is much clearer and matches the spec 1:1
> > when comparing.
> >
>
> I feel awkward and have no word to convince you. If you insist on this,
> I'll go back to 4 build_append_byte().
I've chatted with Michael about it, he doesn't insist on build_append_4bytes()
ans he is ok with using build_append_byte() 4 times.
- Re: [Qemu-devel] [RESEND PATCH v7 20/23] hw/acpi/aml-build: Add Unicode macro, (continued)
[Qemu-devel] [PATCH v7 18/23] hw/acpi/aml-build: Add aml_create_dword_field() term, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 06/23] hw/arm/virt-acpi-build: Generation of DSDT table for virt devices, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 05/23] hw/acpi/aml-build: Add aml_interrupt() term, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 07/23] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 04/23] hw/acpi/aml-build: Add aml_memory32_fixed() term, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 03/23] hw/arm/virt-acpi-build: Basic framework for building ACPI tables on ARM, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 11/23] hw/arm/virt-acpi-build: Generate RSDP table, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 12/23] hw/arm/virt-acpi-build: Generate MCFG table, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 08/23] hw/arm/virt-acpi-build: Generate MADT table, Shannon Zhao, 2015/05/14
[Qemu-devel] [PATCH v7 10/23] hw/arm/virt-acpi-build: Generate RSDT table, Shannon Zhao, 2015/05/14