Changeset 26aafe8 in mainline for kernel/generic
- 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/generic
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
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.