Changeset 44c259c in mainline
- Timestamp:
- 2006-01-15T18:35:45Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77147d6
- Parents:
- ae10582
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rae10582 r44c259c 69 69 ifeq ($(CONFIG_DEBUG_SPINLOCK),y) 70 70 DEFS += -DCONFIG_DEBUG_SPINLOCK 71 endif72 ifeq ($(CONFIG_USERSPACE),y)73 DEFS += -DCONFIG_USERSPACE74 71 endif 75 72 ifeq ($(CONFIG_FPU_LAZY),y) -
arch/amd64/src/asm_utils.S
rae10582 r44c259c 53 53 .global read_efer_flag 54 54 .global set_efer_flag 55 56 57 # THIS IS USERSPACE CODE58 .global utext59 utext:60 0:61 int $4862 jmp 0b63 # not reached64 utext_end:65 66 .data67 .global utext_size68 utext_size:69 .long utext_end - utext70 71 55 72 56 ## Determine CPUID support … … 208 192 h_end: 209 193 210 211 194 .data 212 195 .global interrupt_handler_size -
arch/ia32/src/asm.S
rae10582 r44c259c 149 149 h_end: 150 150 151 152 # THIS IS USERSPACE CODE153 .global utext154 utext:155 xor %ax,%ax156 mov %ax,%ds157 mov %ax,%es158 mov %ax,%fs159 mov %ax,%gs160 0:161 int $48162 jmp 0b163 # not reached164 utext_end:165 166 151 .data 167 .global utext_size168 utext_size:169 .long utext_end - utext170 171 152 .global interrupt_handler_size 172 153 -
arch/mips32/src/asm.S
rae10582 r44c259c 296 296 j $ra 297 297 nop 298 299 # THIS IS USERSPACE CODE300 .global utext301 utext:302 j $31303 nop304 utext_end:305 306 .data307 .global utext_size308 utext_size:309 .long utext_end-utext310 311 -
generic/include/main/uinit.h
rae10582 r44c259c 32 32 #include <arch/types.h> 33 33 34 extern void utext(void);35 extern __u32 utext_size;36 37 34 extern void uinit(void *arg); 38 35 -
generic/src/main/kinit.c
rae10582 r44c259c 70 70 { 71 71 thread_t *t; 72 #ifdef CONFIG_USERSPACE73 72 as_t *as; 74 73 as_area_t *a; … … 76 75 index_t pfn[1]; 77 76 task_t *u; 78 #endif79 77 80 78 interrupts_disable(); … … 140 138 interrupts_enable(); 141 139 142 #ifdef CONFIG_USERSPACE 143 /* 144 * Create the first user task. 145 */ 146 as = as_create(NULL); 147 if (!as) 148 panic("as_create\n"); 149 u = task_create(as); 150 if (!u) 151 panic("task_create\n"); 152 t = thread_create(uinit, NULL, u, THREAD_USER_STACK); 153 if (!t) 154 panic("thread_create\n"); 155 156 /* 157 * Create the text as_area and copy the userspace code there. 158 */ 159 a = as_area_create(as, AS_AREA_TEXT, 1, UTEXT_ADDRESS); 160 if (!a) 161 panic("as_area_create: text\n"); 162 163 frame = frame_alloc(0, ONE_FRAME, NULL); 164 165 if (config.init_size > 0) 140 if (config.init_size > 0) { 141 /* 142 * Create the first user task. 143 */ 144 as = as_create(NULL); 145 if (!as) 146 panic("as_create\n"); 147 u = task_create(as); 148 if (!u) 149 panic("task_create\n"); 150 t = thread_create(uinit, NULL, u, THREAD_USER_STACK); 151 if (!t) 152 panic("thread_create\n"); 153 154 /* 155 * Create the text as_area and copy the userspace code there. 156 */ 157 a = as_area_create(as, AS_AREA_TEXT, 1, UTEXT_ADDRESS); 158 if (!a) 159 panic("as_area_create: text\n"); 160 161 // FIXME: Better way to initialize static code/data 162 frame = frame_alloc(0, ONE_FRAME, NULL); 166 163 memcpy((void *) PA2KA(frame), (void *) config.init_addr, config.init_size < PAGE_SIZE ? config.init_size : PAGE_SIZE); 167 else 168 memcpy((void *) PA2KA(frame), (void *) utext, utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE); 164 165 pfn[0] = frame / FRAME_SIZE; 166 as_area_load_mapping(a, pfn); 169 167 170 pfn[0] = frame / FRAME_SIZE; 171 as_area_load_mapping(a, pfn); 172 173 /* 174 * Create the data as_area. 175 */ 176 a = as_area_create(as, AS_AREA_STACK, 1, USTACK_ADDRESS); 177 if (!a) 178 panic("as_area_create: stack\n"); 168 /* 169 * Create the data as_area. 170 */ 171 a = as_area_create(as, AS_AREA_STACK, 1, USTACK_ADDRESS); 172 if (!a) 173 panic("as_area_create: stack\n"); 179 174 180 thread_ready(t);181 #endif /* CONFIG_USERSPACE */ 175 thread_ready(t); 176 } 182 177 183 178 #ifdef CONFIG_TEST -
kernel.config
rae10582 r44c259c 64 64 ## Run-time configuration directives 65 65 66 # Enable user space support67 ! CONFIG_USERSPACE (n/y)68 69 66 # Kernel test type 70 67 @ "" No test
Note:
See TracChangeset
for help on using the changeset viewer.