Changeset 61eb2ce2 in mainline
- Timestamp:
- 2023-02-05T22:03:19Z (21 months 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)
- Files:
-
- 37 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) -
uspace/app/hbench/env.c
r07700ed r61eb2ce2 81 81 } 82 82 83 static hash_table_ops_t param_hash_table_ops = {83 static const hash_table_ops_t param_hash_table_ops = { 84 84 .hash = param_hash, 85 85 .key_hash = param_key_hash, -
uspace/app/trace/ipcp.c
r07700ed r61eb2ce2 92 92 } 93 93 94 static hash_table_ops_t pending_call_ops = {94 static const hash_table_ops_t pending_call_ops = { 95 95 .hash = pending_call_hash, 96 96 .key_hash = pending_call_key_hash, -
uspace/app/trace/proto.c
r07700ed r61eb2ce2 76 76 } 77 77 78 static hash_table_ops_t srv_proto_ops = {78 static const hash_table_ops_t srv_proto_ops = { 79 79 .hash = srv_proto_hash, 80 80 .key_hash = srv_proto_key_hash, … … 103 103 } 104 104 105 static hash_table_ops_t method_oper_ops = {105 static const hash_table_ops_t method_oper_ops = { 106 106 .hash = method_oper_hash, 107 107 .key_hash = method_oper_key_hash, -
uspace/lib/block/block.c
r07700ed r61eb2ce2 260 260 } 261 261 262 static hash_table_ops_t cache_ops = {262 static const hash_table_ops_t cache_ops = { 263 263 .hash = cache_hash, 264 264 .key_hash = cache_key_hash, -
uspace/lib/c/generic/adt/hash_table.c
r07700ed r61eb2ce2 91 91 */ 92 92 bool hash_table_create(hash_table_t *h, size_t init_size, size_t max_load, 93 hash_table_ops_t *op)93 const hash_table_ops_t *op) 94 94 { 95 95 assert(h); … … 111 111 h->apply_ongoing = false; 112 112 113 if (h->op->remove_callback == NULL) {114 h->op->remove_callback = nop_remove_callback;115 }116 117 113 return true; 118 114 } … … 172 168 if (h->item_cnt == 0) 173 169 return; 170 171 void (*remove_cb)(ht_link_t *) = h->op->remove_callback ? h->op->remove_callback : nop_remove_callback; 174 172 175 173 for (size_t idx = 0; idx < h->bucket_cnt; ++idx) { … … 179 177 180 178 list_remove(cur); 181 h->op->remove_callback(cur_link);179 remove_cb(cur_link); 182 180 } 183 181 } … … 322 320 ++removed; 323 321 list_remove(cur); 324 h->op->remove_callback(cur_link); 322 323 if (h->op->remove_callback) 324 h->op->remove_callback(cur_link); 325 325 } 326 326 } … … 341 341 list_remove(&item->link); 342 342 --h->item_cnt; 343 h->op->remove_callback(item); 343 344 if (h->op->remove_callback) 345 h->op->remove_callback(item); 344 346 shrink_if_needed(h); 345 347 } -
uspace/lib/c/generic/async/ports.c
r07700ed r61eb2ce2 123 123 124 124 /** Operations for the port hash table. */ 125 static hash_table_ops_t interface_hash_table_ops = {125 static const hash_table_ops_t interface_hash_table_ops = { 126 126 .hash = interface_hash, 127 127 .key_hash = interface_key_hash, … … 151 151 152 152 /** Operations for the port hash table. */ 153 static hash_table_ops_t port_hash_table_ops = {153 static const hash_table_ops_t port_hash_table_ops = { 154 154 .hash = port_hash, 155 155 .key_hash = port_key_hash, -
uspace/lib/c/generic/async/server.c
r07700ed r61eb2ce2 250 250 251 251 /** Operations for the client hash table. */ 252 static hash_table_ops_t client_hash_table_ops = {252 static const hash_table_ops_t client_hash_table_ops = { 253 253 .hash = client_hash, 254 254 .key_hash = client_key_hash, … … 511 511 512 512 /** Operations for the notification hash table. */ 513 static hash_table_ops_t notification_hash_table_ops = {513 static const hash_table_ops_t notification_hash_table_ops = { 514 514 .hash = notification_hash, 515 515 .key_hash = notification_key_hash, -
uspace/lib/c/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 -
uspace/lib/ext4/src/ops.c
r07700ed r61eb2ce2 122 122 } 123 123 124 static hash_table_ops_t open_nodes_ops = {124 static const hash_table_ops_t open_nodes_ops = { 125 125 .hash = open_nodes_hash, 126 126 .key_hash = open_nodes_key_hash, -
uspace/lib/nic/src/nic_addr_db.c
r07700ed r61eb2ce2 102 102 } 103 103 104 static hash_table_ops_t set_ops = {104 static const hash_table_ops_t set_ops = { 105 105 .hash = nic_addr_hash, 106 106 .key_hash = nic_addr_key_hash, -
uspace/srv/devman/devtree.c
r07700ed r61eb2ce2 93 93 } 94 94 95 static hash_table_ops_t devman_devices_ops = {95 static const hash_table_ops_t devman_devices_ops = { 96 96 .hash = devman_devices_hash, 97 97 .key_hash = handle_key_hash, … … 101 101 }; 102 102 103 static hash_table_ops_t devman_functions_ops = {103 static const hash_table_ops_t devman_functions_ops = { 104 104 .hash = devman_functions_hash, 105 105 .key_hash = handle_key_hash, … … 109 109 }; 110 110 111 static hash_table_ops_t loc_devices_ops = {111 static const hash_table_ops_t loc_devices_ops = { 112 112 .hash = loc_functions_hash, 113 113 .key_hash = service_id_key_hash, -
uspace/srv/fs/cdfs/cdfs_ops.c
r07700ed r61eb2ce2 323 323 324 324 /** Nodes hash table operations */ 325 static hash_table_ops_t nodes_ops = {325 static const hash_table_ops_t nodes_ops = { 326 326 .hash = nodes_hash, 327 327 .key_hash = nodes_key_hash, -
uspace/srv/fs/exfat/exfat_idx.c
r07700ed r61eb2ce2 149 149 } 150 150 151 static hash_table_ops_t uph_ops = {151 static const hash_table_ops_t uph_ops = { 152 152 .hash = pos_hash, 153 153 .key_hash = pos_key_hash, … … 195 195 } 196 196 197 static hash_table_ops_t uih_ops = {197 static const hash_table_ops_t uih_ops = { 198 198 .hash = idx_hash, 199 199 .key_hash = idx_key_hash, -
uspace/srv/fs/fat/fat_idx.c
r07700ed r61eb2ce2 149 149 } 150 150 151 static hash_table_ops_t uph_ops = {151 static const hash_table_ops_t uph_ops = { 152 152 .hash = pos_hash, 153 153 .key_hash = pos_key_hash, … … 195 195 } 196 196 197 static hash_table_ops_t uih_ops = {197 static const hash_table_ops_t uih_ops = { 198 198 .hash = idx_hash, 199 199 .key_hash = idx_key_hash, -
uspace/srv/fs/locfs/locfs_ops.c
r07700ed r61eb2ce2 95 95 } 96 96 97 static hash_table_ops_t services_ops = {97 static const hash_table_ops_t services_ops = { 98 98 .hash = services_hash, 99 99 .key_hash = services_key_hash, -
uspace/srv/fs/mfs/mfs_ops.c
r07700ed r61eb2ce2 123 123 } 124 124 125 static hash_table_ops_t open_nodes_ops = {125 static const hash_table_ops_t open_nodes_ops = { 126 126 .hash = open_nodes_hash, 127 127 .key_hash = open_nodes_key_hash, -
uspace/srv/fs/tmpfs/tmpfs_ops.c
r07700ed r61eb2ce2 189 189 190 190 /** TMPFS nodes hash table operations. */ 191 hash_table_ops_t nodes_ops = {191 const hash_table_ops_t nodes_ops = { 192 192 .hash = nodes_hash, 193 193 .key_hash = nodes_key_hash, -
uspace/srv/fs/udf/udf_idx.c
r07700ed r61eb2ce2 78 78 } 79 79 80 static hash_table_ops_t udf_idx_ops = {80 static const hash_table_ops_t udf_idx_ops = { 81 81 .hash = udf_idx_hash, 82 82 .key_hash = udf_idx_key_hash, -
uspace/srv/hid/input/gsp.c
r07700ed r61eb2ce2 84 84 } 85 85 86 static hash_table_ops_t trans_ops = {86 static const hash_table_ops_t trans_ops = { 87 87 .hash = trans_hash, 88 88 .key_hash = trans_key_hash, -
uspace/srv/ns/service.c
r07700ed r61eb2ce2 112 112 113 113 /** Operations for service hash table. */ 114 static hash_table_ops_t service_hash_table_ops = {114 static const hash_table_ops_t service_hash_table_ops = { 115 115 .hash = service_hash, 116 116 .key_hash = service_key_hash, … … 121 121 122 122 /** Operations for interface hash table. */ 123 static hash_table_ops_t iface_hash_table_ops = {123 static const hash_table_ops_t iface_hash_table_ops = { 124 124 .hash = iface_hash, 125 125 .key_hash = iface_key_hash, -
uspace/srv/ns/task.c
r07700ed r61eb2ce2 80 80 81 81 /** Operations for task hash table. */ 82 static hash_table_ops_t task_hash_table_ops = {82 static const hash_table_ops_t task_hash_table_ops = { 83 83 .hash = task_hash, 84 84 .key_hash = task_key_hash, … … 131 131 132 132 /** Operations for task hash table. */ 133 static hash_table_ops_t p2i_ops = {133 static const hash_table_ops_t p2i_ops = { 134 134 .hash = p2i_hash, 135 135 .key_hash = p2i_key_hash, -
uspace/srv/vfs/vfs_node.c
r07700ed r61eb2ce2 66 66 67 67 /** VFS node hash table operations. */ 68 hash_table_ops_t nodes_ops = {68 const hash_table_ops_t nodes_ops = { 69 69 .hash = nodes_hash, 70 70 .key_hash = nodes_key_hash,
Note:
See TracChangeset
for help on using the changeset viewer.