Kernel message buffer implemented.

This commit is contained in:
ragge 1995-05-06 00:08:28 +00:00
parent 8951a20fe2
commit 372dd89e62
2 changed files with 38 additions and 43 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.11 1995/05/03 19:20:15 ragge Exp $ */
/* $NetBSD: machdep.c,v 1.12 1995/05/06 00:08:28 ragge Exp $ */
/* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
* Copyright (c) 1993 Adam Glass
@ -46,16 +46,7 @@
*/
#include "sys/param.h"
#include "vax/include/sid.h"
#include "sys/map.h"
#include "buf.h"
#include "mbuf.h"
#include "vax/include/pte.h"
#include "uba.h"
#include "reboot.h"
#include "sys/callout.h"
#include "sys/device.h"
#include "conf.h"
#include "sys/proc.h"
#include "sys/user.h"
#include "sys/time.h"
@ -63,16 +54,12 @@
#include "sys/kernel.h"
#include "sys/reboot.h"
#include "sys/msgbuf.h"
#include "vax/include/mtpr.h"
#include "vax/include/cpu.h"
#include "vm/vm.h"
#include "vm/vm_kern.h"
#include "vm/vm_page.h"
#include "vax/include/macros.h"
#include "vax/include/nexus.h"
#include "vax/include/trap.h"
#include "machine/reg.h"
#include "net/netisr.h"
#include "sys/buf.h"
#include "sys/mbuf.h"
#include "sys/reboot.h"
#include "sys/conf.h"
#include "sys/callout.h"
#include "sys/device.h"
#ifdef SYSVMSG
#include "sys/msg.h"
#endif
@ -82,6 +69,16 @@
#ifdef SYSVSHM
#include "sys/shm.h"
#endif
#include "machine/sid.h"
#include "machine/pte.h"
#include "machine/mtpr.h"
#include "machine/cpu.h"
#include "machine/macros.h"
#include "machine/nexus.h"
#include "machine/trap.h"
#include "machine/reg.h"
#include "vm/vm_kern.h"
#include "net/netisr.h"
/*
* We do these external declarations here, maybe they should be done
@ -128,15 +125,10 @@ cpu_startup() {
extern char *panicstr;
/*
* Initialize error message buffer (at end of core).
* avail_end was pre-decremented in pmap_bootstrap to compensate.
* Initialize error message buffer.
*/
#if 0
for (i = 0; i < btoc(sizeof (struct msgbuf)); i++)
pmap_enter(kernel_pmap, (vm_offset_t)msgbufp,
avail_end + i * NBPG, VM_PROT_ALL, TRUE);
msgbufmapped = 1;
#endif
#ifdef VAX750
if(cpunumber==VAX_750)
if(!mfpr(PR_TODR))
@ -147,9 +139,9 @@ cpu_startup() {
*/
printf("%s\n", version);
printf("realmem = %d\n", avail_end);
physmem=btoc(avail_end);
panicstr=NULL;
mtpr(AST_NO,PR_ASTLVL);
physmem = btoc(avail_end);
panicstr = NULL;
mtpr(AST_NO, PR_ASTLVL);
spl0();
dumpsize=physmem+1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.11 1995/05/05 10:47:39 ragge Exp $ */
/* $NetBSD: pmap.c,v 1.12 1995/05/06 00:08:31 ragge Exp $ */
#define DEBUG
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -109,25 +109,27 @@ pmap_bootstrap()
extern u_int sigcode, esigcode, proc0paddr;
struct pmap *p0pmap=&vmspace0.vm_pmap;
vm_offset_t pend=0;
#define ROUND_PAGE(x) (((uint)(x)+PAGE_SIZE-1)& ~(PAGE_SIZE-1))
#define ROUND_PAGE(x) (((uint)(x) + PAGE_SIZE-1)& ~(PAGE_SIZE - 1))
/* These are in phys memory */
istack=ROUND_PAGE((uint)Sysmap+SYSPTSIZE*4);
(u_int)scratch=istack+ISTACK_SIZE;
mtpr(scratch,PR_ISP); /* set interrupt stack pointer */
pv_table=(struct pv_entry *)(scratch+NBPG*4);
istack = ROUND_PAGE((uint)Sysmap + SYSPTSIZE * 4);
(u_int)scratch = istack + ISTACK_SIZE;
mtpr(scratch, PR_ISP); /* set interrupt stack pointer */
msgbufp = (void *)(scratch + NBPG * 4);
(u_int)pv_table = (int)ROUND_PAGE(sizeof(struct msgbuf)) +
(u_int)msgbufp;
/* Count up phys memory */
while(!badaddr(pend,4))
pend+=NBPG*128;
while (!badaddr(pend, 4))
pend += NBPG * 128;
#if VAX630
if (cpu_type == VAX_630)
pend -= 8 * NBPG; /* Avoid console scratchpad */
#endif
/* These are virt only */
vmmap=ROUND_PAGE(pv_table+(pend/PAGE_SIZE));
(u_int)Numem=vmmap+NBPG*2;
vmmap = ROUND_PAGE(pv_table + (pend / PAGE_SIZE));
(u_int)Numem = vmmap + NBPG * 2;
(pt_entry_t *)UMEMmap=kvtopte(Numem);
(pt_entry_t *)pte_cmap=kvtopte(vmmap);
@ -159,7 +161,9 @@ pmap_bootstrap()
pmap_map(istack+NBPG,istack+NBPG,(vm_offset_t)scratch,
VM_PROT_READ|VM_PROT_WRITE);
pmap_map((vm_offset_t)scratch,(vm_offset_t)scratch,
(vm_offset_t)pv_table,VM_PROT_READ|VM_PROT_WRITE);
(vm_offset_t)msgbufp, VM_PROT_READ|VM_PROT_WRITE);
pmap_map((vm_offset_t)msgbufp, (vm_offset_t)msgbufp,
(vm_offset_t)pv_table, VM_PROT_ALL);
pmap_map((vm_offset_t)pv_table,(vm_offset_t)pv_table,vmmap,
VM_PROT_READ|VM_PROT_WRITE);
@ -207,8 +211,7 @@ pmap_init(s, e)
pte_map=kmem_suballoc(kernel_map, &ptemapstart, &ptemapend,
USRPTSIZE*4, TRUE); /* Don't allow paging yet */
#ifdef DEBUG
if(startpmapdebug) printf("pmap_init: pte_map ptemapstart %x, ptemapend %x,
ptemapsize %x\n", ptemapstart, ptemapend, USRPTSIZE*4);
if(startpmapdebug) printf("pmap_init: pte_map ptemapstart %x, ptemapend %x, ptemapsize %x\n", ptemapstart, ptemapend, USRPTSIZE*4);
#endif
}