diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-01-31 21:09:37 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-01-31 21:09:37 +0000 |
commit | 0189853d2e045b0bd4fce5640849747d19f01c24 (patch) | |
tree | 8c5217d90ee52f223f6fcc6adcebb04f0b93b25c /sys/arch/i386 | |
parent | d9be13a593426dad5ab4c996f5351c88e2d396a0 (diff) |
explicitly round segments to a page boundary
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/apm.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index 1707b0b42ed..7f3f6477bd8 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.31 2000/01/31 19:48:58 mickey Exp $ */ +/* $OpenBSD: apm.c,v 1.32 2000/01/31 21:09:36 mickey Exp $ */ /*- * Copyright (c) 1998-2000 Michael Shalayeff. All rights reserved. @@ -774,11 +774,13 @@ apmattach(parent, self, aux) */ if (ap->apm_detail & APM_32BIT_SUPPORTED) { - /* adjust code size limits */ - if (ap->apm_code_len >= 0x10000) - ap->apm_code_len = 0xffff; - if (ap->apm_code16_len >= 0x10000) - ap->apm_code16_len = 0xffff; + /* truncate segments' limits to a page */ + ap->apm_code_len -= (ap->apm_code32_base + + ap->apm_code_len + 1) & 0xfff; + ap->apm_code16_len -= (ap->apm_code16_base + + ap->apm_code16_len + 1) & 0xfff; + ap->apm_data_len -= (ap->apm_data_base + + ap->apm_data_len + 1) & 0xfff; apm_flags = ap->apm_detail; apm_ep.seg = GSEL(GAPM32CODE_SEL,SEL_KPL); |