Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset b1d3c36 in mainline for uspace/lib/libc/include/fibril.h


Ignore:
Timestamp:
2010-02-04T16:51:36Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
4cac2d69
Parents:
d32358f
Message:

small arch/generic interface cleanup:
context_set() should be always defined explicitly (either as a custom macro
or as a reference to context_set_generic()), using #undef and implicit macro
values can be rather confusing

File:
1 edited

Legend:

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

    rd32358f rb1d3c36  
    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
    5149
    5250typedef enum {
     
    5957typedef sysarg_t fid_t;
    6058
    61 struct fibril {
     59typedef struct fibril {
    6260        link_t link;
    6361        context_t ctx;
     
    7068        int retval;
    7169        int flags;
    72 };
    73 typedef struct fibril fibril_t;
     70} fibril_t;
    7471
    7572/** Fibril-local variable specifier */
    7673#define fibril_local __thread
    7774
    78 extern int context_save(context_t *c) __attribute__ ((returns_twice));
    79 extern void context_restore(context_t *c) __attribute__ ((noreturn));
     75extern int context_save(context_t *ctx) __attribute__((returns_twice));
     76extern void context_restore(context_t *ctx) __attribute__((noreturn));
    8077
    8178extern fid_t fibril_create(int (*func)(void *), void *arg);
     
    9087extern void fibril_dec_sercount(void);
    9188
    92 static inline int fibril_yield(void) {
     89static inline int fibril_yield(void)
     90{
    9391        return fibril_switch(FIBRIL_PREEMPT);
    9492}
Note: See TracChangeset for help on using the changeset viewer.