From owner-freebsd-acpi@FreeBSD.ORG Mon Mar 10 19:23:25 2008 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2814D106573E for ; Mon, 10 Mar 2008 19:23:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id AE87C8FC17 for ; Mon, 10 Mar 2008 19:23:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 234979295-1834499 for multiple; Mon, 10 Mar 2008 15:24:58 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m2AJMvTZ088673; Mon, 10 Mar 2008 15:23:12 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-acpi@freebsd.org, Anish Mistry Date: Mon, 10 Mar 2008 15:22:38 -0400 User-Agent: KMail/1.9.7 References: <200803101910.m2AJA26c037165@freefall.freebsd.org> In-Reply-To: <200803101910.m2AJA26c037165@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803101522.39154.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 10 Mar 2008 15:23:14 -0400 (EDT) X-Virus-Scanned: ClamAV 0.91.2/6192/Mon Mar 10 10:54:00 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, BIZ_TLD autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Subject: Re: kern/121504: [patch] Correctly set hw.acpi.osname on certain machines X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2008 19:23:25 -0000 On Monday 10 March 2008 03:10:02 pm Anish Mistry wrote: > The following reply was made to PR kern/121504; it has been noted by GNATS. > > From: Anish Mistry > To: John Baldwin > Cc: bug-followup@freebsd.org, njl@freebsd.org > Subject: Re: kern/121504: [patch] Correctly set hw.acpi.osname on certain machines > Date: Mon, 10 Mar 2008 15:09:04 -0400 > > --nextPart11816881.8XfUQkhbdk > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > Content-Disposition: inline > > On Monday 10 March 2008, John Baldwin wrote: > > This is not the correct patch. The _OSI method does not return an > > OS name like _OS. Instead, it is a function that returns a boolean > > (True/False) to say if a given OS name is supported (OS name is > > passed as an argument). The proper fix is to say that the osname > > is supported in the > > AcpiOsValidateInterface() method. Something like this should work: > > > > Index: Osd/OsdMemory.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > RCS file: /usr/cvs/src/sys/dev/acpica/Osd/OsdMemory.c,v > > retrieving revision 1.15 > > diff -u -r1.15 OsdMemory.c > > --- Osd/OsdMemory.c 22 Mar 2007 18:16:41 -0000 1.15 > > +++ Osd/OsdMemory.c 10 Mar 2008 16:20:03 -0000 > > @@ -77,6 +77,9 @@ > > ACPI_STATUS > > AcpiOsValidateInterface (char *Interface) > > { > > + > > + if (strcmp(Interface, acpi_osname) =3D=3D 0) > > + return (AE_OK); > > return (AE_SUPPORT); > > } > > I get acpi_osname undeclared on compile. Try this: Index: acpivar.h =================================================================== RCS file: /usr/cvs/src/sys/dev/acpica/acpivar.h,v retrieving revision 1.108 diff -u -r1.108 acpivar.h --- acpivar.h 9 Oct 2007 07:48:07 -0000 1.108 +++ acpivar.h 10 Mar 2008 19:18:53 -0000 @@ -229,6 +229,11 @@ #define ACPI_IVAR_FLAGS 0x103 /* + * Storage for hw.acpi.osname tunable to override _OS or _OSI. + */ +extern char acpi_osname[]; + +/* * Accessor functions for our ivars. Default value for BUS_READ_IVAR is * (type) 0. The accessor functions don't check return values. */ Index: Osd/OsdMemory.c =================================================================== RCS file: /usr/cvs/src/sys/dev/acpica/Osd/OsdMemory.c,v retrieving revision 1.15 diff -u -r1.15 OsdMemory.c --- Osd/OsdMemory.c 22 Mar 2007 18:16:41 -0000 1.15 +++ Osd/OsdMemory.c 10 Mar 2008 19:21:38 -0000 @@ -33,13 +33,17 @@ #include __FBSDID("$FreeBSD: src/sys/dev/acpica/Osd/OsdMemory.c,v 1.15 2007/03/22 18:16:41 jkim Exp $"); -#include - +#include +#include #include #include #include #include +#include + +#include + MALLOC_DEFINE(M_ACPICA, "acpica", "ACPI CA memory pool"); void * @@ -77,6 +81,9 @@ ACPI_STATUS AcpiOsValidateInterface (char *Interface) { + + if (strcmp(Interface, acpi_osname) == 0) + return (AE_OK); return (AE_SUPPORT); } Index: Osd/OsdTable.c =================================================================== RCS file: /usr/cvs/src/sys/dev/acpica/Osd/OsdTable.c,v retrieving revision 1.12 diff -u -r1.12 OsdTable.c --- Osd/OsdTable.c 22 Mar 2007 18:16:41 -0000 1.12 +++ Osd/OsdTable.c 10 Mar 2008 19:20:39 -0000 @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD: src/sys/dev/acpica/Osd/OsdTable.c,v 1.12 2007/03/22 18:16:41 jkim Exp $"); #include +#include #include #include #include @@ -39,10 +40,12 @@ #include #include +#include + #undef _COMPONENT #define _COMPONENT ACPI_TABLES -static char acpi_osname[128]; +char acpi_osname[128]; TUNABLE_STR("hw.acpi.osname", acpi_osname, sizeof(acpi_osname)); ACPI_STATUS -- John Baldwin