Changeset 04803bf in mainline for uspace/lib/c/include/fibril.h


Ignore:
Timestamp:
2011-03-21T22:00:17Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
143932e3
Parents:
b50b5af2 (diff), 7308e84 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes (needs fixes).

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/fibril.h

    rb50b5af2 r04803bf  
    4040#include <libarch/tls.h>
    4141
    42 #ifndef context_set
    43 #define context_set(c, _pc, stack, size, ptls) \
     42#define context_set_generic(c, _pc, stack, size, ptls) \
    4443        (c)->pc = (sysarg_t) (_pc); \
    4544        (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    4645        (c)->tls = (sysarg_t) (ptls);
    47 #endif /* context_set */
    4846
    49 #define FIBRIL_SERIALIZED       1
    50 #define FIBRIL_WRITER           2
     47#define FIBRIL_SERIALIZED  1
     48#define FIBRIL_WRITER      2
     49
     50struct fibril;
     51
     52typedef struct {
     53        struct fibril *owned_by;
     54} fibril_owner_info_t;
    5155
    5256typedef enum {
     
    5963typedef sysarg_t fid_t;
    6064
    61 struct fibril {
     65typedef struct fibril {
    6266        link_t link;
    6367        context_t ctx;
     
    7074        int retval;
    7175        int flags;
    72 };
    73 typedef struct fibril fibril_t;
     76
     77        fibril_owner_info_t *waits_for;
     78} fibril_t;
    7479
    7580/** Fibril-local variable specifier */
    7681#define fibril_local __thread
    7782
    78 extern int context_save(context_t *c) __attribute__ ((returns_twice));
    79 extern void context_restore(context_t *c) __attribute__ ((noreturn));
     83extern int context_save(context_t *ctx) __attribute__((returns_twice));
     84extern void context_restore(context_t *ctx) __attribute__((noreturn));
    8085
    8186extern fid_t fibril_create(int (*func)(void *), void *arg);
     
    8994extern void fibril_inc_sercount(void);
    9095extern void fibril_dec_sercount(void);
     96extern int fibril_get_sercount(void);
    9197
    92 static inline int fibril_yield(void) {
     98static inline int fibril_yield(void)
     99{
    93100        return fibril_switch(FIBRIL_PREEMPT);
    94101}
Note: See TracChangeset for help on using the changeset viewer.