mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
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
This commit is contained in:
parent
4ee026279c
commit
1d6ccf9cd6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19503
@ -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"
|
||||
@ -202,17 +202,6 @@ cpu_startup(dummy)
|
||||
if (boothowto & RB_VERBOSE)
|
||||
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}.
|
||||
*/
|
||||
@ -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) ;
|
||||
|
@ -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 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -213,6 +213,24 @@ static int pmap_unuse_pt __P((pmap_t, vm_offset_t, vm_page_t));
|
||||
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.
|
||||
*
|
||||
@ -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
|
||||
@ -454,24 +475,6 @@ get_ptbase(pmap)
|
||||
return (unsigned *) APTmap;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
@ -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"
|
||||
@ -202,17 +202,6 @@ cpu_startup(dummy)
|
||||
if (boothowto & RB_VERBOSE)
|
||||
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}.
|
||||
*/
|
||||
@ -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) ;
|
||||
|
@ -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 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -213,6 +213,24 @@ static int pmap_unuse_pt __P((pmap_t, vm_offset_t, vm_page_t));
|
||||
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.
|
||||
*
|
||||
@ -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
|
||||
@ -454,24 +475,6 @@ get_ptbase(pmap)
|
||||
return (unsigned *) APTmap;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user