29,6 → 29,8 |
#ifndef __sparc64_CONTEXT_H__ |
#define __sparc64_CONTEXT_H__ |
|
#include <arch/stack.h> |
|
#ifndef __sparc64_TYPES_H__ |
# include <arch/types.h> |
#endif |
37,22 → 39,8 |
# include <align.h> |
#endif |
|
/** According to SPARC Compliance Definition, every stack frame is 16-byte aligned. */ |
#define STACK_ALIGNMENT 16 |
#define SP_DELTA STACK_WINDOW_SAVE_AREA_SIZE |
|
#define STACK_ITEM_SIZE sizeof(__u64) |
|
/** |
* 16-extended-word save area for %i[0-7] and %l[0-7] registers. |
*/ |
#define SAVE_AREA (16*STACK_ITEM_SIZE) |
#define SP_DELTA SAVE_AREA |
|
/** |
* By convention, the actual top of the stack is %sp + BIAS. |
*/ |
#define BIAS 2047 |
|
#ifdef context_set |
#undef context_set |
#endif |
59,7 → 47,7 |
|
#define context_set(c, _pc, stack, size) \ |
(c)->pc = ((__address) _pc) - 8; \ |
(c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (BIAS + SP_DELTA) |
(c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA) |
|
/* |
* Only save registers that must be preserved across |