Changeset 9cefba4 in mainline


Ignore:
Timestamp:
2005-10-16T19:18:19Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba1b2194
Parents:
0bed5d0
Message:

Doxygen-style comments.

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • doc/arch/mips32

    r0bed5d0 r9cefba4  
    1919
    2020EMULATORS AND VIRTUALIZERS
    21         o msim 1.2.7
    22         o msim 1.2.6 with lwl/lwr/swl/swr patch
     21        o msim 1.2.8
    2322        o gxemul - both big and little endian
    2423        o simics 2.2.19
  • include/proc/scheduler.h

    r0bed5d0 r9cefba4  
    4040struct runq {
    4141        spinlock_t lock;
    42         link_t rq_head;
    43         int n;
     42        link_t rq_head;         /**< List of ready threads. */
     43        int n;                  /**< Number of threads in rq_ready. */
    4444};
    4545
  • include/proc/task.h

    r0bed5d0 r9cefba4  
    3636struct task {
    3737        spinlock_t lock;
    38         link_t th_head;         /* list of threads contained in this task */
    39         link_t tasks_link;      /* link to other tasks within the system */
     38        link_t th_head;         /**< List of threads contained in this task. */
     39        link_t tasks_link;      /**< Link to other tasks within the system. */
    4040        vm_t *vm;
    4141};
  • include/proc/thread.h

    r0bed5d0 r9cefba4  
    4646
    4747enum state {
    48         Invalid,
    49         Running,
    50         Sleeping,
    51         Ready,
    52         Entering,
    53         Exiting
     48        Invalid,        /**< It is an error, if thread is found in this state. */
     49        Running,        /**< State of a thread that is currently executing on some CPU. */
     50        Sleeping,       /**< Thread in this state is waiting for an event. */
     51        Ready,          /**< State of threads in a run queue. */
     52        Entering,       /**< Threads are in this state before they are first readied. */
     53        Exiting         /**< After a thread calls thread_exit(), it is put into Exiting state. */
    5454};
    5555
     
    6060
    6161struct thread {
    62         link_t rq_link;                         /* run queue link */
    63         link_t wq_link;                         /* wait queue link */
    64         link_t th_link;                         /* links to threads within the parent task*/
    65         link_t threads_link;
     62        link_t rq_link;                         /**< Run queue link. */
     63        link_t wq_link;                         /**< Wait queue link. */
     64        link_t th_link;                         /**< Links to threads within containing task. */
     65        link_t threads_link;                    /**< Link to the list of all threads. */
    6666       
    6767        /* items below are protected by lock */
    6868        spinlock_t lock;
    6969
    70         void (* thread_code)(void *);
    71         void *thread_arg;
     70        void (* thread_code)(void *);           /**< Function implementing the thread. */
     71        void *thread_arg;                       /**< Argument passed to thread_code() function. */
    7272
    73         context_t saved_context;
    74         context_t sleep_timeout_context;
     73        context_t saved_context;                /**< From here, the stored context is restored when the thread is scheduled. */
     74        context_t sleep_timeout_context;        /**< From here, the stored failover context is restored when sleep times out. */
     75
     76        waitq_t *sleep_queue;                   /**< Wait queue in which this thread sleeps. */
     77        timeout_t sleep_timeout;                /**< Timeout used for timeoutable sleeping.  */
     78        volatile int timeout_pending;           /**< Flag signalling sleep timeout in progress. */
     79
    7580        fpu_context_t saved_fpu_context;
    7681        int fpu_context_exists;
     
    8388        int fpu_context_engaged;
    8489
    85         waitq_t *sleep_queue;
    86         timeout_t sleep_timeout;
    87         volatile int timeout_pending;
     90        rwlock_type_t rwlock_holder_type;
    8891
    89         rwlock_type_t rwlock_holder_type;
    90         void (* call_me)(void *);
    91         void *call_me_with;
     92        void (* call_me)(void *);               /**< Funtion to be called in scheduler before the thread is put asleep. */
     93        void *call_me_with;                     /**< Argument passed to call_me(). */
    9294
    93         int state;
    94         int flags;
     95        state_t state;                          /**< Thread's state. */
     96        int flags;                              /**< Thread's flags. */
    9597       
    96         cpu_t *cpu;
    97         task_t *task;
     98        cpu_t *cpu;                             /**< Thread's CPU. */
     99        task_t *task;                           /**< Containing task. */
    98100
    99         __u64 ticks;
     101        __u64 ticks;                            /**< Ticks before preemption. */
    100102
    101         __u32 tid;
     103        int pri;                                /**< Thread's priority. Implemented as index of run queue. */
     104        __u32 tid;                              /**< Thread ID. */
    102105       
    103         int pri;
    104        
    105         ARCH_THREAD_DATA;
     106        ARCH_THREAD_DATA;                       /**< Architecture-specific data. */
    106107
    107         __u8 *kstack;
    108         __u8 *ustack;
     108        __u8 *kstack;                           /**< Thread's kernel stack. */
     109        __u8 *ustack;                           /**< Thread's user stack. */
    109110};
    110111
    111 extern spinlock_t threads_lock;
    112 extern link_t threads_head;
     112extern spinlock_t threads_lock;                 /**< Lock protecting threads_head list. */
     113extern link_t threads_head;                     /**< List of all threads in the system. */
    113114
    114115static void cushion(void);
  • include/synch/rwlock.h

    r0bed5d0 r9cefba4  
    4343struct rwlock {
    4444        spinlock_t lock;
    45         mutex_t exclusive;
    46         int readers_in;
     45        mutex_t exclusive;      /**< Mutex for writers, readers can bypass it if readers_in is positive. */
     46        int readers_in;         /**< Number of readers in critical section. */
    4747};
    4848
  • include/synch/synch.h

    r0bed5d0 r9cefba4  
    3030#define __SYNCH_H__
    3131
    32 #define SYNCH_NO_TIMEOUT        0
    33 #define SYNCH_BLOCKING          0
    34 #define SYNCH_NON_BLOCKING      1
     32#define SYNCH_NO_TIMEOUT        0       /**< No timeout is request. */
     33#define SYNCH_BLOCKING          0       /**< Blocking operation request. */
     34#define SYNCH_NON_BLOCKING      1       /**< Non-blocking operation request. */
    3535
    36 #define ESYNCH_WOULD_BLOCK      1
    37 #define ESYNCH_TIMEOUT          2
    38 #define ESYNCH_OK_ATOMIC        4
    39 #define ESYNCH_OK_BLOCKED       8
     36#define ESYNCH_WOULD_BLOCK      1       /**< Could not satisfy the request without going to sleep. */
     37#define ESYNCH_TIMEOUT          2       /**< Timeout occurred. */
     38#define ESYNCH_OK_ATOMIC        4       /**< Operation succeeded without sleeping. */
     39#define ESYNCH_OK_BLOCKED       8       /**< Operation succeeded and did sleep. */
    4040
    4141#define SYNCH_FAILED(rc)        ((rc) & (ESYNCH_WOULD_BLOCK | ESYNCH_TIMEOUT))
  • include/synch/waitq.h

    r0bed5d0 r9cefba4  
    4141struct waitq {
    4242        spinlock_t lock;
    43         int missed_wakeups;
    44         link_t head;
     43        int missed_wakeups;     /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */
     44        link_t head;            /**< List of sleeping threads for wich there was no missed_wakeup. */
    4545};
    4646
  • include/typedefs.h

    r0bed5d0 r9cefba4  
    4646typedef struct cpu_arch cpu_arch_t;
    4747typedef struct task task_t;
     48typedef enum state state_t;
    4849typedef struct thread thread_t;
    4950typedef struct context context_t;
Note: See TracChangeset for help on using the changeset viewer.