Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1065 → Rev 1066

/kernel/trunk/generic/include/proc/thread.h
43,8 → 43,6
 
#define THREAD_STACK_SIZE STACK_SIZE
 
#define THREAD_USER_STACK 1
 
enum state {
Invalid, /**< It is an error, if thread is found in this state. */
Running, /**< State of a thread that is currently executing on some CPU. */
59,10 → 57,10
#define X_WIRED (1<<0)
#define X_STOLEN (1<<1)
 
#define THREAD_NAME_BUFLEN 20
 
/** Thread structure. There is one per thread. */
struct thread {
char *name;
link_t rq_link; /**< Run queue link. */
link_t wq_link; /**< Wait queue link. */
link_t th_link; /**< Links to threads within containing task. */
76,6 → 74,8
*/
SPINLOCK_DECLARE(lock);
 
char name[THREAD_NAME_BUFLEN];
 
void (* thread_code)(void *); /**< Function implementing the thread. */
void *thread_arg; /**< Argument passed to thread_code() function. */
 
117,6 → 117,12
__u8 *kstack; /**< Thread's kernel stack. */
};
 
/** Structure passed to uinit kernel thread as argument. */
typedef struct uspace_arg {
__address uspace_entry;
__address uspace_stack;
} uspace_arg_t;
 
/** Thread list lock.
*
* This lock protects all link_t structures chained in threads_head.
139,8 → 145,11
extern void thread_print_list(void);
extern void thread_destroy(thread_t *t);
 
 
/* Fpu context slab cache */
extern slab_cache_t *fpu_context_slab;
 
/** Thread syscall prototypes. */
__native sys_thread_create(__address function, void *arg, void *stack, char *name);
__native sys_thread_exit(int status);
 
#endif
/kernel/trunk/generic/include/userspace.h
29,8 → 29,10
#ifndef __USERSPACE_H__
#define __USERSPACE_H__
 
#include <proc/thread.h>
#include <arch/types.h>
 
extern void userspace(__address entry) __attribute__ ((noreturn)); /**< Switch to user-space (CPU user priviledge level) */
/** Switch to user-space (CPU user priviledge level) */
extern void userspace(uspace_arg_t *uarg) __attribute__ ((noreturn));
 
#endif
/kernel/trunk/generic/include/syscall/syscall.h
30,8 → 30,9
#define __SYSCALL_H__
 
typedef enum {
SYS_CTL = 0,
SYS_IO,
SYS_IO = 0,
SYS_THREAD_CREATE,
SYS_THREAD_EXIT,
SYS_MMAP,
SYS_MREMAP,
SYS_IPC_CALL_SYNC_FAST,
/kernel/trunk/generic/include/ipc/ipc.h
78,7 → 78,7
* so that it can start initiating new messages.
*
* The protocol for negotiating is:
* - sys_connecttome - sends a message IPC_M_CONNECTTOME
* - sys_connect_to_me - sends a message IPC_M_CONNECTTOME
* - sys_wait_for_call - upon receipt tries to allocate new phone
* - if it fails, responds with ELIMIT
* - passes call to userspace. If userspace