From owner-freebsd-acpi@FreeBSD.ORG Mon May 10 07:06:00 2004 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE4A516A4D0 for ; Mon, 10 May 2004 07:06:00 -0700 (PDT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id B925C43D48 for ; Mon, 10 May 2004 07:05:59 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 13803 invoked from network); 10 May 2004 14:05:58 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 10 May 2004 14:05:58 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i4AE5rmX097375; Mon, 10 May 2004 10:05:53 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-acpi@FreeBSD.org Date: Mon, 10 May 2004 10:06:18 -0400 User-Agent: KMail/1.6 References: <20040507231846.F52653@root.org> <20040508.054429.99235478.imp@bsdimp.com> <20040508113421.R58706@root.org> In-Reply-To: <20040508113421.R58706@root.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200405101006.18787.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: acpi@FreeBSD.org cc: arch@FreeBSD.org Subject: Re: New ACPI blacklist format X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 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 May 2004 14:06:00 -0000 On Saturday 08 May 2004 02:37 pm, Nate Lawson wrote: > On Sat, 8 May 2004, M. Warner Losh wrote: > > In message: <20040507231846.F52653@root.org> > > > > Nate Lawson writes: > > : I have extracted a set of known-broken tables/versions from various > > : sources. Since. as far as I know, C does not allow variable length > > : initializers, I've settled on the following format: > > > > It does. > > > > : struct acpi_table_desc { > > : char *signature; > > : char *oem_id; > > : char *oem_table_id; > > : char *oem_rev_op; > > : char *oem_revision; > > : char *creator_id; > > : char *creator_rev_op; > > : char *creator_revision; > > : }; > > : > > : struct acpi_blacklist { > > : int quirk; > > : struct acpi_table_desc *match; > > : }; > > : > > : #define ACPI_BROKEN 0x1 > > : > > : static struct acpi_table_desc Abit_BP6[] = { > > : { "FACP", "AWARD", "AWRDACPI", "<=", "30302e31", "", "", "" }, > > : }; > > > > { .signature = "FACP", .oem_id="AWARD", .oem_table_id="AWARDACPI", > > .oem_rev_op = "<=", } > > > > :The op values will be "<=", "=", and ">=". > > > > These are likely better as a enum. > > > > : Is there any better way to compact this? > > > > Using shorter structure names would get it all onthe same line. > > Sure, good comments. What I meant by compacting was to get a variable > number of acpi_table_desc elements in a single blacklist entry without > defining a separate static. Something like this: > > static struct acpi_blacklist blacklist[] = { > { > .quirk = ACPI_BROKEN, > { > { "FACP", ... }, > { "DSDT", ... } > } > }, > { > .quirk = ... > } > }; > > The compiler didn't allow this. I like the idea of having a flat file that Marcel or Warner suggested and generating the .c code from that file. I also think using enums or #define's for the logical operations is much better than having to do string compares in the kernel. Note that the file parser could translate 'oemrev <= foo' to an appropriate constant. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org