Changes in / [67f11a0:a36f442] in mainline


Ignore:
Files:
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/riscv64/src/main.c

    r67f11a0 ra36f442  
    6464        bootinfo.memmap.zones[0].size = PHYSMEM_SIZE;
    6565
    66         printf("\nMemory statistics (total %llu MB, starting at %p)\n\n",
     66        printf("\nMemory statistics (total %lu MB, starting at %p)\n\n",
    6767            bootinfo.memmap.total >> 20, (void *) bootinfo.physmem_start);
    6868        printf(" %p: boot info structure\n", &bootinfo);
  • kernel/generic/include/adt/hash_table.h

    r67f11a0 ra36f442  
    9595extern bool hash_table_insert_unique(hash_table_t *, ht_link_t *);
    9696extern 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 *,
    98     ht_link_t *);
     97extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *);
    9998extern size_t hash_table_remove(hash_table_t *, void *);
    10099extern void hash_table_remove_item(hash_table_t *, ht_link_t *);
  • kernel/generic/src/adt/hash_table.c

    r67f11a0 ra36f442  
    269269
    270270/** Find the next item equal to item. */
    271 ht_link_t *
    272 hash_table_find_next(const hash_table_t *h, ht_link_t *first, ht_link_t *item)
     271ht_link_t *hash_table_find_next(const hash_table_t *h, ht_link_t *item)
    273272{
    274273        assert(item);
    275274        assert(h && h->bucket);
    276275
    277         size_t idx = h->op->hash(item) % h->bucket_cnt;
    278 
    279276        /* Traverse the circular list until we reach the starting item again. */
    280         for (link_t *cur = item->link.next; cur != &first->link;
    281             cur = cur->next) {
     277        for (link_t *cur = item->link.next; cur != &item->link; cur = cur->next) {
    282278                assert(cur);
    283 
    284                 if (cur == &h->bucket[idx].head)
    285                         continue;
    286 
    287279                ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link);
    288280                /*
  • kernel/generic/src/ddi/irq.c

    r67f11a0 ra36f442  
    141141{
    142142        irq_spinlock_lock(l, false);
    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)) {
     143        for (ht_link_t *lnk = hash_table_find(h, &inr); lnk;
     144            lnk = hash_table_find_next(h, lnk)) {
    146145                irq_t *irq = hash_table_get_inst(lnk, irq_t, link);
    147146                irq_spinlock_lock(&irq->lock, false);
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r67f11a0 ra36f442  
    338338        argc = cli_count_args(argv);
    339339
    340         c = 0;
    341         optreset = 1;
    342         optind = 0;
    343         opt_ind = 0;
    344 
    345         while (c != -1) {
     340        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    346341                c = getopt_long(argc, argv, "xhvmH:t:b:sn", long_options, &opt_ind);
    347342                switch (c) {
  • uspace/app/bdsh/cmds/modules/cmp/cmp.c

    r67f11a0 ra36f442  
    123123        argc = cli_count_args(argv);
    124124
    125         c = 0;
    126         optreset = 1;
    127         optind = 0;
    128         opt_ind = 0;
    129 
    130         while (c != -1) {
     125        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    131126                c = getopt_long(argc, argv, "hv", long_options, &opt_ind);
    132127                switch (c) {
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    r67f11a0 ra36f442  
    484484        argc = cli_count_args(argv);
    485485
    486         c = 0;
    487         optreset = 1;
    488         optind = 0;
    489         opt_ind = 0;
    490 
    491         while (c != -1) {
     486        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    492487                c = getopt_long(argc, argv, "hvVfirb:", long_options, &opt_ind);
    493488                switch (c) {
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    r67f11a0 ra36f442  
    356356        argc = cli_count_args(argv);
    357357
    358         c = 0;
    359         optreset = 1;
    360         optind = 0;
    361         opt_ind = 0;
    362 
    363         while (c != -1) {
     358        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    364359                c = getopt_long(argc, argv, "hur", long_options, &opt_ind);
    365360                switch (c) {
  • uspace/app/bdsh/cmds/modules/mkdir/mkdir.c

    r67f11a0 ra36f442  
    168168        argc = cli_count_args(argv);
    169169
    170         c = 0;
    171         optreset = 1;
    172         optind = 0;
    173         opt_ind = 0;
    174 
    175         while (c != -1) {
     170        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    176171                c = getopt_long(argc, argv, "pvhVfm:", long_options, &opt_ind);
    177172                switch (c) {
  • uspace/app/bdsh/cmds/modules/mkfile/mkfile.c

    r67f11a0 ra36f442  
    133133        argc = cli_count_args(argv);
    134134
    135         c = 0;
    136         optreset = 1;
    137         optind = 0;
    138         opt_ind = 0;
    139 
    140         while (c != -1) {
     135        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    141136                c = getopt_long(argc, argv, "ps:h", long_options, &opt_ind);
    142137                switch (c) {
  • uspace/app/bdsh/cmds/modules/mount/mount.c

    r67f11a0 ra36f442  
    141141        argc = cli_count_args(argv);
    142142
    143         c = 0;
    144         optreset = 1;
    145         optind = 0;
    146         opt_ind = 0;
    147 
    148         while (c != -1) {
     143        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    149144                c = getopt_long(argc, argv, "i:ht", long_options, &opt_ind);
    150145                switch (c) {
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r67f11a0 ra36f442  
    260260        }
    261261
    262         c = 0;
    263         optreset = 1;
    264         optind = 0;
    265         opt_ind = 0;
    266 
    267         while (c != -1) {
     262        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    268263                c = getopt_long(argc, argv, "hvrfs", long_options, &opt_ind);
    269264                switch (c) {
  • uspace/app/bdsh/cmds/modules/touch/touch.c

    r67f11a0 ra36f442  
    8888        DIR *dirp;
    8989
    90         c = 0;
    91         optreset = 1;
    92         optind = 0;
    93         longind = 0;
    94 
    95         while (c != -1) {
     90        for (c = 0, optreset = 1, optind = 0, longind = 0; c != -1; ) {
    9691                c = getopt_long(argc, argv, "c", long_options, &longind);
    9792                switch (c) {
  • uspace/lib/c/arch/riscv64/include/libarch/fibril.h

    r67f11a0 ra36f442  
    3737
    3838#include <stdint.h>
    39 #include <libarch/fibril_context.h>
    4039
    4140#define SP_DELTA  0
     
    4544                (ctx)->pc = (uintptr_t) (_pc); \
    4645                (ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \
    47                 (ctx)->x4 = ((uintptr_t) (ptls)) + sizeof(tcb_t); \
     46                (ctx)->fp = 0; \
     47                (ctx)->tls = ((uintptr_t) (ptls)) + sizeof(tcb_t); \
    4848        } while (0)
     49
     50/*
     51 * This stores the registers which need to be
     52 * preserved across function calls.
     53 */
     54typedef struct {
     55        uintptr_t sp;
     56        uintptr_t fp;
     57        uintptr_t pc;
     58        uintptr_t tls;
     59} context_t;
    4960
    5061static inline uintptr_t _context_get_fp(context_t *ctx)
    5162{
    52         // FIXME: No frame pointer in the standard ABI.
    53         return 0;
     63        /* This function returns the frame pointer. */
     64        return ctx->fp;
    5465}
    5566
  • uspace/lib/c/arch/riscv64/src/fibril.c

    r67f11a0 ra36f442  
    3030 */
    3131
    32 #include <setjmp.h>
     32#include <fibril.h>
    3333#include <stdbool.h>
    3434
  • uspace/lib/c/generic/adt/hash_table.c

    r67f11a0 ra36f442  
    269269
    270270/** Find the next item equal to item. */
    271 ht_link_t *
    272 hash_table_find_next(const hash_table_t *h, ht_link_t *first, ht_link_t *item)
     271ht_link_t *hash_table_find_next(const hash_table_t *h, ht_link_t *item)
    273272{
    274273        assert(item);
    275274        assert(h && h->bucket);
    276275
    277         size_t idx = h->op->hash(item) % h->bucket_cnt;
    278 
    279276        /* Traverse the circular list until we reach the starting item again. */
    280         for (link_t *cur = item->link.next; cur != &first->link;
    281             cur = cur->next) {
     277        for (link_t *cur = item->link.next; cur != &item->link; cur = cur->next) {
    282278                assert(cur);
    283 
    284                 if (cur == &h->bucket[idx].head)
    285                         continue;
    286 
    287279                ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link);
    288280                /*
  • uspace/lib/c/generic/str.c

    r67f11a0 ra36f442  
    13601360
    13611361        /* Skip over leading delimiters. */
    1362         tmp = 0;
    1363         cur = 0;
    1364         while ((ch = str_decode(s, &tmp, len)) && str_chr(delim, ch))
     1362        for (tmp = cur = 0;
     1363            (ch = str_decode(s, &tmp, len)) && str_chr(delim, ch); /**/)
    13651364                cur = tmp;
    13661365        start = &s[cur];
    13671366
    13681367        /* Skip over token characters. */
    1369         tmp = cur;
    1370         while ((ch = str_decode(s, &tmp, len)) && !str_chr(delim, ch))
     1368        for (tmp = cur;
     1369            (ch = str_decode(s, &tmp, len)) && !str_chr(delim, ch); /**/)
    13711370                cur = tmp;
    13721371        end = &s[cur];
  • uspace/lib/c/include/adt/hash_table.h

    r67f11a0 ra36f442  
    9595extern bool hash_table_insert_unique(hash_table_t *, ht_link_t *);
    9696extern 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 *,
    98     ht_link_t *);
     97extern ht_link_t *hash_table_find_next(const hash_table_t *, ht_link_t *);
    9998extern size_t hash_table_remove(hash_table_t *, void *);
    10099extern void hash_table_remove_item(hash_table_t *, ht_link_t *);
Note: See TracChangeset for help on using the changeset viewer.