summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-11-07 14:44:01 +0000
committerjoerg <joerg@FreeBSD.org>1996-11-07 14:44:01 +0000
commit6fc1a569c613dea92b2cd602cf394dd627edb3e8 (patch)
tree5f6df45c533c39d986a65ce6a2bde61a44e7461f /sys
parent524bda369e953d881ee7553b09e8264a246ab63d (diff)
downloadFreeBSD-src-6fc1a569c613dea92b2cd602cf394dd627edb3e8.zip
FreeBSD-src-6fc1a569c613dea92b2cd602cf394dd627edb3e8.tar.gz
Fix the message buffer mapping. This actually allows to increase
the message buffer size in <sys/msgbuf.h>. Reviewed by: davidg,joerg Submitted by: bde
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c20
-rw-r--r--sys/amd64/amd64/pmap.c47
-rw-r--r--sys/i386/i386/machdep.c20
-rw-r--r--sys/i386/i386/pmap.c47
4 files changed, 66 insertions, 68 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 2cf8d5f..049c86d 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.208 1996/10/20 18:35:32 phk Exp $
+ * $Id: machdep.c,v 1.209 1996/10/31 00:57:25 julian Exp $
*/
#include "npx.h"
@@ -203,17 +203,6 @@ cpu_startup(dummy)
bootverbose++;
/*
- * Initialize error message buffer (at end of core).
- */
-
- /* avail_end was pre-decremented in init386() to compensate */
- for (i = 0; i < btoc(sizeof (struct msgbuf)); i++)
- pmap_enter(pmap_kernel(), (vm_offset_t)msgbufp,
- avail_end + i * PAGE_SIZE,
- VM_PROT_ALL, TRUE);
- msgbufmapped = 1;
-
- /*
* Good {morning,afternoon,evening,night}.
*/
printf(version);
@@ -987,6 +976,7 @@ init386(first)
struct region_descriptor r_gdt, r_idt;
int pagesinbase, pagesinext;
int target_page, pa_indx;
+ int off;
proc0.p_addr = proc0paddr;
@@ -1308,6 +1298,12 @@ init386(first)
/* now running on new page tables, configured,and u/iom is accessible */
+ /* Map the message buffer. */
+ for (off = 0; off < round_page(sizeof(struct msgbuf)); off += PAGE_SIZE)
+ pmap_enter(kernel_pmap, (vm_offset_t)msgbufp + off,
+ avail_end + off, VM_PROT_ALL, TRUE);
+ msgbufmapped = 1;
+
/* make a initial tss so microp can get interrupt stack on syscall! */
proc0.p_addr->u_pcb.pcb_tss.tss_esp0 = (int) kstack + UPAGES*PAGE_SIZE;
proc0.p_addr->u_pcb.pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL) ;
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 23de085..0ab922c 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $Id: pmap.c,v 1.128 1996/10/23 05:31:54 dyson Exp $
+ * $Id: pmap.c,v 1.129 1996/11/03 03:40:47 dyson Exp $
*/
/*
@@ -214,6 +214,24 @@ static vm_offset_t pdstack[PDSTACKMAX];
static int pdstackptr;
/*
+ * Routine: pmap_pte
+ * Function:
+ * Extract the page table entry associated
+ * with the given map/virtual_address pair.
+ */
+
+PMAP_INLINE unsigned *
+pmap_pte(pmap, va)
+ register pmap_t pmap;
+ vm_offset_t va;
+{
+ if (pmap && *pmap_pde(pmap, va)) {
+ return get_ptbase(pmap) + i386_btop(va);
+ }
+ return (0);
+}
+
+/*
* Bootstrap the system enough to run with virtual memory.
*
* On the i386 this is called after mapping has already been enabled
@@ -281,14 +299,17 @@ pmap_bootstrap(firstaddr, loadaddr)
SYSMAP(caddr_t, CMAP2, CADDR2, 1)
/*
- * ptmmap is used for reading arbitrary physical pages via /dev/mem.
+ * ptvmmap is used for reading arbitrary physical pages via /dev/mem.
+ * XXX ptmmap is not used.
*/
SYSMAP(caddr_t, ptmmap, ptvmmap, 1)
/*
- * msgbufmap is used to map the system message buffer.
+ * msgbufp is used to map the system message buffer.
+ * XXX msgbufmap is not used.
*/
- SYSMAP(struct msgbuf *, msgbufmap, msgbufp, 1)
+ SYSMAP(struct msgbuf *, msgbufmap, msgbufp,
+ atop(round_page(sizeof(struct msgbuf))))
/*
* ptemap is used for pmap_pte_quick
@@ -455,24 +476,6 @@ get_ptbase(pmap)
}
/*
- * Routine: pmap_pte
- * Function:
- * Extract the page table entry associated
- * with the given map/virtual_address pair.
- */
-
-PMAP_INLINE unsigned *
-pmap_pte(pmap, va)
- register pmap_t pmap;
- vm_offset_t va;
-{
- if (pmap && *pmap_pde(pmap, va)) {
- return get_ptbase(pmap) + i386_btop(va);
- }
- return (0);
-}
-
-/*
* Super fast pmap_pte routine best used when scanning
* the pv lists. This eliminates many coarse-grained
* invltlb calls. Note that many of the pv list
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 2cf8d5f..049c86d 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.208 1996/10/20 18:35:32 phk Exp $
+ * $Id: machdep.c,v 1.209 1996/10/31 00:57:25 julian Exp $
*/
#include "npx.h"
@@ -203,17 +203,6 @@ cpu_startup(dummy)
bootverbose++;
/*
- * Initialize error message buffer (at end of core).
- */
-
- /* avail_end was pre-decremented in init386() to compensate */
- for (i = 0; i < btoc(sizeof (struct msgbuf)); i++)
- pmap_enter(pmap_kernel(), (vm_offset_t)msgbufp,
- avail_end + i * PAGE_SIZE,
- VM_PROT_ALL, TRUE);
- msgbufmapped = 1;
-
- /*
* Good {morning,afternoon,evening,night}.
*/
printf(version);
@@ -987,6 +976,7 @@ init386(first)
struct region_descriptor r_gdt, r_idt;
int pagesinbase, pagesinext;
int target_page, pa_indx;
+ int off;
proc0.p_addr = proc0paddr;
@@ -1308,6 +1298,12 @@ init386(first)
/* now running on new page tables, configured,and u/iom is accessible */
+ /* Map the message buffer. */
+ for (off = 0; off < round_page(sizeof(struct msgbuf)); off += PAGE_SIZE)
+ pmap_enter(kernel_pmap, (vm_offset_t)msgbufp + off,
+ avail_end + off, VM_PROT_ALL, TRUE);
+ msgbufmapped = 1;
+
/* make a initial tss so microp can get interrupt stack on syscall! */
proc0.p_addr->u_pcb.pcb_tss.tss_esp0 = (int) kstack + UPAGES*PAGE_SIZE;
proc0.p_addr->u_pcb.pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL) ;
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 23de085..0ab922c 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $Id: pmap.c,v 1.128 1996/10/23 05:31:54 dyson Exp $
+ * $Id: pmap.c,v 1.129 1996/11/03 03:40:47 dyson Exp $
*/
/*
@@ -214,6 +214,24 @@ static vm_offset_t pdstack[PDSTACKMAX];
static int pdstackptr;
/*
+ * Routine: pmap_pte
+ * Function:
+ * Extract the page table entry associated
+ * with the given map/virtual_address pair.
+ */
+
+PMAP_INLINE unsigned *
+pmap_pte(pmap, va)
+ register pmap_t pmap;
+ vm_offset_t va;
+{
+ if (pmap && *pmap_pde(pmap, va)) {
+ return get_ptbase(pmap) + i386_btop(va);
+ }
+ return (0);
+}
+
+/*
* Bootstrap the system enough to run with virtual memory.
*
* On the i386 this is called after mapping has already been enabled
@@ -281,14 +299,17 @@ pmap_bootstrap(firstaddr, loadaddr)
SYSMAP(caddr_t, CMAP2, CADDR2, 1)
/*
- * ptmmap is used for reading arbitrary physical pages via /dev/mem.
+ * ptvmmap is used for reading arbitrary physical pages via /dev/mem.
+ * XXX ptmmap is not used.
*/
SYSMAP(caddr_t, ptmmap, ptvmmap, 1)
/*
- * msgbufmap is used to map the system message buffer.
+ * msgbufp is used to map the system message buffer.
+ * XXX msgbufmap is not used.
*/
- SYSMAP(struct msgbuf *, msgbufmap, msgbufp, 1)
+ SYSMAP(struct msgbuf *, msgbufmap, msgbufp,
+ atop(round_page(sizeof(struct msgbuf))))
/*
* ptemap is used for pmap_pte_quick
@@ -455,24 +476,6 @@ get_ptbase(pmap)
}
/*
- * Routine: pmap_pte
- * Function:
- * Extract the page table entry associated
- * with the given map/virtual_address pair.
- */
-
-PMAP_INLINE unsigned *
-pmap_pte(pmap, va)
- register pmap_t pmap;
- vm_offset_t va;
-{
- if (pmap && *pmap_pde(pmap, va)) {
- return get_ptbase(pmap) + i386_btop(va);
- }
- return (0);
-}
-
-/*
* Super fast pmap_pte routine best used when scanning
* the pv lists. This eliminates many coarse-grained
* invltlb calls. Note that many of the pv list
OpenPOWER on IntegriCloud