Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 Update to post 1.4.
details: https://anonhg.NetBSD.org/src/rev/ea4c8fd97d81
branches: trunk
changeset: 477096:ea4c8fd97d81
user: eeh <eeh%NetBSD.org@localhost>
date: Mon Oct 11 01:57:43 1999 +0000
description:
Update to post 1.4.
diffstat:
sys/arch/sparc64/dev/zs.c | 14 +++-
sys/arch/sparc64/include/cpu.h | 10 +-
sys/arch/sparc64/include/frame.h | 6 +-
sys/arch/sparc64/include/netbsd32_machdep.h | 6 +-
sys/arch/sparc64/include/pcb.h | 6 +-
sys/arch/sparc64/include/reg.h | 26 ++++--
sys/arch/sparc64/sparc64/locore.s | 6 +-
sys/arch/sparc64/sparc64/machdep.c | 25 ++++-
sys/arch/sparc64/sparc64/netbsd32_machdep.c | 113 +++++++++++++++++++++++++--
sys/arch/sparc64/sparc64/process_machdep.c | 84 ++++++++++++++++++++-
sys/arch/sparc64/sparc64/sunos_machdep.c | 6 +-
sys/arch/sparc64/sparc64/vm_machdep.c | 4 +-
sys/arch/sparc64/stand/ofwboot/boot.c | 9 +-
13 files changed, 263 insertions(+), 52 deletions(-)
diffs (truncated from 668 to 300 lines):
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/dev/zs.c
--- a/sys/arch/sparc64/dev/zs.c Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/dev/zs.c Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.12 1999/05/23 02:45:19 eeh Exp $ */
+/* $NetBSD: zs.c,v 1.13 1999/10/11 01:57:43 eeh Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -631,6 +631,18 @@
if (zsc == NULL)
continue;
(void)zsc_intr_soft(zsc);
+#ifdef TTY_DEBUG
+ {
+ struct zstty_softc *zst0 = zsc->zsc_cs[0]->cs_private;
+ struct zstty_softc *zst1 = zsc->zsc_cs[1]->cs_private;
+ if (zst0->zst_overflows || zst1->zst_overflows ) {
+ struct trapframe *frame = (struct trapframe *)arg;
+
+ printf("zs silo overflow from %p\n",
+ (long)frame->tf_pc);
+ }
+ }
+#endif
}
splx(s);
return (1);
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/include/cpu.h
--- a/sys/arch/sparc64/include/cpu.h Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/include/cpu.h Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.12 1999/08/10 21:08:09 thorpej Exp $ */
+/* $NetBSD: cpu.h,v 1.13 1999/10/11 01:57:44 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -50,10 +50,12 @@
/*
* CTL_MACHDEP definitions.
*/
-#define CPU_MAXID 1 /* no valid machdep ids */
+#define CPU_BOOTED_KERNEL 1 /* string: booted kernel name */
+#define CPU_MAXID 2 /* number of valid machdep ids */
-#define CTL_MACHDEP_NAMES { \
- { 0, 0 }, \
+#define CTL_MACHDEP_NAMES { \
+ { 0, 0 }, \
+ { "booted_kernel", CTLTYPE_STRING }, \
}
#ifdef _KERNEL
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/include/frame.h
--- a/sys/arch/sparc64/include/frame.h Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/include/frame.h Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: frame.h,v 1.5 1998/09/22 02:48:43 eeh Exp $ */
+/* $NetBSD: frame.h,v 1.6 1999/10/11 01:57:44 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -75,8 +75,6 @@
* area at times anyway.
*/
#define CCFSZ 96
-#define STACK_ALIGN 8
-#define SA(X) (((X)+(STACK_ALIGN-1))&~(STACK_ALIGN-1))
/*
@@ -110,8 +108,6 @@
* by the compiler in 64-bit mode. It is (16)*8; space for 8 ins, 8 outs.
*/
#define CC64FSZ 176
-#define STACK_ALIGN64 16
-#define SA64(x) (((x)+(STACK_ALIGN64-1))&~(STACK_ALIGN64-1))
/*
* v9 stacks all have a bias of 2047 added to the %sp and %fp, so you can easily
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/include/netbsd32_machdep.h
--- a/sys/arch/sparc64/include/netbsd32_machdep.h Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/include/netbsd32_machdep.h Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_machdep.h,v 1.3 1999/03/26 04:29:21 eeh Exp $ */
+/* $NetBSD: netbsd32_machdep.h,v 1.4 1999/10/11 01:57:44 eeh Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@@ -48,8 +48,8 @@
};
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));
+int netbsd32_sigreturn __P((struct proc *p, void *v, register_t *retval));
+void netbsd32_sendsig __P((sig_t catcher, int sig, sigset_t *mask, u_int32_t code));
extern char netbsd32_esigcode[], netbsd32_sigcode[];
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/include/pcb.h
--- a/sys/arch/sparc64/include/pcb.h Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/include/pcb.h Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcb.h,v 1.1.1.1 1998/06/20 04:58:52 eeh Exp $ */
+/* $NetBSD: pcb.h,v 1.2 1999/10/11 01:57:45 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -157,4 +157,8 @@
#ifdef _KERNEL
extern struct pcb *cpcb;
+#else
+/* Let gdb compile. We need fancier macros to make these make sense. */
+#define pcb_psr pcb_pstate
+#define pcb_wim pcb_cwp
#endif /* _KERNEL */
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/include/reg.h
--- a/sys/arch/sparc64/include/reg.h Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/include/reg.h Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: reg.h,v 1.2 1999/05/12 01:11:54 eeh Exp $ */
+/* $NetBSD: reg.h,v 1.3 1999/10/11 01:57:45 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -73,7 +73,7 @@
* (The slot tf_global[0] is used to store the %fp when this is used
* as a clockframe. This is known as `cheating'.)
*/
-struct trapframe {
+struct trapframe64 {
int64_t tf_tstate; /* tstate register */
int64_t tf_pc; /* return pc */
int64_t tf_npc; /* return npc */
@@ -110,11 +110,6 @@
int64_t rw_in[8]; /* %i0..%i7 */
};
-union rwindow {
- struct rwindow64 v9;
- struct rwindow32 v8;
-};
-
/*
* Clone trapframe for now; this seems to be the more useful
* than the old struct reg above.
@@ -128,7 +123,7 @@
int r_out[8]; /* output registers in trap's caller */
};
-struct reg {
+struct reg64 {
int64_t r_tstate; /* tstate register */
int64_t r_pc; /* return pc */
int64_t r_npc; /* return npc */
@@ -165,7 +160,7 @@
/*
* Clone fpstate into an fpreg structure to satisfy <kern/sys_process.c>
*/
-struct fpreg {
+struct fpreg64 {
u_int fr_regs[64]; /* our view is 64 32-bit registers */
int64_t fr_fsr; /* %fsr */
int fr_qsize; /* actual queue depth */
@@ -182,4 +177,17 @@
struct fp_qentry fr_queue[FP_QSIZE]; /* queue contents */
};
+#if defined(_KERNEL) || defined(__arch64__)
+/* Here we gotta do naughty things to let gdb work on 32-bit binaries */
+#define reg reg64
+#define fpreg fpreg64
+#define trapframe trapframe64
+#define rwindow rwindow64
+#else
+#define reg reg32
+#define fpreg fpreg32
+#define trapframe trapframe32
+#define rwindow rwindow64
+#endif
+
#endif /* _MACHINE_REG_H_ */
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.45 1999/10/05 03:40:50 eeh Exp $ */
+/* $NetBSD: locore.s,v 1.46 1999/10/11 01:57:45 eeh Exp $ */
/*
* Copyright (c) 1996-1999 Eduardo Horvath
* Copyright (c) 1996 Paul Kranenburg
@@ -5813,11 +5813,11 @@
mov %l7, %g7
#ifdef _LP64
- restore %g0, netbsd32_SYS_compat_netbsd32_sigreturn, %g1 ! get registers back & set syscall #
+ restore %g0, netbsd32_SYS_netbsd32_sigreturn, %g1 ! get registers back & set syscall #
add %sp, 64 + 16, %o0 ! compute scp
t ST_SYSCALL ! sigreturn(scp)
! sigreturn does not return unless it fails
- mov netbsd32_SYS_compat_netbsd32_exit, %g1 ! exit(errno)
+ mov netbsd32_SYS_netbsd32_exit, %g1 ! exit(errno)
t ST_SYSCALL
_C_LABEL(netbsd32_esigcode):
#else
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/sparc64/machdep.c
--- a/sys/arch/sparc64/sparc64/machdep.c Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/sparc64/machdep.c Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.50 1999/09/17 20:07:17 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.51 1999/10/11 01:57:46 eeh Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -215,9 +215,9 @@
* and then give everything true virtual addresses.
*/
sz = (long)allocsys(NULL, mdallocsys);
-
+printf("cpu_startup: allocsys %ld, rounded %ld\n", sz, round_page(sz));
if ((v = (caddr_t)uvm_km_alloc(kernel_map, round_page(sz))) == 0)
- panic("startup: no room for tables");
+ panic("startup: no room for %lx bytes of tables", sz);
if (allocsys(v, mdallocsys) - v != sz)
panic("startup: table size inconsistency");
@@ -311,7 +311,7 @@
caddr_t v;
{
-#if 1 /* XXX this is from allocsys(). we have a copy as we use nbuf */
+#if 0 /* XXX this is from allocsys(). we have a copy as we use nbuf */
if (nbuf == 0) {
nbuf = bufpages;
if (nbuf < 16)
@@ -325,13 +325,11 @@
*/
#ifdef __arch64__
-#define rwindow rwindow64
#define STACK_OFFSET BIAS
#define CPOUTREG(l,v) copyout(&(v), (l), sizeof(v))
#undef CCFSZ
#define CCFSZ CC64FSZ
#else
-#define rwindow rwindow32
#define STACK_OFFSET 0
#define CPOUTREG(l,v) copyout(&(v), (l), sizeof(v))
#endif
@@ -420,12 +418,27 @@
size_t newlen;
struct proc *p;
{
+ int chosen;
+ char bootargs[256];
+ char *cp = NULL;
/* all sysctl names are this level are terminal */
if (namelen != 1)
return (ENOTDIR); /* overloaded */
switch (name[0]) {
+ case CPU_BOOTED_KERNEL:
+ if (((chosen = OF_finddevice("/chosen")) != -1) &&
+ (OF_getprop(chosen, "bootargs", bootargs, sizeof bootargs) < 0)) {
+ for (cp = bootargs;
+ *cp && *cp != ' ' && *cp != '\t' && *cp != '\n';
+ cp++);
+ *cp = 0;
+ cp = bootargs;
+ }
+ if (cp == NULL || cp[0] == '\0')
+ return (ENOENT);
+ return (sysctl_rdstring(oldp, oldlenp, newp, cp));
default:
return (EOPNOTSUPP);
}
diff -r 35546d13f297 -r ea4c8fd97d81 sys/arch/sparc64/sparc64/netbsd32_machdep.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c Mon Oct 11 01:41:10 1999 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c Mon Oct 11 01:57:43 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_machdep.c,v 1.2 1999/03/25 17:49:44 mrg Exp $ */
+/* $NetBSD: netbsd32_machdep.c,v 1.3 1999/10/11 01:57:46 eeh Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@@ -44,9 +44,6 @@
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
-void netbsd32_sendsig __P((sig_t, int, int, u_long));
-void netbsd32_setregs __P((struct proc *, struct exec_package *, u_long));
-
/*
* Set up registers on exec.
*
@@ -119,8 +116,9 @@
void
Home |
Main Index |
Thread Index |
Old Index