Initialize MTRRs on startup if they're enabled.

This commit is contained in:
fvdl 2001-09-10 10:12:16 +00:00
parent 78742dd0e0
commit 38db8748a4
1 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.454 2001/09/09 02:10:44 enami Exp $ */ /* $NetBSD: machdep.c,v 1.455 2001/09/10 10:12:16 fvdl Exp $ */
/*- /*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -86,6 +86,7 @@
#include "opt_compat_svr4.h" #include "opt_compat_svr4.h"
#include "opt_realmem.h" #include "opt_realmem.h"
#include "opt_compat_mach.h" /* need to get the right segment def */ #include "opt_compat_mach.h" /* need to get the right segment def */
#include "opt_mtrr.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -133,6 +134,7 @@
#include <machine/reg.h> #include <machine/reg.h>
#include <machine/specialreg.h> #include <machine/specialreg.h>
#include <machine/bootinfo.h> #include <machine/bootinfo.h>
#include <machine/mtrr.h>
#include <dev/isa/isareg.h> #include <dev/isa/isareg.h>
#include <machine/isa_machdep.h> #include <machine/isa_machdep.h>
@ -190,6 +192,10 @@ int cpureset_delay = CPURESET_DELAY;
int cpureset_delay = 2000; /* default to 2s */ int cpureset_delay = 2000; /* default to 2s */
#endif #endif
#ifdef MTRR
struct mtrr_funcs *mtrr_funcs;
#endif
int physmem; int physmem;
int dumpmem_low; int dumpmem_low;
@ -442,6 +448,14 @@ cpu_startup()
cpu_serial[2] / 65536, cpu_serial[2] % 65536); cpu_serial[2] / 65536, cpu_serial[2] % 65536);
} }
#ifdef MTRR
if (cpu_feature & CPUID_MTRR) {
mtrr_funcs = &i686_mtrr_funcs;
i686_mtrr_init_first();
mtrr_init_cpu(ci);
}
#endif
format_bytes(pbuf, sizeof(pbuf), ptoa(physmem)); format_bytes(pbuf, sizeof(pbuf), ptoa(physmem));
printf("total memory = %s\n", pbuf); printf("total memory = %s\n", pbuf);