inspired by the last commit -- apm_attach_args aren't necessary at all,

kill them
being here fix cast-qual problems in debug code
This commit is contained in:
drochner 2005-05-31 21:47:22 +00:00
parent b7680d1847
commit 5e6bfb3b86
3 changed files with 21 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: apm.c,v 1.85 2005/05/31 17:51:49 christos Exp $ */
/* $NetBSD: apm.c,v 1.86 2005/05/31 21:47:22 drochner Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.85 2005/05/31 17:51:49 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.86 2005/05/31 21:47:22 drochner Exp $");
#include "apm.h"
#if NAPM > 1
@ -248,7 +248,7 @@ static int apm_spl; /* saved spl while suspended */
#ifdef APMDEBUG
int apmcall_debug(int, struct bioscallregs *, int);
static void acallpr(int, char *, struct bioscallregs *);
static void acallpr(int, const char *, struct bioscallregs *);
/* bitmask defns for printing apm call args/results */
#define ACPF_AX 0x00000001
@ -274,7 +274,7 @@ static void acallpr(int, char *, struct bioscallregs *);
#define ACPF_EFLAGS 0x00100000
struct acallinfo {
char *name;
const char *name;
int inflag;
int outflag;
};
@ -302,7 +302,7 @@ static struct acallinfo aci[] = {
{ "timer_reqs", ACPF_BX|ACPF_CX, ACPF_CX },
};
static void acallpr(int flag, char *tag, struct bioscallregs *b) {
static void acallpr(int flag, const char *tag, struct bioscallregs *b) {
if (!flag) return;
printf("%s ", tag);
if (flag & ACPF_AX) printf("ax=%#x ", b->AX);
@ -336,7 +336,7 @@ apmcall_debug(func, regs, line)
{
int rv;
int print = (apmdebug & APMDEBUG_APMCALLS) != 0;
char *name;
const char *name;
int inf;
int outf = 0; /* XXX: gcc */
@ -1105,6 +1105,15 @@ apmmatch(parent, match, aux)
return (apm_enabled);
}
int
apmbus_print(void *aux, const char *pnp)
{
if (pnp)
aprint_normal("apm at %s", pnp);
return (UNCONF);
}
#define DPRINTF_BIOSRETURN(regs, bits) \
DPRINTF(APMDEBUG_ATTACH, \
("bioscall return: %x %x %x %x %s %x %x", \

View File

@ -1,4 +1,4 @@
/* $NetBSD: mainbus.c,v 1.54 2004/08/30 15:05:17 drochner Exp $ */
/* $NetBSD: mainbus.c,v 1.55 2005/05/31 21:47:22 drochner 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.54 2004/08/30 15:05:17 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.55 2005/05/31 21:47:22 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -101,9 +101,6 @@ union mainbus_attach_args {
#if NMCA > 0
struct mcabus_attach_args mba_mba;
#endif
#if NAPM > 0
struct apm_attach_args mba_aaa;
#endif
#if NPNPBIOS > 0
struct pnpbios_attach_args mba_paa;
#endif
@ -340,10 +337,8 @@ mainbus_attach(parent, self, aux)
#if NACPI > 0
if (acpi_active == 0)
#endif
if (apm_busprobe()) {
mba.mba_aaa.aaa_busname = "apm";
config_found_ia(self, "apmbus", &mba.mba_aaa, mainbus_print);
}
if (apm_busprobe())
config_found_ia(self, "apmbus", 0, apmbus_print);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: apmvar.h,v 1.20 2005/05/31 17:51:49 christos Exp $ */
/* $NetBSD: apmvar.h,v 1.21 2005/05/31 21:47:22 drochner Exp $ */
/*-
* Copyright (c) 1995 The NetBSD Foundation, Inc.
* All rights reserved.
@ -65,10 +65,6 @@ struct apm_connect_info {
u_int apm_detail;
};
struct apm_attach_args {
const char *aaa_busname;
};
#ifdef _KERNEL
extern struct apm_connect_info apminfo; /* in locore */
extern int apmpresent;
@ -79,6 +75,7 @@ void apm_cpu_idle(void);
void apminit(void);
int apm_set_powstate(u_int devid, u_int powstate);
int apm_busprobe(void);
int apmbus_print(void *, const char *);
#endif /* _KERNEL */
#endif /* _LOCORE */
#endif /* __i386_apm_h__ */