Proc refcnting wrappers
[akaros.git] / kern / include / env.h
index b82a7fd..9510853 100644 (file)
@@ -23,6 +23,7 @@
 // TODO: clean this up.
 struct proc {
        TAILQ_ENTRY(proc) proc_link NOINIT;     // Free list link pointers
+       TAILQ_ENTRY(proc) proc_arsc_link NOINIT; // Free list link pointers for the arsc list
        spinlock_t proc_lock;
        trapframe_t env_tf;                                             // Saved registers
        ancillary_state_t env_ancillary_state;  // State saved when descheduled
@@ -30,7 +31,7 @@ struct proc {
        pid_t ppid;                 // Parent's PID
        pid_t exitcode;                         // exit() param or main() return value
        uint32_t state;                         // Status of the process
-       uint32_t env_refcnt;            // Reference count of kernel contexts using this
+       struct kref p_kref;             /* Refcnt */
        uint32_t env_flags;
        uint32_t env_entry;
 
@@ -83,7 +84,6 @@ void  env_push_ancillary_state(env_t* e);
 void   env_pop_ancillary_state(env_t* e);
 void   env_user_mem_free(env_t* e, void* start, size_t len);
 void   env_pagetable_free(env_t* e);
-void   env_load_icode(env_t* e, env_t* binary_env, uint8_t *COUNT(size) binary, size_t size);
 
 typedef int (*mem_walk_callback_t)(env_t* e, pte_t* pte, void* va, void* arg);
 int            env_user_mem_walk(env_t* e, void* start, size_t len, mem_walk_callback_t callback, void* arg);