diff options
Diffstat (limited to 'drivers/gpu/pvr/services4/srvkm/env/linux/proc.h')
| -rwxr-xr-x[-rw-r--r--] | drivers/gpu/pvr/services4/srvkm/env/linux/proc.h | 104 |
1 files changed, 32 insertions, 72 deletions
diff --git a/drivers/gpu/pvr/services4/srvkm/env/linux/proc.h b/drivers/gpu/pvr/services4/srvkm/env/linux/proc.h index 62c6dafc0ad..e3abec2bb33 100644..100755 --- a/drivers/gpu/pvr/services4/srvkm/env/linux/proc.h +++ b/drivers/gpu/pvr/services4/srvkm/env/linux/proc.h @@ -44,18 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __SERVICES_PROC_H__ #define __SERVICES_PROC_H__ -#include <asm/system.h> // va_list etc -#include <linux/proc_fs.h> // read_proc_t etc -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) -typedef int (read_proc_t)(char *page, char **start, off_t off, int count, int *eof, void *data); -typedef int (write_proc_t)(struct file *file, const char __user *buffer, unsigned long count, void *data); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) +#include <asm/system.h> #endif -#include <linux/seq_file.h> // seq_file - -#define END_OF_FILE (off_t) -1 - -typedef off_t (pvr_read_proc_t)(IMG_CHAR *, size_t, off_t); +#include <linux/seq_file.h> +#include "img_defs.h" +struct pvr_proc_dir_entry; #define PVR_PROC_SEQ_START_TOKEN (void*)1 typedef void* (pvr_next_proc_seq_t)(struct seq_file *,void*,loff_t); @@ -63,73 +58,38 @@ typedef void* (pvr_off2element_proc_seq_t)(struct seq_file *, loff_t); typedef void (pvr_show_proc_seq_t)(struct seq_file *,void*); typedef void (pvr_startstop_proc_seq_t)(struct seq_file *, IMG_BOOL start); -typedef struct _PVR_PROC_SEQ_HANDLERS_ { - pvr_next_proc_seq_t *next; - pvr_show_proc_seq_t *show; - pvr_off2element_proc_seq_t *off2element; - pvr_startstop_proc_seq_t *startstop; - IMG_VOID *data; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) - read_proc_t *read_proc; - write_proc_t *write_proc; -#endif -} PVR_PROC_SEQ_HANDLERS; - - -/** off2element function for elements with only ONE element (no header) */ -void* ProcSeq1ElementOff2Element(struct seq_file *sfile, loff_t off); - -/** off2element function for elements with only ONE element (+ header) */ -void* ProcSeq1ElementHeaderOff2Element(struct seq_file *sfile, loff_t off); - -off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * format, ...) - __attribute__((format(printf, 4, 5))); - -IMG_INT CreateProcEntries(IMG_VOID); - -IMG_INT CreateProcReadEntry (const IMG_CHAR * name, pvr_read_proc_t handler); - -IMG_INT CreateProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data); - -IMG_INT CreatePerProcessProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data); - -IMG_VOID RemoveProcEntry(const IMG_CHAR * name); - -IMG_VOID RemovePerProcessProcEntry(const IMG_CHAR * name); +typedef int (pvr_proc_write_t)(struct file *file, const char __user *buffer, + unsigned long count, void *data); -IMG_VOID RemoveProcEntries(IMG_VOID); +IMG_INT CreateProcEntries(void); +void RemoveProcEntries(void); -struct proc_dir_entry* CreateProcReadEntrySeq ( - const IMG_CHAR* name, - IMG_VOID* data, - pvr_next_proc_seq_t next_handler, - pvr_show_proc_seq_t show_handler, - pvr_off2element_proc_seq_t off2element_handler, - pvr_startstop_proc_seq_t startstop_handler - ); +struct pvr_proc_dir_entry* CreateProcReadEntrySeq(const IMG_CHAR* name, + IMG_VOID* data, + pvr_next_proc_seq_t next_handler, + pvr_show_proc_seq_t show_handler, + pvr_off2element_proc_seq_t off2element_handler, + pvr_startstop_proc_seq_t startstop_handler); -struct proc_dir_entry* CreateProcEntrySeq ( - const IMG_CHAR* name, - IMG_VOID* data, - pvr_next_proc_seq_t next_handler, - pvr_show_proc_seq_t show_handler, - pvr_off2element_proc_seq_t off2element_handler, - pvr_startstop_proc_seq_t startstop_handler, - write_proc_t whandler - ); +struct pvr_proc_dir_entry* CreateProcEntrySeq(const IMG_CHAR* name, + IMG_VOID* data, + pvr_next_proc_seq_t next_handler, + pvr_show_proc_seq_t show_handler, + pvr_off2element_proc_seq_t off2element_handler, + pvr_startstop_proc_seq_t startstop_handler, + pvr_proc_write_t whandler); -struct proc_dir_entry* CreatePerProcessProcEntrySeq ( - const IMG_CHAR* name, - IMG_VOID* data, - pvr_next_proc_seq_t next_handler, - pvr_show_proc_seq_t show_handler, - pvr_off2element_proc_seq_t off2element_handler, - pvr_startstop_proc_seq_t startstop_handler, - write_proc_t whandler - ); +struct pvr_proc_dir_entry* CreatePerProcessProcEntrySeq(const IMG_CHAR* name, + IMG_VOID* data, + pvr_next_proc_seq_t next_handler, + pvr_show_proc_seq_t show_handler, + pvr_off2element_proc_seq_t off2element_handler, + pvr_startstop_proc_seq_t startstop_handler, + pvr_proc_write_t whandler); +void RemoveProcEntrySeq(struct pvr_proc_dir_entry* proc_entry); +void RemovePerProcessProcEntrySeq(struct pvr_proc_dir_entry* proc_entry); -IMG_VOID RemoveProcEntrySeq(struct proc_dir_entry* proc_entry); -IMG_VOID RemovePerProcessProcEntrySeq(struct proc_dir_entry* proc_entry); +void *PVRProcGetData(struct pvr_proc_dir_entry* ppde); #endif |