diff options
Diffstat (limited to 'drivers/gpu/pvr/proc.h')
-rw-r--r-- | drivers/gpu/pvr/proc.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/proc.h b/drivers/gpu/pvr/proc.h new file mode 100644 index 00000000000..823b666176b --- /dev/null +++ b/drivers/gpu/pvr/proc.h | |||
@@ -0,0 +1,108 @@ | |||
1 | /********************************************************************** | ||
2 | * | ||
3 | * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful but, except | ||
10 | * as otherwise stated in writing, without any warranty; without even the | ||
11 | * implied warranty of merchantability or fitness for a particular purpose. | ||
12 | * See the GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in | ||
19 | * the file called "COPYING". | ||
20 | * | ||
21 | * Contact Information: | ||
22 | * Imagination Technologies Ltd. <gpl-support@imgtec.com> | ||
23 | * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK | ||
24 | * | ||
25 | ******************************************************************************/ | ||
26 | |||
27 | #ifndef __SERVICES_PROC_H__ | ||
28 | #define __SERVICES_PROC_H__ | ||
29 | |||
30 | #include <asm/system.h> | ||
31 | #include <linux/proc_fs.h> | ||
32 | #include <linux/seq_file.h> | ||
33 | |||
34 | #define END_OF_FILE (off_t) -1 | ||
35 | |||
36 | typedef off_t (pvr_read_proc_t)(IMG_CHAR *, size_t, off_t); | ||
37 | |||
38 | |||
39 | #define PVR_PROC_SEQ_START_TOKEN (void*)1 | ||
40 | typedef void* (pvr_next_proc_seq_t)(struct seq_file *,void*,loff_t); | ||
41 | typedef void* (pvr_off2element_proc_seq_t)(struct seq_file *, loff_t); | ||
42 | typedef void (pvr_show_proc_seq_t)(struct seq_file *,void*); | ||
43 | typedef void (pvr_startstop_proc_seq_t)(struct seq_file *, IMG_BOOL start); | ||
44 | |||
45 | typedef struct _PVR_PROC_SEQ_HANDLERS_ { | ||
46 | pvr_next_proc_seq_t *next; | ||
47 | pvr_show_proc_seq_t *show; | ||
48 | pvr_off2element_proc_seq_t *off2element; | ||
49 | pvr_startstop_proc_seq_t *startstop; | ||
50 | IMG_VOID *data; | ||
51 | } PVR_PROC_SEQ_HANDLERS; | ||
52 | |||
53 | |||
54 | void* ProcSeq1ElementOff2Element(struct seq_file *sfile, loff_t off); | ||
55 | |||
56 | void* ProcSeq1ElementHeaderOff2Element(struct seq_file *sfile, loff_t off); | ||
57 | |||
58 | off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * format, ...) | ||
59 | __attribute__((format(printf, 4, 5))); | ||
60 | |||
61 | IMG_INT CreateProcEntries(IMG_VOID); | ||
62 | |||
63 | IMG_INT CreateProcReadEntry (const IMG_CHAR * name, pvr_read_proc_t handler); | ||
64 | |||
65 | IMG_INT CreateProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data); | ||
66 | |||
67 | IMG_INT CreatePerProcessProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data); | ||
68 | |||
69 | IMG_VOID RemoveProcEntry(const IMG_CHAR * name); | ||
70 | |||
71 | IMG_VOID RemovePerProcessProcEntry(const IMG_CHAR * name); | ||
72 | |||
73 | IMG_VOID RemoveProcEntries(IMG_VOID); | ||
74 | |||
75 | struct proc_dir_entry* CreateProcReadEntrySeq ( | ||
76 | const IMG_CHAR* name, | ||
77 | IMG_VOID* data, | ||
78 | pvr_next_proc_seq_t next_handler, | ||
79 | pvr_show_proc_seq_t show_handler, | ||
80 | pvr_off2element_proc_seq_t off2element_handler, | ||
81 | pvr_startstop_proc_seq_t startstop_handler | ||
82 | ); | ||
83 | |||
84 | struct proc_dir_entry* CreateProcEntrySeq ( | ||
85 | const IMG_CHAR* name, | ||
86 | IMG_VOID* data, | ||
87 | pvr_next_proc_seq_t next_handler, | ||
88 | pvr_show_proc_seq_t show_handler, | ||
89 | pvr_off2element_proc_seq_t off2element_handler, | ||
90 | pvr_startstop_proc_seq_t startstop_handler, | ||
91 | write_proc_t whandler | ||
92 | ); | ||
93 | |||
94 | struct proc_dir_entry* CreatePerProcessProcEntrySeq ( | ||
95 | const IMG_CHAR* name, | ||
96 | IMG_VOID* data, | ||
97 | pvr_next_proc_seq_t next_handler, | ||
98 | pvr_show_proc_seq_t show_handler, | ||
99 | pvr_off2element_proc_seq_t off2element_handler, | ||
100 | pvr_startstop_proc_seq_t startstop_handler, | ||
101 | write_proc_t whandler | ||
102 | ); | ||
103 | |||
104 | |||
105 | IMG_VOID RemoveProcEntrySeq(struct proc_dir_entry* proc_entry); | ||
106 | IMG_VOID RemovePerProcessProcEntrySeq(struct proc_dir_entry* proc_entry); | ||
107 | |||
108 | #endif | ||