Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2014 19:40:10 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        "freebsd-acpi@freebsd.org" <freebsd-acpi@freebsd.org>
Subject:   Re: Investigating failed suspend/resume T61
Message-ID:  <538673DA.5030105@FreeBSD.org>
In-Reply-To: <53865FCA.6080407@FreeBSD.org>
References:  <1400861698.1126.0.camel@bruno> <201405281556.37651.jhb@freebsd.org> <538641DE.5030309@FreeBSD.org> <201405281729.35703.jhb@freebsd.org> <53865FCA.6080407@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------040405030706020903010103
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2014-05-28 18:14:34 -0400, Jung-uk Kim wrote:
> However, it had to be done from AcpiEvGpeInitialize() in 
> sys/contrib/dev/acpica/components/events/evgpeinit.c, IMHO.
> 
> ACPI_STATUS AcpiEvGpeInitialize ( void) { ... if
> (AcpiGbl_FADT.Gpe1BlockLength && ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
> HERE!!! AcpiGbl_FADT.XGpe1Block.Address) { ...

Please see the attached patch (not tested).  Probably, this is what
you really meant to test.

Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQEcBAEBAgAGBQJThnPaAAoJEHyflib82/FGKbcIAIfNGtaEDNhEuGUTTr7wSgCE
DIAIt/QdTeICyOiR8t9r8SrOKrnrloPohKTqtujhkliiAN7bKbjodeN3+/50H7a9
Ura6075gCtds/6Im/hOiFMyclWBA88HR+lUpct3RJD9Ag70qcfEQloIiVI1pkm2U
X1YRRgS0liUbG4NKoZuAl2xPxyO+DS+jC7FKO/Ti4Bl4buM+R/lO0fvAj6ZZoRQ4
JnLGsOPMrmPLDfug6dZSCruG8rcetrh+0PYVn3En4ecZ8rzsY+IW5qR+57+8rcXX
Jh9JsWyS0eYiGP62yOKzdj+9GSH85MJJC0fvtOgYe42eA8UU3bf8GAD5Vynl+gU=
=4thP
-----END PGP SIGNATURE-----

--------------040405030706020903010103
Content-Type: text/x-patch;
 name="gpe.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="gpe.diff"

Index: sys/contrib/dev/acpica/components/events/evgpeinit.c
===================================================================
--- sys/contrib/dev/acpica/components/events/evgpeinit.c	(리비전 266821)
+++ sys/contrib/dev/acpica/components/events/evgpeinit.c	(작업 사본)
@@ -128,12 +128,19 @@ AcpiEvGpeInitialize (
      * If EITHER the register length OR the block address are zero, then that
      * particular block is not supported.
      */
-    if (AcpiGbl_FADT.Gpe0BlockLength &&
-        AcpiGbl_FADT.XGpe0Block.Address)
+    if ((AcpiGbl_FADT.Gpe0Block && AcpiGbl_FADT.Gpe0BlockLength) ||
+        (AcpiGbl_FADT.XGpe0Block.Address && AcpiGbl_FADT.XGpe0Block.BitWidth))
     {
         /* GPE block 0 exists (has both length and address > 0) */
 
-        RegisterCount0 = (UINT16) (AcpiGbl_FADT.Gpe0BlockLength / 2);
+        if (AcpiGbl_FADT.XGpe0Block.Address && AcpiGbl_FADT.XGpe0Block.BitWidth)
+        {
+            RegisterCount0 = ACPI_DIV_8 (AcpiGbl_FADT.XGpe0Block.BitWidth) / 2;
+        }
+        else
+        {
+            RegisterCount0 = AcpiGbl_FADT.Gpe0BlockLength / 2;
+        }
         GpeNumberMax = (RegisterCount0 * ACPI_GPE_REGISTER_WIDTH) - 1;
 
         /* Install GPE Block 0 */
@@ -149,12 +156,19 @@ AcpiEvGpeInitialize (
         }
     }
 
-    if (AcpiGbl_FADT.Gpe1BlockLength &&
-        AcpiGbl_FADT.XGpe1Block.Address)
+    if ((AcpiGbl_FADT.Gpe1Block && AcpiGbl_FADT.Gpe1BlockLength) ||
+        (AcpiGbl_FADT.XGpe1Block.Address && AcpiGbl_FADT.XGpe1Block.BitWidth))
     {
         /* GPE block 1 exists (has both length and address > 0) */
 
-        RegisterCount1 = (UINT16) (AcpiGbl_FADT.Gpe1BlockLength / 2);
+        if (AcpiGbl_FADT.XGpe1Block.Address && AcpiGbl_FADT.XGpe1Block.BitWidth)
+        {
+            RegisterCount1 = ACPI_DIV_8 (AcpiGbl_FADT.XGpe1Block.BitWidth) / 2;
+        }
+        else
+        {
+            RegisterCount1 = AcpiGbl_FADT.Gpe1BlockLength / 2;
+        }
 
         /* Check for GPE0/GPE1 overlap (if both banks exist) */
 

--------------040405030706020903010103--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?538673DA.5030105>