Rev 1123 | Rev 1657 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1123 | Rev 1129 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | #ifndef __LIBC__mips32PSTHREAD_H__ |
29 | #ifndef __LIBC__mips32PSTHREAD_H__ |
30 | #define __LIBC__mips32PSTHREAD_H__ |
30 | #define __LIBC__mips32PSTHREAD_H__ |
31 | 31 | ||
32 | #include <types.h> |
32 | #include <types.h> |
33 | 33 | ||
- | 34 | /* We define our own context_set, because we need to set |
|
- | 35 | * the TLS pointer to the tcb+0x7000 |
|
- | 36 | * |
|
- | 37 | * See tls_set in thread.h |
|
- | 38 | */ |
|
- | 39 | #define context_set(c, _pc, stack, size, ptls) \ |
|
- | 40 | (c)->pc = (sysarg_t) (_pc); \ |
|
- | 41 | (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ |
|
- | 42 | (c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t); |
|
- | 43 | ||
- | 44 | ||
34 | /* +16 is just for sure that the called function |
45 | /* +16 is just for sure that the called function |
35 | * have space to store it's arguments |
46 | * have space to store it's arguments |
36 | */ |
47 | */ |
37 | #define SP_DELTA (8+16) |
48 | #define SP_DELTA (8+16) |
38 | 49 |