Rev 1125 | Rev 1175 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1125 | Rev 1155 | ||
|---|---|---|---|
| Line 39... | Line 39... | ||
| 39 | */ |
39 | */ |
| 40 | #define SP_DELTA (0+ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) |
40 | #define SP_DELTA (0+ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) |
| 41 | 41 | ||
| 42 | #define PFM_MASK (~0x3fffffffff) |
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 | #ifdef context_set |
48 | #ifdef context_set |
| 45 | #undef context_set |
49 | #undef context_set |
| 46 | #endif |
50 | #endif |
| 47 | 51 | ||
| 48 | #define context_set(c, _pc, stack, size, tls) \ |
52 | #define context_set(c, _pc, stack, size, tls) \ |
| 49 | do { \ |
53 | do { \ |
| 50 | (c)->pc = (uint64_t) _pc; \ |
54 | (c)->pc = (uint64_t) _pc; \ |
| 51 | (c)->bsp = (uint64_t) stack; \ |
55 | (c)->bsp = ((uint64_t) stack) + size / PSTHREAD_INITIAL_STACK_DIVISION; \ |
| 52 | (c)->ar_pfs &= PFM_MASK; \ |
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 | (c)->tp = (uint64_t) tls; \ |
58 | (c)->tp = (uint64_t) tls; \ |
| 55 | } while (0); |
59 | } while (0); |
| 56 | 60 | ||
| 57 | 61 | ||
| 58 | /* |
62 | /* |