Introduce acpi_check() to inform the caller whether the acpi driver is

still enabled, as it could have been disabled through USERCONF.

Use it in amd64 and i386 mainbus code and skip all ACPI processing in case
it is disabled.
This commit is contained in:
cube 2006-11-26 12:30:05 +00:00
parent 7682107fa9
commit 35d885e59a
4 changed files with 27 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mainbus.c,v 1.13 2006/07/04 10:05:06 he Exp $ */
/* $NetBSD: mainbus.c,v 1.14 2006/11/26 12:30:05 cube Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.13 2006/07/04 10:05:06 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.14 2006/11/26 12:30:05 cube Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -163,7 +163,8 @@ mainbus_attach(parent, self, aux)
#endif
#if NACPI > 0
acpi_present = acpi_probe();
if (acpi_check(self, "acpibus"))
acpi_present = acpi_probe();
/*
* First, see if the MADT contains CPUs, and possibly I/O APICs.
* Building the interrupt routing structures can only

View File

@ -1,4 +1,4 @@
/* $NetBSD: mainbus.c,v 1.69 2006/11/22 12:31:51 yamt Exp $ */
/* $NetBSD: mainbus.c,v 1.70 2006/11/26 12:30:05 cube Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.69 2006/11/22 12:31:51 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.70 2006/11/26 12:30:05 cube Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -223,7 +223,8 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
#endif
#if NACPI > 0
acpi_present = acpi_probe();
if (acpi_check(self, "acpibus"))
acpi_present = acpi_probe();
/*
* First, see if the MADT contains CPUs, and possibly I/O APICs.
* Building the interrupt routing structures can only

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi.c,v 1.97 2006/11/16 01:32:47 christos Exp $ */
/* $NetBSD: acpi.c,v 1.98 2006/11/26 12:30:05 cube Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.97 2006/11/16 01:32:47 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.98 2006/11/26 12:30:05 cube Exp $");
#include "opt_acpi.h"
#include "opt_pcifixup.h"
@ -239,6 +239,21 @@ acpi_probe(void)
return 1;
}
static int
acpi_submatch(device_t parent, cfdata_t cf, const int *locs, void *aux)
{
struct cfattach *ca;
ca = config_cfattach_lookup(cf->cf_name, cf->cf_atname);
return (ca == &acpi_ca);
}
int
acpi_check(device_t parent, const char *ifattr)
{
return (config_search_ia(acpi_submatch, parent, ifattr, NULL) != NULL);
}
ACPI_STATUS
acpi_OsGetRootPointer(UINT32 Flags, ACPI_POINTER *PhysicalAddress)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpivar.h,v 1.27 2006/09/23 17:04:26 fvdl Exp $ */
/* $NetBSD: acpivar.h,v 1.28 2006/11/26 12:30:05 cube Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -257,6 +257,7 @@ extern int acpi_active;
extern const struct acpi_resource_parse_ops acpi_resource_parse_ops_default;
int acpi_check(device_t, const char *);
int acpi_probe(void);
ACPI_STATUS acpi_OsGetRootPointer(UINT32, ACPI_POINTER *);
int acpi_match_hid(ACPI_DEVICE_INFO *, const char * const *);