Subversion Repositories HelenOS

Rev

Rev 354 | Rev 403 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 354 Rev 402
Line 28... Line 28...
28
 
28
 
29
#ifndef __ia64_CONTEXT_H__
29
#ifndef __ia64_CONTEXT_H__
30
#define __ia64_CONTEXT_H__
30
#define __ia64_CONTEXT_H__
31
 
31
 
32
#include <arch/types.h>
32
#include <arch/types.h>
-
 
33
#include <align.h>
33
 
34
 
34
#define STACK_ITEM_SIZE 16
35
#define STACK_ITEM_SIZE 16
-
 
36
#define STACK_ALIGNMENT 16
35
 
37
 
36
/*
38
/*
37
 * context_save() and context_restore() are both leaf procedures.
39
 * context_save() and context_restore() are both leaf procedures.
38
 * No need to allocate scratch area.
40
 * No need to allocate scratch area.
39
 *
41
 *
Line 45... Line 47...
45
#undef context_set
47
#undef context_set
46
#endif
48
#endif
47
 
49
 
48
#define context_set(c, _pc, stack, size)            \
50
#define context_set(c, _pc, stack, size)                        \
49
    (c)->pc = (__address) _pc;              \
51
    (c)->pc = (__address) _pc;                          \
50
    (c)->bsp = ((__address) stack) + (sizeof(the_t));   \
52
    (c)->bsp = ((__address) stack) + (ALIGN(sizeof(the_t), STACK_ALIGNMENT));   \
51
    (c)->sp = ((__address) stack) + (size) - SP_DELTA;
53
    (c)->sp = ((__address) stack) + (size) - SP_DELTA;
52
 
54
 
53
/*
55
/*
54
 * Only save registers that must be preserved across
56
 * Only save registers that must be preserved across
55
 * function calls.
57
 * function calls.