summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/initcpu.c
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1999-01-16 13:41:33 +0000
committerkato <kato@FreeBSD.org>1999-01-16 13:41:33 +0000
commit6a367acbf2a395035f73aab24210eaf9e4020c22 (patch)
tree931e4e0de9e2fb28ad006702465a1067261804fb /sys/amd64/amd64/initcpu.c
parenta8b74b8641ab2f4ad222afcc7ac3a969f935072f (diff)
downloadFreeBSD-src-6a367acbf2a395035f73aab24210eaf9e4020c22.zip
FreeBSD-src-6a367acbf2a395035f73aab24210eaf9e4020c22.tar.gz
There are two models of AMD K6-2 Model 8 (c.f. AMD's document), so the
CPU stepping must be checked. Also, fixed print_AMD_info. Submitted by: Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp>
Diffstat (limited to 'sys/amd64/amd64/initcpu.c')
-rw-r--r--sys/amd64/amd64/initcpu.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index 330f9ef..d64f4ee 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: initcpu.c,v 1.15 1998/12/14 06:16:13 dillon Exp $
+ * $Id: initcpu.c,v 1.16 1998/12/27 23:23:26 msmith Exp $
*/
#include "opt_cpu.h"
@@ -617,20 +617,17 @@ enable_K6_wt_alloc(void)
#endif
/* Don't assume that memory size is aligned with 4M. */
if (Maxmem > 0)
- size = Maxmem / 256;
+ size = ((Maxmem >> 8) + 3) >> 2;
else
size = 0;
- size = (size + 3) / 4;
/* Limit is 508M bytes. */
- if (size > 127)
- size = 127;
- whcr = rdmsr(0xc0000082);
- whcr &= ~0x00feLL;
- whcr |= (size << 1);
+ if (size > 0x7f)
+ size = 0x7f;
+ whcr = (rdmsr(0xc0000082) & ~(0x7fLL << 1)) | (size << 1);
#if defined(PC98) || defined(NO_MEMORY_HOLE)
- if (whcr & 0x00feLL) {
+ if (whcr & (0x7fLL << 1)) {
#ifdef PC98
/*
* If bit 2 of port 0x43b is 0, disable wrte allocate for the
@@ -687,7 +684,8 @@ enable_K6_2_wt_alloc(void)
size = 0;
/* Limit is 4092M bytes. */
- size &= 0x3ff;
+ if (size > 0x3fff)
+ size = 0x3ff;
whcr = (rdmsr(0xc0000082) & ~(0x3ffLL << 22)) | (size << 22);
#if defined(PC98) || defined(NO_MEMORY_HOLE)
OpenPOWER on IntegriCloud