• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  /*
2   *
3   *   Copyright (c) International Business Machines  Corp., 2001
4   *
5   *   This program is free software;  you can redistribute it and/or modify
6   *   it under the terms of the GNU General Public License as published by
7   *   the Free Software Foundation; either version 2 of the License, or
8   *   (at your option) any later version.
9   *
10   *   This program is distributed in the hope that it will be useful,
11   *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
12   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
13   *   the GNU General Public License for more details.
14   *
15   *   You should have received a copy of the GNU General Public License
16   *   along with this program;  if not, write to the Free Software
17   *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18   *
19  
20   * In this header file keep all flags and other
21   * structures that will be needed in both kernel
22   * and user space. Specifically the ioctl flags
23   * will go in here so that in user space a program
24   * can specify flags for the ioctl call.
25   *
26   * author: Kai Zhao
27   * date:   09/03/2003
28   *
29   */
30  #ifndef __TDRM_H
31  #define __TDRM_H
32  
33  #define TMOD_DRIVER_NAME	"ltp drm module"
34  #define DEVICE_NAME		"/dev/tdrm"
35  #define DRIVER_NAME     DEVICE_NAME
36  
37  #define MAG_NUM			'k'
38  #define TDRM_MAJOR      2
39  #define DRIVER_MAJOR    TDRM_MAJOR
40  #define DRIVER_MINOR     0
41  #define DRIVER_PATCHLEVEL 0
42  
43  /*--------------------------------------------------------------------------*/
44  /* This remains constant for all DRM template files.
45   */
46  #define DRM(x) tdrm_##x
47  
48  /* General customization:
49   */
50  #define __HAVE_MTRR		1
51  #define __HAVE_CTX_BITMAP	1
52  
53  
54  #define __HAVE_AGP		1
55  #define __MUST_HAVE_AGP		0
56  //#define __HAVE_DMA              1
57  
58  
59  
60  //#define TDRM_DRM_IOCTL_INTERFACE          DRM_IOW( 0x40, drm_tdrm_interface_t)
61  #define TDRM_STUB_REGISTER                DRM_IO( 0x41 )
62  #define TDRM_STUB_UNREGISTER              DRM_IO( 0x42 )
63  #define TDRM_UNINIT_AGP                   DRM_IO( 0x43 )
64  #define TDRM_INIT_AGP                     DRM_IO( 0x44 )
65  #define TDRM_ADD_MAGIC                    DRM_IO( 0x45 )
66  #define TDRM_REMOVE_MAGIC                 DRM_IO( 0x46 )
67  #define TDRM_CTXBITMAP_INIT               DRM_IO( 0x47 )
68  #define TDRM_CTXBITMAP_UNINIT             DRM_IO( 0x48 )
69  #define TDRM_ALLOC_PAGES                  DRM_IO( 0x49 )
70  #define TDRM_FREE_PAGES                   DRM_IO( 0x50 )
71  
72  #define DRIVER_IOCTLS							    \
73  	[DRM_IOCTL_NR(TDRM_STUB_REGISTER)] = {tdrm_test_stub_register , 1 , 1 }, \
74  	[DRM_IOCTL_NR(TDRM_STUB_UNREGISTER)] = {tdrm_test_stub_unregister , 1 , 1 }, \
75  	[DRM_IOCTL_NR(TDRM_UNINIT_AGP)] = {tdrm_test_uninit_agp , 1 , 1 }, \
76  	[DRM_IOCTL_NR(TDRM_INIT_AGP)] = {tdrm_test_init_agp , 1 , 1 }, \
77  	[DRM_IOCTL_NR(TDRM_ADD_MAGIC)] = {tdrm_test_add_magic , 1 , 1 }, \
78  	[DRM_IOCTL_NR(TDRM_REMOVE_MAGIC)] = {tdrm_test_remove_magic , 1 , 1 }, \
79  	[DRM_IOCTL_NR(TDRM_CTXBITMAP_INIT)] = {tdrm_test_ctxbitmap_init , 1 , 1 }, \
80  	[DRM_IOCTL_NR(TDRM_CTXBITMAP_UNINIT)] = {tdrm_test_ctxbitmap_cleanup , 1 , 1 }, \
81  	[DRM_IOCTL_NR(TDRM_ALLOC_PAGES)] = {tdrm_test_alloc_pages , 1 , 1 }, \
82  	[DRM_IOCTL_NR(TDRM_FREE_PAGES)] = {tdrm_test_free_pages , 1 , 1 }
83  
84  #endif
85  
86