Add isa_get_slotcount/isa_set_slotcount to get/set the number of ISA

compatible expansion slots in a system.
This commit is contained in:
ad 2008-03-30 15:24:08 +00:00
parent 56baac4d94
commit cad7ab7809
2 changed files with 23 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/* $NetBSD: isa.c,v 1.132 2008/03/15 16:56:29 cube Exp $ */
/* $NetBSD: isa.c,v 1.133 2008/03/30 15:24:08 ad Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
* Copyright (c) 1998, 2001, 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: isa.c,v 1.132 2008/03/15 16:56:29 cube Exp $");
__KERNEL_RCSID(0, "$NetBSD: isa.c,v 1.133 2008/03/30 15:24:08 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -76,6 +76,8 @@ void isa_free_knowndevs(struct isa_softc *);
int isasubmatch(device_t, cfdata_t, const int *, void *);
int isasearch(device_t, cfdata_t, const int *, void *);
static int isa_slotcount = -1; /* -1 == don't know how many */
int
isamatch(device_t parent, cfdata_t cf, void *aux)
{
@ -469,3 +471,17 @@ isa_intr_typename(int type)
panic("isa_intr_typename: invalid type %d", type);
}
}
int
isa_get_slotcount(void)
{
return isa_slotcount;
}
void
isa_set_slotcount(int arg)
{
isa_slotcount = arg;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: isavar.h,v 1.50 2008/03/15 16:56:29 cube Exp $ */
/* $NetBSD: isavar.h,v 1.51 2008/03/30 15:24:08 ad Exp $ */
/*-
* Copyright (c) 1997, 2001 The NetBSD Foundation, Inc.
@ -278,4 +278,7 @@ const char *isa_intr_typename(int);
*/
#define ISABUS_DMA_DEFERCHAN BUS_DMA_BUS2
void isa_set_slotcount(int);
int isa_get_slotcount(void);
#endif /* _DEV_ISA_ISAVAR_H_ */