When ACPI is not present, free any resources used by the ACPICA. Also,
no need to complain (unless we're debugging) that ACPI is not present.
This commit is contained in:
parent
cf036af25e
commit
ec32b60246
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: acpi.c,v 1.129 2009/08/18 21:38:41 cegger Exp $ */
|
||||
/* $NetBSD: acpi.c,v 1.130 2009/08/23 15:16:16 jmcneill Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
|
||||
@ -70,7 +70,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.129 2009/08/18 21:38:41 cegger Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.130 2009/08/23 15:16:16 jmcneill Exp $");
|
||||
|
||||
#include "opt_acpi.h"
|
||||
#include "opt_pcifixup.h"
|
||||
@ -244,8 +244,11 @@ acpi_probe(void)
|
||||
|
||||
rv = AcpiInitializeTables(acpi_initial_tables, 128, 0);
|
||||
if (ACPI_FAILURE(rv)) {
|
||||
#ifdef ACPI_DEBUG
|
||||
printf("ACPI: unable to initialize ACPI tables: %s\n",
|
||||
AcpiFormatException(rv));
|
||||
#endif
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -253,6 +256,7 @@ acpi_probe(void)
|
||||
if (ACPI_FAILURE(rv)) {
|
||||
printf("ACPI: unable to reallocate root table: %s\n",
|
||||
AcpiFormatException(rv));
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -265,12 +269,14 @@ acpi_probe(void)
|
||||
if (ACPI_FAILURE(rv)) {
|
||||
printf("ACPI: unable to load tables: %s\n",
|
||||
AcpiFormatException(rv));
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
rsdt = acpi_map_rsdt();
|
||||
if (rsdt == NULL) {
|
||||
printf("ACPI: unable to map RSDT\n");
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -284,6 +290,7 @@ acpi_probe(void)
|
||||
rsdt->AslCompilerRevision);
|
||||
printf("ACPI: not used. set acpi_force_load to use anyway.\n");
|
||||
acpi_unmap_rsdt(rsdt);
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -296,6 +303,7 @@ acpi_probe(void)
|
||||
if (ACPI_FAILURE(rv)) {
|
||||
printf("ACPI: unable to initialise SystemMemory handler: %s\n",
|
||||
AcpiFormatException(rv));
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
rv = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT,
|
||||
@ -303,6 +311,7 @@ acpi_probe(void)
|
||||
if (ACPI_FAILURE(rv)) {
|
||||
printf("ACPI: unable to initialise SystemIO handler: %s\n",
|
||||
AcpiFormatException(rv));
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
rv = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT,
|
||||
@ -310,6 +319,7 @@ acpi_probe(void)
|
||||
if (ACPI_FAILURE(rv)) {
|
||||
printf("ACPI: unabled to initialise PciConfig handler: %s\n",
|
||||
AcpiFormatException(rv));
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -317,6 +327,7 @@ acpi_probe(void)
|
||||
rv = AcpiEnableSubsystem(~(ACPI_NO_HARDWARE_INIT|ACPI_NO_ACPI_ENABLE));
|
||||
if (ACPI_FAILURE(rv)) {
|
||||
printf("ACPI: unable to enable: %s\n", AcpiFormatException(rv));
|
||||
AcpiTerminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: acpi_osd.h,v 1.1 2001/09/28 02:09:23 thorpej Exp $ */
|
||||
/* $NetBSD: acpi_osd.h,v 1.2 2009/08/23 15:16:16 jmcneill Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
@ -45,4 +45,3 @@ void acpi_osd_debugger(void);
|
||||
|
||||
/* Osd/OsdSchedule.c */
|
||||
void acpi_osd_sched_init(void);
|
||||
void acpi_osd_sched_fini(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: OsdEnvironment.c,v 1.4 2009/08/18 16:41:02 jmcneill Exp $ */
|
||||
/* $NetBSD: OsdEnvironment.c,v 1.5 2009/08/23 15:16:16 jmcneill Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: OsdEnvironment.c,v 1.4 2009/08/18 16:41:02 jmcneill Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: OsdEnvironment.c,v 1.5 2009/08/23 15:16:16 jmcneill Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@ -77,9 +77,6 @@ AcpiOsInitialize(void)
|
||||
ACPI_STATUS
|
||||
AcpiOsTerminate(void)
|
||||
{
|
||||
/* Tear down the Osd Scheduler. */
|
||||
acpi_osd_sched_fini();
|
||||
|
||||
return acpi_md_OsTerminate();
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: OsdSchedule.c,v 1.11 2009/08/18 16:41:02 jmcneill Exp $ */
|
||||
/* $NetBSD: OsdSchedule.c,v 1.12 2009/08/23 15:16:16 jmcneill Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.11 2009/08/18 16:41:02 jmcneill Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.12 2009/08/23 15:16:16 jmcneill Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/malloc.h>
|
||||
@ -79,17 +79,6 @@ acpi_osd_sched_init(void)
|
||||
cv_init(&acpi_osd_sleep_cv, "acpislp");
|
||||
}
|
||||
|
||||
/*
|
||||
* acpi_osd_sched_fini:
|
||||
*
|
||||
* Clean up the ACPICA Osd scheduler. Called from AcpiOsdTerminate().
|
||||
*/
|
||||
void
|
||||
acpi_osd_sched_fini(void)
|
||||
{
|
||||
sysmon_task_queue_fini();
|
||||
}
|
||||
|
||||
/*
|
||||
* AcpiOsGetThreadId:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user