qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device


From: Gerd Hoffmann
Subject: Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device
Date: Mon, 6 Apr 2020 12:26:52 +0200

On Fri, Apr 03, 2020 at 12:16:01PM +0200, Igor Mammedov wrote:
> On Fri, 3 Apr 2020 12:12:10 +0200
> Igor Mammedov <address@hidden> wrote:
> 
> > On Fri,  3 Apr 2020 10:04:59 +0200
> > Gerd Hoffmann <address@hidden> wrote:
> > 
> [...]
> > > +static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
> > > +{
> > > +    ISAParallelState *isa = ISA_PARALLEL(isadev);
> > > +    Aml *dev;
> > > +    Aml *crs;
> > > +
> > > +    if (isa->iobase != 0x0378) {
> > > +        return;
> > > +    }
> if device is present why should we skip adding it to DSDT?

Well, that is the current state of affairs, only the first parallel
ports shows up in the dsdt.  And given how rare parallel ports are these
days I didn't bother changing that ...

We can handle this simliar to serial lines though, incremental below.
Do you prefer that?

take care,
  Gerd

=================================== cut here =======================
>From 617797cf42e56e18d5d62cb171af00c28589caba Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <address@hidden>
Date: Mon, 6 Apr 2020 12:17:59 +0200
Subject: [PATCH] [fixup] parallel

---
 hw/char/parallel.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 2bff1f17fda7..7157d6816b77 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -572,10 +572,16 @@ static void parallel_isa_realizefn(DeviceState *dev, 
Error **errp)
 static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
 {
     ISAParallelState *isa = ISA_PARALLEL(isadev);
+    int i, uid = 0;
     Aml *dev;
     Aml *crs;
 
-    if (isa->iobase != 0x0378) {
+    for (i = 0; i < ARRAY_SIZE(isa_parallel_io); i++) {
+        if (isa->iobase == isa_parallel_io[i]) {
+            uid = i + 1;
+        }
+    }
+    if (!uid) {
         return;
     }
 
@@ -583,8 +589,9 @@ static void parallel_isa_build_aml(ISADevice *isadev, Aml 
*scope)
     aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
     aml_append(crs, aml_irq_no_flags(7));
 
-    dev = aml_device("LPT");
+    dev = aml_device("LPT%d", uid);
     aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
+    aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
     aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
     aml_append(dev, aml_name_decl("_CRS", crs));
 
-- 
2.18.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]