summaryrefslogtreecommitdiffstats
path: root/sys/pc98/apm/apm.c
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1996-07-23 07:46:59 +0000
committerasami <asami@FreeBSD.org>1996-07-23 07:46:59 +0000
commit80d063318901b953d4a5e1db64b20bea78785caf (patch)
treea4a7cbb6b9a6c0397043022de208c713b39053de /sys/pc98/apm/apm.c
parent7f40ab6534c99db1b9436ab4748d58d4f7aeea29 (diff)
downloadFreeBSD-src-80d063318901b953d4a5e1db64b20bea78785caf.zip
FreeBSD-src-80d063318901b953d4a5e1db64b20bea78785caf.tar.gz
Update to current state of PC98 world.
Submitted by: The FreeBSD(98) development team
Diffstat (limited to 'sys/pc98/apm/apm.c')
-rw-r--r--sys/pc98/apm/apm.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/pc98/apm/apm.c b/sys/pc98/apm/apm.c
index d140eb0..482eefb 100644
--- a/sys/pc98/apm/apm.c
+++ b/sys/pc98/apm/apm.c
@@ -14,7 +14,7 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.43 1996/06/04 17:50:28 nate Exp $
+ * $Id: apm.c,v 1.1.1.1 1996/06/14 10:04:36 asami Exp $
*/
#include "apm.h"
@@ -36,10 +36,8 @@
#include <sys/proc.h>
#include <sys/vnode.h>
#ifdef PC98
-#include "pc98/pc98/pc98.h"
#include "pc98/pc98/pc98_device.h"
#else
-#include "i386/isa/isa.h"
#include "i386/isa/isa_device.h"
#endif
#include <machine/apm_bios.h>
@@ -710,6 +708,11 @@ apmattach(struct isa_device *dvp)
#ifdef APM_DSVALUE_BUG
caddr_t apm_bios_work;
+ /*
+ * XXX - Malloc enough space for the APM DS, and then copy the
+ * current DS into the new space since the DS setup by the
+ * APM bios is going to get wiped out.
+ */
apm_bios_work = (caddr_t)malloc(apm_ds_limit, M_DEVBUF, M_NOWAIT);
bcopy((caddr_t)((apm_ds_base << 4) + APM_KERNBASE), apm_bios_work,
apm_ds_limit);
@@ -721,14 +724,15 @@ apmattach(struct isa_device *dvp)
sc->active = 0;
/* setup APM parameters */
- sc->cs16_base = (apm_cs32_base << 4) + APM_KERNBASE;
- sc->cs32_base = (apm_cs16_base << 4) + APM_KERNBASE;
+ sc->cs16_base = (apm_cs16_base << 4) + APM_KERNBASE;
+ sc->cs32_base = (apm_cs32_base << 4) + APM_KERNBASE;
sc->ds_base = (apm_ds_base << 4) + APM_KERNBASE;
sc->cs_limit = apm_cs_limit;
sc->ds_limit = apm_ds_limit;
sc->cs_entry = apm_cs_entry;
#ifdef APM_DSVALUE_BUG
+ /* Set the DS base to point to the newly made copy of the APM DS */
sc->ds_base = (u_int)apm_bios_work;
#endif /* APM_DSVALUE_BUG */
@@ -747,10 +751,11 @@ apmattach(struct isa_device *dvp)
printf("apm: Code entry 0x%08x, Idling CPU %s, Management %s\n",
sc->cs_entry, is_enabled(sc->slow_idle_cpu),
is_enabled(!sc->disabled));
- printf("apm: CS_limit=%x, DS_limit=%x\n", sc->cs_limit, sc->ds_limit);
+ printf("apm: CS_limit=0x%x, DS_limit=0x%x\n",
+ sc->cs_limit, sc->ds_limit);
#endif /* APM_DEBUG */
-#ifdef APM_DEBUG
+#ifdef 0
/* Workaround for some buggy APM BIOS implementations */
sc->cs_limit = 0xffff;
sc->ds_limit = 0xffff;
OpenPOWER on IntegriCloud