Use two-page stacks
[akaros.git] / kern / include / mm.h
index 0080953..88c7dec 100644 (file)
 #include <sys/queue.h>
 #include <slab.h>
 #include <kref.h>
+#include <rcu.h>
 
-struct file;
 struct chan;
 struct fd_table;
 struct proc;                                                           /* preprocessor games */
 
-#define F_OR_C_NONE 0
-#define F_OR_C_FILE 1
 #define F_OR_C_CHAN 2
 
 struct file_or_chan {
        int type;
-       struct file *file;
        struct chan *chan;
+       struct fs_file *fsf;    /* weak ref, set during mmap. */
        struct kref kref;
+       struct rcu_head rcu;
 };
 
 char *foc_to_name(struct file_or_chan *foc);
@@ -55,6 +54,8 @@ struct vm_region {
        int                                                     vm_flags;
        struct file_or_chan                     *__vm_foc;
        size_t                                          vm_foff;
+       bool                                            vm_ready;       /* racy, for the PM checks */
+       bool                                            vm_shootdown_needed;
 };
 TAILQ_HEAD(vmr_tailq, vm_region);                      /* Declares 'struct vmr_tailq' */