diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-06-07 22:25:48 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-06-07 22:25:48 +0000 |
commit | c845274a79933175e67692e9cb6f9c1629b9e566 (patch) | |
tree | 3aa50adc8a3942e82d7a335a2911147e55cb1b65 | |
parent | 8d525262629c4957f6024567423ad8abefc69a31 (diff) |
look into config flags for version enforcement and other flags
-rw-r--r-- | sys/arch/i386/i386/apm.c | 18 | ||||
-rw-r--r-- | sys/arch/i386/include/apmvar.h | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index 49c260f6316..16581d89c20 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.38 2000/05/30 03:39:34 mickey Exp $ */ +/* $OpenBSD: apm.c,v 1.39 2000/06/07 22:25:47 mickey Exp $ */ /*- * Copyright (c) 1998-2000 Michael Shalayeff. All rights reserved. @@ -767,10 +767,11 @@ apmattach(parent, self, aux) u_int cbase, clen, l; bus_space_handle_t ch16, ch32, dh; + apm_flags = ap->apm_detail; /* * set up GDT descriptors for APM */ - if (ap->apm_detail & APM_32BIT_SUPPORTED) { + if (apm_flags & APM_32BIT_SUPPORTED) { /* truncate segments' limits to a page */ ap->apm_code_len -= (ap->apm_code32_base + @@ -780,7 +781,16 @@ apmattach(parent, self, aux) ap->apm_data_len -= (ap->apm_data_base + ap->apm_data_len + 1) & 0xfff; - apm_flags = ap->apm_detail; + /* adjust version */ + if ((sc->sc_dev.dv_cfdata->cf_flags & APM_VERMASK) && + (apm_flags & APM_VERMASK) != + (sc->sc_dev.dv_cfdata->cf_flags & APM_VERMASK)) + apm_flags = (apm_flags & ~APM_VERMASK) | + (sc->sc_dev.dv_cfdata->cf_flags & APM_VERMASK); + if (sc->sc_dev.dv_cfdata->cf_flags & APM_NOCLI) { + extern int apm_cli; /* from apmcall.S */ + apm_cli = 0; + } apm_ep.seg = GSEL(GAPM32CODE_SEL,SEL_KPL); apm_ep.entry = ap->apm_entry; cbase = min(ap->apm_code32_base, ap->apm_code16_base); @@ -827,7 +837,7 @@ apmattach(parent, self, aux) ap->apm_entry, apm_ep.seg, ap->apm_entry+ch32, sc->sc_dev.dv_xname)); - if (ap->apm_detail & APM_BIOS_PM_DISABLED) + if (apm_flags & APM_BIOS_PM_DISABLED) apm_powmgt_enable(1); /* * Engage cooperative power mgt (we get to do it) diff --git a/sys/arch/i386/include/apmvar.h b/sys/arch/i386/include/apmvar.h index 15a0e4d3af1..62ba5f61866 100644 --- a/sys/arch/i386/include/apmvar.h +++ b/sys/arch/i386/include/apmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: apmvar.h,v 1.9 2000/01/29 21:46:59 mickey Exp $ */ +/* $OpenBSD: apmvar.h,v 1.10 2000/06/07 22:25:47 mickey Exp $ */ /* * Copyright (c) 1995 John T. Kohl @@ -49,6 +49,8 @@ #define APM_BIOS_PM_DISENGAGED 0x00100000 #define APM_MAJOR(f) (((f) >> 8) & 0xff) #define APM_MINOR(f) ((f) & 0xff) +#define APM_VERMASK 0x0000ffff +#define APM_NOCLI 0x00010000 /* APM error codes */ #define APM_ERR_CODE(regs) (((regs)->ax & 0xff00) >> 8) |