/* $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. *
* 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 *
* DIGITAL assumes no responsibility for the use or reliability of its *
* software on equipment which is not supplied by DIGITAL. *
****************************************************************************/
/* 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
ReportStatus (devType
, devVersion
, ucodeVersion
, framebuffer
,
freeFramebuffer
, freeProgram
, hostMem
, rom
)
short *devVersion
, *ucodeVersion
;
MemArea
*freeFramebuffer
, *freeProgram
, *hostMem
;
register ReportStatusPacket
*rsp
;
#define h ((PacketHeader *) rsp->rsp_head)
rsp
= (ReportStatusPacket
*) AllocateSpace (sizeof (ReportStatusPacket
));
if (rsp
== NULL
) return (-1);
h
->ph_modifier
.emptymod
= 0;
h
->ph_opcode
= (rom
? REPORT_STATUS_ROM
: REPORT_STATUS
);
*(long *) h
->ph_next
= NULL
;
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
;
*framebuffer
= *(BitMap
*) rsp
->rsp_visibleFramebuffer
;
*freeFramebuffer
= *(MemArea
*) rsp
->rsp_freeFramebuffer
;
*freeProgram
= *(MemArea
*) rsp
->rsp_freeProgramMemory
;
*hostMem
= *(MemArea
*) rsp
->rsp_hostMemory
;