1: /* $Header: report.c,v 10.3 86/02/01 15:47:36 tony Rel $ */
2: /* report.c routine to do a ReportStatus call to the vs
3: *
4: * ReportStatus Get information about the workstation
5: *
6: */
7:
8: /****************************************************************************
9: * *
10: * Copyright (c) 1983, 1984 by *
11: * DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts. *
12: * All rights reserved. *
13: * *
14: * This software is furnished on an as-is basis and may be used and copied *
15: * only with inclusion of the above copyright notice. This software or any *
16: * other copies thereof may be provided or otherwise made available to *
17: * others only for non-commercial purposes. No title to or ownership of *
18: * the software is hereby transferred. *
19: * *
20: * The information in this software is subject to change without notice *
21: * and should not be construed as a commitment by DIGITAL EQUIPMENT *
22: * CORPORATION. *
23: * *
24: * DIGITAL assumes no responsibility for the use or reliability of its *
25: * software on equipment which is not supplied by DIGITAL. *
26: * *
27: * *
28: ****************************************************************************/
29:
30: #include "vs100.h"
31:
32: char *AllocateSpace();
33:
34: /* Issue a report status. This returns the device type and version (usually
35: * useless), the microcode version (also useless), a bitmap describing the
36: * frame buffer (very useful), a description of framebuffer memory
37: * that isn't mapped to the screen, a description of the program memory
38: * not used by the firmware (useful for caching data in the workstation),
39: * and a description of where to map the host Vax's memory (useful to the
40: * driver but not to anyone else). There are two versions; if rom is
41: * 1 the rom version is used; this only works before the firmware is started
42: * up. Any of the pointers may be NULL if the appropriate information
43: * isn't required.
44: */
45:
46: ReportStatus (devType, devVersion, ucodeVersion, framebuffer,
47: freeFramebuffer, freeProgram, hostMem, rom)
48: int *devType, rom;
49: short *devVersion, *ucodeVersion;
50: BitMap *framebuffer;
51: MemArea *freeFramebuffer, *freeProgram, *hostMem;
52: {
53: register ReportStatusPacket *rsp;
54: #define h ((PacketHeader *) rsp->rsp_head)
55:
56: rsp = (ReportStatusPacket *) AllocateSpace (sizeof (ReportStatusPacket));
57: if (rsp == NULL) return (-1);
58:
59: /* Format the packet */
60:
61: h->ph_modifier.emptymod = 0;
62: h->ph_opcode = (rom ? REPORT_STATUS_ROM : REPORT_STATUS);
63: *(long *) h->ph_next = NULL;
64:
65: /* And send it off */
66:
67: if (WritePacket ((caddr_t) rsp) || SynchWrites()) return (-1);
68:
69: if (devType) *devType = *(long *) rsp->rsp_deviceType;
70: if (devVersion) *devVersion = rsp->rsp_deviceVersion;
71: if (ucodeVersion) *ucodeVersion = rsp->rsp_ucodeVersion;
72: if (framebuffer)
73: *framebuffer = *(BitMap *) rsp->rsp_visibleFramebuffer;
74: if (freeFramebuffer)
75: *freeFramebuffer = *(MemArea *) rsp->rsp_freeFramebuffer;
76: if (freeProgram)
77: *freeProgram = *(MemArea *) rsp->rsp_freeProgramMemory;
78: if (hostMem)
79: *hostMem = *(MemArea *) rsp->rsp_hostMemory;
80:
81: return (0);
82: }
Defined functions
Defined macros
h
defined in line
54; used 3 times