~martin-decky/helenos/rcu

« back to all changes in this revision

Viewing changes to uspace/lib/c/arch/ppc32/include/fibril.h

MergeĀ mainlineĀ changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
27
 */
28
28
 
29
 
/** @addtogroup libcppc32       
 
29
/** @addtogroup libcppc32
30
30
 * @{
31
31
 */
32
32
/** @file
37
37
 
38
38
#include <sys/types.h>
39
39
 
40
 
/* We define our own context_set, because we need to set
41
 
 * the TLS pointer to the tcb+0x7000
 
40
#define SP_DELTA  16
 
41
 
 
42
/*
 
43
 * We define our own context_set, because we need to set
 
44
 * the TLS pointer to the tcb + 0x7000
42
45
 *
43
46
 * See tls_set in thread.h
44
47
 */
45
 
#define context_set(c, _pc, stack, size, ptls)                  \
46
 
        (c)->pc = (sysarg_t) (_pc);                             \
47
 
        (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA;     \
48
 
        (c)->tls = ((sysarg_t) (ptls)) + 0x7000 + sizeof(tcb_t);
49
 
 
50
 
#define SP_DELTA        16
 
48
#define context_set(c, _pc, stack, size, ptls) \
 
49
        do { \
 
50
                (c)->pc = (sysarg_t) (_pc); \
 
51
                (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
 
52
                (c)->tls = ((sysarg_t) (ptls)) + 0x7000 + sizeof(tcb_t); \
 
53
        } while (0)
51
54
 
52
55
typedef struct {
53
56
        uint32_t sp;