summaryrefslogtreecommitdiffstats
path: root/sys/i386/include
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-07-17 04:34:03 +0000
committerdyson <dyson@FreeBSD.org>1997-07-17 04:34:03 +0000
commitb39089e3e900353e31d93fec75b93ad05e747cdb (patch)
tree1061ae63c03d4ba52b54a403d33ef428edac2173 /sys/i386/include
parent72b4af037318ef528f726826d4dc58d259321d8f (diff)
downloadFreeBSD-src-b39089e3e900353e31d93fec75b93ad05e747cdb.zip
FreeBSD-src-b39089e3e900353e31d93fec75b93ad05e747cdb.tar.gz
Add support for 4MB pages. This includes the .text, .data, .data parts
of the kernel, and also most of the dynamic parts of the kernel. Additionally, 4MB pages will be allocated for display buffers as appropriate (only.) The 4MB support for SMP isn't complete, but doesn't interfere with operation either.
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/cpufunc.h4
-rw-r--r--sys/i386/include/pmap.h26
2 files changed, 23 insertions, 7 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 693b568..41e1bd7 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.67 1997/05/21 22:56:04 jdp Exp $
+ * $Id: cpufunc.h,v 1.68 1997/05/31 09:13:03 peter Exp $
*/
/*
@@ -416,8 +416,10 @@ void wrmsr __P((u_int msr, quad_t newval));
void load_cr0 __P((u_long cr0));
void load_cr3 __P((u_long cr3));
+void load_cr4 __P((u_long cr4));
void ltr __P((u_short sel));
u_int rcr0 __P((void));
u_long rcr3 __P((void));
+u_long rcr4 __P((void));
#endif /* !_MACHINE_CPUFUNC_H_ */
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index f00d4f2..3265129 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/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.50 1997/04/26 11:45:41 peter Exp $
+ * $Id: pmap.h,v 1.51 1997/06/22 16:03:54 peter Exp $
*/
#ifndef _MACHINE_PMAP_H_
@@ -144,6 +144,7 @@ extern pd_entry_t PTD[], APTD[], PTDpde, APTDpde, Upde;
extern pd_entry_t IdlePTD; /* physical address of "Idle" state directory */
#endif
+#ifdef KERNEL
/*
* virtual address to page table entry and
* to physical address. Likewise for alternate address space.
@@ -151,12 +152,9 @@ extern pd_entry_t IdlePTD; /* physical address of "Idle" state directory */
* the corresponding pde that in turn maps it.
*/
#define vtopte(va) (PTmap + i386_btop(va))
-#define vtophys(va) (((int) (*vtopte(va))&PG_FRAME) | ((int)(va) & PAGE_MASK))
#define avtopte(va) (APTmap + i386_btop(va))
-#define avtophys(va) (((int) (*avtopte(va))&PG_FRAME) | ((int)(va) & PAGE_MASK))
-#ifdef KERNEL
/*
* Routine: pmap_kextract
* Function:
@@ -166,10 +164,24 @@ extern pd_entry_t IdlePTD; /* physical address of "Idle" state directory */
static __inline vm_offset_t
pmap_kextract(vm_offset_t va)
{
- vm_offset_t pa = *(int *)vtopte(va);
- pa = (pa & PG_FRAME) | (va & PAGE_MASK);
+ vm_offset_t pa;
+ if ((pa = (vm_offset_t) PTD[va >> PDRSHIFT]) & PG_PS) {
+ pa = (pa & ~(NBPDR - 1)) | (va & (NBPDR - 1));
+ } else {
+ pa = *(vm_offset_t *)vtopte(va);
+ pa = (pa & PG_FRAME) | (va & PAGE_MASK);
+ }
return pa;
}
+
+#if 0
+#define vtophys(va) (((int) (*vtopte(va))&PG_FRAME) | ((int)(va) & PAGE_MASK))
+#else
+#define vtophys(va) pmap_kextract(((vm_offset_t) (va)))
+#endif
+
+#define avtophys(va) (((int) (*avtopte(va))&PG_FRAME) | ((int)(va) & PAGE_MASK))
+
#endif
/*
@@ -237,6 +249,8 @@ pmap_t pmap_kernel __P((void));
void *pmap_mapdev __P((vm_offset_t, vm_size_t));
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));
#endif /* KERNEL */
OpenPOWER on IntegriCloud