PERFORCE change 29900 for review

Marcel Moolenaar marcel at FreeBSD.org
Sun Apr 27 15:45:28 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=29900

Change 29900 by marcel at marcel_pluto2 on 2003/04/27 15:45:23

	IFia64

Affected files ...

.. //depot/projects/ia64_epc/sys/dev/acpica/acpi_timer.c#2 integrate

Differences ...

==== //depot/projects/ia64_epc/sys/dev/acpica/acpi_timer.c#2 (text+ko) ====

@@ -129,14 +129,14 @@
 	}
 	if (max - min > 2)
 		n = 0;
-	else if (min < 0)
+	else if (min < 0 || max == 0)
 		n = 0;
 	else
 		n = 1;
 	if (bootverbose)
 		printf("ACPI timer looks %s min = %d, max = %d, width = %d\n",
 			n ? "GOOD" : "BAD ",
-			min, max, max - min + 1);
+			min, max, max - min);
 	return (n);
 }
 
@@ -149,7 +149,8 @@
 {
     device_t	dev;
     char	desc[40];
-    int		rid, i, j;
+    u_long	rlen, rstart;
+    int		i, j, rid, rtype;
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
@@ -164,10 +165,17 @@
 	return_VOID;
     }
     acpi_timer_dev = dev;
+
     rid = 0;
-    bus_set_resource(dev, SYS_RES_IOPORT, rid, AcpiGbl_FADT->V1_PmTmrBlk, sizeof(u_int32_t));
-    if ((acpi_timer_reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE)) == NULL) {
-	device_printf(dev, "couldn't allocate I/O resource (port 0x%x)\n", AcpiGbl_FADT->V1_PmTmrBlk);
+    rlen = 3 + AcpiGbl_FADT->TmrValExt;		/* 24 or 32 bit timers. */
+    rtype = (AcpiGbl_FADT->XPmTmrBlk.AddressSpaceId)
+      ? SYS_RES_IOPORT : SYS_RES_MEMORY;
+    rstart = AcpiGbl_FADT->XPmTmrBlk.Address;
+    bus_set_resource(dev, rtype, rid, rstart, 4);
+    acpi_timer_reg = bus_alloc_resource(dev, rtype, &rid, 0, ~0, 1, RF_ACTIVE);
+    if (acpi_timer_reg == NULL) {
+	device_printf(dev, "couldn't allocate I/O resource (%s 0x%lx)\n",
+	  (rtype == SYS_RES_IOPORT) ? "port" : "mem", rstart);
 	return_VOID;
     }
     if (testenv("debug.acpi.timer_test"))
@@ -186,7 +194,7 @@
     }
     tc_init(&acpi_timer_timecounter);
 
-    sprintf(desc, "%d-bit timer at 3.579545MHz", AcpiGbl_FADT->TmrValExt ? 32 : 24);
+    sprintf(desc, "%d-bit timer at 3.579545MHz", (int)(rlen << 3));
     device_set_desc_copy(dev, desc);
 
     return_VOID;


More information about the p4-projects mailing list