From 4fb4310cdabdf5a1054be0bd3f5a793c5198bbc6 Mon Sep 17 00:00:00 2001 From: Steve Murphree Date: Mon, 27 Sep 1999 20:30:33 +0000 Subject: This gets us to 2.6... --- sys/arch/mvme68k/dev/bug.c | 16 +- sys/arch/mvme68k/dev/vme.h | 6 +- sys/arch/mvme68k/mvme68k/disksubr.c | 311 +++++++++++++++++++--------------- sys/arch/mvme68k/mvme68k/dkbad.c | 5 +- sys/arch/mvme68k/mvme68k/machdep.c | 18 +- sys/arch/mvme68k/mvme68k/mem.c | 12 +- sys/arch/mvme68k/mvme68k/pmap.c | 26 ++- sys/arch/mvme68k/mvme68k/trap.c | 7 +- sys/arch/mvme68k/mvme68k/vm_machdep.c | 25 +-- 9 files changed, 236 insertions(+), 190 deletions(-) diff --git a/sys/arch/mvme68k/dev/bug.c b/sys/arch/mvme68k/dev/bug.c index c463bf3a0a8..340ee115917 100644 --- a/sys/arch/mvme68k/dev/bug.c +++ b/sys/arch/mvme68k/dev/bug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bug.c,v 1.3 1996/04/28 11:03:18 deraadt Exp $ */ +/* $OpenBSD: bug.c,v 1.4 1999/09/27 20:30:31 smurph Exp $ */ /* * Copyright (c) 1995 Dale Rahn. @@ -45,7 +45,7 @@ char bug_inchr() { int s = splhigh(); - char a; + volatile char a; promcall = 1; asm volatile ("subql #2,sp"); @@ -62,7 +62,7 @@ int bug_instat() { int s = splhigh(); - short ret; + volatile short ret; promcall = 1; MVMEPROM_CALL(MVMEPROM_INSTAT); @@ -126,7 +126,7 @@ int bug_diskrd(arg) bug_dskio *arg; { - int ret; + volatile int ret; promcall = 1; bug_drdcnt++; @@ -137,13 +137,14 @@ bug_diskrd(arg) promcall = 0; return (!(ret & 0x4)); } + /* returns 0: success, nonzero: error */ u_int bug_dwrcnt = 0; int bug_diskwr(arg) bug_dskio *arg; { - int ret; + volatile int ret; promcall = 1; bug_dwrcnt ++; @@ -246,3 +247,8 @@ asm_bug_stat() asm volatile ("movl _asm_callbuf+8,d0"); asm volatile ("movl _asm_callbuf+12,d1"); } + + + + + diff --git a/sys/arch/mvme68k/dev/vme.h b/sys/arch/mvme68k/dev/vme.h index 94a84ff714c..32cdaa4aa45 100644 --- a/sys/arch/mvme68k/dev/vme.h +++ b/sys/arch/mvme68k/dev/vme.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.h,v 1.5 1996/12/11 21:04:14 deraadt Exp $ */ +/* $OpenBSD: vme.h,v 1.6 1999/09/27 20:30:31 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -226,6 +226,10 @@ struct vme2reg { /*58*/ volatile u_long vme2_t2cmp; /*5c*/ volatile u_long vme2_t2count; /*60*/ volatile u_long vme2_tctl; +#define VME2_TCTL_CEN 0x01 +#define VME2_TCTL_COC 0x02 +#define VME2_TCTL_COVF 0x04 +#define VME2_TCTL_OVF 0xf0 #define VME2_TCTL_SCON 0x40000000 /* we are SCON */ #define VME2_TCTL_SYSFAIL 0x20000000 /* light SYSFAIL led */ #define VME2_TCTL_SRST 0x00800000 /* system reset */ diff --git a/sys/arch/mvme68k/mvme68k/disksubr.c b/sys/arch/mvme68k/mvme68k/disksubr.c index b3379f82675..71ec5656a30 100644 --- a/sys/arch/mvme68k/mvme68k/disksubr.c +++ b/sys/arch/mvme68k/mvme68k/disksubr.c @@ -1,6 +1,6 @@ -/* $OpenBSD: disksubr.c,v 1.18 1999/01/08 04:29:07 millert Exp $ */ - +/* $OpenBSD: disksubr.c,v 1.19 1999/09/27 20:30:31 smurph Exp $ */ /* + * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. * All rights reserved. * @@ -77,18 +77,9 @@ dk_establish(dk, dev) strncmp("cd", dev->dv_xname, 2) == 0) { sbsc = (struct scsibus_softc *)dev->dv_parent; - if (cputyp == CPU_147) { - target = bootctrllun % 8; /* XXX: 147 only */ - lun = bootdevlun; /* XXX: 147, untested */ - } else { - /* - * XXX: on the 167: - * ignore bootctrllun - */ - target = bootdevlun / 10; - lun = bootdevlun % 10; - } - + target = bootdevlun / 10; + lun = bootdevlun % 10; + if (sbsc->sc_link[target][lun] != NULL && sbsc->sc_link[target][lun]->device_softc == (void *)dev) { bootdv = dev; @@ -97,6 +88,7 @@ dk_establish(dk, dev) } } + /* * Attempt to read a disk label from a device * using the indicated stategy routine. @@ -105,6 +97,7 @@ dk_establish(dk, dev) * (e.g., sector size) must be filled in before calling us. * Returns null on success and an error string on failure. */ + char * readdisklabel(dev, strat, lp, clp, spoofonly) dev_t dev; @@ -167,6 +160,56 @@ readdisklabel(dev, strat, lp, clp, spoofonly) return (msg); } +#if 0 +char * +readdisklabel(dev, strat, lp, clp) + dev_t dev; + void (*strat)(); + struct disklabel *lp; + struct cpu_disklabel *clp; +{ + struct buf *bp; + char *msg = NULL; + + /* obtain buffer to probe drive with */ + bp = geteblk((int)lp->d_secsize); + + /* request no partition relocation by driver on I/O operations */ + bp->b_dev = dev; + bp->b_blkno = 0; /* contained in block 0 */ + bp->b_bcount = lp->d_secsize; + bp->b_flags = B_BUSY | B_READ; + bp->b_cylin = 0; /* contained in block 0 */ + (*strat)(bp); + + if (biowait(bp)) { + msg = "cpu_disklabel read error\n"; + }else { + bcopy(bp->b_data, clp, sizeof (struct cpu_disklabel)); + } + + bp->b_flags = B_INVAL | B_AGE | B_READ; + brelse(bp); + + if (msg || clp->magic1 != DISKMAGIC || clp->magic2 != DISKMAGIC) { +#if defined(CD9660) + if (iso_disklabelspoof(dev, strat, lp) == 0) + msg = NULL; +#endif + return (msg); + } + + cputobsdlabel(lp, clp); +#ifdef DEBUG + if(disksubr_debug > 0) { + printlp(lp, "readdisklabel:bsd label"); + printclp(clp, "readdisklabel:cpu label"); + } +#endif + return (msg); +} + +#endif /* 0 */ /* * Check new disk label for sensibility * before setting it. @@ -286,19 +329,26 @@ writedisklabel(dev, strat, lp, clp) } #endif - /* obtain buffer to scrozz drive with */ - bp = geteblk((int)lp->d_secsize); - bcopy(clp, bp->b_data, sizeof(struct cpu_disklabel)); - /* request no partition relocation by driver on I/O operations */ - bp->b_dev = dev; - bp->b_blkno = 0; /* contained in block 0 */ - bp->b_bcount = lp->d_secsize; - bp->b_flags = B_WRITE; - bp->b_cylin = 0; /* contained in block 0 */ - (*strat)(bp); - error = biowait(bp); - bp->b_flags = B_INVAL | B_AGE | B_READ; - brelse(bp); + if (lp->d_magic == DISKMAGIC && lp->d_magic2 == DISKMAGIC && + dkcksum(lp) == 0) { + /* obtain buffer to scrozz drive with */ + bp = geteblk((int)lp->d_secsize); + + bcopy(clp, bp->b_data, sizeof(struct cpu_disklabel)); + + /* request no partition relocation by driver on I/O operations */ + bp->b_dev = dev; + bp->b_blkno = 0; /* contained in block 0 */ + bp->b_bcount = lp->d_secsize; + bp->b_flags = B_WRITE; + bp->b_cylin = 0; /* contained in block 0 */ + (*strat)(bp); + + error = biowait(bp); + + bp->b_flags = B_INVAL | B_AGE | B_READ; + brelse(bp); + } return (error); } @@ -341,7 +391,7 @@ bounds_check_with_label(bp, lp, osdep, wlabel) bp->b_resid = bp->b_bcount; return(0); } - if (sz < 0) { + if (sz <= 0) { bp->b_error = EINVAL; goto bad; } @@ -501,149 +551,138 @@ cputobsdlabel(lp, clp) struct cpu_disklabel *clp; { int i; - struct disklabel llp; - struct disklabel *nlp = &llp; - bzero (&llp, sizeof (llp)); if (clp->version == 0) { struct cpu_disklabel_old *clpo = (void *) clp; - nlp->d_magic = clpo->magic1; - nlp->d_type = clpo->type; - nlp->d_subtype = clpo->subtype; - strncpy(nlp->d_typename, clpo->vid_vd, 16); - strncpy(nlp->d_packname, clpo->packname, 16); - nlp->d_secsize = clpo->cfg_psm; - nlp->d_nsectors = clpo->cfg_spt; - nlp->d_ncylinders = clpo->cfg_trk; /* trk is really num of cyl! */ - nlp->d_ntracks = clpo->cfg_hds; - nlp->d_secpercyl = clpo->secpercyl; - nlp->d_secperunit = clpo->secperunit; - nlp->d_secpercyl = clpo->secpercyl; - nlp->d_secperunit = clpo->secperunit; - nlp->d_sparespertrack = clpo->sparespertrack; - nlp->d_sparespercyl = clpo->sparespercyl; - nlp->d_acylinders = clpo->acylinders; - nlp->d_rpm = clpo->rpm; - nlp->d_interleave = clpo->cfg_ilv; - nlp->d_trackskew = clpo->cfg_sof; - nlp->d_cylskew = clpo->cylskew; - nlp->d_headswitch = clpo->headswitch; +#ifdef DEBUG + if (disksubr_debug > 0) { + printf("Reading old disklabel\n"); + } +#endif + lp->d_magic = clp->magic1; + lp->d_type = clp->type; + lp->d_subtype = clp->subtype; + strncpy(lp->d_typename, clp->vid_vd, 16); + strncpy(lp->d_packname, clp->packname, 16); + lp->d_secsize = clp->cfg_psm; + lp->d_nsectors = clp->cfg_spt; + lp->d_ncylinders = clp->cfg_trk; /* trk is really num of cyl! */ + lp->d_ntracks = clp->cfg_hds; + + lp->d_secpercyl = clp->secpercyl; + lp->d_secperunit = clp->secperunit; + lp->d_secpercyl = clp->secpercyl; + lp->d_secperunit = clp->secperunit; + lp->d_sparespertrack = clp->sparespertrack; + lp->d_sparespercyl = clp->sparespercyl; + lp->d_acylinders = clp->acylinders; + lp->d_rpm = clp->rpm; + lp->d_interleave = clp->cfg_ilv; + lp->d_trackskew = clp->cfg_sof; + lp->d_cylskew = clp->cylskew; + lp->d_headswitch = clp->headswitch; + /* this silly table is for winchester drives */ - switch (clpo->cfg_ssr) { + switch (clp->cfg_ssr) { case 0: - nlp->d_trkseek = 0; + lp->d_trkseek = 0; break; case 1: - nlp->d_trkseek = 6; + lp->d_trkseek = 6; break; case 2: - nlp->d_trkseek = 10; + lp->d_trkseek = 10; break; case 3: - nlp->d_trkseek = 15; + lp->d_trkseek = 15; break; case 4: - nlp->d_trkseek = 20; + lp->d_trkseek = 20; break; default: - nlp->d_trkseek = 0; + lp->d_trkseek = 0; } - nlp->d_flags = clpo->flags; + lp->d_flags = clp->flags; for (i = 0; i < NDDATA; i++) - nlp->d_drivedata[i] = clpo->drivedata[i]; + lp->d_drivedata[i] = clp->drivedata[i]; for (i = 0; i < NSPARE; i++) - nlp->d_spare[i] = clpo->spare[i]; - - nlp->d_magic2 = clpo->magic2; - nlp->d_checksum = clpo->checksum; - nlp->d_npartitions = clpo->partitions; - nlp->d_bbsize = clpo->bbsize; - nlp->d_sbsize = clpo->sbsize; - bcopy(clpo->vid_4, &nlp->d_partitions[0], sizeof(struct partition) * 4); - bcopy(clpo->cfg_4, &nlp->d_partitions[4], sizeof(struct partition) * 12); -#if 0 - nlp->d_checksum = 0; - nlp->d_checksum = dkcksum(nlp); -#endif + lp->d_spare[i] = clp->spare[i]; + + lp->d_magic2 = clp->magic2; + lp->d_checksum = clp->checksum; + lp->d_npartitions = clp->partitions; + lp->d_bbsize = clp->bbsize; + lp->d_sbsize = clp->sbsize; + bcopy(clp->vid_4, &lp->d_partitions[0], sizeof(struct partition) * 4); + bcopy(clp->cfg_4, &lp->d_partitions[4], sizeof(struct partition) * 12); + lp->d_checksum = 0; + lp->d_checksum = dkcksum(lp); } else { - nlp->d_magic = clp->magic1; - nlp->d_type = clp->type; - nlp->d_subtype = clp->subtype; - strncpy(nlp->d_typename, clp->vid_vd, 16); - strncpy(nlp->d_packname, clp->packname, 16); - nlp->d_secsize = clp->cfg_psm; - nlp->d_nsectors = clp->cfg_spt; - nlp->d_ncylinders = clp->cfg_trk; /* trk is really num of cyl! */ - nlp->d_ntracks = clp->cfg_hds; - - nlp->d_secpercyl = clp->secpercyl; - nlp->d_secperunit = clp->secperunit; - nlp->d_secpercyl = clp->secpercyl; - nlp->d_secperunit = clp->secperunit; - nlp->d_sparespertrack = clp->sparespertrack; - nlp->d_sparespercyl = clp->sparespercyl; - nlp->d_acylinders = clp->acylinders; - nlp->d_rpm = clp->rpm; - nlp->d_interleave = clp->cfg_ilv; - nlp->d_trackskew = clp->cfg_sof; - nlp->d_cylskew = clp->cylskew; - nlp->d_headswitch = clp->headswitch; +#ifdef DEBUG + if (disksubr_debug > 0) { + printf("Reading new disklabel\n"); + } +#endif + lp->d_magic = clp->magic1; + lp->d_type = clp->type; + lp->d_subtype = clp->subtype; + strncpy(lp->d_typename, clp->vid_vd, 16); + strncpy(lp->d_packname, clp->packname, 16); + lp->d_secsize = clp->cfg_psm; + lp->d_nsectors = clp->cfg_spt; + lp->d_ncylinders = clp->cfg_trk; /* trk is really num of cyl! */ + lp->d_ntracks = clp->cfg_hds; + + lp->d_secpercyl = clp->secpercyl; + lp->d_secperunit = clp->secperunit; + lp->d_secpercyl = clp->secpercyl; + lp->d_secperunit = clp->secperunit; + lp->d_sparespertrack = clp->sparespertrack; + lp->d_sparespercyl = clp->sparespercyl; + lp->d_acylinders = clp->acylinders; + lp->d_rpm = clp->rpm; + lp->d_interleave = clp->cfg_ilv; + lp->d_trackskew = clp->cfg_sof; + lp->d_cylskew = clp->cylskew; + lp->d_headswitch = clp->headswitch; /* this silly table is for winchester drives */ switch (clp->cfg_ssr) { case 0: - nlp->d_trkseek = 0; + lp->d_trkseek = 0; break; case 1: - nlp->d_trkseek = 6; + lp->d_trkseek = 6; break; case 2: - nlp->d_trkseek = 10; + lp->d_trkseek = 10; break; case 3: - nlp->d_trkseek = 15; + lp->d_trkseek = 15; break; case 4: - nlp->d_trkseek = 20; + lp->d_trkseek = 20; break; default: - nlp->d_trkseek = 0; + lp->d_trkseek = 0; } - nlp->d_flags = clp->flags; + lp->d_flags = clp->flags; for (i = 0; i < NDDATA; i++) - nlp->d_drivedata[i] = clp->drivedata[i]; + lp->d_drivedata[i] = clp->drivedata[i]; for (i = 0; i < NSPARE; i++) - nlp->d_spare[i] = clp->spare[i]; - - nlp->d_magic2 = clp->magic2; - nlp->d_checksum = clp->checksum; - nlp->d_npartitions = clp->partitions; - nlp->d_bbsize = clp->bbsize; - nlp->d_sbsize = clp->sbsize; - bcopy(clp->vid_4, &nlp->d_partitions[0], sizeof(struct partition) * 4); - bcopy(clp->cfg_4, &nlp->d_partitions[4], sizeof(struct partition) * 12); -#if 0 - nlp->d_checksum = 0; - nlp->d_checksum = dkcksum(nlp); -#endif - } - { - int oldcksum; - - oldcksum = nlp->d_checksum; - nlp->d_checksum = 0; -#ifdef DEBUG -printf("old chksum = %x new %x\n", oldcksum, dkcksum(nlp)); - printlp(nlp, "lp disklabel"); - printclp(clp, "clp disklabel"); -#endif - if ((nlp->d_magic == DISKMAGIC) && (oldcksum == dkcksum(nlp))) { - nlp->d_checksum = oldcksum; - bcopy (nlp, lp, sizeof (*lp)); - } + lp->d_spare[i] = clp->spare[i]; + + lp->d_magic2 = clp->magic2; + lp->d_checksum = clp->checksum; + lp->d_npartitions = clp->partitions; + lp->d_bbsize = clp->bbsize; + lp->d_sbsize = clp->sbsize; + bcopy(clp->vid_4, &lp->d_partitions[0], sizeof(struct partition) * 4); + bcopy(clp->cfg_4, &lp->d_partitions[4], sizeof(struct partition) * 12); + lp->d_checksum = 0; + lp->d_checksum = dkcksum(lp); } - -#ifdef DEBUG +#if DEBUG if (disksubr_debug > 0) { printlp(lp, "translated label read from disk\n"); } @@ -682,10 +721,6 @@ printclp(clp, str) { int max, i; - if (clp->version == 0) { - printf("cannot print old version cpudisklabel\n"); - return; - } printf("%s\n", str); printf("magic1 %x\n", clp->magic1); printf("magic2 %x\n", clp->magic2); diff --git a/sys/arch/mvme68k/mvme68k/dkbad.c b/sys/arch/mvme68k/mvme68k/dkbad.c index 9d0de666038..1295aadc15c 100644 --- a/sys/arch/mvme68k/mvme68k/dkbad.c +++ b/sys/arch/mvme68k/mvme68k/dkbad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dkbad.c,v 1.4 1999/07/20 03:23:05 csapuntz Exp $ */ +/* $OpenBSD: dkbad.c,v 1.5 1999/09/27 20:30:32 smurph Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -45,6 +45,9 @@ * the specified sector. Return index if found. * Return -1 if not found. */ +#ifndef NBT_BAD +#define NBT_BAD 126 +#endif isbad(bt, cyl, trk, sec) register struct dkbad *bt; diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c index 5d9f4b2f353..9287013541f 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.28 1999/09/03 18:01:21 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.29 1999/09/27 20:30:32 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -226,10 +226,11 @@ cpu_startup() * avail_end was pre-decremented in pmap_bootstrap to compensate. */ for (i = 0; i < btoc(sizeof (struct msgbuf)); i++) - pmap_enter(pmap_kernel(), (vm_offset_t)msgbufp, - avail_end + i * NBPG, VM_PROT_READ|VM_PROT_WRITE, TRUE, - VM_PROT_READ|VM_PROT_WRITE); - msgbufmapped = 1; + pmap_enter(pmap_kernel(), (vm_offset_t)msgbufp, + avail_end + i * NBPG, VM_PROT_READ|VM_PROT_WRITE, + TRUE, VM_PROT_READ|VM_PROT_WRITE); + + msgbufmapped = 1; /* * Good {morning,afternoon,evening,night}. @@ -905,13 +906,6 @@ netintr() pppintr(); } #endif -#include "bridge.h" -#if NBRIDGE > 0 - if (netisr & (1 << NETISR_BRIDGE)) { - netisr &= ~(1 << NETISR_BRIDGE); - bridgeintr(); - } -#endif } /* diff --git a/sys/arch/mvme68k/mvme68k/mem.c b/sys/arch/mvme68k/mvme68k/mem.c index 1208b59d1fa..3288aeb681c 100644 --- a/sys/arch/mvme68k/mvme68k/mem.c +++ b/sys/arch/mvme68k/mvme68k/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.7 1999/09/03 18:01:22 art Exp $ */ +/* $OpenBSD: mem.c,v 1.8 1999/09/27 20:30:32 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -160,9 +160,13 @@ mmrw(dev, uio, flags) goto unlock; } #endif - pmap_enter(pmap_kernel(), (vm_offset_t)vmmap, - trunc_page(v), uio->uio_rw == UIO_READ ? - VM_PROT_READ : VM_PROT_WRITE, TRUE, 0); + + pmap_enter(pmap_kernel(), (vm_offset_t)vmmap, + trunc_page(v), + uio->uio_rw == UIO_READ ? VM_PROT_READ : VM_PROT_WRITE, + TRUE, + uio->uio_rw == UIO_READ ? VM_PROT_READ : VM_PROT_WRITE); + 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/mvme68k/mvme68k/pmap.c b/sys/arch/mvme68k/mvme68k/pmap.c index d28b0a87d3b..621c71644ed 100644 --- a/sys/arch/mvme68k/mvme68k/pmap.c +++ b/sys/arch/mvme68k/mvme68k/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.12 1999/09/03 18:01:23 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.13 1999/09/27 20:30:32 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -751,7 +751,7 @@ pmap_map(va, spa, epa, prot) #endif while (spa < epa) { - pmap_enter(pmap_kernel(), va, spa, prot, FALSE, 0); + pmap_enter(pmap_kernel(), va, spa, prot, FALSE, prot); va += NBPG; spa += NBPG; } @@ -1155,14 +1155,15 @@ pmap_protect(pmap, sva, eva, prot) * or lose information. That is, this routine must actually * insert this page into the given map NOW. */ + void pmap_enter(pmap, va, pa, prot, wired, access_type) register pmap_t pmap; - vm_offset_t va; - register vm_offset_t pa; + vaddr_t va; + register paddr_t pa; vm_prot_t prot; boolean_t wired; - vm_prot_t access_type; + vm_prot_t access_type; { register pt_entry_t *pte; register int npte; @@ -1172,8 +1173,8 @@ pmap_enter(pmap, va, pa, prot, wired, access_type) #ifdef DEBUG if (pmapdebug & (PDB_FOLLOW|PDB_ENTER)) - printf("pmap_enter(%x, %x, %x, %x, %x)\n", - pmap, va, pa, prot, wired); + printf("pmap_enter(%x, %x, %x, %x, %x, %x)\n", + pmap, va, pa, prot, wired, access_type); #endif if (pmap == NULL) return; @@ -1700,8 +1701,7 @@ pmap_zero_page(phys) printf("pmap_zero_page(%x)\n", phys); #endif kva = (vm_offset_t) CADDR1; - pmap_enter(pmap_kernel(), kva, phys, VM_PROT_READ|VM_PROT_WRITE, TRUE, - 0); + pmap_enter(pmap_kernel(), kva, phys, VM_PROT_READ|VM_PROT_WRITE, TRUE, VM_PROT_READ|VM_PROT_WRITE); zeropage((caddr_t)kva); pmap_remove_mapping(pmap_kernel(), kva, PT_ENTRY_NULL, PRM_TFLUSH|PRM_CFLUSH); @@ -1733,9 +1733,8 @@ pmap_copy_page(src, dst) #endif skva = (vm_offset_t) CADDR1; dkva = (vm_offset_t) CADDR2; - pmap_enter(pmap_kernel(), skva, src, VM_PROT_READ, TRUE, 0); - pmap_enter(pmap_kernel(), dkva, dst, VM_PROT_READ|VM_PROT_WRITE, TRUE, - 0); + pmap_enter(pmap_kernel(), skva, src, VM_PROT_READ, TRUE, VM_PROT_READ); + pmap_enter(pmap_kernel(), dkva, dst, VM_PROT_READ|VM_PROT_WRITE, TRUE, VM_PROT_READ|VM_PROT_WRITE); copypage((caddr_t)skva, (caddr_t)dkva); /* CADDR1 and CADDR2 are virtually contiguous */ pmap_remove(pmap_kernel(), skva, skva + (2 * NBPG)); @@ -2421,8 +2420,7 @@ pmap_enter_ptpage(pmap, va) kpt_used_list = kpt; ptpa = kpt->kpt_pa; bzero((caddr_t)kpt->kpt_va, NBPG); - pmap_enter(pmap, va, ptpa, VM_PROT_DEFAULT, TRUE, - VM_PROT_DEFAULT); + pmap_enter(pmap, va, ptpa, VM_PROT_DEFAULT, TRUE, VM_PROT_DEFAULT); #ifdef DEBUG if (pmapdebug & (PDB_ENTER|PDB_PTPAGE)) { int ix = pmap_ste(pmap, va) - pmap_ste(pmap, 0); diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c index 751d5262f7a..65a105f9c46 100644 --- a/sys/arch/mvme68k/mvme68k/trap.c +++ b/sys/arch/mvme68k/mvme68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.21 1999/09/03 18:01:23 art Exp $ */ +/* $OpenBSD: trap.c,v 1.22 1999/09/27 20:30:32 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -720,8 +720,7 @@ writeback(fp, docachepush) */ if (docachepush) { pmap_enter(pmap_kernel(), (vm_offset_t)vmmap, - trunc_page(f->f_fa), VM_PROT_WRITE, TRUE, - VM_PROT_WRITE); + trunc_page(f->f_fa), VM_PROT_WRITE, TRUE, VM_PROT_WRITE); fa = (u_int)&vmmap[(f->f_fa & PGOFSET) & ~0xF]; bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16); DCFL(pmap_extract(pmap_kernel(), (vm_offset_t)fa)); @@ -947,7 +946,7 @@ dumpwb(num, s, a, d) num, a, d, f7sz[(s & SSW4_SZMASK) >> 5], f7tt[(s & SSW4_TTMASK) >> 3], f7tm[s & SSW4_TMMASK]); printf(" PA "); - pa = pmap_extract(p->p_vmspace->vm_map.pmap, (vm_offset_t)a); + pa = pmap_extract(&p->p_vmspace->vm_pmap, (vm_offset_t)a); if (pa == 0) printf(""); else diff --git a/sys/arch/mvme68k/mvme68k/vm_machdep.c b/sys/arch/mvme68k/mvme68k/vm_machdep.c index e3d08aa8a75..1722b359ce4 100644 --- a/sys/arch/mvme68k/mvme68k/vm_machdep.c +++ b/sys/arch/mvme68k/mvme68k/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.13 1999/09/03 18:01:24 art Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.14 1999/09/27 20:30:32 smurph Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -66,11 +66,12 @@ * address in each process; in the future we will probably relocate * the frame pointers on the stack after copying. */ + void cpu_fork(p1, p2, stack, stacksize) register struct proc *p1, *p2; - void *stack; - size_t stacksize; + void *stack; + size_t stacksize; { register struct pcb *pcb = &p2->p_addr->u_pcb; register struct trapframe *tf; @@ -82,7 +83,7 @@ cpu_fork(p1, p2, stack, stacksize) savectx(curpcb); *pcb = p1->p_addr->u_pcb; - PMAP_ACTIVATE(p2->p_vmspace->vm_map.pmap, pcb, 0); + PMAP_ACTIVATE(&p2->p_vmspace->vm_pmap, pcb, 0); /* * Copy the trap frame, and arrange for the child to return directly @@ -91,15 +92,16 @@ cpu_fork(p1, p2, stack, stacksize) tf = (struct trapframe *)((u_int)p2->p_addr + USPACE) - 1; p2->p_md.md_regs = (int *)tf; *tf = *(struct trapframe *)p1->p_md.md_regs; - - /* + + /* * If specified, give the child a different stack. */ if (stack != NULL) tf->tf_regs[15] = (u_int)stack + stacksize; - - sf = (struct switchframe *)tf - 1; + + sf = (struct switchframe *)tf - 1; sf->sf_pc = (u_int)proc_trampoline; + pcb->pcb_regs[6] = (int)child_return; /* A2 */ pcb->pcb_regs[7] = (int)p2; /* A3 */ pcb->pcb_regs[11] = (int)sf; /* SSP */ @@ -184,8 +186,9 @@ pagemove(from, to, size) pmap_remove(pmap_kernel(), (vm_offset_t)from, (vm_offset_t)from + PAGE_SIZE); pmap_enter(pmap_kernel(), - (vm_offset_t)to, pa, VM_PROT_READ|VM_PROT_WRITE, 1, - VM_PROT_READ|VM_PROT_WRITE); + (vm_offset_t)to, pa, + VM_PROT_READ|VM_PROT_WRITE, 1, + VM_PROT_READ|VM_PROT_WRITE); from += PAGE_SIZE; to += PAGE_SIZE; size -= PAGE_SIZE; @@ -294,7 +297,7 @@ vmapbuf(bp, siz) if (pa == 0) panic("vmapbuf: null page frame"); pmap_enter(vm_map_pmap(phys_map), kva, trunc_page(pa), - VM_PROT_READ|VM_PROT_WRITE, TRUE, 0); + VM_PROT_READ|VM_PROT_WRITE, TRUE, VM_PROT_READ|VM_PROT_WRITE); addr += PAGE_SIZE; kva += PAGE_SIZE; } -- cgit v1.2.3