Changes in / [a36f442:67f11a0] in mainline


Ignore:
Files:
1 added
18 edited

Legend:

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

    ra36f442 r67f11a0  
    6464        bootinfo.memmap.zones[0].size = PHYSMEM_SIZE;
    6565
    66         printf("\nMemory statistics (total %lu MB, starting at %p)\n\n",
     66        printf("\nMemory statistics (total %llu 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

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

    ra36f442 r67f11a0  
    269269
    270270/** Find the next item equal to item. */
    271 ht_link_t *hash_table_find_next(const hash_table_t *h, ht_link_t *item)
     271ht_link_t *
     272hash_table_find_next(const hash_table_t *h, ht_link_t *first, ht_link_t *item)
    272273{
    273274        assert(item);
    274275        assert(h && h->bucket);
    275276
     277        size_t idx = h->op->hash(item) % h->bucket_cnt;
     278
    276279        /* 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) {
    278282                assert(cur);
     283
     284                if (cur == &h->bucket[idx].head)
     285                        continue;
     286
    279287                ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link);
    280288                /*
  • kernel/generic/src/ddi/irq.c

    ra36f442 r67f11a0  
    141141{
    142142        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)) {
    145146                irq_t *irq = hash_table_get_inst(lnk, irq_t, link);
    146147                irq_spinlock_lock(&irq->lock, false);
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    ra36f442 r67f11a0  
    338338        argc = cli_count_args(argv);
    339339
    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) {
    341346                c = getopt_long(argc, argv, "xhvmH:t:b:sn", long_options, &opt_ind);
    342347                switch (c) {
  • uspace/app/bdsh/cmds/modules/cmp/cmp.c

    ra36f442 r67f11a0  
    123123        argc = cli_count_args(argv);
    124124
    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) {
    126131                c = getopt_long(argc, argv, "hv", long_options, &opt_ind);
    127132                switch (c) {
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    ra36f442 r67f11a0  
    484484        argc = cli_count_args(argv);
    485485
    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) {
    487492                c = getopt_long(argc, argv, "hvVfirb:", long_options, &opt_ind);
    488493                switch (c) {
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    ra36f442 r67f11a0  
    356356        argc = cli_count_args(argv);
    357357
    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) {
    359364                c = getopt_long(argc, argv, "hur", long_options, &opt_ind);
    360365                switch (c) {
  • uspace/app/bdsh/cmds/modules/mkdir/mkdir.c

    ra36f442 r67f11a0  
    168168        argc = cli_count_args(argv);
    169169
    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) {
    171176                c = getopt_long(argc, argv, "pvhVfm:", long_options, &opt_ind);
    172177                switch (c) {
  • uspace/app/bdsh/cmds/modules/mkfile/mkfile.c

    ra36f442 r67f11a0  
    133133        argc = cli_count_args(argv);
    134134
    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) {
    136141                c = getopt_long(argc, argv, "ps:h", long_options, &opt_ind);
    137142                switch (c) {
  • uspace/app/bdsh/cmds/modules/mount/mount.c

    ra36f442 r67f11a0  
    141141        argc = cli_count_args(argv);
    142142
    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) {
    144149                c = getopt_long(argc, argv, "i:ht", long_options, &opt_ind);
    145150                switch (c) {
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    ra36f442 r67f11a0  
    260260        }
    261261
    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) {
    263268                c = getopt_long(argc, argv, "hvrfs", long_options, &opt_ind);
    264269                switch (c) {
  • uspace/app/bdsh/cmds/modules/touch/touch.c

    ra36f442 r67f11a0  
    8888        DIR *dirp;
    8989
    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) {
    9196                c = getopt_long(argc, argv, "c", long_options, &longind);
    9297                switch (c) {
  • uspace/lib/c/arch/riscv64/include/libarch/fibril.h

    ra36f442 r67f11a0  
    3737
    3838#include <stdint.h>
     39#include <libarch/fibril_context.h>
    3940
    4041#define SP_DELTA  0
     
    4445                (ctx)->pc = (uintptr_t) (_pc); \
    4546                (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); \
    4848        } while (0)
    49 
    50 /*
    51  * This stores the registers which need to be
    52  * 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;
    6049
    6150static inline uintptr_t _context_get_fp(context_t *ctx)
    6251{
    63         /* This function returns the frame pointer. */
    64         return ctx->fp;
     52        // FIXME: No frame pointer in the standard ABI.
     53        return 0;
    6554}
    6655
  • uspace/lib/c/arch/riscv64/src/fibril.c

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

    ra36f442 r67f11a0  
    269269
    270270/** Find the next item equal to item. */
    271 ht_link_t *hash_table_find_next(const hash_table_t *h, ht_link_t *item)
     271ht_link_t *
     272hash_table_find_next(const hash_table_t *h, ht_link_t *first, ht_link_t *item)
    272273{
    273274        assert(item);
    274275        assert(h && h->bucket);
    275276
     277        size_t idx = h->op->hash(item) % h->bucket_cnt;
     278
    276279        /* 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) {
    278282                assert(cur);
     283
     284                if (cur == &h->bucket[idx].head)
     285                        continue;
     286
    279287                ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link);
    280288                /*
  • uspace/lib/c/generic/str.c

    ra36f442 r67f11a0  
    13601360
    13611361        /* 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))
    13641365                cur = tmp;
    13651366        start = &s[cur];
    13661367
    13671368        /* 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))
    13701371                cur = tmp;
    13711372        end = &s[cur];
  • uspace/lib/c/include/adt/hash_table.h

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