Subversion Repositories HelenOS-historic

Rev

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

Rev 501 Rev 525
Line 27... Line 27...
27
 */
27
 */
28
 
28
 
29
#ifndef __sparc64_CONTEXT_H__
29
#ifndef __sparc64_CONTEXT_H__
30
#define __sparc64_CONTEXT_H__
30
#define __sparc64_CONTEXT_H__
31
 
31
 
-
 
32
#include <arch/stack.h>
-
 
33
 
32
#ifndef __sparc64_TYPES_H__
34
#ifndef __sparc64_TYPES_H__
33
# include <arch/types.h>
35
# include <arch/types.h>
34
#endif
36
#endif
35
 
37
 
36
#ifndef __ALIGN_H__
38
#ifndef __ALIGN_H__
37
# include <align.h>
39
# include <align.h>
38
#endif
40
#endif
39
 
41
 
40
/** According to SPARC Compliance Definition, every stack frame is 16-byte aligned. */
-
 
41
#define STACK_ALIGNMENT         16
-
 
42
 
-
 
43
#define STACK_ITEM_SIZE         sizeof(__u64)
-
 
44
 
-
 
45
/**
-
 
46
 * 16-extended-word save area for %i[0-7] and %l[0-7] registers.
-
 
47
 */
-
 
48
#define SAVE_AREA   (16*STACK_ITEM_SIZE)
-
 
49
#define SP_DELTA    SAVE_AREA
42
#define SP_DELTA    STACK_WINDOW_SAVE_AREA_SIZE
50
 
-
 
51
/**
-
 
52
 * By convention, the actual top of the stack is %sp + BIAS.
-
 
53
 */
-
 
54
#define BIAS        2047
-
 
55
 
43
 
56
#ifdef context_set
44
#ifdef context_set
57
#undef context_set
45
#undef context_set
58
#endif
46
#endif
59
 
47
 
60
#define context_set(c, _pc, stack, size)                                                                \
48
#define context_set(c, _pc, stack, size)                                                                \
61
        (c)->pc = ((__address) _pc) - 8;                                                                \
49
        (c)->pc = ((__address) _pc) - 8;                                                                \
62
        (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (BIAS + SP_DELTA)
50
        (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA)
63
 
51
 
64
/*
52
/*
65
 * Only save registers that must be preserved across
53
 * Only save registers that must be preserved across
66
 * function calls.
54
 * function calls.
67
 */
55
 */