From 06a1b17660d364238e1cee868cd7f56e6e6c3bde Mon Sep 17 00:00:00 2001 From: todd Date: Thu, 2 Mar 2000 23:02:14 +0000 Subject: [PATCH] sun3 is alive, thanks to Miod Vallat add ksyms, proto fix, msgbuf --- sys/arch/sun3/sun3/conf.c | 5 +++-- sys/arch/sun3/sun3/machdep.c | 4 +--- sys/arch/sun3/sun3/mem.c | 4 ++-- sys/arch/sun3/sun3/pmap.c | 5 +---- sys/arch/sun3/sun3/sun3_startup.c | 6 +++--- sys/arch/sun3/sun3/trap.c | 12 ++++++------ sys/arch/sun3/sun3/vm_machdep.c | 12 ++++++------ 7 files changed, 22 insertions(+), 26 deletions(-) diff --git a/sys/arch/sun3/sun3/conf.c b/sys/arch/sun3/sun3/conf.c index 0a738675e0c..7c02f90985f 100644 --- a/sys/arch/sun3/sun3/conf.c +++ b/sys/arch/sun3/sun3/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.23 1998/09/25 09:20:54 todd Exp $ */ +/* $OpenBSD: conf.c,v 1.24 2000/03/02 23:02:14 todd Exp $ */ /* $NetBSD: conf.c,v 1.51 1996/11/04 16:16:09 gwr Exp $ */ /*- @@ -69,6 +69,7 @@ int ttselect __P((dev_t, int, struct proc *)); #include cdev_decl(xfs_dev); #endif +#include "ksyms.h" struct bdevsw bdevsw[] = { @@ -138,7 +139,7 @@ struct cdevsw cdevsw[] = cdev_notdef(), /* 34: floating point accelerator */ cdev_notdef(), /* 35 */ cdev_bpftun_init(NBPFILTER,bpf),/* 36: Berkeley packet filter */ - cdev_notdef(), /* 37 */ + cdev_ksyms_init(NKSYMS,ksyms), /* 37: Kernel symbols device */ cdev_notdef(), /* 38 */ cdev_fb_init(NCGFOUR,cg4), /* 39: cgfour */ cdev_notdef(), /* 40: (sni) */ diff --git a/sys/arch/sun3/sun3/machdep.c b/sys/arch/sun3/sun3/machdep.c index 5c0688a99a2..26d49c789e7 100644 --- a/sys/arch/sun3/sun3/machdep.c +++ b/sys/arch/sun3/sun3/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.24 1999/11/09 14:30:39 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.25 2000/03/02 23:02:14 todd Exp $ */ /* $NetBSD: machdep.c,v 1.77 1996/10/13 03:47:51 christos Exp $ */ /* @@ -103,7 +103,6 @@ extern vm_offset_t vmmap; /* XXX - poor name. See mem.c */ int physmem; int fputype; -int msgbufmapped; label_t *nofault; vm_offset_t vmmap; @@ -711,7 +710,6 @@ dumpsys() daddr_t blkno; int error = 0; - msgbufmapped = 0; if (dumpdev == NODEV) return; if (dumppage_va == 0) diff --git a/sys/arch/sun3/sun3/mem.c b/sys/arch/sun3/sun3/mem.c index 55d49489a47..8f4b28f4f09 100644 --- a/sys/arch/sun3/sun3/mem.c +++ b/sys/arch/sun3/sun3/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.8 1999/11/22 19:22:03 matthieu Exp $ */ +/* $OpenBSD: mem.c,v 1.9 2000/03/02 23:02:14 todd Exp $ */ /* $NetBSD: mem.c,v 1.19 1995/08/08 21:09:01 gwr Exp $ */ /* @@ -172,7 +172,7 @@ mmrw(dev, uio, flags) /* Temporarily map the memory at vmmap. */ pmap_enter(pmap_kernel(), vmmap, trunc_page(v), uio->uio_rw == UIO_READ ? - VM_PROT_READ : VM_PROT_WRITE, TRUE); + VM_PROT_READ : VM_PROT_WRITE, TRUE, 0); o = uio->uio_offset & PGOFSET; c = min(uio->uio_resid, (int)(NBPG - o)); error = uiomove((caddr_t)vmmap + o, c, uio); diff --git a/sys/arch/sun3/sun3/pmap.c b/sys/arch/sun3/sun3/pmap.c index 3a866377b4a..8983cd4bb05 100644 --- a/sys/arch/sun3/sun3/pmap.c +++ b/sys/arch/sun3/sun3/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.18 1999/11/09 14:32:48 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.19 2000/03/02 23:02:14 todd Exp $ */ /* $NetBSD: pmap.c,v 1.64 1996/11/20 18:57:35 gwr Exp $ */ /*- @@ -164,9 +164,6 @@ static vm_offset_t temp_seg_va; #define PMAP_LOCK() s = splpmap() #define PMAP_UNLOCK() splx(s) -#define TAILQ_EMPTY(headp) \ - !((headp)->tqh_first) - #define TAILQ_REMOVE_FIRST(result, headp, entries) \ { \ result = (headp)->tqh_first; \ diff --git a/sys/arch/sun3/sun3/sun3_startup.c b/sys/arch/sun3/sun3/sun3_startup.c index 90ff80a11e7..26674e25c34 100644 --- a/sys/arch/sun3/sun3/sun3_startup.c +++ b/sys/arch/sun3/sun3/sun3_startup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sun3_startup.c,v 1.10 1997/09/07 14:05:21 kstailey Exp $ */ +/* $OpenBSD: sun3_startup.c,v 1.11 2000/03/02 23:02:14 todd Exp $ */ /* $NetBSD: sun3_startup.c,v 1.55 1996/11/20 18:57:38 gwr Exp $ */ /*- @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -89,7 +90,6 @@ int cpu_has_vme = 0; vm_offset_t high_segment_free_start = 0; vm_offset_t high_segment_free_end = 0; -int msgbufmapped = 0; struct msgbuf *msgbufp = NULL; extern vm_offset_t tmp_vpages[]; extern int physmem; @@ -414,7 +414,7 @@ sun3_vm_init(kehp) set_pte(va, pte); /* offset by half a page to avoid PROM scribbles */ msgbufp = (struct msgbuf *)(va + 0x1000); - msgbufmapped = 1; + initmsgbuf((caddr_t)msgbufp, round_page(MSGBUFSIZE)); /* * Virtual and physical pages for proc[0] u-area (already mapped) diff --git a/sys/arch/sun3/sun3/trap.c b/sys/arch/sun3/sun3/trap.c index bc59d8ae546..ea802257caf 100644 --- a/sys/arch/sun3/sun3/trap.c +++ b/sys/arch/sun3/sun3/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.19 1998/08/23 16:53:00 kstailey Exp $ */ +/* $OpenBSD: trap.c,v 1.20 2000/03/02 23:02:14 todd Exp $ */ /* $NetBSD: trap.c,v 1.63-1.65ish 1997/01/16 15:41:40 gwr Exp $ */ /* @@ -762,11 +762,11 @@ syscall(code, frame) */ void child_return(p) - struct proc *p; + void *p; { struct frame *f; - f = (struct frame *)p->p_md.md_regs; + f = (struct frame *)((struct proc *)p)->p_md.md_regs; f->f_regs[D0] = 0; f->f_sr &= ~PSL_C; f->f_format = FMT0; @@ -775,10 +775,10 @@ child_return(p) * Old ticks (3rd arg) is zero so we will charge the child * for any clock ticks that might happen before this point. */ - userret(p, f, 0); + userret((struct proc *)p, f, 0); #ifdef KTRACE - if (KTRPOINT(p, KTR_SYSRET)) - ktrsysret(p->p_tracep, SYS_fork, 0, 0); + if (KTRPOINT((struct proc *)p, KTR_SYSRET)) + ktrsysret(((struct proc *)p)->p_tracep, SYS_fork, 0, 0); #endif } diff --git a/sys/arch/sun3/sun3/vm_machdep.c b/sys/arch/sun3/sun3/vm_machdep.c index b4a68c9889c..cff257308c3 100644 --- a/sys/arch/sun3/sun3/vm_machdep.c +++ b/sys/arch/sun3/sun3/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.10 1999/11/09 14:30:39 art Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.11 2000/03/02 23:02:15 todd Exp $ */ /* $NetBSD: vm_machdep.c,v 1.35 1996/04/26 18:38:06 gwr Exp $ */ /* @@ -161,19 +161,19 @@ cpu_fork(p1, p2, stack, stacksize) * before we "pushed" this call. */ void -cpu_set_kpc(proc, func, arg) - struct proc *proc; - void (*func) __P((void *)); +cpu_set_kpc(prc, func, arg) + struct proc *prc; + void (*func) (void *); void *arg; { struct pcb *pcbp; struct ksigframe { struct switchframe sf; - void (*func)(void *); + void (*func) (void *); void *arg; } *ksfp; - pcbp = &proc->p_addr->u_pcb; + pcbp = &prc->p_addr->u_pcb; /* Push a ksig frame onto the kernel stack. */ ksfp = (struct ksigframe *)pcbp->pcb_regs[11] - 1; -- 2.20.1