Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mac68k Use m68k/m68k/cacheops.[ch]



details:   https://anonhg.NetBSD.org/src/rev/121b7ffab857
branches:  trunk
changeset: 525337:121b7ffab857
user:      briggs <briggs%NetBSD.org@localhost>
date:      Wed Apr 10 04:38:48 2002 +0000

description:
Use m68k/m68k/cacheops.[ch]
Use m68k/m68k/bus_dma.c
        - Add mainbus_attach_args with bus_space_tag_t and bus_dma_tag_t.
        - Use passed-in tags for nubus scan.

diffstat:

 sys/arch/mac68k/conf/files.mac68k  |    5 +-
 sys/arch/mac68k/include/autoconf.h |    9 +-
 sys/arch/mac68k/include/bus.h      |    4 +-
 sys/arch/mac68k/include/cpu.h      |   22 +---
 sys/arch/mac68k/mac68k/locore.s    |  215 +-----------------------------------
 sys/arch/mac68k/mac68k/mainbus.c   |   33 +++++-
 sys/arch/mac68k/nubus/nubus.c      |    7 +-
 sys/arch/mac68k/nubus/nubus.h      |    3 +-
 8 files changed, 61 insertions(+), 237 deletions(-)

diffs (truncated from 466 to 300 lines):

diff -r 1197f9c79d5f -r 121b7ffab857 sys/arch/mac68k/conf/files.mac68k
--- a/sys/arch/mac68k/conf/files.mac68k Wed Apr 10 04:36:20 2002 +0000
+++ b/sys/arch/mac68k/conf/files.mac68k Wed Apr 10 04:38:48 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.mac68k,v 1.102 2002/01/21 21:57:04 jdolecek Exp $
+#      $NetBSD: files.mac68k,v 1.103 2002/04/10 04:38:48 briggs Exp $
 
 # mac68k-specific configuration info
 
@@ -142,6 +142,9 @@
 file   arch/m68k/m68k/db_memrw.c       ddb | kgdb
 include "arch/m68k/fpe/files.fpe"
 
+file   arch/m68k/m68k/bus_dma.c
+file   arch/m68k/m68k/cacheops.c
+
 # legitimate pseudo-devices
 defpseudo grf
 defpseudo ite
diff -r 1197f9c79d5f -r 121b7ffab857 sys/arch/mac68k/include/autoconf.h
--- a/sys/arch/mac68k/include/autoconf.h        Wed Apr 10 04:36:20 2002 +0000
+++ b/sys/arch/mac68k/include/autoconf.h        Wed Apr 10 04:38:48 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.h,v 1.7 1998/12/22 08:47:06 scottr Exp $      */
+/*     $NetBSD: autoconf.h,v 1.8 2002/04/10 04:38:49 briggs Exp $      */
 
 /*
  * Copyright (c) 1994 Gordon W. Ross
@@ -34,11 +34,18 @@
 
 #include <sys/device.h>
 
+#include <machine/bus.h>
+
 /*
  * Autoconfiguration information.
  * From sun3 port--adapted for mac68k platform by Allen Briggs.
  */
 
+struct mainbus_attach_args {
+       bus_space_tag_t mba_bst;
+       bus_dma_tag_t   mba_dmat;
+};
+
 /* autoconf.c */
 void   setconf __P((void));
 
diff -r 1197f9c79d5f -r 121b7ffab857 sys/arch/mac68k/include/bus.h
--- a/sys/arch/mac68k/include/bus.h     Wed Apr 10 04:36:20 2002 +0000
+++ b/sys/arch/mac68k/include/bus.h     Wed Apr 10 04:38:48 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.19 2002/04/09 01:53:47 briggs Exp $  */
+/*     $NetBSD: bus.h,v 1.20 2002/04/10 04:38:49 briggs Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -786,4 +786,6 @@
 
 #define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
 
+#include <m68k/bus_dma.h>
+
 #endif /* _MAC68K_BUS_H_ */
diff -r 1197f9c79d5f -r 121b7ffab857 sys/arch/mac68k/include/cpu.h
--- a/sys/arch/mac68k/include/cpu.h     Wed Apr 10 04:36:20 2002 +0000
+++ b/sys/arch/mac68k/include/cpu.h     Wed Apr 10 04:38:48 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.69 2002/03/04 16:58:37 shiba Exp $   */
+/*     $NetBSD: cpu.h,v 1.70 2002/04/10 04:38:49 briggs Exp $  */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -77,6 +77,7 @@
  */
 #include <m68k/cpu.h>
 #define        M68K_MMU_MOTOROLA
+#include <m68k/cacheops.h>
 
 /*
  * Get interrupt glue.
@@ -327,25 +328,6 @@
 /* locore.s functions */
 void   m68881_save __P((struct fpframe *));
 void   m68881_restore __P((struct fpframe *));
-void   DCIA __P((void));
-void   DCIS __P((void));
-void   DCIU __P((void));
-void   ICIA __P((void));
-void   ICPA __P((void));
-void   PCIA __P((void));
-void   TBIA __P((void));
-void   TBIS __P((vaddr_t));
-void   TBIAS __P((void));
-void   TBIAU __P((void));
-#if defined(M68040)
-void   DCFA __P((void));
-void   DCFP __P((paddr_t));
-void   DCFL __P((paddr_t));
-void   DCPL __P((paddr_t));
-void   DCPP __P((paddr_t));
-void   ICPL __P((paddr_t));
-void   ICPP __P((paddr_t));
-#endif
 int    suline __P((caddr_t, caddr_t));
 void   savectx __P((struct pcb *));
 void   switch_exit __P((struct proc *));
diff -r 1197f9c79d5f -r 121b7ffab857 sys/arch/mac68k/mac68k/locore.s
--- a/sys/arch/mac68k/mac68k/locore.s   Wed Apr 10 04:36:20 2002 +0000
+++ b/sys/arch/mac68k/mac68k/locore.s   Wed Apr 10 04:38:48 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.138 2002/02/11 10:44:39 wiz Exp $ */
+/*     $NetBSD: locore.s,v 1.139 2002/04/10 04:38:49 briggs Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -316,9 +316,9 @@
        movl    %a1,_C_LABEL(curpcb)    | proc0 is running
 
 /* flush TLB and turn on caches */
-       jbsr    _C_LABEL(TBIA)          | invalidate TLB
        cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jeq     Lnocache0               | yes, cache already on
+       jeq     Ltbia040                | yes, cache already on
+       pflusha
        movl    #CACHE_ON,%d0
        movc    %d0,%cacr               | clear cache(s)
 #ifdef __notyet__
@@ -326,6 +326,10 @@
        jeq     Lnocache0
                                        | Enable external cache here
 #endif
+       jra     Lnocache0
+
+Ltbia040:
+       .word   0xf518                  | pflusha
 
 Lnocache0:
 /* Final setup for call to main(). */
@@ -1230,211 +1234,6 @@
        rts
 #endif
 
-/*
- * Invalidate entire TLB.
- */
-ENTRY(TBIA)
-#if defined(M68040)
-       cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jne     Lmotommu3               | no, skip
-       .word   0xf518                  | yes, pflusha
-       rts
-Lmotommu3:
-#endif
-       pflusha
-#if defined(M68020)
-       tstl    _C_LABEL(mmutype)
-       jgt     Ltbia851
-#endif
-       movl    #DC_CLEAR,%d0
-       movc    %d0,%cacr               | invalidate on-chip d-cache
-Ltbia851:
-       rts
-
-/*
- * Invalidate any TLB entry for given VA (TB Invalidate Single)
- */
-ENTRY(TBIS)
-#ifdef DEBUG
-       tstl    _ASM_LABEL(fulltflush)  | being conservative?
-       jne     _C_LABEL(TBIA)          | yes, flush entire TLB
-#endif
-       movl    %sp@(4),%a0
-#if defined(M68040)
-       cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jne     Lmotommu4               | no, skip
-       movc    %dfc,%d1
-       moveq   #FC_USERD,%d0           | user space
-       movc    %d0,%dfc
-       .word   0xf508                  | pflush %a0@
-       moveq   #FC_SUPERD,%d0          | supervisor space
-       movc    %d0,%dfc
-       .word   0xf508                  | pflush %a0@
-       movc    %d1,%dfc
-       rts
-Lmotommu4:
-#endif
-#if defined(M68020)
-       tstl    _C_LABEL(mmutype)
-       jle     Ltbis851
-       pflushs #0,#0,%a0@              | flush address from both sides
-       rts
-Ltbis851:
-#endif
-       pflush  #0,#0,%a0@              | flush address from both sides
-       movl    #DC_CLEAR,%d0
-       movc    %d0,%cacr               | invalidate on-chip data cache
-       rts
-
-/*
- * Invalidate supervisor side of TLB
- */
-ENTRY(TBIAS)
-#ifdef DEBUG
-       tstl    _ASM_LABEL(fulltflush)  | being conservative?
-       jne     _C_LABEL(TBIA)          | yes, flush everything
-#endif
-#if defined(M68040)
-       cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jne     Lmotommu5               | no, skip
-       .word   0xf518                  | yes, pflusha (for now) XXX
-       rts
-Lmotommu5:
-#endif
-#if defined(M68020)
-       tstl    _C_LABEL(mmutype)
-       jle     Ltbias851
-       pflushs #4,#4                   | flush supervisor TLB entries
-       rts
-Ltbias851:
-#endif
-       pflush  #4,#4                   | flush supervisor TLB entries
-       movl    #DC_CLEAR,%d0
-       movc    %d0,%cacr               | invalidate on-chip d-cache
-       rts
-
-/*
- * Invalidate user side of TLB
- */
-ENTRY(TBIAU)
-#ifdef DEBUG
-       tstl    _ASM_LABEL(fulltflush)  | being conservative?
-       jne     _C_LABEL(TBIA)          | yes, flush everything
-#endif
-#if defined(M68040)
-       cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jne     Lmotommu6               | no, skip
-       .word   0xf518                  | yes, pflusha (for now) XXX
-Lmotommu6:
-#endif
-#if defined(M68020)
-       tstl    _C_LABEL(mmutype)
-       jle     Ltbiau851
-       pflush  #0,#4                   | flush user TLB entries
-       rts
-Ltbiau851:
-#endif
-       pflush  #0,#4                   | flush user TLB entries
-       movl    #DC_CLEAR,%d0
-       movc    %d0,%cacr               | invalidate on-chip d-cache
-       rts
-
-/*
- * Invalidate instruction cache
- */
-ENTRY(ICIA)
-#if defined(M68040)
-ENTRY(ICPA)
-       cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jne     Lmotommu7               | no, skip
-       .word   0xf498                  | cinva ic
-       rts
-Lmotommu7:
-#endif
-       movl    #IC_CLEAR,%d0
-       movc    %d0,%cacr               | invalidate i-cache
-       rts
-
-/*
- * Invalidate data cache.
- * NOTE: we do not flush 68030 on-chip cache as there are no aliasing
- * problems with DC_WA.  The only cases we have to worry about are context
- * switch and TLB changes, both of which are handled "in-line" in resume
- * and TBI*.
- */
-ENTRY(DCIA)
-__DCIA:
-#if defined(M68040)
-       cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jne     Lmotommu8               | no, skip
-       .word   0xf478                  | cpusha dc
-Lmotommu8:
-#endif
-       rts
-
-ENTRY(DCIS)
-__DCIS:
-#if defined(M68040)
-       cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jne     Lmotommu9               | no, skip
-       .word   0xf478                  | cpusha dc
-Lmotommu9:
-#endif
-       rts
-
-ENTRY(DCIU)
-__DCIU:
-#if defined(M68040)
-       cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
-       jne     LmotommuA               | no, skip
-       .word   0xf478                  | cpusha dc



Home | Main Index | Thread Index | Old Index