#ident "$Id: logging.c,v 1.9 1997/10/22 21:52:22 gary Exp $"
/*****************************************************************************
 * Copyright (c) 1988-95 Digi International Inc., All Rights Reserved
 * 
 * This  software  contains  proprietary  and  confidential   information   of
 * Digi International  Inc.   By  accepting  transfer  of this copy, Recipient
 * agrees to retain this software in  confidence,  to  prevent  disclosure  to
 * others,  and  to make no  use of this software other than that for which it
 * was delivered.  This is an unpublished copyright work  Digi   International
 * Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is
 * strictly prohibited.
 * 
 * Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc.
 * Confidential  when   combined   with   the   aggregated  modules  for  this
 * product) OBJECT CODE ONLY SOURCE MATERIALS
 * 
 * (C) COPYRIGHT Digi International Inc. 1995
 * 
 * All Rights Reserved
 * 
 * US   Government   Users   Restricted   Rights   -   Use,   duplication   or
 * disclosure  restricted by GSA ADP Schedule Contract with Digi International
 * Inc.
 * 
 *****************************************************************************/


/*
 *  LOGGING.C
 */

/*
 *	 /projects/common/PBRAIN/SCCS/pbrainF/dev/embed/common/71/s.logging.c
 *	@(#)logging.c	1.1
 *
 *	Last delta created	12:47:57 6/25/92
 *	This file extracted	15:40:30 10/29/92
 *
 *	Modifications:
 *
 *	GMK	Jun 	91	New file created
 *				mprintf prints across the bus.
 *				It is streams based and can only be used
 *				once streams have been started.
 *				Fixed portability problem in phex.
 *
 */

#define PRINTBUFSZ 100

#include "types.h"
#ifdef DXB
#include "dxbusinc.h"
#include "dxbshare.h"
#else
#include "sxbusinc.h"
#include "sxbshare.h"
#endif
#include "emul.h"
#include "slot.h"

#ifdef	GAT
extern void trace();
#endif

extern struct mslot *mslots;
extern struct pollq_t *pollq, *pq;
extern strm_t *shead[];
extern struct streamtab headinfo;

#ifndef SOH
strlog(mid,sid,level,flags,fmt)
short   mid ;
short   sid ;
char    level ;
ushort  flags ;
char    *fmt ;
{
    printf(fmt);
}
#endif

init_print_queue()
{
    strm_t *s;
    strm_t *news();

    if ((s = shead[0] = news(headinfo.st_rdinit, headinfo.st_wrinit)) ==
	(strm_t *)0)
    {
    	printf("Failed to initialise print queue!\n");
	return -1;
    }

#ifndef	SQUEEZE
    RD(shead[0]->str_sq)->q_ptr = (caddr_t)mslots;
#else
    RD(shead[0]->str_sq)->q_ptr_b.q_ptr_m = (ulong)mslots;
#endif
#ifndef	SQUEEZE
    shead[0]->str_sq->q_ptr = (caddr_t)mslots;
#else
    shead[0]->str_sq->q_ptr_b.q_ptr_m = (ulong)mslots;
#endif

    mslots->strm = shead[0];

    return;
}
