From 52db3e0545263ddcc4f37766e21a134aa00965d8 Mon Sep 17 00:00:00 2001 From: niklas Date: Thu, 9 May 1996 22:25:15 +0000 Subject: [PATCH] From NetBSD: Prototype + -Wall fixes. Clean up a few printf format strings. Added an include for the sunos_sendsig prototype Fix "prototype disagrees about inline" error. --- sys/arch/m68k/include/db_machdep.h | 10 ++++++++- sys/arch/m68k/m68k/db_disasm.c | 12 ++++++++-- sys/arch/m68k/m68k/db_interface.c | 16 ++++++++++++-- sys/arch/m68k/m68k/db_trace.c | 33 ++++++++++++++++++++-------- sys/arch/m68k/m68k/in_cksum.c | 6 +++-- sys/arch/m68k/m68k/process_machdep.c | 5 ++++- sys/arch/m68k/m68k/sunos_machdep.c | 12 +++++----- 7 files changed, 72 insertions(+), 22 deletions(-) diff --git a/sys/arch/m68k/include/db_machdep.h b/sys/arch/m68k/include/db_machdep.h index aa5ea85aad8..1374f5e5db3 100644 --- a/sys/arch/m68k/include/db_machdep.h +++ b/sys/arch/m68k/include/db_machdep.h @@ -1,4 +1,5 @@ -/* $NetBSD: db_machdep.h,v 1.12 1994/10/26 07:50:44 cgd Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.2 1996/05/09 22:25:15 niklas Exp $ */ +/* $NetBSD: db_machdep.h,v 1.13 1996/04/29 20:50:08 leo Exp $ */ /* * Mach Operating System @@ -104,4 +105,11 @@ db_regs_t ddb_regs; /* register state */ #define inst_load(ins) 0 #define inst_store(ins) 0 +#ifdef _KERNEL + +void kdb_kintr __P((struct mc68020_saved_state *)); +int kdb_trap __P((int, struct mc68020_saved_state *)); + +#endif /* _KERNEL */ + #endif /* _M68K_DB_MACHDEP_H_ */ diff --git a/sys/arch/m68k/m68k/db_disasm.c b/sys/arch/m68k/m68k/db_disasm.c index b4c157e8a3f..d90cf0319df 100644 --- a/sys/arch/m68k/m68k/db_disasm.c +++ b/sys/arch/m68k/m68k/db_disasm.c @@ -1,5 +1,5 @@ -/* $OpenBSD: db_disasm.c,v 1.2 1996/04/21 22:17:44 deraadt Exp $ */ -/* $NetBSD: db_disasm.c,v 1.13 1996/04/01 01:38:01 briggs Exp $ */ +/* $OpenBSD: db_disasm.c,v 1.3 1996/05/09 22:30:09 niklas Exp $ */ +/* $NetBSD: db_disasm.c,v 1.14 1996/04/29 20:50:26 leo Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -505,6 +505,7 @@ opcode_move(dbuf, opc) { int sz, lused; + sz = 0; switch (OPCODE_MAP(opc)) { case 0x1: /* move.b */ sz = SIZE_BYTE; @@ -1579,6 +1580,7 @@ opcode_fmove_ext(dbuf, opc, ext) { int sz; + sz = 0; if (BITFIELD(ext,15,13) == 3) { /* fmove r ==> m */ addstr(dbuf, "fmov"); @@ -1843,6 +1845,8 @@ opcode_pmove(dbuf, opc, ext) const char *reg; int rtom, sz, preg; + reg = "???"; + sz = 0; rtom = ISBITSET(ext, 9); preg = BITFIELD(ext, 12, 10); @@ -2291,6 +2295,8 @@ get_modregstr_moto(dbuf, bit, mod, sz, dd) u_short ext; int disp, odisp, bd, od, reg; + odisp = 0; + /* check to see if we have been given the mod */ if (mod != GETMOD_BEFORE && mod != GETMOD_AFTER) reg = BITFIELD(*dbuf->val, bit, bit-2); @@ -2496,6 +2502,7 @@ get_modregstr_mit(dbuf, bit, mod, sz, dd) u_short ext; int disp, odisp, bd, od, reg; + disp = odisp = 0; /* check to see if we have been given the mod */ if (mod != GETMOD_BEFORE && mod != GETMOD_AFTER) reg = BITFIELD(*dbuf->val, bit, bit-2); @@ -2811,6 +2818,7 @@ get_fpustdGEN(dbuf,ext,name) * it is. */ + sz = 0; addchar(*name++); if (ISBITSET(ext,7)) { if(ISBITSET(ext,2)) diff --git a/sys/arch/m68k/m68k/db_interface.c b/sys/arch/m68k/m68k/db_interface.c index 411ab3673da..4996320887c 100644 --- a/sys/arch/m68k/m68k/db_interface.c +++ b/sys/arch/m68k/m68k/db_interface.c @@ -1,5 +1,5 @@ -/* $OpenBSD: db_interface.c,v 1.4 1996/04/21 22:17:49 deraadt Exp $ */ -/* $NetBSD: db_interface.c,v 1.19 1996/03/16 18:45:44 mhitch Exp $ */ +/* $OpenBSD: db_interface.c,v 1.5 1996/05/09 22:30:10 niklas Exp $ */ +/* $NetBSD: db_interface.c,v 1.20 1996/04/29 20:50:28 leo Exp $ */ /* * Mach Operating System @@ -37,16 +37,26 @@ #include +#include + #include #include +#include +#include +#include + + extern label_t *db_recover; int db_active = 0; +static void kdbprinttrap __P((int, int)); + /* * Received keyboard interrupt sequence. */ +void kdb_kintr(regs) register struct mc68020_saved_state *regs; { @@ -60,6 +70,7 @@ kdb_kintr(regs) * kdb_trap - field a TRACE or BPT trap * Return non-zero if we "handled" the trap. */ +int kdb_trap(type, regs) int type; register struct mc68020_saved_state *regs; @@ -124,6 +135,7 @@ extern int trap_types; /* * Print trap reason. */ +static void kdbprinttrap(type, code) int type, code; { diff --git a/sys/arch/m68k/m68k/db_trace.c b/sys/arch/m68k/m68k/db_trace.c index d9eeeb95648..885f2a93659 100644 --- a/sys/arch/m68k/m68k/db_trace.c +++ b/sys/arch/m68k/m68k/db_trace.c @@ -1,5 +1,5 @@ -/* $OpenBSD: db_trace.c,v 1.3 1996/04/19 06:18:16 niklas Exp $ */ -/* $NetBSD: db_trace.c,v 1.15 1996/02/22 23:23:41 gwr Exp $ */ +/* $OpenBSD: db_trace.c,v 1.4 1996/05/09 22:30:11 niklas Exp $ */ +/* $NetBSD: db_trace.c,v 1.16 1996/04/29 20:50:29 leo Exp $ */ /* * Mach Operating System @@ -29,9 +29,12 @@ #include #include +#include #include +#include +#include #include #include #include @@ -41,7 +44,8 @@ extern label_t *db_recover; /* * Register list */ -static int db_var_short(struct db_variable *, db_expr_t *, int); +static int db_var_short __P((struct db_variable *, db_expr_t *, int)); + struct db_variable db_regs[] = { { "d0", (int *)&ddb_regs.d0, FCN_NULL }, { "d1", (int *)&ddb_regs.d1, FCN_NULL }, @@ -64,7 +68,8 @@ struct db_variable db_regs[] = { }; struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); -static int db_var_short(varp, valp, op) +static int +db_var_short(varp, valp, op) struct db_variable *varp; db_expr_t *valp; int op; @@ -73,6 +78,7 @@ static int db_var_short(varp, valp, op) *valp = (db_expr_t) *((short*)varp->valuep); else *((short*)varp->valuep) = (short) *valp; + return(0); } #define MAXINT 0x7fffffff @@ -103,11 +109,18 @@ struct stackpos { int k_regloc[NREGISTERS]; }; +static void findentry __P((struct stackpos *)); +static void findregs __P((struct stackpos *, db_addr_t)); +static int nextframe __P((struct stackpos *, int)); +static void stacktop __P((struct mc68020_saved_state *, struct stackpos *)); + + #define FR_SAVFP 0 #define FR_SAVPC 4 #define K_CALLTRAMP 1 /* for k_flags: caller is __sigtramp */ #define K_SIGTRAMP 2 /* for k_flags: this is __sigtramp */ +static void stacktop(regs, sp) register struct mc68020_saved_state *regs; register struct stackpos *sp; @@ -173,14 +186,14 @@ stacktop(regs, sp) struct nlist * trampsym = 0; struct nlist * funcsym = 0; +static int nextframe(sp, kerneltrace) register struct stackpos *sp; int kerneltrace; { - int val, regp, i; + int i; db_addr_t addr; db_addr_t calladdr; - register int instruc; db_addr_t oldfp = sp->k_fp; /* @@ -249,6 +262,7 @@ nextframe(sp, kerneltrace) return (sp->k_fp); } +static void findentry(sp) register struct stackpos *sp; { @@ -260,7 +274,7 @@ findentry(sp) */ register instruc; register val; - db_addr_t addr, calladdr, nextword; + db_addr_t addr, nextword; label_t db_jmpbuf; label_t *savejmp; @@ -393,6 +407,7 @@ findentry(sp) * Look at the procedure prolog of the current called procedure. * Figure out which registers we saved, and where they are */ +static void findregs(sp, addr) register struct stackpos *sp; register db_addr_t addr; @@ -400,6 +415,7 @@ findregs(sp, addr) register long instruc, val, i; int regp; + regp = 0; instruc = get(addr, ISP); if ((instruc & HIWORD) == LINKLA6) { instruc = get(addr + 2, ISP); @@ -462,12 +478,11 @@ db_stack_trace_cmd(addr, have_addr, count, modif) db_expr_t count; char *modif; { - int i, val, nargs, spa; + int i, val, nargs; db_addr_t regp; char * name; struct stackpos pos; boolean_t kernel_only = TRUE; - boolean_t trace_thread = FALSE; { register char *cp = modif; diff --git a/sys/arch/m68k/m68k/in_cksum.c b/sys/arch/m68k/m68k/in_cksum.c index aa017759e2b..c70cdd43eb8 100644 --- a/sys/arch/m68k/m68k/in_cksum.c +++ b/sys/arch/m68k/m68k/in_cksum.c @@ -1,4 +1,5 @@ -/* $NetBSD: in_cksum.c,v 1.5 1994/10/26 07:51:11 cgd Exp $ */ +/* $OpenBSD: in_cksum.c,v 1.2 1996/05/09 22:30:11 niklas Exp $ */ +/* $NetBSD: in_cksum.c,v 1.6 1996/04/30 11:57:05 briggs Exp $ */ /* * Copyright (c) 1988, 1990 Regents of the University of California. @@ -46,7 +47,7 @@ #include #include -extern int oc_cksum(); +extern int oc_cksum __P((char *buffer, int length, int startingval)); /* * Checksum routine for the Internet Protocol family. @@ -59,6 +60,7 @@ extern int oc_cksum(); * inside the "if". If fact, if m_copydata & sb_compact are doing * their job, we should never do the hairy code inside the "if". */ +int in_cksum(m, len) register struct mbuf *m; register int len; diff --git a/sys/arch/m68k/m68k/process_machdep.c b/sys/arch/m68k/m68k/process_machdep.c index 658d09bbe32..30dffe4a925 100644 --- a/sys/arch/m68k/m68k/process_machdep.c +++ b/sys/arch/m68k/m68k/process_machdep.c @@ -1,4 +1,5 @@ -/* $NetBSD: process_machdep.c,v 1.15 1995/08/13 09:05:51 mycroft Exp $ */ +/* $OpenBSD: process_machdep.c,v 1.2 1996/05/09 22:30:12 niklas Exp $ */ +/* $NetBSD: process_machdep.c,v 1.17 1996/05/06 20:05:24 gwr Exp $ */ /* * Copyright (c) 1993 Christopher G. Demetriou @@ -65,6 +66,8 @@ #ifdef cpu_set_init_frame extern char kstack[]; /* XXX */ #endif +static inline struct frame *process_frame __P((struct proc *p)); +static inline struct fpframe *process_fpframe __P((struct proc *p)); static inline struct frame * process_frame(p) diff --git a/sys/arch/m68k/m68k/sunos_machdep.c b/sys/arch/m68k/m68k/sunos_machdep.c index d55697a6cdd..fb2c3591444 100644 --- a/sys/arch/m68k/m68k/sunos_machdep.c +++ b/sys/arch/m68k/m68k/sunos_machdep.c @@ -1,4 +1,5 @@ -/* $NetBSD: sunos_machdep.c,v 1.8 1996/01/04 22:22:12 jtc Exp $ */ +/* $OpenBSD: sunos_machdep.c,v 1.6 1996/05/09 22:30:12 niklas Exp $ */ +/* $NetBSD: sunos_machdep.c,v 1.10 1996/05/05 16:11:31 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -57,6 +58,7 @@ #include #include +#include #include #include @@ -144,7 +146,7 @@ sunos_sendsig(catcher, sig, mask, code) (void)grow(p, (unsigned)fp); #ifdef DEBUG if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) - printf("sunos_sendsig(%d): sig %d ssp %x usp %x scp %x ft %d\n", + printf("sunos_sendsig(%d): sig %d ssp %p usp %p scp %p ft %d\n", p->p_pid, sig, &oonstack, fp, &fp->sf_sc, ft); #endif if (useracc((caddr_t)fp, fsize, B_WRITE) == 0) { @@ -194,8 +196,8 @@ sunos_sendsig(catcher, sig, mask, code) frame->f_regs[SP] = (int)fp; #ifdef DEBUG if (sigdebug & SDB_FOLLOW) - printf("sunos_sendsig(%d): sig %d scp %x sc_sp %x\n", - p->p_pid, sig, kfp.sf_sc.sc_sp); + printf("sunos_sendsig(%d): sig %d scp %p sc_sp %x\n", + p->p_pid, sig, &fp->sf_sc,kfp.sf_sc.sc_sp); #endif /* have the user-level trampoline code sort out what registers it @@ -233,7 +235,7 @@ sunos_sys_sigreturn(p, v, retval) scp = (struct sunos_sigcontext *) SCARG(uap, sigcntxp); #ifdef DEBUG if (sigdebug & SDB_FOLLOW) - printf("sunos_sigreturn: pid %d, scp %x\n", p->p_pid, scp); + printf("sunos_sigreturn: pid %d, scp %p\n", p->p_pid, scp); #endif if ((int)scp & 1) return (EINVAL); -- 2.20.1