aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorJohn Dyson <dyson@FreeBSD.org>1998-05-11 01:06:08 +0000
committerJohn Dyson <dyson@FreeBSD.org>1998-05-11 01:06:08 +0000
commitf0175db1ee1568b9db4c3c8f15455ed5147bae94 (patch)
tree5d3a7af6cf2528adaa6a76e02056e65aa8e372e3 /sys/amd64/include
parent9b6f1a185f2ed2c2e545c774a3a2901f0610ef8a (diff)
Notes
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/mptable.h64
-rw-r--r--sys/amd64/include/pmap.h16
2 files changed, 20 insertions, 60 deletions
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h
index 62f17ba5ed4f..8d8873bb3a06 100644
--- a/sys/amd64/include/mptable.h
+++ b/sys/amd64/include/mptable.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.72 1998/04/06 08:25:30 phk Exp $
+ * $Id: mp_machdep.c,v 1.73 1998/04/06 15:48:30 peter Exp $
*/
#include "opt_smp.h"
@@ -286,13 +286,6 @@ int io_num_to_apic_id[NAPICID];
int apic_id_to_logical[NAPICID];
-#define NPPROVMTRR 8
-#define PPRO_VMTRRphysBase0 0x200
-#define PPRO_VMTRRphysMask0 0x201
-static struct {
- u_int64_t base, mask;
-} PPro_vmtrr[NPPROVMTRR];
-
/* Bitmap of all available CPUs */
u_int all_cpus;
@@ -342,10 +335,6 @@ static void init_locks(void);
static int start_all_aps(u_int boot_addr);
static void install_ap_tramp(u_int boot_addr);
static int start_ap(int logicalCpu, u_int boot_addr);
-static void getmtrr(void);
-static void putmtrr(void);
-static void putfmtrr(void);
-
/*
* Calculate usable address in base memory for AP trampoline code.
@@ -494,7 +483,7 @@ init_secondary(void)
pmap_set_opt((unsigned *)PTD);
putmtrr();
- putfmtrr();
+ pmap_setvidram();
invltlb();
}
@@ -554,7 +543,7 @@ mp_enable(u_int boot_addr)
#endif /* APIC_IO */
getmtrr();
- putfmtrr();
+ pmap_setvidram();
POSTCODE(MP_ENABLE_POST);
@@ -2119,6 +2108,8 @@ ap_init()
panic("cpuid mismatch! boom!!");
}
+ getmtrr();
+
/* Init local apic for irq's */
apic_initialize();
@@ -2134,51 +2125,6 @@ ap_init()
curproc = NULL; /* make sure */
}
-void
-getmtrr()
-{
- int i;
-
- if (cpu_class == CPUCLASS_686) {
- for(i = 0; i < NPPROVMTRR; i++) {
- PPro_vmtrr[i].base = rdmsr(PPRO_VMTRRphysBase0 + i * 2);
- PPro_vmtrr[i].mask = rdmsr(PPRO_VMTRRphysMask0 + i * 2);
- }
- }
-}
-
-void
-putmtrr()
-{
- int i;
-
- if (cpu_class == CPUCLASS_686) {
- wbinvd();
- for(i = 0; i < NPPROVMTRR; i++) {
- wrmsr(PPRO_VMTRRphysBase0 + i * 2, PPro_vmtrr[i].base);
- wrmsr(PPRO_VMTRRphysMask0 + i * 2, PPro_vmtrr[i].mask);
- }
- }
-}
-
-void
-putfmtrr()
-{
- if (cpu_class == CPUCLASS_686) {
- wbinvd();
- /*
- * Set memory between 0-640K to be WB
- */
- wrmsr(0x250, 0x0606060606060606LL);
- wrmsr(0x258, 0x0606060606060606LL);
- /*
- * Set normal, PC video memory to be WC
- */
- wrmsr(0x259, 0x0101010101010101LL);
- }
-}
-
-
#ifdef BETTER_CLOCK
#define CHECKSTATE_USER 0
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 414b70a78df4..400802d1f269 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -42,7 +42,7 @@
*
* from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
- * $Id: pmap.h,v 1.53 1997/08/05 00:42:01 dyson Exp $
+ * $Id: pmap.h,v 1.54 1997/11/20 19:30:35 bde Exp $
*/
#ifndef _MACHINE_PMAP_H_
@@ -234,6 +234,15 @@ typedef struct pv_entry {
#ifdef KERNEL
+#define NPPROVMTRR 8
+#define PPRO_VMTRRphysBase0 0x200
+#define PPRO_VMTRRphysMask0 0x201
+struct {
+ u_int64_t base, mask;
+} PPro_vmtrr[NPPROVMTRR];
+
+/* Bitmap of all available CPUs */
+
extern caddr_t CADDR1;
extern pt_entry_t *CMAP1;
extern vm_offset_t avail_end;
@@ -252,6 +261,11 @@ unsigned *pmap_pte __P((pmap_t, vm_offset_t)) __pure2;
vm_page_t pmap_use_pt __P((pmap_t, vm_offset_t));
void pmap_set_opt __P((unsigned *));
void pmap_set_opt_bsp __P((void));
+void getmtrr __P((void));
+void putmtrr __P((void));
+void putfmtrr __P((void));
+void pmap_setdevram __P((unsigned long long, unsigned));
+void pmap_setvidram __P((void));
#endif /* KERNEL */