Changeset 20d50a1 in mainline for generic/src/main
- Timestamp:
- 2006-01-13T13:02:45Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f9425006
- Parents:
- 0369911
- Location:
- generic/src/main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/main/kinit.c
r0369911 r20d50a1 40 40 #include <mm/page.h> 41 41 #include <arch/mm/page.h> 42 #include <mm/ vm.h>42 #include <mm/as.h> 43 43 #include <mm/frame.h> 44 44 #include <print.h> … … 71 71 thread_t *t; 72 72 #ifdef CONFIG_USERSPACE 73 vm_t *m; 74 vm_area_t *a; 73 as_t *as; 74 as_area_t *a; 75 __address frame; 76 index_t pfn[1]; 75 77 task_t *u; 76 78 #endif … … 142 144 * Create the first user task. 143 145 */ 144 m = vm_create(NULL);145 if (! m)146 panic(" vm_create\n");147 u = task_create( m);146 as = as_create(NULL); 147 if (!as) 148 panic("as_create\n"); 149 u = task_create(as); 148 150 if (!u) 149 151 panic("task_create\n"); … … 153 155 154 156 /* 155 * Create the text vm_area and copy the userspace code there.157 * Create the text as_area and copy the userspace code there. 156 158 */ 157 a = vm_area_create(m, VMA_TEXT, 1, UTEXT_ADDRESS);159 a = as_area_create(as, AS_AREA_TEXT, 1, UTEXT_ADDRESS); 158 160 if (!a) 159 panic("vm_area_create: vm_text\n"); 160 vm_area_map(a, m); 161 panic("as_area_create: text\n"); 162 163 frame = frame_alloc(0, ONE_FRAME, NULL); 164 161 165 if (config.init_size > 0) 162 memcpy((void *) PA2KA( a->mapping[0]), (void *) config.init_addr, config.init_size < PAGE_SIZE ? config.init_size : PAGE_SIZE);166 memcpy((void *) PA2KA(frame), (void *) config.init_addr, config.init_size < PAGE_SIZE ? config.init_size : PAGE_SIZE); 163 167 else 164 memcpy((void *) PA2KA(a->mapping[0]), (void *) utext, utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE); 168 memcpy((void *) PA2KA(frame), (void *) utext, utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE); 169 170 pfn[0] = frame / FRAME_SIZE; 171 as_area_load_mapping(a, pfn); 165 172 166 173 /* 167 * Create the data vm_area.174 * Create the data as_area. 168 175 */ 169 a = vm_area_create(m, VMA_STACK, 1, USTACK_ADDRESS);176 a = as_area_create(as, AS_AREA_STACK, 1, USTACK_ADDRESS); 170 177 if (!a) 171 panic("vm_area_create: vm_stack\n"); 172 vm_area_map(a, m); 178 panic("as_area_create: stack\n"); 173 179 174 180 thread_ready(t); -
generic/src/main/main.c
r0369911 r20d50a1 49 49 #include <genarch/mm/page_pt.h> 50 50 #include <mm/tlb.h> 51 #include <mm/ vm.h>51 #include <mm/as.h> 52 52 #include <synch/waitq.h> 53 53 #include <arch/arch.h> … … 136 136 void main_bsp_separated_stack(void) 137 137 { 138 vm_t *m;138 as_t *as; 139 139 task_t *k; 140 140 thread_t *t; … … 184 184 185 185 /* 186 * Create kernel vm mapping.187 */ 188 m = vm_create(GET_PTL0_ADDRESS());189 if (! m)190 panic("can't create kernel vmaddress space\n");186 * Create kernel address space. 187 */ 188 as = as_create(GET_PTL0_ADDRESS()); 189 if (!as) 190 panic("can't create kernel address space\n"); 191 191 192 192 /* 193 193 * Create kernel task. 194 194 */ 195 k = task_create( m);195 k = task_create(as); 196 196 if (!k) 197 197 panic("can't create kernel task\n");
Note:
See TracChangeset
for help on using the changeset viewer.
