Changeset e1b6742 in mainline for kernel/generic/include


Ignore:
Timestamp:
2010-04-18T12:17:11Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e535eeb
Parents:
bbda5ab
Message:

export threads to user space
the "tasks" command can now print all threads or threads belonging to a task

Location:
kernel/generic/include
Files:
3 edited

Legend:

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

    rbbda5ab re1b6742  
    4848#include <proc/uarg.h>
    4949#include <udebug/udebug.h>
     50#include <sysinfo/abi.h>
    5051
    5152#define THREAD_STACK_SIZE       STACK_SIZE
     
    6970#define THREAD_FLAG_NOATTACH    (1 << 3)
    7071
    71 /** Thread states. */
    72 typedef enum {
    73         /** It is an error, if thread is found in this state. */
    74         Invalid,
    75         /** State of a thread that is currently executing on some CPU. */
    76         Running,
    77         /** Thread in this state is waiting for an event. */
    78         Sleeping,
    79         /** State of threads in a run queue. */
    80         Ready,
    81         /** Threads are in this state before they are first readied. */
    82         Entering,
    83         /** After a thread calls thread_exit(), it is put into Exiting state. */
    84         Exiting,
    85         /** Threads that were not detached but exited are Lingering. */
    86         Lingering
    87 } state_t;
    88 
    8972/** Thread structure. There is one per thread. */
    9073typedef struct thread {
     
    253236extern void thread_print_list(void);
    254237extern void thread_destroy(thread_t *);
     238extern thread_t *thread_find_by_id(thread_id_t);
    255239extern void thread_update_accounting(bool);
    256240extern bool thread_exists(thread_t *);
  • kernel/generic/include/sysinfo/abi.h

    rbbda5ab re1b6742  
    4242/** Maximum task name size */
    4343#define TASK_NAME_BUFLEN  20
     44
     45/** Thread states */
     46typedef enum {
     47        /** It is an error, if thread is found in this state. */
     48        Invalid,
     49        /** State of a thread that is currently executing on some CPU. */
     50        Running,
     51        /** Thread in this state is waiting for an event. */
     52        Sleeping,
     53        /** State of threads in a run queue. */
     54        Ready,
     55        /** Threads are in this state before they are first readied. */
     56        Entering,
     57        /** After a thread calls thread_exit(), it is put into Exiting state. */
     58        Exiting,
     59        /** Threads that were not detached but exited are Lingering. */
     60        Lingering
     61} state_t;
    4462
    4563/** Statistics about a single CPU
     
    89107} stats_task_t;
    90108
     109/** Statistics about a single thread
     110 *
     111 */
     112typedef struct {
     113        task_id_t task_id;
     114        state_t state;
     115        int priority;
     116        uint64_t ucycles;
     117        uint64_t kcycles;
     118        bool on_cpu;
     119        unsigned int cpu;
     120} stats_thread_t;
     121
    91122/** Load fixed-point value */
    92123typedef uint32_t load_t;
  • kernel/generic/include/sysinfo/sysinfo.h

    rbbda5ab re1b6742  
    105105
    106106/** Generated subtree function */
    107 typedef sysinfo_return_t (*sysinfo_fn_subtree_t)(const char *);
     107typedef sysinfo_return_t (*sysinfo_fn_subtree_t)(const char *, bool);
    108108
    109109/** Sysinfo subtree (union)
Note: See TracChangeset for help on using the changeset viewer.