Subversion Repositories HelenOS

Rev

Rev 1976 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1976 Rev 2025
Line 43... Line 43...
43
 
43
 
44
#ifdef context_set
44
#ifdef context_set
45
#undef context_set
45
#undef context_set
46
#endif
46
#endif
47
 
47
 
48
#define context_set(c, _pc, stack, size)                                \
48
#define context_set(c, _pc, stack, size)            \
49
    (c)->pc = ((uintptr_t) _pc) - 8;                                \
49
    (c)->pc = ((uintptr_t) _pc) - 8;            \
50
    (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size), STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA);    \
50
    (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size),    \
-
 
51
        STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA); \
51
    (c)->fp = -STACK_BIAS
52
    (c)->fp = -STACK_BIAS
52
   
53
   
53
 
54
 
54
/*
55
/*
55
 * Only save registers that must be preserved across
56
 * Save only registers that must be preserved across
56
 * function calls.
57
 * function calls.
57
 */
58
 */
58
struct context {
59
struct context {
59
    uintptr_t sp;       /* %o6 */
60
    uintptr_t sp;       /* %o6 */
60
    uintptr_t pc;       /* %o7 */
61
    uintptr_t pc;       /* %o7 */