Catch up with AcpiOsSleep() interface change.
Catch up with some #define's renaming. Implement AcpiOsGetTimer() as per ACPI 3.0. Approved by: njl MFC after: 1 week
This commit is contained in:
parent
cdb35b24fe
commit
f8c60df7a6
@ -48,7 +48,7 @@ static UINT32 InterruptOverride = 0;
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiOsInstallInterruptHandler(UINT32 InterruptNumber,
|
||||
OSD_HANDLER ServiceRoutine, void *Context)
|
||||
ACPI_OSD_HANDLER ServiceRoutine, void *Context)
|
||||
{
|
||||
struct acpi_softc *sc;
|
||||
|
||||
@ -105,7 +105,7 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber,
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiOsRemoveInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine)
|
||||
AcpiOsRemoveInterruptHandler(UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine)
|
||||
{
|
||||
struct acpi_softc *sc;
|
||||
|
||||
|
@ -60,7 +60,7 @@ static void AcpiOsExecuteQueue(void *arg, int pending);
|
||||
|
||||
struct acpi_task {
|
||||
struct task at_task;
|
||||
OSD_EXECUTION_CALLBACK at_function;
|
||||
ACPI_OSD_EXEC_CALLBACK at_function;
|
||||
void *at_context;
|
||||
};
|
||||
|
||||
@ -98,7 +98,7 @@ static void
|
||||
acpi_task_thread(void *arg)
|
||||
{
|
||||
struct acpi_task_queue *atq;
|
||||
OSD_EXECUTION_CALLBACK Function;
|
||||
ACPI_OSD_EXEC_CALLBACK Function;
|
||||
void *Context;
|
||||
|
||||
ACPI_LOCK(taskq);
|
||||
@ -108,7 +108,7 @@ acpi_task_thread(void *arg)
|
||||
STAILQ_REMOVE_HEAD(&acpi_task_queue, at_q);
|
||||
ACPI_UNLOCK(taskq);
|
||||
|
||||
Function = (OSD_EXECUTION_CALLBACK)atq->at->at_function;
|
||||
Function = (ACPI_OSD_EXEC_CALLBACK)atq->at->at_function;
|
||||
Context = atq->at->at_context;
|
||||
|
||||
Function(Context);
|
||||
@ -143,7 +143,7 @@ acpi_task_thread_init(void)
|
||||
|
||||
/* This function is called in interrupt context. */
|
||||
ACPI_STATUS
|
||||
AcpiOsQueueForExecution(UINT32 Priority, OSD_EXECUTION_CALLBACK Function,
|
||||
AcpiOsQueueForExecution(UINT32 Priority, ACPI_OSD_EXEC_CALLBACK Function,
|
||||
void *Context)
|
||||
{
|
||||
struct acpi_task *at;
|
||||
@ -188,7 +188,7 @@ static void
|
||||
AcpiOsExecuteQueue(void *arg, int pending)
|
||||
{
|
||||
struct acpi_task_queue *atq;
|
||||
OSD_EXECUTION_CALLBACK Function;
|
||||
ACPI_OSD_EXEC_CALLBACK Function;
|
||||
void *Context;
|
||||
|
||||
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
|
||||
@ -213,14 +213,14 @@ AcpiOsExecuteQueue(void *arg, int pending)
|
||||
}
|
||||
|
||||
void
|
||||
AcpiOsSleep(UINT32 Seconds, UINT32 Milliseconds)
|
||||
AcpiOsSleep(ACPI_INTEGER Milliseconds)
|
||||
{
|
||||
int timo;
|
||||
static int dummy;
|
||||
|
||||
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
|
||||
|
||||
timo = (Seconds * hz) + Milliseconds * hz / 1000;
|
||||
timo = Milliseconds * hz / 1000;
|
||||
|
||||
/*
|
||||
* If requested sleep time is less than our hz resolution, use
|
||||
@ -234,6 +234,26 @@ AcpiOsSleep(UINT32 Seconds, UINT32 Milliseconds)
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the current time in 100 nanosecond units
|
||||
*/
|
||||
UINT64
|
||||
AcpiOsGetTimer(void)
|
||||
{
|
||||
struct bintime bt;
|
||||
UINT64 t;
|
||||
|
||||
/* XXX During early boot there is no (decent) timer available yet. */
|
||||
if (cold)
|
||||
panic("acpi: timer op not yet supported during boot");
|
||||
|
||||
binuptime(&bt);
|
||||
t = ((UINT64)10000000 * (uint32_t)(bt.frac >> 32)) >> 32;
|
||||
t += bt.sec * 10000000;
|
||||
|
||||
return (t);
|
||||
}
|
||||
|
||||
void
|
||||
AcpiOsStall(UINT32 Microseconds)
|
||||
{
|
||||
|
@ -238,7 +238,7 @@ acpi_acad_init_acline(void *arg)
|
||||
acpi_acad_get_status(dev);
|
||||
if (sc->status != -1)
|
||||
break;
|
||||
AcpiOsSleep(10, 0);
|
||||
AcpiOsSleep(10000);
|
||||
}
|
||||
|
||||
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
|
||||
|
@ -587,7 +587,7 @@ acpi_cmbat_init_battery(void *arg)
|
||||
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
|
||||
"battery initialization start\n");
|
||||
|
||||
for (retry = 0; retry < ACPI_CMBAT_RETRY_MAX; retry++, AcpiOsSleep(10, 0)) {
|
||||
for (retry = 0; retry < ACPI_CMBAT_RETRY_MAX; retry++, AcpiOsSleep(10000)) {
|
||||
sc->present = acpi_BatteryIsPresent(dev);
|
||||
if (!sc->present)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user