Changeset 615e83d in mainline for uspace/lib/c/generic/context.c


Ignore:
Timestamp:
2018-03-08T18:25:31Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
55f068c
Parents:
e0a4686
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-08 17:43:06)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-08 18:25:31)
Message:

Turn context_save/context_restore into standard setjmp/longjmp.

File:
1 edited

Legend:

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

    re0a4686 r615e83d  
    2828
    2929#include <context.h>
     30#include <setjmp.h>
    3031#include <libarch/tls.h>
    3132#include <libarch/fibril.h>
     
    4243void context_swap(context_t *self, context_t *other)
    4344{
    44         if (context_save(self))
    45                 context_restore(other);
     45        if (!setjmp(self))
     46                __longjmp(other, 1);
    4647}
    4748
    4849void context_create(context_t *context, const context_create_t *arg)
    4950{
    50         context_save(context);
     51        setjmp(context);
    5152        context_set(context, FADDR(arg->fn), arg->stack_base,
    5253            arg->stack_size, arg->tls);
Note: See TracChangeset for help on using the changeset viewer.