Rev 699 | Rev 756 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 699 | Rev 746 | ||
|---|---|---|---|
| Line 34... | Line 34... | ||
| 34 | 34 | ||
| 35 | #ifndef __PAGE_HT_H__ |
35 | #ifndef __PAGE_HT_H__ |
| 36 | #define __PAGE_HT_H__ |
36 | #define __PAGE_HT_H__ |
| 37 | 37 | ||
| 38 | #include <mm/page.h> |
38 | #include <mm/page.h> |
| - | 39 | #include <typedefs.h> |
|
| - | 40 | ||
| - | 41 | /** Number of slots in page hash table. */ |
|
| - | 42 | #define HT_ENTRIES HT_ENTRIES_ARCH |
|
| 39 | 43 | ||
| 40 | /** Hash function. |
44 | /** Hash function. |
| 41 | * |
45 | * |
| 42 | * @param page Virtual address. Only vpn bits will be used. |
46 | * @param page Virtual address. Only vpn bits will be used. |
| 43 | * @param asid Address space identifier. |
47 | * @param asid Address space identifier. |
| Line 54... | Line 58... | ||
| 54 | * |
58 | * |
| 55 | * @return 1 on match, 0 otherwise. |
59 | * @return 1 on match, 0 otherwise. |
| 56 | */ |
60 | */ |
| 57 | #define HT_COMPARE(page, asid, t) HT_COMPARE_ARCH(page, asid, t) |
61 | #define HT_COMPARE(page, asid, t) HT_COMPARE_ARCH(page, asid, t) |
| 58 | 62 | ||
| 59 | /** Identify empty hash table slots. |
63 | /** Identify empty page hash table slots. |
| 60 | * |
64 | * |
| 61 | * @param t Pointer ro hash table typed pte_t *. |
65 | * @param t Pointer ro hash table typed pte_t *. |
| 62 | * |
66 | * |
| 63 | * @return 1 if the slot is empty, 0 otherwise. |
67 | * @return 1 if the slot is empty, 0 otherwise. |
| 64 | */ |
68 | */ |
| 65 | #define HT_SLOT_EMPTY(t) HT_SLOT_EMPTY_ARCH(t) |
69 | #define HT_SLOT_EMPTY(t) HT_SLOT_EMPTY_ARCH(t) |
| 66 | 70 | ||
| - | 71 | /** Invalidate/empty page hash table slot. |
|
| - | 72 | * |
|
| - | 73 | * @param t Address of the slot to be invalidated. |
|
| - | 74 | */ |
|
| - | 75 | #define HT_INVALIDATE_SLOT(t) HT_INVALIDATE_SLOT_ARCH(t) |
|
| - | 76 | ||
| 67 | /** Return next record in collision chain. |
77 | /** Return next record in collision chain. |
| 68 | * |
78 | * |
| 69 | * @param t PTE. |
79 | * @param t PTE. |
| 70 | * |
80 | * |
| 71 | * @return Successor of PTE or NULL. |
81 | * @return Successor of PTE or NULL. |
| Line 87... | Line 97... | ||
| 87 | * @param frame Physical address. Only pfn bits will be used. |
97 | * @param frame Physical address. Only pfn bits will be used. |
| 88 | * @param flags Flags. See mm/page.h. |
98 | * @param flags Flags. See mm/page.h. |
| 89 | */ |
99 | */ |
| 90 | #define HT_SET_RECORD(t, page, asid, frame, flags) HT_SET_RECORD_ARCH(t, page, asid, frame, flags) |
100 | #define HT_SET_RECORD(t, page, asid, frame, flags) HT_SET_RECORD_ARCH(t, page, asid, frame, flags) |
| 91 | 101 | ||
| - | 102 | ||
| 92 | extern page_operations_t page_ht_operations; |
103 | extern page_operations_t page_ht_operations; |
| - | 104 | extern spinlock_t page_ht_lock; |
|
| - | 105 | ||
| - | 106 | extern pte_t *page_ht; |
|
| - | 107 | ||
| - | 108 | extern void ht_invalidate_all(void); |
|
| 93 | 109 | ||
| 94 | #endif |
110 | #endif |