From: Jan Wieck Date: Fri, 13 Jan 2012 18:35:13 +0000 (+0000) Subject: Implement AcpiOsStall, AcpiOsSleep, AcpiOsGetTimer X-Git-Tag: v3.2.0~125 X-Git-Url: http://zhaoyanbai.com/repos/icons/debian/static/ChangeLog.txt?a=commitdiff_plain;h=2fe79d0b76c01f3e2f3c2616adadaff241c8556e;p=minix.git Implement AcpiOsStall, AcpiOsSleep, AcpiOsGetTimer - change AcpiOsRemoveInterruptHandler() to print a warning instead of panic. - we do the same in AcpiOsInstallInterruptHandler(). Signed-off-by: Tomas Hruby --- diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index bfdc49357..e6edd0b2b 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -139,7 +139,7 @@ ACPICA_SRCS= \ SRCS+=${ACPICA_SRCS} DPADD+= ${LIBSYS} -LDADD+= -lsys +LDADD+= -lsys -lc CPPFLAGS += -I${.CURDIR}/include CFLAGS += -DACPI_LIBRARY diff --git a/drivers/acpi/osminixxf.c b/drivers/acpi/osminixxf.c index c56d25e8d..4531d67a5 100644 --- a/drivers/acpi/osminixxf.c +++ b/drivers/acpi/osminixxf.c @@ -109,6 +109,8 @@ #include #include +#include +#include #include "acpi.h" #include "accommon.h" @@ -644,7 +646,7 @@ AcpiOsRemoveInterruptHandler ( UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine) { - panic("NOTIMPLEMENTED %s\n", __func__); + printf("AcpiOsRemoveInterruptHandler NOT SUPPORTED\n"); return AE_OK; } @@ -711,7 +713,9 @@ void AcpiOsStall ( UINT32 microseconds) { - panic("NOTIMPLEMENTED %s\n", __func__); + if (microseconds > 0) + usleep (microseconds); + return; } @@ -732,7 +736,12 @@ void AcpiOsSleep ( ACPI_INTEGER milliseconds) { - panic("NOTIMPLEMENTED %s\n", __func__); + if ((milliseconds / 1000) > 0) + sleep (milliseconds / 1000); + + if ((milliseconds % 1000) > 0) + usleep ((milliseconds % 1000) * 1000); + return; } @@ -751,8 +760,11 @@ AcpiOsSleep ( UINT64 AcpiOsGetTimer (void) { - panic("NOTIMPLEMENTED %s\n", __func__); - return 0; + struct timeval time; + + gettimeofday (&time, NULL); + return (((UINT64) time.tv_sec * 10000000) + + ((UINT64) time.tv_usec * 10)); }