OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [proc_fs.h] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _LINUX_PROC_FS_H
2
#define _LINUX_PROC_FS_H
3
 
4
#include <linux/fs.h>
5
#include <linux/malloc.h>
6
 
7
/*
8
 * The proc filesystem constants/structures
9
 */
10
 
11
/*
12
 * We always define these enumerators
13
 */
14
 
15
enum root_directory_inos {
16
        PROC_ROOT_INO = 1,
17
        PROC_LOADAVG,
18
        PROC_UPTIME,
19
        PROC_MEMINFO,
20
        PROC_KMSG,
21
        PROC_VERSION,
22
        PROC_CPUINFO,
23
        PROC_PCI,
24
        PROC_SELF,      /* will change inode # */
25
        PROC_NET,
26
        PROC_SCSI,
27
        PROC_MALLOC,
28
        PROC_KCORE,
29
        PROC_MODULES,
30
        PROC_STAT,
31
        PROC_DEVICES,
32
        PROC_INTERRUPTS,
33
        PROC_FILESYSTEMS,
34
        PROC_KSYMS,
35
        PROC_DMA,
36
        PROC_IOPORTS,
37
#ifdef __SMP_PROF__
38
        PROC_SMP_PROF,
39
#endif
40
        PROC_PROFILE, /* whether enabled or not */
41
        PROC_CMDLINE,
42
        PROC_SYS,
43
        PROC_MTAB,
44
        PROC_MD,
45
        PROC_RTC,
46
        PROC_LOCKS,
47
        PROC_SERIAL
48
};
49
 
50
enum pid_directory_inos {
51
        PROC_PID_INO = 2,
52
        PROC_PID_STATUS,
53
        PROC_PID_MEM,
54
        PROC_PID_CWD,
55
        PROC_PID_ROOT,
56
        PROC_PID_EXE,
57
        PROC_PID_FD,
58
        PROC_PID_ENVIRON,
59
        PROC_PID_CMDLINE,
60
        PROC_PID_STAT,
61
#ifndef NO_MM
62
        PROC_PID_STATM,
63
        PROC_PID_MAPS
64
#endif /* !NO_MM */
65
};
66
 
67
enum pid_subdirectory_inos {
68
        PROC_PID_FD_DIR = 1
69
};
70
 
71
enum net_directory_inos {
72
        PROC_NET_UNIX = 128,
73
        PROC_NET_ARP,
74
        PROC_NET_ROUTE,
75
        PROC_NET_DEV,
76
        PROC_NET_RAW,
77
        PROC_NET_TCP,
78
        PROC_NET_UDP,
79
        PROC_NET_SNMP,
80
        PROC_NET_RARP,
81
        PROC_NET_IGMP,
82
        PROC_NET_IPMR_VIF,
83
        PROC_NET_IPMR_MFC,
84
        PROC_NET_IPFWFWD,
85
        PROC_NET_IPFWIN,
86
        PROC_NET_IPFWOUT,
87
        PROC_NET_IPACCT,
88
        PROC_NET_IPMSQHST,
89
        PROC_NET_WIRELESS,
90
        PROC_NET_IPX_INTERFACE,
91
        PROC_NET_IPX_ROUTE,
92
        PROC_NET_IPX,
93
        PROC_NET_ATALK,
94
        PROC_NET_AT_ROUTE,
95
        PROC_NET_ATIF,
96
        PROC_NET_AX25_ROUTE,
97
        PROC_NET_AX25,
98
        PROC_NET_AX25_CALLS,
99
        PROC_NET_NR_NODES,
100
        PROC_NET_NR_NEIGH,
101
        PROC_NET_NR,
102
        PROC_NET_SOCKSTAT,
103
        PROC_NET_RTCACHE,
104
        PROC_NET_AX25_BPQETHER,
105
        PROC_NET_ALIAS_TYPES,
106
        PROC_NET_ALIASES,
107
        PROC_NET_IP_MASQ_APP,
108
        PROC_NET_STRIP_STATUS,
109
        PROC_NET_STRIP_TRACE,
110
        PROC_NET_IPAUTOFW,
111
        PROC_NET_IPPORTFW,
112
        PROC_NET_RS_NODES,
113
        PROC_NET_RS_NEIGH,
114
        PROC_NET_RS_ROUTES,
115
        PROC_NET_RS,
116
        PROC_NET_Z8530,
117
        PROC_NET_LAST
118
};
119
 
120
enum scsi_directory_inos {
121
        PROC_SCSI_SCSI = 256,
122
        PROC_SCSI_ADVANSYS,
123
        PROC_SCSI_EATA,
124
        PROC_SCSI_EATA_PIO,
125
        PROC_SCSI_AHA152X,
126
        PROC_SCSI_AHA1542,
127
        PROC_SCSI_AHA1740,
128
        PROC_SCSI_AIC7XXX,
129
        PROC_SCSI_BUSLOGIC,
130
        PROC_SCSI_U14_34F,
131
        PROC_SCSI_FDOMAIN,
132
        PROC_SCSI_GENERIC_NCR5380,
133
        PROC_SCSI_IN2000,
134
        PROC_SCSI_PAS16,
135
        PROC_SCSI_QLOGICFAS,
136
        PROC_SCSI_QLOGICISP,
137
        PROC_SCSI_SEAGATE,
138
        PROC_SCSI_T128,
139
        PROC_SCSI_DC390T,
140
        PROC_SCSI_NCR53C7xx,
141
        PROC_SCSI_NCR53C8XX,
142
        PROC_SCSI_ULTRASTOR,
143
        PROC_SCSI_7000FASST,
144
        PROC_SCSI_EATA2X,
145
        PROC_SCSI_AM53C974,
146
        PROC_SCSI_SSC,
147
        PROC_SCSI_NCR53C406A,
148
        PROC_SCSI_SYM53C416,
149
        PROC_SCSI_MEGARAID,
150
        PROC_SCSI_INIA100,
151
        PROC_SCSI_PPA,
152
        PROC_SCSI_ATP870U,
153
        PROC_SCSI_ESP,
154
        PROC_SCSI_A3000,
155
        PROC_SCSI_A2091,
156
        PROC_SCSI_GVP11,
157
        PROC_SCSI_ATARI,
158
        PROC_SCSI_GDTH,
159
        PROC_SCSI_INI9100U,
160
        PROC_SCSI_PCI2000,
161
        PROC_SCSI_PCI2220I,
162
        PROC_SCSI_PSI240I,
163
        PROC_SCSI_IDESCSI,
164
        PROC_SCSI_SCSI_DEBUG,
165
        PROC_SCSI_NOT_PRESENT,
166
        PROC_SCSI_FILE,                        /* I'm assuming here that we */
167
        PROC_SCSI_LAST = (PROC_SCSI_FILE + 16) /* won't ever see more than */
168
};                                             /* 16 HBAs in one machine   */
169
 
170
/* Finally, the dynamically allocatable proc entries are reserved: */
171
 
172
#define PROC_DYNAMIC_FIRST 4096
173
#define PROC_NDYNAMIC      4096
174
 
175
#define PROC_SUPER_MAGIC 0x9fa0
176
 
177
/*
178
 * This is not completely implemented yet. The idea is to
179
 * create a in-memory tree (like the actual /proc filesystem
180
 * tree) of these proc_dir_entries, so that we can dynamically
181
 * add new files to /proc.
182
 *
183
 * The "next" pointer creates a linked list of one /proc directory,
184
 * while parent/subdir create the directory structure (every
185
 * /proc file has a parent, but "subdir" is NULL for all
186
 * non-directory entries).
187
 *
188
 * "get_info" is called at "read", while "fill_inode" is used to
189
 * fill in file type/protection/owner information specific to the
190
 * particular /proc file.
191
 */
192
struct proc_dir_entry {
193
        unsigned short low_ino;
194
        unsigned short namelen;
195
        const char *name;
196
        mode_t mode;
197
        nlink_t nlink;
198
        uid_t uid;
199
        gid_t gid;
200
        unsigned long size;
201
        struct inode_operations * ops;
202
        int (*get_info)(char *, char **, off_t, int, int);
203
        void (*fill_inode)(struct inode *);
204
        struct proc_dir_entry *next, *parent, *subdir;
205
        void *data;
206
};
207
 
208
extern int (* dispatch_scsi_info_ptr) (int ino, char *buffer, char **start,
209
                                off_t offset, int length, int inout);
210
 
211
extern struct proc_dir_entry proc_root;
212
extern struct proc_dir_entry proc_net;
213
extern struct proc_dir_entry proc_scsi;
214
extern struct proc_dir_entry proc_sys;
215
extern struct proc_dir_entry proc_pid;
216
extern struct proc_dir_entry proc_pid_fd;
217
 
218
extern struct inode_operations proc_scsi_inode_operations;
219
 
220
extern void proc_root_init(void);
221
extern void proc_base_init(void);
222
extern void proc_net_init(void);
223
 
224
extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *);
225
extern int proc_register_dynamic(struct proc_dir_entry *,
226
                                 struct proc_dir_entry *);
227
extern int proc_unregister(struct proc_dir_entry *, int);
228
 
229
static inline int proc_net_register(struct proc_dir_entry * x)
230
{
231
        return proc_register(&proc_net, x);
232
}
233
 
234
static inline int proc_net_unregister(int x)
235
{
236
        return proc_unregister(&proc_net, x);
237
}
238
 
239
static inline int proc_scsi_register(struct proc_dir_entry *driver,
240
                                     struct proc_dir_entry *x)
241
{
242
    x->ops = &proc_scsi_inode_operations;
243
    if(x->low_ino < PROC_SCSI_FILE){
244
        return(proc_register(&proc_scsi, x));
245
    }else{
246
        return(proc_register(driver, x));
247
    }
248
}
249
 
250
static inline int proc_scsi_unregister(struct proc_dir_entry *driver, int x)
251
{
252
    extern void scsi_init_free(char *ptr, unsigned int size);
253
 
254
    if(x <= PROC_SCSI_FILE)
255
        return(proc_unregister(&proc_scsi, x));
256
    else {
257
        struct proc_dir_entry **p = &driver->subdir, *dp;
258
        int ret;
259
 
260
        while ((dp = *p) != NULL) {
261
                if (dp->low_ino == x)
262
                    break;
263
                p = &dp->next;
264
        }
265
        ret = proc_unregister(driver, x);
266
        scsi_init_free((char *) dp, sizeof(struct proc_dir_entry) + 4);
267
        return(ret);
268
    }
269
}
270
 
271
extern struct super_block *proc_read_super(struct super_block *,void *,int);
272
extern int init_proc_fs(void);
273
extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *);
274
extern void proc_statfs(struct super_block *, struct statfs *, int);
275
extern void proc_read_inode(struct inode *);
276
extern void proc_write_inode(struct inode *);
277
extern int proc_match(int, const char *, struct proc_dir_entry *);
278
 
279
/*
280
 * These are generic /proc routines that use the internal
281
 * "struct proc_dir_entry" tree to traverse the filesystem.
282
 *
283
 * The /proc root directory has extended versions to take care
284
 * of the /proc/<pid> subdirectories.
285
 */
286
extern int proc_readdir(struct inode *, struct file *, void *, filldir_t);
287
extern int proc_lookup(struct inode *, const char *, int, struct inode **);
288
 
289
extern struct inode_operations proc_dir_inode_operations;
290
extern struct inode_operations proc_net_inode_operations;
291
extern struct inode_operations proc_netdir_inode_operations;
292
extern struct inode_operations proc_scsi_inode_operations;
293
extern struct inode_operations proc_mem_inode_operations;
294
extern struct inode_operations proc_sys_inode_operations;
295
extern struct inode_operations proc_array_inode_operations;
296
extern struct inode_operations proc_arraylong_inode_operations;
297
extern struct inode_operations proc_kcore_inode_operations;
298
extern struct inode_operations proc_profile_inode_operations;
299
extern struct inode_operations proc_kmsg_inode_operations;
300
extern struct inode_operations proc_link_inode_operations;
301
extern struct inode_operations proc_fd_inode_operations;
302
 
303
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.