Changes in / [a36f442:67f11a0] in mainline
- Files:
-
- 1 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/riscv64/src/main.c
ra36f442 r67f11a0 64 64 bootinfo.memmap.zones[0].size = PHYSMEM_SIZE; 65 65 66 printf("\nMemory statistics (total %l u MB, starting at %p)\n\n",66 printf("\nMemory statistics (total %llu MB, starting at %p)\n\n", 67 67 bootinfo.memmap.total >> 20, (void *) bootinfo.physmem_start); 68 68 printf(" %p: boot info structure\n", &bootinfo); -
kernel/generic/include/adt/hash_table.h
ra36f442 r67f11a0 95 95 extern bool hash_table_insert_unique(hash_table_t *, ht_link_t *); 96 96 extern ht_link_t *hash_table_find(const hash_table_t *, void *); 97 extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *); 97 extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *, 98 ht_link_t *); 98 99 extern size_t hash_table_remove(hash_table_t *, void *); 99 100 extern void hash_table_remove_item(hash_table_t *, ht_link_t *); -
kernel/generic/src/adt/hash_table.c
ra36f442 r67f11a0 269 269 270 270 /** Find the next item equal to item. */ 271 ht_link_t *hash_table_find_next(const hash_table_t *h, ht_link_t *item) 271 ht_link_t * 272 hash_table_find_next(const hash_table_t *h, ht_link_t *first, ht_link_t *item) 272 273 { 273 274 assert(item); 274 275 assert(h && h->bucket); 275 276 277 size_t idx = h->op->hash(item) % h->bucket_cnt; 278 276 279 /* Traverse the circular list until we reach the starting item again. */ 277 for (link_t *cur = item->link.next; cur != &item->link; cur = cur->next) { 280 for (link_t *cur = item->link.next; cur != &first->link; 281 cur = cur->next) { 278 282 assert(cur); 283 284 if (cur == &h->bucket[idx].head) 285 continue; 286 279 287 ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link); 280 288 /* -
kernel/generic/src/ddi/irq.c
ra36f442 r67f11a0 141 141 { 142 142 irq_spinlock_lock(l, false); 143 for (ht_link_t *lnk = hash_table_find(h, &inr); lnk; 144 lnk = hash_table_find_next(h, lnk)) { 143 ht_link_t *first = hash_table_find(h, &inr); 144 for (ht_link_t *lnk = first; lnk; 145 lnk = hash_table_find_next(h, first, lnk)) { 145 146 irq_t *irq = hash_table_get_inst(lnk, irq_t, link); 146 147 irq_spinlock_lock(&irq->lock, false); -
uspace/app/bdsh/cmds/modules/cat/cat.c
ra36f442 r67f11a0 338 338 argc = cli_count_args(argv); 339 339 340 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 340 c = 0; 341 optreset = 1; 342 optind = 0; 343 opt_ind = 0; 344 345 while (c != -1) { 341 346 c = getopt_long(argc, argv, "xhvmH:t:b:sn", long_options, &opt_ind); 342 347 switch (c) { -
uspace/app/bdsh/cmds/modules/cmp/cmp.c
ra36f442 r67f11a0 123 123 argc = cli_count_args(argv); 124 124 125 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 125 c = 0; 126 optreset = 1; 127 optind = 0; 128 opt_ind = 0; 129 130 while (c != -1) { 126 131 c = getopt_long(argc, argv, "hv", long_options, &opt_ind); 127 132 switch (c) { -
uspace/app/bdsh/cmds/modules/cp/cp.c
ra36f442 r67f11a0 484 484 argc = cli_count_args(argv); 485 485 486 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 486 c = 0; 487 optreset = 1; 488 optind = 0; 489 opt_ind = 0; 490 491 while (c != -1) { 487 492 c = getopt_long(argc, argv, "hvVfirb:", long_options, &opt_ind); 488 493 switch (c) { -
uspace/app/bdsh/cmds/modules/ls/ls.c
ra36f442 r67f11a0 356 356 argc = cli_count_args(argv); 357 357 358 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 358 c = 0; 359 optreset = 1; 360 optind = 0; 361 opt_ind = 0; 362 363 while (c != -1) { 359 364 c = getopt_long(argc, argv, "hur", long_options, &opt_ind); 360 365 switch (c) { -
uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
ra36f442 r67f11a0 168 168 argc = cli_count_args(argv); 169 169 170 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 170 c = 0; 171 optreset = 1; 172 optind = 0; 173 opt_ind = 0; 174 175 while (c != -1) { 171 176 c = getopt_long(argc, argv, "pvhVfm:", long_options, &opt_ind); 172 177 switch (c) { -
uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
ra36f442 r67f11a0 133 133 argc = cli_count_args(argv); 134 134 135 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 135 c = 0; 136 optreset = 1; 137 optind = 0; 138 opt_ind = 0; 139 140 while (c != -1) { 136 141 c = getopt_long(argc, argv, "ps:h", long_options, &opt_ind); 137 142 switch (c) { -
uspace/app/bdsh/cmds/modules/mount/mount.c
ra36f442 r67f11a0 141 141 argc = cli_count_args(argv); 142 142 143 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 143 c = 0; 144 optreset = 1; 145 optind = 0; 146 opt_ind = 0; 147 148 while (c != -1) { 144 149 c = getopt_long(argc, argv, "i:ht", long_options, &opt_ind); 145 150 switch (c) { -
uspace/app/bdsh/cmds/modules/rm/rm.c
ra36f442 r67f11a0 260 260 } 261 261 262 for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) { 262 c = 0; 263 optreset = 1; 264 optind = 0; 265 opt_ind = 0; 266 267 while (c != -1) { 263 268 c = getopt_long(argc, argv, "hvrfs", long_options, &opt_ind); 264 269 switch (c) { -
uspace/app/bdsh/cmds/modules/touch/touch.c
ra36f442 r67f11a0 88 88 DIR *dirp; 89 89 90 for (c = 0, optreset = 1, optind = 0, longind = 0; c != -1; ) { 90 c = 0; 91 optreset = 1; 92 optind = 0; 93 longind = 0; 94 95 while (c != -1) { 91 96 c = getopt_long(argc, argv, "c", long_options, &longind); 92 97 switch (c) { -
uspace/lib/c/arch/riscv64/include/libarch/fibril.h
ra36f442 r67f11a0 37 37 38 38 #include <stdint.h> 39 #include <libarch/fibril_context.h> 39 40 40 41 #define SP_DELTA 0 … … 44 45 (ctx)->pc = (uintptr_t) (_pc); \ 45 46 (ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \ 46 (ctx)->fp = 0; \ 47 (ctx)->tls = ((uintptr_t) (ptls)) + sizeof(tcb_t); \ 47 (ctx)->x4 = ((uintptr_t) (ptls)) + sizeof(tcb_t); \ 48 48 } while (0) 49 50 /*51 * This stores the registers which need to be52 * preserved across function calls.53 */54 typedef struct {55 uintptr_t sp;56 uintptr_t fp;57 uintptr_t pc;58 uintptr_t tls;59 } context_t;60 49 61 50 static inline uintptr_t _context_get_fp(context_t *ctx) 62 51 { 63 / * This function returns the frame pointer. */64 return ctx->fp;52 // FIXME: No frame pointer in the standard ABI. 53 return 0; 65 54 } 66 55 -
uspace/lib/c/arch/riscv64/src/fibril.c
ra36f442 r67f11a0 30 30 */ 31 31 32 #include < fibril.h>32 #include <setjmp.h> 33 33 #include <stdbool.h> 34 34 -
uspace/lib/c/generic/adt/hash_table.c
ra36f442 r67f11a0 269 269 270 270 /** Find the next item equal to item. */ 271 ht_link_t *hash_table_find_next(const hash_table_t *h, ht_link_t *item) 271 ht_link_t * 272 hash_table_find_next(const hash_table_t *h, ht_link_t *first, ht_link_t *item) 272 273 { 273 274 assert(item); 274 275 assert(h && h->bucket); 275 276 277 size_t idx = h->op->hash(item) % h->bucket_cnt; 278 276 279 /* Traverse the circular list until we reach the starting item again. */ 277 for (link_t *cur = item->link.next; cur != &item->link; cur = cur->next) { 280 for (link_t *cur = item->link.next; cur != &first->link; 281 cur = cur->next) { 278 282 assert(cur); 283 284 if (cur == &h->bucket[idx].head) 285 continue; 286 279 287 ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link); 280 288 /* -
uspace/lib/c/generic/str.c
ra36f442 r67f11a0 1360 1360 1361 1361 /* Skip over leading delimiters. */ 1362 for (tmp = cur = 0; 1363 (ch = str_decode(s, &tmp, len)) && str_chr(delim, ch); /**/) 1362 tmp = 0; 1363 cur = 0; 1364 while ((ch = str_decode(s, &tmp, len)) && str_chr(delim, ch)) 1364 1365 cur = tmp; 1365 1366 start = &s[cur]; 1366 1367 1367 1368 /* Skip over token characters. */ 1368 for (tmp = cur;1369 (ch = str_decode(s, &tmp, len)) && !str_chr(delim, ch); /**/)1369 tmp = cur; 1370 while ((ch = str_decode(s, &tmp, len)) && !str_chr(delim, ch)) 1370 1371 cur = tmp; 1371 1372 end = &s[cur]; -
uspace/lib/c/include/adt/hash_table.h
ra36f442 r67f11a0 95 95 extern bool hash_table_insert_unique(hash_table_t *, ht_link_t *); 96 96 extern ht_link_t *hash_table_find(const hash_table_t *, void *); 97 extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *); 97 extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *, 98 ht_link_t *); 98 99 extern size_t hash_table_remove(hash_table_t *, void *); 99 100 extern void hash_table_remove_item(hash_table_t *, ht_link_t *);
Note:
See TracChangeset
for help on using the changeset viewer.