summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/amiga/amiga/genassym.cf7
-rw-r--r--sys/arch/amiga/amiga/locore.s53
-rw-r--r--sys/arch/amiga/amiga/pmap.c14
-rw-r--r--sys/arch/amiga/amiga/vm_machdep.c8
-rw-r--r--sys/arch/amiga/include/pcb.h4
-rw-r--r--sys/arch/amiga/include/pmap.h9
6 files changed, 24 insertions, 71 deletions
diff --git a/sys/arch/amiga/amiga/genassym.cf b/sys/arch/amiga/amiga/genassym.cf
index 6635ae9791e..b64d5cfff93 100644
--- a/sys/arch/amiga/amiga/genassym.cf
+++ b/sys/arch/amiga/amiga/genassym.cf
@@ -1,5 +1,5 @@
# $NetBSD: genassym.cf,v 1.3 1997/07/16 00:01:49 is Exp $
-# $OpenBSD: genassym.cf,v 1.4 2000/05/27 19:46:49 art Exp $
+# $OpenBSD: genassym.cf,v 1.5 2000/05/28 03:55:21 art Exp $
#
# Copyright (c) 1982, 1990, 1993
# The Regents of the University of California. All rights reserved.
@@ -110,10 +110,6 @@ define P_MD_REGS offsetof(struct proc, p_md.md_regs)
define SRUN SRUN
-# VM structure fields
-define PM_STCHG offsetof(struct pmap, pm_stchanged)
-define VM_PMAP offsetof(struct vmspace, vm_map.pmap)
-
# interrupt/fault metering
ifdef UVM
define UVMEXP_INTRS offsetof(struct uvmexp, intrs)
@@ -169,7 +165,6 @@ define PG_FRAME PG_FRAME
# pcb fields
define PCB_FLAGS offsetof(struct pcb, pcb_flags)
define PCB_PS offsetof(struct pcb, pcb_ps)
-define PCB_USTP offsetof(struct pcb, pcb_ustp)
define PCB_USP offsetof(struct pcb, pcb_usp)
define PCB_REGS offsetof(struct pcb, pcb_regs)
define PCB_CMAP2 offsetof(struct pcb, pcb_cmap2)
diff --git a/sys/arch/amiga/amiga/locore.s b/sys/arch/amiga/amiga/locore.s
index fc578a22961..5db4275ae7c 100644
--- a/sys/arch/amiga/amiga/locore.s
+++ b/sys/arch/amiga/amiga/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.27 2000/05/27 20:14:18 art Exp $ */
+/* $OpenBSD: locore.s,v 1.28 2000/05/28 03:55:21 art Exp $ */
/* $NetBSD: locore.s,v 1.89 1997/07/17 16:22:54 is Exp $ */
/*
@@ -1378,51 +1378,18 @@ Lswnofpsave:
movl a1,_curpcb
movb a1@(PCB_FLAGS+1),pcbflag | copy of pcb_flags low byte
- /* see if pmap_activate needs to be called; should remove this */
- movl a0@(P_VMSPACE),a2 | vmspace = p->p_vmspace
-#ifdef DIAGNOSTIC
- tstl a2 | map == VM_MAP_NULL?
- jeq Lbadsw | panic
-#endif
- movl a2@(VM_PMAP),a2 | pmap = vmspace->vm_map.pmap
- tstl a2@(PM_STCHG) | pmap->st_changed?
- jeq Lswnochg | no, skip
+ /*
+ * Activate process's address space.
+ * XXX Should remember the last USTP value loaded, and call this
+ * XXX only if it has changed.
+ */
pea a0@ | push proc
jbsr _pmap_activate | pmap_activate(p)
addql #4,sp
movl _curpcb,a1 | restore p_addr
-Lswnochg:
+
lea tmpstk,sp | now goto a tmp stack for NMI
- cmpl #MMU_68040,_mmutype
- jeq Lres2
- movl #CACHE_CLR,d0
- movc d0,cacr | invalidate cache(s)
- pflusha | flush entire TLB
- jra Lres3
-Lres2:
- .word 0xf518 | pflusha (68040)
-| movl #CACHE40_ON,d0
-| movc d0,cacr | invalidate cache(s)
-#ifdef M68060
- btst #7,_machineid+3
- jeq Lres3
- movc cacr,d2
- orl #IC60_CUBC,d2 | clear user branch cache entries
- movc d2,cacr
-#endif
-Lres3:
- movl a1@(PCB_USTP),d0 | get USTP
- moveq #PGSHIFT,d1
- lsll d1,d0 | convert to addr
- cmpl #MMU_68040,_mmutype
- jeq Lres4
- lea _protorp,a0 | CRP prototype
- movl d0,a0@(4) | stash USTP
- pmove a0@,crp | load new user root pointer
- jra Lres5
-Lres4:
- .word 0x4e7b,0x0806 | movc d0,URP
-Lres5:
+
movl a1@(PCB_CMAP2),_CMAP2 | reload tmp map
moveml a1@(PCB_REGS),#0xFCFC | and registers
movl a1@(PCB_USP),a0
@@ -1884,10 +1851,11 @@ ENTRY(loadustp)
#endif
cmpl #MMU_68040,_mmutype
jeq Lldustp040
+ pflusha | flush entire TLB
lea _protorp,a0 | CRP prototype
movl d0,a0@(4) | stash USTP
pmove a0@,crp | load root pointer
- movl #DC_CLEAR,d0
+ movl #CACHE_CLR,d0
movc d0,cacr | invalidate on-chip d-cache
rts | since pmove flushes TLB
#ifdef M68060
@@ -1897,6 +1865,7 @@ Lldustp060:
movc d1,cacr
#endif
Lldustp040:
+ .word 0xf518
.word 0x4e7b,0x0806 | movec d0,URP
rts
diff --git a/sys/arch/amiga/amiga/pmap.c b/sys/arch/amiga/amiga/pmap.c
index 2d75a191881..20d87deefd6 100644
--- a/sys/arch/amiga/amiga/pmap.c
+++ b/sys/arch/amiga/amiga/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.21 2000/05/27 22:12:33 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.22 2000/05/28 03:55:21 art Exp $ */
/* $NetBSD: pmap.c,v 1.39 1997/06/10 18:26:41 veego Exp $ */
/*
@@ -948,7 +948,6 @@ pmap_pinit(pmap)
if (mmutype == MMU_68040)
pmap->pm_stfree = protostfree;
#endif
- pmap->pm_stchanged = TRUE;
pmap->pm_count = 1;
simple_lock_init(&pmap->pm_lock);
}
@@ -1259,16 +1258,13 @@ pmap_remove(pmap, sva, eva)
ptpmap->pm_stfree =
protostfree;
#endif
- ptpmap->pm_stchanged = TRUE;
/*
* XXX may have changed segment table
* pointer for current process so
* update now to reload hardware.
*/
if (active_user_pmap(ptpmap))
- PMAP_ACTIVATE(ptpmap,
- (struct pcb *)
- &curproc->p_addr->u_pcb, 1);
+ PMAP_ACTIVATE(ptpmap, 1);
}
}
if (ptpmap == pmap_kernel())
@@ -2002,14 +1998,13 @@ void
pmap_activate(p)
struct proc *p;
{
- struct pcb *pcb = &p->p_addr->u_pcb;
pmap_t pmap = p->p_vmspace->vm_map.pmap;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_SEGTAB))
printf("pmap_activate(%p)\n", p);
#endif
- PMAP_ACTIVATE(pmap, pcb, p == curproc);
+ PMAP_ACTIVATE(pmap, p == curproc);
}
/*
@@ -2414,13 +2409,12 @@ pmap_enter_ptpage(pmap, va)
pmap->pm_stfree = protostfree;
}
#endif
- pmap->pm_stchanged = TRUE;
/*
* XXX may have changed segment table pointer for current
* process so update now to reload hardware.
*/
if (active_user_pmap(pmap))
- PMAP_ACTIVATE(pmap, &curproc->p_addr->u_pcb, 1);
+ PMAP_ACTIVATE(pmap, 1);
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
printf("enter_pt: pmap %p stab %p(%p)\n", pmap,
diff --git a/sys/arch/amiga/amiga/vm_machdep.c b/sys/arch/amiga/amiga/vm_machdep.c
index 16f1ddb4f78..c9d782fe27a 100644
--- a/sys/arch/amiga/amiga/vm_machdep.c
+++ b/sys/arch/amiga/amiga/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.12 2000/05/27 21:21:19 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.13 2000/05/28 03:55:21 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/05/19 10:14:50 veego Exp $ */
/*
@@ -93,8 +93,6 @@ cpu_fork(p1, p2, stack, stacksize)
savectx(curpcb);
*pcb = p1->p_addr->u_pcb;
- PMAP_ACTIVATE(p2->p_vmspace->vm_map.pmap, pcb, 0);
-
/*
* Copy the trap frame, and arrange for the child to return directly
* through return_to_user(). Note the inline cpu_set_kpc();
@@ -392,7 +390,7 @@ vmapbuf(bp, sz)
p = bp->b_proc;
npf = btoc(round_page(bp->b_bcount + off));
#if defined(UVM)
- kva = uvm_km_valloc_wait(phys_map, len);
+ kva = uvm_km_valloc_wait(phys_map, ctob(npf));
#else
kva = kmem_alloc_wait(phys_map, ctob(npf));
#endif
@@ -428,7 +426,7 @@ vunmapbuf(bp, sz)
npf = btoc(round_page(bp->b_bcount + ((int)addr & PGOFSET)));
kva = (vm_offset_t)((int)addr & ~PGOFSET);
#if defined(UVM)
- uvm_km_free_wakeup(phys_map, kva, len);
+ uvm_km_free_wakeup(phys_map, kva, ctob(npf));
#else
kmem_free_wakeup(phys_map, kva, ctob(npf));
#endif
diff --git a/sys/arch/amiga/include/pcb.h b/sys/arch/amiga/include/pcb.h
index 79988a800c5..efcd17f9ba4 100644
--- a/sys/arch/amiga/include/pcb.h
+++ b/sys/arch/amiga/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.2 1997/01/16 09:25:59 niklas Exp $ */
+/* $OpenBSD: pcb.h,v 1.3 2000/05/28 03:55:21 art Exp $ */
/* $NetBSD: pcb.h,v 1.9 1995/05/11 23:05:57 chopps Exp $ */
/*
@@ -54,7 +54,7 @@ struct pcb
{
short pcb_flags; /* misc. process flags (+0) */
short pcb_ps; /* processor status word (+2) */
- int pcb_ustp; /* user segment table pointer (+4) */
+ int __pcb_spare0;
int pcb_usp; /* user stack pointer (+8) */
int pcb_regs[12]; /* D2-D7, A2-A7 (+C) */
int pcb_cmap2; /* temporary copy PTE */
diff --git a/sys/arch/amiga/include/pmap.h b/sys/arch/amiga/include/pmap.h
index 7ca76f2f778..f4eb15b8bb1 100644
--- a/sys/arch/amiga/include/pmap.h
+++ b/sys/arch/amiga/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.5 2000/05/27 20:14:18 art Exp $ */
+/* $OpenBSD: pmap.h,v 1.6 2000/05/28 03:55:21 art Exp $ */
/* $NetBSD: pmap.h,v 1.17 1997/06/10 18:34:52 veego Exp $ */
/*
@@ -49,7 +49,6 @@
struct pmap {
pt_entry_t *pm_ptab; /* KVA of page table */
st_entry_t *pm_stab; /* KVA of segment table */
- int pm_stchanged; /* ST changed */
int pm_stfree; /* 040: free lev2 blocks */
u_int *pm_stpa; /* 040: ST phys addr */
short pm_sref; /* segment table ref count */
@@ -80,12 +79,10 @@ typedef struct pmap *pmap_t;
/*
* Macros for speed
*/
-#define PMAP_ACTIVATE(pmap, pcb, loadhw) \
+#define PMAP_ACTIVATE(pmap, loadhw) \
{ \
- (pcb)->pcb_ustp = m68k_btop((vm_offset_t)(pmap)->pm_stpa); \
if ((loadhw)) \
- loadustp((pcb)->pcb_ustp); \
- (pmap)->pm_stchanged = FALSE; \
+ loadustp(m68k_btop((pmap)->pm_stpa)); \
}
/*