Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Include device decoding type in acpi_mem resources



details:   https://anonhg.NetBSD.org/src/rev/71d983fa37d5
branches:  trunk
changeset: 968006:71d983fa37d5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Dec 31 13:39:15 2019 +0000

description:
Include device decoding type in acpi_mem resources

diffstat:

 sys/dev/acpi/acpi_resource.c |  21 ++++++++++++---------
 sys/dev/acpi/acpivar.h       |   6 ++++--
 2 files changed, 16 insertions(+), 11 deletions(-)

diffs (118 lines):

diff -r c404d4fe3224 -r 71d983fa37d5 sys/dev/acpi/acpi_resource.c
--- a/sys/dev/acpi/acpi_resource.c      Tue Dec 31 13:07:09 2019 +0000
+++ b/sys/dev/acpi/acpi_resource.c      Tue Dec 31 13:39:15 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_resource.c,v 1.39 2019/12/31 12:27:50 jmcneill Exp $      */
+/*     $NetBSD: acpi_resource.c,v 1.40 2019/12/31 13:39:15 jmcneill Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.39 2019/12/31 12:27:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.40 2019/12/31 13:39:15 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -148,7 +148,7 @@
                        (*ops->memory)(arg->dev, arg->context,
                            res->Data.FixedMemory32.Address,
                            res->Data.FixedMemory32.AddressLength,
-                           0);
+                           0, 0);
                break;
 
        case ACPI_RESOURCE_TYPE_MEMORY32:
@@ -162,7 +162,7 @@
                                (*ops->memory)(arg->dev, arg->context,
                                    res->Data.Memory32.Minimum,
                                    res->Data.Memory32.AddressLength,
-                                   0);
+                                   0, 0);
                } else {
                        ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
                                             "Memory32 0x%x-0x%x/%u\n",
@@ -189,7 +189,7 @@
                                (*ops->memory)(arg->dev, arg->context,
                                    res->Data.Memory24.Minimum,
                                    res->Data.Memory24.AddressLength,
-                                   0);
+                                   0, 0);
                } else {
                        ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
                                             "Memory24 0x%x-0x%x/%u\n",
@@ -259,7 +259,8 @@
                                        (*ops->memory)(arg->dev, arg->context,
                                            res->Data.Address32.Address.Minimum,
                                            res->Data.Address32.Address.AddressLength,
-                                           res->Data.Address32.Address.TranslationOffset);
+                                           res->Data.Address32.Address.TranslationOffset,
+                                           res->Data.Address32.Decode);
                        } else {
                                if (ops->memrange)
                                        (*ops->memrange)(arg->dev, arg->context,
@@ -313,7 +314,8 @@
                                        (*ops->memory)(arg->dev, arg->context,
                                            res->Data.Address64.Address.Minimum,
                                            res->Data.Address64.Address.AddressLength,
-                                           res->Data.Address64.Address.TranslationOffset);
+                                           res->Data.Address64.Address.TranslationOffset,
+                                           res->Data.Address64.Decode);
                        } else {
                                if (ops->memrange)
                                        (*ops->memrange)(arg->dev, arg->context,
@@ -652,7 +654,7 @@
                    uint32_t, uint32_t, uint32_t);
 
 static void    acpi_res_parse_memory(device_t, void *, uint64_t,
-                   uint64_t, uint64_t);
+                   uint64_t, uint64_t, uint8_t);
 static void    acpi_res_parse_memrange(device_t, void *, uint64_t,
                    uint64_t, uint64_t, uint64_t);
 
@@ -802,7 +804,7 @@
 
 static void
 acpi_res_parse_memory(device_t dev, void *context, uint64_t base,
-    uint64_t length, uint64_t offset)
+    uint64_t length, uint64_t offset, uint8_t decode)
 {
        struct acpi_resources *res = context;
        struct acpi_mem *ar;
@@ -819,6 +821,7 @@
        ar->ar_base = base;
        ar->ar_length = length;
        ar->ar_offset = offset;
+       ar->ar_decode = decode;
 
        SIMPLEQ_INSERT_TAIL(&res->ar_mem, ar, ar_list);
 }
diff -r c404d4fe3224 -r 71d983fa37d5 sys/dev/acpi/acpivar.h
--- a/sys/dev/acpi/acpivar.h    Tue Dec 31 13:07:09 2019 +0000
+++ b/sys/dev/acpi/acpivar.h    Tue Dec 31 13:39:15 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpivar.h,v 1.79 2019/12/31 12:27:50 jmcneill Exp $    */
+/*     $NetBSD: acpivar.h,v 1.80 2019/12/31 13:39:15 jmcneill Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -227,6 +227,7 @@
        bus_addr_t      ar_base;
        bus_size_t      ar_length;
        bus_addr_t      ar_offset;
+       uint8_t         ar_decode;
 };
 
 struct acpi_memrange {
@@ -285,7 +286,8 @@
        void    (*iorange)(device_t, void *, uint32_t, uint32_t,
                    uint32_t, uint32_t);
 
-       void    (*memory)(device_t, void *, uint64_t, uint64_t, uint64_t);
+       void    (*memory)(device_t, void *, uint64_t, uint64_t,
+                   uint64_t, uint8_t);
        void    (*memrange)(device_t, void *, uint64_t, uint64_t,
                    uint64_t, uint64_t);
 



Home | Main Index | Thread Index | Old Index