Changeset 380553c in mainline for kernel/generic/include/proc/thread.h


Ignore:
Timestamp:
2012-06-21T10:49:44Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d510ac01
Parents:
2616a75b (diff), f22dc820 (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 with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/thread.h

    r2616a75b r380553c  
    5454
    5555/* Thread flags */
    56 
    57 /** Thread cannot be migrated to another CPU.
    58  *
    59  * When using this flag, the caller must set cpu in the thread_t
    60  * structure manually before calling thread_ready (even on uniprocessor).
    61  *
    62  */
    63 #define THREAD_FLAG_WIRED  (1 << 0)
    64 
    65 /** Thread was migrated to another CPU and has not run yet. */
    66 #define THREAD_FLAG_STOLEN  (1 << 1)
    67 
    68 /** Thread executes in userspace. */
    69 #define THREAD_FLAG_USPACE  (1 << 2)
    70 
    71 /** Thread will be attached by the caller. */
    72 #define THREAD_FLAG_NOATTACH  (1 << 3)
     56typedef enum {
     57        THREAD_FLAG_NONE = 0,
     58        /** Thread executes in user space. */
     59        THREAD_FLAG_USPACE = (1 << 0),
     60        /** Thread will be attached by the caller. */
     61        THREAD_FLAG_NOATTACH = (1 << 1),
     62        /** Thread accounting doesn't affect accumulated task accounting. */
     63        THREAD_FLAG_UNCOUNTED = (1 << 2)
     64} thread_flags_t;
    7365
    7466/** Thread structure. There is one per thread. */
     
    147139       
    148140        fpu_context_t *saved_fpu_context;
    149         int fpu_context_exists;
     141        bool fpu_context_exists;
    150142       
    151143        /*
     
    154146         * thread. This disables migration.
    155147         */
    156         int fpu_context_engaged;
     148        bool fpu_context_engaged;
    157149       
    158150        /* The thread will not be migrated if nomigrate is non-zero. */
    159         int nomigrate;
    160        
    161         /** Thread's state. */
     151        unsigned int nomigrate;
     152       
     153        /** Thread state. */
    162154        state_t state;
    163         /** Thread's flags. */
    164         unsigned int flags;
    165        
    166         /** Thread's CPU. */
     155       
     156        /** Thread CPU. */
    167157        cpu_t *cpu;
    168158        /** Containing task. */
    169159        task_t *task;
     160        /** Thread is wired to CPU. */
     161        bool wired;
     162        /** Thread was migrated to another CPU and has not run yet. */
     163        bool stolen;
     164        /** Thread is executed in user space. */
     165        bool uspace;
    170166       
    171167        /** Ticks before preemption. */
     
    216212extern void thread_init(void);
    217213extern thread_t *thread_create(void (*)(void *), void *, task_t *,
    218     unsigned int, const char *, bool);
     214    thread_flags_t, const char *);
     215extern void thread_wire(thread_t *, cpu_t *);
    219216extern void thread_attach(thread_t *, task_t *);
    220217extern void thread_ready(thread_t *);
Note: See TracChangeset for help on using the changeset viewer.