- Timestamp:
- 2023-02-05T22:03:19Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b596d0d
- Parents:
- 07700ed
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-05 22:01:46)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-05 22:03:19)
- Location:
- kernel
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/include/genarch/mm/page_ht.h
r07700ed r61eb2ce2 57 57 #define PTE_EXECUTABLE(pte) ((pte)->x != 0) 58 58 59 extern as_operations_t as_ht_operations;60 extern page_mapping_operations_t ht_mapping_operations;59 extern const as_operations_t as_ht_operations; 60 extern const page_mapping_operations_t ht_mapping_operations; 61 61 62 62 extern slab_cache_t *pte_cache; 63 63 extern hash_table_t page_ht; 64 extern hash_table_ops_t ht_ops;64 extern const hash_table_ops_t ht_ops; 65 65 66 66 #endif -
kernel/genarch/include/genarch/mm/page_pt.h
r07700ed r61eb2ce2 140 140 #define PTE_EXECUTABLE(p) PTE_EXECUTABLE_ARCH((p)) 141 141 142 extern as_operations_t as_pt_operations;143 extern page_mapping_operations_t pt_mapping_operations;142 extern const as_operations_t as_pt_operations; 143 extern const page_mapping_operations_t pt_mapping_operations; 144 144 145 145 extern void page_mapping_insert_pt(as_t *, uintptr_t, uintptr_t, unsigned int); -
kernel/genarch/src/mm/as_ht.c
r07700ed r61eb2ce2 53 53 static bool ht_locked(as_t *); 54 54 55 as_operations_t as_ht_operations = {55 const as_operations_t as_ht_operations = { 56 56 .page_table_create = ht_create, 57 57 .page_table_destroy = ht_destroy, -
kernel/genarch/src/mm/as_pt.c
r07700ed r61eb2ce2 54 54 static bool pt_locked(as_t *); 55 55 56 as_operations_t as_pt_operations = {56 const as_operations_t as_pt_operations = { 57 57 .page_table_create = ptl0_create, 58 58 .page_table_destroy = ptl0_destroy, -
kernel/genarch/src/mm/page_ht.c
r07700ed r61eb2ce2 82 82 83 83 /** Hash table operations for page hash table. */ 84 hash_table_ops_t ht_ops = {84 const hash_table_ops_t ht_ops = { 85 85 .hash = ht_hash, 86 86 .key_hash = ht_key_hash, … … 90 90 91 91 /** Page mapping operations for page hash table architectures. */ 92 page_mapping_operations_t ht_mapping_operations = {92 const page_mapping_operations_t ht_mapping_operations = { 93 93 .mapping_insert = ht_mapping_insert, 94 94 .mapping_remove = ht_mapping_remove, -
kernel/genarch/src/mm/page_pt.c
r07700ed r61eb2ce2 58 58 static void pt_mapping_make_global(uintptr_t, size_t); 59 59 60 page_mapping_operations_t pt_mapping_operations = {60 const page_mapping_operations_t pt_mapping_operations = { 61 61 .mapping_insert = pt_mapping_insert, 62 62 .mapping_remove = pt_mapping_remove, -
kernel/generic/include/adt/hash_table.h
r07700ed r61eb2ce2 73 73 /** Hash table structure. */ 74 74 typedef struct { 75 hash_table_ops_t *op;75 const hash_table_ops_t *op; 76 76 list_t *bucket; 77 77 size_t bucket_cnt; … … 86 86 87 87 extern bool hash_table_create(hash_table_t *, size_t, size_t, 88 hash_table_ops_t *);88 const hash_table_ops_t *); 89 89 extern void hash_table_destroy(hash_table_t *); 90 90 -
kernel/generic/include/mm/as.h
r07700ed r61eb2ce2 307 307 extern as_t *AS_KERNEL; 308 308 309 extern as_operations_t *as_operations;309 extern const as_operations_t *as_operations; 310 310 extern list_t inactive_as_with_asid_list; 311 311 -
kernel/generic/include/mm/page.h
r07700ed r61eb2ce2 53 53 } page_mapping_operations_t; 54 54 55 extern page_mapping_operations_t *page_mapping_operations;55 extern const page_mapping_operations_t *page_mapping_operations; 56 56 57 57 extern void page_init(void); -
kernel/generic/src/adt/hash_table.c
r07700ed r61eb2ce2 90 90 */ 91 91 bool hash_table_create(hash_table_t *h, size_t init_size, size_t max_load, 92 hash_table_ops_t *op)92 const hash_table_ops_t *op) 93 93 { 94 94 assert(h); … … 110 110 h->apply_ongoing = false; 111 111 112 if (h->op->remove_callback == NULL) {113 h->op->remove_callback = nop_remove_callback;114 }115 116 112 return true; 117 113 } … … 171 167 if (h->item_cnt == 0) 172 168 return; 169 170 void (*remove_cb)(ht_link_t *) = h->op->remove_callback ? h->op->remove_callback : nop_remove_callback; 173 171 174 172 for (size_t idx = 0; idx < h->bucket_cnt; ++idx) { … … 178 176 179 177 list_remove(cur); 180 h->op->remove_callback(cur_link);178 remove_cb(cur_link); 181 179 } 182 180 } … … 321 319 ++removed; 322 320 list_remove(cur); 323 h->op->remove_callback(cur_link); 321 322 if (h->op->remove_callback) 323 h->op->remove_callback(cur_link); 324 324 } 325 325 } … … 340 340 list_remove(&item->link); 341 341 --h->item_cnt; 342 h->op->remove_callback(item); 342 343 if (h->op->remove_callback) 344 h->op->remove_callback(item); 343 345 shrink_if_needed(h); 344 346 } -
kernel/generic/src/cap/cap.c
r07700ed r61eb2ce2 125 125 } 126 126 127 static hash_table_ops_t caps_ops = {127 static const hash_table_ops_t caps_ops = { 128 128 .hash = caps_hash, 129 129 .key_hash = caps_key_hash, -
kernel/generic/src/ddi/irq.c
r07700ed r61eb2ce2 77 77 static bool irq_ht_key_equal(const void *, const ht_link_t *); 78 78 79 static hash_table_ops_t irq_ht_ops = {79 static const hash_table_ops_t irq_ht_ops = { 80 80 .hash = irq_ht_hash, 81 81 .key_hash = irq_ht_key_hash, -
kernel/generic/src/lib/ra.c
r07700ed r61eb2ce2 81 81 } 82 82 83 static hash_table_ops_t used_ops = {83 static const hash_table_ops_t used_ops = { 84 84 .hash = used_hash, 85 85 .key_hash = used_key_hash, -
kernel/generic/src/mm/as.c
r07700ed r61eb2ce2 86 86 * address space operations such as creating or locking page tables. 87 87 */ 88 as_operations_t *as_operations = NULL;88 const as_operations_t *as_operations = NULL; 89 89 90 90 /** Cache for as_t objects */ -
kernel/generic/src/mm/page.c
r07700ed r61eb2ce2 76 76 77 77 /** Virtual operations for page subsystem. */ 78 page_mapping_operations_t *page_mapping_operations = NULL;78 const page_mapping_operations_t *page_mapping_operations = NULL; 79 79 80 80 void page_init(void)
Note:
See TracChangeset
for help on using the changeset viewer.