Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev/acpi Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/d890761e07b7
branches:  netbsd-9
changeset: 931718:d890761e07b7
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Apr 29 13:33:35 2020 +0000

description:
Pull up following revision(s) (requested by jmcneill in ticket #866):

        sys/dev/acpi/acpi_ec.c: revision 1.82

kern/55206: acpibat reporting broken by acpi_ec.c r1.81

Assume byte instead of qword alignment of the buffer passed to the EC
space handler.

diffstat:

 sys/dev/acpi/acpi_ec.c |  20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diffs (58 lines):

diff -r d8841a74d8eb -r d890761e07b7 sys/dev/acpi/acpi_ec.c
--- a/sys/dev/acpi/acpi_ec.c    Wed Apr 29 13:25:42 2020 +0000
+++ b/sys/dev/acpi/acpi_ec.c    Wed Apr 29 13:33:35 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_ec.c,v 1.75.20.2 2020/04/12 08:48:56 martin Exp $ */
+/*     $NetBSD: acpi_ec.c,v 1.75.20.3 2020/04/29 13:33:35 martin Exp $ */
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.75.20.2 2020/04/12 08:48:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.75.20.3 2020/04/29 13:33:35 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/callout.h>
@@ -659,32 +659,30 @@
 {
        device_t dv;
        ACPI_STATUS rv;
-       uint8_t addr, reg;
+       uint8_t addr, *buf;
        unsigned int i;
 
-       if (paddr > 0xff || width % 8 != 0 || width > sizeof(ACPI_INTEGER)*8 ||
+       if (paddr > 0xff || width % 8 != 0 ||
            value == NULL || arg == NULL || paddr + width / 8 > 0x100)
                return AE_BAD_PARAMETER;
 
        addr = paddr;
        dv = arg;
+       buf = (uint8_t *)value;
 
        rv = AE_OK;
 
        switch (func) {
        case ACPI_READ:
-               *value = 0;
-               for (i = 0; i < width; i += 8, ++addr) {
-                       rv = acpiec_read(dv, addr, &reg);
+               for (i = 0; i < width; i += 8, ++addr, ++buf) {
+                       rv = acpiec_read(dv, addr, buf);
                        if (rv != AE_OK)
                                break;
-                       *value |= (ACPI_INTEGER)reg << i;
                }
                break;
        case ACPI_WRITE:
-               for (i = 0; i < width; i += 8, ++addr) {
-                       reg = (*value >> i) & 0xff;
-                       rv = acpiec_write(dv, addr, reg);
+               for (i = 0; i < width; i += 8, ++addr, ++buf) {
+                       rv = acpiec_write(dv, addr, *buf);
                        if (rv != AE_OK)
                                break;
                }



Home | Main Index | Thread Index | Old Index