xref: /original-bsd/sys/hp/dev/grfvar.h (revision d11ff5ba)
1 /*
2  * Copyright (c) 1988 University of Utah.
3  * Copyright (c) 1990 The Regents of the University of California.
4  * All rights reserved.
5  *
6  * This code is derived from software contributed to Berkeley by
7  * the Systems Programming Group of the University of Utah Computer
8  * Science Department.
9  *
10  * %sccs.include.redist.c%
11  *
12  * from: Utah $Hdr: grfvar.h 1.1 90/07/09$
13  *
14  *	@(#)grfvar.h	7.2 (Berkeley) 11/04/90
15  */
16 
17 #define GRFMAXLCK	256
18 
19 /* per display info */
20 struct	grf_softc {
21 	int	g_flags;		/* software flags */
22 	int	g_type;			/* type of display */
23 	struct	grfinfo g_display;	/* hardware description */
24 	struct	proc *g_lockp;		/* process holding lock */
25 	int	g_lockpslot;		/* g_pid entry of g_lockp */
26 	u_char	*g_locks;		/* lock page associated with device */
27 	short	*g_pid;			/* array of pids with device open */
28 };
29 
30 /* flags */
31 #define	GF_ALIVE	0x01
32 #define GF_OPEN		0x02
33 #define GF_EXCLUDE	0x04
34 #define GF_WANTED	0x08
35 #define GF_BSDOPEN	0x10
36 #define GF_HPUXOPEN	0x20
37 
38 /* display types - indices into grfdev */
39 #define	GT_TOPCAT	0
40 #define	GT_GATORBOX	1
41 #define	GT_RENAISSANCE	2
42 #define GT_LRCATSEYE	3
43 #define GT_HRCCATSEYE	4
44 #define GT_HRMCATSEYE	5
45 #define GT_DAVINCI	6
46 
47 struct	grfdev {
48 	int	gd_hardid;	/* secondary id returned by hardware */
49 	int	gd_softid;	/* id returned by HP-UX */
50 	int	(*gd_init)();	/* boot time initialization */
51 	int	(*gd_mode)();	/* misc functions */
52 	char	*gd_desc;	/* text description */
53 };
54 
55 /* hardware ids */
56 #define GID_GATORBOX	1
57 #define	GID_TOPCAT	2
58 #define GID_RENAISSANCE	4
59 #define GID_LRCATSEYE	5
60 #define GID_HRCCATSEYE	6
61 #define GID_HRMCATSEYE	7
62 #define GID_DAVINCI	8
63 
64 /* software ids defined in grfioctl.h */
65 
66 /* requests to mode routine */
67 #define GM_GRFON	1
68 #define GM_GRFOFF	2
69 #define GM_GRFOVON	3
70 #define GM_GRFOVOFF	4
71 
72 struct	grfreg {
73 	char	gr_pad0;
74 	u_char	gr_id;		/* +0x01 */
75 	char	gr_pad1[0x13];
76 	u_char	gr_id2;		/* +0x15 */
77 	char	gr_pad2[0x47];
78 	u_char	gr_fbomsb;	/* +0x5d */
79 	char	gr_pad3;
80 	u_char	gr_fbolsb;	/* +0x5f */
81 };
82 /* bitmapped display hardware id */
83 #define GRFHWID		0x39
84 
85 /* internal bitmapped display address */
86 #define GRFIADDR	0x560000
87 
88 /* minor device interpretation */
89 #define GRFOVDEV	0x10	/* overlay planes */
90 #define GRFIMDEV	0x20	/* images planes */
91 #define GRFUNIT(d)	((d) & 0x7)
92 
93 #ifdef KERNEL
94 extern	struct grf_softc grf_softc[];
95 #endif
96