Mercurial > repos > rhope
comparison runtime/context.h @ 139:a68e6828d896
Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 19 Nov 2010 04:04:14 -0500 |
parents | d1569087348f |
children | c14698c512f1 |
comparison
equal
deleted
inserted
replaced
138:1411de6050e1 | 139:a68e6828d896 |
---|---|
2 #define _CONTEXT_H_ | 2 #define _CONTEXT_H_ |
3 | 3 |
4 #include "thread.h" | 4 #include "thread.h" |
5 #include "plat_types.h" | 5 #include "plat_types.h" |
6 #include "func.h" | 6 #include "func.h" |
7 #include "transaction.h" | |
7 | 8 |
8 #define STACK_CHUNK_SIZE 4096-(sizeof(struct stackchunk *)*2+sizeof(char *)) | 9 #define STACK_CHUNK_SIZE 4096-(sizeof(struct stackchunk *)*2+sizeof(char *)) |
9 | 10 |
10 typedef struct stackchunk { | 11 typedef struct stackchunk { |
11 struct stackchunk * next; | 12 struct stackchunk * next; |
15 } stackchunk; | 16 } stackchunk; |
16 | 17 |
17 typedef struct context { | 18 typedef struct context { |
18 stackchunk *stack_begin; | 19 stackchunk *stack_begin; |
19 stackchunk *current_stack; | 20 stackchunk *current_stack; |
21 transaction *transaction; | |
20 } context; | 22 } context; |
21 | 23 |
22 stackchunk * new_stack(); | 24 stackchunk * new_stack(); |
23 context * new_context(); | 25 context * new_context(); |
24 void * alloc_stack(context * ct, uint32_t size); | 26 void * alloc_stack(context * ct, uint32_t size); |