Changeset e0a4686 in mainline for uspace/lib/c/generic/fibril_synch.c


Ignore:
Timestamp:
2018-03-08T18:25:31Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
53ad43c, 615e83d
Parents:
fd57cf17
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-06 22:03:11)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-08 18:25:31)
Message:

Introduce context_swap() and use it to simplify fibril implementation.

This wraps the use of context_save()/context_restore(), to provide a more
natural (and easier to understand) control flow. The patch also hides the
details of the underlying context, requiring the use of context_get_pc()
to acquire program counter. This might allow context_swap() to only store
one pointer in the context, storing the remaining information in its stack
frame. However, that is not done in this patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/fibril_synch.c

    rfd57cf17 re0a4686  
    7373                if (oi->owned_by == f)
    7474                        break;
    75                 stacktrace_print_fp_pc(context_get_fp(&oi->owned_by->ctx),
    76                     oi->owned_by->ctx.pc);
     75                stacktrace_print_fp_pc(
     76                    context_get_fp(&oi->owned_by->ctx),
     77                    context_get_pc(&oi->owned_by->ctx));
    7778                printf("Fibril %p waits for primitive %p.\n",
    7879                     oi->owned_by, oi->owned_by->waits_for);
Note: See TracChangeset for help on using the changeset viewer.