Source-Changes-HG archive

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

[src/trunk]: src/sys COMPAT_SPARC32 -> COMPAT_NETBSD32



details:   https://anonhg.NetBSD.org/src/rev/e1bae6e9750d
branches:  trunk
changeset: 467584:e1bae6e9750d
user:      eeh <eeh%NetBSD.org@localhost>
date:      Fri Mar 26 04:29:20 1999 +0000

description:
COMPAT_SPARC32 -> COMPAT_NETBSD32

diffstat:

 sys/arch/sparc64/conf/GENERIC                |   4 +-
 sys/arch/sparc64/conf/GENERIC64              |   4 +-
 sys/arch/sparc64/conf/NONPLUS64              |   4 +-
 sys/arch/sparc64/include/netbsd32_machdep.h  |   9 ++++++-
 sys/arch/sparc64/include/psl.h               |   4 ++-
 sys/arch/sparc64/include/signal.h            |   3 +-
 sys/arch/sparc64/sparc64/compat_13_machdep.c |  35 +++++++++++++++++++++++++--
 sys/arch/sparc64/sparc64/genassym.cf         |   8 +-----
 sys/arch/sparc64/sparc64/locore.s            |   4 +-
 sys/arch/sparc64/sparc64/pmap.c              |  34 +++++++++++++-------------
 sys/arch/sparc64/sparc64/sunos_machdep.c     |  25 +++++++++++++------
 sys/arch/sparc64/sparc64/svr4_machdep.c      |  11 ++------
 sys/arch/sparc64/stand/bootblk/Makefile      |  11 +++-----
 sys/compat/netbsd32/netbsd32_exec.c          |   4 +-
 sys/kern/exec_conf.c                         |  12 ++++----
 15 files changed, 103 insertions(+), 69 deletions(-)

diffs (truncated from 477 to 300 lines):

diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/conf/GENERIC
--- a/sys/arch/sparc64/conf/GENERIC     Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/conf/GENERIC     Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: GENERIC,v 1.11 1999/01/23 19:09:00 eeh Exp $
+#      $NetBSD: GENERIC,v 1.12 1999/03/26 04:29:20 eeh Exp $
 
 include "arch/sparc64/conf/std.sparc64"
 
@@ -124,7 +124,7 @@
 options        COMPAT_11       # NetBSD 1.1 binary compatibility
 options        COMPAT_12       # NetBSD 1.2 binary compatibility
 options        COMPAT_13       # NetBSD 1.3 binary compatibility
-#options       COMPAT_SPARC32  # NetBSD/sparc binary compatibility -- 64-bit only
+#options       COMPAT_NETBSD32 # NetBSD/sparc binary compatibility -- 64-bit only
 options        COMPAT_SUNOS    # SunOS 4.x binary compatibility
 options        COMPAT_SVR4     # SunOS 5.x binary compatibility
 options        EXEC_ELF32      # Exec module for SunOS 5.x binaries.
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/conf/GENERIC64
--- a/sys/arch/sparc64/conf/GENERIC64   Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/conf/GENERIC64   Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: GENERIC64,v 1.1 1999/01/23 19:13:16 eeh Exp $
+#      $NetBSD: GENERIC64,v 1.2 1999/03/26 04:29:20 eeh Exp $
 
 include "arch/sparc64/conf/std.sparc64"
 
@@ -124,7 +124,7 @@
 options        COMPAT_11       # NetBSD 1.1 binary compatibility
 options        COMPAT_12       # NetBSD 1.2 binary compatibility
 options        COMPAT_13       # NetBSD 1.3 binary compatibility
-options        COMPAT_SPARC32  # NetBSD/sparc binary compatibility
+options        COMPAT_NETBSD32 # NetBSD/sparc binary compatibility
 options        COMPAT_SUNOS    # SunOS 4.x binary compatibility
 options        COMPAT_SVR4     # SunOS 5.x binary compatibility
 options        EXEC_ELF32      # Exec module for SunOS 5.x binaries.
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/conf/NONPLUS64
--- a/sys/arch/sparc64/conf/NONPLUS64   Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/conf/NONPLUS64   Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NONPLUS64,v 1.4 1999/01/23 19:12:19 eeh Exp $
+#      $NetBSD: NONPLUS64,v 1.5 1999/03/26 04:29:20 eeh Exp $
 
 include "arch/sparc64/conf/std.sparc64"
 
@@ -126,7 +126,7 @@
 options        COMPAT_11       # NetBSD 1.1 binary compatibility
 options        COMPAT_12       # NetBSD 1.2 binary compatibility
 options        COMPAT_13       # NetBSD 1.3 binary compatibility
-options                COMPAT_SPARC32  # NetBSD/sparc binary compatibility
+options                COMPAT_NETBSD32 # NetBSD/sparc binary compatibility
 options        COMPAT_SUNOS    # SunOS 4.x binary compatibility
 options        COMPAT_SVR4     # SunOS 5.x binary compatibility
 options        EXEC_ELF32      # Exec module for SunOS 5.x binaries.
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/include/netbsd32_machdep.h
--- a/sys/arch/sparc64/include/netbsd32_machdep.h       Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/include/netbsd32_machdep.h       Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.h,v 1.2 1999/03/25 17:49:43 mrg Exp $ */
+/*     $NetBSD: netbsd32_machdep.h,v 1.3 1999/03/26 04:29:21 eeh Exp $ */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -47,4 +47,11 @@
        int     sc_o0;                  /* %o0 to restore */
 };
 
+void netbsd32_setregs __P((struct proc *p, struct exec_package *pack, u_long stack));
+int compat_netbsd32_sigreturn __P((struct proc *p, void *v, register_t *retval));
+void netbsd32_sendsig __P((sig_t catcher, int sig, int mask, u_long code));
+
+extern char netbsd32_esigcode[], netbsd32_sigcode[];
+
+
 #endif /* _MACHINE_NETBSD32_H_ */
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/include/psl.h
--- a/sys/arch/sparc64/include/psl.h    Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/include/psl.h    Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: psl.h,v 1.6 1999/01/31 09:21:20 mrg Exp $ */
+/*     $NetBSD: psl.h,v 1.7 1999/03/26 04:29:21 eeh Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -378,6 +378,7 @@
 
 /* zs hardware interrupts are at level 12 */
 SPLHOLD(splzs, PIL_SER)
+SPLHOLD(splserial, PIL_SER)
 
 /* audio hardware interrupts are at level 13 */
 SPLHOLD(splaudio, PIL_AUD)
@@ -414,6 +415,7 @@
 #define        splclock()      splclockX(__FILE__, __LINE__)
 #define        splfd()         splfdX(__FILE__, __LINE__)
 #define        splzs()         splzsX(__FILE__, __LINE__)
+#define        splserial()     splzerialX(__FILE__, __LINE__)
 #define        splaudio()      splaudioX(__FILE__, __LINE__)
 #define        splstatclock()  splstatclockX(__FILE__, __LINE__)
 #define        splhigh()       splhighX(__FILE__, __LINE__)
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/include/signal.h
--- a/sys/arch/sparc64/include/signal.h Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/include/signal.h Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: signal.h,v 1.7 1999/01/31 09:21:20 mrg Exp $ */
+/*     $NetBSD: signal.h,v 1.8 1999/03/26 04:29:21 eeh Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -94,6 +94,7 @@
        sigset_t        sc_mask;        /* signal mask to restore (new style) */
 };
 #else /* _LOCORE */
+/* XXXXX These values don't work for _LP64 */
 #define        SC_SP_OFFSET    8
 #define        SC_PC_OFFSET    12
 #define        SC_NPC_OFFSET   16
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/sparc64/compat_13_machdep.c
--- a/sys/arch/sparc64/sparc64/compat_13_machdep.c      Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/sparc64/compat_13_machdep.c      Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_13_machdep.c,v 1.4 1999/01/31 09:21:18 mrg Exp $        */
+/*     $NetBSD: compat_13_machdep.c,v 1.5 1999/03/26 04:29:21 eeh Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -47,6 +47,7 @@
 #include <sys/signalvar.h>
 
 #include <sys/syscallargs.h>
+#include <sparc64/sparc64/sigdebug.h>
 
 /*
  * System call to cleanup state after a signal
@@ -77,12 +78,33 @@
        /* Make sure our D$ is not polluted w/bad data */
        blast_vcache();
 #endif
-       if (rwindow_save(p))
+       if (rwindow_save(p)) {
+#ifdef DEBUG
+               printf("compat_13_sys_sigreturn: rwindow_save(%p) failed, sending SIGILL\n", p);
+               Debugger();
+#endif
                sigexit(p, SIGILL);
+       }
+#ifdef DEBUG
+       if (sigdebug & SDB_FOLLOW) {
+               printf("compat_13_sys_sigreturn: %s[%d], sigcntxp %p\n",
+                   p->p_comm, p->p_pid, SCARG(uap, sigcntxp));
+               if (sigdebug & SDB_DDB) Debugger();
+       }
+#endif
 
        scp = SCARG(uap, sigcntxp);
        if ((vaddr_t)scp & 3 || (copyin((caddr_t)scp, &sc, sizeof sc) != 0))
+#ifdef DEBUG
+       {
+               printf("compat_13_sys_sigreturn: copyin failed: scp=%p\n", scp);
+               Debugger();
                return (EFAULT);
+       }
+#else
+               return (EFAULT);
+#endif
+
        scp = &sc;
 
        tf = p->p_md.md_tf;
@@ -94,7 +116,7 @@
        if (((scp->sc_pc | scp->sc_npc) & 3) != 0 || scp->sc_pc == 0 || scp->sc_npc == 0)
 #ifdef DEBUG
        {
-               printf("sigreturn13: pc %p or npc %p invalid\n", scp->sc_pc, scp->sc_npc);
+               printf("compat_13_sys_sigreturn: pc %p or npc %p invalid\n", scp->sc_pc, scp->sc_npc);
                Debugger();
                return (EINVAL);
        }
@@ -111,6 +133,13 @@
        tf->tf_global[1] = scp->sc_g1;
        tf->tf_out[0] = scp->sc_o0;
        tf->tf_out[6] = scp->sc_sp;
+#ifdef DEBUG
+       if (sigdebug & SDB_FOLLOW) {
+               printf("compat_13_sys_sigreturn: return trapframe pc=%p sp=%p tstate=%llx\n",
+                      (vaddr_t)tf->tf_pc, (vaddr_t)tf->tf_out[6], tf->tf_tstate);
+               if (sigdebug & SDB_DDB) Debugger();
+       }
+#endif
 
        if (scp->sc_onstack & SS_ONSTACK)
                p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/sparc64/genassym.cf
--- a/sys/arch/sparc64/sparc64/genassym.cf      Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/sparc64/genassym.cf      Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.10 1999/03/22 06:45:15 eeh Exp $
+#      $NetBSD: genassym.cf,v 1.11 1999/03/26 04:29:22 eeh Exp $
 
 #
 # Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -140,15 +140,9 @@
 
 
 # interrupt/fault metering
-ifdef UVM
 define V_SWTCH         offsetof(struct uvmexp, swtch)
 define V_INTR          offsetof(struct uvmexp, intrs)
 define V_FAULTS        offsetof(struct uvmexp, faults)
-else
-define V_SWTCH         offsetof(struct vmmeter, v_swtch)
-define V_INTR          offsetof(struct vmmeter, v_intr)
-define V_FAULTS        offsetof(struct vmmeter, v_faults)
-endif
 
 # CPU info structure
 #define        CPUINFO_FAULTSTATUS     offsetof(struct cpu_softc, get_faultstatus)
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.35 1999/03/25 17:49:43 mrg Exp $  */
+/*     $NetBSD: locore.s,v 1.36 1999/03/26 04:29:22 eeh Exp $  */
 /*
  * Copyright (c) 1996, 1997, 1998 Eduardo Horvath
  * Copyright (c) 1996 Paul Kranenburg
@@ -5577,7 +5577,7 @@
 _C_LABEL(esigcode):
 #endif
        
-#if defined(COMPAT_SPARC32) || ! defined(_LP64)
+#if defined(COMPAT_NETBSD32) || ! defined(_LP64)
 /*
  * The following code is copied to the top of the user stack when each
  * process is exec'ed, and signals are `trampolined' off it.
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c   Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c   Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.27 1999/03/24 05:51:13 mrg Exp $    */
+/*     $NetBSD: pmap.c,v 1.28 1999/03/26 04:29:23 eeh Exp $    */
 /* #define NO_VCACHE */ /* Don't forget the locked TLB in dostart */
 #define HWREF
 /* #define BOOT_DEBUG */
@@ -2251,8 +2251,8 @@
        register daddr_t blkno;
        register int (*dump)    __P((dev_t, daddr_t, caddr_t, size_t));
 {
-       kcore_seg_t     *ksegp;
-       cpu_kcore_hdr_t *kcpup;
+       kcore_seg_t     *kseg;
+       cpu_kcore_hdr_t *kcpu;
        phys_ram_seg_t  memseg;
        register int    error = 0;
        register int    i, memsegoffset, segmapoffset;
@@ -2281,26 +2281,26 @@
        ep = &buffer[sizeof(buffer) / sizeof(buffer[0])];
 
        /* Fill in MI segment header */
-       ksegp = (kcore_seg_t *)bp;
-       CORE_SETMAGIC(*ksegp, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
-       ksegp->c_size = dbtob(pmap_dumpsize()) - ALIGN(sizeof(kcore_seg_t));
+       kseg = (kcore_seg_t *)bp;
+       CORE_SETMAGIC(*kseg, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
+       kseg->c_size = dbtob(pmap_dumpsize()) - ALIGN(sizeof(kcore_seg_t));
 
        /* Fill in MD segment header (interpreted by MD part of libkvm) */
-       kcpup = (cpu_kcore_hdr_t *)((long)bp + ALIGN(sizeof(kcore_seg_t)));
-       kcpup->cputype = CPU_SUN4U;
-       kcpup->kernbase = KERNBASE;
-       kcpup->kphys = (paddr_t)ksegp;
-       kcpup->nmemseg = memsize;
-       kcpup->memsegoffset = memsegoffset = ALIGN(sizeof(cpu_kcore_hdr_t));
-       kcpup->nsegmap = STSZ;
-       kcpup->segmapoffset = segmapoffset =
+       kcpu = (cpu_kcore_hdr_t *)((long)bp + ALIGN(sizeof(kcore_seg_t)));
+       kcpu->cputype = CPU_SUN4U;
+       kcpu->kernbase = KERNBASE;
+       kcpu->kphys = (paddr_t)ksegp;
+       kcpu->nmemseg = memsize;
+       kcpu->memsegoffset = memsegoffset = ALIGN(sizeof(cpu_kcore_hdr_t));
+       kcpu->nsegmap = STSZ;
+       kcpu->segmapoffset = segmapoffset =
                memsegoffset + memsize * sizeof(phys_ram_seg_t);
 
-       kcpup->npmeg = 0; 
-       kcpup->pmegoffset = 0; /* We don't do this. */
+       kcpu->npmeg = 0; 
+       kcpu->pmegoffset = 0; /* We don't do this. */
 
        /* Note: we have assumed everything fits in buffer[] so far... */
-       bp = (int *)((long)kcpup + ALIGN(sizeof(cpu_kcore_hdr_t)));
+       bp = (int *)((long)kcpu + ALIGN(sizeof(cpu_kcore_hdr_t)));
 
        for (i = 0; i < memsize; i++) {
                memseg.start = mem[i].start;
diff -r e3cfd4fa0b9a -r e1bae6e9750d sys/arch/sparc64/sparc64/sunos_machdep.c
--- a/sys/arch/sparc64/sparc64/sunos_machdep.c  Fri Mar 26 04:17:46 1999 +0000
+++ b/sys/arch/sparc64/sparc64/sunos_machdep.c  Fri Mar 26 04:29:20 1999 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index