Subversion Repositories HelenOS

Rev

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

Rev 426 Rev 427
Line 35... Line 35...
35
 
35
 
36
#ifndef __ALIGN_H__
36
#ifndef __ALIGN_H__
37
# include <align.h>
37
# include <align.h>
38
#endif
38
#endif
39
 
39
 
-
 
40
/** According to SPARC Compliance Definition, every stack frame is 16-byte aligned. */
40
#define STACK_ALIGNMENT         8
41
#define STACK_ALIGNMENT         16
41
#define STACK_ITEM_SIZE         8
-
 
42
 
42
 
-
 
43
#define STACK_ITEM_SIZE         sizeof(__u64)
-
 
44
 
43
/*
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
-
 
50
 
-
 
51
/**
44
 * One item is put onto the stack to support get_stack_base().
52
 * By convention, the actual top of the stack is %sp + BIAS.
45
 */
53
 */
46
#define SP_DELTA    (0+STACK_ITEM_SIZE)
54
#define BIAS        2047
47
 
55
 
48
#ifdef context_set
56
#ifdef context_set
49
#undef context_set
57
#undef context_set
50
#endif
58
#endif
51
 
59
 
52
#define context_set(c, _pc, stack, size)                                                                \
60
#define context_set(c, _pc, stack, size)                                                                \
53
        (c)->pc = ((__address) _pc) - 8;                                                                \
61
        (c)->pc = ((__address) _pc) - 8;                                                                \
54
        (c)->sp = ((__address) stack) + (ALIGN((size), STACK_ALIGNMENT) + 1) - SP_DELTA;            
62
        (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (BIAS + SP_DELTA)
55
 
63
 
56
/*
64
/*
57
 * Only save registers that must be preserved across
65
 * Only save registers that must be preserved across
58
 * function calls.
66
 * function calls.
59
 */
67
 */