Re: [current tinderbox] failure on i386/i386

From: Roman Kurakin <rik_at_cronyx.ru>
Date: Thu, 01 Jul 2004 20:02:50 +0400
Dag-Erling Smørgrav wrote:

>FreeBSD Tinderbox <tinderbox_at_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
_at__at_ -375,8 +375,8 _at__at_
     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
>_at__at_ -366,6 +366,7 _at__at_
> void
> acpi_ec_ecdt_probe(device_t parent)
> {
>+    ACPI_TABLE_HEADER *hdr;
>     ACPI_TABLE_ECDT *ecdt;
>     ACPI_STATUS	     status;
>     device_t	     child;
>_at__at_ -375,8 +376,8 _at__at_
>     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
>_at__at_ -307,11 +307,13 _at__at_
> 		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_at_freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-current
>To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
>  
>
Received on Thu Jul 01 2004 - 14:09:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:59 UTC