Changeset a7818c26 in mainline
- Timestamp:
- 2006-04-09T12:24:36Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fcd10af
- Parents:
- 0319a8f6
- Location:
- libc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/arch/ia64/include/psthread.h
r0319a8f6 ra7818c26 42 42 #define PFM_MASK (~0x3fffffffff) 43 43 44 #define PSTHREAD_INITIAL_STACK_PAGES_NO 2 45 #define PSTHREAD_INITIAL_STACK_DIVISION 2 /*Stack is divided into two equal parts (for clasic stack and register stack)*/ 46 47 44 48 #ifdef context_set 45 49 #undef context_set … … 49 53 do { \ 50 54 (c)->pc = (uint64_t) _pc; \ 51 (c)->bsp = ( uint64_t) stack; \55 (c)->bsp = ((uint64_t) stack) + size / PSTHREAD_INITIAL_STACK_DIVISION; \ 52 56 (c)->ar_pfs &= PFM_MASK; \ 53 (c)->sp = ((uint64_t) stack) + ALIGN_UP((size ), STACK_ALIGNMENT) - SP_DELTA; \57 (c)->sp = ((uint64_t) stack) + ALIGN_UP((size / PSTHREAD_INITIAL_STACK_DIVISION), STACK_ALIGNMENT) - SP_DELTA; \ 54 58 (c)->tp = (uint64_t) tls; \ 55 59 } while (0); -
libc/generic/psthread.c
r0319a8f6 ra7818c26 34 34 #include <stdio.h> 35 35 #include <kernel/arch/faddr.h> 36 37 38 #ifndef PSTHREAD_INITIAL_STACK_PAGES_NO 39 #define PSTHREAD_INITIAL_STACK_PAGES_NO 1 40 #endif 36 41 37 42 static LIST_INITIALIZE(ready_list); … … 166 171 return 0; 167 172 } 168 pt->stack = (char *) malloc( getpagesize());173 pt->stack = (char *) malloc(PSTHREAD_INITIAL_STACK_PAGES_NO*getpagesize()); 169 174 170 175 if (!pt->stack) { … … 180 185 181 186 context_save(&pt->ctx); 182 context_set(&pt->ctx, FADDR(psthread_main), pt->stack, getpagesize(),187 context_set(&pt->ctx, FADDR(psthread_main), pt->stack, PSTHREAD_INITIAL_STACK_PAGES_NO*getpagesize(), 183 188 tcb); 184 189
Note:
See TracChangeset
for help on using the changeset viewer.