Subversion Repositories HelenOS

Rev

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

Rev 771 Rev 778
Line 63... Line 63...
63
 
63
 
64
/** Initialize address space subsystem. */
64
/** Initialize address space subsystem. */
65
void as_init(void)
65
void as_init(void)
66
{
66
{
67
    as_arch_init();
67
    as_arch_init();
68
    AS_KERNEL = as_create(FLAG_AS_KERNEL);
68
    AS_KERNEL = as_create(FLAG_AS_KERNEL | FLAG_AS_EARLYMALLOC);
69
        if (!AS_KERNEL)
69
        if (!AS_KERNEL)
70
                panic("can't create kernel address space\n");
70
                panic("can't create kernel address space\n");
71
}
71
}
72
 
72
 
73
/** Create address space.
73
/** Create address space.
Line 76... Line 76...
76
 */
76
 */
77
as_t *as_create(int flags)
77
as_t *as_create(int flags)
78
{
78
{
79
    as_t *as;
79
    as_t *as;
80
 
80
 
-
 
81
    if (flags & FLAG_AS_EARLYMALLOC)
81
    as = (as_t *) early_malloc(sizeof(as_t));
82
        as = (as_t *) early_malloc(sizeof(as_t));
-
 
83
    else
-
 
84
        as = (as_t *) malloc(sizeof(as_t));
82
    if (as) {
85
    if (as) {
83
        list_initialize(&as->as_with_asid_link);
86
        list_initialize(&as->as_with_asid_link);
84
        spinlock_initialize(&as->lock, "as_lock");
87
        spinlock_initialize(&as->lock, "as_lock");
85
        list_initialize(&as->as_area_head);
88
        list_initialize(&as->as_area_head);
86
 
89