Subject: kern/1968: sys/ddb: Clean up code, handle most -Wall problems, move extern to .h files
To: None <gnats-bugs@gnats.netbsd.org>
From: Erik Bertelsen <erik@arhpc214.uni-c.dk>
List: netbsd-bugs
Date: 01/18/1996 15:02:03
>Number:         1968
>Category:       kern
>Synopsis:       sys/ddb: Clean up code, handle most -Wall problems, move extern to .h files
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 22 02:20:02 1996
>Last-Modified:
>Originator:     Erik Bertelsen
>Organization:
UNI-C
>Release:        NetBSD-current 15 January 1996
>Environment:
	i386 PC running NetBSD-current, also applies to other architectures
System: NetBSD arhpc214.uni-c.dk 1.1A NetBSD 1.1A (EBE) #9: Tue Jan 16 10:23:45 MET 1996 erik@arhpc214.uni-c.dk:/usr/sup/netbsd/src/sys/arch/i386/compile/EBE i386



>Description:
	This is mostly a change request, but with elements of a bug fix.

	In an attempt to check out the source code for the kernel, I tried to compile
	it with cc -Wall to make the compiler report problematic, but not necessarily
	errouneous code. In the end, I reduced the set of warnings a bit by using
	-Wall -Wno-parentheses -Wno-uninitialized.

	To minimize the work to be done, I just made the changes below for
	/usr/src/ddb with the addition of a few other consequential changes.

	The compiler reported a lot of functions that were declared implicitly by 
	using them or that were defined with no declarations in scope.

	The compiler also reported some functions where an absent return type was
	defaulted to int. Some of these functions did not return a value, and
	were converted to void functions.

	Functions that are declared implicitly by just calling them have their
	declarations added to the header file named after the source file, where
	it is actually defined. This header file is created if not already existing.
	This header file is included in those source files that use them.

	Some functions are local to a single source file and therefore converted to
	be declared with static scope.

	Extern function declarations within the source files are converted to inclusion
	of the appropriate header files. Other extern declarations (i.e. of variables)
	are done via header files as well. Two exceptions to this rule are the
	declarations of getreg_val in db_run.c and end in db_aout.c and db_sym.c.
	I did not find any definition of getreg_val, and anyway its declaration and
	use is in an #ifdef block, that may be unused on most (all?) architectures.
	End is left with its external declarations, because I did not identfy a 
	good place to place it.

	A few functions seem to be completely unused and are hided within a dummy
	#ifdef block. Maybe the best is to remove the completely, but there may
	be a reason for their presence.

	As a consequence of the changes in /usr/src/ddb, a few other places were
	also patched: In src/sys/kern a couple of extern declaration were put
	into header files (and including their respective implementation files).
	The same goes for src/sys/arch/i386/i386, where db_disasm and db_stack_-
	trace_cmd are defined. The changes for i386 should be reviewed and installed
	as appropriately for all architectures.

	The file kern/locore.h is added, but I don't really know where I think
	that this shall be done. But an external declaration of some of the stuff
	defined in locore.s is needed. For the ddb sources, the declaration of
	esym is enough, but other parts of the kernel may need other variables
	from locore.s. Placing the declaration of esym in a header file also
	leads to a couple of consequential changes in mac68k/machdep.c and 
	pmap_bootstrap.c. In fact I noticed that esym was declared with at least
	three different types in different source files....
>How-To-Repeat:
	Compile kernel with -Wall.
>Fix:
	Below is the patches for the changes described above. These patches are for
	files in src/sys/ddb, src/sys/kern, src/arch/i386/i386, and src/arc/mac68k/mac68k.
	After the patches, new header files in src/sys/ddb and src/sys/kern are
	given. These header file need to be augmented with copyright text, CVS
	id's, etc. as needed by all BSD source files.
	================patches for src/sys/ddb=============================
diff -c /usr/src/sys/ddb/db_aout.c /usr/ebe/sys/ddb/db_aout.c
*** /usr/src/sys/ddb/db_aout.c	Sat Oct 14 03:36:15 1995
--- /usr/ebe/sys/ddb/db_aout.c	Thu Jan 18 13:13:56 1996
***************
*** 33,39 ****
--- 33,45 ----
  
  #include <machine/db_machdep.h>		/* data types */
  
+ #ifndef SYMTAB_SPACE
+ #include <kern/locore.h>
+ #endif
+ 
+ #include <ddb/db_aout.h>
  #include <ddb/db_sym.h>
+ #include <ddb/db_output.h>
  
  #ifndef	DB_NO_AOUT
  
***************
*** 62,68 ****
  /*
   * Find the symbol table and strings; tell ddb about them.
   */
! X_db_sym_init(symtab, esymtab, name)
  	int *	symtab;		/* pointer to start of symbol table */
  	char *	esymtab;	/* pointer to end of string table,
  				   for checking - rounded up to integer
--- 68,74 ----
  /*
   * Find the symbol table and strings; tell ddb about them.
   */
! static void X_db_sym_init(symtab, esymtab, name)
  	int *	symtab;		/* pointer to start of symbol table */
  	char *	esymtab;	/* pointer to end of string table,
  				   for checking - rounded up to integer
***************
*** 235,241 ****
  	db_expr_t	off;
  {
  	register struct nlist	*sp, *ep;
- 	register struct nlist	*sym = (struct nlist *)cursym;
  	unsigned long		sodiff = -1UL, lndiff = -1UL, ln = 0;
  	char			*fname = NULL;
  
--- 241,246 ----
***************
*** 333,343 ****
  /*
   * Initialization routine for a.out files.
   */
  ddb_init()
  {
  #ifndef SYMTAB_SPACE
! 	extern char	*esym;
! 	extern int	end;
  
  	if (esym > (char *)&end) {
  	    X_db_sym_init((int *)&end, esym, "netbsd");
--- 338,348 ----
  /*
   * Initialization routine for a.out files.
   */
+ void
  ddb_init()
  {
  #ifndef SYMTAB_SPACE
! 	extern end;
  
  	if (esym > (char *)&end) {
  	    X_db_sym_init((int *)&end, esym, "netbsd");
Only in /usr/ebe/sys/ddb/: db_aout.h
diff -c /usr/src/sys/ddb/db_break.c /usr/ebe/sys/ddb/db_break.c
*** /usr/src/sys/ddb/db_break.c	Sat Oct 14 03:36:17 1995
--- /usr/ebe/sys/ddb/db_break.c	Wed Jan 17 13:16:41 1996
***************
*** 41,47 ****
  #include <ddb/db_break.h>
  #include <ddb/db_access.h>
  #include <ddb/db_sym.h>
! #include <ddb/db_break.h>
  
  #define	NBREAKPOINTS	100
  struct db_breakpoint	db_break_table[NBREAKPOINTS];
--- 41,47 ----
  #include <ddb/db_break.h>
  #include <ddb/db_access.h>
  #include <ddb/db_sym.h>
! #include <ddb/db_output.h>
  
  #define	NBREAKPOINTS	100
  struct db_breakpoint	db_break_table[NBREAKPOINTS];
***************
*** 49,55 ****
  db_breakpoint_t		db_free_breakpoints = 0;
  db_breakpoint_t		db_breakpoint_list = 0;
  
! db_breakpoint_t
  db_breakpoint_alloc()
  {
  	register db_breakpoint_t	bkpt;
--- 49,55 ----
  db_breakpoint_t		db_free_breakpoints = 0;
  db_breakpoint_t		db_breakpoint_list = 0;
  
! static db_breakpoint_t
  db_breakpoint_alloc()
  {
  	register db_breakpoint_t	bkpt;
***************
*** 68,74 ****
  	return (bkpt);
  }
  
! void
  db_breakpoint_free(bkpt)
  	register db_breakpoint_t	bkpt;
  {
--- 68,74 ----
  	return (bkpt);
  }
  
! static void
  db_breakpoint_free(bkpt)
  	register db_breakpoint_t	bkpt;
  {
***************
*** 76,82 ****
  	db_free_breakpoints = bkpt;
  }
  
! void
  db_set_breakpoint(map, addr, count)
  	vm_map_t	map;
  	db_addr_t	addr;
--- 76,82 ----
  	db_free_breakpoints = bkpt;
  }
  
! static void
  db_set_breakpoint(map, addr, count)
  	vm_map_t	map;
  	db_addr_t	addr;
***************
*** 105,111 ****
  	db_breakpoint_list = bkpt;
  }
  
! void
  db_delete_breakpoint(map, addr)
  	vm_map_t	map;
  	db_addr_t	addr;
--- 105,111 ----
  	db_breakpoint_list = bkpt;
  }
  
! static void
  db_delete_breakpoint(map, addr)
  	vm_map_t	map;
  	db_addr_t	addr;
***************
*** 235,241 ****
  /*
   * List breakpoints.
   */
! void
  db_list_breakpoints()
  {
  	register db_breakpoint_t	bkpt;
--- 235,241 ----
  /*
   * List breakpoints.
   */
! static void
  db_list_breakpoints()
  {
  	register db_breakpoint_t	bkpt;
diff -c /usr/src/sys/ddb/db_break.h /usr/ebe/sys/ddb/db_break.h
*** /usr/src/sys/ddb/db_break.h	Sat Oct 14 03:36:19 1995
--- /usr/ebe/sys/ddb/db_break.h	Wed Jan 17 13:21:30 1996
***************
*** 53,58 ****
--- 53,61 ----
  db_breakpoint_t	db_find_breakpoint_here __P((db_addr_t));
  void db_set_breakpoints __P((void));
  void db_clear_breakpoints __P((void));
+ extern void db_delete_cmd __P((db_expr_t, int, db_expr_t, char*));
+ extern void db_breakpoint_cmd __P((db_expr_t, int, db_expr_t, char*));
+ extern void db_listbreak_cmd __P((void));
  
  db_breakpoint_t	db_set_temp_breakpoint __P((db_addr_t));
  void db_delete_temp_breakpoint __P((db_breakpoint_t));
diff -c /usr/src/sys/ddb/db_command.c /usr/ebe/sys/ddb/db_command.c
*** /usr/src/sys/ddb/db_command.c	Mon Dec 11 21:39:34 1995
--- /usr/ebe/sys/ddb/db_command.c	Wed Jan 17 16:16:35 1996
***************
*** 33,44 ****
--- 33,57 ----
  #include <sys/proc.h>
  
  #include <vm/vm.h>
+ #include <vm/vm_object.h>
+ 
+ #include <kern/kern_synch.h>
+ #include <kern/kern_clock.h>
  
  #include <machine/db_machdep.h>		/* type definitions */
  
  #include <ddb/db_lex.h>
  #include <ddb/db_output.h>
+ #include <ddb/db_print.h>
+ #include <ddb/db_examine.h>
+ #include <ddb/db_expr.h>
+ #include <ddb/db_variables.h>
  #include <ddb/db_command.h>
+ #include <ddb/db_break.h>
+ #include <ddb/db_run.h>
+ #include <ddb/db_watch.h>
+ #include <ddb/db_write_cmd.h>
+ #include <ddb/db_trace.h>
  
  #include <setjmp.h>
  
***************
*** 47,52 ****
--- 60,71 ----
   */
  boolean_t	db_cmd_loop_done;
  jmp_buf		*db_recover;
+ db_addr_t	db_dot;		/* current location */
+ db_addr_t	db_last_addr;	/* last explicit address typed */
+ db_addr_t	db_prev;	/* last address examined
+ 					   or written */
+ db_addr_t	db_next;	/* next address to be examined
+ 				   or written */
  
  /*
   * if 'ed' style: 'dot' is set at start of last item printed,
***************
*** 55,60 ****
--- 74,81 ----
   */
  boolean_t	db_ed_style = TRUE;
  
+ static void		db_fncall __P((void));
+ 
  /*
   * Utility routine - discard tokens through end-of-line.
   */
***************
*** 79,85 ****
  /*
   * Search for command prefix.
   */
! int
  db_cmd_search(name, table, cmdp)
  	char			*name;
  	struct db_command	*table;
--- 100,106 ----
  /*
   * Search for command prefix.
   */
! static int
  db_cmd_search(name, table, cmdp)
  	char			*name;
  	struct db_command	*table;
***************
*** 127,133 ****
  	return (result);
  }
  
! void
  db_cmd_list(table)
  	struct db_command *table;
  {
--- 148,154 ----
  	return (result);
  }
  
! static void
  db_cmd_list(table)
  	struct db_command *table;
  {
***************
*** 139,145 ****
  	}
  }
  
! void
  db_command(last_cmdp, cmd_table)
  	struct db_command	**last_cmdp;	/* IN_OUT */
  	struct db_command	*cmd_table;
--- 160,166 ----
  	}
  }
  
! static void
  db_command(last_cmdp, cmd_table)
  	struct db_command	**last_cmdp;	/* IN_OUT */
  	struct db_command	*cmd_table;
***************
*** 148,154 ****
  	int		t;
  	char		modif[TOK_STRING_SIZE];
  	db_expr_t	addr, count;
! 	boolean_t	have_addr;
  	int		result;
  
  	t = db_read_token();
--- 169,175 ----
  	int		t;
  	char		modif[TOK_STRING_SIZE];
  	db_expr_t	addr, count;
! 	boolean_t	have_addr = FALSE /* ???? */;
  	int		result;
  
  	t = db_read_token();
***************
*** 161,167 ****
  	    modif[0] = '\0';
  	}
  	else if (t == tEXCL) {
- 	    void db_fncall();
  	    db_fncall();
  	    return;
  	}
--- 182,187 ----
***************
*** 280,293 ****
  }
  
  /*ARGSUSED*/
! void
  db_map_print_cmd(addr, have_addr, count, modif)
  	db_expr_t	addr;
  	int		have_addr;
  	db_expr_t	count;
  	char *		modif;
  {
-         extern void	_vm_map_print();
          boolean_t full = FALSE;
          
          if (modif[0] == 'f')
--- 300,312 ----
  }
  
  /*ARGSUSED*/
! static void
  db_map_print_cmd(addr, have_addr, count, modif)
  	db_expr_t	addr;
  	int		have_addr;
  	db_expr_t	count;
  	char *		modif;
  {
          boolean_t full = FALSE;
          
          if (modif[0] == 'f')
***************
*** 297,310 ****
  }
  
  /*ARGSUSED*/
! void
  db_object_print_cmd(addr, have_addr, count, modif)
  	db_expr_t	addr;
  	int		have_addr;
  	db_expr_t	count;
  	char *		modif;
  {
-         extern void	_vm_object_print();
          boolean_t full = FALSE;
          
          if (modif[0] == 'f')
--- 316,328 ----
  }
  
  /*ARGSUSED*/
! static void
  db_object_print_cmd(addr, have_addr, count, modif)
  	db_expr_t	addr;
  	int		have_addr;
  	db_expr_t	count;
  	char *		modif;
  {
          boolean_t full = FALSE;
          
          if (modif[0] == 'f')
***************
*** 316,327 ****
  /*
   * 'show' commands
   */
- extern void	db_show_all_procs();
- extern void	db_show_callout();
- extern void	db_listbreak_cmd();
- extern void	db_listwatch_cmd();
- extern void	db_show_regs();
- void		db_show_help();
  
  struct db_command db_show_all_cmds[] = {
  	{ "procs",	db_show_all_procs,0,	0 },
--- 334,339 ----
***************
*** 339,355 ****
  	{ (char *)0, }
  };
  
- extern void	db_print_cmd(), db_examine_cmd(), db_set_cmd();
- extern void	db_search_cmd();
- extern void	db_write_cmd();
- extern void	db_delete_cmd(), db_breakpoint_cmd();
- extern void	db_deletewatch_cmd(), db_watchpoint_cmd();
- extern void	db_single_step_cmd(), db_trace_until_call_cmd(),
- 		db_trace_until_matching_cmd(), db_continue_cmd();
- extern void	db_stack_trace_cmd();
- void		db_help_cmd();
- void		db_fncall();
- 
  struct db_command db_command_table[] = {
  #ifdef DB_MACHINE_COMMANDS
    /* this must be the first entry, if it exists */
--- 351,356 ----
***************
*** 397,402 ****
--- 398,404 ----
  
  struct db_command	*db_last_command = 0;
  
+ #ifdef THISFUNCTIONISUNUSED
  void
  db_help_cmd()
  {
***************
*** 408,420 ****
  	    cmd++;
  	}
  }
  
  void
  db_command_loop()
  {
  	jmp_buf		db_jmpbuf;
  	jmp_buf		*savejmp = db_recover;
- 	extern int	db_output_line;
  
  	/*
  	 * Initialize 'prev' and 'next' to dot.
--- 410,422 ----
  	    cmd++;
  	}
  }
+ #endif
  
  void
  db_command_loop()
  {
  	jmp_buf		db_jmpbuf;
  	jmp_buf		*savejmp = db_recover;
  
  	/*
  	 * Initialize 'prev' and 'next' to dot.
***************
*** 454,460 ****
   * Call random function:
   * !expr(arg,arg,arg)
   */
! void
  db_fncall()
  {
  	db_expr_t	fn_addr;
--- 456,462 ----
   * Call random function:
   * !expr(arg,arg,arg)
   */
! static void
  db_fncall()
  {
  	db_expr_t	fn_addr;
diff -c /usr/src/sys/ddb/db_command.h /usr/ebe/sys/ddb/db_command.h
*** /usr/src/sys/ddb/db_command.h	Sat Oct 14 03:36:23 1995
--- /usr/ebe/sys/ddb/db_command.h	Thu Jan 18 11:49:25 1996
***************
*** 29,48 ****
   *	Date:	7/90
   */
  
  /*
   * Command loop declarations.
   */
  void db_command_loop __P((void));
  void db_skip_to_eol __P((void));
  
! void db_error __P((char *));	/* report error */
  
! db_addr_t	db_dot;		/* current location */
! db_addr_t	db_last_addr;	/* last explicit address typed */
! db_addr_t	db_prev;	/* last address examined
! 				   or written */
! db_addr_t	db_next;	/* next address to be examined
! 				   or written */
  
  /*
   * Command table
--- 29,51 ----
   *	Date:	7/90
   */
  
+ #include <machine/db_machdep.h>		/* type definitions */
+ 
  /*
   * Command loop declarations.
   */
  void db_command_loop __P((void));
  void db_skip_to_eol __P((void));
  
! void db_error __P((char *)) __attribute__ ((noreturn));	/* report error */
  
! extern boolean_t        db_cmd_loop_done;
! extern db_addr_t	db_dot;		/* current location */
! extern db_addr_t	db_last_addr;	/* last explicit address typed */
! extern db_addr_t	db_prev;	/* last address examined
! 					   or written */
! extern db_addr_t	db_next;	/* next address to be examined
! 					   or written */
  
  /*
   * Command table
Only in /usr/ebe/sys/ddb/: db_disasm.h
diff -c /usr/src/sys/ddb/db_examine.c /usr/ebe/sys/ddb/db_examine.c
*** /usr/src/sys/ddb/db_examine.c	Sat Oct 14 03:36:23 1995
--- /usr/ebe/sys/ddb/db_examine.c	Wed Jan 17 16:44:23 1996
***************
*** 35,48 ****
  #include <machine/db_machdep.h>		/* type definitions */
  
  #include <ddb/db_lex.h>
  #include <ddb/db_output.h>
  #include <ddb/db_command.h>
  #include <ddb/db_sym.h>
  
  char	db_examine_format[TOK_STRING_SIZE] = "x";
  
! extern	db_addr_t db_disasm(/* db_addr_t, boolean_t */);
! 			/* instruction disassembler */
  
  /*
   * Examine (print) data.  Syntax is:
--- 35,52 ----
  #include <machine/db_machdep.h>		/* type definitions */
  
  #include <ddb/db_lex.h>
+ #include <ddb/db_examine.h>
+ #include <ddb/db_expr.h>
+ #include <ddb/db_access.h>
  #include <ddb/db_output.h>
  #include <ddb/db_command.h>
  #include <ddb/db_sym.h>
+ #include <ddb/db_disasm.h>
  
  char	db_examine_format[TOK_STRING_SIZE] = "x";
  
! static void db_search(db_addr_t, int, db_expr_t, db_expr_t, unsigned int);
! static void db_examine(register db_addr_t, char *, int);
  
  /*
   * Examine (print) data.  Syntax is:
***************
*** 69,75 ****
  	db_examine((db_addr_t) addr, db_examine_format, count);
  }
  
! db_examine(addr, fmt, count)
  	register
  		db_addr_t	addr;
  	char *		fmt;	/* format string */
--- 73,79 ----
  	db_examine((db_addr_t) addr, db_examine_format, count);
  }
  
! static void db_examine(addr, fmt, count)
  	register
  		db_addr_t	addr;
  	char *		fmt;	/* format string */
***************
*** 225,231 ****
  	db_printf("\n");
  }
  
! db_print_loc_and_inst(loc)
  	db_addr_t	loc;
  {
  	db_printsym(loc, DB_STGY_PROC);
--- 229,235 ----
  	db_printf("\n");
  }
  
! void db_print_loc_and_inst(loc)
  	db_addr_t	loc;
  {
  	db_printsym(loc, DB_STGY_PROC);
***************
*** 233,243 ****
  	(void) db_disasm(loc, FALSE);
  }
  
! db_strcpy(dst, src)
  	register char *dst;
  	register char *src;
  {
! 	while (*dst++ = *src++)
  		;
  }
  
--- 237,247 ----
  	(void) db_disasm(loc, FALSE);
  }
  
! void db_strcpy(dst, src)
  	register char *dst;
  	register char *src;
  {
! 	while ((*dst++ = *src++))
  		;
  }
  
***************
*** 278,284 ****
  		size = 4;
  	}
  
! 	if (!db_expression(&addr)) {
  		db_printf("Address missing\n");
  		db_flush_lex();
  		return;
--- 282,288 ----
  		size = 4;
  	}
  
! 	if (!db_expression((db_expr_t *)&addr)) {
  		db_printf("Address missing\n");
  		db_flush_lex();
  		return;
***************
*** 309,315 ****
  	db_search(addr, size, value, mask, count);
  }
  
! db_search(addr, size, value, mask, count)
  	register
  	db_addr_t	addr;
  	int		size;
--- 313,319 ----
  	db_search(addr, size, value, mask, count);
  }
  
! static void db_search(addr, size, value, mask, count)
  	register
  	db_addr_t	addr;
  	int		size;
Only in /usr/ebe/sys/ddb/: db_examine.h
diff -c /usr/src/sys/ddb/db_expr.c /usr/ebe/sys/ddb/db_expr.c
*** /usr/src/sys/ddb/db_expr.c	Sat Oct 14 03:36:23 1995
--- /usr/ebe/sys/ddb/db_expr.c	Wed Jan 17 14:54:19 1996
***************
*** 37,44 ****
  #include <ddb/db_lex.h>
  #include <ddb/db_access.h>
  #include <ddb/db_command.h>
  
! boolean_t
  db_term(valuep)
  	db_expr_t *valuep;
  {
--- 37,47 ----
  #include <ddb/db_lex.h>
  #include <ddb/db_access.h>
  #include <ddb/db_command.h>
+ #include <ddb/db_expr.h>
+ #include <ddb/db_variables.h>
+ #include <ddb/db_sym.h>
  
! static boolean_t
  db_term(valuep)
  	db_expr_t *valuep;
  {
***************
*** 93,99 ****
  	return (FALSE);
  }
  
! boolean_t
  db_unary(valuep)
  	db_expr_t *valuep;
  {
--- 96,102 ----
  	return (FALSE);
  }
  
! static boolean_t
  db_unary(valuep)
  	db_expr_t *valuep;
  {
***************
*** 121,127 ****
  	return (db_term(valuep));
  }
  
! boolean_t
  db_mult_expr(valuep)
  	db_expr_t *valuep;
  {
--- 124,130 ----
  	return (db_term(valuep));
  }
  
! static boolean_t
  db_mult_expr(valuep)
  	db_expr_t *valuep;
  {
***************
*** 158,164 ****
  	return (TRUE);
  }
  
! boolean_t
  db_add_expr(valuep)
  	db_expr_t *valuep;
  {
--- 161,167 ----
  	return (TRUE);
  }
  
! static boolean_t
  db_add_expr(valuep)
  	db_expr_t *valuep;
  {
***************
*** 185,191 ****
  	return (TRUE);
  }
  
! boolean_t
  db_shift_expr(valuep)
  	db_expr_t *valuep;
  {
--- 188,194 ----
  	return (TRUE);
  }
  
! static boolean_t
  db_shift_expr(valuep)
  	db_expr_t *valuep;
  {
Only in /usr/ebe/sys/ddb/: db_expr.h
diff -c /usr/src/sys/ddb/db_input.c /usr/ebe/sys/ddb/db_input.c
*** /usr/src/sys/ddb/db_input.c	Sat Oct 14 03:36:24 1995
--- /usr/ebe/sys/ddb/db_input.c	Wed Jan 17 11:31:43 1996
***************
*** 32,38 ****
--- 32,42 ----
  #include <sys/param.h>
  #include <sys/proc.h>
  
+ #include <dev/cons.h>
+ 
+ #include <ddb/db_input.h>
  #include <ddb/db_output.h>
+ #include <ddb/db_command.h>
  
  /*
   * Character input and editing.
***************
*** 53,59 ****
  #define	BLANK		' '
  #define	BACKUP		'\b'
  
! void
  db_putstring(s, count)
  	char	*s;
  	int	count;
--- 57,65 ----
  #define	BLANK		' '
  #define	BACKUP		'\b'
  
! static int cnmaygetc ();
! 
! static void
  db_putstring(s, count)
  	char	*s;
  	int	count;
***************
*** 62,68 ****
  	    cnputc(*s++);
  }
  
! void
  db_putnchars(c, count)
  	int	c;
  	int	count;
--- 68,74 ----
  	    cnputc(*s++);
  }
  
! static void
  db_putnchars(c, count)
  	int	c;
  	int	count;
***************
*** 76,82 ****
   */
  #define	DEL_FWD		0
  #define	DEL_BWD		1
! void
  db_delete(n, bwd)
  	int	n;
  	int	bwd;
--- 82,88 ----
   */
  #define	DEL_FWD		0
  #define	DEL_BWD		1
! static void
  db_delete(n, bwd)
  	int	n;
  	int	bwd;
***************
*** 97,103 ****
  }
  
  /* returns TRUE at end-of-line */
! int
  db_inputchar(c)
  	int	c;
  {
--- 103,109 ----
  }
  
  /* returns TRUE at end-of-line */
! static int
  db_inputchar(c)
  	int	c;
  {
***************
*** 240,246 ****
  	}
  }
  
! cnmaygetc ()
  {
  	return (-1);
  }
--- 246,252 ----
  	}
  }
  
! static int cnmaygetc ()
  {
  	return (-1);
  }
Only in /usr/ebe/sys/ddb/: db_input.h
diff -c /usr/src/sys/ddb/db_lex.c /usr/ebe/sys/ddb/db_lex.c
*** /usr/src/sys/ddb/db_lex.c	Sat Oct 14 03:36:25 1995
--- /usr/ebe/sys/ddb/db_lex.c	Tue Jan 16 16:42:36 1996
***************
*** 35,44 ****
--- 35,49 ----
  #include <sys/param.h>
  
  #include <ddb/db_lex.h>
+ #include <ddb/db_input.h>
+ #include <ddb/db_output.h>
+ #include <ddb/db_command.h>
  
  char	db_line[120];
  char *	db_lp, *db_endlp;
  
+ static int db_lex __P((void));
+ 
  int
  db_read_line()
  {
***************
*** 117,123 ****
  	db_look_token = 0;
  }
  
! int
  db_lex()
  {
  	int	c;
--- 122,128 ----
  	db_look_token = 0;
  }
  
! static int
  db_lex()
  {
  	int	c;
diff -c /usr/src/sys/ddb/db_lex.h /usr/ebe/sys/ddb/db_lex.h
*** /usr/src/sys/ddb/db_lex.h	Sat Oct 14 03:36:26 1995
--- /usr/ebe/sys/ddb/db_lex.h	Thu Jan 18 11:29:58 1996
***************
*** 43,49 ****
  int	db_tok_number;
  #define	TOK_STRING_SIZE		120 
  char	db_tok_string[TOK_STRING_SIZE];
! int	db_radix;
  
  #define	tEOF		(-1)
  #define	tEOL		1
--- 43,49 ----
  int	db_tok_number;
  #define	TOK_STRING_SIZE		120 
  char	db_tok_string[TOK_STRING_SIZE];
! extern int	db_radix;
  
  #define	tEOF		(-1)
  #define	tEOL		1
diff -c /usr/src/sys/ddb/db_output.c /usr/ebe/sys/ddb/db_output.c
*** /usr/src/sys/ddb/db_output.c	Mon Dec 11 21:39:35 1995
--- /usr/ebe/sys/ddb/db_output.c	Thu Jan 18 11:29:57 1996
***************
*** 31,38 ****
--- 31,45 ----
   */
  #include <sys/param.h>
  
+ #include <dev/cons.h>
+ 
  #include <machine/stdarg.h>
  
+ #include <ddb/db_output.h>
+ #include <ddb/db_input.h>
+ #include <ddb/db_command.h>
+ #include <ddb/db_lex.h>
+ 
  /*
   *	Character output - tracks position in line.
   *	To do this correctly, we should know how wide
***************
*** 64,70 ****
  int	db_max_line = DB_MAX_LINE;	/* output max lines */
  int	db_max_width = DB_MAX_WIDTH;	/* output line width */
  
! extern void	db_check_interrupt();
  
  /*
   * Force pending whitespace.
--- 71,77 ----
  int	db_max_line = DB_MAX_LINE;	/* output max lines */
  int	db_max_width = DB_MAX_WIDTH;	/* output line width */
  
! static void db_printf_guts(register const char*, va_list);
  
  /*
   * Force pending whitespace.
***************
*** 124,129 ****
--- 131,137 ----
  /*
   * Output character.  Buffer whitespace.
   */
+ void
  db_putchar(c)
  	int	c;		/* character to output */
  {
***************
*** 183,194 ****
  /*
   * Printing
   */
- extern int	db_radix;
  
  /*VARARGS1*/
  void
  #ifdef __STDC__
! db_printf(char *fmt, ...)
  #else
  db_printf(fmt, va_alist)
  	char *fmt;
--- 191,201 ----
  /*
   * Printing
   */
  
  /*VARARGS1*/
  void
  #ifdef __STDC__
! db_printf(const char *fmt, ...)
  #else
  db_printf(fmt, va_alist)
  	char *fmt;
***************
*** 202,207 ****
--- 209,215 ----
  
  /* alternate name */
  
+ #ifdef THISFUNCTIONISNOTUSED
  /*VARARGS1*/
  void
  #ifdef __STDC__
***************
*** 216,221 ****
--- 224,230 ----
  	db_printf_guts (fmt, listp);
  	va_end(listp);
  }
+ #endif
  
  /*
   * End line if too long.
***************
*** 249,254 ****
--- 258,264 ----
  	return (p);
  }
  
+ static void
  db_printf_guts(fmt, ap)
  	register const char *fmt;
  	va_list ap;
diff -c /usr/src/sys/ddb/db_output.h /usr/ebe/sys/ddb/db_output.h
*** /usr/src/sys/ddb/db_output.h	Mon Dec 11 21:39:35 1995
--- /usr/ebe/sys/ddb/db_output.h	Thu Jan 18 11:30:00 1996
***************
*** 30,38 ****
   */
  
  /*
!  * Printing routines for kernel debugger.
   */
  void db_force_whitespace __P((void));
  int db_print_position __P((void));
  void db_end_line __P((void));
  void db_printf __P((const char *, ...));
--- 30,45 ----
   */
  
  /*
!  * Printing interface for kernel debugger.
   */
+ 
+ extern int db_output_line;
+ extern int db_max_line;
+ extern int	db_max_width;
+ extern int	db_tab_stop_width;
+ 
  void db_force_whitespace __P((void));
  int db_print_position __P((void));
  void db_end_line __P((void));
  void db_printf __P((const char *, ...));
+ void db_putchar __P((int));
diff -c /usr/src/sys/ddb/db_print.c /usr/ebe/sys/ddb/db_print.c
*** /usr/src/sys/ddb/db_print.c	Sat Oct 14 03:36:30 1995
--- /usr/ebe/sys/ddb/db_print.c	Thu Jan 18 11:45:26 1996
***************
*** 37,52 ****
  
  #include <machine/db_machdep.h>
  
  #include <ddb/db_lex.h>
  #include <ddb/db_variables.h>
  #include <ddb/db_sym.h>
  
- extern unsigned int	db_maxoff;
- 
  void
  db_show_regs()
  {
- 	int	(*func)();
  	register struct db_variable *regp;
  	db_expr_t	value, offset;
  	char *		name;
--- 37,52 ----
  
  #include <machine/db_machdep.h>
  
+ #include <ddb/db_print.h>
+ #include <ddb/db_output.h>
+ #include <ddb/db_examine.h>
  #include <ddb/db_lex.h>
  #include <ddb/db_variables.h>
  #include <ddb/db_sym.h>
  
  void
  db_show_regs()
  {
  	register struct db_variable *regp;
  	db_expr_t	value, offset;
  	char *		name;
Only in /usr/ebe/sys/ddb/: db_print.h
diff -c /usr/src/sys/ddb/db_run.c /usr/ebe/sys/ddb/db_run.c
*** /usr/src/sys/ddb/db_run.c	Sat Oct 14 03:36:32 1995
--- /usr/ebe/sys/ddb/db_run.c	Thu Jan 18 11:51:41 1996
***************
*** 41,46 ****
--- 41,50 ----
  #include <ddb/db_lex.h>
  #include <ddb/db_break.h>
  #include <ddb/db_access.h>
+ #include <ddb/db_output.h>
+ #include <ddb/db_examine.h>
+ #include <ddb/db_watch.h>
+ #include <ddb/db_command.h>
  
  int	db_run_mode;
  #define	STEP_NONE	0
***************
*** 284,291 ****
  }
  
  #endif	SOFTWARE_SSTEP
- 
- extern int	db_cmd_loop_done;
  
  /* single-step */
  /*ARGSUSED*/
--- 288,293 ----
diff -c /usr/src/sys/ddb/db_run.h /usr/ebe/sys/ddb/db_run.h
*** /usr/src/sys/ddb/db_run.h	Sat Oct 14 03:36:32 1995
--- /usr/ebe/sys/ddb/db_run.h	Wed Jan 17 12:09:43 1996
***************
*** 47,51 ****
--- 47,56 ----
  #endif
  void db_restart_at_pc __P((db_regs_t *, boolean_t));
  boolean_t db_stop_at_pc __P((db_regs_t *, boolean_t *));
+ extern void db_continue_cmd __P((db_expr_t, int, db_expr_t, char*));
+ extern void db_trace_until_call_cmd __P((db_expr_t, int, db_expr_t, char*));
+ extern void db_trace_until_matching_cmd __P((db_expr_t, int, db_expr_t, char*));
+ extern void db_single_step_cmd __P((db_expr_t, int, db_expr_t, char*));
+ extern void db_single_step __P((db_regs_t *));
  
  #endif	_DDB_DB_RUN_
diff -c /usr/src/sys/ddb/db_sym.c /usr/ebe/sys/ddb/db_sym.c
*** /usr/src/sys/ddb/db_sym.c	Mon Dec 11 21:39:36 1995
--- /usr/ebe/sys/ddb/db_sym.c	Wed Jan 17 14:11:43 1996
***************
*** 27,45 ****
   */
  
  #include <sys/param.h>
  #include <sys/proc.h>
  
  #include <machine/db_machdep.h>
  
  #include <ddb/db_sym.h>
! 
! /*
!  * We import from the symbol-table dependent routines:
!  */
! extern db_sym_t	X_db_lookup();
! extern db_sym_t	X_db_search_symbol();
! extern boolean_t X_db_line_at_pc();
! extern void	X_db_symbol_values();
  
  /*
   * Multiple symbol tables
--- 27,41 ----
   */
  
  #include <sys/param.h>
+ #include <sys/systm.h>
  #include <sys/proc.h>
  
  #include <machine/db_machdep.h>
  
  #include <ddb/db_sym.h>
! #include <ddb/db_aout.h>
! #include <ddb/db_output.h>
! #include <ddb/db_command.h>
  
  /*
   * Multiple symbol tables
***************
*** 56,62 ****
  
  db_symtab_t	*db_last_symtab;
  
! db_sym_t	db_lookup();	/* forward */
  
  /*
   * Add symbol table, with given name, to list of symbol tables.
--- 52,59 ----
  
  db_symtab_t	*db_last_symtab;
  
! static db_sym_t	db_lookup __P((char *));
! static boolean_t db_line_at_pc __P((db_sym_t, char **, int *, db_expr_t));
  
  /*
   * Add symbol table, with given name, to list of symbol tables.
***************
*** 172,178 ****
   * then only the specified symbol table will be searched;
   * otherwise, all symbol tables will be searched.
   */
! db_sym_t
  db_lookup(symstr)
  	char *symstr;
  {
--- 169,175 ----
   * then only the specified symbol table will be searched;
   * otherwise, all symbol tables will be searched.
   */
! static db_sym_t
  db_lookup(symstr)
  	char *symstr;
  {
***************
*** 225,231 ****
   */
  boolean_t db_qualify_ambiguous_names = FALSE;
  
! boolean_t
  db_symbol_is_ambiguous(sym)
  	db_sym_t	sym;
  {
--- 222,228 ----
   */
  boolean_t db_qualify_ambiguous_names = FALSE;
  
! static boolean_t
  db_symbol_is_ambiguous(sym)
  	db_sym_t	sym;
  {
***************
*** 361,367 ****
  }
  
  
! boolean_t
  db_line_at_pc( sym, filename, linenum, pc)
  	db_sym_t	sym;
  	char		**filename;
--- 358,364 ----
  }
  
  
! static boolean_t
  db_line_at_pc( sym, filename, linenum, pc)
  	db_sym_t	sym;
  	char		**filename;
diff -c /usr/src/sys/ddb/db_sym.h /usr/ebe/sys/ddb/db_sym.h
*** /usr/src/sys/ddb/db_sym.h	Sat Oct 14 03:36:35 1995
--- /usr/ebe/sys/ddb/db_sym.h	Thu Jan 18 11:43:59 1996
***************
*** 29,34 ****
--- 29,37 ----
   *	Date:	8/90
   */
  
+ #ifndef _DDB_DB_SYM_H
+ #define _DDB_DB_SYM_H
+ 
  /*
   * This module can handle multiple symbol tables
   */
***************
*** 66,71 ****
--- 69,76 ----
  					 * for multiple occurrences of a name.
  					 * Might slow down quite a bit */
  
+ extern db_expr_t db_maxoff;
+ 
  /*
   * Functions exported by the symtable module
   */
***************
*** 97,99 ****
--- 102,108 ----
  
  void db_printsym __P((db_expr_t, db_strategy_t));
  					/* print closest symbol to a value */
+ 
+ extern int db_sym_numargs __P((db_sym_t, int*, char**));
+ 
+ #endif /* _DDB_DB_SYM_H */
Only in /usr/ebe/sys/ddb/: db_trace.h
diff -c /usr/src/sys/ddb/db_trap.c /usr/ebe/sys/ddb/db_trap.c
*** /usr/src/sys/ddb/db_trap.c	Sat Oct 14 03:36:38 1995
--- /usr/ebe/sys/ddb/db_trap.c	Wed Jan 17 14:20:53 1996
***************
*** 37,47 ****
  
  #include <machine/db_machdep.h>
  
  #include <ddb/db_run.h>
  #include <ddb/db_command.h>
  #include <ddb/db_break.h>
  
! db_trap(type, code)
  	int	type, code;
  {
  	boolean_t	bkpt;
--- 37,50 ----
  
  #include <machine/db_machdep.h>
  
+ #include <ddb/db_trap.h>
  #include <ddb/db_run.h>
  #include <ddb/db_command.h>
+ #include <ddb/db_output.h>
  #include <ddb/db_break.h>
+ #include <ddb/db_examine.h>
  
! void db_trap(type, code)
  	int	type, code;
  {
  	boolean_t	bkpt;
Only in /usr/ebe/sys/ddb/: db_trap.h
diff -c /usr/src/sys/ddb/db_variables.c /usr/ebe/sys/ddb/db_variables.c
*** /usr/src/sys/ddb/db_variables.c	Sat Oct 14 03:36:39 1995
--- /usr/ebe/sys/ddb/db_variables.c	Thu Jan 18 11:45:58 1996
***************
*** 33,45 ****
  
  #include <ddb/db_lex.h>
  #include <ddb/db_variables.h>
! 
! extern unsigned int	db_maxoff;
! 
! extern int	db_radix;
! extern int	db_max_width;
! extern int	db_tab_stop_width;
! extern int	db_max_line;
  
  struct db_variable db_vars[] = {
  	{ "radix",	&db_radix, FCN_NULL },
--- 33,42 ----
  
  #include <ddb/db_lex.h>
  #include <ddb/db_variables.h>
! #include <ddb/db_expr.h>
! #include <ddb/db_command.h>
! #include <ddb/db_output.h>
! #include <ddb/db_sym.h>
  
  struct db_variable db_vars[] = {
  	{ "radix",	&db_radix, FCN_NULL },
***************
*** 50,56 ****
  };
  struct db_variable *db_evars = db_vars + sizeof(db_vars)/sizeof(db_vars[0]);
  
! int
  db_find_variable(varp)
  	struct db_variable	**varp;
  {
--- 47,55 ----
  };
  struct db_variable *db_evars = db_vars + sizeof(db_vars)/sizeof(db_vars[0]);
  
! static void db_write_variable __P((struct db_variable *, db_expr_t *));
! 
! static int
  db_find_variable(varp)
  	struct db_variable	**varp;
  {
***************
*** 105,111 ****
  }
  
  
! db_read_variable(vp, valuep)
  	struct db_variable *vp;
  	db_expr_t	*valuep;
  {
--- 104,110 ----
  }
  
  
! void db_read_variable(vp, valuep)
  	struct db_variable *vp;
  	db_expr_t	*valuep;
  {
***************
*** 117,123 ****
  	    (*func)(vp, valuep, DB_VAR_GET);
  }
  
! db_write_variable(vp, valuep)
  	struct db_variable *vp;
  	db_expr_t	*valuep;
  {
--- 116,122 ----
  	    (*func)(vp, valuep, DB_VAR_GET);
  }
  
! static void db_write_variable(vp, valuep)
  	struct db_variable *vp;
  	db_expr_t	*valuep;
  {
***************
*** 133,139 ****
  db_set_cmd()
  {
  	db_expr_t	value;
- 	int	(*func)();
  	struct db_variable *vp;
  	int	t;
  
--- 132,137 ----
diff -c /usr/src/sys/ddb/db_variables.h /usr/ebe/sys/ddb/db_variables.h
*** /usr/src/sys/ddb/db_variables.h	Sat Oct 14 03:36:40 1995
--- /usr/ebe/sys/ddb/db_variables.h	Wed Jan 17 14:46:44 1996
***************
*** 50,53 ****
--- 50,58 ----
  extern struct db_variable	db_regs[];	/* machine registers */
  extern struct db_variable	*db_eregs;
  
+ extern int db_get_variable __P((db_expr_t *));
+ extern int db_set_variable __P((db_expr_t));
+ extern void db_read_variable __P((struct db_variable *, db_expr_t *));
+ extern void db_set_cmd __P((void));
+ 
  #endif	/* _DB_VARIABLES_H_ */
diff -c /usr/src/sys/ddb/db_watch.c /usr/ebe/sys/ddb/db_watch.c
*** /usr/src/sys/ddb/db_watch.c	Sat Oct 14 03:36:42 1995
--- /usr/ebe/sys/ddb/db_watch.c	Wed Jan 17 15:24:34 1996
***************
*** 34,44 ****
--- 34,49 ----
  
  #include <machine/db_machdep.h>
  
+ #include <ddb/db_watch.h>
  #include <ddb/db_break.h>
+ #include <ddb/db_run.h>
  #include <ddb/db_watch.h>
  #include <ddb/db_lex.h>
  #include <ddb/db_access.h>
  #include <ddb/db_sym.h>
+ #include <ddb/db_expr.h>
+ #include <ddb/db_output.h>
+ #include <ddb/db_command.h>
  
  /*
   * Watchpoints.
***************
*** 52,58 ****
  db_watchpoint_t		db_free_watchpoints = 0;
  db_watchpoint_t		db_watchpoint_list = 0;
  
! db_watchpoint_t
  db_watchpoint_alloc()
  {
  	register db_watchpoint_t	watch;
--- 57,63 ----
  db_watchpoint_t		db_free_watchpoints = 0;
  db_watchpoint_t		db_watchpoint_list = 0;
  
! static db_watchpoint_t
  db_watchpoint_alloc()
  {
  	register db_watchpoint_t	watch;
***************
*** 71,77 ****
  	return (watch);
  }
  
! void
  db_watchpoint_free(watch)
  	register db_watchpoint_t	watch;
  {
--- 76,82 ----
  	return (watch);
  }
  
! static void
  db_watchpoint_free(watch)
  	register db_watchpoint_t	watch;
  {
diff -c /usr/src/sys/ddb/db_watch.h /usr/ebe/sys/ddb/db_watch.h
*** /usr/src/sys/ddb/db_watch.h	Sat Oct 14 03:36:43 1995
--- /usr/ebe/sys/ddb/db_watch.h	Wed Jan 17 15:17:33 1996
***************
*** 50,53 ****
--- 50,57 ----
  void db_delete_watchpoint __P((vm_map_t, db_addr_t));
  void db_list_watchpoints __P((void));
  
+ extern void db_listwatch_cmd __P((void));
+ extern void db_watchpoint_cmd __P((db_expr_t, int, db_expr_t, char *));
+ extern void db_deletewatch_cmd __P((db_expr_t, int, db_expr_t, char *));
+ 
  #endif	_DDB_DB_WATCH_
diff -c /usr/src/sys/ddb/db_write_cmd.c /usr/ebe/sys/ddb/db_write_cmd.c
*** /usr/src/sys/ddb/db_write_cmd.c	Sat Oct 14 03:36:44 1995
--- /usr/ebe/sys/ddb/db_write_cmd.c	Wed Jan 17 15:28:06 1996
***************
*** 34,43 ****
--- 34,46 ----
  
  #include <machine/db_machdep.h>
  
+ #include <ddb/db_write_cmd.h>
  #include <ddb/db_lex.h>
  #include <ddb/db_access.h>
  #include <ddb/db_command.h>
  #include <ddb/db_sym.h>
+ #include <ddb/db_expr.h>
+ #include <ddb/db_output.h>
  
  /*
   * Write to file.
Only in /usr/ebe/sys/ddb/: db_write_cmd.h
	================patches for src/sys/kern=============================
diff -c /usr/src/sys/kern/kern_clock.c /usr/ebe/sys/kern/kern_clock.c
*** /usr/src/sys/kern/kern_clock.c	Wed Jan 17 13:28:37 1996
--- /usr/ebe/sys/kern/kern_clock.c	Wed Jan 17 15:41:55 1996
***************
*** 1,4 ****
! /*	$NetBSD: kern_clock.c,v 1.24 1996/01/17 04:37:31 cgd Exp $	*/
  
  /*-
   * Copyright (c) 1982, 1986, 1991, 1993
--- 1,4 ----
! /*	$NetBSD: kern_clock.c,v 1.23 1995/12/28 19:16:41 thorpej Exp $	*/
  
  /*-
   * Copyright (c) 1982, 1986, 1991, 1993
***************
*** 48,53 ****
--- 48,55 ----
  #include <sys/proc.h>
  #include <sys/resourcevar.h>
  
+ #include <kern/kern_clock.h>
+ 
  #include <machine/cpu.h>
  
  #ifdef GPROF
***************
*** 200,206 ****
  	delta = tick;
  	if (tickfix) {
  		tickfixcnt++;
! 		if (tickfixcnt >= tickfixinterval) {
  			delta += tickfix;
  			tickfixcnt = 0;
  		}
--- 202,208 ----
  	delta = tick;
  	if (tickfix) {
  		tickfixcnt++;
! 		if (tickfixcnt > tickfixinterval) {
  			delta += tickfix;
  			tickfixcnt = 0;
  		}
Only in /usr/ebe/sys/kern/: kern_clock.h
diff -c /usr/src/sys/kern/kern_synch.c /usr/ebe/sys/kern/kern_synch.c
*** /usr/src/sys/kern/kern_synch.c	Sat Oct 14 03:41:18 1995
--- /usr/ebe/sys/kern/kern_synch.c	Wed Jan 17 15:37:01 1996
***************
*** 54,59 ****
--- 54,61 ----
  
  #include <machine/cpu.h>
  
+ #include <kern/kern_synch.h>
+ 
  u_char	curpriority;		/* usrpri of curproc */
  int	lbolt;			/* once a second sleep address */
  
Only in /usr/ebe/sys/kern/: kern_synch.h
Only in /usr/ebe/sys/kern/: locore.h
	================patches for src/sys/arch/i386/i386=============================
diff -c /usr/src/sys/arch/i386/i386/db_disasm.c /usr/ebe/sys/arch/i386/i386/db_disasm.c
*** /usr/src/sys/arch/i386/i386/db_disasm.c	Sat Oct 14 02:56:39 1995
--- /usr/ebe/sys/arch/i386/i386/db_disasm.c	Wed Jan 17 16:43:35 1996
***************
*** 35,40 ****
--- 35,41 ----
  #include "proc.h"
  #include <machine/db_machdep.h>
  
+ #include <ddb/db_disasm.h>
  #include <ddb/db_access.h>
  #include <ddb/db_sym.h>
  
diff -c /usr/src/sys/arch/i386/i386/db_trace.c /usr/ebe/sys/arch/i386/i386/db_trace.c
*** /usr/src/sys/arch/i386/i386/db_trace.c	Sat Oct 14 02:56:40 1995
--- /usr/ebe/sys/arch/i386/i386/db_trace.c	Wed Jan 17 16:14:10 1996
***************
*** 31,36 ****
--- 31,37 ----
  
  #include <machine/db_machdep.h>
  
+ #include <ddb/db_trace.h>
  #include <ddb/db_access.h>
  #include <ddb/db_sym.h>
  #include <ddb/db_variables.h>
	================patches for src/sys/arch/mac68k/mac68k=============================
diff -c /usr/src/sys/arch/mac68k/mac68k/machdep.c /usr/ebe/sys/arch/mac68k/mac68k/machdep.c
*** /usr/src/sys/arch/mac68k/mac68k/machdep.c	Tue Jan 16 13:24:30 1996
--- /usr/ebe/sys/arch/mac68k/mac68k/machdep.c	Thu Jan 18 13:17:25 1996
***************
*** 107,112 ****
--- 107,114 ----
  #include <sys/shm.h>
  #endif
  
+ #include <kern/locore.h>
+ 
  #include <machine/cpu.h>
  #include <machine/reg.h>
  #include <machine/psl.h>
***************
*** 1891,1897 ****
  getenvvars()
  {
  	extern u_long bootdev, videobitdepth, videosize;
! 	extern u_long end, esym;
  	extern u_long macos_boottime, MacOSROMBase;
  	extern long macos_gmtbias;
  	int     root_scsi_id;
--- 1893,1899 ----
  getenvvars()
  {
  	extern u_long bootdev, videobitdepth, videosize;
! 	extern u_long end;
  	extern u_long macos_boottime, MacOSROMBase;
  	extern long macos_gmtbias;
  	int     root_scsi_id;
diff -c /usr/src/sys/arch/mac68k/mac68k/pmap_bootstrap.c /usr/ebe/sys/arch/mac68k/mac68k/pmap_bootstrap.c
*** /usr/src/sys/arch/mac68k/mac68k/pmap_bootstrap.c	Sat Oct 14 03:09:16 1995
--- /usr/ebe/sys/arch/mac68k/mac68k/pmap_bootstrap.c	Thu Jan 18 13:21:52 1996
***************
*** 47,52 ****
--- 47,54 ----
  #include <machine/vmparam.h>
  #include <machine/cpu.h>
  
+ #include <kern/locore.h>
+ 
  #include <vm/vm.h>
  
  #define PA2VA(v, t)	(t)((u_int)(v) - firstpa)
***************
*** 549,555 ****
  bootstrap_mac68k(tc)
  	int	tc;
  {
- 	extern caddr_t	esym;
  	extern u_long	videoaddr, boothowto;
  	u_long		newvideoaddr = 0;
  	vm_offset_t	nextpa;
--- 551,556 ----
***************
*** 576,582 ****
  		if (mac68k_machine.do_graybars)
  			printf("Faked range to byte 0x%x.\n", high[0]);
  	}
! 	nextpa = load_addr + ((int)esym + NBPG - 1) & PG_FRAME;
  
  #if MFS
  	if (boothowto & RB_MINIROOT) {
--- 577,583 ----
  		if (mac68k_machine.do_graybars)
  			printf("Faked range to byte 0x%x.\n", high[0]);
  	}
! 	nextpa = load_addr + (esym + NBPG - 1) & PG_FRAME;
  
  #if MFS
  	if (boothowto & RB_MINIROOT) {
	================new header files=============================
===========================sys/ddb/db_aout.h==============================
#ifndef _DDB_DB_AOUT_H
#define _DDB_DB_AOUT_H

#include <ddb/db_sym.h>

extern boolean_t X_db_sym_numargs __P((db_symtab_t *, db_sym_t, int *, char **));
extern boolean_t X_db_line_at_pc __P((db_symtab_t *, db_sym_t, char **, 
				      int *, db_expr_t));
extern void X_db_symbol_values __P((db_sym_t, char**, db_expr_t*));
extern db_sym_t X_db_search_symbol __P((db_symtab_t *, register db_addr_t,
					db_strategy_t, db_expr_t *));
extern db_sym_t X_db_lookup __P((db_symtab_t *, char *));
extern void ddb_init __P((void));

#endif /* _DDB_DB_AOUT_H */
===========================sys/ddb/db_disasm.h==============================
#ifndef _DDB_DB_DISASM_H
#define _DDB_DB_DISASM_H

/* implementation found in arch/${MACHINE}/${MACHINE}/db_disasm.c */

extern	db_addr_t db_disasm __P((db_addr_t, boolean_t));
			/* instruction disassembler */

#endif /* _DDB_DB_DISASM_H */
===========================sys/ddb/db_examine.h==============================
extern void db_strcpy __P((register char *, register char*));
extern void db_print_loc_and_inst __P((db_addr_t));
extern void db_examine_cmd __P((db_expr_t, int, db_expr_t, char*));
extern void db_print_cmd __P((db_expr_t, int, db_expr_t, char*));
extern void db_search_cmd __P((void));

===========================sys/ddb/db_expr.h==============================
#ifndef _DDB_DB_EXPR_H
#define _DDB_DB_EXPR_H

#include <machine/db_machdep.h>		/* type definitions */

extern int db_expression __P((db_expr_t *));

#endif /* _DDB_DB_EXPR_H */
===========================sys/ddb/db_input.h==============================
extern int db_readline __P(char *, int));
extern void db_check_interrupt __P((void));
===========================sys/ddb/db_print.h==============================
extern void db_show_regs __P((void));
===========================sys/ddb/db_trace.h==============================
#ifndef _DDB_DB_TRACE_H
#define _DDB_DB_TRACE_H

/* implementation found in arch/${MACHINE}/${MACHINE}/db_trace.c */

extern void	db_stack_trace_cmd __P((db_expr_t, boolean_t, db_expr_t, char *));

#endif /* _DDB_DB_TRACE_H */
===========================sys/ddb/db_trap.h==============================
#ifndef _DDB_DB_TRAP_H
#define _DDB_DB_TRAP_H

extern void db_trap __P((int, int));

#endif /* _DDB_DB_TRAP_H */
===========================sys/ddb/db_write_cmd.h==============================
#ifndef _DDB_DB_WRITE_CMD_H
#define _DDB_DB_WRITE_CMD_H

extern void db_write_cmd __P((db_expr_t, boolean_t, db_expr_t, char *));

#endif /* _DDB_DB_WRITE_CMD_H */
===========================sys/kern/kern_clock.h===========================
#ifndef _KERN_KERN_CLOCK_H
#define _KERN_KERN_CLOCK_H

#ifdef DDB
extern void db_show_callout __P((long, int, int, char *));
#endif

#endif /* _KERN_KERN_CLOCK_H */
===========================sys/kern/kern_synch.h===========================
#ifndef _KERN_KERN_SYNCH_H
#define _KERN_KERN_SYNCH_H

#ifdef DDB
extern void db_show_all_procs __P((long, int, int, char *));
#endif

#endif /* _KERN_KERN_SYNCH_H */
===========================sys/kern/locore.h===========================
#ifndef _KERN_LOCORE_H
#define _KERN_LOCORE_H

/*
  in this file I declare some variables, that are defined in the
  architecture dependent source file(s) locore.s.

  I really don't know where these declarations are best put, but
  some header file is needed to avoid several possibly incompatible
  declarations of the same variables. Don't take the name or place
  of this file as a final suggestion...

  I don't like to put into a header file in the /usr/src/sys/sys 
  directory, as these declarations need not be available to user
  applications via /usr/include/sys.
  */

extern caddr_t esym; /* defined in architecture dependent locore.s source */
/* at some places esym was declared as char * and u_long besides caddr_t */

#endif /* _KERN_LOCORE_H */
======================end of new header files, end of message=================
>Audit-Trail:
>Unformatted: