Subversion Repositories HelenOS

Rev

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

Rev 2479 Rev 2482
Line 40... Line 40...
40
 
40
 
41
#include <libc.h>
41
#include <libc.h>
42
#include <unistd.h>
42
#include <unistd.h>
43
#include <thread.h>
43
#include <thread.h>
44
#include <malloc.h>
44
#include <malloc.h>
45
#include <psthread.h>
45
#include <fibril.h>
46
#include <io/stream.h>
46
#include <io/stream.h>
47
#include <ipc/ipc.h>
47
#include <ipc/ipc.h>
48
#include <async.h>
48
#include <async.h>
49
#include <as.h>
49
#include <as.h>
50
 
50
 
Line 55... Line 55...
55
    thread_exit(status);
55
    thread_exit(status);
56
}
56
}
57
 
57
 
58
void __main(void)
58
void __main(void)
59
{
59
{
60
    psthread_data_t *pt;
60
    fibril_t *f;
61
 
61
 
62
    (void) as_area_create(&_heap, 1, AS_AREA_WRITE | AS_AREA_READ);
62
    (void) as_area_create(&_heap, 1, AS_AREA_WRITE | AS_AREA_READ);
63
    _async_init();
63
    _async_init();
64
    pt = psthread_setup();
64
    f = fibril_setup();
65
    __tcb_set(pt->tcb);
65
    __tcb_set(f->tcb);
66
}
66
}
67
 
67
 
68
void __io_init(void)
68
void __io_init(void)
69
{
69
{
70
    open("stdin", 0);
70
    open("stdin", 0);
Line 72... Line 72...
72
    open("stderr", 0);
72
    open("stderr", 0);
73
}
73
}
74
 
74
 
75
void __exit(void)
75
void __exit(void)
76
{
76
{
77
    psthread_teardown(__tcb_get()->pst_data);
77
    fibril_teardown(__tcb_get()->fibril_data);
78
    _exit(0);
78
    _exit(0);
79
}
79
}
80
 
80
 
81
/** @}
81
/** @}
82
 */
82
 */