Changeset 26aafe8 in mainline
- Timestamp:
- 2011-05-19T16:47:49Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a6d8726
- Parents:
- bcaca55
- Location:
- kernel
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/include/mm/as.h
rbcaca55 r26aafe8 43 43 #define USER_ADDRESS_SPACE_END_ARCH UINT32_C(0x7fffffff) 44 44 45 #define USTACK_ADDRESS_ARCH (USER_ADDRESS_SPACE_END_ARCH - (PAGE_SIZE - 1))46 47 45 typedef struct { 48 46 } as_arch_t; -
kernel/arch/amd64/include/mm/as.h
rbcaca55 r26aafe8 43 43 #define KERNEL_ADDRESS_SPACE_START_ARCH UINT64_C(0xffff800000000000) 44 44 #define KERNEL_ADDRESS_SPACE_END_ARCH UINT64_C(0xffffffffffffffff) 45 46 #define USER_ADDRESS_SPACE_START_ARCH UINT64_C(0x0000000000000000) 47 #define USER_ADDRESS_SPACE_END_ARCH UINT64_C(0x00007fffffffffff) 48 49 #define USTACK_ADDRESS_ARCH (USER_ADDRESS_SPACE_END_ARCH - (PAGE_SIZE - 1)) 45 #define USER_ADDRESS_SPACE_START_ARCH UINT64_C(0x0000000000000000) 46 #define USER_ADDRESS_SPACE_END_ARCH UINT64_C(0x00007fffffffffff) 50 47 51 48 #define as_constructor_arch(as, flags) (as != as) -
kernel/arch/amd64/src/proc/scheduler.c
rbcaca55 r26aafe8 56 56 { 57 57 CPU->arch.tss->rsp0 = 58 (uintptr_t) &THREAD->kstack[ THREAD_STACK_SIZE];58 (uintptr_t) &THREAD->kstack[STACK_SIZE]; 59 59 60 60 /* -
kernel/arch/amd64/src/userspace.c
rbcaca55 r26aafe8 66 66 "iretq\n" 67 67 :: [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER), 68 [stack_size] "r" (kernel_uarg->uspace_stack + THREAD_STACK_SIZE),68 [stack_size] "r" (kernel_uarg->uspace_stack + STACK_SIZE), 69 69 [ipl] "r" (ipl), 70 70 [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER), -
kernel/arch/arm32/include/mm/as.h
rbcaca55 r26aafe8 37 37 #define KERN_arm32_AS_H_ 38 38 39 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 39 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 0 40 40 41 #define KERNEL_ADDRESS_SPACE_START_ARCH (unsigned long) 0x80000000 42 #define KERNEL_ADDRESS_SPACE_END_ARCH (unsigned long) 0xffffffff 43 #define USER_ADDRESS_SPACE_START_ARCH (unsigned long) 0x00000000 44 #define USER_ADDRESS_SPACE_END_ARCH (unsigned long) 0x7fffffff 45 46 #define USTACK_ADDRESS_ARCH (0x80000000 - PAGE_SIZE) 41 #define KERNEL_ADDRESS_SPACE_START_ARCH UINT32_C(0x80000000) 42 #define KERNEL_ADDRESS_SPACE_END_ARCH UINT32_C(0xffffffff) 43 #define USER_ADDRESS_SPACE_START_ARCH UINT32_C(0x00000000) 44 #define USER_ADDRESS_SPACE_END_ARCH UINT32_C(0x7fffffff) 47 45 48 46 typedef struct { -
kernel/arch/arm32/src/arm32.c
rbcaca55 r26aafe8 134 134 uint8_t *stck; 135 135 136 stck = &THREAD->kstack[ THREAD_STACK_SIZE - SP_DELTA];136 stck = &THREAD->kstack[STACK_SIZE - SP_DELTA]; 137 137 supervisor_sp = (uintptr_t) stck; 138 138 } -
kernel/arch/arm32/src/userspace.c
rbcaca55 r26aafe8 38 38 39 39 /** Struct for holding all general purpose registers. 40 * 40 * 41 41 * Used to set registers when going to userspace. 42 42 */ … … 60 60 } ustate_t; 61 61 62 /** Changes processor mode and jumps to the address specified in the first 63 * parameter. 62 /** Change processor mode 64 63 * 65 * @param kernel_uarg Userspace settings (entry point, stack, ...). 64 * @param kernel_uarg Userspace settings (entry point, stack, ...). 65 * 66 66 */ 67 67 void userspace(uspace_arg_t *kernel_uarg) … … 79 79 80 80 /* clear other registers */ 81 ustate.r3 = ustate.r4 = ustate.r5 = ustate.r6 = ustate.r7 = 82 ustate.r8 = ustate.r9 = ustate.r10 = ustate.r11 = ustate.r12 = 83 ustate.lr = 0; 81 ustate.r3 = 0; 82 ustate.r4 = 0; 83 ustate.r5 = 0; 84 ustate.r6 = 0; 85 ustate.r7 = 0; 86 ustate.r8 = 0; 87 ustate.r9 = 0; 88 ustate.r10 = 0; 89 ustate.r11 = 0; 90 ustate.r12 = 0; 91 ustate.lr = 0; 84 92 85 93 /* set user stack */ 86 ustate.sp = ((uint32_t)kernel_uarg->uspace_stack) + PAGE_SIZE;94 ustate.sp = ((uint32_t)kernel_uarg->uspace_stack) + STACK_SIZE; 87 95 88 96 /* set where uspace execution starts */ -
kernel/arch/ia32/include/mm/as.h
rbcaca55 r26aafe8 43 43 #define USER_ADDRESS_SPACE_END_ARCH UINT32_C(0x7fffffff) 44 44 45 #define USTACK_ADDRESS_ARCH (USER_ADDRESS_SPACE_END_ARCH - (PAGE_SIZE - 1))46 47 45 typedef struct { 48 46 } as_arch_t; -
kernel/arch/ia32/src/proc/scheduler.c
rbcaca55 r26aafe8 58 58 void before_thread_runs_arch(void) 59 59 { 60 uintptr_t kstk = (uintptr_t) &THREAD->kstack[ THREAD_STACK_SIZE];60 uintptr_t kstk = (uintptr_t) &THREAD->kstack[STACK_SIZE]; 61 61 62 62 if (CPU->arch.fi.bits.sep) { -
kernel/arch/ia32/src/userspace.c
rbcaca55 r26aafe8 76 76 : 77 77 : [udata_des] "i" (GDT_SELECTOR(UDATA_DES) | PL_USER), 78 [stack_size] "r" ((uint8_t *) kernel_uarg->uspace_stack + THREAD_STACK_SIZE),78 [stack_size] "r" ((uint8_t *) kernel_uarg->uspace_stack + STACK_SIZE), 79 79 [ipl] "r" (ipl), 80 80 [utext_des] "i" (GDT_SELECTOR(UTEXT_DES) | PL_USER), -
kernel/arch/ia64/include/arch.h
rbcaca55 r26aafe8 36 36 #define KERN_ia64_ARCH_H_ 37 37 38 #define LOADED_PROG_STACK_PAGES_NO 239 40 38 #include <arch/drivers/ski.h> 41 39 -
kernel/arch/ia64/include/asm.h
rbcaca55 r26aafe8 131 131 NO_TRACE static inline uintptr_t get_stack_base(void) 132 132 { 133 uint64_t v ;133 uint64_t value; 134 134 135 135 /* … … 152 152 asm volatile ( 153 153 "mov %[value] = r12" 154 : [value] "=r" (v )155 ); 156 157 return (v & (~(STACK_SIZE - 1)));154 : [value] "=r" (value) 155 ); 156 157 return (value & (~(STACK_SIZE - 1))); 158 158 } 159 159 -
kernel/arch/ia64/include/mm/as.h
rbcaca55 r26aafe8 38 38 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 0 39 39 40 #define KERNEL_ADDRESS_SPACE_START_ARCH ((unsigned long) 0xe000000000000000ULL)41 #define KERNEL_ADDRESS_SPACE_END_ARCH ((unsigned long) 0xffffffffffffffffULL)42 #define USER_ADDRESS_SPACE_START_ARCH ((unsigned long) 0x0000000000000000ULL)43 #define USER_ADDRESS_SPACE_END_ARCH ((unsigned long) 0xdfffffffffffffffULL)40 #define KERNEL_ADDRESS_SPACE_START_ARCH UINT64_C(0xe000000000000000) 41 #define KERNEL_ADDRESS_SPACE_END_ARCH UINT64_C(0xffffffffffffffff) 42 #define USER_ADDRESS_SPACE_START_ARCH UINT64_C(0x0000000000000000) 43 #define USER_ADDRESS_SPACE_END_ARCH UINT64_C(0xdfffffffffffffff) 44 44 45 #define USTACK_ADDRESS_ARCH 0x0000000ff0000000ULL45 #define USTACK_ADDRESS_ARCH UINT64_C(0x0000000ff0000000) 46 46 47 47 typedef struct { -
kernel/arch/ia64/include/mm/frame.h
rbcaca55 r26aafe8 49 49 #define physmem_print() 50 50 51 #define ARCH_STACK_FRAMES TWO_FRAMES52 53 51 #endif /* __ASM__ */ 54 52 #endif /* KERNEL */ -
kernel/arch/ia64/src/ia64.c
rbcaca55 r26aafe8 250 250 251 251 switch_to_userspace((uintptr_t) kernel_uarg->uspace_entry, 252 ((uintptr_t) kernel_uarg->uspace_stack) + PAGE_SIZE -252 ((uintptr_t) kernel_uarg->uspace_stack) + STACK_SIZE - 253 253 ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT), 254 ((uintptr_t) kernel_uarg->uspace_stack) + PAGE_SIZE,254 ((uintptr_t) kernel_uarg->uspace_stack) + STACK_SIZE, 255 255 (uintptr_t) kernel_uarg->uspace_uarg, psr.value, rsc.value); 256 256 -
kernel/arch/ia64/src/proc/scheduler.c
rbcaca55 r26aafe8 86 86 "bsw.1\n" 87 87 : 88 : "r" (&THREAD->kstack[ THREAD_STACK_SIZE]),89 "r" (&THREAD->kstack[ THREAD_STACK_SIZE - SP_DELTA])88 : "r" (&THREAD->kstack[STACK_SIZE]), 89 "r" (&THREAD->kstack[STACK_SIZE - SP_DELTA]) 90 90 ); 91 91 } -
kernel/arch/mips32/include/mm/as.h
rbcaca55 r26aafe8 38 38 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 0 39 39 40 #define KERNEL_ADDRESS_SPACE_START_ARCH (unsigned long) 0x80000000 41 #define KERNEL_ADDRESS_SPACE_END_ARCH (unsigned long) 0x9fffffff 42 #define USER_ADDRESS_SPACE_START_ARCH (unsigned long) 0x00000000 43 #define USER_ADDRESS_SPACE_END_ARCH (unsigned long) 0x7fffffff 44 45 #define USTACK_ADDRESS_ARCH (0x80000000 - PAGE_SIZE) 40 #define KERNEL_ADDRESS_SPACE_START_ARCH UINT32_C(0x80000000) 41 #define KERNEL_ADDRESS_SPACE_END_ARCH UINT32_C(0x9fffffff) 42 #define USER_ADDRESS_SPACE_START_ARCH UINT32_C(0x00000000) 43 #define USER_ADDRESS_SPACE_END_ARCH UINT32_C(0x7fffffff) 46 44 47 45 typedef struct { -
kernel/arch/mips32/src/mips32.c
rbcaca55 r26aafe8 220 220 cp0_status_um_bit | cp0_status_ie_enabled_bit)); 221 221 cp0_epc_write((uintptr_t) kernel_uarg->uspace_entry); 222 userspace_asm(((uintptr_t) kernel_uarg->uspace_stack + PAGE_SIZE),222 userspace_asm(((uintptr_t) kernel_uarg->uspace_stack + STACK_SIZE), 223 223 (uintptr_t) kernel_uarg->uspace_uarg, 224 224 (uintptr_t) kernel_uarg->uspace_entry); … … 235 235 void before_thread_runs_arch(void) 236 236 { 237 supervisor_sp = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE -238 SP_DELTA];237 supervisor_sp = 238 (uintptr_t) &THREAD->kstack[STACK_SIZE - SP_DELTA]; 239 239 } 240 240 -
kernel/arch/ppc32/include/boot/boot.h
rbcaca55 r26aafe8 37 37 38 38 #define BOOT_OFFSET 0x8000 39 40 /* Temporary stack size for boot process */41 #define TEMP_STACK_SIZE 0x100042 39 43 40 #define TASKMAP_MAX_RECORDS 32 -
kernel/arch/ppc32/include/istate.h
rbcaca55 r26aafe8 73 73 uint32_t cr; 74 74 uint32_t pc; 75 uint32_t srr1;75 uint32_t msr; 76 76 uint32_t lr; 77 77 uint32_t ctr; … … 90 90 /** Return true if exception happened while in userspace 91 91 * 92 * The contexts of MSR register was stored in SRR1.93 *94 92 */ 95 93 NO_TRACE static inline int istate_from_uspace(istate_t *istate) 96 94 { 97 return (istate-> srr1& MSR_PR) != 0;95 return (istate->msr & MSR_PR) != 0; 98 96 } 99 97 -
kernel/arch/ppc32/include/mm/as.h
rbcaca55 r26aafe8 38 38 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 0 39 39 40 #define KERNEL_ADDRESS_SPACE_START_ARCH ((unsigned long) 0x80000000) 41 #define KERNEL_ADDRESS_SPACE_END_ARCH ((unsigned long) 0xffffffff) 42 #define USER_ADDRESS_SPACE_START_ARCH ((unsigned long) 0x00000000) 43 #define USER_ADDRESS_SPACE_END_ARCH ((unsigned long) 0x7fffffff) 44 45 #define USTACK_ADDRESS_ARCH (0x7fffffff - (PAGE_SIZE - 1)) 40 #define KERNEL_ADDRESS_SPACE_START_ARCH UINT32_C(0x80000000) 41 #define KERNEL_ADDRESS_SPACE_END_ARCH UINT32_C(0xffffffff) 42 #define USER_ADDRESS_SPACE_START_ARCH UINT32_C(0x00000000) 43 #define USER_ADDRESS_SPACE_END_ARCH UINT32_C(0x7fffffff) 46 44 47 45 typedef struct { -
kernel/arch/ppc32/src/boot/boot.S
rbcaca55 r26aafe8 28 28 29 29 #include <arch/asm/regname.h> 30 #include < arch/boot/boot.h>30 #include <config.h> 31 31 32 32 .section K_TEXT_START, "ax" … … 56 56 .align 12 57 57 kernel_stack_bottom: 58 .space TEMP_STACK_SIZE58 .space STACK_SIZE 59 59 kernel_stack: -
kernel/arch/ppc32/src/mm/tlb.c
rbcaca55 r26aafe8 223 223 switch (pfrc) { 224 224 case AS_PF_FAULT: 225 goto fail; 226 break; 225 page_table_unlock(as, true); 226 pht_refill_fail(badvaddr, istate); 227 return; 227 228 case AS_PF_DEFER: 228 229 /* … … 242 243 243 244 page_table_unlock(as, true); 244 return;245 246 fail:247 page_table_unlock(as, true);248 pht_refill_fail(badvaddr, istate);249 245 } 250 246 -
kernel/arch/ppc32/src/ppc32.c
rbcaca55 r26aafe8 265 265 { 266 266 userspace_asm((uintptr_t) kernel_uarg->uspace_uarg, 267 (uintptr_t) kernel_uarg->uspace_stack + 268 THREAD_STACK_SIZE - SP_DELTA, 267 (uintptr_t) kernel_uarg->uspace_stack + STACK_SIZE - SP_DELTA, 269 268 (uintptr_t) kernel_uarg->uspace_entry); 270 269 -
kernel/arch/ppc32/src/proc/scheduler.c
rbcaca55 r26aafe8 55 55 asm volatile ( 56 56 "mtsprg0 %[ksp]\n" 57 :: [ksp] "r" (KA2PA(&THREAD->kstack[ THREAD_STACK_SIZE - SP_DELTA]))57 :: [ksp] "r" (KA2PA(&THREAD->kstack[STACK_SIZE - SP_DELTA])) 58 58 ); 59 59 } -
kernel/arch/sparc64/include/mm/sun4u/as.h
rbcaca55 r26aafe8 27 27 */ 28 28 29 /** @addtogroup sparc64mm 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ … … 38 38 #include <arch/mm/tte.h> 39 39 40 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 40 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 1 41 41 42 #define KERNEL_ADDRESS_SPACE_START_ARCH (unsigned long) 0x0000000000000000 43 #define KERNEL_ADDRESS_SPACE_END_ARCH (unsigned long) 0xffffffffffffffff 44 #define USER_ADDRESS_SPACE_START_ARCH (unsigned long) 0x0000000000000000 45 #define USER_ADDRESS_SPACE_END_ARCH (unsigned long) 0xffffffffffffffff 46 47 #define USTACK_ADDRESS_ARCH (0xffffffffffffffffULL - (PAGE_SIZE - 1)) 42 #define KERNEL_ADDRESS_SPACE_START_ARCH UINT64_C(0x0000000000000000) 43 #define KERNEL_ADDRESS_SPACE_END_ARCH UINT64_C(0xffffffffffffffff) 44 #define USER_ADDRESS_SPACE_START_ARCH UINT64_C(0x0000000000000000) 45 #define USER_ADDRESS_SPACE_END_ARCH UINT64_C(0xffffffffffffffff) 48 46 49 47 #ifdef CONFIG_TSB -
kernel/arch/sparc64/include/mm/sun4v/as.h
rbcaca55 r26aafe8 40 40 #include <arch/mm/tsb.h> 41 41 42 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 42 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 1 43 43 44 #define KERNEL_ADDRESS_SPACE_START_ARCH (unsigned long) 0x0000000000000000 45 #define KERNEL_ADDRESS_SPACE_END_ARCH (unsigned long) 0xffffffffffffffff 46 #define USER_ADDRESS_SPACE_START_ARCH (unsigned long) 0x0000000000000000 47 #define USER_ADDRESS_SPACE_END_ARCH (unsigned long) 0xffffffffffffffff 48 49 #define USTACK_ADDRESS_ARCH (0xffffffffffffffffULL - (PAGE_SIZE - 1)) 44 #define KERNEL_ADDRESS_SPACE_START_ARCH UINT64_C(0x0000000000000000) 45 #define KERNEL_ADDRESS_SPACE_END_ARCH UINT64_C(0xffffffffffffffff) 46 #define USER_ADDRESS_SPACE_START_ARCH UINT64_C(0x0000000000000000) 47 #define USER_ADDRESS_SPACE_END_ARCH UINT64_C(0xffffffffffffffff) 50 48 51 49 #ifdef CONFIG_TSB -
kernel/generic/include/config.h
rbcaca55 r26aafe8 36 36 #define KERN_CONFIG_H_ 37 37 38 #include <typedefs.h>39 38 #include <arch/mm/page.h> 40 39 41 #define STACK_SIZE PAGE_SIZE 40 #define ONE_FRAME 0 41 #define TWO_FRAMES 1 42 #define FOUR_FRAMES 2 43 44 #define STACK_FRAMES TWO_FRAMES 45 #define STACK_SIZE ((1 << STACK_FRAMES) << PAGE_WIDTH) 42 46 43 47 #define CONFIG_INIT_TASKS 32 44 48 #define CONFIG_TASK_NAME_BUFLEN 32 49 50 #ifndef __ASM__ 51 52 #include <typedefs.h> 45 53 46 54 typedef struct { … … 80 88 extern ballocs_t ballocs; 81 89 90 #endif /* __ASM__ */ 91 82 92 #endif 83 93 -
kernel/generic/include/cpu.h
rbcaca55 r26aafe8 41 41 #include <arch/cpu.h> 42 42 #include <arch/context.h> 43 44 #define CPU_STACK_SIZE STACK_SIZE45 43 46 44 /** CPU structure. -
kernel/generic/include/mm/as.h
rbcaca55 r26aafe8 84 84 #define USER_ADDRESS_SPACE_END USER_ADDRESS_SPACE_END_ARCH 85 85 86 #define USTACK_ADDRESS USTACK_ADDRESS_ARCH 86 #ifdef USTACK_ADDRESS_ARCH 87 #define USTACK_ADDRESS USTACK_ADDRESS_ARCH 88 #else 89 #define USTACK_ADDRESS (USER_ADDRESS_SPACE_END - (STACK_SIZE - 1)) 90 #endif 87 91 88 92 /** Kernel address space. */ -
kernel/generic/include/mm/frame.h
rbcaca55 r26aafe8 44 44 #include <arch/mm/page.h> 45 45 #include <arch/mm/frame.h> 46 47 #define ONE_FRAME 048 #define TWO_FRAMES 149 #define FOUR_FRAMES 250 51 52 #ifdef ARCH_STACK_FRAMES53 #define STACK_FRAMES ARCH_STACK_FRAMES54 #else55 #define STACK_FRAMES ONE_FRAME56 #endif57 46 58 47 /** Maximum number of zones in the system. */ -
kernel/generic/include/proc/task.h
rbcaca55 r26aafe8 78 78 /** Unique identity of task. */ 79 79 task_id_t taskid; 80 /** Task security cont ext. */81 cont ext_id_t context;80 /** Task security container. */ 81 container_id_t container; 82 82 83 83 /** Number of references (i.e. threads). */ -
kernel/generic/include/proc/thread.h
rbcaca55 r26aafe8 49 49 #include <sysinfo/abi.h> 50 50 51 #define THREAD_STACK_SIZE STACK_SIZE52 51 #define THREAD_NAME_BUFLEN 20 53 52 -
kernel/generic/include/proc/uarg.h
rbcaca55 r26aafe8 40 40 void *uspace_entry; 41 41 void *uspace_stack; 42 42 43 43 void (* uspace_thread_function)(); 44 44 void *uspace_thread_arg; -
kernel/generic/include/typedefs.h
rbcaca55 r26aafe8 64 64 typedef uint64_t thread_id_t; 65 65 typedef uint64_t task_id_t; 66 typedef uint32_t cont ext_id_t;66 typedef uint32_t container_id_t; 67 67 68 68 typedef int32_t inr_t; -
kernel/generic/src/interrupt/interrupt.c
rbcaca55 r26aafe8 205 205 * stack. 206 206 */ 207 return (istate_t *) ((uint8_t *) thread->kstack + THREAD_STACK_SIZE -208 sizeof(istate_t));207 return (istate_t *) ((uint8_t *) 208 thread->kstack + STACK_SIZE - sizeof(istate_t)); 209 209 } 210 210 -
kernel/generic/src/main/main.c
rbcaca55 r26aafe8 118 118 #endif 119 119 120 #define CONFIG_STACK_SIZE ((1 << STACK_FRAMES) * STACK_SIZE)121 122 120 /** Main kernel routine for bootstrap CPU. 123 121 * … … 139 137 config.kernel_size = ALIGN_UP(hardcoded_ktext_size + 140 138 hardcoded_kdata_size, PAGE_SIZE); 141 config.stack_size = CONFIG_STACK_SIZE;139 config.stack_size = STACK_SIZE; 142 140 143 141 /* Initialy the stack is placed just after the kernel */ … … 165 163 166 164 context_save(&ctx); 167 context_set(&ctx, FADDR(main_bsp_separated_stack), config.stack_base,168 THREAD_STACK_SIZE);165 context_set(&ctx, FADDR(main_bsp_separated_stack), 166 config.stack_base, STACK_SIZE); 169 167 context_restore(&ctx); 170 168 /* not reached */ … … 323 321 context_save(&CPU->saved_context); 324 322 context_set(&CPU->saved_context, FADDR(main_ap_separated_stack), 325 (uintptr_t) CPU->stack, CPU_STACK_SIZE);323 (uintptr_t) CPU->stack, STACK_SIZE); 326 324 context_restore(&CPU->saved_context); 327 325 /* not reached */ -
kernel/generic/src/proc/program.c
rbcaca55 r26aafe8 54 54 #include <proc/program.h> 55 55 56 #ifndef LOADED_PROG_STACK_PAGES_NO57 #define LOADED_PROG_STACK_PAGES_NO 158 #endif59 60 56 /** 61 57 * Points to the binary image used as the program loader. All non-initial … … 90 86 91 87 /* 92 * Create the dataaddress space area.88 * Create the stack address space area. 93 89 */ 94 90 as_area_t *area = as_area_create(as, 95 91 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, 96 LOADED_PROG_STACK_PAGES_NO * PAGE_SIZE, USTACK_ADDRESS,97 AS_AREA_ATTR_NONE,&anon_backend, NULL);92 STACK_SIZE, USTACK_ADDRESS, AS_AREA_ATTR_NONE, 93 &anon_backend, NULL); 98 94 if (!area) 99 95 return ENOMEM; -
kernel/generic/src/proc/scheduler.c
rbcaca55 r26aafe8 376 376 context_save(&CPU->saved_context); 377 377 context_set(&CPU->saved_context, FADDR(scheduler_separated_stack), 378 (uintptr_t) CPU->stack, CPU_STACK_SIZE);378 (uintptr_t) CPU->stack, STACK_SIZE); 379 379 context_restore(&CPU->saved_context); 380 380 -
kernel/generic/src/proc/thread.c
rbcaca55 r26aafe8 68 68 #include <errno.h> 69 69 70 71 #ifndef LOADED_PROG_STACK_PAGES_NO72 #define LOADED_PROG_STACK_PAGES_NO 173 #endif74 75 76 70 /** Thread states */ 77 71 const char *thread_states[] = { … … 300 294 301 295 /* Not needed, but good for debugging */ 302 memsetb(thread->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0);296 memsetb(thread->kstack, STACK_SIZE, 0); 303 297 304 298 irq_spinlock_lock(&tidlock, true); … … 308 302 context_save(&thread->saved_context); 309 303 context_set(&thread->saved_context, FADDR(cushion), 310 (uintptr_t) thread->kstack, THREAD_STACK_SIZE);304 (uintptr_t) thread->kstack, STACK_SIZE); 311 305 312 306 the_initialize((the_t *) thread->kstack); … … 605 599 printf("%-8" PRIu64 " %-14s %10p %-8s %10p %-5" PRIu32 "\n", 606 600 thread->tid, name, thread, thread_states[thread->state], 607 thread->task, thread->task->cont ext);601 thread->task, thread->task->container); 608 602 #endif 609 603 … … 617 611 printf("%-8" PRIu64 " %-14s %18p %-8s %18p %-5" PRIu32 "\n", 618 612 thread->tid, name, thread, thread_states[thread->state], 619 thread->task, thread->task->cont ext);613 thread->task, thread->task->container); 620 614 #endif 621 615 … … 658 652 else 659 653 printf("[id ] [name ] [address ] [state ] [task ]" 660 " [ct x]\n");654 " [ctn]\n"); 661 655 #endif 662 656 … … 667 661 } else 668 662 printf("[id ] [name ] [address ] [state ]" 669 " [task ] [ct x]\n");663 " [task ] [ctn]\n"); 670 664 #endif 671 665
Note:
See TracChangeset
for help on using the changeset viewer.