dol: initial dol commit
[jump.git] / dol / src / dol / visitor / cell / lib / dol.h
1 #ifndef __DOL_H__
2 #define __DOL_H__
3
4 // structure for local memory of process
5 typedef struct _local_states *LocalState;
6
7 // structure for process
8 struct _process;
9
10 // standard functions
11 typedef void (*ProcessInit)(struct _process*);
12 typedef int (*ProcessFire)(struct _process*);
13 typedef void *WPTR;
14
15 typedef struct _process {
16     LocalState     local;
17     ProcessInit    init;
18     ProcessFire    fire;
19     WPTR           wptr;
20 } DOLProcess;
21
22 void DOL_read(void *port, void *buf, int len, DOLProcess *process);
23 void DOL_write(void *port, void *buf, int len, DOLProcess *process);
24
25 unsigned DOL_reserve(void* port, void** destination, unsigned len, DOLProcess* process); 
26 void DOL_release(void* port, DOLProcess* process); 
27 unsigned DOL_capture(void* port, void** destination, unsigned len, DOLProcess* process);  
28 void DOL_consume(void* port, DOLProcess* process); 
29  
30 void DOL_detach(DOLProcess *process);
31 int getIndex(const char* string, char* tokens, int indexNumber); 
32 int *createPort(int *port, int base, int number_of_indices, int index_range_pairs, ...); 
33
34 #endif