Pipes (XCC)
[akaros.git] / kern / include / ros / procinfo.h
index 36a380c..9b69de4 100644 (file)
@@ -29,7 +29,8 @@ struct vcore {
 #endif /* ROS_KERNEL */
        uint32_t                        pcoreid;
        bool                            valid;
-       bool                            preempt_served;
+       uint32_t                        nr_preempts_sent;       /* these two differ when a preempt*/
+       uint32_t                        nr_preempts_done;       /* is in flight. */
        uint64_t                        preempt_pending;
 };
 
@@ -41,11 +42,12 @@ struct pcore {
 typedef struct procinfo {
        pid_t pid;
        pid_t ppid;
-       size_t max_vcores;
+       size_t max_vcores;      /* TODO: change to a uint32_t */
        uint64_t tsc_freq;
-       void* heap_bottom;
+       uint64_t timing_overhead;
+       void *heap_bottom;
        /* for traditional forks, these two need to be memcpy'd over: */
-       charargp[PROCINFO_MAX_ARGP];
+       char *argp[PROCINFO_MAX_ARGP];
        char argbuf[PROCINFO_ARGBUF_SIZE];
        /* glibc relies on stuff above this point.  if you change it, you need to
         * rebuild glibc. */
@@ -69,7 +71,8 @@ procinfo_pack_args(procinfo_t* p, char* const* argv, char* const* envp)
                return -1;
 
        int pos = 0;
-       for(int i = 0; i < nargv; i++)
+       int i;
+       for(i = 0; i < nargv; i++)
        {
                int len = strlen(argv[i])+1;
                if(pos+len > PROCINFO_ARGBUF_SIZE)
@@ -80,7 +83,7 @@ procinfo_pack_args(procinfo_t* p, char* const* argv, char* const* envp)
        }
        p->argp[nargv] = 0;
 
-       for(int i = 0; i < nenvp; i++)
+       for(i = 0; i < nenvp; i++)
        {
                int len = strlen(envp[i])+1;
                if(pos+len > PROCINFO_ARGBUF_SIZE)
@@ -115,7 +118,7 @@ static inline uint32_t __get_vcoreid_from_procinfo(void)
        do {
                cmb();
                old_seq = __procinfo.coremap_seqctr;
-               kpcoreid = __ros_syscall(SYS_getpcoreid, 0, 0, 0, 0, 0, 0, NULL);
+               kpcoreid = __ros_syscall_noerrno(SYS_getpcoreid, 0, 0, 0, 0, 0, 0);
                if (!__procinfo.pcoremap[kpcoreid].valid)
                        continue;
                kvcoreid = __procinfo.pcoremap[kpcoreid].vcoreid;