oprofile: sampling works
[akaros.git] / kern / include / page_alloc.h
index b0a7e4c..d2bf5f5 100644 (file)
@@ -32,6 +32,8 @@ typedef LIST_ENTRY(page) page_list_entry_t;
 #define PG_UPTODATE            0x002   /* page map, filled with file data */
 #define PG_DIRTY               0x004   /* page map, data is dirty */
 #define PG_BUFFER              0x008   /* is a buffer page, has BHs */
+#define PG_PAGEMAP             0x010   /* belongs to a page map */
+#define PG_REMOVAL             0x020   /* Working flag for page map removal */
 
 /* TODO: this struct is not protected from concurrent operations in some
  * functions.  If you want to lock on it, use the spinlock in the semaphore.
@@ -42,10 +44,13 @@ struct page {
        LIST_ENTRY(page)                        pg_link;        /* membership in various lists */
        struct kref                                     pg_kref;
        atomic_t                                        pg_flags;
-       struct page_map                         *pg_mapping;
+       struct page_map                         *pg_mapping; /* for debugging... */
        unsigned long                           pg_index;
+       void                                            **pg_tree_slot;
        void                                            *pg_private;    /* type depends on page usage */
        struct semaphore                        pg_sem;         /* for blocking on IO */
+       uint64_t                                gpa;            /* physical address in guest */
+                                                               /* pg_private is overloaded. */
 };
 
 /******** Externally visible global variables ************/