Xenomai  3.1
sysregfs.h
1 /*
2  * Copyright (C) 2013 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 
19 #ifndef _REGD_SYSREGFS_H
20 #define _REGD_SYSREGFS_H
21 
22 #include <copperplate/clockobj.h>
23 #include <copperplate/registry-obstack.h>
24 
25 struct sysreg_fsdir {
26  const char *path;
27 };
28 
29 struct sysreg_fsfile {
30  const char *path;
31  struct fsobj fsobj;
32  int mode;
33  struct registry_operations ops;
34 };
35 
36 struct thread_data {
37  char name[XNOBJECT_NAME_LEN];
38  pid_t pid;
39  int priority;
40  int policy;
41  int cpu;
42  int schedlock;
43  ticks_t timeout;
44  unsigned long status;
45 };
46 
47 extern struct sysreg_fsdir sysreg_dirs[];
48 
49 extern struct sysreg_fsfile sysreg_files[];
50 
51 int open_threads(struct fsobj *fsobj, void *priv);
52 
53 int open_heaps(struct fsobj *fsobj, void *priv);
54 
55 int open_version(struct fsobj *fsobj, void *priv);
56 
57 char *format_thread_status(const struct thread_data *p,
58  char *buf, size_t len);
59 
60 #endif /* !_REGD_SYSREGFS_H */