/* $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.
 */

#ident	"$Header: lintasm.c 1.43 90/07/24 $"

/*
 * lintasm.c
 *	Provide C-declarations for asm-declared procedures/data, for lint.
 */

/* $Log:	lintasm.c,v $
 */

#include "sys/types.h"
#include "sys/param.h"
#include "sys/debug.h"
#include "sys/devsw.h"
#include "sys/mutex.h"
#include "sys/buf.h"
#include "sys/vm.h"
#include "sys/signal.h"
#include "sys/user.h"
#include "sys/cmap.h"
#include "sys/map.h"
#include "sys/timer.h"
#include "sys/proc.h"
#include "sys/uio.h"

#include "sys/engine.h"
#include "sys/slic.h"
#include "sys/cfg.h"

#include "sys/pte.h"
#include "sys/gate.h"
#include "sys/trap.h"
#include "sys/plocal.h"
#include "sys/intctl.h"
#include "sys/psl.h"
#include "sys/session.h"
#include "sys/stream.h"
#include "sys/cmn_err.h"

/*ARGSUSED*/
useracc(base, count, rw) char *base; uint count; { return(0); }

/*ARGSUSED*/
bcopy(from, to, count) char *from, *to; unsigned count; { /*NOTREACHED*/ }

/*ARGSUSED*/
ovbcopy(from, to, size) char *from, *to; unsigned size; { /*NOTREACHED*/ }

/*ARGSUSED*/
bzero(base, length) char *base; unsigned length; { /*NOTREACHED*/ }

/*ARGSUSED*/
ptefill(pte, val, cnt) struct pte *pte; { /*NOTREACHED*/ }

save() { return(0); }

/*ARGSUSED*/
resume(curproc, newproc, locked)
	struct proc *curproc, *newproc, *locked; { /*NOTREACHED*/ }

use_private() { /*NOTREACHED*/ }

disable_fpu() { /*NOTREACHED*/ }

restore_fpu() { /*NOTREACHED*/ }

save_fpu() { /*NOTREACHED*/ }

char	icode[];
int	szicode;
int	etext;
int	(*probe_nmi)();

spl_t	spl0() { return(0); }
spl_t	spl1() { return(0); }
spl_t	spl5() { return(0); }
spl_t	splimp() { return(0); }
spl_t	splhi() { return(0); }
spl_t	getspl() { return(0); }

/*ARGSUSED*/
splx(s) spl_t s; { /*NOTREACHED*/ }

swt_undef() { /*NOTREACHED*/ }

resched() { /*NOTREACHED*/ }

undef() { /*NOTREACHED*/ }

/*ARGSUSED*/
addupc(upc, u_prof, ticks) struct uprof *u_prof; { /*NOTREACHED*/ }

/*ARGSUSED*/
bcmp(s1, s2, n) char *s1, *s2; unsigned n; { return(0); }

/*ARGSUSED*/
ffs(mask) int mask; { return(0); }

/*ARGSUSED*/
strlen(string) char *string; { return(0); }

/*ARGSUSED*/
setjmp(jmp_buf) label_t *jmp_buf; { return(0); }

/*ARGSUSED*/
fsetjmp(jmp_buf) label_t *jmp_buf; { return(0); }

saveregs() { return(0); }

/*ARGSUSED*/
longjmp(jmp_buf) label_t *jmp_buf; { /*NOTREACHED*/ }

/*ARGSUSED*/
pushlongjmp(uarea, jmp_buf)
	struct user *uarea;
	label_t *jmp_buf;
{ /*NOTREACHED*/ }

/*ARGSUSED*/
int READ_DSR() { return(0); }

/*ARGSUSED*/
void WRITE_DSR(val) int val; {/*NOTREACHED*/}

/*ARGSUSED*/
void WRITE_DCR(val) int val; {/*NOTREACHED*/}

/*ARGSUSED*/
void WRITE_DB0(val) int val; {/*NOTREACHED*/}

/*ARGSUSED*/
void WRITE_DB1(val) int val; {/*NOTREACHED*/}

/*ARGSUSED*/
void WRITE_DB2(val) int val; {/*NOTREACHED*/}

/*ARGSUSED*/
void WRITE_DB3(val) int val; {/*NOTREACHED*/}

/*ARGSUSED*/
void WRITE_DB6(val) int val; {/*NOTREACHED*/}

/*ARGSUSED*/
void WRITE_DB7(val) int val; {/*NOTREACHED*/}

/*ARGSUSED*/
int READ_DB0(){ return(0); }

/*ARGSUSED*/
int READ_DB1(){ return(0);}

/*ARGSUSED*/
int READ_DB2(){ return(0);}

/*ARGSUSED*/
int READ_DB3(){ return(0);}

/*ARGSUSED*/
int READ_DB6(){ return(0);}

/*ARGSUSED*/
int READ_DB7(){ return(0);}

struct	user	u;
struct	plocal	l;

short	upyet;

/*
 * Make refs to things called from asm or conditionally configured.
 */

refstuff(i)
{
	extern	int	(*softvec[])();
	extern	int	(*swtrapvec[])();
	extern	int	syscall_nhandler;
#ifdef DEBUG
	extern	int	allocbcnt();
#endif
	extern	int	bdevcnt;
	extern	int	cdevcnt;
	extern	int	cstrcnt;
	extern	struct streamtab	*cstrtab[];
	extern	mblk_t	*allocb_priv();
	extern	int     stablesize;
	extern	char	slic_to_pic[];
	void hardclock();
	spl_t	s;

	cmn_err(CE_NOTE, "use this var %d\n", bdevcnt);
	cmn_err(CE_NOTE, "use this var %d\n", cdevcnt);
	cmn_err(CE_NOTE, "use this var %d\n", cstrcnt);
	cmn_err(CE_NOTE, "use this var %d\n", (int)cstrtab[1]);
	cmn_err(CE_NOTE, "use this var %d\n", stablesize);
	sysinit("","");
	(void)_useracc((caddr_t)NULL, sizeof(i), 1);
	/*
	 * "service" functions provided by str_mm.c.
	 * Some of them are hooks to support stream module debugging
	 */
	(void)testb(sizeof(int), BPRI_HI);
	slic_to_pic[0] = '\0';
#ifdef DEBUG
	fail_allocb(0);
	unfail_allocb();
	(void)allocbcnt(0);
	(void)freemblkbcnt();
	print_msg((mblk_t *)0);
	(void)dumpmsg((mblk_t *)0);
#endif
	(void)allocb_priv((unsigned char *)0, 0, 0, NULL, 0);
	(void)rmvb((mblk_t *)0, (mblk_t *)0);
	(void)adjmsg((mblk_t *)0, 0);
	(void)putctl1((queue_t *)0, 0, 0);
	(void)strlog(0, 0, 0, 0, (char *)0, 0);
	/*
	 * "service" routines from str_q.c
	 */
	 (void)putctl((queue_t *)NULL, 4);
	 put((queue_t *)NULL, (mblk_t *)NULL);
	 (void)backq((queue_t *)0);

	(void)suibyte((char *)NULL, 0);

	s = spl5();
	s = spl6();
	(void)getspl();
	splx(s);
	trap(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	nosyscall(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	lint_ref_int(syscall_nhandler);
	systrap(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	sigclean(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	hardclock(i, 0, 0, 0, 0, (caddr_t)0, 0);
	minphys((struct buf *)0);

	(*softvec[0])();
	(*swtrapvec[0])();

	setgm(0,0);

	(void) fuibyte((caddr_t)0);

	bufalloc((struct buf *)0);
	buffree((struct buf *)0);

	fpa_trap((long) 0);

	(void) rdSubslave((unchar)0, (unchar)0, (unchar)0);
	wrSubslave((unchar)0, (unchar)0, (unchar)0, (unchar)0);

	(void) copyoutstr((char *)0, (char *)0, 0, (int *)0);

#ifdef	KERNEL_PROFILING
	(void) kp_nmi(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
#endif	/* KERNEL_PROFILING  */
	WRITE_DCR(0);
	WRITE_DB0(0);
	WRITE_DB1(0);
	WRITE_DB2(0);
	WRITE_DB3(0);
	WRITE_DB6(0);
	WRITE_DB7(0);
}

/*
 * Procedure to reference an integer, to satisfy various lint gripes
 * (variables decleared for 032 & SGS portability that aren't used in SGS).
 */

lint_ref_int(i) int i; { refstuff(i); }

/*ARGSUSED*/
copyin(from, to, count) char *from, *to; uint count; { return(0); }

/*ARGSUSED*/
copyout(from, to, count) char *from, *to; uint count; { return(0); }

/*ARGSUSED*/
copyinstr(fromaddr, toaddr, maxlen, lencopied)
	char	*fromaddr, *toaddr;
	int	maxlen, *lencopied;
{ return(0); }

/*ARGSUSED*/
copyoutstr(fromaddr, toaddr, maxlen, lencopied)
	char	*fromaddr, *toaddr;
	int	maxlen, *lencopied;
{ return(0); }

/*ARGSUSED*/
copystr(fromaddr, toaddr, maxlen, lencopied)
	char	*fromaddr, *toaddr;
	int	maxlen, *lencopied;
{ return(0); }

/*ARGSUSED*/
fubyte(address) char *address; { return(0); }

/*ARGSUSED*/
fuibyte(address) char *address; { return(0); }

/*ARGSUSED*/
fuword(address) char *address; { return(0); }

/*ARGSUSED*/
fuiword(address) char *address; { return(0); }

/*ARGSUSED*/
subyte(address, data) char *address; char data; { return(0); }

/*ARGSUSED*/
suibyte(address, data) char *address; char data; { return(0); }

/*ARGSUSED*/
suword(address, data) char *address; int data; { return(0); }

/*ARGSUSED*/
suiword(address, data) char *address; int data; { return(0); }

/*ARGSUSED*/
ustrlen(str, lencopied)
	caddr_t	str;
	int *lencopied;
{ return(0); }

/*ARGSUSED*/
void insque_s(entry, predecessor) list_t *entry, *predecessor; {/*NOTREACHED*/}

/*ARGSUSED*/
void remque_s(entry) list_t *entry;  {/*NOTREACHED*/}

/*ARGSUSED*/
void L_INCR(addr) ulong *addr; {/*NOTREACHED*/}

/*ARGSUSED*/
void L_DECR(addr) ulong *addr; {/*NOTREACHED*/}

/*ARGSUSED*/
void copyseg(vpn, paddr) unsigned vpn; unsigned paddr; {/*NOTREACHED*/}

/*ARGSUSED*/
copyphys(sphys, tphys) unsigned sphys; unsigned tphys; {/*NOTREACHED*/}

/*ARGSUSED*/
pgcopy(from, to) caddr_t from; caddr_t to; {/*NOTREACHED*/}

/*ARGSUSED*/
clearseg(base) unsigned base; {/*NOTREACHED*/}

/*ARGSUSED*/
unsigned READ_PTROOT() { return(0); }

/*ARGSUSED*/
LFLUSH_TLB() {/*NOTREACHED*/}

/*ARGSUSED*/
#ifdef	MODELD
WRITE_MSW(val) unsigned val; {/*NOTREACHED*/}
#else	/* !MODELD */
WRITE_MSW(val) int val; {/*NOTREACHED*/}
#endif	/* MODELD */

#ifdef	MODELD
void INVAL_ONCHIP_CACHE(){}

unsigned READ_MSW() { return(0); }
#endif	/* MODELD */

/*ARGSUSED*/
init_fpu() {/*NOTREACHED*/}

/*ARGSUSED*/
void setup_seg_regs() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_nmi() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_diverr() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_dbg() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_int3() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_into() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_check() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_und() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_dna() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_syserr() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_res() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_badtss() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_notpres() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_stkflt() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_gpflt() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_pgflt() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_coperr() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_svc0() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_svc1() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_svc2() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_svc3() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_svc4() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_svc5() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_svc6() {/*NOTREACHED*/}

/*ARGSUSED*/
void bin0int() {/*NOTREACHED*/}

/*ARGSUSED*/
void bin1int() {/*NOTREACHED*/}

/*ARGSUSED*/
void bin2int() {/*NOTREACHED*/}

/*ARGSUSED*/
void bin3int() {/*NOTREACHED*/}

/*ARGSUSED*/
void bin4int() {/*NOTREACHED*/}

/*ARGSUSED*/
void bin5int() {/*NOTREACHED*/}

/*ARGSUSED*/
void bin6int() {/*NOTREACHED*/}

/*ARGSUSED*/
void bin7int() {/*NOTREACHED*/}

/*ARGSUSED*/
void t_fpa() {/*NOTREACHED*/}

/*ARGSUSED*/
void sys_call() {/*NOTREACHED*/}

/*ARGSUSED*/
void sig_clean() {/*NOTREACHED*/}

/*ARGSUSED*/
enable_nmi() {/*NOTREACHED*/}

/*ARGSUSED*/
spl_t cp_lock(lock, spl) lock_t *lock; spl_t spl; { return(0); }

/*ARGSUSED*/
void p_gate(g) gate_t *g; {/*NOTREACHED*/}

/*ARGSUSED*/
bool_t cp_gate(g) gate_t *g; { return(0); }

/*ARGSUSED*/
void v_gate_asm(g) gate_t *g; {/*NOTREACHED*/}

#ifdef DEBUG
/*ARGSUSED*/
void v_gate_dbg() {/*NOTREACHED*/}
#endif

/*ARGSUSED*/
spl_t p_lock(lock, spl) lock_t *lock; spl_t spl; { return(SPL0); }

/*ARGSUSED*/
void v_lock(lock, spl) lock_t *lock; spl_t spl; {/*NOTREACHED*/}

/*ARGSUSED*/
void DISABLE() {/*NOTREACHED*/}

/*ARGSUSED*/
void ENABLE() {/*NOTREACHED*/}

/*ARGSUSED*/
WRITE_PTROOT(val) unsigned val; {/*NOTREACHED*/}

#ifdef	EMULA_FPA
void wfpusave(fpusave) struct fpusave *fpusave; { fpusave->fpu_status = 0; }
 
void wfpurestor(fpusave) struct fpusave *fpusave; { fpusave->fpu_status = 0; }

void init_i387() { return; } 
 
int get_sw() { return(0); }
 
/*ARGSUSED*/
void set_cw(val) { return; }
 
void adds(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void adds_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void addd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; }
 
void addd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void floats(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void floatd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void fixs(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 

void fixs_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void fixd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 

void fixd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void cvtds(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void cvtds_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void cvtsd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void cvtsd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void muls(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void muls_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void muld(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void muld_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void subs(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void subs_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void subd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void subd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void divs(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void divs_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void divd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void divd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void mulns(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void mulns_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void mulnd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void mulnd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void cmps(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void cmps_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void cmpd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void cmpd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void tsts(src) long *src; { *src = 0; return; } 
 
void tsts_fast(src) long *src; { *src = 0; return; } 
 
void tstd(src) long *src; { *src = 0; return; } 
 
void tstd_fast(src) long *src; { *src = 0; return; } 
 
void negs(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void negs_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void negd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void negd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void abss(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void abss_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void absd(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void absd_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void amuls(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void amuls_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void amuld(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void amuld_fast(src, dst) long *src, *dst; { *src = 0; *dst = 0; return; } 
 
void macs(src, dst, acc) long *src, *dst, *acc; { *src = 0; *dst = 0; *acc = 0; return; }
 
void macs_fast(src, dst, acc) long *src, *dst, *acc; { *src = 0; *dst = 0; *acc = 0; return; }
 
void macd(src, dst, acc) long *src, *dst, *acc; { *src = 0; *dst = 0; *acc = 0; return; } 
 
void macd_fast(src, dst, acc) long *src, *dst, *acc; { *src = 0; *dst = 0; *acc = 0; return; } 

int segdesc_D() {return(1);}

void loads(src, dst) long *src, *dst; { *src = 0; *dst = 0; }

void loadd(src, dst) long *src, *dst; { *src = 0; *dst = 0; }
#endif	/* EMULA_FPA */
