Rev 2085 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2085 | Rev 2089 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | #ifdef CONFIG_PAGE_HT |
37 | #ifdef CONFIG_PAGE_HT |
38 | 38 | ||
39 | #ifndef KERN_PAGE_HT_H_ |
39 | #ifndef KERN_PAGE_HT_H_ |
40 | #define KERN_PAGE_HT_H_ |
40 | #define KERN_PAGE_HT_H_ |
41 | 41 | ||
- | 42 | #include <arch/types.h> |
|
- | 43 | #include <mm/as.h> |
|
42 | #include <mm/page.h> |
44 | #include <mm/page.h> |
43 | #include <synch/mutex.h> |
45 | #include <synch/mutex.h> |
44 | #include <arch/types.h> |
- | |
45 | #include <adt/list.h> |
- | |
46 | #include <adt/hash_table.h> |
46 | #include <adt/hash_table.h> |
47 | 47 | ||
48 | #define PAGE_HT_KEYS 2 |
48 | #define PAGE_HT_KEYS 2 |
49 | #define KEY_AS 0 |
49 | #define KEY_AS 0 |
50 | #define KEY_PAGE 1 |
50 | #define KEY_PAGE 1 |
Line 59... | Line 59... | ||
59 | #define PTE_WRITABLE(pte) ((pte)->w != 0) |
59 | #define PTE_WRITABLE(pte) ((pte)->w != 0) |
60 | #define PTE_EXECUTABLE(pte) ((pte)->x != 0) |
60 | #define PTE_EXECUTABLE(pte) ((pte)->x != 0) |
61 | 61 | ||
62 | #define SET_PTL0_ADDRESS(x) |
62 | #define SET_PTL0_ADDRESS(x) |
63 | 63 | ||
64 | struct pte { |
- | |
65 | link_t link; /**< Page hash table link. */ |
- | |
66 | as_t *as; /**< Address space. */ |
- | |
67 | uintptr_t page; /**< Virtual memory page. */ |
64 | extern as_operations_t as_ht_operations; |
68 | uintptr_t frame; /**< Physical memory frame. */ |
- | |
69 | unsigned g : 1; /**< Global page. */ |
- | |
70 | unsigned x : 1; /**< Execute. */ |
- | |
71 | unsigned w : 1; /**< Writable. */ |
- | |
72 | unsigned k : 1; /**< Kernel privileges required. */ |
- | |
73 | unsigned c : 1; /**< Cacheable. */ |
- | |
74 | unsigned a : 1; /**< Accessed. */ |
- | |
75 | unsigned d : 1; /**< Dirty. */ |
- | |
76 | unsigned p : 1; /**< Present. */ |
- | |
77 | }; |
- | |
78 | - | ||
79 | extern page_mapping_operations_t ht_mapping_operations; |
65 | extern page_mapping_operations_t ht_mapping_operations; |
- | 66 | ||
80 | extern mutex_t page_ht_lock; |
67 | extern mutex_t page_ht_lock; |
81 | extern hash_table_t page_ht; |
68 | extern hash_table_t page_ht; |
82 | extern hash_table_operations_t ht_operations; |
69 | extern hash_table_operations_t ht_operations; |
83 | 70 | ||
84 | #endif |
71 | #endif |