From owner-cvs-src@FreeBSD.ORG Thu Oct 7 05:13:11 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 10E8616A4CE; Thu, 7 Oct 2004 05:13:11 +0000 (GMT) Received: from sana.init-main.com (104.194.138.210.bn.2iij.net [210.138.194.104]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44D9443D2F; Thu, 7 Oct 2004 05:13:10 +0000 (GMT) (envelope-from takawata@init-main.com) Received: from init-main.com (localhost.init-main.com [127.0.0.1]) by sana.init-main.com (8.13.1/8.13.1) with ESMTP id i975AsrS029949; Thu, 7 Oct 2004 14:10:55 +0900 (JST) (envelope-from takawata@init-main.com) Message-Id: <200410070510.i975AsrS029949@sana.init-main.com> To: Nate Lawson In-reply-to: Your message of "Wed, 06 Oct 2004 12:14:29 MST." <41644415.3030402@root.org> Date: Thu, 07 Oct 2004 14:10:54 +0900 From: Takanori Watanabe cc: cvs-src@freebsd.org cc: cvs-all@freebsd.org cc: src-committers@freebsd.org cc: robert.moore@intel.com cc: jhb@freebsd.org Subject: Re: cvs commit: src/usr.sbin/acpi/acpidump acpi.c acpidump.c acpidump.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 05:13:11 -0000 In message <41644415.3030402@root.org>, Nate Lawson wrote: > >> I think ACPI-CA itself can override any SSDT by checking existing >> SSDT header passed to AcpiOsTableOverride. > >I'm not sure what you mean here but I agree that AcpiOsTableOverride() >should be able to decide whether to override an SSDT or not. All I'm >asking for is a special return code from AcpiOsTableOverride() that >means "ignore this table completely" so I don't have to provide a fake >empty table to get this effect. The thing I want to say is like this. In this code, I intended to be able to override arbitaly table on a system, though I have never run it. And if iASL can accept ASL file with multiple DefinitionBlock, you don't need to compound all SSDT's into DSDT: all you have to do is concatinate SSDT with DefinitionBlock to the tail of DSDT dump. I think this approach is far more extensive, though I don't deny current approach as a workaround. --- /sys/dev/acpica/Osd/OsdTable.c Sun May 16 22:37:37 2004 +++ OsdTable.c Thu Oct 7 13:01:01 2004 @@ -63,20 +63,40 @@ ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { - caddr_t acpi_dsdt, p; - + caddr_t acpi_sdt, modtype; + ACPI_TABLE_HEADER *p; + if (ExistingTable == NULL || NewTable == NULL) return(AE_BAD_PARAMETER); *NewTable = NULL; - if (strncmp(ExistingTable->Signature, "DSDT", 4) != 0) - return(AE_OK); - if ((acpi_dsdt = preload_search_by_type("acpi_dsdt")) == NULL) - return(AE_OK); - if ((p = preload_search_info(acpi_dsdt, MODINFO_ADDR)) == NULL) - return(AE_OK); - *NewTable = *(void **)p; - printf("ACPI: DSDT was overridden.\n"); + if (strncmp(ExistingTable->Signature, "DSDT", 4) == 0){ + if ((acpi_sdt = preload_search_by_type("acpi_dsdt"))&& + (p = (ACPI_TABLE_HEADER *)preload_search_info + (acpi_sdt, MODINFO_ADDR))) + *NewTable = *(void **)p; + printf("ACPI: DSDT was overridden.\n"); + return (AE_OK); + } + + acpi_sdt = NULL; + while ((acpi_sdt = preload_search_next_name(acpi_sdt)) != NULL) { + modtype = (char *)preload_search_info(acpi_sdt, MODINFO_TYPE); + if(strcmp(modtype, "acpi_sdt") != 0){ + continue; + } + p = (ACPI_TABLE_HEADER *)preload_search_info(acpi_sdt, MODINFO_ADDR); + if(strncmp(ExistingTable->Signature, p->Signature, 4)&& + strncmp(ExistingTable->OemId, p->OemId, 6)&& + strncmp(ExistingTable->OemTableId, p->OemTableId, 8)){ + *NewTable = p; + printf("ACPI: %4s- %6s/%8s was overridden\n", + ExistingTable->Signature, ExistingTable->OemId, + ExistingTable->OemTableId); + return(AE_OK); + } + } + return (AE_OK); }