------=_Part_590_19097426.1109794299229
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Here is a patch that I put together to update acpica to the 20050211
distribution. The only changes are matching to API changes. This
requires a commiter to download the source latest source from intel at
http://developer.intel.com/technology/iapc/acpi/downloads/acpica-unix-20050211.tar.gz
and import it based on the instructions in
/usr/src/sys/contrib/dev/acpica-unix-20040527/README.DRAGONFLY
It was tested on an hp pavilion zt3000 and under vmware.
Someone should look at my logic in AcpiOsSleep just as a double check
of my logic to make sure all my times aren't off by 10x or something
like that.
-Craig
--
-----------------------------------------------------------------------
Craig Dooley <xlnxminusx@gmail.com>
------=_Part_590_19097426.1109794299229
Content-Type: text/plain; name="acpi-20050211-support.patch.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="acpi-20050211-support.patch.txt"
Index: Makefile.inc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/dev/acpica5/Makefile.inc,v
retrieving revision 1.2
diff -u -r1.2 Makefile.inc
--- Makefile.inc=095 Jul 2004 00:07:35 -0000=091.2
+++ Makefile.inc=092 Mar 2005 13:15:10 -0000
@@ -1,4 +1,4 @@
# $DragonFly: src/sys/dev/acpica5/Makefile.inc,v 1.2 2004/07/05 00:07:35 d=
illon Exp $
=20
-SYSACPICA_VERSION?=3D=0920040527
+SYSACPICA_VERSION?=3D=0920050211
SYSACPICA?=3D contrib/dev/acpica-unix-${SYSACPICA_VERSION}
Index: acpi_acad.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/dev/acpica5/acpi_acad.c,v
retrieving revision 1.4
diff -u -r1.4 acpi_acad.c
--- acpi_acad.c=092 Aug 2004 19:51:07 -0000=091.4
+++ acpi_acad.c=092 Mar 2005 13:18:12 -0000
@@ -248,7 +248,7 @@
=09acpi_acad_get_status(dev);
=09if (status !=3D sc->status)
=09 break;
-=09AcpiOsSleep(0, 10);
+=09AcpiOsSleep(10);
}
=20
sc->initializing =3D 0;
Index: acpi_cmbat.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/dev/acpica5/acpi_cmbat.c,v
retrieving revision 1.5
diff -u -r1.5 acpi_cmbat.c
--- acpi_cmbat.c=092 Aug 2004 19:51:07 -0000=091.5
+++ acpi_cmbat.c=092 Mar 2005 13:18:55 -0000
@@ -583,7 +583,7 @@
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
=09=09"battery initialization start\n");
=20
- for (retry =3D 0; retry < ACPI_CMBAT_RETRY_MAX; retry++, AcpiOsSleep(0=
, 10)) {
+ for (retry =3D 0; retry < ACPI_CMBAT_RETRY_MAX; retry++, AcpiOsSleep(1=
0)) {
=09sc->present =3D acpi_BatteryIsPresent(dev);
=09if (!sc->present)
=09 continue;
Index: acpi_thermal.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/dev/acpica5/acpi_thermal.c,v
retrieving revision 1.3
diff -u -r1.3 acpi_thermal.c
--- acpi_thermal.c=095 Jul 2004 00:07:35 -0000=091.3
+++ acpi_thermal.c=092 Mar 2005 13:23:36 -0000
@@ -690,7 +690,7 @@
case TZ_NOTIFY_LEVELS:
=09/* Zone devices/setpoints changed */
=09AcpiOsQueueForExecution(OSD_PRIORITY_HIGH,
-=09=09=09=09(OSD_EXECUTION_CALLBACK)acpi_tz_establish, sc);
+=09=09=09=09(ACPI_OSD_EXEC_CALLBACK)acpi_tz_establish, sc);
=09break;
default:
=09ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
@@ -761,7 +761,7 @@
=09} else {
=09 /* We have to re-evaluate the entire zone now */
=09 AcpiOsQueueForExecution(OSD_PRIORITY_HIGH,
-=09=09=09=09 (OSD_EXECUTION_CALLBACK)acpi_tz_establish,
+=09=09=09=09 (ACPI_OSD_EXEC_CALLBACK)acpi_tz_establish,
=09=09=09=09 sc);
=09}
}
Index: Osd/OsdInterrupt.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/dev/acpica5/Osd/OsdInterrupt.c,v
retrieving revision 1.2
diff -u -r1.2 OsdInterrupt.c
--- Osd/OsdInterrupt.c=0927 Jun 2004 08:52:42 -0000=091.2
+++ Osd/OsdInterrupt.c=092 Mar 2005 13:29:03 -0000
@@ -47,12 +47,12 @@
=20
static void=09=09InterruptWrapper(void *arg);
=20
-static OSD_HANDLER=09InterruptHandler;
+static ACPI_OSD_HANDLER=09InterruptHandler;
static UINT32=09=09InterruptOverride =3D 0;
=20
ACPI_STATUS
AcpiOsInstallInterruptHandler(UINT32 InterruptNumber,
- OSD_HANDLER ServiceRoutine, void *Context)
+ ACPI_OSD_HANDLER ServiceRoutine, void *Context)
{
struct acpi_softc=09*sc;
=20
@@ -115,7 +115,7 @@
}
=20
ACPI_STATUS
-AcpiOsRemoveInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRo=
utine)
+AcpiOsRemoveInterruptHandler(UINT32 InterruptNumber, ACPI_OSD_HANDLER Serv=
iceRoutine)
{
struct acpi_softc=09*sc;
=20
Index: Osd/OsdSchedule.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/dcvs/src/sys/dev/acpica5/Osd/OsdSchedule.c,v
retrieving revision 1.4
diff -u -r1.4 OsdSchedule.c
--- Osd/OsdSchedule.c=092 Aug 2004 19:51:09 -0000=091.4
+++ Osd/OsdSchedule.c=092 Mar 2005 13:52:23 -0000
@@ -66,7 +66,7 @@
=20
struct acpi_task {
struct lwkt_msg=09=09at_msg;
- OSD_EXECUTION_CALLBACK=09at_function;
+ ACPI_OSD_EXEC_CALLBACK=09at_function;
void=09=09=09*at_context;
int=09=09=09=09at_priority;
};
@@ -93,12 +93,12 @@
static void
acpi_task_thread(void *arg)
{
- OSD_EXECUTION_CALLBACK func;
+ ACPI_OSD_EXEC_CALLBACK func;
struct acpi_task *at;
=20
for (;;) {
=09at =3D (void *)lwkt_waitport(&curthread->td_msgport, NULL);
-=09func =3D (OSD_EXECUTION_CALLBACK)at->at_function;
+=09func =3D (ACPI_OSD_EXEC_CALLBACK)at->at_function;
=09func((void *)at->at_context);
=09lwkt_replymsg(&at->at_msg, 0);
}
@@ -111,7 +111,7 @@
* to automatically free the message.
*/
ACPI_STATUS
-AcpiOsQueueForExecution(UINT32 Priority, OSD_EXECUTION_CALLBACK Function,
+AcpiOsQueueForExecution(UINT32 Priority, ACPI_OSD_EXEC_CALLBACK Function,
void *Context)
{
struct acpi_task=09*at;
@@ -159,16 +159,27 @@
free(msg, M_ACPITASK);
}
=20
+UINT64
+AcpiOsGetTimer (void)
+{
+ struct timeval time;
+
+ microtime(&time);
+
+ /* Seconds * 10^7 =3D 100ns(10^-7), Microseconds(10^-6) * 10^1 =3D 100=
ns */
+
+ return (((UINT64) time.tv_sec * 10000000) + ((UINT64) time.tv_usec * 1=
0));
+}
=20
void
-AcpiOsSleep(UINT32 Seconds, UINT32 Milliseconds)
+AcpiOsSleep(UINT64 Milliseconds)
{
int=09=09timo;
static int=09dummy;
=20
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
=20
- timo =3D (Seconds * hz) + Milliseconds * hz / 1000;
+ timo =3D Milliseconds * hz / 1000;
=20
/*=20
* If requested sleep time is less than our hz resolution, or if
@@ -176,13 +187,13 @@
* use DELAY instead for better granularity.
*/
if (clocks_running =3D=3D 0) {
-=09while (Seconds) {
+=09while (timo > 1000000) {
=09 DELAY(1000000);
-=09 --Seconds;
+=09 timo -=3D 1000000;
=09}
-=09if (Milliseconds)
-=09 DELAY(Milliseconds * 1000);
- } else if (timo > 0) {
+=09if (timo)
+=09 DELAY(timo * 1000);
+ } else if (timo > 1000) {
=09tsleep(&dummy, 0, "acpislp", timo);
} else {
=09DELAY(Milliseconds * 1000);
------=_Part_590_19097426.1109794299229--