Bring back the ARSC functionality that was removed earlier.
[akaros.git] / kern / include / ros / procdata.h
1 /* Copyright (c) 2009 The Regents of the University of California
2  * See LICENSE for details.  */
3
4 #ifndef ROS_PROCDATA_H
5 #define ROS_PROCDATA_H
6
7 #include <ros/memlayout.h>
8 #include <ros/ring_syscall.h>
9 #include <ros/sysevent.h>
10 #include <ros/arch/arch.h>
11 #include <ros/common.h>
12 #include <ros/procinfo.h>
13 #include <ros/notification.h>
14
15 typedef struct procdata {
16         syscall_sring_t                 syscallring;
17         char                                    pad1[SYSCALLRINGSIZE - sizeof(syscall_sring_t)];
18         sysevent_sring_t                syseventring;
19         char                                    pad2[SYSEVENTRINGSIZE - sizeof(sysevent_sring_t)];
20 #ifdef __i386__
21         segdesc_t                               *ldt; // TODO: bug with this. (TLSV)
22 #endif
23         /* glibc relies on stuff above this point.  if you change it, you need to
24          * rebuild glibc. */
25         struct notif_method             notif_methods[MAX_NR_NOTIF];
26         /* Long range, would like these to be mapped in lazily, as the vcores are
27          * requested.  Sharing MAX_NUM_CPUS is a bit weird too. */
28         struct preempt_data             vcore_preempt_data[MAX_NUM_CPUS];
29 } procdata_t;
30
31 #define PROCDATA_NUM_PAGES  ((sizeof(procdata_t)-1)/PGSIZE + 1)
32
33 // this is how user programs access the procdata page
34 #ifndef ROS_KERNEL
35 # define __procdata (*(procdata_t*)UDATA)
36 #endif
37
38 #endif // !ROS_PROCDATA_H