Subversion Repositories HelenOS

Rev

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

Rev 2334 Rev 2346
Line 36... Line 36...
36
#ifndef LIBC_arm32_PSTHREAD_H_
36
#ifndef LIBC_arm32_PSTHREAD_H_
37
#define LIBC_arm32_PSTHREAD_H_
37
#define LIBC_arm32_PSTHREAD_H_
38
 
38
 
39
#include <types.h>
39
#include <types.h>
40
#include <align.h>
40
#include <align.h>
-
 
41
#include "thread.h"
-
 
42
 
41
#define STACK_ITEM_SIZE     4
43
#define STACK_ITEM_SIZE     4
42
 
44
 
43
/** see <a href="http://www.arm.com/support/faqdev/14269.html">ABI</a> for details */
45
/** see <a href="http://www.arm.com/support/faqdev/14269.html">ABI</a> for details */
44
#define STACK_ALIGNMENT     8
46
#define STACK_ALIGNMENT     8
45
 
47
 
46
#define SP_DELTA    (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
48
#define SP_DELTA    (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
47
 
49
 
48
#define context_set(c, _pc, stack, size, ptls)          \
50
#define context_set(c, _pc, stack, size, ptls)          \
49
    (c)->pc = (sysarg_t) (_pc);             \
51
    (c)->pc = (sysarg_t) (_pc);             \
50
    (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA;     \
52
    (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA;     \
51
        (c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t);
53
        (c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET;
52
 
54
 
53
 
55
 
54
typedef struct  {
56
typedef struct  {
55
    uint32_t sp;
57
    uint32_t sp;
56
    uint32_t pc;
58
    uint32_t pc;