Subversion Repositories HelenOS-historic

Rev

Rev 1129 | Rev 1392 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1129 Rev 1167
Line 34... Line 34...
34
#include <psthread.h>
34
#include <psthread.h>
35
#include <string.h>
35
#include <string.h>
36
 
36
 
37
#include <stdio.h>
37
#include <stdio.h>
38
 
38
 
-
 
39
 
-
 
40
#ifndef THREAD_INITIAL_STACK_PAGES_NO
-
 
41
#define THREAD_INITIAL_STACK_PAGES_NO 1
-
 
42
#endif
-
 
43
 
-
 
44
 
39
extern char _tdata_start;
45
extern char _tdata_start;
40
extern char _tdata_end;
46
extern char _tdata_end;
41
extern char _tbss_start;
47
extern char _tbss_start;
42
extern char _tbss_end;
48
extern char _tbss_end;
43
 
49
 
Line 107... Line 113...
107
int thread_create(void (* function)(void *), void *arg, char *name)
113
int thread_create(void (* function)(void *), void *arg, char *name)
108
{
114
{
109
    char *stack;
115
    char *stack;
110
    uspace_arg_t *uarg;
116
    uspace_arg_t *uarg;
111
 
117
 
112
    stack = (char *) malloc(getpagesize());
118
    stack = (char *) malloc(getpagesize()*THREAD_INITIAL_STACK_PAGES_NO);
113
    if (!stack)
119
    if (!stack)
114
        return -1;
120
        return -1;
115
       
121
       
116
    uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t));
122
    uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t));
117
    if (!uarg) {
123
    if (!uarg) {