Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64 move {dump, print}_[id]tlb() into a separate...



details:   https://anonhg.NetBSD.org/src/rev/3c44021e329c
branches:  trunk
changeset: 752315:3c44021e329c
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Feb 22 22:28:57 2010 +0000

description:
move {dump,print}_[id]tlb() into a separate file.

diffstat:

 sys/arch/sparc64/conf/files.sparc64      |    7 +-
 sys/arch/sparc64/sparc64/db_tlb_access.S |  246 +++++++++++++++++++++++++++++++
 sys/arch/sparc64/sparc64/locore.s        |  217 +---------------------------
 3 files changed, 251 insertions(+), 219 deletions(-)

diffs (truncated from 510 to 300 lines):

diff -r a52b205502b0 -r 3c44021e329c sys/arch/sparc64/conf/files.sparc64
--- a/sys/arch/sparc64/conf/files.sparc64       Mon Feb 22 21:32:55 2010 +0000
+++ b/sys/arch/sparc64/conf/files.sparc64       Mon Feb 22 22:28:57 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.sparc64,v 1.123 2010/01/12 14:45:50 martin Exp $
+#      $NetBSD: files.sparc64,v 1.124 2010/02/22 22:28:58 mrg Exp $
 
 # @(#)files.sparc64    8.1 (Berkeley) 7/19/93
 # sparc64-specific configuration info
@@ -198,7 +198,7 @@
 file   arch/sparc64/sparc64/intr.c
 file   arch/sparc64/sparc64/kgdb_machdep.c     kgdb
 file   arch/sparc64/sparc64/kobj_machdep.c     modular
-# sparc/sparc/locore.s is handled specially in the makefile,
+# sparc64/sparc64/locore.s is handled specially in the makefile,
 # because it must come first in the "ld" command line.
 file   arch/sparc64/sparc64/machdep.c
 file   arch/sparc64/sparc64/process_machdep.c
@@ -216,8 +216,9 @@
 file   arch/sparc64/sparc64/lock_stubs.s
 
 file   arch/sparc64/sparc64/db_interface.c     ddb | kgdb
-file   arch/sparc64/sparc64/db_trace.c ddb
+file   arch/sparc64/sparc64/db_trace.c         ddb
 file   arch/sparc64/sparc64/db_disasm.c        ddb
+file   arch/sparc64/sparc64/db_tlb_access.S    ddb
 
 # USB Support
 include "dev/usb/files.usb"
diff -r a52b205502b0 -r 3c44021e329c sys/arch/sparc64/sparc64/db_tlb_access.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sparc64/sparc64/db_tlb_access.S  Mon Feb 22 22:28:57 2010 +0000
@@ -0,0 +1,246 @@
+/*     $NetBSD: db_tlb_access.S,v 1.1 2010/02/22 22:28:58 mrg Exp $    */
+
+/*
+ * Copyright (c) 1996-2002 Eduardo Horvath
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR  ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR  BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include "opt_ddb.h"
+
+#include <machine/ctlreg.h>
+#include <machine/asm.h>
+
+#ifdef DDB
+!!!
+!!! Dump the DTLB to phys address in %o0 and print it
+!!!
+!!! Only toast a few %o registers
+!!!
+
+ENTRY_NOPROFILE(dump_dtlb)
+       clr     %o1
+       add     %o1, (64 * 8), %o3              ! XXX TLB_SIZE
+1:
+       ldxa    [%o1] ASI_DMMU_TLB_TAG, %o2
+       membar  #Sync
+       stx     %o2, [%o0]
+       membar  #Sync
+       inc     8, %o0
+       ldxa    [%o1] ASI_DMMU_TLB_DATA, %o4
+       membar  #Sync
+       inc     8, %o1
+       stx     %o4, [%o0]
+       cmp     %o1, %o3
+       membar  #Sync
+       bl      1b
+        inc    8, %o0
+
+       retl
+        nop
+
+ENTRY_NOPROFILE(dump_itlb)
+       clr     %o1
+       add     %o1, (64 * 8), %o3              ! XXX TLB_SIZE
+1:
+       ldxa    [%o1] ASI_IMMU_TLB_TAG, %o2
+       membar  #Sync
+       stx     %o2, [%o0]
+       membar  #Sync
+       inc     8, %o0
+       ldxa    [%o1] ASI_IMMU_TLB_DATA, %o4
+       membar  #Sync
+       inc     8, %o1
+       stx     %o4, [%o0]
+       cmp     %o1, %o3
+       membar  #Sync
+       bl      1b
+        inc    8, %o0
+
+       retl
+        nop
+
+#ifdef _LP64
+ENTRY_NOPROFILE(print_dtlb)
+       save    %sp, -CC64FSZ, %sp
+       clr     %l1
+       add     %l1, (64 * 8), %l3              ! XXX TLB_SIZE
+       clr     %l2
+1:
+       ldxa    [%l1] ASI_DMMU_TLB_TAG, %o2
+       membar  #Sync
+       mov     %l2, %o1
+       ldxa    [%l1] ASI_DMMU_TLB_DATA, %o3
+       membar  #Sync
+       inc     %l2
+       set     2f, %o0
+       call    _C_LABEL(db_printf)
+        inc    8, %l1
+
+       ldxa    [%l1] ASI_DMMU_TLB_TAG, %o2
+       membar  #Sync
+       mov     %l2, %o1
+       ldxa    [%l1] ASI_DMMU_TLB_DATA, %o3
+       membar  #Sync
+       inc     %l2
+       set     3f, %o0
+       call    _C_LABEL(db_printf)
+        inc    8, %l1
+
+       cmp     %l1, %l3
+       bl      1b
+        inc    8, %l0
+
+       ret
+        restore
+
+
+ENTRY_NOPROFILE(print_itlb)
+       save    %sp, -CC64FSZ, %sp
+       clr     %l1
+       add     %l1, (64 * 8), %l3              ! XXX TLB_SIZE
+       clr     %l2
+1:
+       ldxa    [%l1] ASI_IMMU_TLB_TAG, %o2
+       membar  #Sync
+       mov     %l2, %o1
+       ldxa    [%l1] ASI_IMMU_TLB_DATA, %o3
+       membar  #Sync
+       inc     %l2
+       set     2f, %o0
+       call    _C_LABEL(db_printf)
+        inc    8, %l1
+
+       ldxa    [%l1] ASI_IMMU_TLB_TAG, %o2
+       membar  #Sync
+       mov     %l2, %o1
+       ldxa    [%l1] ASI_IMMU_TLB_DATA, %o3
+       membar  #Sync
+       inc     %l2
+       set     3f, %o0
+       call    _C_LABEL(db_printf)
+        inc    8, %l1
+
+       cmp     %l1, %l3
+       bl      1b
+        inc    8, %l0
+
+       ret
+        restore
+
+       .data
+2:
+       .asciz  "%2d:%016lx %016lx "
+3:
+       .asciz  "%2d:%016lx %016lx\r\n"
+       .text
+#else
+ENTRY_NOPROFILE(print_dtlb)
+       save    %sp, -CC64FSZ, %sp
+       clr     %l1
+       add     %l1, (64 * 8), %l3              ! XXX TLB_SIZE
+       clr     %l2
+1:
+       ldxa    [%l1] ASI_DMMU_TLB_TAG, %o2
+       membar  #Sync
+       srl     %o2, 0, %o3
+       mov     %l2, %o1
+       srax    %o2, 32, %o2
+       ldxa    [%l1] ASI_DMMU_TLB_DATA, %o4
+       membar  #Sync
+       srl     %o4, 0, %o5
+       inc     %l2
+       srax    %o4, 32, %o4
+       set     2f, %o0
+       call    _C_LABEL(db_printf)
+        inc    8, %l1
+
+       ldxa    [%l1] ASI_DMMU_TLB_TAG, %o2
+       membar  #Sync
+       srl     %o2, 0, %o3
+       mov     %l2, %o1
+       srax    %o2, 32, %o2
+       ldxa    [%l1] ASI_DMMU_TLB_DATA, %o4
+       membar  #Sync
+       srl     %o4, 0, %o5
+       inc     %l2
+       srax    %o4, 32, %o4
+       set     3f, %o0
+       call    _C_LABEL(db_printf)
+        inc    8, %l1
+
+       cmp     %l1, %l3
+       bl      1b
+        inc    8, %l0
+
+       ret
+        restore
+
+ENTRY_NOPROFILE(print_itlb)
+       save    %sp, -CC64FSZ, %sp
+       clr     %l1
+       add     %l1, (64 * 8), %l3              ! XXX TLB_SIZE
+       clr     %l2
+1:
+       ldxa    [%l1] ASI_IMMU_TLB_TAG, %o2
+       membar  #Sync
+       srl     %o2, 0, %o3
+       mov     %l2, %o1
+       srax    %o2, 32, %o2
+       ldxa    [%l1] ASI_IMMU_TLB_DATA, %o4
+       membar  #Sync
+       srl     %o4, 0, %o5
+       inc     %l2
+       srax    %o4, 32, %o4
+       set     2f, %o0
+       call    _C_LABEL(db_printf)
+        inc    8, %l1
+
+       ldxa    [%l1] ASI_IMMU_TLB_TAG, %o2
+       membar  #Sync
+       srl     %o2, 0, %o3
+       mov     %l2, %o1
+       srax    %o2, 32, %o2
+       ldxa    [%l1] ASI_IMMU_TLB_DATA, %o4
+       membar  #Sync
+       srl     %o4, 0, %o5
+       inc     %l2
+       srax    %o4, 32, %o4
+       set     3f, %o0
+       call    _C_LABEL(db_printf)
+        inc    8, %l1
+
+       cmp     %l1, %l3
+       bl      1b
+        inc    8, %l0
+
+       ret
+        restore
+
+       .data
+2:
+       .asciz  "%2d:%08x:%08x %08x:%08x "
+3:
+       .asciz  "%2d:%08x:%08x %08x:%08x\r\n"
+       .text
+#endif
+#endif
diff -r a52b205502b0 -r 3c44021e329c sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Mon Feb 22 21:32:55 2010 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Mon Feb 22 22:28:57 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.318 2010/02/22 00:16:31 mrg Exp $ */
+/*     $NetBSD: locore.s,v 1.319 2010/02/22 22:28:57 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -4333,221 +4333,6 @@
        .globl  _C_LABEL(endtrapcode)
 _C_LABEL(endtrapcode):
 
-#ifdef DDB
-!!!
-!!! Dump the DTLB to phys address in %o0 and print it
-!!!
-!!! Only toast a few %o registers
-!!!
-
-ENTRY_NOPROFILE(dump_dtlb)



Home | Main Index | Thread Index | Old Index