xref: /titanic_41/usr/src/uts/common/sys/agp/agpmaster_io.h (revision ba2e4443695ee6a6f420a35cd4fc3d3346d22932)
1 /*
2  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef	_SYS_AGPMASTER_IO_H
7 #define	_SYS_AGPMASTER_IO_H
8 
9 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #ifdef _KERNEL
16 
17 #define	AGPMASTER_NAME		"agpmaster"
18 #define	AGPMASTER_DEVLINK	"/dev/agp/agpmaster"
19 
20 /* macros for layered ioctls */
21 #define	AGPMASTERIOC_BASE		'M'
22 #define	DEVICE_DETECT		_IOR(AGPMASTERIOC_BASE, 10, int)
23 #define	I8XX_GET_INFO		_IOR(AGPMASTERIOC_BASE, 11, igd_info_t)
24 #define	I810_SET_GTT_BASE	_IOW(AGPMASTERIOC_BASE, 12, uint32_t)
25 #define	I8XX_ADD2GTT		_IOW(AGPMASTERIOC_BASE, 13, igd_gtt_seg_t)
26 #define	I8XX_REM_GTT		_IOW(AGPMASTERIOC_BASE, 14, igd_gtt_seg_t)
27 #define	I8XX_UNCONFIG		_IO(AGPMASTERIOC_BASE, 16)
28 #define	AGP_MASTER_GETINFO	_IOR(AGPMASTERIOC_BASE, 20, agp_info_t)
29 #define	AGP_MASTER_SETCMD	_IOW(AGPMASTERIOC_BASE, 21, uint32_t)
30 
31 /* used for IGD to bind/unbind gtt entries */
32 typedef struct igd_gtt_seg {
33 	uint32_t	igs_pgstart;
34 	uint32_t	igs_npage;
35 	uint32_t	*igs_phyaddr; /* pointer to address array */
36 	uint32_t	igs_type; /* reserved for other memory type */
37 } igd_gtt_seg_t;
38 
39 /* used for IGD to get info */
40 typedef struct igd_info {
41 	uint32_t	igd_devid;
42 	uint32_t	igd_aperbase;
43 	size_t		igd_apersize; /* in MB */
44 } igd_info_t;
45 
46 #endif /* _KERNEL */
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif /* _SYS_AGPMASTER_IO_H */
53