]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h
b22081740fdbd3b1b7e8471974e4c4d1b1b2e503
[karo-tx-linux.git] / drivers / mxc / gpu-viv / hal / os / linux / kernel / gc_hal_kernel_os.h
1 /****************************************************************************
2 *
3 *    Copyright (C) 2005 - 2013 by Vivante Corp.
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 the
13 *    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., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 *****************************************************************************/
20
21
22 #ifndef __gc_hal_kernel_os_h_
23 #define __gc_hal_kernel_os_h_
24
25 typedef struct _LINUX_MDL_MAP
26 {
27     gctINT                  pid;
28     gctPOINTER              vmaAddr;
29     gctUINT32               count;
30     struct vm_area_struct * vma;
31     struct _LINUX_MDL_MAP * next;
32 }
33 LINUX_MDL_MAP;
34
35 typedef struct _LINUX_MDL_MAP * PLINUX_MDL_MAP;
36
37 typedef struct _LINUX_MDL
38 {
39     gctINT                  pid;
40     char *                  addr;
41
42     union _pages
43     {
44         /* Pointer to a array of pages. */
45         struct page *       contiguousPages;
46         /* Pointer to a array of pointers to page. */
47         struct page **      nonContiguousPages;
48     }
49     u;
50
51 #ifdef NO_DMA_COHERENT
52     gctPOINTER              kaddr;
53 #endif /* NO_DMA_COHERENT */
54
55     gctINT                  numPages;
56     gctINT                  pagedMem;
57     gctBOOL                 contiguous;
58 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
59     gctBOOL                 exact;
60 #endif
61     dma_addr_t              dmaHandle;
62     PLINUX_MDL_MAP          maps;
63     struct _LINUX_MDL *     prev;
64     struct _LINUX_MDL *     next;
65 }
66 LINUX_MDL, *PLINUX_MDL;
67
68 extern PLINUX_MDL_MAP
69 FindMdlMap(
70     IN PLINUX_MDL Mdl,
71     IN gctINT PID
72     );
73
74 typedef struct _DRIVER_ARGS
75 {
76     gctUINT64               InputBuffer;
77     gctUINT64               InputBufferSize;
78     gctUINT64               OutputBuffer;
79     gctUINT64               OutputBufferSize;
80 }
81 DRIVER_ARGS;
82
83 #endif /* __gc_hal_kernel_os_h_ */