Changeset 9f52563 in mainline for generic/include


Ignore:
Timestamp:
2006-03-17T01:34:36Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8a0b0669
Parents:
5fceec7
Message:

Support for user space threads.

Location:
generic/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • generic/include/ipc/ipc.h

    r5fceec7 r9f52563  
    7979 *
    8080 * The protocol for negotiating is:
    81  * - sys_connecttome - sends a message IPC_M_CONNECTTOME
     81 * - sys_connect_to_me - sends a message IPC_M_CONNECTTOME
    8282 * - sys_wait_for_call - upon receipt tries to allocate new phone
    8383 *                       - if it fails, responds with ELIMIT
  • generic/include/proc/thread.h

    r5fceec7 r9f52563  
    4444#define THREAD_STACK_SIZE       STACK_SIZE
    4545
    46 #define THREAD_USER_STACK       1
    47 
    4846enum state {
    4947        Invalid,        /**< It is an error, if thread is found in this state. */
     
    6058#define X_STOLEN        (1<<1)
    6159
     60#define THREAD_NAME_BUFLEN      20
     61
    6262/** Thread structure. There is one per thread. */
    6363struct thread {
    64         char *name;
    65        
    6664        link_t rq_link;                         /**< Run queue link. */
    6765        link_t wq_link;                         /**< Wait queue link. */
     
    7674         */
    7775        SPINLOCK_DECLARE(lock);
     76
     77        char name[THREAD_NAME_BUFLEN];
    7878
    7979        void (* thread_code)(void *);           /**< Function implementing the thread. */
     
    118118};
    119119
     120/** Structure passed to uinit kernel thread as argument. */
     121typedef struct uspace_arg {
     122        __address uspace_entry;
     123        __address uspace_stack;
     124} uspace_arg_t;
     125
    120126/** Thread list lock.
    121127 *
     
    140146extern void thread_destroy(thread_t *t);
    141147
    142 
    143148/* Fpu context slab cache */
    144149extern slab_cache_t *fpu_context_slab;
    145150
     151/** Thread syscall prototypes. */
     152__native sys_thread_create(__address function, void *arg, void *stack, char *name);
     153__native sys_thread_exit(int status);
     154
    146155#endif
  • generic/include/syscall/syscall.h

    r5fceec7 r9f52563  
    3131
    3232typedef enum {
    33         SYS_CTL = 0,
    34         SYS_IO,
     33        SYS_IO = 0,
     34        SYS_THREAD_CREATE,
     35        SYS_THREAD_EXIT,
    3536        SYS_MMAP,
    3637        SYS_MREMAP,
  • generic/include/userspace.h

    r5fceec7 r9f52563  
    3030#define __USERSPACE_H__
    3131
     32#include <proc/thread.h>
    3233#include <arch/types.h>
    3334
    34 extern void userspace(__address entry) __attribute__ ((noreturn)); /**< Switch to user-space (CPU user priviledge level) */
     35/** Switch to user-space (CPU user priviledge level) */
     36extern void userspace(uspace_arg_t *uarg) __attribute__ ((noreturn));
    3537
    3638#endif
Note: See TracChangeset for help on using the changeset viewer.