Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/arch/sparc64 Pullup by patch [eeh]:



details:   https://anonhg.NetBSD.org/src/rev/9b0b8a5daf86
branches:  netbsd-1-5
changeset: 489905:9b0b8a5daf86
user:      tv <tv%NetBSD.org@localhost>
date:      Wed Oct 18 16:31:27 2000 +0000

description:
Pullup by patch [eeh]:
Move KERNBASE from 0xf1000000 to 0x01000000.

diffstat:

 sys/arch/sparc64/conf/Makefile.sparc64      |   12 +-
 sys/arch/sparc64/include/cpu.h              |    4 +-
 sys/arch/sparc64/include/param.h            |   12 +-
 sys/arch/sparc64/include/vmparam.h          |   25 ++-
 sys/arch/sparc64/sparc64/db_trace.c         |   73 ++++++---
 sys/arch/sparc64/sparc64/locore.s           |  193 +++++++++++++++++++--------
 sys/arch/sparc64/sparc64/machdep.c          |    9 +-
 sys/arch/sparc64/sparc64/netbsd32_machdep.c |    6 +-
 sys/arch/sparc64/sparc64/trap.c             |   17 +-
 9 files changed, 234 insertions(+), 117 deletions(-)

diffs (truncated from 879 to 300 lines):

diff -r c9b82be5911a -r 9b0b8a5daf86 sys/arch/sparc64/conf/Makefile.sparc64
--- a/sys/arch/sparc64/conf/Makefile.sparc64    Wed Oct 18 16:23:57 2000 +0000
+++ b/sys/arch/sparc64/conf/Makefile.sparc64    Wed Oct 18 16:31:27 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.sparc64,v 1.26.2.2 2000/08/07 01:25:25 mrg Exp $
+#      $NetBSD: Makefile.sparc64,v 1.26.2.3 2000/10/18 16:31:27 tv Exp $
 
 # Makefile for NetBSD
 #
@@ -72,8 +72,14 @@
 CFLAGS += -mcmodel=medlow
 .endif
 AFLAGS=                -x assembler-with-cpp -traditional-cpp -D_LOCORE -Wa,-Av9a
-LINKFLAGS=     -Ttext f1000000 -Tdata f1400000 -e start
-#LINKFLAGS=    -N -Ttext f1000000 -e start
+
+#
+# Gotta find a way to make kernel base tuneable.
+#
+
+LINKFLAGS=     -Ttext 01000000 -Tdata 01400000 -e start
+
+#LINKFLAGS=    -Ttext f1000000 -Tdata f1400000 -e start
 STRIPFLAGS=    -g
 
 %INCLUDES
diff -r c9b82be5911a -r 9b0b8a5daf86 sys/arch/sparc64/include/cpu.h
--- a/sys/arch/sparc64/include/cpu.h    Wed Oct 18 16:23:57 2000 +0000
+++ b/sys/arch/sparc64/include/cpu.h    Wed Oct 18 16:31:27 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.20.2.1 2000/07/18 16:23:22 mrg Exp $ */
+/*     $NetBSD: cpu.h,v 1.20.2.2 2000/10/18 16:31:28 tv Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -219,8 +219,8 @@
        short                   ih_number;      /* interrupt number */
                                                /* the H/W provides */
        char                    ih_pil;         /* interrupt priority */
-       char                    ih_pending;     /* interrupt queued */
        struct intrhand         *ih_next;       /* global list */
+       struct intrhand         *ih_pending;    /* interrupt queued */
        volatile u_int64_t      *ih_map;        /* Interrupt map reg */
        volatile u_int64_t      *ih_clr;        /* clear interrupt reg */
 };
diff -r c9b82be5911a -r 9b0b8a5daf86 sys/arch/sparc64/include/param.h
--- a/sys/arch/sparc64/include/param.h  Wed Oct 18 16:23:57 2000 +0000
+++ b/sys/arch/sparc64/include/param.h  Wed Oct 18 16:31:27 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: param.h,v 1.20.2.1 2000/07/18 16:23:23 mrg Exp $ */
+/*     $NetBSD: param.h,v 1.20.2.2 2000/10/18 16:31:28 tv Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -171,8 +171,8 @@
  * 0x00000000fe000000: IODEV_END -- end of device mapping space.
  *
  */
-#define        KERNBASE        0x0f1000000     /* start of kernel virtual space */
-#define        KERNEND         0x0fe000000     /* end of kernel virtual space */
+#define        KERNBASE        0x001000000     /* start of kernel virtual space */
+#define        KERNEND         0x0e0000000     /* end of kernel virtual space */
 #define        VM_MAX_KERNEL_BUF       ((KERNEND-KERNBASE)/4)
 
 #define _MAXNBPG       8192    /* fixed VAs, independent of actual NBPG */
@@ -184,10 +184,10 @@
  * Here's the location of the interrupt stack and CPU structure.
  */
 #define INTSTACK       (      KERNEND + 8*_MAXNBPG)/* 64K after kernel end */
-#define        EINTSTACK       (     INTSTACK + 2*USPACE)
+#define        EINTSTACK       (     INTSTACK + 2*USPACE)      /* 32KB */
 #define        CPUINFO_VA      (    EINTSTACK)
 #define        IODEV_BASE      (   CPUINFO_VA + 8*_MAXNBPG)/* 64K long */
-#define        IODEV_END       0x0ff000000UL           /* 16 MB of iospace */
+#define        IODEV_END       0x0f0000000UL           /* 16 MB of iospace */
 
 /*
  * Constants related to network buffer management.
@@ -228,7 +228,7 @@
 
 /* pages to bytes */
 #define        ctob(x)         ((x) << PGSHIFT)
-#define        btoc(x)         (((x) + PGOFSET) >> PGSHIFT)
+#define        btoc(x)         (((vsize_t)(x) + PGOFSET) >> PGSHIFT)
 
 /* bytes to disk blocks */
 #define        btodb(x)        ((x) >> DEV_BSHIFT)
diff -r c9b82be5911a -r 9b0b8a5daf86 sys/arch/sparc64/include/vmparam.h
--- a/sys/arch/sparc64/include/vmparam.h        Wed Oct 18 16:23:57 2000 +0000
+++ b/sys/arch/sparc64/include/vmparam.h        Wed Oct 18 16:31:27 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam.h,v 1.10.4.1 2000/07/18 16:23:24 mrg Exp $ */
+/*     $NetBSD: vmparam.h,v 1.10.4.2 2000/10/18 16:31:28 tv Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,18 +45,27 @@
  */
 
 /*
- * Machine dependent constants for Sun-4c SPARC
+ * Machine dependent constants for Sun-4u SPARC
  */
 
+#ifndef VMPARAM_H
+#define VMPARAM_H
+
 /*
  * USRTEXT is the start of the user text/data space, while USRSTACK
  * is the top (end) of the user stack.
  */
 #define        USRTEXT         0x2000                  /* Start of user text */
-#define        USRSTACK        KERNBASE                /* Start of user stack */
+#ifdef __arch64__
+#define USRSTACK       0xffffffffffffe000L
+#else
+#define USRSTACK       0xffffe000L
+#endif
 
 /*
  * Virtual memory related constants, all in bytes
+ *
+ * XXXX -- These need to be updated to 64-bits.
  */
 #ifndef MAXTSIZ
 #define        MAXTSIZ         (64*1024*1024)          /* max text size */
@@ -100,8 +109,9 @@
  * User/kernel map constants.
  */
 #define VM_MIN_ADDRESS         ((vaddr_t)0)
-#define VM_MAX_ADDRESS         ((vaddr_t)KERNBASE)
-#define VM_MAXUSER_ADDRESS     ((vaddr_t)KERNBASE)
+#define VM_MAX_ADDRESS         ((vaddr_t)-1)
+#define VM_MAXUSER_ADDRESS     ((vaddr_t)-1)
+
 #define VM_MIN_KERNEL_ADDRESS  ((vaddr_t)KERNBASE)
 #define VM_MAX_KERNEL_ADDRESS  ((vaddr_t)KERNEND)
 
@@ -116,8 +126,10 @@
  * pmap specific data stored in the vm_physmem[] array
  */
 
+struct pv_entry;
+
 struct pmap_physseg {
-       /* NULL */
+       struct pv_entry *pvent;
 };
 
 #if defined (_KERNEL) && !defined(_LOCORE)
@@ -125,3 +137,4 @@
 vaddr_t                dvma_mapin __P((struct vm_map *, vaddr_t, int, int));
 void           dvma_mapout __P((vaddr_t, vaddr_t, int));
 #endif
+#endif
diff -r c9b82be5911a -r 9b0b8a5daf86 sys/arch/sparc64/sparc64/db_trace.c
--- a/sys/arch/sparc64/sparc64/db_trace.c       Wed Oct 18 16:23:57 2000 +0000
+++ b/sys/arch/sparc64/sparc64/db_trace.c       Wed Oct 18 16:31:27 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_trace.c,v 1.15.2.2 2000/07/31 02:50:53 mrg Exp $ */
+/*     $NetBSD: db_trace.c,v 1.15.2.3 2000/10/18 16:31:29 tv Exp $ */
 
 /*
  * Mach Operating System
@@ -29,7 +29,9 @@
 #include <sys/param.h>
 #include <sys/proc.h>
 #include <sys/systm.h>
+#include <sys/user.h>
 #include <machine/db_machdep.h>
+#include <machine/ctlreg.h>
 
 #include <ddb/db_access.h>
 #include <ddb/db_sym.h>
@@ -44,6 +46,8 @@
 
 #define INKERNEL(va)   (((vaddr_t)(va)) >= USRSTACK) /* Not really true, y'know */
 
+#define        KLOAD(x)        probeget((paddr_t)(long)&(x), ASI_PRIMARY, sizeof(x))   
+#define ULOAD(x)       probeget((paddr_t)(long)&(x), ASI_AIUS, sizeof(x))      
 void
 db_stack_trace_print(addr, have_addr, count, modif, pr)
        db_expr_t       addr;
@@ -54,19 +58,39 @@
 {
        vaddr_t         frame;
        boolean_t       kernel_only = TRUE;
+       boolean_t       trace_thread = FALSE;
+       char            c, *cp = modif;
 
-       {
-               register char c, *cp = modif;
-               while ((c = *cp++) != 0)
-                       if (c == 'u')
-                               kernel_only = FALSE;
+       while ((c = *cp++) != 0) {
+               if (c == 't')
+                       trace_thread = TRUE;
+               if (c == 'u')
+                       kernel_only = FALSE;
        }
 
        if (!have_addr)
                frame = (vaddr_t)DDB_TF->tf_out[6];
-       else
-               frame = (vaddr_t)addr;
-
+       else {
+               if (trace_thread) {
+                       struct proc *p;
+                       struct user *u;
+                       (*pr)("trace: pid %d ", (int)addr);
+                       p = pfind(addr);
+                       if (p == NULL) {
+                               (*pr)("not found\n");
+                               return;
+                       }       
+                       if ((p->p_flag & P_INMEM) == 0) {
+                               (*pr)("swapped out\n");
+                               return;
+                       }
+                       u = p->p_addr;
+                       frame = (vaddr_t)u->u_pcb.pcb_sp;
+                       (*pr)("at %p\n", frame);
+               } else {
+                       frame = (vaddr_t)addr;
+               }
+       }
        while (count--) {
                        int             i;
                        db_expr_t       offset;
@@ -77,24 +101,22 @@
 
                        if (frame & 1) {
                                f64 = (struct frame64 *)(frame + BIAS);
-                               pc = f64->fr_pc;
-                               if (!INKERNEL(pc))
+                               pc = KLOAD(f64->fr_pc);
+                               if (pc == -1)
                                        break;
                        
                                /*
                                 * Switch to frame that contains arguments
                                 */
-                               frame = f64->fr_fp;
+                               frame = KLOAD(f64->fr_fp);
                        } else {
                                f32 = (struct frame32 *)(frame);
-                               pc = f32->fr_pc;
-                               if (!INKERNEL(pc))
-                                       break;
+                               pc = KLOAD(f32->fr_pc);
                        
                                /*
                                 * Switch to frame that contains arguments
                                 */
-                               frame = (long)f32->fr_fp;
+                               frame = (long)KLOAD(f32->fr_fp);
                        }
                        if (!INKERNEL(frame))
                                break;
@@ -112,8 +134,9 @@
                                 * actual arguments somewhat...
                                 */
                                for (i=0; i < 5; i++)
-                                       (*pr)("%lx, ", (long)f64->fr_arg[i]);
-                               (*pr)("%lx) at ", (long)f64->fr_arg[i]);
+                                       (*pr)("%lx, ", 
+                                               (long)KLOAD(f64->fr_arg[i]));
+                               (*pr)("%lx) at ", (long)KLOAD(f64->fr_arg[i]));
                        } else {
                                f32 = (struct frame32 *)(frame);
                                /*
@@ -121,8 +144,8 @@
                                 * actual arguments somewhat...
                                 */
                                for (i=0; i < 5; i++)
-                                       (*pr)("%x, ", f32->fr_arg[i]);
-                               (*pr)("%x) at ", f32->fr_arg[i]);
+                                       (*pr)("%x, ", KLOAD(f32->fr_arg[i]));
+                               (*pr)("%x) at ", KLOAD(f32->fr_arg[i]));
                        }
                        db_printsym(pc, DB_STGY_PROC, pr);
                        (*pr)("\n");
@@ -232,13 +255,11 @@
        int             i;
        u_int64_t       frame, oldframe;
        boolean_t       kernel_only = TRUE;
+       char            c, *cp = modif;
 
-       {
-               register char c, *cp = modif;
-               while ((c = *cp++) != 0)
-                       if (c == 'u')
-                               kernel_only = FALSE;
-       }
+       while ((c = *cp++) != 0)
+               if (c == 'u')
+                       kernel_only = FALSE;
 



Home | Main Index | Thread Index | Old Index