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


Ignore:
Timestamp:
2007-06-28T00:54:12Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12f91130
Parents:
b9641ee
Message:

Goodbye pseudo threads, welcome fibrils.
The renaming might still be incomplete.

File:
1 moved

Legend:

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

    rb9641ee rbc1f1c2  
    3333 */
    3434
    35 #ifndef LIBC_PSTHREAD_H_
    36 #define LIBC_PSTHREAD_H_
     35#ifndef LIBC_FIBRIL_H_
     36#define LIBC_FIBRIL_H_
    3737
    38 #include <libarch/psthread.h>
     38#include <libarch/fibril.h>
    3939#include <libadt/list.h>
    4040#include <libarch/thread.h>
     
    4747#endif /* context_set */
    4848
    49 #define PSTHREAD_SERIALIZED   1
     49#define FIBRIL_SERIALIZED   1
    5050
    5151typedef enum {
    52         PS_SLEEP,
    53         PS_PREEMPT,
    54         PS_TO_MANAGER,
    55         PS_FROM_MANAGER,
    56         PS_FROM_DEAD
    57 } pschange_type;
     52        FIBRIL_SLEEP,
     53        FIBRIL_PREEMPT,
     54        FIBRIL_TO_MANAGER,
     55        FIBRIL_FROM_MANAGER,
     56        FIBRIL_FROM_DEAD
     57} fibril_switch_type_t;
    5858
    59 typedef sysarg_t pstid_t;
     59typedef sysarg_t fid_t;
    6060
    61 struct psthread_data {
     61struct fibril {
    6262        link_t link;
    6363        context_t ctx;
     
    6767        tcb_t *tcb;
    6868
    69         struct psthread_data *clean_after_me;
    70         struct psthread_data *joiner;
     69        struct fibril *clean_after_me;
     70        struct fibril *joiner;
    7171        int joinee_retval;
    7272        int retval;
    7373        int flags;
    7474};
    75 typedef struct psthread_data psthread_data_t;
     75typedef struct fibril fibril_t;
    7676
    7777extern int context_save(context_t *c);
    7878extern void context_restore(context_t *c) __attribute__ ((noreturn));
    7979
    80 pstid_t psthread_create(int (*func)(void *), void *arg);
    81 int psthread_join(pstid_t psthrid);
    82 psthread_data_t * psthread_setup(void);
    83 void psthread_teardown(psthread_data_t *pt);
    84 int psthread_schedule_next_adv(pschange_type ctype);
    85 void psthread_add_ready(pstid_t ptid);
    86 void psthread_add_manager(pstid_t psthrid);
    87 void psthread_remove_manager(void);
    88 pstid_t psthread_get_id(void);
    89 void psthread_inc_sercount(void);
    90 void psthread_dec_sercount(void);
     80extern fid_t fibril_create(int (*func)(void *), void *arg);
     81extern int fibril_join(fid_t fid);
     82extern fibril_t *fibril_setup(void);
     83extern void fibril_teardown(fibril_t *f);
     84extern int fibril_schedule_next_adv(fibril_switch_type_t stype);
     85extern void fibril_add_ready(fid_t fid);
     86extern void fibril_add_manager(fid_t fid);
     87extern void fibril_remove_manager(void);
     88extern fid_t fibril_get_id(void);
     89extern void fibril_inc_sercount(void);
     90extern void fibril_dec_sercount(void);
    9191
    92 static inline int psthread_schedule_next(void) {
    93         return psthread_schedule_next_adv(PS_PREEMPT);
     92static inline int fibril_schedule_next(void) {
     93        return fibril_schedule_next_adv(FIBRIL_PREEMPT);
    9494}
    9595
Note: See TracChangeset for help on using the changeset viewer.