Rev 1062 | Rev 1078 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1062 | Rev 1066 | ||
---|---|---|---|
Line 113... | Line 113... | ||
113 | as_t *as; |
113 | as_t *as; |
114 | as_area_t *a; |
114 | as_area_t *a; |
115 | int rc; |
115 | int rc; |
116 | thread_t *t; |
116 | thread_t *t; |
117 | task_t *task; |
117 | task_t *task; |
- | 118 | uspace_arg_t *uarg; |
|
118 | 119 | ||
119 | as = as_create(0); |
120 | as = as_create(0); |
120 | 121 | ||
121 | rc = elf_load((elf_header_t *) program_addr, as); |
122 | rc = elf_load((elf_header_t *) program_addr, as); |
122 | if (rc != EE_OK) { |
123 | if (rc != EE_OK) { |
123 | as_free(as); |
124 | as_free(as); |
124 | return NULL; |
125 | return NULL; |
125 | } |
126 | } |
126 | 127 | ||
- | 128 | uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0); |
|
- | 129 | uarg->uspace_entry = (__address) ((elf_header_t *) program_addr)->e_entry; |
|
- | 130 | uarg->uspace_stack = USTACK_ADDRESS; |
|
- | 131 | ||
127 | task = task_create(as, name); |
132 | task = task_create(as, name); |
128 | t = thread_create(uinit, (void *)((elf_header_t *)program_addr)->e_entry, |
133 | t = thread_create(uinit, uarg, task, 0, "uinit"); |
129 | task, 0, "uinit"); |
- | |
130 | 134 | ||
131 | /* |
135 | /* |
132 | * Create the data as_area. |
136 | * Create the data as_area. |
133 | */ |
137 | */ |
134 | a = as_area_create(as, AS_AREA_READ | AS_AREA_WRITE, PAGE_SIZE, USTACK_ADDRESS); |
138 | a = as_area_create(as, AS_AREA_READ | AS_AREA_WRITE, PAGE_SIZE, USTACK_ADDRESS); |