Rev 534 | Rev 919 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 534 | Rev 564 | ||
|---|---|---|---|
| Line 38... | Line 38... | ||
| 38 | * context_save() and context_restore() are both leaf procedures. |
38 | * context_save() and context_restore() are both leaf procedures. |
| 39 | * No need to allocate scratch area. |
39 | * No need to allocate scratch area. |
| 40 | * |
40 | * |
| 41 | * One item is put onto the stack to support get_stack_base(). |
41 | * One item is put onto the stack to support get_stack_base(). |
| 42 | */ |
42 | */ |
| 43 | #define SP_DELTA (0+ALIGN(STACK_ITEM_SIZE, STACK_ALIGNMENT)) |
43 | #define SP_DELTA (0+ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) |
| 44 | 44 | ||
| 45 | #define PFM_MASK (~0x3fffffffff) |
45 | #define PFM_MASK (~0x3fffffffff) |
| 46 | 46 | ||
| 47 | #ifdef context_set |
47 | #ifdef context_set |
| 48 | #undef context_set |
48 | #undef context_set |
| 49 | #endif |
49 | #endif |
| 50 | 50 | ||
| 51 | #define context_set(c, _pc, stack, size) \ |
51 | #define context_set(c, _pc, stack, size) \ |
| 52 | (c)->pc = (__address) _pc; \ |
52 | (c)->pc = (__address) _pc; \ |
| 53 | (c)->bsp = ((__address) stack) + ALIGN(sizeof(the_t), REGISTER_STACK_ALIGNMENT); \ |
53 | (c)->bsp = ((__address) stack) + ALIGN_UP(sizeof(the_t), REGISTER_STACK_ALIGNMENT); \ |
| 54 | (c)->ar_pfs &= PFM_MASK; \ |
54 | (c)->ar_pfs &= PFM_MASK; \ |
| 55 | (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - SP_DELTA; |
55 | (c)->sp = ((__address) stack) + ALIGN_UP((size), STACK_ALIGNMENT) - SP_DELTA; |
| 56 | 56 | ||
| 57 | /* |
57 | /* |
| 58 | * Only save registers that must be preserved across |
58 | * Only save registers that must be preserved across |
| 59 | * function calls. |
59 | * function calls. |
| 60 | */ |
60 | */ |