DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T r

⟦8e2111a7c⟧ TextFile

    Length: 3146 (0xc4a)
    Types: TextFile
    Names: »report.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦526ad3590⟧ »EUUGD11/gnu-31mar87/X.V10.R4.tar.Z« 
        └─⟦2109abc41⟧ 
            └─ ⟦this⟧ »./X.V10R4/libvs100/report.c« 

TextFile

/* $Header: report.c,v 10.3 86/02/01 15:47:36 tony Rel $ */
/* report.c	routine to do a ReportStatus call to the vs
 *
 *	ReportStatus	Get information about the workstation
 *
 */

/****************************************************************************
 *									    *
 *  Copyright (c) 1983, 1984 by						    *
 *  DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts.		    *
 *  All rights reserved.						    *
 * 									    *
 *  This software is furnished on an as-is basis and may be used and copied *
 *  only with inclusion of the above copyright notice. This software or any *
 *  other copies thereof may be provided or otherwise made available to     *
 *  others only for non-commercial purposes.  No title to or ownership of   *
 *  the software is hereby transferred.					    *
 * 									    *
 *  The information in this software is  subject to change without notice   *
 *  and  should  not  be  construed as  a commitment by DIGITAL EQUIPMENT   *
 *  CORPORATION.							    *
 * 									    *
 *  DIGITAL assumes no responsibility for the use  or  reliability of its   *
 *  software on equipment which is not supplied by DIGITAL.		    *
 * 									    *
 *									    *
 ****************************************************************************/

#include "vs100.h"

char *AllocateSpace();

/* Issue a report status.  This returns the device type and version (usually
 * useless), the microcode version (also useless), a bitmap describing the
 * frame buffer (very useful), a description of framebuffer memory
 * that isn't mapped to the screen, a description of the program memory
 * not used by the firmware (useful for caching data in the workstation),
 * and a description of where to map the host Vax's memory (useful to the
 * driver but not to anyone else).  There are two versions; if rom is
 * 1 the rom version is used; this only works before the firmware is started
 * up.  Any of the pointers may be NULL if the appropriate information
 * isn't required.
 */

ReportStatus (devType, devVersion, ucodeVersion, framebuffer,
		freeFramebuffer, freeProgram, hostMem, rom)
	int *devType, rom;
	short *devVersion, *ucodeVersion;
	BitMap *framebuffer;
	MemArea *freeFramebuffer, *freeProgram, *hostMem;
{
	register ReportStatusPacket *rsp;
#define	h ((PacketHeader *) rsp->rsp_head)

	rsp = (ReportStatusPacket *) AllocateSpace (sizeof (ReportStatusPacket));
	if (rsp == NULL) return (-1);

	/* Format the packet */

	h->ph_modifier.emptymod = 0;
	h->ph_opcode = (rom ? REPORT_STATUS_ROM : REPORT_STATUS);
	*(long *) h->ph_next = NULL;

	/* And send it off */

	if (WritePacket ((caddr_t) rsp) || SynchWrites()) return (-1);

	if (devType) *devType = *(long *) rsp->rsp_deviceType;
	if (devVersion) *devVersion = rsp->rsp_deviceVersion;
	if (ucodeVersion) *ucodeVersion = rsp->rsp_ucodeVersion;
	if (framebuffer)
		*framebuffer = *(BitMap *) rsp->rsp_visibleFramebuffer;
	if (freeFramebuffer)
		*freeFramebuffer = *(MemArea *) rsp->rsp_freeFramebuffer;
	if (freeProgram)
		*freeProgram = *(MemArea *) rsp->rsp_freeProgramMemory;
	if (hostMem)
		*hostMem = *(MemArea *) rsp->rsp_hostMemory;

	return (0);
}