Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Jul 2004 20:02:50 +0400
From:      Roman Kurakin <rik@cronyx.ru>
To:        =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        current@freebsd.org
Subject:   Re: [current tinderbox] failure on i386/i386
Message-ID:  <40E435AA.1040400@cronyx.ru>
In-Reply-To: <xzp8ye3lpxn.fsf@dwp.des.no>
References:  <20040701115954.805D27303F@freebsd-current.sentex.ca> <xzp8ye3lpxn.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smørgrav wrote:

>FreeBSD Tinderbox <tinderbox@freebsd.org> writes:
>  
>
>>/tinderbox/CURRENT/i386/i386/src/sys/dev/acpica/acpi_ec.c: In function `acpi_ec_ecdt_probe':
>>/tinderbox/CURRENT/i386/i386/src/sys/dev/acpica/acpi_ec.c:379: warning: dereferencing type-punned pointer will break strict-aliasing rules
>>*** Error code 1
>>    
>>
>
>Hack attached.
>  
>
How about this:

--- sys/dev/acpica/acpi_ec.c	1 Jul 2004 00:51:31 -0000	1.56
+++ sys/dev/acpica/acpi_ec.c	1 Jul 2004 15:06:46 -0000
@@ -375,8 +375,8 @@
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
     /* Find and validate the ECDT. */
     status = AcpiGetFirmwareTable("ECDT", 1, ACPI_LOGICAL_ADDRESSING, 
-		(ACPI_TABLE_HEADER **)&ecdt);
+		(void *)&ecdt);
     if (ACPI_FAILURE(status) ||
 	ecdt->control.RegisterBitWidth != 8 ||

 	ecdt->data.RegisterBitWidth != 8) {
...

it is more hacky but simple ;-)

rik

>DES
>  
>
>------------------------------------------------------------------------
>
>Index: sys/dev/acpica/acpi_ec.c
>===================================================================
>RCS file: /home/ncvs/src/sys/dev/acpica/acpi_ec.c,v
>retrieving revision 1.56
>diff -u -r1.56 acpi_ec.c
>--- sys/dev/acpica/acpi_ec.c	1 Jul 2004 00:51:31 -0000	1.56
>+++ sys/dev/acpica/acpi_ec.c	1 Jul 2004 15:06:46 -0000
>@@ -366,6 +366,7 @@
> void
> acpi_ec_ecdt_probe(device_t parent)
> {
>+    ACPI_TABLE_HEADER *hdr;
>     ACPI_TABLE_ECDT *ecdt;
>     ACPI_STATUS	     status;
>     device_t	     child;
>@@ -375,8 +376,8 @@
>     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
> 
>     /* Find and validate the ECDT. */
>-    status = AcpiGetFirmwareTable("ECDT", 1, ACPI_LOGICAL_ADDRESSING, 
>-		(ACPI_TABLE_HEADER **)&ecdt);
>+    status = AcpiGetFirmwareTable("ECDT", 1, ACPI_LOGICAL_ADDRESSING, &hdr);
>+    ecdt = (ACPI_TABLE_ECDT *)hdr;
>     if (ACPI_FAILURE(status) ||
> 	ecdt->control.RegisterBitWidth != 8 ||
> 	ecdt->data.RegisterBitWidth != 8) {
>Index: sys/i386/acpica/acpi_wakeup.c
>===================================================================
>RCS file: /home/ncvs/src/sys/i386/acpica/acpi_wakeup.c,v
>retrieving revision 1.33
>diff -u -r1.33 acpi_wakeup.c
>--- sys/i386/acpica/acpi_wakeup.c	6 May 2004 02:18:58 -0000	1.33
>+++ sys/i386/acpica/acpi_wakeup.c	1 Jul 2004 15:11:53 -0000
>@@ -307,11 +307,13 @@
> 		return;
> 	}
> 
>-	if (bus_dmamem_alloc(acpi_waketag, (void **)&acpi_wakeaddr,
>+	void *wakeaddr = (void *)acpi_wakeaddr;
>+	if (bus_dmamem_alloc(acpi_waketag, &wakeaddr,
> 			     BUS_DMA_NOWAIT, &acpi_wakemap)) {
> 		printf("acpi_alloc_wakeup_handler: can't alloc wake memory\n");
> 		return;
> 	}
>+	acpi_wakeaddr = (vm_offset_t)wakeaddr;
> }
> 
> SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0)
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>freebsd-current@freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-current
>To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
>  
>





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40E435AA.1040400>