31,18 → 31,44 |
|
#include <types.h> |
|
/* We define our own context_set, because we need to set |
* the TLS pointer to the tcb+0x7000 |
* |
* See tls_set in thread.h |
*/ |
#define context_set(c, _pc, stack, size, ptls) \ |
(c)->pc = (sysarg_t) (_pc); \ |
(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ |
(c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t); |
(c)->tls = ((sysarg_t) (ptls)) + 0x7000 + sizeof(tcb_t); |
|
#define SP_DELTA (8+16) |
#define SP_DELTA 16 |
|
typedef struct { |
typedef struct { |
uint32_t sp; |
uint32_t pc; |
|
uint32_t tls; |
} context_t; |
uint32_t r13; |
uint32_t r14; |
uint32_t r15; |
uint32_t r16; |
uint32_t r17; |
uint32_t r18; |
uint32_t r19; |
uint32_t r20; |
uint32_t r21; |
uint32_t r22; |
uint32_t r23; |
uint32_t r24; |
uint32_t r25; |
uint32_t r26; |
uint32_t r27; |
uint32_t r28; |
uint32_t r29; |
uint32_t r30; |
uint32_t r31; |
|
uint32_t cr; |
} __attribute__ ((packed)) context_t; |
|
#endif |