1
/**********************************************************************
3
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
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.
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.
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.
18
* The full GNU General Public License is included in this distribution in
19
* the file called "COPYING".
21
* Contact Information:
22
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
23
* Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25
******************************************************************************/
27
#ifndef __SERVICES_PROC_H__
28
#define __SERVICES_PROC_H__
30
#include <asm/system.h>
31
#include <linux/proc_fs.h>
32
#include <linux/seq_file.h>
34
#define END_OF_FILE (off_t) -1
36
typedef off_t (pvr_read_proc_t)(IMG_CHAR *, size_t, off_t);
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);
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;
51
} PVR_PROC_SEQ_HANDLERS;
54
void* ProcSeq1ElementOff2Element(struct seq_file *sfile, loff_t off);
56
void* ProcSeq1ElementHeaderOff2Element(struct seq_file *sfile, loff_t off);
58
off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * format, ...)
59
__attribute__((format(printf, 4, 5)));
61
IMG_INT CreateProcEntries(IMG_VOID);
63
IMG_INT CreateProcReadEntry (const IMG_CHAR * name, pvr_read_proc_t handler);
65
IMG_INT CreateProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data);
67
IMG_INT CreatePerProcessProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data);
69
IMG_VOID RemoveProcEntry(const IMG_CHAR * name);
71
IMG_VOID RemovePerProcessProcEntry(const IMG_CHAR * name);
73
IMG_VOID RemoveProcEntries(IMG_VOID);
75
struct proc_dir_entry* CreateProcReadEntrySeq (
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
84
struct proc_dir_entry* CreateProcEntrySeq (
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,
94
struct proc_dir_entry* CreatePerProcessProcEntrySeq (
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
105
IMG_VOID RemoveProcEntrySeq(struct proc_dir_entry* proc_entry);
106
IMG_VOID RemovePerProcessProcEntrySeq(struct proc_dir_entry* proc_entry);