/* $Header: define.h 1.9 89/06/13 $ */

/*
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

extern int stack(), Upte(), Uarea(), File(), trace(), Inode(), Snode(),
	Dev(), mount(), tty(), cmdsum(), Text(), Proc(), Sess(), stat(), Kfp(), 
	Bufhdr(), buffer(), tout(), map(), var(), exit(), nop(),
	Eng(), Every(), Dv(), Dp(), news(), expr(), set(), Dis(), Vnode(),
	Vtop(), What(), Debug(), getdballoc(), getdbfree(), getdblk(),
	getlinkblk(), getmbfree(), getmess(), getqrun(), getqueue(),
	getstream(), getstrstat();

struct	tsw	t[] = {
	"D",	"Debug",	Debug,	"change debug settings",
	"dis",	"disassemble",	Dis,	"Disassemble addr count",
	"buffer","buffer",	buffer, "buffer data",
	"b", 	"b",		buffer,	NULL,
	"hdr",	"bufhdr",	Bufhdr, "buffer headers",
	"dba",	"dballoc", 	getdballoc,"display dballoc table",
	" ",	"   value(s)",	getdballoc,"dballoc modifier (give class)",
	"dbf",	"dbfree", 	getdbfree,"display free data blocks",
	" ",	"   value(s)",	getdbfree,"dbfree modifier (give class)",
	"dbl",	"dblock", 	getdblk,"display allocated stream dblocks",
	" ",	"   -e",	getdblk,"dblock modifier (all dblocks)",
	" ",	"   -c value(s)",	getdblk,"dblock modifier (give class)",
	" ",	"   value(s)",	getdblk,"dblock identifier (give slot # or addr)",
	"dev",	"dev",		Dev,	"display devsw",
	"dp",	"dp",		Dp,	"dump physical",
	" ",	" ", 		0,	" i.e. dp addr [count] [dhoxDHOXcs]",
	"dv",	"dv",		Dv,	"dump virtual",
	" ",	" ",		0,	" i.e. dv addr [count] [dhoxDHOXcs]",
	"file",	"file",		File,	"file table",
	"f",	"f",		File,	NULL,
	"inode","inode",	Inode,	"inode table",
	"ino",	"ino",		Inode,	NULL,
	"i",	"i",		Inode,	NULL,
	"kfp",	"kfp",		Kfp,	"frame pointer for kernel stack trace start",
	"fp",	"fp",		Kfp,	NULL,
	"every","every",	Every, 	"repeat periodicaly",
	"ex",	"expr",		expr,	"evaluate expressions",
	"e",	"engine",	Eng, 	"display engine tables",
	"link",	"linkblk", 	getlinkblk,"display linkblk table",
	" ",	"   -e",	getlinkblk,"linkblk modifier (all entries)",
	" ",	"   value(s)",	getlinkblk,"linkblk identifier (give slot # or addr)",
	/*	"map",		map,	"map structures",	*/
	"mbf",	"mbfree", 	getmbfree,"display free stream msgs",
	"mbl",	"mblock", 	getmess,"display allocated stream mblocks",
	" ",	"   -e",	getmess,"mblock modifier (all mblocks)",
	" ",	"   value(s)",	getmess,"mblock identifier (give slot # or addr)",
	/*	"mount",	mount,	"mount table",	*/
	/*	"mnt",		mount,	NULL,	*/
	/*	"m",		mount,	NULL,	*/
/*	"N",	"News",		news,	"news and features",	*/
	"p",	"proc",		Proc,	"process table (one per line)",
	" ",	"     -l",	Proc,	"process table (long listing)",
	" ",	"     -r",	Proc,	"RUN & ONPROC procs only",
	" ",	"     -o",	Proc,	"ONPROC procs only",
	"qrun",	"qrun", 	getqrun,"display servicable stream queues",
	"Q",	"Queue", 	getqueue,"display allocated stream queues",
	" ",	"   -e",	getqueue,"Queue modifier (all queues)",
	" ",	"   value(s)",	getqueue,"Queue identifier (give slot # or addr)",
	"q",	"quit",		exit,	"quit or exit",
	/*	"kernel",	stack,	NULL,	*/
	/*	"k",		stack,	NULL,	*/
	"snode","snode",	Snode,	"snodes (all from inode table)",
	" ",	"   -b",	Snode,	"snode modifier (common VBLK snodes)",
	" ",	"   value",	Snode,	"snode modifier (give inode slot # or addr)",
	"strm",	"stream", 	getstream,"display allocated streams",
	" ",	"   -e",	getstream,"stream modifier (all queues)",
	" ",	"   -f",	getstream,"stream modifier (full display)",
	" ",	"   value(s)",	getstream,"stream identifier (give slot # or addr)",
	"strst","strstat", getstrstat,"display streams statistics",
	"set",	"set var=expr", set,	"set variable equal to expresion value",
	"s",	"stack",	stack,	"kernel stack trace (all procs)",
	" ",	"   -r",	stack,	"kernel stack modifier (display registers)",
	" ",	"   -f",	stack,	"kernel stack modifier (use kfp value)",
	" ",	"   -e value",	stack,	"kernel stack trace (give engine #)",
	" ",	"   value",	stack,	"kernel stack trace (give proc #)",
	"S",	"session",	Sess,	"session information",
	" ",	"   value(s)",	Sess,	"session information (give proc #)",
	/*	"stk",		stack,	NULL,	*/
	/*	"s",		stack,	NULL,	*/
	/*	"stat",		stat,	"dump statistics",	*/
	"t",	"trace",	trace,	"turn on debug tracing",
	/*	"callout",	tout,	"callout table",	*/
	/*	"calls",	tout,	NULL,	*/
	/*	"call",		tout,	NULL,	*/
	/*	"timeout",	tout,	NULL,	*/
	/*	"time",		tout,	NULL,	*/
	/*	"tout",		tout,	NULL,	*/
	/*	"c",		tout,	NULL,	*/
	/*	"trace",	trace,	"kernel stack trace",	*/
	/*	"trace -r",	trace,	"trace using saved kernel frame pointer",	*/
	/*	"t",		trace,	NULL,	*/
	/*	"tty",		tty,	"tty structures",	*/
	/*	"tty -",	tty,	"tty structures with full stty parameters",	*/
	/*	"tty type",	tty,	"use type tty structure (i.e.,dz,dzb,dh,kl)",	*/
	/*	"term",		tty,	NULL,	*/
	/*	"dz",		tty,	NULL,	*/
	/*	"dh",		tty,	NULL,	*/
	"upte",	"upte",		Upte,	"dump user pte's (give proc #)",
	"u",	"user",		Uarea,	"display user area (give proc #)",
	/*	"var",		var,	"system variables",	*/
	/*	"tunables",	var,	NULL,	*/
	/*	"tunable",	var,	NULL,	*/
	/*	"tune",		var,	NULL,	*/
	/*	"v",		var,	NULL,	*/
	"vnode", "vnode",	Vnode,	"dump a vnode table (sortof)",
	"vtop",	"vtop",		Vtop,	"virtual to physical",
	" ",	"!",		nop,	"escape to shell",
	" ",    "!!",		nop,	"repeat last command",
	" ",	". <file>",	nop,	"source a file",
	"?",	"?",		cmdsum,	"print this list of available commands",
	"h",	"help",		cmdsum, "print this list of available commands",
	"w",	"what",		What,	"interpret addresses, symbols or expressions",
	NULL,		NULL,	NULL
};

struct	prmode	prm[] = {
	"d",		DEC2,
	"D",		DEC4,
	"o",		OCT2,
	"O",		OCT4,
	"x",		HEX2,
	"X",		HEX4,
	"c",		CHAR,
	"b",		BYTE,
	"inode",	INODE,
	"ino",		INODE,
	"directory",	DIRECT,
	"direct",	DIRECT,
	"dir",		DIRECT,
	"write",	WRITE,
	"w",		WRITE,
	"s",		STRING,
	NULL,		NULL
} ;

extern getsymboltable(), getsysmap(), eng_init(), proc_init(), heuristics();
extern sess_init(), dev_init();
extern inode_init(), vnode_init(), buffer_init(), file_init(), stream_init();

struct initfuns initfuns[] = {
	getsymboltable,
	getsysmap,
	eng_init,
	proc_init,
	sess_init,
	heuristics,
	vnode_init,
	inode_init,
	buffer_init,
	file_init,
	stream_init,
	dev_init,
	NULL
};
